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?

          Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


          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:
            Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.



            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.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by inanazsocial, Today, 01:15 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by rocketman7, Today, 02:12 AM
              0 responses
              10 views
              0 likes
              Last Post rocketman7  
              Started by dustydbayer, Today, 01:59 AM
              0 responses
              2 views
              0 likes
              Last Post dustydbayer  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              5 responses
              23 views
              0 likes
              Last Post trilliantrader  
              Started by Davidtowleii, Today, 12:15 AM
              0 responses
              3 views
              0 likes
              Last Post Davidtowleii  
              Working...
              X