• 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 sergey_z, Today, 02:56 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by samir, Today, 02:46 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by neoikon, Today, 02:24 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by XimoTrader, Today, 12:57 PM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_PatrickG  
      Started by FxInception, Today, 12:27 PM
      2 responses
      14 views
      0 likes
      Last Post FxInception  
      Working...
      X