![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
zeeee, I will have someone respond to you tomorrow.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jul 2010
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
|
Great, thanks for your help Austin and Bertrand!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |