To accomplish this I have a SetProfitTarget in the OnStateChange() under State == State.DataLoaded. I'm not sure why it's there but I saw that's where the Strategy Builder places it.
Down in the code after processing the conditions I have EnterLong(Convert.ToInt32(DefaultQuantity), "") and I also have an if statement that on each tick it will try to ExitLongStopMarket.
Either I can have the EnterLong (that uses a static SetStopLoss and a static SetProfitTarget) or the ExitLongStopMarket with no Profit Target at all. I can't have SetProfitTarget and ExitLongStopMarket together. Not sure why this is.
How can I achieve my objective? of having a trailing stop with a profit target?
Comment