Create EA for open position buy and sell at the same time with TP and SL


I’m looking for an EA to Open Position Buy and Sell at the same time

here the rules:

Open Position Buy and Sell at the same time
TP : X Pips
SL : X Pips
Lot : X

After both positions are closed the EA will wait for some minutes ( adjustable delay 0 - 20 minutes) before opening another Buy and Sell positions simultaneously.

After total X amount of total account profit is reached the EA will stop opening positions.

Who knows the code to make it please share or Who can help me create one?
Please Help Me…

I can’t answer your question directly but its interesting - you must have trialled this and worked out how to make the approach work profitably. Might encourage someone to come forward and reply if you give out what are your basic principles.

I can take a look.
It would be easier to wait in candles instead of minutes, but lets just prototype first.
I’ll try to drop something tomorrow.

One question - are the positions closed only by reaching their SL/TP? Or is there any scenario where second one is closed before reaching TP/SL?

CutMeTwice.ex4 (11.5 KB)

Please check this out and let me know, if it works as intended. Not sure about minute delay part between trades.

I am surprised how robust this strategy is :slight_smile: I’ve backtested it without any delay between trades, small position size and 30 TP / 10 SL with quite good results on EUR USD

Thanks If you could please also add max spread & slippage function.

Sure, I will drop new version once I have some free time :slight_smile: Cheers!

Guys i will explain ok.

If you open a position lets say buy 1 lot, and you decide to close that position immediately, when you press the close trade button your broker closes your position for you by entering a order of 1 lot sell, and you pay the spread.

So in the example above you buy 1 lot, close the trade ( broker sells 1 lot) you are net flat in the market payed the spread.

If you buy 1 lot and sell 1 lot at the same time, it will do the exact same thing that it did in the previous example you end up net flat in the market, but now you pay for 2 spreads.

So you are opening a trade and closing it right after and paying the spreads for nothing, its a really stupid thing to do, you pay and wont get anything from it.

You’re quite fast to call something stupid.
This is clearly a volatility strategy (check out option strategies such as straddle) - it aims at move in one of the directions (regardless which)

Take a Stop Loss = 10 pips and Take Profit = 30 pips.
Open Buy and Sell.
If the market will move > 30 pips in long - you will lose 10 pips from sell and get 30 pips from remaining buy which is hit
If the market will move < 10 pips long and then > 30 pips short - you will hit the buy stop loss (-10) and get 30 pips short …

This strategy wins if TP > 2SL AND there is a volatility. Whenever price changes directions below 30 pips - you lose 20 pips on both trades. So definitely this is not the same as closed position.
If you would like to replicate this strategy in one trade you would say “If price goes 10 pips in direction X I will open a position in this direction for 20 pips TP”. Yet the OP wanted to have two trades so I’ve dropped an EA :slight_smile: I don’t say it’s profitable in current state. Personally I would add some volatility indicator (%BB or some MA/ATR)

This is exactly why its stupid, if you can let the market run 10 pips and then open a trade with 20 pips TP and pay for only 1 SPREAD, why would someone want to open 2 positions and pay 2 SPREADS to achieve exactly the same thing.

Its like you disagree with me, but at the same time you proved that i am right. If he wants to take both directions he can place 2 pending orders 10 pips above and below current price and have a 20 pip TP and it will cost him less.