If applying the following code to (SPY,1) and ($SPX,1), the "day" value printed out are different for the two symbols. For SPY, the values are correct, which are "1", while for "$SPX", the day returned by getValueAbsolute("day", 0, -1, "$SPX,D") is yesterday's day (30). is this a bug of EFS or problem of data server? Same error happens to indices like $COMPQ, $NDX, etc. but not $SOX. This is weird.
One more thing, getValueAbsolute("high", 0, -11, "$SPX,D" ) returns the correct values. Therefore it seems getValueAbsolute("day", ......) is not correctly implemented. The "day" array is shifted by 1 and the more current day is missing.
-- Clearpicks
var vSymbol = null;
var vInterval = null;
function preMain() {
}
function main( ) {
var vInterval = getInterval();
if(vInterval != "1" && vInterval != "5" ) return null;
var nState = getBarState();
if ( nState == BARSTATE_ALLBARS ) {
vSymbol = getSymbol() + ",D";
}
if ( getCurrentBarIndex() == 0 ) {
var d1, d0;
d1 = getValueAbsolute("day", 0, -1, vSymbol); d1 = d1[0];
d0 = getValueAbsolute("day", 0, -1); d0 = d0[0];
debugPrintln("daily: " + d1);
debugPrintln("intraday: " + d0);
}
}
One more thing, getValueAbsolute("high", 0, -11, "$SPX,D" ) returns the correct values. Therefore it seems getValueAbsolute("day", ......) is not correctly implemented. The "day" array is shifted by 1 and the more current day is missing.
-- Clearpicks
var vSymbol = null;
var vInterval = null;
function preMain() {
}
function main( ) {
var vInterval = getInterval();
if(vInterval != "1" && vInterval != "5" ) return null;
var nState = getBarState();
if ( nState == BARSTATE_ALLBARS ) {
vSymbol = getSymbol() + ",D";
}
if ( getCurrentBarIndex() == 0 ) {
var d1, d0;
d1 = getValueAbsolute("day", 0, -1, vSymbol); d1 = d1[0];
d0 = getValueAbsolute("day", 0, -1); d0 = d0[0];
debugPrintln("daily: " + d1);
debugPrintln("intraday: " + d0);
}
}
Comment