set sell pending order at SL price of buy trade
-
@alexdepa ...hi...I'm also having the same strategy like this..if you find solution for this strategy.. please share that ea
-
Hi,
like I wrote in the subject I'd like to set a sell pending order at SL price of a buy trade. Is there a way to catch the SL price of a buy trade in some way?I found this example that could do what I want but...it doesn't work, it only keeps buy at market and nothing more.
What I'm trying to do is a simple martingale system that do this:
- buy at market with TP=30 pips and SL=15pips at 0.1lots;
- set a Sell pending order at the value of the SL of the first trade with 0.2lots and TP=30pips and SL=15pips;
- if the first trade goes to TP open a new buy trade an delete the Sell pending order;
- if the first goes to SL the Sell pending order is triggered and a third Buy pending order with 0.3lots and TP=30pips and SL=15pips should be placed;
- and go on...
Many thanks,
Alessandro -
https://fxdreema.com/shared/NderHfNib
"For each Trade" should be also used, but in this particular case I think we can live without it.
I don't like hedging strategies and I don't even want to think about them, so you can play with the rest. You can catch TP events in "on Trade" or in "on Tick" to check for the count of trades/orders and reach when the count is something meaningful. Let's say that 0 trades and 1 (or more) pending orders means that the orders must be deleted.