pause EA for X min if taking SL ?

 

Hi, new in this just made my first EA on stoch and RSI  with a free EA builder, It seems to work fine on quiet market hours on 1min time frame just scalping small moves .

 

But if market start moving fast in one direction my EA will still enter the  market as my indicators will still be over or under bought so  I need to add a code to my EA for not taking several losses in a row.

anyone can help me to add a code in my EA with this idea :

 

if 1 loss taken pause  EA fox X min

if x loss taken  in x min pause  EA until manual activation + send mail alert 

 

to avoid big market move o betteer said being alerted and take manuel position :)

 

any site o reference to learn codebase will be apreciated

 

thks  

 
akinob:

Hi, new in this just made my first EA on stoch and RSI  with a free EA builder, It seems to work fine on quiet market hours on 1min time frame just scalping small moves .

 

But if market start moving fast in one direction my EA will still enter the  market as my indicators will still be over or under bought so  I need to add a code to my EA for not taking several losses in a row.

anyone can help me to add a code in my EA with this idea :

 

if 1 loss taken pause  EA fox X min

if x loss taken  in x min pause  EA until manual activation + send mail alert 

Don't Sleep() . . .  record the time and then keep returning from start() until the current time > recorded time + delay
Documentation on MQL5: Date and Time / TimeCurrent
Documentation on MQL5: Date and Time / TimeCurrent
  • www.mql5.com
Date and Time / TimeCurrent - Documentation on MQL5
 
RaptorUK:
Don't Sleep() . . .  record the time and then keep returning from start() until the current time > recorded time + delay
great but Iam really a newbie and dont program nada so If I understand the principle I dont know how to write it ... could you help . thks a lot :)
 
akinob:
great but Iam really a newbie and dont program nada so If I understand the principle I dont know how to write it ... could you help . thks a lot :)
Show us what you have tried and you will receive help.
 
akinob:
great but Iam really a newbie and dont program nada so If I understand the principle I dont know how to write it ... could you help . thks a lot :)
I'm a newbie at mql5 so just like me you will have to make the effort and learn . . .