![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Feb 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
Hello, I have a question on the workings of stop/start strategy from the strategies tab: if I start a strategy after using RightClick-> New Strategy I undestand the Initialize() is executed, and the OnBarUpdate() is ready to be triggered and being executed.
Now what happens if I stop a running strategy and start it again by pressing the start button? Is the Initialize() member function executed? In other terms, if I stop and start the strategy, do I get a new instance of the object, or is it still the same, and therefore Initialize() is not executed? Thanks |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
You get a new instance.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2009
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
Do you mean that when pressing start (after stopping) Initialize() is executed and the variables are reinitialized?
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
No. You can see when Initialize() is called by adding a print command into it. You should not be placing variable initializes in there. You should do that in the Variables section of the code.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stop-Start | trend | Automated Trading | 1 | 03-12-2009 09:35 AM |
| Start/Stop strategy event | zer0balance | Strategy Development | 6 | 12-29-2008 09:29 AM |
| start strategy again | max-td | Strategy Development | 5 | 04-24-2008 04:32 AM |
| How to set session start/stop time in NS? | henry.omd | Strategy Development | 1 | 01-11-2008 02:31 PM |
| Strategy Start/Stop Event | Json | Strategy Development | 1 | 05-01-2007 03:55 AM |