This is what I am looking to do:
/***** Pseudocode below ***
double profitTarget = 8; // Ticks
double stopLoss = 8 // Ticks
Lets say I buy S&P Eminis for a 1000
I would like to immediately put out a stopOrder for 1000 - 8 ticks = 998
I believe I can do this in OnExecution( )
SetStopLoss
However when my PNL = 1000 + (profitTarget )8 ticks = 1002, I would want to cancel the StopLoss Order and generate a Trailing Stop Loss (trailing stop loss order by 8 ticks)
I do not want to start trailing right away because, the i want to allow 8 ticks of downside in the beginning and only after the simulated profit target is reached, I want to start trailing.
Given the fact that there are no references returned for stoploss orders, how do i cancel the stop loss order and send a trailing

Comment