cbal6:
New Member,
How can I setup an EA to Re-calculate or update only every (n_seconds). Not on a Tick basis?
Actually it's a bad idea to calculate every n second. Even in just 1 second price may change direction far far away from its latest position which is 1 second before.
int start() { while (IsStopped() == false) { //--- put the code here Sleep (1000); // sleep 1000 milliseconds or equal with 1 second RefreshRates(); // don't forget to add this so the data is updated on every loop - Thanks to WHRoeder (see below) } return (0); }
sleep(); RefreshRates();
WHRoeder:
sleep(); RefreshRates();
sleep(); RefreshRates();
You're right, I need that coffee.
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
New Member,
How can I setup an EA to Re-calculate or update only every (n_seconds). Not on a Tick basis?