ModifyPosition
Created at 02 Jun 2015, 13:42
ModifyPosition
02 Jun 2015, 13:42
protected override void OnPositionOpened(Position openedPosition) { position = openedPosition; if (position.TradeType == TradeType.Buy) { double? stopLoss = position.EntryPrice - StopLoss * Symbol.PipSize; double? takeProfit = position.EntryPrice + TakeProfit * Symbol.PipSize; ModifyPosition(position, stopLoss, takeProfit); } if (position.TradeType == TradeType.Sell) { double? stopLoss = position.EntryPrice + StopLoss * Symbol.PipSize; double? takeProfit = position.EntryPrice - TakeProfit * Symbol.PipSize; ModifyPosition(position, stopLoss, takeProfit); }
Basically on Stop orders the SL and TP are calculated based on the original submitted price. Now since the slippage may be absurd even 30-50 pips, I've inserted this code in order to modify SL and TP on Stop Orders.
Sometimes it doesn't work and SL and TP are not modified. is there and error or what?
Spotware
10 Jun 2015, 14:58
Dear Trader,
Could you please send us the corresponding journal records for cases when protection was not applied?
The journal tab contains detailed information about trading operations.
@Spotware