NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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.

Reply
 
Thread Tools Display Modes
Old 08-22-2010, 06:27 AM   #1
zeeee
Junior Member
 
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default Populating strategy variables after restarting NT7

I have coded up a strategy using the stop placement techniques detailed in this thread ( http://www.ninjatrader.com/support/f...ead.php?t=7499 ).

Throughout the code I am referring to the IOrder variables to manage the orders. Now I am concerned that these variables won't be repopulated if NT7 is shut down and restarted for whatever reason and hence my strategy won't work. Is this true?

I can't seem to find any examples of people who have tackled this in the forum.

Regards
zeeee is offline  
Reply With Quote
Old 08-22-2010, 10:58 AM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

zeeee, I am not exactly sure what you are asking, although if your strategy works fine as is, it will work fine after restarting NinjaTrader. You are correct though that unless you've wrote specific code to persist the variables, the variables will be reset upon a restart, but that shouldn't make your strategy non-functional.
NinjaTrader_Austin is offline  
Reply With Quote
Old 08-22-2010, 02:32 PM   #3
zeeee
Junior Member
 
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

Well if I am referring to the IOrder in something like this:
if(NewCalculatedStop > stopOrder.StopPrice) MoveStop();

Then stopOrder would be null and the strategy wouldn't function correctly (by my definition!)

Do you suggest that I loop through the OrderCollection and pick out the order upon startup?
zeeee is offline  
Reply With Quote
Old 08-22-2010, 09:06 PM   #4
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

zeeee, I will have someone respond to you tomorrow.
NinjaTrader_Austin is offline  
Reply With Quote
Old 08-23-2010, 02:53 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

zeeee, when you restart the strategy will recalculate the on it's historical part before continuing to run in realtime, this will include IOrder objects, however the state of those which you for example encountered on the last realtime run is not persisted.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-23-2010, 03:04 AM   #6
zeeee
Junior Member
 
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

Great, thanks for your help Austin and Bertrand!
zeeee 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
restarting strategy after failure dave1992 Version 7 Beta General Questions & Bug Reports 3 07-06-2010 11:46 AM
Restarting strategy vlsachta Strategy Development 1 10-14-2008 08:38 AM
Restarting a terminated strategy garyford Automated Trading 1 04-14-2008 01:49 PM
Charts not populating? digdeep Charting 2 03-27-2008 05:15 PM
Super dom not populating fishbed SuperDOM and other Order Entry Windows 3 02-07-2008 07:36 AM


All times are GMT -6. The time now is 09:58 PM.