Announcement

Collapse
No announcement yet.

Is this the expected behaviour of getValue("rawtime",##)?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is this the expected behaviour of getValue("rawtime",##)?

    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:
    9: Idx of 1st loaded bar- -683, vStartTime- 1297459260, The GMTDate is: Fri Feb 11 2011 16:21:00 GMT-0500 (Eastern Standard Time)
    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)
    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);
        }

    Wayne
    Last edited by waynecd; 02-13-2011, 09:19 AM.

  • #2
    I tried to delete the message but couldn't.

    Anyway, the issue is that the index value (vOSet) for:
    PHP Code:
    getValue("rawtime", -vOSet); 
    is reversed so index for the firs plotted bar is 1 and the last is 683. It is in reverse order of the normal bar index system.

    Wayne

    Comment

    Working...
    X