Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automated strategy with Interactive Brokers and CL

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

    Automated strategy with Interactive Brokers and CL

    I have an automated script that works fine in SIM mode. I'm placing orders for CL 10-09 with IB. When I switched it live today it placed an order on the correct signal but did not display the order on the chart or a running PnL on the control panel strategy tab. The price went against me and a signal was generated for entry in the opposite direction while the previous order was still running. This canceled out the open order. But my script only places orders when the position is flat. Looking at the log, looks like, although I generated a CL 10-09 order, the execution line says it's a CL 09-09 contract! I guess NT thinks it's got a CL 09-09 contract from then on and so the strategy thinks it's flat.
    Any ideas?

    -thanks

    #2
    Strategies only runs on the instrument it is told to run on. If you put it on a Cl 10-09 chart, it submits the order to 10-09. Whether that gets filled or not as 10-09 depends on what ultimately happens over on your brokerages end.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh - the strategy placed an order for CL 10-09 and the broker reports on their TWS that they have filled the order for CL 10-09. The NT log shows a position of CL 09-09. As you know, CL 09-09 doesn't exist any more.

      So I'm placing an order for CL 10-09, IB fills the order for CL 10-09 but NT thinks it's got a position in CL 09-09.

      Comment


        #4
        Please test with manual trades. Are you sure you are looking at the right thing. If your chart is 10-09 there is no way it will just change to 09-09.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh - I have tested the strategy using SIM and it works fine. If you look at the log, the order placing lines all reference CL 10-09 and then when the execution and position lines are posted in the log, they reference CL 09-09. Can I perhaps send you the log?

          -thanks

          Comment


            #6
            Please attach it here along with reproducible steps. Thank you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              The steps are:
              through a script invoked from a CL 10-09 5 min chart run "EnterLong(noCars, "Buy1");"
              the log entries are:

              9/1/2009 8:40:00 AM|1|32|Order='40f1f5291356424fb7fc3842b9d4646c/U560535' Name='Buy1' New State=PendingSubmit Instrument='CL 10-09' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
              9/1/2009 8:40:01 AM|2|4|Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed. 2109
              9/1/2009 8:40:01 AM|1|32|Order='1139609026/U560535' Name='Buy1' New State=Accepted Instrument='CL 10-09' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
              9/1/2009 8:40:02 AM|1|32|Order='1139609026/U560535' Name='Buy1' New State=Working Instrument='CL 10-09' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=0 Fill price=0 Error=NoError Native error=''
              9/1/2009 8:40:02 AM|1|32|Order='1139609026/U560535' Name='Buy1' New State=Filled Instrument='CL 10-09' Action=Buy Limit price=0 Stop price=0 Quantity=1 Type=Market Filled=1 Fill price=70.39 Error=NoError Native error=''
              9/1/2009 8:40:02 AM|1|16|Execution='CL 09-09/0000ffb5.4a9c5f47.01.01' Instrument='CL 09-09' Account='U560535' Exchange=Nymex Price=70.39 Quantity=1 Market position=Long Operation=Insert Order='1139609026' Time='9/1/2009 8:40:02 AM'
              9/1/2009 8:40:03 AM|1|64|Instrument='CL 09-09' Account='U560535' Avg price=70.39275 Quantity=1 Market position=Long Operation=Insert Currency=UsDollar

              Comment


                #8
                Have you tried with a manual order yet.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  No I have not. My signal only fires every 2 or 3 days so I am not going to place a random order and blow a whole new wad of $. I would try my sim account at IB but your software won't link to it. IB issue sim accounts using a different logon. Perhaps if you tell me how I can get the software to link to the IB sim account, I can test a manual order entry.

                  Is this the same problem you were dealing with in this thread: http://www.ninjatrader-support2.com/...t=16341&page=2

                  If so, has it been fixed yet? If not, you suggest using TWS890. Is this still available and is it compatible with NT 6.5.1000.12?

                  Comment


                    #10
                    Could be the case, but you should be on 6.5.1000.12 and TWS 895 as outlined here: http://www.ninjatrader.com/webnew/su...ivebrokers.htm
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      I am on 6.1000.12 and 895. Does this mean that between you and IB you have fixed the problem of NT interpreting the execution expiry date as the expiry month? It being the case that energy contracts expire the month before the date of the contract. If so, I must be doing something else incorrectly. What more can we do to isolate this?

                      -thanks

                      Comment


                        #12
                        As per Dierk in that thread, issue still persists as last updated a week ago.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Josh - we don't seem to be moving forward on this.

                          The thread has you saying that TWS890 works. Can I use that release and if so, from where do I get it? What version of NT is compatible with it?

                          -thank you

                          Comment


                            #14
                            The thread does not have me saying anything. You can try downgrading but the only version .12 supports is 895.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Josh - my mistake - it was Jason, I apologize.

                              However.......The thread has Jason saying that TWS890 works. Can I use that release and if so, from where do I get it? What version of NT is compatible with it? and how do I get that?

                              It would seem that this downgrade would be of interest to everyone who wants to trade energy futures with NT and IB. For the most part of this year NT and IB would seem to be incompatible for trading energy futures.

                              -thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by CortexZenUSA, Today, 12:53 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by CortexZenUSA, Today, 12:46 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post CortexZenUSA  
                              Started by usazencortex, Today, 12:43 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post usazencortex  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              168 responses
                              2,265 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              12 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X