NinjaTrader Support Forum  

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 09-24-2010, 01:09 PM   #1
zwentz
Member
 
Join Date: Jun 2009
Posts: 84
Thanks: 1
Thanked 0 times in 0 posts
Default Strategy start another strategy

Say your conditions are met and you'd like to start a new strategy, for whatever reason.

I know you can disable a currently running strategy; take for instance you have two strategies called SimpleMA and ComplicatedMA and you want to disable complicated from simple.

Code:
Account.Strategies[i].Disable(); //i is the index in the StrategiesCollection of your ComplicatedMA strategy
My current code looks like the following:

Code:
Period test = new Period(PeriodType.Minute,1,MarketDataType.Last);
							DoNothing nts = new DoNothing();
							nts.Account = Acct;
							nts.SetBarsPeriodInstrument(test,position.Instrument);
							Acct.Strategies.Add(nts);
							InstrumentDictionary.Add(position.Instrument.FullName,Acct.Strategies.Count-1);
							InstrumentNames.Add(position.Instrument.FullName);
Now that disables the strategy, but there is no corresponding Enable(); or Start(); or Initialize(); function to start it, from what I can tell anyway.

Is there anyway I can do such a thing? Maybe something I'm missing?
zwentz is offline  
Reply With Quote
Old 09-24-2010, 01:23 PM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello zwentz,

Unfortunately there isn't a supported method for starting strategies programatically. Strategies must be enabled by setting enabled to true from chart GUI, or checking the box in the control center.
NinjaTrader_RyanM 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
Start a strategy from another one SMuhr Automated Trading 1 07-05-2010 10:00 AM
Difference between Time Frame start and manual Strategy start Turtle Trader Strategy Development 7 06-15-2010 08:09 AM
How to start a strategy from now stevebong Strategy Development 4 02-20-2010 05:01 PM
Start Strategy volpiemanuele Automated Trading 5 08-07-2008 02:14 AM
start strategy again max-td Strategy Development 5 04-24-2008 04:32 AM


All times are GMT -6. The time now is 12:50 AM.