Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      4 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Started by pechtri, 06-22-2023, 02:31 AM
      10 responses
      125 views
      0 likes
      Last Post Leeroy_Jenkins  
      Working...
      X