Announcement

Collapse
No announcement yet.

Add/tick

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

  • Add/tick

    Could someone please take a peek at this and see if it can be pared down to load faster?
    Also the $TICK line doesn't seem to draw accurately on a 1 or 3 minute chart when compared to the actual $TICK values, or when compared to an advanced line chart of $TICK.

    Brian


    function preMain()
    {
    setStudyTitle("ADDTICK");
    setCursorLabelName("ADNY", 0);
    setDefaultBarFgColor(Color.red,0);
    setCursorLabelName("ADNAZ", 1);
    setDefaultBarFgColor(Color.aqua,1);
    setCursorLabelName("Tick", 2);
    setDefaultBarFgColor(Color.lime,2);
    setCursorLabelName("ZERO", 3);
    setDefaultBarFgColor(Color.grey,3);
    setCursorLabelName(" ", 4);
    setDefaultBarFgColor(Color.olive,4);
    setCursorLabelName(" ", 5);
    setDefaultBarFgColor(Color.olive,5);
    setPlotType(PLOTTYPE_LINE);

    }
    function main()
    {
    var vA;
    var vD;
    var vT;
    var vZ;
    var vU;
    var vL;


    vA = getValue("Close",0,1,"$ADD");
    vD = getValue("Close",0,1,"$ADDQ");
    vT = getValue("Close",0,1,"$tick");
    vZ = 0;
    vU = 600;
    vL = -600;

    return new Array(vA[0], vD[0], vT[0],vZ, vU, vL);
    }

  • #2
    I think that efs will oad and execute fast, but you could put the var stmts in the premain section and not keep re defing them with every tick inside of main.

    Also, if you only need the end of bar values, you could add setComputeOnClose() in premain.

    Comment

    Working...
    X