Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unmanaged Change Order Question

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

    Unmanaged Change Order Question

    When using unmanaged orders and an limit order is currently long.

    Can in the same code snippet i place a cancelorder() command and a submitoder command?

    such as if (entryOrder !=null && limitprice=true)
    {

    cancelorder(entryoder);
    Submitorder ()

    }

    Is this going to work in real time or will i need to delay a period of time between the cancel and submit orders?


    Thanks.

    #2
    Hello neb1998,

    Yes, this is definitely possible to do. There is possibility of overfill if both orders are filled. This would happen if the order pending cancel is filled before it can be cancelled.

    If you want to verify it's cancelled before submitting, best is to work off OrderState values rather than a delay.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok thanks, i have too many orders being fired at a time now, still working through the unmanaged orders. They are working better in backtesting than i could get the managed to work but i have way to many orders firing.....more debugging.

      Thanks.

      Comment


        #4
        Another question.....

        When using changeorder() methods where is the best place in the code to place them? It would seem to me that onbarupdate would be the best but i am getting some strange results.

        Once a long order is issued within the onbarupdate method then the script moves to the onexecute() method correct?

        After the exits are submitted then the script returns to the first action of onbarupdate() or onexecute() if one of the exits is executed prior to the next tick being received or bar closing historically?

        Comment


          #5
          You would need to add prints to see the event call sequencing for your script and scenario, then you can deduct where to best place your change order call...the events come in a they 'fire' in realtime, so there's race conditions at play here.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          635 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X