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 Hour Sessions | Code or Platform

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

    Trading Hour Sessions | Code or Platform

    Hello to everyone,

    NT version 8 Beta

    I am new to NT and I am migrated an existing strategy across from another platform, I have a few questions regarding the Trading Hours feature.

    Managing Trading Hours from Platform
    I noticed I can set up a template for custom sessions, if I assign the Trading hours template to a Data Series for an instrument and then assign this to a chart am I correct that the data feed stops outside trading hours and any strategy assigned to the chart will also stop trading?

    Am I correct that this will close open positions if set to true in the Order Handling group in the strategy properties?

    Will the strategy re-commence trading during trading hours?

    Managing Trading Hours With Code
    I found that I can get a list of Trading sessions from the TradingHours object by getting a template by name, I can then iterate the sessions and do a date-time compare to decide if the strategy should trade.

    If managing the trading hours through the platform is possible then what are the benefits of managing the logic through code? more control?

    Hope you can help.

    Regards,

    Paul.
    Last edited by Paul.; 01-26-2016, 01:38 AM.

    #2
    Hello Paul,

    Thanks for your post.

    Yes, if the trading hours stop, the chart, the strategy and any indicators will also stop. When the chart resumes, the strategy and indicators will resume. Please note you may face a situation where there is a significant change in the data from the end of one session to the beginning of another and that change could effect your strategy and/or indicators. This would be a significant reason why you might not want to use trading hours to control your strategy (or indicators).

    I've attached a picture of two charts running the sampleMACrossover strategy, on 1 minute charts. The chart on the right has a 15 off session period (2:45PM - 3:00 PM). Even though the price change in this example is mild, note the differences between the two charts in terms of the executions and the moving average indicators.
    Attached Files
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      That is a great answer, thank you very much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      43 views
      0 likes
      Last Post bill2023  
      Started by yertle, Today, 08:38 AM
      6 responses
      25 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Started by algospoke, Yesterday, 06:40 PM
      2 responses
      24 views
      0 likes
      Last Post algospoke  
      Started by ghoul, Today, 06:02 PM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      46 views
      0 likes
      Last Post jeronymite  
      Working...
      X