Order line plots (open position, stoploss) stopped working for no apparent reason.
Background
- Based on NT 7
- Strategy is based on the SampleStrategyPlotOrderLines example provided.
- Strategy worked OK for a while showing open positions and trailing stops as expected
- Then the lines stop showing for no apparent reason
Debug to date
After various attempts, I put tracers in the StrategyPlot indicator (which has not been changed in anyway) and reduced the Strategy Plots to 1 (i.e. only 1 call to strategy plot) and found the following:
- Removed calls to strategy plots in onbarupdate i.e. only had the Add strategy plot in initialize:
- Get multiple tracers (appears to be one for each candle) was only expecting 1
- Added the call to strategyplot back into onbarupdate i.e.
StrategyPlot(id, color).value.set(value)- Value.set was being ignored i.e. it plotted what appeared to be Close[0] regardless of the value I provided
So it appeared that the Value[0] for both the position line and the stoploss line were identical i.e. the Value.Set statements in the calling strategy were being ignored and the lines were plotting on top of each other.
Any assistance would be greatly appreciated.
Comment