![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jun 2009
Posts: 84
Thanks: 1
Thanked 0 times in 0 posts
|
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 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); Is there anyway I can do such a thing? Maybe something I'm missing? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |