Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with trading daily bars over IB

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

    Problem with trading daily bars over IB

    Hi,

    I have currently the following problem: I am trading a Ninjascripts strategy real-time with daily bars (CalculateOnBarClose = TRUE). This works fine for European futures (DAX, Bund, etc.).
    It does not work for US futures (ES, ZN, etc.) because at some point in time (during an internet downtime here) there was suddenly a bar for today and a position on, which seems to be simulated since it is not matched on IB.

    How can I control, when my strategy starts trading?

    thx, Peter

    #2
    Hello,

    Thank you for your note.

    Are you looking to Enable/Disable the strategy? Put a time filter on when strategies can send orders?

    Also, the new bar would start formin based on the session template used. What session template is in use?

    Also, when you started the strategy what account had you started it on?

    I look forward to assisting you further.

    Comment


      #3
      Well my session templates for US stock index futures start e.g. with 15:30 and ends with 22:15 our (vienna) time. So why did I have at 14.00 already a position on for today? The strategy seems to produce a trade as soon as the daily bar for today is here. But how can I control, when the daily bars arrives?

      Comment


        #4
        Hello,

        Is this a custom session template? If you use a pre defined session template such as US Equities RTH, does this change anything here? Only thing I can think of currently is with the time conversion a new bar is being created due to the session template rules before you expect.

        Let me know if I can be of further assistance.

        Comment


          #5
          No, it's a predefined session template (CME US Index Futures RTH).

          Well time conversion could be a problem, because I have the same problem on all US Futures (ZN, CL, ES) all using pre-defined session templates.

          Or the problem is the daily bar data coming from IB? Could it be that the session template does not work there?

          Comment


            #6
            Hello,

            Yes this is done on IB's side. I found the following post where you found that you would need to not use daily bars but instead use minute bars as daily data is not affected by the session template. Please do not use daily bars please use minute bars as dicussed with Ryan Millard in the below post.



            Let me know if I can be of further assistance.

            Comment


              #7
              Brett,

              This does not solve my problem. I have to trade daily bars, since my strategy is long-term and in order to see my stops, etc. I have to stick with daily bars. This is no intraday strategy!!

              Sorry, but for me this is bug in NinjaTrader, when I have to switch to minute charts in order to trade US markets correctly. What are other IB customers doing in this case? There should be another workaround possible....

              I will make now a test, if my strategy works on minute bar charts at all.

              Peter

              Comment


                #8
                Peter,

                Dont think you mis-understood what I meant, You still run on daily bars except its minute data in use instead of daily data. When you build a 1440 minute chart this is equal to 1 day. You must run on a 1440 minute chart to simulate one day to then be able to use a session template. Otherwise NinjaTrader has no way of looking into the bar to apply a session template.

                Let me know if I can be of further assistance.

                Comment


                  #9
                  Brett,

                  Yes I understand that 1440 minutes are 1 day. But I nevertheless loose my view of the long-term behaviour of my strategy, when I am looking at a minute chart. As it looks for me switching between timeframes (minute --> day, day --> minute) is not possible, because I always loose the attached strategy. Correct?

                  By the way I just tried to enable the strategy on a 1 minute bar charts for the e-mini S&P500 with a session template, which would start trading at 17.00 our time in 1 minute, but I could not enable the strategy..... My strategy is not a typical NinjaScripts strategy, since I am trading an external signal, which is coming on a monthly basis from another application (Matlab). I need some workaround here, otherwise I cannot use NT.

                  Thx

                  Comment


                    #10
                    Hello.

                    I guess I'm not understanding why 1440 minute chart will not work for you? Does it not have enough historical data for you form IB is that what your saying? As there would be no reason to use 1 day charts in this case you would only use 1440 minute charts and there would be no need to switch back to a 1 day chart. However IB is specific in I know that they only provide a years worth of minute data. A solution here may be to purchase data from a data feed provider that will provide more data such as Kinetick.com and then just place trading signals to IB. However based on your last post here this may be irrelevant.


                    As far as your strategy. This information you provided to me is key. As your strategy may not be trading based OnBarClose basis if its trading from an external application signal. OnBarClose would have no effect here. At this point in time I would need to have you send me your strategy to support at ninjatrader dot com and reference this forum post as you have some strategy logic that is not correct/not as you expect that is causing this to occur on daily charts.

                    Let me know if I can be of further assistance.

                    Comment


                      #11
                      Brett I will send the code to this address,

                      Thx, Peter

                      Comment


                        #12
                        Problem is solved now. The reason for the problem was how daily bars for certain markets (US, etc.) are delivered from IB. Since this strategy is a long-term futures systems it had to stick with daily bars. So I decided to switch to Kinetick as data provider and do just the trading over IB. This seems to work now since bars in Kinetick are matching the trading sessions within Ninja.

                        Thx for the support!!

                        Comment


                          #13
                          Hello,

                          Thanks for the report and letting others know!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by andrewtrades, Today, 04:57 PM
                          1 response
                          10 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by chbruno, Today, 04:10 PM
                          0 responses
                          6 views
                          0 likes
                          Last Post chbruno
                          by chbruno
                           
                          Started by josh18955, 03-25-2023, 11:16 AM
                          6 responses
                          436 views
                          0 likes
                          Last Post Delerium  
                          Started by FAQtrader, Today, 03:35 PM
                          0 responses
                          9 views
                          0 likes
                          Last Post FAQtrader  
                          Started by rocketman7, Today, 09:41 AM
                          5 responses
                          19 views
                          0 likes
                          Last Post NinjaTrader_Jesse  
                          Working...
                          X