If the time template is set to load explicitly specified number of daily bars, if it is the first time to open the daily chart of that symbol, although the 300 bars would appear on chart almost immediately, the efs would mysteriously in "loading data..." status for quite a few seconds (e.g. 12 seconds).
The following test script can be applied on a $SPX,D chart and set the time template to 300 days for daily chart, then change the symbol to "ZN #F,D" or "CL #F", and observe the significant time gap between candlestick bars drawing on chart and the printout in output window.
function preMain()
{
setStudyTitle("TestDailyChart");
setPriceStudy(true);
}
function main()
{
var barState = getBarState();
if ( barState == BARSTATE_NEWBAR ) {
debugPrintln(getCurrentBarIndex());
}
}
The following test script can be applied on a $SPX,D chart and set the time template to 300 days for daily chart, then change the symbol to "ZN #F,D" or "CL #F", and observe the significant time gap between candlestick bars drawing on chart and the printout in output window.
function preMain()
{
setStudyTitle("TestDailyChart");
setPriceStudy(true);
}
function main()
{
var barState = getBarState();
if ( barState == BARSTATE_NEWBAR ) {
debugPrintln(getCurrentBarIndex());
}
}
Comment