NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09-17-2009, 06:04 AM   #1
leontancfa
Member
 
Join Date: Nov 2008
Posts: 95
Thanks: 0
Thanked 0 times in 0 posts
Default NinjaTrader crashes when I load strategy with CancelOrder()

The script is approx. like below. I had no problem before adding CancelOrder() and IOrder. Don't know which caused the crash. Could you have a look?



private IOrder myEntryOrder = null;
private int barNumberOfOrder = 0;

protected override void OnBarUpdate()
{

{

myEntryOrder = null;

myEntryOrder = EnterLongLimit(0, true, 1, Low[0], "Long Entry");
barNumberOfOrder = CurrentBar;
}


if (CurrentBar > barNumberOfOrder + 3)
CancelOrder(myEntryOrder);
}
leontancfa is offline  
Reply With Quote
 

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
Strategy: Using CancelOrder() method to cancel orders NinjaTrader_Josh Reference Samples 0 07-20-2009 01:51 PM
Can't load NinjaTrader - error Andy73 Installation and Licensing 6 02-18-2009 05:56 AM
Simple Limit Strategy with CancelOrder stefy Strategy Development 7 11-10-2008 07:44 AM
Ninja 6.5 slow tro load and crashes PeterBrazel Miscellaneous Support 5 03-06-2008 10:25 PM
Opening Chart crashes NinjaTrader jrowenjr Charting 3 05-20-2007 12:25 AM


All times are GMT -6. The time now is 09:15 AM.