I had mentioned several times that the indicator is working just fine.
The problem I am having is that this same code executing in a strategy starts producing incorrect results as soon as the strategy encounters live data.
When backtesting the strategy, the code produces accurate results. When the strategy is starting up but processing historical data, it produces accurate results. As soon as the first bar of live data enters the strategy, the calculations go haywire. There doesn't seem to be any logical explanation for that behavior.
At this point, I am going to modify the strategy to spit out all of the underlying data so that i can more effectively demonstrate the problem.
Comment