So, it appears that the indicator.OnBarUpdate() is being called twice, once to run the strategy and then again to draw the plot on the chart.
My question is whether there is a way to gain full access to the Strategy object while the plot is being created. I can envision two different ways to accomplish this:
1) Draw the plot from the instance of the indicator that was called during the execution of the strategy.
2) Make the Strategy object persist until after the plots have been drawn.
The reason that I want to do this is that I want to draw objects on the plot that are conditional on features like BarsSinceEntry() and MarketPosition so I can debug the operation of my strategy.
Would you please suggest a way to accomplish my objective and let me know whether what I described is normal behavior or I have coded something incorrectly.
Thanks,
Mark
Comment