I have some custom studies, and some built-in studies, running on advanced chart(s). I noticed that the intraday and DWM charts all plot a value for the last bar -- except when you select 60-minutes as the interval. This is because this bar technically isn't a completed bar -- right?
Here's what I'm doing -- essentially. I can't copy the entire script as it is too long.
preMain -- setComputeOnClose(false)
main
var nState = getBarState()
switch(nState)
2=Allbars (just return)
1=Currentbar(return)
0=Newbar (do the processing)
If I reload my custom scripts, they will add a final bar -- but that won't happen if you just click the intervals on the menu bar. The volume script does not add a final bar (basicVolume.efs -- from my eSignal folder) if reloaded on a 60-minute chart. All of them have a final bar if I click the daily time interval. Am I supposed to be processing one last time for the current bar also?
I checked and close(0) does return the correct close price for the last bar on a 60-minute chart.
Here's what I'm doing -- essentially. I can't copy the entire script as it is too long.
preMain -- setComputeOnClose(false)
main
var nState = getBarState()
switch(nState)
2=Allbars (just return)
1=Currentbar(return)
0=Newbar (do the processing)
If I reload my custom scripts, they will add a final bar -- but that won't happen if you just click the intervals on the menu bar. The volume script does not add a final bar (basicVolume.efs -- from my eSignal folder) if reloaded on a 60-minute chart. All of them have a final bar if I click the daily time interval. Am I supposed to be processing one last time for the current bar also?
I checked and close(0) does return the correct close price for the last bar on a 60-minute chart.
Comment