• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Numbering

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

    Bar Numbering

    Hi Support and Community,

    Can anyone help me to modify the BarNumber indicator (attached),the way,so it would calculates the certain set of bars.For e.g.,it starts to count from anywhere,and it counts the 10 bars set,from 1 to 10,and then starts it over,from 1 to 10 and so on?

    Thanks
    Attached Files

    #2
    Hello Cachevery,

    Thank you for your post.

    While we cannot offer custom development for scripts, I will leave this thread open for any of our other users to assist you in this matter.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hello Cachevery!

      #region Variables
      int numbar;
      ......

      protected override void OnBarUpdate()
      {

      Plot0.Set(
      0.0);
      Plot1.Set(
      2.0);

      if (Bars.FirstBarOfSession||numbar>9)
      numbar =
      1;
      else numbar =numbar+ 1;
      DrawText(
      "bnum" + CurrentBar, Convert.ToString(numbar), 0, 1.0 , Color.Black);

      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pstrusi, Today, 03:29 PM
      2 responses
      8 views
      0 likes
      Last Post pstrusi
      by pstrusi
       
      Started by ntbone, Today, 03:06 PM
      0 responses
      4 views
      0 likes
      Last Post ntbone
      by ntbone
       
      Started by AMATX, Today, 01:43 PM
      2 responses
      7 views
      0 likes
      Last Post AMATX
      by AMATX
       
      Started by razeus, Today, 12:00 PM
      4 responses
      17 views
      0 likes
      Last Post razeus
      by razeus
       
      Started by kitwit, Today, 09:47 AM
      5 responses
      24 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Working...
      X