|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Question about programming AMA logic into an EA
How would I go about creating an EA using the AMA(Kaufman) that enters positions on the bar after a colored ball appears? Do I need to put the AMA logic into the EA or should I be using global variables? I have a bit of programming knowledge, however in my tests using a global variable the EA only trades in one direction.
The logic in the indicator that I think identifies whether a ball appears or not is : if ((MathAbs(ddK)) > (dK*Point) && (ddK > 0)) kAMAupsig[pos]=AMA; else kAMAupsig[pos]=0; if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0; So what I did was put " datetime AMASig = GlobalVariableSet(string "AMASig", double ddK);" into the indicator to pull out the ddK. Then, in the EA I put: if ((MathAbs(ddK)) > (dK*Point) && (ddK > 0))sig=1; if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) sig=2; Where sig 1 is a buy and sig 2 is a sell, however the problem I described above persists. The EA only trades in one direction. Thanks for any help! Pictures and indicator attached. |
|
|||
|
a good qustion me too i want to learn ea programmation
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Question... | omelette | General Discussion | 6 | 12-12-2006 02:29 AM |
| Programming question using Close[] | knili | Metatrader 4 | 7 | 08-31-2006 07:35 PM |
| Indicator Programming Question | cubesteak | Indicators - Metatrader 4 | 5 | 08-05-2006 09:25 AM |
| a question on mt4 programming | huaxia009 | Metatrader 4 | 3 | 05-31-2006 03:10 AM |