that is weird. It doesn’t require any target order…do you have any code that you would use a target somewhere? A google search with your error comes up with nothing. Sorry
@FauxBogan I suspect the relevant code isn’t the EnterLong() block. Since EnterLong() is just a market entry, the issue is more likely to be in the code that calculates or submits the profit target after the entry signal.
That message comes from the managed profit target, not from EnterLong. When the entry fills, NinjaTrader turns whatever SetProfitTarget() currently holds into a price, and if that works out to zero or below it skips the target. It’s sporadic because the input is: typically a Price-mode target from a variable still 0 on that bar, or ATR, risk or currency math that isn’t ready yet. Search the code for SetProfitTarget, print its value just before each EnterLong, and only enter when it’s above zero. Calling SetProfitTarget right before the entry also avoids a stale value from the last trade. Happy to help further, feel free to DM me.