Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set default BarsPeriodType and Value?

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

    How to set default BarsPeriodType and Value?

    How can i set defaults of Period Type and Value, so, when adding my indicator, it was by default chosen to have, i.e.:

    Week (Type)
    5 (Value)



    I tried BarsPeriod in State.SetDefaults, but it seems Null by that time..

    #2
    Hello TazoTodua,

    Thank you for your post.

    To clarify, do you want your indicator to plot based on that specific default bars period and value regardless of the Period Type and Value of the chart it's applied to?

    Or is this an indicator hosted within another indicator or strategy and you're wanting the user to be able to choose the values for those?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      just defualt indicator, and inside "State.SetDefaults" i want to set some "default" type and value of barsperiod, so, when user applies indicator on chart, and in Indicators configuration window, the default was chosen i.e. week, 5 (instead of Day, 1)

      Comment


        #4
        Hello TazoTodua,

        Thank you for your reply.

        The primary bars period type and value of a chart cannot be modifies by an indicator through supported means.

        You may be able to use unsupported code, but this would not be recommended. You might find some code from this add-on to be useful should you opt to go the unsupported route:

        Shows a button on the chart to roll the expiry to the next available contract month. Option to hide button until a number of days before or on roll date. Another option to confirm by opening the instrument overlay selector or automatically rollover without confirmation. (Update June 27th, 2019 – Added an option to show […]


        Please let us know if we may be of further assistance to you.

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X