• 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 geemoney, Yesterday, 04:07 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Marco  
      Started by guvenators, Yesterday, 05:18 PM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Started by LANwarr1or, Yesterday, 03:00 PM
      2 responses
      9 views
      0 likes
      Last Post LANwarr1or  
      Started by Newtrader101, Yesterday, 02:53 PM
      2 responses
      10 views
      0 likes
      Last Post Newtrader101  
      Started by JuanPabloQuevedo, Yesterday, 02:53 PM
      2 responses
      9 views
      0 likes
      Last Post JuanPabloQuevedo  
      Working...
      X