CODE:
string name = this.IsMetaStrategyComponent ? this.MSC.QualifiedStrategyName : Backtester.Strategy.QualifiedName; Strategy stgy = StrategyFactory.Instance.Find(name); if (stgy != null) { WriteToDebugLog("Name: " + stgy.Name); WriteToDebugLog("Folder: " + stgy.FolderName); WriteToDebugLog($"Path: {stgy.FileName}"); }
Thanks Cone.
The above code seems not working when a strategy is run as a substrategy in a metastrategy. There's null pointer thrown somewhere. Is that possible to make it work in both cases?
The above code seems not working when a strategy is run as a substrategy in a metastrategy. There's null pointer thrown somewhere. Is that possible to make it work in both cases?
Seems i could get the qualified name with the following code then get folder
CODE:
if (_strategy.IsMetaStrategyComponent) { qualifiedName = _strategy.MSC?.QualifiedStrategyName; } else { qualifiedName = _strategy.Backtester.Strategy.QualifiedName; }
Nicely done. Post #1 modified for the complete solution.
Your Response
Post
Edit Post
Login is required