NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Educational Resources > Reference Samples

Reference Samples Official NinjaScript reference code samples

Reply
 
Thread Tools Display Modes
Old 07-29-2009, 09:05 AM   #1
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default Strategy: Keeping orders alive

Reference sample for NinjaTrader 6.5.xxxx.x or greater.

The default behavior for NinjaTrader is to cancel limit orders if the trigger conditions are no longer true. It is possible to submit orders that stay active until cancelled by setting liveUntilCancelled to true. This sample demonstrates and explains the difference between submitting an order with liveUntilCancelled true and false. The comments contain a longer, more detailed explanation.

This reference sample demonstrates the following concepts:
  • How to submit an order that stays active until it is explicitly cancelled
Another sample demonstrating how to explicitly cancel orders can be found here: http://www.ninjatrader-support2.com/...ad.php?t=18890

Important methods and properties used include:Other methods and properties of interest include:Import instructions for NinjaTrader 6.5.XXXX.X or greater:
  1. Download the file contained in this thread to your PC desktop
  2. From the Control Center window, select the menu File > Utilities > Import NinjaScript
  3. Select the downloaded file
Attached Files
File Type: zip SampleLiveUntilCancelled.zip (3.7 KB, 739 views)
NinjaTrader_Josh is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Keep Limit Order Alive for 3 Minutes BillCh General Programming 4 02-18-2009 08:45 AM
exiting NT and keeping positions/orders andrewbee Miscellaneous Support 1 12-10-2008 02:36 PM
Keeping track of equity in the account venkatesh Strategy Development 1 11-15-2008 07:48 AM
Keeping Stop Entry Orders Alive Beyond Signal Bar TapeReader Strategy Development 1 08-17-2008 07:09 PM
Keeping rectangles eDanny Indicator Development 15 08-06-2008 11:17 AM


All times are GMT -6. The time now is 10:35 PM.