When eSignal starts up, getValueAbsolute() doesn't show correct value in the following scenario. The EFS is applied to ($SPX, 5).
getValueAbsolute("day", 0, -1, vSymbol) should show the most current day (29, which is today ), but what shown is last Friday's date ( 26 ). After reload the EFS, the result returned becomes correct.
In Format Output window, after
the starting up, it looks like
26 29
After the reload, it is shown as
29 29
26 29
var vSymbol = null;
var vInterval = null;
var done;
function preMain() {
setPriceStudy(true);
setStudyTitle("Test");
done = false;
}
function main() {
var vInterval = getInterval();
if(vInterval == null)
return null;
if(vInterval == "D")
return null;
if(vInterval == "W")
return null;
if(vInterval == "M")
return null;
if(vInterval == "T")
return null;
if(vInterval > 5)
return null;
var nState = getBarState();
if ( nState == BARSTATE_ALLBARS ) {
done = false;
}
vSymbol = getSymbol() + ",D";
if ( getCurrentBarIndex() == 0 ) {
if ( done == false ) {
var d1, d0;
d1 = getValueAbsolute("day", 0, -1, vSymbol); d1 = d1[0];
d0 = getValue("day", 0, -1, getSymbol()+","+getInterval()); d0 = d0[0];
debugPrintln(d1 + " " + d0);
done = true;
}
}
}
getValueAbsolute("day", 0, -1, vSymbol) should show the most current day (29, which is today ), but what shown is last Friday's date ( 26 ). After reload the EFS, the result returned becomes correct.
In Format Output window, after
the starting up, it looks like
26 29
After the reload, it is shown as
29 29
26 29
var vSymbol = null;
var vInterval = null;
var done;
function preMain() {
setPriceStudy(true);
setStudyTitle("Test");
done = false;
}
function main() {
var vInterval = getInterval();
if(vInterval == null)
return null;
if(vInterval == "D")
return null;
if(vInterval == "W")
return null;
if(vInterval == "M")
return null;
if(vInterval == "T")
return null;
if(vInterval > 5)
return null;
var nState = getBarState();
if ( nState == BARSTATE_ALLBARS ) {
done = false;
}
vSymbol = getSymbol() + ",D";
if ( getCurrentBarIndex() == 0 ) {
if ( done == false ) {
var d1, d0;
d1 = getValueAbsolute("day", 0, -1, vSymbol); d1 = d1[0];
d0 = getValue("day", 0, -1, getSymbol()+","+getInterval()); d0 = d0[0];
debugPrintln(d1 + " " + d0);
done = true;
}
}
}
Comment