The following study code snippet works on a symbol with a day interval in version 10.6 (GetPivotsStudy is not yet implemented in version 11.4.)
var Cnt=0;
var Pivots;
var nPivots;
function preMain(){
setPriceStudy(true);
setStudyTitle("Test")
debugClear()
Pivots = new GetPivotsStudy();
}
function main() {
Cnt++;
nPivots=Pivots.getValue(GetPivotsStudy.PIVOTS);
if(nPivots!=null) {debugPrintln("Cnt: "+Cnt+" ;PIVOTS: "+nPivots);}
return;
}
When the page is saved, eSignal closed and reopened, the snippet works as expected. However if the interval is changed to say 15 minutes, page saved ,eSignal closed and reopened, the snippet produces a run time error "GetPivotsStudy is not enabled." If the snippet is reloaded it works as expected.
I do not know how to circumvent this error for intraday intervals, except to start with a daily interval and then change to a intraday interval. Any help?
var Cnt=0;
var Pivots;
var nPivots;
function preMain(){
setPriceStudy(true);
setStudyTitle("Test")
debugClear()
Pivots = new GetPivotsStudy();
}
function main() {
Cnt++;
nPivots=Pivots.getValue(GetPivotsStudy.PIVOTS);
if(nPivots!=null) {debugPrintln("Cnt: "+Cnt+" ;PIVOTS: "+nPivots);}
return;
}
When the page is saved, eSignal closed and reopened, the snippet works as expected. However if the interval is changed to say 15 minutes, page saved ,eSignal closed and reopened, the snippet produces a run time error "GetPivotsStudy is not enabled." If the snippet is reloaded it works as expected.
I do not know how to circumvent this error for intraday intervals, except to start with a daily interval and then change to a intraday interval. Any help?