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 09try, 03-29-2024, 01:27 PM
|
9 responses
77 views
0 likes
|
Last Post
by ntcat
Today, 01:16 PM
|
||
Started by ninza33, Today, 06:28 AM
|
4 responses
15 views
0 likes
|
Last Post
by ninza33
Today, 12:38 PM
|
||
Started by ScottWalsh, Yesterday, 04:29 PM
|
4 responses
18 views
0 likes
|
Last Post Today, 12:00 PM | ||
Started by Gibranes, Today, 10:05 AM
|
4 responses
19 views
0 likes
|
Last Post
by Gibranes
Today, 11:54 AM
|
||
Started by f.saeidi, Today, 08:12 AM
|
2 responses
15 views
0 likes
|
Last Post
by f.saeidi
Today, 11:46 AM
|
Comment