Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CancelOrder Submits a Modified Order

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

    #16
    Hi Bertrand,
    Another problem has arisen again that is preventing me from testing for any sync issue.

    See this post, http://www.ninjatrader.com/support/f...ad.php?t=32391

    Once this problem with calls to the OnExecution method is resolved (or goes away again), I'll be able test the sync issue.
    The Trading Mantis
    NinjaTrader Ecosystem Vendor - The Trading Mantis

    Comment


      #17
      Hi Bertrand, I was able to verify that the account and strategy where in sync when the trailing stop was hit and the modified target orders was submitted. Attached are 3 screen captures. Capture 1 is before the the trailing stop was hit and shows the account and strategy positions were the same (100,000). Capture 2 is after the trailing stop was hit, showing both strategy and account positions are now zero. Capture 3 shows details of the modified T3 and T4 orders that were submitted. I have not idea where the 16,666 quantity for T3 and T4 comes from. The only calculations in my code for this multiplies the lot size (50,000) by the number of lots (1 per target).
      Attached Files
      The Trading Mantis
      NinjaTrader Ecosystem Vendor - The Trading Mantis

      Comment


        #18
        This gets really strange. I was continuing to watch this and noted the following.

        When the trailing stop is hit after T1, everything works as expected (outstanding target orders are cancelled, modified orders are not submitted). I verified this by looking at the IB audit log.

        When the trailing stop is hit after T2 or T3, the problem occurs. First a modified order is submitted and then cancelled. The modified order is 1/3 of the original order and if less than the minimum forex order, it is rejected by IB.
        The Trading Mantis
        NinjaTrader Ecosystem Vendor - The Trading Mantis

        Comment


          #19
          Greg, I would suggest you print out all associated qty part in your calcs in OnExecution() for the 'Target 2, 3 and 4 Hit' cases you've setup - please also add prints to your OnOrderUpdate() section to see when / if there are qty changes seen for your orders.
          BertrandNinjaTrader Customer Service

          Comment


            #20
            I added Print statements to OnOrderUpdate. I already had print statements where the target orders get entered. There is no place in my code where the target orders get updated once entered (except for CancelOrder). The only place targets are entered is in a conditional if block in OnExecution. The if block only executes when the execution OrderId equals the entryOrder Id.

            I've attached Excel files of the relevant portion of the trace file and the output window. I highlighted in pink the area where the qty change to the target occurs and the specific line where this happens is in bold. I have also attached the strategy that I was running.

            There is nothing in my code that submits this change to the target order.

            I do not know what else I can do to convince you that this is a bug in Ninjatrader. It is very repeatable on my end and happens everytime the ATR Stop is hit after T2 is filled (also after T3 is filled).

            Thanks
            Attached Files
            The Trading Mantis
            NinjaTrader Ecosystem Vendor - The Trading Mantis

            Comment


              #21
              Greg, thanks for the analysis - I will rerun your last posted file here, I see what mean, there's a PendingChange before PendingCancel for those targets.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              10 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              14 views
              0 likes
              Last Post AaronKoRn  
              Started by carnitron, Yesterday, 08:42 PM
              0 responses
              11 views
              0 likes
              Last Post carnitron  
              Started by strategist007, Yesterday, 07:51 PM
              0 responses
              13 views
              0 likes
              Last Post strategist007  
              Started by StockTrader88, 03-06-2021, 08:58 AM
              44 responses
              3,983 views
              3 likes
              Last Post jhudas88  
              Working...
              X