What are peoples thoughts on the best way to use an IsNewBar() type approach, during back-testing?
making decisions based on tick count is one, but using IsNewBar() based on time or Bars() just doesn't back test well at all...

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
isNewBar:
The function allows checking whether a new bar has appeared on the specified timeframe.
For the indicators and Expert Advisors it's very often necessary the information whether a new bar has appeared on the specified timeframe. Here is an example, how it can be done.
After the first call of the isNewBar() function, the current bar is not assumed as a new bar. The function saves its time, it's the current bars, the next bar will be new. The code is commented, it's easy to understand, I hope it will be useful.
Author: Prival