I'm left confused. I'll try my best to provide a clear explanation.
So, I've developed an indicator. The troublesome & important parts are, that this indicator is reading values from ChartTrader elements & custom added elements. It also does provide buttons for custom functions. Both things work fine. I'm also using the TriggerCustomEvent method for pointer alignment when the buttons are pressed (I use OHLC price values inside these functions). For the most part, everything is read and triggered fine. Since I couldn't find a better solutions, I'm reading the ChartTrader values in the OnStateChange when state is dataloaded, and onbarupdate.
Now the issue happens actually at the very start when adding this indicator to the chart. If I add this indicator to a chart which doesn't update because e.g. I'm not connected, using the playback & on pause or the chart simply doesn't update that frequent, these ChartTrader values (or from custom elements) are not read inside the TriggerCustomEvent functions. To be more precise:
I used prints throughout each step and the values themselves are perfectly read and set upon adding the indicator to the chart, only inside the TriggerCustomEvent functions they are not. Not until any update to the chart happens that is.
Is there something I've misunderstood or missed about these functions? I assume that the issue is that these functions require some update to align/update their pointers. If that is the case, can I somehow force that to happen initially?
Comment