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

60 minute vs hour MultiTimeframe data with IB

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

    60 minute vs hour MultiTimeframe data with IB

    I have found out that when using multitimeframe strategies, I cannot use PeriodType.Minute greater than 59 with Interactive Brokers. It seems IB doesn't provide minute data from 60 and higher. In fact you would have to use hourly data.

    Anyone found a way around this issue?

    #2
    siroki, so you would the same be seen in your charts, i.e. you create a 65 minute chart for example? Do you see any errors reported?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      That's the strange thing. I'm able to create regular charts using any interval I want (65, 93 / 128 etc etc).

      Here is the code I tested with:

      Code:
              protected override void Initialize()
              {
                  CalculateOnBarClose = true;
      							// Index = 0 (1 minute)
      	    Add(PeriodType.Minute, 5); 	// Index = 1
      	    Add(PeriodType.Minute, 15); 	// Index = 2
               }
      
              protected override void OnBarUpdate()
              {
              Print("So far so good");
               }
      Now this works fine! I get a nice "so far so good" text in my Output window. But when I change the 15 into a 60 or higher timeframe something goes wrong.

      Code:
              protected override void Initialize()
              {
                  CalculateOnBarClose = true;
      							// Index = 0 (1 minute)
      	    Add(PeriodType.Minute, 5); 	// Index = 1
      	    Add(PeriodType.Minute, 60); 	// Index = 2
               }
      
              protected override void OnBarUpdate()
              {
              Print("So far so good");
               }
      Nothing is printed now.

      Comment


        #4
        siroki, thanks. When the second test fails, do you see any log error noted?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Where can I find the error-log?

          Comment


            #6
            In your NT Control Center go to the right most tab please, this is called 'Log'.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              No, there are no error logged. Now, For some reason I am able to add a 5, 15 and 60 minute timeframe to the array. But now the Print-test fails when I want to add a fourth one, 240 minute.

              Comment


                #8
                Looks fine on my end, I tried with this setup also printing the BarsInProgress alongside, to see which bars object is calling the OnBarUpdate.

                protected override void Initialize()
                {
                CalculateOnBarClose = true;
                // Index = 0 (1 minute)
                Add(PeriodType.Minute, 5); // Index = 1
                Add(PeriodType.Minute, 60); // Index = 2
                Add(PeriodType.Minute, 240); // Index = 3
                }

                protected override void OnBarUpdate()
                {
                Print(BarsInProgress + " So far so good");
                }

                Do you run on latest NT7R21 and IB TWS 938.1?

                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Using TWS 936.9 .. I might try and update...

                  Comment


                    #10
                    Yes, please do and double-check on the recommend version combo. Thanks.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      I upgraded to the latest stable TWS version and also upgraded to NT 7.0.1000.18.

                      Seems we're back to the old issue again. I can add timeframes up to the 55 minutes interval.

                      I am testing through the Strategy Analyzer. Is this ok?

                      Comment


                        #12
                        What do you mean by latest stable TWS please? The 938.1 from our sites?

                        Yes, from Strategy Analyzer is fine as well.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          No, I always download directly from the Interactive Brokers website so I am sure the software is original. So I downloaded version 943.1c.I will download the combo as you stated later on a separate machine. Will keep you posted. But problem does seem strange right?

                          Comment


                            #14
                            Thanks, yes. For sure I would not expect. However I strongly recommend running of the TWS we outline in the guide only, that's the reason we have it on our servers, too. It's IB's original software, we just mirror the version needed for the NT setup.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              But I know that IB provides data in set intervals of seconds and then minutes of 1,2,3,5,10,15,20,30 and then hourly intervals and then daily and weekly.

                              So maybe the 55 minute interval is made up of 30+20+5 .. And 60 minute cannot be created because it expects an hourly?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by sofortune, Today, 10:28 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by marcus2300, Today, 10:21 AM
                              2 responses
                              2 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by proptradingshop, Today, 10:07 AM
                              3 responses
                              5 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by DT215, 01-14-2023, 07:59 PM
                              3 responses
                              126 views
                              1 like
                              Last Post proptradingshop  
                              Started by DawnTreader, 05-08-2024, 05:58 PM
                              10 responses
                              39 views
                              0 likes
                              Last Post DawnTreader  
                              Working...
                              X