| Overall Statistics |
|
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Probabilistic Sharpe Ratio 0% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
import csv
def get_crypto_universe(algo):
def is_valid_quote_currency(currency):
return True
# this list if far from completeness
return currency in ("USD", "USDT", "USDC", "BTC", "ETH", "EUR", "GBP", "AUD", "JPY", "XCHF", "CNHT")
DB_URL = "https://raw.githubusercontent.com/QuantConnect/Lean/master/Data/symbol-properties/" \
"symbol-properties-database.csv"
csv = algo.Download(DB_URL)
csv = csv.split("\n")
market = Market.Bitfinex
lines = [line for line in csv if line.startswith(market) and ",crypto," in line]
lines = [s.split(",") for s in lines]
tickers_with_quotes = [(x[1], x[4]) for x in lines]
tickers = [row[0] for row in tickers_with_quotes if is_valid_quote_currency(row[1])]
symbols = [Symbol.Create(x, SecurityType.Crypto, market) for x in tickers]
return ManualUniverseSelectionModel(symbols)
class GeekyFluorescentYellowScorpion(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 6, 13) # Set Start Date
self.SetCash(100_000_000) # Set Strategy Cash
self.UniverseSettings.Resolution = Resolution.Daily
self.SetBrokerageModel(BrokerageName.Bitfinex)
self.AddUniverseSelection(get_crypto_universe(self))
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
for symbol in data.Keys:
if not self.Portfolio[symbol].Invested:
self.SetHoldings(symbol, 0.0001)