Please look at code below, I have a time based stop loss function below but it is not working properly as It only looping on on the first time only (TimeBasedSLperiodLoss1), and does not go to TimeBasedSLperiodLoss2. Any help would be highly appreciated.
- Newbie coding help
- Need a coder to take a look at an EA that is not functioning properly
- OrderDelete() Function in Loop Will Not Work. Please Help!!!!
and does not go to TimeBasedSLperiodLoss2
When it must go tp period2?
Can you please fix the above bug?
Make these variables static or declare globally.
static bool alreadyExecuted1 = false; static bool alreadyExecuted2 = false; static bool alreadyExecuted3 = false; static bool alreadyExecuted4 = false;Also, use integers when working with time.
extern int TimeBasedSLperiodLoss1 = 300; // in seconds extern int TimeBasedSLperiodLoss2 = 600; extern int TimeBasedSLperiodLoss3 = 900; extern int TimeBasedSLperiodLoss4 = 1200; int TimeBasedSL=0;
Thanks, but the above did not fix the bug. :(
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