Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

troubles with pending orders

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

    troubles with pending orders

    Dear friends.
    I try to set up pending orders for my positions.
    Code:
    Print("try open long");
                        Print("try open long");
                    EnterLongLimit(tp);
                    Print("take");
                    EnterLongStop(sl);
                        Print("stop");
                EnterLong(vol,"long");
    And I have no error messages. I have only opened long position.
    I have in out put window message like stop and tp. But no pending orders.
    If you need full source code I can sent it to private message.

    #2
    daglas, please run your script with TraceOrders = true to be able to debug the behavior seen better - http://www.ninjatrader.com/support/f...ead.php?t=3627

    Depending on your entry namings, you would need to run with a higher EntriesPerDirection or unique entry handling potentially - http://www.ninjatrader.com/support/h...try%2Bhandling

    Comment


      #3
      I have set up entries per direction to 100 value. But nt7 cancel my orders, after few seconds, some times they stay 1 -2 minutes. I have enable trace orders, but I can't see error messages.

      Comment


        #4
        Did you open the Output window before running the strategy? There should be information printed to this window which will give you more information as to why the order is canceled. It may not be an error, but there should be an entry for each order that is processed.
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          Did you open the Output window before running the strategy? There should be information printed to this window which will give you more information as to why the order is canceled. It may not be an error, but there should be an entry for each order that is processed.
          I have attached screen from orders tab.
          Attached Files

          Comment


            #6
            I see that the orders are canceled, however to determine exactly why they are cancled, we will need to review the TraceOrders output.

            When you run the strategy, please make sure TraceOrders = true; in the Initalize() method of your code.

            Then go to Tools--> Output window and it will give us reasons for the order canceling.

            For example it may say " Cancelled expired order: "

            If this the reason for the cancel, it would be because by default orders are set to cancel if they are not filled while the condition is true. If this is what's happening, you can change this behavior by following the reference sample linked below:

            MatthewNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Matthew View Post
              I see that the orders are canceled, however to determine exactly why they are cancled, we will need to review the TraceOrders output.

              When you run the strategy, please make sure TraceOrders = true; in the Initalize() method of your code.

              Then go to Tools--> Output window and it will give us reasons for the order canceling.

              For example it may say " Cancelled expired order: "

              If this the reason for the cancel, it would be because by default orders are set to cancel if they are not filled while the condition is true. If this is what's happening, you can change this behavior by following the reference sample linked below:

              http://www.ninjatrader.com/support/f...ad.php?t=19169
              I have such message
              26.10.2012 20:07:35 Cancelled expired order: BarsInProgress=0: Order='482727616/DU144785' Name='limit short' State=Working Instrument='$EURUSD' Action=SellShort Limit price=1,2959 Stop price=0 Quantity=0,03M Strategy='astreamcopir' Type=Limit Tif=Day Oco='' Filled=0 Fill price=0 Token='c749f3f62ed24397a5adae69a740e37a' Gtd='01.12.2099 00:00:00'
              26.10.2012 20:07:35 Cancelled expired order: BarsInProgress=0: Order='482727617/DU144785' Name='limit short' State=Accepted Instrument='$EURUSD' Action=SellShort Limit price=0 Stop price=1,2909 Quantity=0,03M Strategy='astreamcopir' Type=Stop Tif=Day Oco='' Filled=0 Fill price=0 Token='ce1dda661a6943b4948d5f72e2bcb75d' Gtd='01.12.2099 00:00:00'
              And I use such code
              Code:
              entryPrice = Low[0] - 20 * TickSize;
              EnterLongLimit(0, true, DefaultQuantity, entryPrice, "live until cancelled long");

              Comment


                #8
                The order that was canceled is called 'limit short' and is a Sell Short limit order.

                Can you double check this limit order and ensure this is also set to liveUntilCancelled true?
                MatthewNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                647 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X