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

Trading Hours Template

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

    Trading Hours Template

    How can I manually set in the code which Trading Hours Template is used by strategy? I do not want to use Strategy Analyzer and drop-down list.

    I would like to use variable for this that this can be optimized and tested with multiple Trading Hours Template for the best fit.

    Thanks!

    #2
    Hello Jones,

    NinjaTrader does not have any supported ways to modify the primary series programmatically. This is all controlled by the chart data series or the data series in the strategy parameters when adding a script to the strategies tab of the control center.

    It is possible to add series to a script and set the trading hours template for an added series. You can use the data from that added series in the script any where in place of the primary series.

    It is not possible to dynamically add a series using variables.

    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 into 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."

    Below is a public link to the help guide on AddDataSeries().


    This is also mentioned in the help guide on Multi-Time Frame & Instruments.


    If you hardcode the additional series, you can use a switch to prevent logic from processing during the OnBarUpdates for that BarsInProgress.


    Alternatively, a BarsRequest can be used to call data out of sync.


    I'm happy to forward any feature requests you'd like our development to consider for future versions of NinjaTrader.
    Last edited by NinjaTrader_ChelseaB; 06-03-2018, 08:33 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by AveryFlynn, Today, 04:57 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Started by Max238, Today, 01:28 AM
    4 responses
    37 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by r68cervera, Today, 05:29 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by geddyisodin, Today, 05:20 AM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by timko, Today, 06:45 AM
    2 responses
    14 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X