Announcement

Collapse
No announcement yet.

RemainingBarTime.efs does nothing on my intraday charts - why ?

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

  • RemainingBarTime.efs does nothing on my intraday charts - why ?

    Yes, it's me again! ;=)

    Today i tried to use the RemainingBarTime script - but loading it unto my existing charts as well as a completely new advanced chart window gave no results.
    (1,3 and 5min charts)

    The script is loaded (name is printed below the other studies) but it is doing nothing! in fact, it is doing SOMETHING. If I activate writing to the FO-Window I can see prints there - although irregular (not a countdown second by second) and on the right side of the chart sticking to the price axis I have something painted to the chart which looks like a pipe (| <- like this).Should it work out of the box or do I miss something ?

    Im using esignal 7.7 btw. This is the script I tried to use:

    /************************************************** ***************
    Provided By : eSignal. (c) Copyright 2004
    ************************************************** ***************/

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("Remaining Bar Time");
    setShowCursorLabel(false);
    }

    var vTimeStamp = null;
    var vInt = null;

    function main() {
    if (!isIntraday() || getCurrentBarIndex() < -1) return;
    var nState = getBarState();
    var vClockTime = new Date()*1;

    if (vInt == null) vInt = (getInterval()*60000); // convert to milliseconds
    if (nState == BARSTATE_NEWBAR) {
    vTimeStamp = getValue("Time")*1 + vInt;
    }

    var vTimeLeft = (vTimeStamp - vClockTime);
    if (vTimeLeft < 0) return;

    var vHr = 0;
    var vMin = 0;
    var vSec = 0;

    if (vInt > 3600000) {
    vHr = Math.floor(vTimeLeft/3600000);
    vTimeLeft -= (vHr*3600000);
    }
    if (vInt > 60000) {
    vMin = Math.floor(vTimeLeft/60000);
    vTimeLeft -= (vMin*60000);
    }
    vSec = Math.floor(vTimeLeft/1000);

    if (vHr < 10) vHr = ("0" + vHr);
    if (vMin < 10) vMin = ("0" + vMin);
    if (vSec < 10) vSec = ("0" + vSec);

    vTimeLeft = (" " + vHr + ":" + vMin + ":" + vSec + " ");
    //debugPrintln(vTimeLeft);

    drawTextAbsolute(2, 20, vTimeLeft, Color.white, Color.navy,
    Text.BOLD|Text.LEFT|Text.FRAME|Text.RELATIVETOTOP, null, 12, "TR");

    return;
    }


    regards
    EZ-T

  • #2
    EZ-T
    Here is what appears when running the script you posted.
    Note that it will not return a second by second countdown (ie like a timer) because the efs executes only when a new tick comes in
    Alex

    Comment

    Working...
    X