Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Limit Order to Market Order

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

    Change Limit Order to Market Order

    Hi All,

    Is there a way to change a profit target limit order to a market order if the limit price is touched? Thank you all in advance for your help!

    #2
    Hello GeoOrtiz,

    Thanks for your note.

    While a profit target is always a limit order, you could instead place a Stop Market Order as the profit target and StopLimit Order as the stop loss. When one is filled cancel the other.

    Below is a link to a reference sample that may help you to accomplish this.
    http://www.ninjatrader.com/support/f...ead.php?t=7499
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea, but I'm using the unmanaged order approach. How do I place a stop market order for my profit target using the unmanaged order approach?

      Comment


        #4
        Hello GeoOrtiz,

        Thanks for your reply.

        SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 0, High[0]+2*TickSize, "oco1", "myLong");

        This would place a stop market order at 2 ticks above the high of the current bar.

        Below is a link to the help guide on SubmitOrder().
        http://www.ninjatrader.com/support/h...ubmitorder.htm

        Please let me know if I can be of further assistance.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          like to add the following to this thread

          Code:
                          if (Position.MarketPosition == MarketPosition.Short)
                          {
                              shorttarget = Position.AvgPrice - tRmult * ATR(1)[0];
                              ChangeOrder(ProfitTarget,ProfitTarget.Quantity,shorttarget,0);
          because the profit limit price has been recalculated (1.2471) on bar close and is already touched, Somehow it fills the order somewhere in open space. Do you know why this happens?

          World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


          so i want to take profit the next bar at the market:
          i like to change the limitorder into a market order.

          i don't see this as an option within ChangeOrder()
          Last edited by yeshe; 12-18-2014, 12:44 AM. Reason: picture does not show , added a link instead

          Comment


            #6
            to continue:

            other option is to change the limitorder price with Close[0]

            Code:
                            if (Position.MarketPosition == MarketPosition.Short)
                            {
                                shorttarget = Position.AvgPrice - tRmult * ATR(1)[0];
                                if (Close[0]<shorttarget)shorttarget=Close[0];
                                ChangeOrder(ProfitTarget,ProfitTarget.Quantity,shorttarget,0);
                            }
            this will do:
            World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.



            but what about if the open of next bar is greater than the close[0]= shorttarget? will the buylimitorder fill?? In any way is this limit order not way to close to the market with possible unwanted result?


            If not possible : is it possible to change a limitorder into a stop order
            like:
            ChangeOrder(limitorder,limitorder.Quantity,0,newst opprice for old limit order)

            please your recommendation

            Comment


              #7
              yeshe, the limit order will fill at your price specified on the default fill algorithm in backtesting, never better.

              You cannot change an order type with the ChangeOrder method, just cancel your original order and then resubmit as your new desired type via the SubmitOrder.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              22 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              120 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              63 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              45 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X