1.4 Lifecycle

The UDI is initialised once, when it is loaded. The UDI.onInit() function is not then called again if there is a change to the chart, such as a switch to a different market or timeframe, nor is it called if there is a change to the user-defined parameters. (This behaviour is different to other platforms such as MT4 and MT5.)

If your UDI needs to react to changes in the choice of market or timeframe (beyond just recalculating all its data, which will happen anyway) then you can watch for these changes by implementing the optional functions UDI.onContextChange() and UDI.onParameterChange()

Last updated