In the following code "getValue("rawtime", -vOSet);" returns the date/time stamp of the last loaded bar (bar index 0) instead of the date/time stamp of the first bar loaded (bar index -683).
Shouldn't it return the date/time stamp of bar -683?
debug output:
Which is the date/time stamp of the last bar (index 0) instead of the date/time stamp of the first bar on the chart at index -683.
(efs was run on symbol "ES #F" on Sunday Feb 13 at 12 noon on a TimeTemplate of "Intraday Default" with 5 days,
"Start Time" = 9:30, and "End Time" = 16:30)
Wayne
Shouldn't it return the date/time stamp of bar -683?
debug output:
9: Idx of 1st loaded bar- -683, vStartTime- 1297459260, The GMTDate is: Fri Feb 11 2011 16:21:00 GMT-0500 (Eastern Standard Time)
(efs was run on symbol "ES #F" on Sunday Feb 13 at 12 noon on a TimeTemplate of "Intraday Default" with 5 days,
"Start Time" = 9:30, and "End Time" = 16:30)
PHP Code:
//returns date/time of last loaded bar,i.e. barIdx 0 maybe because rawtime of 1st bar == 0??
var bInit = false;
function main() {
var vOSet,vStartTime,GMTDateObject;
if (bInit == false) {
bInit = true;
vOSet = getOldestBarIndex();//oldest bar index of all bars loaded
vStartTime = getValue("rawtime", -vOSet); //returns date/time of last loaded bar,i.e. barIdx 0 maybe because rawtime of 1st bar == 0??
GMTDateObject = new Date(vStartTime*1000); //converts rawtime into a local time date object//used only for debug purposes
debugPrintln("9: Idx of 1st loaded bar- "+vOSet + ", vStartTime- " + vStartTime+", The GMTDate is: "+GMTDateObject);
}
}
Comment