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

Want to test Chart Bar Type... How?

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

    Want to test Chart Bar Type... How?

    I have an indicator that adds 2 additional bar periods as follows...

    Add(PeriodType.Range, 12);
    Add(PeriodType.Range, 24);

    I now want to adapt this for a tick chart. How do I test to see what the PeriodType is?

    (couldn't find anything in the help)

    Thanks,
    Saroj

    #2
    Hi saroj,

    You can add tick series using Add(PeriodType.Tick, 1000);

    You can identify the interval type of a chart using BarsPeriod.Id, but this property should not be accessed in Initialize, where you need to add series.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      thanks ryanM... yes I saw that but don't see how to construct the test...

      so if I have to Add the bars in the initialize section, but not allowed to test for what's on the chart there... how do I construct the "Add" statement so that it only adds tick bars to a tick chart and minute to a minute, etc.?

      Comment


        #4
        Right - the primary series is not available at the time the script needs to add. We only support hard coding additional series.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          can I use an enum definition for the user to select a bar type and then do a conditional on the "Add" statements or is that not available in the Initialize section?

          Comment


            #6
            We support only hard coding any additional series, but some users reports success with inputs and an enum may work as well. You're free to try but will be on your own to verify everything works as you expect and resolve any potential issues.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Ryan, if I want to try this what is the correct way to test the BarsPeriod.Id value?

              I doubt the following is correct, but just to show you what I'm trying to do.

              if (BarsPeriod.Id == "Range") Add(PeriodType.Range, addBarPeriod1);

              Comment


                #8
                saroj,

                Unfortunately we would not be able to offer any advice on this. However we will leave this thread open for other users to comment.
                MatthewNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by mkouitra, 10-23-2021, 04:40 PM
                17 responses
                1,959 views
                0 likes
                Last Post NinjaTrader_Jason  
                Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
                4 responses
                27 views
                0 likes
                Last Post Vietanhnguyen2hotmailcom  
                Started by PhillT, 04-19-2024, 02:16 PM
                4 responses
                36 views
                0 likes
                Last Post PhillT
                by PhillT
                 
                Started by ageeholdings, 05-01-2024, 05:22 AM
                5 responses
                38 views
                0 likes
                Last Post ageeholdings  
                Started by reynoldsn, Yesterday, 02:34 PM
                0 responses
                15 views
                0 likes
                Last Post reynoldsn  
                Working...
                X