24 internal sealed
class DailyReturnsReportElement : ChartReportElement
47 public override string Render()
49 var backtestReturns = ResultsUtil.EquityPoints(_backtest);
50 var liveReturns = ResultsUtil.EquityPoints(_live);
52 var backtestSeries =
new Series<DateTime, double>(backtestReturns.Keys, backtestReturns.Values);
53 var liveSeries =
new Series<DateTime, double>(liveReturns.Keys, liveReturns.Values);
56 var backtestResampled = backtestSeries.ResampleEquivalence(date => date.Date, s => s.LastValue()).PercentChange().DropMissing() * 100;
57 var liveResampled = liveSeries.ResampleEquivalence(date => date.Date, s => s.LastValue()).PercentChange().DropMissing() * 100;
62 var backtestList =
new PyList();
63 backtestList.Append(backtestResampled.Keys.ToList().ToPython());
64 backtestList.Append(backtestResampled.Values.ToList().ToPython());
66 var liveList =
new PyList();
67 liveList.Append(liveResampled.Keys.ToList().ToPython());
68 liveList.Append(liveResampled.Values.ToList().ToPython());
70 base64 = Charting.GetDailyReturns(backtestList, liveList);
72 backtestList.Dispose();