NULL is not a datetime.
You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, MarketInfo does not. OrderSend does not.
Don't use NULL (except for pointers where you explicitly check for it.) Use
_Symbol and _Period, that is minimalist
as possible and more efficient.
Zero is the same as PERIOD_CURRENT which means _Period.
No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[]

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
Hi there,
I have an EA that I've been trying to back test with inconsistent results using the Optimizer.
If I use the settings that come back from the Optimizer and just run a single pass I get different results.
I decided to add some logging to a file in order to try and figure it out. The first pass when using Optimization works as expected and the same as if I ran just using a single pass. However, the subequent passes are filled with non-existent or incorrect dates and times and the log balloons out. However, at the end of the subsequent pass it suddenly reverts to legitimate dates and times.
Does anyone know what might be causing this and how I would fix it?
The main function that I have writing to the log file is one that detects when a new bar has formed :