• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trading Hours Bug?

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

    Trading Hours Bug?

    Hello,

    I'm using default Trading Hours for CL which is "Nymex Metals - Energy ETH", but session template code always gives starting date from Oct 2017, even if back-testing date selected from 2011, 2012,2013,2014... Please look attached screenshot. It that a bug, or I don't understand session templates and expecting something wrong?
    Attached Files
    Last edited by login_dejavu; 02-17-2019, 11:57 AM.

    #2
    Hello login_dejavu,

    Trading hours templates are not specific to any year (except for holiday dates).

    What is the date and time of the first bar of data on the chart?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Yes, I'm aware of TradingHours which has DayOfWeek(BeginDay/EndDay) and then relative integers BeginTime/EndTime times. And from this you can create as many sessions as you want (respecting other filters like holidays,etc...).

      But in my understanding when history data loaded to chart TradingHours template is used to generate actual sessions which will be accessible by Bars.TradingHours.GetActualSessions(). It works as I'm expecting but NOT if historical data starts before Oct-2017.

      I'm attaching new screenshot which contains answer to your question.

      * And I also noticed that this starting date is kind of moving window, because yesterday was 04-Oct-17, today this date already 05-Oct-17.
      Attached Files
      Last edited by login_dejavu; 02-18-2019, 01:26 AM.

      Comment


        #4
        Hello login_dejavu,

        TradingHours.GetActualSessions() is not documented in the NinjaTrader 8 help guide and as this is an internal method we cannot guarantee its functionality.

        The proper way would be using a SessionIterator.

        Below is a link to the help guide which includes an example.
        https://ninjatrader.com/support/help...oniterator.htm

        Also, here is a link to a video of a short test demonstrating this code in the latest version of NinjaTrader 8 while connected to Continuum/CQG.
        https://drive.google.com/file/d/1mMT...w?usp=drivesdk
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok, I'll try this way, thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ballboy11, Today, 05:22 PM
          0 responses
          3 views
          0 likes
          Last Post ballboy11  
          Started by ballboy11, Today, 04:33 PM
          2 responses
          4 views
          0 likes
          Last Post ballboy11  
          Started by dedouglas, Today, 03:16 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by TradeMyth, Today, 02:45 PM
          3 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Ticnician, Today, 01:46 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Jim  
          Working...
          X