diff --git a/compare.py b/compare.py index bf26b3d..2d15221 100644 --- a/compare.py +++ b/compare.py @@ -43,7 +43,7 @@ def run(strategy, data, fund_mode=False): ) thestrats = cerebro.run() thestrat = thestrats[0] - cerebro.plot(iplot=False, style="candlestick") + # cerebro.plot(iplot=False, style="candlestick") return thestrat @@ -61,6 +61,7 @@ if __name__ == "__main__": "max_dd", "max_md", "twr", + "tr", ] ) @@ -79,9 +80,8 @@ if __name__ == "__main__": therun = run(strategy, data) dd = therun.analyzers.drawdown ret = therun.analyzers.returns - # tr = thestrat.analyzers.tr + tr = therun.analyzers.tr # print(next(reversed(tr.get_analysis()))) - # print(tr.get_analysis()) params = therun.calc_params() annual = 100 * ( (1 + params[0] / 100) ** (365 / (endDate - actualStart).days) - 1 @@ -92,6 +92,7 @@ if __name__ == "__main__": dd.get_analysis().max.drawdown, dd.get_analysis().max.moneydown, ret.get_analysis()["vwr"], + list(tr.get_analysis().items())[0][1], ) print("Starting from:", actualStart) print("Time in Market: {:.1f} years".format((endDate - actualStart).days / 365))