If you try to look at a bar which is outside the time interval you're backtesting
Could I possibly ask for clarification about something. Suppose you were doing a backtest on a particular time interval and you were on the very first bar of that time interval, and then your code called a function trying to look at the previous bar. Does that mean that MT5 would get data from outside the time interval of your backtest?
- Is it possible to programmatically find ALL horizontal channels/floats at a certain time interval or at least formulate the ToR correctly?
- How to code Auto Reverse Signal when AccountBalance less.
- Limit of trades per 1H interval while backtest
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
rupert65: Could I possibly ask for clarification about something. Suppose you were doing a backtest on a particular time interval and you were on the very first bar of that time interval, and then your code called a function trying to look at the previous bar. Does that mean that MT5 would get data from outside the time interval of your backtest?
Usually on the first bar of the test period, the Strategy Tester will provide access to some bars before that. I think it is somewhere in the range of 1000 bars (provided that data is actually available from the broker).
In your EA code, use the iBars() function for example, to see how many bars are available.

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