Color Candles withot OnCalculation

 

I have written an indicator that shows the candles after the vertical line with a different color.

I use this indicator to get a backtest (the color of the candles after the vertical line is the same color as the background so that it is not shown)
The problem is that the color of the candles after the vertical line does not change when the market is closed.

Is there a way to update the color of candles on holidays without needing OnCalculate?

 

It shouldn't be that.

OnCalculate() executes at least once with all the data available . Possibly twice before a tick arrives.
 

You can access the buffer arrays from any point, in this case if you're creating or modifying the line you should change the color of them in OnChartEvent. You probably need to tell the program to get events from chart objects with a ChartSetInteger() (at least for creation and deletion).

Outside of OnCalculate you don't have access to time/price/volume arrays, you would have to use some functions for timeseries access

 
Manuel Alejandro Cercos Perez #:

You can access the buffer arrays from any point, in this case if you're creating or modifying the line you should change the color of them in OnChartEvent. You probably need to tell the program to get events from chart objects with a ChartSetInteger() (at least for creation and deletion).

Outside of OnCalculate you don't have access to time/price/volume arrays, you would have to use some functions for timeseries access

thats right

thank you