Announcement

Collapse
No announcement yet.

possible getFirstBarIndexOfDay bug

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

  • possible getFirstBarIndexOfDay bug

    running the attached study on a DELL 5 min chart (starts 1st Feb 2013) and get error "line 32: Parameter Number 2 of Function getValueAbsolute is invalid".

    function preMain()
    {
    setPriceStudy(true);
    setShowTitleParameters(false);
    setShowCursorLabel(true);
    }

    function main()
    {


    if(getBarState() == BARSTATE_NEWBAR)
    {
    var symb = "SPY";
    var intv = getInterval();
    var indx = getCurrentBarIndex();
    var openraw = getValue("rawtime",indx);
    var openindx = getFirstBarIndexOfDay(openraw);
    db(openindx);
    var ssOpen = getValueAbsolute("Open", openindx, symb + "," + intv);
    var ssLast = getValueAbsolute("Close", indx, symb + "," + intv);
    }

    return null;
    }

    function db(a,b,c,d,e,f,g,h,i)
    {
    var str = "[" + String("0"+getMonth()).slice(-2) + "/" + String("0"+getDay()).slice(-2) + " " + String("0"+getHour()).slice(-2) + ":" + String("0"+getMinute()).slice(-2) + "]";
    str += ",";
    if (a != null) str += a;
    str += ",";
    if (b != null) str += b;
    str += ",";
    if (c != null) str += c;
    str += ",";
    if (d != null) str += d;
    str += ",";
    if (e != null) str += e;
    str += ",";
    if (f != null) str += f;
    str += ",";
    if (g != null) str += g;
    str += ",";
    if (h != null) str += h;
    str += ",";
    if (i != null) str += i;
    debugPrintln(str);
    return;
    }
    Attached Files
    Paul Williams
    Strategy & Applications
    www.futurenets.co.uk
Working...
X