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

Bars.Period.Id - Interval Settings Conflict

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

    Bars.Period.Id - Interval Settings Conflict

    Hello:

    When loading a chart, you have a choice of data bars: Month, Week, Day, Minute, etc.

    You also have a choice of Interval Settings: 1, 2, etc.

    However, when writing script for an indicator there is no location to put the interval setting. For example:

    if(Bars.Period.Id == PeriodType.Minute)

    I need to know the Interval Setting selected on the chart, no matter if it is 2 days, 3 weeks, etc. How can I do this?

    Thanks.

    Tony

    #2
    Bars.Period.Value
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Bars.Period.Value

      Thanks Josh!

      I notice that variables like these aren't available in the index part of Help section. Is there a location on the site where I can download the entire list to have onhand? Thanks.

      Comment


        #4
        I second that. There is so much missing in the help files.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          What is not in the Help Guide is not supported.


          You should be able to find the syntax there.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by tonyh View Post
            Hello:

            When loading a chart, you have a choice of data bars: Month, Week, Day, Minute, etc.

            You also have a choice of Interval Settings: 1, 2, etc.

            However, when writing script for an indicator there is no location to put the interval setting. For example:

            if(Bars.Period.Id == PeriodType.Minute)

            I need to know the Interval Setting selected on the chart, no matter if it is 2 days, 3 weeks, etc. How can I do this?

            Thanks.

            Tony
            Tony,

            If your looking to change the default period settings for each chart type, the source file is in the "Type" folder. I think its charttype.cs or something like that. Make sure you recompile NT if you make any changes. Please use extreme caution if you choose to do this. Make copies of any file before making changes. Also, do a backup. If things go wrong, just restore to prior configuration or copy over edited file with original.

            Also, I think the 3rd party developer app is one level up from the "Type" folder. It may be of some help.

            RJay
            Last edited by RJay; 02-03-2009, 12:47 PM.
            RJay
            NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

            Comment


              #7
              Format Data Series Window - Interval Setting - Data Series

              Hello Josh:

              After loading up a chart, and selecting my custom indicator to appear on the chart, the script must know the "Interval Setting" selected in the "Format Data Series" window. This is also known as "Data Series" at top of chart. I tried to use the Bars.Period.Value to return the "Interval Setting" selected in the Format Data Series Window or "Data Series" at top of chart. However, I found that this was not correct.

              What variable name holds the "Interval Setting" number (ex: 1 min = 1, 120 min = 120) selected in the "Format Data Series" window or shown as "Data Series" at top of chart?

              Thanks.

              Tony

              Comment


                #8
                Tony,

                It is Bars.Period.Value. You should only access this in OnBarUpdate() where the Bars actually exist.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Bars.Period.Value

                  Thanks Josh:

                  You are absolutely correct! I readjusted code to reflect this and everything is fine. Thanks.

                  Tony

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by elderan, Today, 08:03 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post elderan
                  by elderan
                   
                  Started by algospoke, Today, 06:40 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post algospoke  
                  Started by maybeimnotrader, Today, 05:46 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post maybeimnotrader  
                  Started by quantismo, Today, 05:13 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post quantismo  
                  Started by AttiM, 02-14-2024, 05:20 PM
                  8 responses
                  169 views
                  0 likes
                  Last Post jeronymite  
                  Working...
                  X