I have an indicator that caculates the ratio between two instruments and use the value as a dataseries to create an oscilator. The oscilltor is ploted most of the time. But if I change to a different time frame, a different instrument, or even change the periods parameters for the oscillator will not plot and the an error is generated:
"Object reference not set to an instance of an object."
I have made sure that CurrentBar under OnBarUpdate is not < Periods but the issue persist.
I could not find any references in the forum addressing this error for plotting indicators. I have seen some references regarding correlation indicator with similar issues, but did not help.
Any chance that you could provide some info on what might be causing this error.
Many thanks.
Comment