Thanks for your post.
The signal of the indicator is likely only going to be 1 for a single bar and then 0 for many bars after.
What indicator is the input to the ColorThePlot indicator?
What bar type and bar size are you testing this on?
Are you testing on live data, playback with market replay data or Historical data on a chart or historical data in the strategy analyzer?
What is the strategies Calculate setting? (Calculate.OnBarClose, Calculate.OnEachTick, Calculate.OnPriceChange)
Your code is exiting the trade on the next bar after the entry and you can see that it is trying to exit when there is no position to exit (This was an exit order but no position exists to exit'). You may want to rethink your strategy coding so that you are only exiting when there is a position to exit. One approach to this is to check to see if you are in a market position and then exit that position rather than exiting without first seeing you are in a position.
Reference: https://ninjatrader.com/support/help...etposition.htm
Comment