Announcement

Collapse
No announcement yet.

Baffled?? close("$TICK") in ES returns bad/old data.

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

  • Baffled?? close("$TICK") in ES returns bad/old data.

    Not quite sure why this is happening and it is driving me nuts!!

    Attach this simple efs to a 2m chart of the S&P mini (ES #F,2) and a 2m chart of the $TICK ($TICK,2).

    All it's supposed to do is plot the close of the current $TICK bar -- no big deal. But the close values I get back on the ES chart are wrong and do not match up with the Tick chart -- actually the data is old by two bars. Why??

    function preMain() {
    setStudyTitle("Tick");
    setDefaultBarFgColor(Color.red, 0);
    setDefaultBarThickness(2, 0);
    }

    function main(nLength) {
    var Cl = close(0,"$TICK");

    return Cl;
    }

    I tried to attach a image showing an example but couldn't figure out how... Should be easy enough to duplicate.

    Thanks!!

  • #2
    gkelly
    You need to make sure that the Time Template is set to the shorter of the trading sessions of the two symbols which in this case would be that of $TICK (ie 9:30-16:00). That will realign the plot of $TICK to that of ES.
    You may also want to see the following threads
    Getting the Value for $TICK in EFS study
    More $TICK headaches
    Also for an explanation of why this happens see this post
    Alex

    Comment


    • #3
      Alex,

      Thanks for the explanation and prompt reply. I did make sure the time templates were the same but didn't realize the $TICK had a shorter timeframe and would have a negative impact on the ES chart.

      Thanks!!

      Comment

      Working...
      X