Is there a way to read the Strategy Display Name (as it is displayed in the Strategy window) in code?
Rename
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.
Try one of these -
CODE:
WriteToDebugLog(StrategyHost.Strategy.QualifiedName); WriteToDebugLog(StrategyHost.Strategy.Name);
I can't get the StrategyHost class. I'm running WL8 Build 35. Is there an update required to get this class?
Given the context, it's a property of the UserStrategyBase or StrategyBase.
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.
Different with the interface IStrategyHost, there seems to exist such a property but I can't find a way to access it.
I gave you the code.??? It works in a Strategy, right?
Just pass a UserStrategyBase and use it.
Just pass a UserStrategyBase and use it.
Here is another way:
CODE:
public override void Initialize(BarHistory bars) { Strategy s = Backtester.Strategy; WriteToDebugLog(s.Name); WriteToDebugLog(s.QualifiedName); }
Your Response
Post
Edit Post
Login is required