Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy allways cancle Orders....

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

    Strategy allways cancle Orders....

    Hi,

    I am workin on a little strategy with multiple Timeframes (1min and 100Tick). I successfully designed the conditions for entering and exiting. Now I am testing life. But everytime, when there is a signal, the order was sent and cancled again at the same time.
    As far I can see, it's not the Exit-Order wich cancle the Entryorder. But why the orders are cancled?

    Jens

    #2
    Hello,

    If you have not, please enable the TraceOrders property which will give us additional logging to the Output window and should tell us exactly why the order is canceling.

    More information on TraceOrders can be found below:



    The default behavior of a strategy is to cancel an order once the condition is no longer true. If that is what is occurring, this can be changed by following the methods outlined in the following reference sample on Keeping Orders Alive:



    If you're unsure how to interrupt the results of the TraceOrders, please feel free to post these here and I'd be happy to look at them with you.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      Hello,

      If you have not, please enable the TraceOrders property which will give us additional logging to the Output window and should tell us exactly why the order is canceling.
      Thats a good idea, but where and how.....

      Thank you

      aunt edit means: I should better read your posting. I found it.... ;-)
      Last edited by xenayoo; 05-24-2012, 08:46 AM.

      Comment


        #4
        To enable TraceOrders, add this line into the Initialize() method of your NinjaScript strategy:

        Code:
        TraceOrders = true;
        Please review the following link for further clarification:

        MatthewNinjaTrader Product Management

        Comment


          #5
          Now tracing orders...

          Well,

          i use a set of exitorders wich was send when a signal (adx is falling) lost. I thought, that these Exitorders (ExitLong and ExitShort) where ignored when there is no marketposition. But these Exitorders where set and if a EntryOrder was triggered, the existing Exitorder cancled the EntryOrder.

          So far.
          Now I changed the condition of the exitorder to:
          Code:
           
          if(Position.MarketPosition != Marketposition.Flat)
          {
              ExitLong();
              ExitShort();
          }
          But now the strategy doesn't make Entries. Why? I only changed the Exit...

          Jens

          Comment


            #6
            Does the TraceOrders list these Entry Orders as being Ignored?

            Under what condition are using using the Entry orders? Do you know if this block of code is being called? You can check this by using Print() statements where the Entry orders should be and see if this is being printed as well.

            Click here for more information on Debugging your NinjaScript Code
            MatthewNinjaTrader Product Management

            Comment


              #7
              Hello Matthew,

              I use a pyramid of conditions, so eyery condition have to be true when order is send. But the OrderTrace in the output window shows: "Cancelled expired Order...." two seconds after "Entered internal PlaceOrder()....".
              There is one condition with two timeframes:
              Condition1(1min) && (Condition2(100Ticks) || Condition3(100Ticks))
              My only explanation for the moment is, that the Ordercondition from the 100Tick-Indicator was calculated intrabar. I thought, that the calculation would be calculated on bar close of the 1Minutechart, where the strategy was inserted.

              Jens

              Comment


                #8
                Hello,

                If the order is expiring, you should be able to use the liveUntilCancelled property and only cancel the order under the condition you would like the order to be canceled.

                You can see a detailed example of how this done from the following link - http://www.ninjatrader.com/support/f...ad.php?t=19169
                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