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 traderqz, Today, 12:06 AM
      2 responses
      4 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by RideMe, 04-07-2024, 04:54 PM
      5 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by f.saeidi, Today, 08:13 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by DavidHP, Today, 07:56 AM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by kujista, Today, 06:23 AM
      3 responses
      11 views
      0 likes
      Last Post kujista
      by kujista
       
      Working...
      X