| Overall Statistics |
|
Total Orders 53 Average Win 1.59% Average Loss -0.46% Compounding Annual Return 67.808% Drawdown 11.700% Expectancy 2.995 Start Equity 100000 End Equity 168046.61 Net Profit 68.047% Sharpe Ratio 2.265 Sortino Ratio 2.138 Probabilistic Sharpe Ratio 85.260% Loss Rate 10% Win Rate 90% Profit-Loss Ratio 3.44 Alpha 0.398 Beta 0.347 Annual Standard Deviation 0.2 Annual Variance 0.04 Information Ratio 1.157 Tracking Error 0.252 Treynor Ratio 1.307 Total Fees $78.08 Estimated Strategy Capacity $0 Lowest Capacity Asset TSLA UNU3P8Y3WFAD Portfolio Turnover 0.66% Drawdown Recovery 13 |
# region imports
from AlgorithmImports import *
# endregion
class VirtualMagentaBeaver(QCAlgorithm):
def initialize(self):
self.set_start_date(2020, 1, 1)
self.set_end_date(2021, 1, 1)
self.set_cash(100000)
# Universe: Top 10 most liquid US equities
self.universe_settings.resolution = Resolution.DAILY
self._universe = self.add_universe(self.universe.top(10))
# Rebalance monthly on the first trading day
self.schedule.on(self.date_rules.month_start(),
self.time_rules.after_market_open("SPY", 0),
self.rebalance)
def rebalance(self):
symbols = list(self._universe.selected)
if not symbols:
return
targets = [PortfolioTarget(symbol, 1.0 / len(symbols)) for symbol in symbols]
self.set_holdings(targets, True)