You don't instruct the EA to do anything if the condition is false and when the condition is true, it justs assigns a value to the variable ThisBarTrade
line 2 is conditional on line 1, then it will continue with the rest of the code
Your code | if (Bars != ThisBarTrade ) ThisBarTrade = Bars; : // every tick |
Equivalent | if (Bars != ThisBarTrade ) ThisBarTrade = Bars; : // every tick |
Try | : // every tick static datetime timeNow; datetime timePrev = timeNow; timeNow = Time[0]; if (timeNow != timePrev) { : // Once per bar } : // every tickDon't use bars, if new history is downloaded, Bars changes. Don't use tick volume, you can miss ticks. Always use time. See also resetting statics |
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 errors but continues to open multiple trades when stopped out during signal bar. Any help would be much appreciated.
Cheers.