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 Barry Milan, Yesterday, 10:35 PM
|
5 responses
16 views
0 likes
|
Last Post Today, 05:37 PM | ||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM | ||
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
13 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
12 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
8 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
Comment