Create Martingale effect without closing trades
-
Hi,
I want to create an EA which opens additional positions 1.2x larger than the previous ones each time price moves against me by a certain number of pips, however the martingale system in fXDreema requires the losing trade to be stopped out before it opens the next trade.
Does anyone know a way of keeping the losing trades open whilst still applying the new trades? I would also want to trail the TP on all existing positions so that they all close at the same time should price move a certain number of pips in my favour.
-
You're right about how the martingala is designed on fxDreema. The way to do what you want to do is craeting several variables in which all relevant information is stored. Ther is not one 'supereasy' way to do it if this is what you are asking for. But it's not difficult either :).
Do you have any initial project to begin with?
-
Hola, visita la página ferrodbot.com para que conozcas un robot que trabaja cómo tu dices.
-
@l-andorrà I thought as much, can it be done using a loop? This is what I have so far:
-
@yoander4503 Sorry - I'm not looking to buy anything
-
@specialfx Firstly I recommend you to specify candle ID 1 for both operands on blocks 3 and 5. Now they are set to pass on candle ID 0 so weird results can be obtained.
Now let me understand a bit more of your strategy. Won't you use any SL? Will you just modify the TP?
-
@l-andorrà Good advice on the candle ID - and yes the plan is to just continually modify take profits and open extra trades to compensate for the drawdown. Do you suggest an alternarive method?
-
@specialfx you could use sequence on loss http://icecream.me/49eee10f0db5239289181f16b76ff0af . I find it works well with no trade nearby.
-
@hadees How does this sequence work? What is the logic?
-
@specialfx said in Create Martingale effect without closing trades:
Hi,
I want to create an EA which opens additional positions 1.2x larger than the previous ones each time price moves against me by a certain number of pips, however the martingale system in fXDreema requires the losing trade to be stopped out before it opens the next trade.
Does anyone know a way of keeping the losing trades open whilst still applying the new trades? I would also want to trail the TP on all existing positions so that they all close at the same time should price move a certain number of pips in my favour.
Hi! Something like this? https://fxdreema.com/shared/PQwexnIge

-
Hi - some interesting work here, thank you. However I'm seeking to trail TP not SL - I don't want it to use any SL at all.
I'd also be looking to trigger sells once price crosses above the 21 EMA, and buys once price crosses below the 21 EMA - I presume I would do this by entering this condition block between 12 and 13 in your example?
-
@ambrogio
S
SpecialFX about a minute agoHi - some interesting work here, thank you. However I'm seeking to trail TP not SL - I don't want it to use any SL at all.
I'd also be looking to trigger sells once price crosses above the 21 EMA, and buys once price crosses below the 21 EMA - I presume I would do this by entering this condition block between 12 and 13 in your example?
-
I now have this:
https://fxdreema.com/shared/haAHOX4Jb
However when I try to test the EA I get this error:

I think I may have set up the variable wrong, can anyone advise on this?

-
@specialfx
Single is not a valid data type.
Try Double for decimal numbers,
Int for integer numbers -
@roar Thx!
-
Variable is now as follows:

However EA still does not load in tester:
-
https://fxdreema.com/shared/K7mu5Qiyd- You ticked the boxes next to lots. You can test your project for errors in fxdreema by pressing the ex4 button and it will list the thing that it is causing the error.
-
@hadees Thank you! Learning every day on here lol.
Now the EA loads, but seems it's not profitable. I'm pursuing this because a friend of mine produced something similar which appears to be consitantly profitable, but he won't share the code :S
Do you think I'm chasing a dead end here and his EA will eventually crash?
-
@specialfx martingale can work but you must optimise the sequence and range for each pair. I'm trying to find extreme overbought and oversold conditions and start betting then but its hard to find when price is at those points as it can stay overbought and oversold . i recently lost a chunk of money trading martingale manually so probably not best person to ask
even though the entries were decent i overleverged my position and got spiked out of my trades. -
@hadees The model I'm pursuing wouldn't close a negative trade unless it also closes a larger, positive trade, mitigating loss. However when I run backtests it doesn't seem like this is happening, so I think I've messed up somewhere in the build :S