eatrader:
I have an EA and I just want it to work on the 30M chart eventhough it is on a 1H or 5M. Or diplay it only work on a 30 M chart. This is so I do not need to keep remembering which Timeframe I use on each EA I use. How do I code this?? Thanks
I have an EA and I just want it to work on the 30M chart eventhough it is on a 1H or 5M. Or diplay it only work on a 30 M chart. This is so I do not need to keep remembering which Timeframe I use on each EA I use. How do I code this?? Thanks
EA will only work on the chart it's attached to. However, if your EA is using indicators you can code them to call their values from a time frame other than the chart they are attached to.
Example would be if your EA is on a 1H or a 5M chart you could call a moving average from a 30M time frame.
iMA(NULL,PERIOD_M30,13,0,MODE_SMMA,PRICE_CLOSE,0);
Hope this helps.
Or you can do this to avoid plotting the EA on the wrong chart
Start()
{
if(Period()!=30){Comment("Wrong time frame! M30 only");return(-1);}
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have an EA and I just want it to work on the 30M chart eventhough it is on a 1H or 5M. Or diplay it only work on a 30 M chart. This is so I do not need to keep remembering which Timeframe I use on each EA I use. How do I code this??
Thanks