![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2008
Posts: 36
Thanks: 0
Thanked 0 times in 0 posts
|
I am using OnOrderUpdate() method for confirmation of my EnterLongLimit() entry order, to submit my stop via ExitLongStop() and to submit my profit target via ExitLongLimit(). I've set the parameter liveUntilCancelled to true, so I don't have to resubmit orders on every bar update.
If a condition arises that would dictate closing all open orders and any filled position (if it has already been entered). What is the preferred method to do this. Since I would want to close all open orders, and my entry position if it has been filled, would AtmStrategyClose() , using the entry order signal name be best? Or is some other way preferred. Thanks, Phineas |
|
|
|
|
|
#2 |
|
Member
Join Date: Jan 2008
Posts: 36
Thanks: 0
Thanked 0 times in 0 posts
|
Follow-Up: I think the following works, Could you let me know if there is a better way.
I will first check on status of original entry order (filled or not). If not filled, I'll use CancelOrder(), and that is it. If it has already been filled, I should submit an ExitShort() or ExitLong to close original position, AND then use CancelOrder() on Stop loss and CancelOrder() on Profit Target. Thanks, Phineas |
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
I would CancelOrder(myStopOrder), monitor this to make sure it comes back cancelled with a filled amount of zero, then modifying the limit order to a price (below market if a sell order for example) to get it to fill. This reduces any potential overfill on orders are you request cancellation.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Limit orders filled at different price | Richard Von | SuperDOM and other Order Entry Windows | 4 | 01-28-2008 12:02 PM |
| Closing a forex position with ExitLong() | henry.omd | Strategy Development | 2 | 01-05-2008 12:31 PM |
| Automation-Orders not filled. | Zardoz | Automated Trading | 2 | 02-26-2007 08:05 AM |
| partially filled entry orders | werosen | Miscellaneous Support | 3 | 01-11-2006 07:53 AM |
| Partially filled orders | bor | Automated Trading | 2 | 05-27-2005 01:39 AM |