chart11610 wrote:
I want the EA to wake up and react when the chart has moved to a new bar.
No reason to run all of this code in circles for ever waiting for a bar close and then run the logic to make EA type of decisions.
I want the EA to wake up and react when the chart has moved to a new bar.
No reason to run all of this code in circles for ever waiting for a bar close and then run the logic to make EA type of decisions.
here's how i'd do that:
int start() { static datetime lastProcessedBarTime = 0; if( Time[ 0 ] == lastProcessedBarTime ) return( 0 ); lastProcessedBarTime = Time[ 0 ]; // The following EA code will only run once for every new bar ... }
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
No reason to run all of this code in circles for ever waiting for a bar close and then run the logic to make EA type of decisions.