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!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Change Limit Order to Market Order
Collapse
X
-
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=7499Chelsea B.NinjaTrader Customer Service
-
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
-
like to add the following to this thread
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?Code:if (Position.MarketPosition == MarketPosition.Short) { shorttarget = Position.AvgPrice - tRmult * ATR(1)[0]; ChangeOrder(ProfitTarget,ProfitTarget.Quantity,shorttarget,0);
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()
Comment
-
to continue:
other option is to change the limitorder price with Close[0]
this will do: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); }
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
110 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
59 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
37 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
78 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment