17 using System.Collections.Generic;
26 internal sealed
class LeverageUtilizationReportElement : ChartReportElement
30 private List<PointInTimePortfolio> _backtestPortfolios;
31 private List<PointInTimePortfolio> _livePortfolios;
42 public LeverageUtilizationReportElement(
47 List<PointInTimePortfolio> backtestPortfolios,
48 List<PointInTimePortfolio> livePortfolios)
51 _backtestPortfolios = backtestPortfolios;
53 _livePortfolios = livePortfolios;
61 public override string Render()
63 var backtestSeries = Metrics.LeverageUtilization(_backtestPortfolios).FillMissing(
Direction.Forward);
64 var liveSeries = Metrics.LeverageUtilization(_livePortfolios).FillMissing(
Direction.Forward);
69 var backtestList =
new PyList();
70 var liveList =
new PyList();
72 backtestList.Append(backtestSeries.Keys.ToList().ToPython());
73 backtestList.Append(backtestSeries.Values.ToList().ToPython());
75 liveList.Append(liveSeries.Keys.ToList().ToPython());
76 liveList.Append(liveSeries.Values.ToList().ToPython());
78 base64 = Charting.GetLeverage(backtestList, liveList);