Edit Your Comment
Sleep after loosing trade
Nov 09, 2015 at 07:13
Medlem sedan Jan 09, 2015
7 inlägg
Hi Everyone. I'm trying to make something to add to my EA that means after it closes a trade at a loss the EA "sleeps" for X amount of time but I'm stuck on how to do it.
Is there any way to record balance say every hour then current balance can be compared to that for example?
Is there any way to record balance say every hour then current balance can be compared to that for example?
Medlem sedan Nov 21, 2011
1601 inlägg
Nov 09, 2015 at 10:24
Medlem sedan Nov 21, 2011
1601 inlägg
Hi,
Simply check at the trade history.
If last order closed < 0, then don't open new trades until timecurrent() > LastOrderclosedtime()+X
Simply check at the trade history.
If last order closed < 0, then don't open new trades until timecurrent() > LastOrderclosedtime()+X
Nov 10, 2015 at 11:48
Medlem sedan Sep 06, 2011
30 inlägg
Like CrazyTrader said you need to check trade history first. And to sleep for X times, you only need to start a timer that will set a flag.
Nov 11, 2015 at 13:14
Medlem sedan Jan 09, 2015
7 inlägg
Nice, thanks guys. I knew there would be a way to do it but I was getting all crossed up!

forex_trader_29148
Medlem sedan Feb 11, 2011
1768 inlägg
Nov 11, 2015 at 17:01
Medlem sedan Feb 11, 2011
1768 inlägg
TomS91 posted:
Hi Everyone. I'm trying to make something to add to my EA that means after it closes a trade at a loss the EA "sleeps" for X amount of time but I'm stuck on how to do it.
Is there any way to record balance say every hour then current balance can be compared to that for example?
you can modify it in order to open only .01 lot the next trade..

*Kommersiell användning och skräppost tolereras inte och kan leda till att kontot avslutas.
Tips: Om du lägger upp en bild/youtube-adress bäddas den automatiskt in i ditt inlägg!
Tips: Skriv @-tecknet för att automatiskt komplettera ett användarnamn som deltar i den här diskussionen.