- ago
Is there a way to read the Strategy Display Name (as it is displayed in the Strategy window) in code?
0
635
Solved
8 Replies

Reply

Bookmark

Sort
- ago
#1
StrategyName?
https://www.wealth-lab.com/Support/ApiReference/UserStrategyBase
0
- ago
#2
QUOTE:

StrategyName
public string StrategyName
Returns the class name of the executing strategy that derives from UserStrategyBase.


I do not need the class name but the display name, as it is shown in the program window.
0
Cone8
 ( 4.83% )
- ago
#3
Try one of these -

CODE:
         WriteToDebugLog(StrategyHost.Strategy.QualifiedName);          WriteToDebugLog(StrategyHost.Strategy.Name);
0
- ago
#4
I can't get the StrategyHost class. I'm running WL8 Build 35. Is there an update required to get this class?
0
Cone8
 ( 4.83% )
- ago
#5
Given the context, it's a property of the UserStrategyBase or StrategyBase.
0
- ago
#6
I had a quick look at the metadata of the UserStrategyBase and StrategyBase classes, but couldn't find anything.

Different with the interface IStrategyHost, there seems to exist such a property but I can't find a way to access it.
0
Cone8
 ( 4.83% )
- ago
#7
I gave you the code.??? It works in a Strategy, right?
Just pass a UserStrategyBase and use it.
0
Glitch8
 ( 11.08% )
- ago
#8
Here is another way:

CODE:
public override void Initialize(BarHistory bars) {          Strategy s = Backtester.Strategy;          WriteToDebugLog(s.Name);          WriteToDebugLog(s.QualifiedName); }
1
Best Answer

Reply

Bookmark

Sort