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

Weekend data not triggering on secondary time series

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

    Weekend data not triggering on secondary time series

    I am trying to write a multipe time series strategy. Unfortunately, the secondary time series does not seem to trigger OnBarUpdate after midnight between Friday and Saturday until midnight between Sunday and Monday.

    The primary bar series does not have this problem.

    Setting the strategy's ExcludeWeekend property to false has no effect.

    Is this expected behavior? Am I missing a setting or property?

    #2
    We will look into that and let you know

    Comment


      #3
      To clarify:
      - this is a realtime issue and not a backtest issue?
      - you are on latest NT6R4?

      Thanks

      Comment


        #4
        I have not tested it in realtime yet.

        So far I have only observed it on the historical data when I put it on the chart.

        The strategy I am developing relies on indicator values calculated on a secondary time series. However, since indicator values are not being calculated for any data after midnight Friday night, the indicator values are completely off for a large part of the following Monday.

        And no, it is not related to the indicator in question. Any code (such as drawing methods) executed on bar updates for that particular bar series does not execute after midnight.

        Essentially it looks like the ExcludeWeekend property for some reason is being set to true for that bar series.

        FYI, I am using version 6.0.1000.4.

        Comment


          #5
          I just implemented attached sample strategy which did not exhibit any problem. (primary=$EURUSD, secondary=$EURJPY, both currencies are traded on sunday).

          - please make sure you really have data for the secondary series over on weekend
          - to be save I suggest running further tests on latest custom build which you can download here:

          (note: you need to uninstall NT6 before)
          - I suggest taking my sample strategy, adding/changing code step by step and see where your logic breaks
          Attached Files

          Comment


            #6
            Thanks, Dierk. I will give it a look Monday morning.

            BTW, my strategy is running on two time series on the same instrument, not multiple instruments if that makes a difference.

            Comment


              #7
              Tried primary=$EURUSD, secondary=$EURUSD. Same positive result.

              Comment


                #8
                Just downloaded and installed the custom build of NT and ran your sample.

                I changed the code so that the second time series is from the same instrument and the bar size is 5 minutes:

                Code:
                [FONT=Courier New][SIZE=2][COLOR=#008000]//Add("$EURJPY", PeriodType.Minute, 1);[/COLOR][/SIZE][/FONT]
                [FONT=Courier New][SIZE=2]Add(PeriodType.Minute, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);[/SIZE][/FONT]
                I put it on $EURUSD, 1 minute bars, 10 days back.

                I only get the 12:00 AM bar updates in the output window:

                Code:
                [SIZE=1]Got it: BarsInProgress=1 at 8/4/2007 12:00:00 AM[/SIZE]
                [SIZE=1]Got it: BarsInProgress=1 at 8/11/2007 12:00:00 AM[/SIZE]
                If I change the code to ouput on the primary bar series instead, I get all the output messages I would expect. So the issue is only affecting the secondary bar series.

                If I open a chart with what should be in the secondary series (that is 5 minute bars), I see everything I should see. So the data in question can be loaded.

                As I said before, it looks exactly like what you would expect to see if the secondary series was loaded with ExcludeWeekend=true.

                Circumstances that I can think of that may or may not influence what I am experiencing:

                Time zone: I am in East Asia (GMT +8:00).
                Data supplier: ESignal.

                Comment


                  #9
                  Sorry I can not reproduce. I tried this:
                  - set my PC to GMT+8 hours
                  - amended strategy as per your suggestion
                  - got a fresh DB
                  - connected to eSignal and pulled 30 days of 1 minute data for $EURUSD
                  - disconnected from eSignal
                  - opened strategy analyzer and output window
                  - run test strategy on $EURUSD with ExcludeWeekend=False

                  and got this:
                  ...
                  Got it: BarsInProgress=1 at 04.08.2007 05:30:00
                  Got it: BarsInProgress=1 at 04.08.2007 05:35:00
                  Got it: BarsInProgress=1 at 04.08.2007 05:40:00
                  Got it: BarsInProgress=1 at 04.08.2007 05:45:00
                  Got it: BarsInProgress=1 at 04.08.2007 05:50:00
                  Got it: BarsInProgress=1 at 11.08.2007 00:00:00
                  Got it: BarsInProgress=1 at 11.08.2007 00:05:00
                  Got it: BarsInProgress=1 at 11.08.2007 00:10:00
                  Got it: BarsInProgress=1 at 11.08.2007 00:15:00
                  Got it: BarsInProgress=1 at 11.08.2007 00:20:00
                  ...

                  Please double check that you have installed latest custom build as per below. It is reported as 6.0.1000.4 as the regular so just go through that procedure:
                  - uninstall NT6
                  - clear your browser cache (important!)
                  - download from here: https://www.ninjatrader-support.com/...er.Install.msi

                  Not sure it that would make a difference, but just in case...

                  Comment


                    #10
                    OK, now we are getting somewhere.

                    Until now I had not tried it with the Strategy Analyzer. If I do that it prints out all the weekend values without any problems.

                    However, if I put it on a realtime chart it does not print out the values for the historical data on the chart. That was my point.

                    When I said that I had not tried it with realtime data, I meant that I had not run it over the weekend to test if OnBarUpdate would be called on non historical data.

                    Comment


                      #11
                      We'll look into and let you know.

                      Comment


                        #12
                        Thanks for your follow up. This is a bug which will be fixed with next release.

                        Comment


                          #13
                          If anyone is developing strategies along similar principles and is affected by the same problem, I think I have come across a simple work-around until the good people at NT get their next release out

                          Simply adding the following property to your strategy and setting it to false in the Initialize method, seems to do the trick for me:

                          Code:
                          [FONT=Courier New][SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ExcludeWeekend[/SIZE][/FONT]
                          [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                          [FONT=Courier New][SIZE=2][COLOR=#0000ff]  get[/COLOR][/SIZE][/FONT]
                          [FONT=Courier New][SIZE=2]  {[/SIZE][/FONT]
                          [FONT=Courier New][SIZE=2][COLOR=#0000ff]    return [/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]base[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2].ExcludeWeekend;[/SIZE][/FONT]
                          [SIZE=2][FONT=Courier New]  }[/FONT][/SIZE]
                          [FONT=Courier New][SIZE=2][COLOR=#0000ff]  set[/COLOR][/SIZE][/FONT]
                          [FONT=Courier New][SIZE=2]  {[/SIZE][/FONT]
                          [FONT=Courier New][SIZE=2][COLOR=#0000ff]    base[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2].ExcludeWeekend = value;[/SIZE][/FONT]
                          [SIZE=2][FONT=Courier New]  }[/FONT][/SIZE]
                          [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                          I have attached a modified version of Dierk's sample strategy to demonstrate the work-around.
                          Attached Files

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by BarzTrading, Today, 07:25 AM
                          2 responses
                          14 views
                          1 like
                          Last Post BarzTrading  
                          Started by devatechnologies, 04-14-2024, 02:58 PM
                          3 responses
                          19 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by tkaboris, Today, 08:01 AM
                          0 responses
                          3 views
                          0 likes
                          Last Post tkaboris  
                          Started by EB Worx, 04-04-2023, 02:34 AM
                          7 responses
                          162 views
                          0 likes
                          Last Post VFI26
                          by VFI26
                           
                          Started by Mizzouman1, Today, 07:35 AM
                          1 response
                          10 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Working...
                          X