I have run across a seemingly simple issue but the solution eludes me. I may be missing something. Any suggestions/advice would be greatly appreciated. Thank you.
I have created a custom indicator with a fair number of arguments.
PBTD(arg1, arg2, ...). The indicator creates and draws three plots: TS, TSE, and OS. The plots DO NOT contain calculated data for every bar. CalculateOnBarClose = true for the indicator.
I add this indicator to my strategy and it plots correctly in the chart tab of the Strategy Analyzer. The CalculateOnBarClose for the strategy is set to true.
Here is the issue. When I try to access the plot TS of the indicator, I test if it contains a calculated value with PBTD().TS.ContainsValue(0). The result is always false even though the indicator and the Startegy Analyzer chart indicate that the answer should be true. Furthermore, if I try to print the values PBTD().TS[0] incorrect values are printed. The values are the Closing prices of the bar. I have also tried this using the previous bar. It seems that none of the indicator plot information is coming through to the strategy. This is very odd as the indicator seems to have been added properly to the strategy.
As an aside, is there a need to use Update() to ensure the indicator is up to date before it is used in the strategy?
Thank you.

Comment