I've tested this so far
StopLossMove = ((
(9 * TickSize) > Instrument.MasterInstrument.RoundToTickSize((GetCurrentBid() - stopLossOrder.StopPrice) / TickSize)) ?
(Instrument.MasterInstrument.RoundToTickSize(((GetCurrentBid() - stopLossOrder.StopPrice)) - (9 * TickSize))) :
(9 * TickSize));
StopLossMove = (((
9 * Instrument.MasterInstrument.RoundToTickSize(TickSi ze)) > Instrument.MasterInstrument.RoundToTickSize((GetCurrentBid() - stopLossOrder.StopPrice) / TickSize)) ?
(Instrument.MasterInstrument.RoundToTickSize(((GetCurrentBid() - stopLossOrder.StopPrice))- (1 * Instrument.MasterInstrument.RoundToTickSize(TickSize)))) :
(9 * Instrument.MasterInstrument.RoundToTickSize(TickSize)));
StopLossMove = (((
9 * Instrument.MasterInstrument.RoundToTickSize(TickSi ze)) > Instrument.MasterInstrument.RoundToTickSize((GetCurrentBid() - stopLossOrder.StopPrice) / Instrument.MasterInstrument.RoundToTickSize( 1* TickSize))) ?
(Instrument.MasterInstrument.RoundToTickSize(((GetCurrentBid() - stopLossOrder.StopPrice)) - (1 * Instrument.MasterInstrument.RoundToTickSize(1 * TickSize)))) :
(9 * Instrument.MasterInstrument.RoundToTickSize(TickSize)));
It is supposed to set the StopLossMove value to 1 tick less than the gap from Current Bid to StopPrice on Long orders,
if that gap is less than 9 ticks,
else use 9 ticks for StopLossMove value.
The problem is after testing the move still throws the error.
What would be wrong in this case? Thanks?
Comment