| Overall Statistics |
|
Total Orders 584 Average Win 0.16% Average Loss -0.07% Compounding Annual Return 27.260% Drawdown 3.100% Expectancy 0.491 Start Equity 1000000 End Equity 1128436.18 Net Profit 12.844% Sharpe Ratio 1.261 Sortino Ratio 6.251 Probabilistic Sharpe Ratio 63.156% Loss Rate 55% Win Rate 45% Profit-Loss Ratio 2.34 Alpha 0.17 Beta 0.257 Annual Standard Deviation 0.146 Annual Variance 0.021 Information Ratio 0.744 Tracking Error 0.173 Treynor Ratio 0.716 Total Fees $6050.86 Estimated Strategy Capacity $1700000.00 Lowest Capacity Asset NSPH TXA0MGR7LUG5 Portfolio Turnover 3.24% |
from AlgorithmImports import *
class what_is_happeningg(QCAlgorithm):
def Initialize(self):
self.set_start_date(2016, 1, 1)
self.set_end_date(2016, 7, 1)
self.set_cash(1000000)
self.symbols = {}
# Build universe
self.universe_settings.resolution = Resolution.MINUTE
self.add_universe(self.CoarseFilter)
# Set a warm-up period to ensure indicators are ready
self.set_warmup(200, Resolution.MINUTE)
def CoarseFilter(self, universe):
topVolume = []
# Filter universe
universe = [asset for asset in universe if asset.HasFundamentalData
and asset.volume > 1000000
and asset.price <= 10
and asset.MarketCap <= 1e6]
# Sort universe by highest volume
topVolume = sorted(universe, key=lambda asset: asset.volume, reverse=True)[:10]
# Get symbol objects
top_symbols = [x.symbol for x in topVolume]
return top_symbols
# Changes to the universe get passed into this function
def OnSecuritiesChanged(self, changes):
self.changes = changes
# Sell
for security in self.changes.RemovedSecurities:
if security.Invested:
self.liquidate(security.symbol)
# for security in self.changes.AddedSecurities:
# if not security.Invested and security.is_tradable:
# self.SetHoldings(security.symbol, 0.01)
def OnData(self, data):
if self.IsWarmingUp:
return
for security in self.changes.AddedSecurities:
symbol = security.symbol
# Buy
if data.ContainsKey(symbol) and data[symbol] is not None and data[symbol].Close is not None and self.Securities[symbol].Price is not None:
if not security.Invested and security.is_tradable:
history = self.History(symbol, 1)
if not history.empty:
self.SetHoldings(symbol, 0.01)