Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market data replay - Trading hours - lagging indicators - console output

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

    Market data replay - Trading hours - lagging indicators - console output

    Okay, so I'm having a few issues. I've posted about this a few times and have tried to implement the suggestions, but the indicators and market replay data are confusing me.

    Question1:

    Okay so this is my current settings. See "Trading hours from tools menu.png". When I run market playback it has full futures market data hours. My strategy is based on normal equities trading hours and does not take into account any non-american or extended trading hours. However, when I set up my indicators, they all appear to be lagging because of the longer sessions that futures typically have (almost 24hrs). I don't know how to get my strategy and indicators to basically ignore all those other hours.

    If you were to visit yahoo finance and look up SPY non extended hours that's essentially how I want my charts to look. (See attached "Yahoo finance SPY screen shot.png")

    Question 2:
    Additionally, when I run strategies using market data playback, where can I see the values in my strategy? For instance, when using debugging prints. I went to NEW>NINJASCRIPT OUTPUT, but that doesn't seem to be right. Sorry, learning to use this platform is a lot. It's very powerful but has a high learning curve.
    Attached Files

    #2
    The Trading hours control the data that you and any indicators would "see". Think of it as a window that excludes anything you cannot see. So if you are looking at the MES which trades 23 hours a day but you only want to see the 8 hours of regular trading then you would use the Trading hours template "CME US Index Futures RTH" Just try that as a first step and see if indeed all you see are RTH data.

    Question 2:
    Additionally, when I run strategies using market data playback, where can I see the values in my strategy? For instance, when using debugging prints. I went to NEW>NINJASCRIPT OUTPUT, but that doesn't seem to be right. Sorry, learning to use this platform is a lot. It's very powerful but has a high learning curve.


    You are not specific about what values but if you are debugging you would be using Print Statements and those do send their output to the New>Ninjascript output window. Note that there are two tabs there so perhaps you are looking at Tab2 when you want Tab1. You can also send output to either tab. Here are a couple of links to clarify: https://ninjatrader.com/support/help...html?print.htm

    Comment


      #3
      So I don't know if you could tell but i had the trading hours set to US Equities RTH when posting. I changed it to hours you mentioned as suggested. I am still having hours outside of this window showing up on the market playback. I'm not sure if market playback is different, but for whatever reason adjusting trading hours does not seem to modify this chart in anyway.

      So on ninja script output, does it get prints when running market playback, strategy analyzer, and real time analysis? Or only certain conditions? I'm continuing to dig into it but haven't found this explicitly stated yet.

      Comment


        #4
        Hello RISKYBUSINEZZ,

        Thanks for your post.

        The Trading Hours templates contain a collection of session definitions. When a template is applied, any data outside of the times in the session definitions will be ignored. Trading Hours templates could be viewed by going to Tools > Trading Hours. Note that the 'CME US Index Futures RTH' Trading Hours template starts at 8:30AM and ends at 4:00PM Central Time Zone.

        You may also create your own custom Trading Hour Templates to suit your needs. Trading Hours apply to Historical, Market Replay/Playback, and Realtime data.

        Download Market Replay data in the Tools > Historical Data window for ES 12-22 from dates 11/01/2022 to 11/03/2022, connect to the Playback connection, open a 1-Minute chart window for ES 12-22 with the Trading Hours Data Series setting set to 'CME US Index Futures RTH', the 'Days to load' property set to 1, and the 'End date' property set to 11/01/2022. In the Playback window, set the Start Date to 11/01/2022 and the End Date to 11/03/2022 and click the Play button.

        You should see the data start populating on the chart on the 8:30AM Central Time Zone candle on 11/01/2022. You should also see that the data stops populating at 4:00PM Central Time Zone.

        I am in the Mountain Time Zone which is 1 hour behind the Central Time Zone. On my charts, the data starts populating on the chart at 7:30AM and stops populating at 3:00PM on 11/01/2022.

        See this demonstration video: https://brandonh-ninjatrader.tinytak...N18yMDQ4MTMwNg

        When Print statements are added to the script, it will print output to the NinjaScript Output window when that Print statement is called.

        If the Print statement is within a condition and you do not see the print appearing in the Output window, it could be likely that the condition to trigger the Print statement is not being reached. In this case, prints would need to be added one line above the condition to trigger that print. These prints should print out all the values used in the condition to see how they are evaluating.

        Prints can be used with any type of data (Historical, Market Replay/Playback, Realtime).

        Below is a link to a forum post that demonstrates and details how to use prints to understand behavior.

        https://ninjatrader.com/support/foru...121#post791121

        Let us know if we may assist further.​
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Perfect that worked like a charm for market playback. I'll test it on the others soon. Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          65 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          139 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X