Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prior Week's Candle Not Closing on Monday

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

    Prior Week's Candle Not Closing on Monday

    Concerning @GER30 cfd, trading hours 07:00 GMT to 21:00 GMT.

    My chart has a 1min (primary), a 1440min and a 1week data series applied. I load the charts up Sunday night (obviously out of trading hours for DAX). On Monday morning 07:00am, when the 1min data starts to print, the prior week's candle fails to close out meaning I can't access the data for the last weekly candle (Closes[2][0]) . Closes[2][0] still accesses what is in fact the Closes[2][1] candle as a result. The only way to get the weekly candle to close out is to reload historical data from 07:00 Monday onwards.

    Why isn't the weekly candle closing out when the minute data starts printing at 07:00am?
    Last edited by pmn100; 03-05-2018, 01:53 PM.

    #2
    Hello pmn100,

    Thank you for your post.

    While it is expected that the 1 Week bar would not return for the current week if the script was running Calcualte.OnBarClose, it is not expected that reloading the historical data would update it.

    Can you provide the script you are using to test this on your end?

    You can export your indicator by going to Tools > Export > NinjaScript Add On > Add > select your indicator > OK > Export > name the file 'NTsupport' > Save.

    The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

    I look forward to your response.

    Comment


      #3
      Hello Patrick

      To make it clear I am running the strategy with OnBarClose, and its the last weekly bar that isn't closing, not the current weekly bar. I know the current weekly bar isn't accessible, but the problem is when the current weekly bar starts printing as the realtime data starts at 07:00 Monday, the prior weekly bar isn't closing.

      So as an example today. The weekly bar ending 2nd March failed to close out this morning, even though a new weekly bar for this week had started printing. So where my strategies are accessing for example, Closes[2][0] (the weekly candle close of 2nd March), they are in fact still accessing Closes[2][1] (week ending 23rd March).

      When I reload historical data, last weeks weekly bar must close out properly because my strategies start accessing it correctly.

      Comment


        #4
        Hello pmn100,

        Thank you for your response.

        This behavior is not expected and I was unable to replicate on my end with Market Replay.

        Do you have a test script that you are using for this? Attached is my script that I used to test this.

        I look forward to your response.
        Attached Files
        Last edited by NinjaTrader_PatrickH; 03-06-2018, 03:56 PM.

        Comment


          #5
          Hello Patrick

          There won't be a problem now because you're pulling historical data for the week in progress. I have included a script. I'll be running this Sunday night on the @ger30 cfd, FXCM connection. Could you do the same? Its essential you start the script running prior to the market opening at 7am GMT Monday.

          When the market opens after 7am I suspect the print of the last weekly candle close will still be the prior to last weekly candle close. I also suspect the same thing will happen with the daily candle because I run into this issue before with the Day 1 series and switched to 1440minute candles to solve it. But I don't see a way to make weekly candles out of minute data to fix this.
          Attached Files

          Comment


            #6
            Hello pmn100,

            Thank you for your response.

            Market Replay data should playback like real-time however I am unable to reproduce with several different attempts so I will run this on Sunday into Monday at 7 am GMT.

            Comment


              #7
              Hello pmn100,

              Thank you for your patience.

              I was unable to reproduce this on my end with your strategy and my test indicator. Can you detail who you connect to for the CFD data? Can you also detail what version of NinjaTrader 8 you are using? You can find this under Help > About in the NinjaTrader Control Center.

              I look forward to your response.
              Last edited by NinjaTrader_PatrickH; 03-13-2018, 12:39 PM.

              Comment


                #8
                Hello Patrick

                I couldn't reproduce the issue this week either. I got the correct weekly close when the first 1min bar of the new week session started ticking. Its possible it was a one off for some reason, I will pay attention to this again next week. In answer to your questions though, I use FXCM and NT 8.0.12.0. Thanks for testing it anyway.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by terofs, Yesterday, 04:18 PM
                1 response
                21 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by CommonWhale, Today, 09:55 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by Gerik, Today, 09:40 AM
                2 responses
                7 views
                0 likes
                Last Post Gerik
                by Gerik
                 
                Started by RookieTrader, Today, 09:37 AM
                2 responses
                12 views
                0 likes
                Last Post RookieTrader  
                Started by alifarahani, Today, 09:40 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X