Hi
I have code for indicator that is generally running well with FX, indices etc, it runs well with stocks but comes up with reasonably frequent calculation errors when switching between stocks. It will add the indicator to a stock without issue but not when switching between, and doesnt do it with all the chart timeframes either, but seemes indiscrimiate in what it produces the error on.
1: it doesnt do it with FX, indices etc just stocks.
So I’ve contemplated that maybe its related to the closure of the item, so I created a snippet of code to only run the calculation if the daily is open and not to run if closed, so it only calculates when the next daily is open again. This doesn’t change the indicator in any way.
In relation to the calculation (its a calculation error that comes up) it doesnt come up with any errors when using the “Timeframe (default)” only. So its related to the multi timeframe coding.
There don’t seem to be any issues in the coding, no 0 divisions that should come up… and if they did you would expect them to be repeated when re-adding the indicator, which it doesnt.
So I’m in the process of giving it some thought, but its not a complicated calculation, just involves highs and lows ..
Is there any instance of this happening before?
I’ll continue to ponder on it, not too much of anissue as using the default overcomes anything or a simply reload… Is there something about stocks i should know about in relation to basic calculations?