Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Accessing Custom Bar Type From Ninja Script Code

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

    Accessing Custom Bar Type From Ninja Script Code

    I want to use a custom bar type from within a ninja script program.

    The custom bar type is accessible when I create a chart in the main NT console. However, when I try to access it from within my code (using Add(PeriodType....)) there is no option to select it.

    What am I doing wrong?

    Thanks

    #2
    Hello x703jko,

    Thanks for your post.

    Please see the responses to this thread: http://ninjatrader.com/support/forum...ad.php?t=45587

    Comment


      #3
      Got. Solved the conundrum. Thanks!

      Comment


        #4
        Still not sure what to do. For a custom bar type, how do I specify the parameters required by the bar type when I use the "Add" statement in my NinjaScript code.

        Comment


          #5
          Hello x703jko,

          Thanks for your post.

          In this example: Add(PeriodType.Custom0, 1); 1 is the parameter.

          Comment


            #6
            Originally posted by NinjaTrader_Paul View Post
            Hello x703jko,

            Thanks for your post.

            In this example: Add(PeriodType.Custom0, 1); 1 is the parameter.
            How many parameters can the Add command take? I'm using a Period Type that requires three parameters.

            Comment


              #7
              Hello x703jko,

              Thanks for your reply.

              The Add statement only permits the one parameter.

              If the custom bar is the unirenko type, that custom bar type permits the 1 parameter to represent all 3 of the bar specifiers. For example Add(PeriodType.Custom5, 001019009); would pass to the unirenko bar type the parameter where 001 = step size, 019 = reversal bar size and 009 is the body size.

              I do know the bar code for the unirenko bar type does permit parsing in such a parameter. I cannot advise of other custom bar types.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              607 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              353 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              561 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X