Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I want to narrow an order

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

    I want to narrow an order

    Hi,

    I'm using NT7 to develop an auto-trading strategy and I'm using a combination of EntryLongStop or EntryShortStop (depending on my direction) and a SetStopLoss call.

    In certain circumstances, I'd like to change the order prices before the order has been filled to narrow the range of the order such that both the stop loss price and the entry prices are moved closer to each other so that I can reduce my risk and improve my profits.

    I see the "Unmanaged" method called ChangeOrder that takes an IOrder object (returned by the EnterLongStop or EnterShortStop) and three arguments, a quantity, a limit price and a stop price. How can I use this to narrow the order or do you have another way to achieve the same thing?

    Regards,

    Paul

    #2
    Hi Paul, to change your Entry and Exit prices, you could just resubmit the same orders at the new price level again, this would not need the new unmanaged approach.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Paul, to change your Entry and Exit prices, you could just resubmit the same orders at the new price level again, this would not need the new unmanaged approach.
      Ok, so two calls:

      SetStopLoss(StopLossPrice);
      myOrder = EnterLongStop(MaximumRiskQty,EntryPrice);

      Does this result in one new transmit to IB or 2 separate calls and if 1 fails does the other still get executed?

      Thanks,

      Paul

      Comment


        #4
        Correct, two calls which would change the already present orders to your newly set price.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Correct, two calls which would change the already present orders to your newly set price.
          So if I want to narrow the range of the order and therefore decrease my Risk/Reward ratio (improve my leverage), then this would result in a transmit call for the stoploss followed by another transmit call for the new entry price?

          If this is the case, is there any way to change these values in the order then transmit in 1 atomic operation? I'm concerned that if 1 of the operations fails, the orders will end up in an undefined state in the market.

          Regards,

          Paul

          Comment


            #6
            Paul, unfortunately not as you would provide the 'linking' of those order changes with your custom code - if you're concerned about those case work with the IOrder objects and confirm their states in the OnOrderUpdate() - http://ninjatrader.com/support/helpG...nt7/iorder.htm

            The native errors you receive are now exposed as well with the NativeError property.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X