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

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.
    Kate W.NinjaTrader Customer Service

    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.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        9 responses
        122 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, 04-18-2024, 09:08 AM
        16 responses
        66 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by habeebft, Today, 01:18 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by benmarkal, Today, 12:52 PM
        2 responses
        14 views
        0 likes
        Last Post benmarkal  
        Started by f.saeidi, Today, 01:38 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X