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 CarlTrading, 03-31-2026, 09:41 PM
              1 response
              152 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              87 views
              1 like
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              131 views
              2 likes
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              127 views
              1 like
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              106 views
              0 likes
              Last Post CarlTrading  
              Working...
              X