Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-timeframe strategy skips lower timeframe bars at one point

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

    Multi-timeframe strategy skips lower timeframe bars at one point

    My strategy uses 60min bars and 1min bars and on one day on GBPUSD - 2010-03-09 - it doesn't execute the 1min bars.

    I print out the OHLC on every bar to make debugging easier and I don't see any print() in the output for the 1min bars on this date.

    What should I be looking for here? What could stop the onBarUpdate event from firing?

    The only suspicious thing I see is that the price gaps down 50 points at midnight 2010-03-08.

    I tested using one of the sample strategies

    Ah, actually looking at the minute bars in the chart for the sample strategy, it shows no minute bars for 2010-03-09 until 22:16 (the forex session start) which accounts for the apparent gap on the chart, but the data is there in the HDM for the whole day from 00:01 to 00:00

    What could this be down to?

    Thanks
    Last edited by adamus; 07-02-2010, 08:57 AM.

    #2
    Hello adamus,

    The strategy will execute bars for the day starting at the time defined in your session template. What results do you get when switching this to Default 24 / 7 ?
    Attached Files
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Setting the Session Template to 24/7 sorts out the data on that date. But it is forex and it should be showing all the data for the day, just as the rest of the days have, and just as the rest of the instruments do.

      Or was there something special about 2010-03-09? Was it a holiday? Is that recorded in NT?

      Comment


        #4
        NinjaTrader does not designate Holidays. I'm not sure why 3-9-10 would work differently than other days for the same instrument and session template.

        Can you share the following and I'll test here:
        • The code you're using to print
        • Instrument applied
        • Which Data Provider you're using.
        • Time Zone
        • Session Template used
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          It's GBPUSD

          Interactive Brokers

          Timezone London / Dublin

          Session Template Forex (default for instrument)

          Code:
                          string ohlc = "O[" + Open[0].ToString(getFormat(TickSize)) + "] H[" +
                              High[0].ToString(getFormat(TickSize)) + "] L[" +
                              Low[0].ToString(getFormat(TickSize)) + "] C[" +
                              Close[0].ToString(getFormat(TickSize)) + "]";
                          Print(Time[0] + " " + ohlc);

          Comment


            #6
            adamus,

            Are you saying you don't see the data being charted at all? Or are you saying the data is being charted but just not processed?
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              The 60 mins bars (the primary timeframe) is charted and processed, but the 1 min bars aren't charted anyway. I'm looking at the chart on the strategy analyzer results.

              But the 1min bars are not processed on that day before 22:15 GMT+0 (session start) because I see my exit order on that timeframe isn't hit until 22:15 and there are no Print()s from 1 min onBarUpdates.

              Comment


                #8
                adamus,

                Please be specific as to what instruments you are using exactly. What is the primary, what is the secondary? What is the session template applied to the primary series?
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  This is on the GBP-USD forex pair. The primary bars are the 60mins, the second bars are the 1mins. The session template applied is the default selection on the Strategy property "Use instrument settings" and the instrument settings are unchanged from the installation, i.e. it is the Forex session template.

                  Comment


                    #10
                    Please test with attached strategy. It works on my end for both 60min prints and 1min prints. Tested dates: 3/3/2010 to 3/10/2010.

                    The 3/9 date printed all accurately.
                    Attached Files
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Josh, I'm unable to unzip it. Can you check it please?

                      Comment


                        #12
                        adamus,

                        You do not need to unzip it. Please import the zip file through the NT import NinjaScript utility. http://www.ninjatrader.com/support/h...nt7/import.htm
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          This is what I get:


                          BarsInProgress: 1 Time: 08/03/2010 23:55:00
                          BarsInProgress: 1 Time: 08/03/2010 23:56:00
                          BarsInProgress: 1 Time: 08/03/2010 23:57:00
                          BarsInProgress: 1 Time: 08/03/2010 23:58:00
                          BarsInProgress: 1 Time: 08/03/2010 23:59:00
                          BarsInProgress: 0 Time: 09/03/2010 00:00:00
                          BarsInProgress: 1 Time: 09/03/2010 00:00:00
                          BarsInProgress: 0 Time: 09/03/2010 01:00:00
                          BarsInProgress: 0 Time: 09/03/2010 02:00:00
                          BarsInProgress: 0 Time: 09/03/2010 03:00:00
                          BarsInProgress: 0 Time: 09/03/2010 04:00:00
                          BarsInProgress: 0 Time: 09/03/2010 05:00:00
                          BarsInProgress: 0 Time: 09/03/2010 06:00:00
                          BarsInProgress: 0 Time: 09/03/2010 07:00:00
                          BarsInProgress: 0 Time: 09/03/2010 08:00:00
                          BarsInProgress: 0 Time: 09/03/2010 09:00:00
                          BarsInProgress: 0 Time: 09/03/2010 10:00:00
                          BarsInProgress: 0 Time: 09/03/2010 11:00:00
                          BarsInProgress: 0 Time: 09/03/2010 12:00:00
                          BarsInProgress: 0 Time: 09/03/2010 13:00:00
                          BarsInProgress: 0 Time: 09/03/2010 14:00:00
                          BarsInProgress: 0 Time: 09/03/2010 15:00:00
                          BarsInProgress: 0 Time: 09/03/2010 16:00:00
                          BarsInProgress: 0 Time: 09/03/2010 17:00:00
                          BarsInProgress: 0 Time: 09/03/2010 18:00:00
                          BarsInProgress: 0 Time: 09/03/2010 19:00:00
                          BarsInProgress: 0 Time: 09/03/2010 20:00:00
                          BarsInProgress: 0 Time: 09/03/2010 21:00:00
                          BarsInProgress: 0 Time: 09/03/2010 22:00:00
                          BarsInProgress: 1 Time: 09/03/2010 22:16:00
                          BarsInProgress: 1 Time: 09/03/2010 22:17:00
                          BarsInProgress: 1 Time: 09/03/2010 22:18:00
                          BarsInProgress: 1 Time: 09/03/2010 22:19:00
                          BarsInProgress: 1 Time: 09/03/2010 22:20:00

                          Comment


                            #14
                            adamus, which datafeed would you use in this example? It seems you're missing data to me, have you tried after a fresh reload of all series used?
                            BertrandNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by rtwave, 04-12-2024, 09:30 AM
                            2 responses
                            20 views
                            0 likes
                            Last Post rtwave
                            by rtwave
                             
                            Started by tsantospinto, 04-12-2024, 07:04 PM
                            5 responses
                            68 views
                            0 likes
                            Last Post tsantospinto  
                            Started by cre8able, Today, 03:20 PM
                            0 responses
                            7 views
                            0 likes
                            Last Post cre8able  
                            Started by Fran888, 02-16-2024, 10:48 AM
                            3 responses
                            49 views
                            0 likes
                            Last Post Sam2515
                            by Sam2515
                             
                            Started by martin70, 03-24-2023, 04:58 AM
                            15 responses
                            115 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Working...
                            X