NinjaTrader_Josh
07-20-2009, 02:51 PM
Reference sample for NinjaTrader 6.5.XXXX.X or greater.
When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until-cancelled, the way to cancel them is by using the CancelOrder() method.
This reference sample demonstrates the following concept:
Submitting live-until-cancelled entry orders
Manually cancelling orders
Important methods and properties used include:
CancelOrder() (http://www.ninjatrader.com/support/helpGuides/nt7/cancelorder.htm)
IOrder (http://www.ninjatrader.com/support/helpGuides/nt7/iorder.htm)
OnOrderUpdate() (http://www.ninjatrader.com/support/helpGuides/nt7/onorderupdate.htm)
OnExecution() (http://www.ninjatrader.com/support/helpGuides/nt7/onexecution.htm)
Other methods and properties of interest include:
EnterLongLimit() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlonglimit.htm)
EnterLongStop() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlongstop.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file
When using NinjaTrader's Enter() and Exit() methods, the default behavior is to automatically expire them at the end of a bar unless they are resubmitted to keep them alive. Sometimes you may want more flexibility in this behavior and wish to submit orders as live-until-cancelled. When orders are submitted as live-until-cancelled, the way to cancel them is by using the CancelOrder() method.
This reference sample demonstrates the following concept:
Submitting live-until-cancelled entry orders
Manually cancelling orders
Important methods and properties used include:
CancelOrder() (http://www.ninjatrader.com/support/helpGuides/nt7/cancelorder.htm)
IOrder (http://www.ninjatrader.com/support/helpGuides/nt7/iorder.htm)
OnOrderUpdate() (http://www.ninjatrader.com/support/helpGuides/nt7/onorderupdate.htm)
OnExecution() (http://www.ninjatrader.com/support/helpGuides/nt7/onexecution.htm)
Other methods and properties of interest include:
EnterLongLimit() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlonglimit.htm)
EnterLongStop() (http://www.ninjatrader.com/support/helpGuides/nt7/enterlongstop.htm)
Import instructions for NinjaTrader 6.5.XXXX.X or greater:
Download the file contained in this thread to your PC desktop
From the Control Center window, select the menu File > Utilities > Import NinjaScript
Select the downloaded file