Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IB <-> Ninja Order Problem

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

    IB <-> Ninja Order Problem

    I have an ATM strategy that runs fine most of the time. It is a simple two target ATM with auto BE at the first target. I also have the reverse at stop turned on. This ATM runs fine most of the time, but I have seen it fail several times now.

    What seems to happen is the first ATM runs correctly and bumps up to BE, then it reverses at BE, then when the second ATM is running and it reaches the auto-BE level I get the following popup from IB:

    "Error validating request:-'nb' : cause - The size value can not be zero: (321) Affected Order: Sell 0 StopLimit @ 710.1 x 708.1"

    This msg is also in the NT log along with a msg that the order was rejected, and another entry saying order cancelled for reason 202.

    The issue only happens after a reverse, as the same ATM has never failed otherwise. I only run this ATM once a day, and after the reverse is hit, manually turn off the reverse on stop (only want one reverse).

    This is happening with 6.5.

    #2
    This issue likely is related to incorrect instrument setup.
    - please make sure you are on latest 6.5.0.9 or 6.0.1000.9
    - if this is instrument provided by default by NT and you are on NT6.5: please try Tools->Options->Misc->Reset instruments
    - if this a custom instrument then you need to revisit the instrument settings in Tools->Instruments, compare them to a NT default instrument and see what's missing or setup incorrectly

    Comment


      #3
      Well, I really dont think it is the instrument, as I am using the default ER2 symbol and have never mucked with it. The ATM is also very simple.

      It is also interesting that the ATM works just fine with simulated data.

      I think the issue is that NT is getting confused on the reverse when dealing with IB and somehow mucking up the quantity used for orders.

      I am upgrading from 6.5.0.8 to 6.5.0.9, and will verify the instrument. Is there anything else that I should do to trace the problem for you?

      Comment


        #4
        Not for now thanks.

        Comment


          #5
          Happened again today with latest Ninja and default instruments.

          Next idea?

          Comment


            #6
            Please provide exact step on how to reproduce this issue. Thanks

            Comment


              #7
              Well I kind of did that when I opened the issue the first time, but I'll try to be more precise:

              NT: 6.5.0.9 (but happens on other versions)
              IB: latest version (but happens on other versions)

              ATM Strategy: 2 targets, 7T & 30T, both set to stop of 13T, both set to custom stop with auto-BE set to 6T trigger Plus=0T. Rev at stop turned on.

              Instrument: ER2 03-08

              Quanity: 2

              Scenario:

              * Enter trade

              * price hits auto-BE -> ATM moves stop to BE
              * price hits target1 -> ATM closes one contract still has one left
              * price hits BE -> ATM closes last contract and reverses position

              NOTE: the above three steps could also be a stop out and reverse at stop level instead of BE level. I have seen it happen both ways, and the initial ATM always executes correctly. The reversed position is where the trouble is.

              * once reversed, manually cancel the reverse at stop (want one reverse)
              -> ATM cancels reverse order (quanity 2) and leaves stop where it is
              -> at this point, the stop1 quanity is set to zero in the log!

              * price hits auto BE level -> ATM moves stop2 corectly, but stop one fails with the msgs I listed below (quanity zero issue)

              * at this point NT is hosed, but the target1/2 and stop2 orders are active, but they can only be manually moved (single click modification no longer works)


              The problem seems to stem from the manual reset of reverse on stop, as the quantity on the stop1 order should have gone to 1 not zero (removed the reverse but not the stop). Could be wrong, but it seems like the reverse entry and stop1 orders are combined. If they are, then the manual reset of the reverse on stop needs to take that into account and change the quanitity to the correct quanitity not zero.

              Comment


                #8
                Thanks for this information. I have tried to reproduce without any success based on the exact steps you have provided. I will leave this issue as an open case in with the hope that we receive more information from you or any other user that helps us triangulate on this issue and get it resolved.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  Happened again this AM, exactly as I mentioned below.

                  Do you want to see the traces/logs?

                  Can I do anything to help you figure this out?

                  I execute this trade every morning, but of course it does not reverse every morning. The behavior seems to be very consistent when it reverses.

                  Comment


                    #10
                    Unfortunately the logs/traces will not tell me anything. What I need is what you already provided which are steps to reproduce. The problem is that I can't reproduce the behaviour.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      I agree it is a difficult problem.

                      I have had a difficult time reproducing in my IB paper trading account (both with and without restarting NT). Generally, it works and the quantities in the log are correct. I did reproduce it once yesterday though. Generally, it only seems to happen on the first trade of the day in real IB account. Perhaps that is another clue.

                      Looking back at my notes, I have now seen this error 4 times in 2 weeks (did not report first one). It is not going to magically go away. I would like to know what the plan is for figuring it out since I am only using documented supported features of the platform. I am willing to help you figure it out, but you need to tell me what to do.

                      Comment


                        #12
                        >> IB paper trading account
                        NT does not support the IB paper trading account since there are issues with TWS. Can you reproduce on IB demo or live account?

                        Comment


                          #13
                          Well, I have had the problem in live mode 4 times now. I will reproduce it in a live account as it comes up (I make the trade once a day, but I can not control if the reverse hits or not), but will not be trying to reproduce it in my live account with real money just for fun (unless you want to fund it :-).

                          I use the paper trading account to test strategies etc, and have never had a problem with it, but good to know there could be issues.

                          Comment


                            #14
                            The IB demo account might work for your tests too (user=edemo, pwd=demouser).

                            Please do not use the paper trade account.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by 21laienoch, Today, 10:21 AM
                            1 response
                            3 views
                            0 likes
                            Last Post NinjaTrader_ChristopherJ  
                            Started by synthhokie, Today, 10:24 AM
                            1 response
                            3 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by RaddiFX, Today, 10:15 AM
                            1 response
                            3 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by Rogers101, 05-05-2024, 11:30 AM
                            23 responses
                            68 views
                            0 likes
                            Last Post NinjaTrader_Jesse  
                            Started by Human#102, Today, 09:54 AM
                            1 response
                            2 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Working...
                            X