is there any way to set the benchmark symbol programmatically to the current symbol? WL 6 did this but wl7 forces a change on every symbol if you want to do this.
Rename
No there’s currently no way to change the benchmark symbol programmatically in WL8.
Yes. It is explained in the C# Coding QuickRef:
Class: StrategyRunner
Example:
Class: StrategyRunner
Example:
CODE:
using WealthLab.Backtest; using WealthLab.Core; using System; namespace WealthScript3 { public class MyStrategy : UserStrategyBase { //Initialize public override void Initialize(BarHistory bars) { } //Execute public override void Execute(BarHistory bars, int idx) { } //Backtest Completed (executes once) public override void BacktestComplete() { StrategyRunner sr = new StrategyRunner(); foreach (BarHistory bars in BacktestData) sr.Symbols.Add(bars.Symbol); sr.BenchmarkSymbol = "SPY"; Backtester bt = sr.RunBacktest("RSI Agita"); WriteToDebugLog("RSI Agita on backtested data with SPY benchmark Alpha= " + bt.Metrics.Alpha.ToString("N2")); sr.BenchmarkSymbol = "QQQ"; bt = sr.RunBacktest("RSI Agita"); WriteToDebugLog("RSI Agita on backtested data with QQQ benchmark Alpha= " + bt.Metrics.Alpha.ToString("N2")); } } }
We’ll yes that’s a roundabout way 🙂
Really a backtest within a backtest though.
Really a backtest within a backtest though.
taking properties from the backtester does give some insight. What Im looking for is to see the generated equity curve by the strategy contrasted not with the "benchmark" but rather the symbol Buy and Hold, i.e. make the benchmark just be B&H of the symbol
QUOTE:
... I'm looking for ... the generated equity curve by the strategy contrasted not with the "benchmark" but rather the symbol Buy and Hold, ...
WL6 includes a Buy and Hold case on the equity curve. You could post a feature request to do the same in WL8. It would be nice to have a checkbox to turn it on if desired.
Your Response
Post
Edit Post
Login is required