Is this a bug of StopLoss setting when using PlaceStopOrderAsync()
Created at 23 Jun 2016, 10:46
Is this a bug of StopLoss setting when using PlaceStopOrderAsync()
23 Jun 2016, 10:46
I use the following statement to place stop order with stoploss:
PlaceStopOrderAsync(TradeType.Buy, Symbol, volume, openPrice, Lable, 5.5, takeProfitPips, Server.Time.AddHours(OrderExpireHour), Comment);
You can see I hardcoded 5.5 pips stoploss in the code. But when I run backtest, the stoploss is never 5.5pips, sometime is 5.0, sometimes is 6.0. Like the snapshot below.
Is this a bug? Or I did something wrong when I call PlaceStopOrderAsync()?
Thanks!
whis.gg
23 Jun 2016, 12:47
It's not a bug, stop loss and take profit haven't supported decimal places, so it always rounds to whole number. However, there is a workaround - see the sample code below.
@whis.gg