I have a simple beginner's question. I need for an indicator some input based on historical data, i.e. prior day's Low/High/Open/close. This input stays unchanged during "normal" bar updates. I can't calculate this input in Initialize() because the chart and historical data are not loaded at his time yet. I won't calculate this input in OnBarUpdate() for better performance. The history will be not changed with each tick, it makes no sense to calculate old OLHC' over and over again.
What is the guide for such situations?
At the moment I have only idea with a status variable, which is set to 1 after first (and last) calculation and once set to 1 the calculation is avoided. I don't know where this variable should be declared and with which visibility. When it will be reset? During loading of indicator for some chart?
Comment