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

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
    Paul H.NinjaTrader Customer Service

    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.
          Paul H.NinjaTrader Customer Service

          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.
              Paul H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              41 views
              0 likes
              Last Post alifarahani  
              Working...
              X