I just want to get the Strategies much like the Control Center Strategies tab. I guess I am hoping for the "StrategyBase" so I can potentially control/view their status.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
INFO: List of Strategies
Collapse
X
-
When a strategy is enabled, it is added to the Account.Strategies collection and you can obtain information related to the strategy which is running.
But if you're looking for all strategies which reside on the grid (meaning they are configured, but not enabled), there is no sort of public collection which holds this information.MatthewNinjaTrader Product Management
-
Thanks Matt,
I started to play with this, but it doesn't look like all the strategy methods are exposed at the StrategyBase level such as "IsEnabled", etc. I don't seem to be able to dynamically case this or even at compile time to a strategy eg. "((Strategies).strat).IsEnabled" as I get this error:
Indicator 'SampleChartObjectsCollectionChanged': Error on calling 'OnStateChange' method: Unable to cast object of type 'NinjaTrader.NinjaScript.Strategies.GHPStrategy01' to type 'NinjaTrader.NinjaScript.Strategies.Strategy'.Originally posted by NinjaTrader_Matthew View PostActually - sorry, there is a static Strategies collection in StrategyBase which will get you want you're looking for
Code:foreach (StrategyBase strat in Strategies) { Print(strat.Name + ": " + strat.State); }
Comment
-
I see - my mistake.
The IsEnable property will just let you know if the strategy is enabled on a chart, and the other properties in the StrategyRenderBase are just used for charting.
If you just want to monitor the strategy, in that case, you want to check the State of the strategy. If a State of a Strategy is Historical/Realtime, then it would indicate that it is running. You can also check other properties like "IsWaitUntilFlat", etc.
If there other properties and fields that you cannot locate, or have a situation you're having trouble monitoring, let me know and I'll be happy to look into that further.MatthewNinjaTrader Product Management
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rhyminkevin, Today, 04:58 PM
|
0 responses
14 views
0 likes
|
Last Post
by rhyminkevin
Today, 04:58 PM
|
||
Started by lightsun47, Today, 03:51 PM
|
0 responses
6 views
0 likes
|
Last Post
by lightsun47
Today, 03:51 PM
|
||
Started by 00nevest, Today, 02:27 PM
|
1 response
14 views
0 likes
|
Last Post
by 00nevest
Today, 03:48 PM
|
||
Started by futtrader, 04-21-2024, 01:50 AM
|
4 responses
48 views
0 likes
|
Last Post
by futtrader
Today, 03:01 PM
|
||
Can someone turn this thinkscript into a ninjascript. 5PM CST OHL and Previous Day
by Option Whisperer
Started by Option Whisperer, Today, 09:55 AM
|
1 response
15 views
0 likes
|
Last Post
by bltdavid
Today, 02:44 PM
|
Comment