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

Variable input for Additional Data Source

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

    Variable input for Additional Data Source

    Looking for help with setting the Value of an additional data series with a user input

    Example: Adding additional data for: Instrument <Primary> , Type "minute", Value"1"

    I want the Value of the 1 minute to be a input variable

    Thanks

    #2
    Hello DTSSTS,

    Unfortunately, this is not supported by NinjaTrader.

    From the help guide.
    "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
    https://ninjatrader.com/support/help...dataseries.htm


    As far as creating inputs, I recommend using the Strategy Builder to create inputs and then take a look at the code that is generated in the #region properties and State.SetDefaults.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Seems this would be something that would have been requested long ago. If you want to build conditions around NQ 09-20 as your primary source of conditions and logic but wish to trade MNQ 09-20 you would have to change your code of the strategy every time there is a roll over. so if you have have hundreds of clients using strategies in this manner they all have to edit the source code of the strategy. Which might not be accessible in a vendor supply and protected script.

      Comment


        #4
        Hello DTSSTS,

        This has been previously requested and is being tracked with ID #SFT-882.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Currently, you can use null for the instrument to get the same instrument as the primary, but not for the BarsPeriod information which is not available in State.Configure, and is not allowed to be used as an input to AddDataSeries().
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Barry Milan, Today, 10:35 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,428 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Working...
        X