Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Defining trading hours template in NinjaScript code for my strategy

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

    Defining trading hours template in NinjaScript code for my strategy

    Hello,

    Is there a way to define the trading hours template in my NinjaScript code for my strategy?

    When I want to apply the strategy to the instrument I have to define the trading hours every time and also each time I use the strategy in the StrategyAnalyser.

    I use the same trading hours in all of my strategies so it would be convenient to remove this step from the strategy configuration process with it being hard coded into my strategy.

    Thanks,

    Neil

    #2
    Hello Neil,

    Thank you for your post.

    There is an overload for AddDataSeries() that allows you to specify the trading hours to use, though this would only apply for a multi-series script that calls AddDataSeries():


    Ultimately, the Trading Hours selected will be based on the input series for the strategy by default unless you save a new default template. You could consider saving the default strategy template to the desired trading hours session to save you the step of manually changing the trading hours every time you use the strategy. For more information about working with strategy templates:


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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X