trades retake
-
hi guys im developing my EA now im stuck here i want my EA to have 15 pips stop loss and if stop loss hit and the moving average is not cross against the closed trade then the bot must retake the trade after the candle closed please help guys
-
Not sure if I catch what you want exactly. Could you please upload a few explanatory screenshot?
-
HI THANKS for your response here is the screenshort

-
Could you please confirm I understood it correcty?
- Full bullish bar closes above fast MA.
- At the end of that bar a buy is open at that same price with a 10 pips SL.
- Price touches SL (fast MA) but doesn't cross it below.
- New bar closes above MA.
- New trade is open at that bar close price.
Is that correct?
-
100% correct but this will happen only two times per trade which means total stop loss will be 30 pips. 1 original trade plus two retakes will give us 30 pips stop loss combined.
-
And can this combination be variable or is it fix? I mean, is always the first trade 10 pips SL, then the second another 10 pip and same for the last one or could it be 12, 12, 6, for axample?
-
it will be always 10 pips
-
Ok, now I got it. If you don't mind, I will send you a private message.
-
I imagine two ways of doing this.
The better way is on the beginning of the candle to check when the last trade was closed, and probably how, and the MA levels. In other words, at the time when a new trade is supposed to be created if the scenario you described happened, you check whether the scenario happened and you create a new trade if needed.
And the other way is to detect when SL is hit (in "on Trade"), then to write value to some Variable, or even to create some object as a form of temporary memory, and then in the beginning of the next candle (assuming you have "Once per bar" in "on Tick") to check the value of that variable and to create the new trade. In other words, you have 2 events that can happen let's say in 5 minutes apart - when the first event happens, you will write some value in some variable to mark that event and then when the second event happens you will check that variable to see whether the first event happened.
I prefer the first way, because it would work even if you restart the EA. The second way involves variable, which is just a temporary memory and exists until the EA is working.
-
thanks for respond im not good in this so if you can help with screenshorts of the blocks will be helpfull