Announcement

Collapse
No announcement yet.

Tick counter per bar?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tick counter per bar?

    .
    Last edited by billco; 09-04-2005, 04:56 PM.

  • #2
    bc
    In an EFS declare a global variable (ie outside of function main) and set it to 1 as follows

    PHP Code:
    var vCounter 1
    Then inside main add the following.

    PHP Code:
    vCounter++;
    if(
    getBarState()==BARSTATE_NEWBAR){
         
    vCounter=1;
    }
    drawTextRelative(1,1,vCounterColor.bluenullText.RELATIVETOTOP"Arial"12"counter"); 
    The vCounter++; line will increase vCounter by 1 at every tick until a new bar occurs when the BARSTATE_NEWBAR condition will reset vCounter to 1 and the cycle begins again. The drawTextRelative() command then writes the value of vCounter on your chart in the price pane if the efs is a price study or in the indicator pane if it is a non-price study
    Alex

    Comment


    • #3
      bc
      Post the efs as you have modified it and that is giving you an error and I will look it over
      Alex

      Comment

      Working...
      X