close StopOrder
Created at 17 Dec 2016, 22:03
CO
close StopOrder
17 Dec 2016, 22:03
Hello,
If a cBot places two Orders, a MarkeOrder and a StopOrder, what code can I use to close the StopOrder when the MarketOrder hits its TakeProfit = 10 pips?
Kind regards
if (_MA_cross_down && shortPosition == null) { ExecuteMarketOrder(TradeType.Sell, Symbol, Symbol.NormalizeVolume(Volume), label, StopLoss, TakeProfit); } if (_MA_cross_down && shortPosition == null) { double targetPrice = Symbol.Ask + PipsAway * Symbol.PipSize; PlaceStopOrder(TradeType.Buy, Symbol, Volume2, targetPrice, label_2, StopLoss, TakeProfit); }
Replies
collinganesh
17 Dec 2016, 23:40
Thanks Lucian. The code works perfectly.
Merry Christmas to you.
@collinganesh
... Deleted by UFO ...