I am writing my first EA (again!). I am trying to simulate an existing MT4 indicator so I can confirm my calculations are correct. So I am trying to calculate the ichi-moku calculations for Hourly and Daily in one EA and compare my results to the packaged MT4 one.
My issue issue is, when running my EA from MetaEditor, if I set Tools->Options->Debug to my currency, GBPUSD for example, and Hourly timeframe then my PERIOD_H1 calculations are correct and my PERIOD_D1 are "off". After multiple fruitless trawls for a bug I just changed the Tools->Options->Debug to GBPUSD and Daily and voila my PERIOD_D1 calculations are correct but my PERIOD_H1 calculations are now "off"
When I'm making my calculations I am calling the same piece of code (OO class function), I just change the timeframe from PERIOD_H1 to PERIOD_D1. Am i doing something wrong? This implies that to get the correct value I need to run my EA and calculations against one timeframe only _ I presume this implication is incorrect!
for example, all calculations are "timeframe generic" like below:
- Rates function problem
- My EA works in multiple time frames but data in backtest isn t working
- Running EA on several charts without interference, maybe SelectOrder()?
int val_indexHigh=iHighest(EA_CURRENCY,timeFrame,MODE_HIGH,periods,offset); if(val_indexHigh!=-1) valHigh=High[val_indexHigh];Predefined variables are the current chart only. You are mixing apples and oranges
Perfect! Thank you for replying, I'm not sure i would ever have spotted that. That should teach me not to blindly copy n pate snippets from documentation!!
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