| Overall Statistics |
|
Total Orders 79 Average Win 8.66% Average Loss -5.62% Compounding Annual Return -3.296% Drawdown 67.300% Expectancy 0.046 Start Equity 100000 End Equity 84564.55 Net Profit -15.435% Sharpe Ratio 0.1 Sortino Ratio 0.139 Probabilistic Sharpe Ratio 1.065% Loss Rate 59% Win Rate 41% Profit-Loss Ratio 1.54 Alpha 0.002 Beta 0.646 Annual Standard Deviation 0.473 Annual Variance 0.224 Information Ratio -0.05 Tracking Error 0.467 Treynor Ratio 0.073 Total Fees $614.53 Estimated Strategy Capacity $1000.00 Lowest Capacity Asset PRPO WLST8ENVMBTX Portfolio Turnover 0.40% Drawdown Recovery 347 |
#region imports
from AlgorithmImports import *
#endregion
# https://quantpedia.com/Screener/Details/25
class SmallCapInvestmentAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(self.end_date - timedelta(5*365))
self.set_cash(100_000)
self.settings.seed_initial_prices = True
date_rule = self.date_rules.year_start('SPY')
self.universe_settings.schedule.on(date_rule)
self.universe_settings.resolution = Resolution.DAILY
self._universe = self.add_universe(self._select_assets)
self.schedule.on(
date_rule,
self.time_rules.midnight,
self._rebalance
)
def _select_assets(self, fundamentals):
# Drop stocks which have no fundamental data or have low price
selected = [f for f in fundamentals if f.price > 5 and (f.market_cap or 0) > 0]
return [f.symbol for f in sorted(selected, key=lambda f: f.market_cap)[:10]]
def _rebalance(self):
if len(self._universe.selected) == 0: return
weight = 1 / len(self._universe.selected)
self.set_holdings([PortfolioTarget(symbol, weight) for symbol in self._universe.selected], True)