| Overall Statistics |
|
Total Orders 80 Average Win 0.88% Average Loss -0.63% Compounding Annual Return 38.700% Drawdown 29.200% Expectancy 0.652 Start Equity 100000 End Equity 138824.78 Net Profit 38.825% Sharpe Ratio 1.062 Sortino Ratio 0.999 Probabilistic Sharpe Ratio 47.514% Loss Rate 31% Win Rate 69% Profit-Loss Ratio 1.40 Alpha 0.155 Beta 0.89 Annual Standard Deviation 0.282 Annual Variance 0.079 Information Ratio 0.999 Tracking Error 0.138 Treynor Ratio 0.336 Total Fees $110.25 Estimated Strategy Capacity $0 Lowest Capacity Asset QQQ RIWIV7K5Z9LX Portfolio Turnover 0.99% Drawdown Recovery 110 |
# 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('SPY'),
self.time_rules.after_market_open('SPY', 1),
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)