Anil Varma:
Hello Everyone
This post is somehow related to my previous topic at https://www.mql5.com/en/forum/456103 where in following suggestion was there from @William Roeder
- Don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
I am now trying to synchronize and checkLoadHistory before running my calculations in OnTick().
The challenge is I am running it on weekend and since there is no tick, none of the PrintFormat() statement work and Class is terminated by return condition.
Is there a way to over come this and continue working with available bars in history?
Use strategy tester.
Wow such a simple solution, yeh it did worked in Strategy Tester.
Thanks a lot.
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
Hello Everyone
This post is somehow related to my previous topic at https://www.mql5.com/en/forum/456103 where in following suggestion was there from @William Roeder
I am now trying to synchronize and checkLoadHistory before running my calculations in OnTick().
The challenge is I am running it on weekend and since there is no tick, none of the PrintFormat() statement work and Class is terminated by return condition.
Is there a way to over come this and continue working with available bars in history?