Overall Statistics
Total Trades
138
Average Win
0.69%
Average Loss
-0.36%
Compounding Annual Return
-98.877%
Drawdown
38.200%
Expectancy
-0.478
Net Profit
-33.187%
Sharpe Ratio
-1.718
Probabilistic Sharpe Ratio
0.496%
Loss Rate
82%
Win Rate
18%
Profit-Loss Ratio
1.96
Alpha
-0.271
Beta
2.241
Annual Standard Deviation
0.555
Annual Variance
0.308
Information Ratio
-1.353
Tracking Error
0.479
Treynor Ratio
-0.425
Total Fees
$2389912.48
Estimated Strategy Capacity
$17000.00
Lowest Capacity Asset
ZRXBTC XJ
from AlgorithmImports import *

class CoinAPIDataAlgorithm(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2022, 1, 1)
        self.SetEndDate(2022, 2, 1)
        self.SetCash(100000)
        self.SetCash("BTC", 1000)

        # Warm up the security with the last known price to avoid conversion error
        self.SetSecurityInitializer(lambda security: security.SetMarketPrice(self.GetLastKnownPrice(security)))
        
        self.UniverseSettings.Resolution = Resolution.Daily
        # Add universe selection of cryptos based on coarse fundamentals
        self.AddUniverse(CryptoCoarseFundamentalUniverse(Market.GDAX, self.UniverseSettings, self.UniverseSelectionFilter))
        
        self.AddAlpha(ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(days=1), 0.025, None))
        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())

    def UniverseSelectionFilter(self, crypto_coarse):
        return [d.Symbol for d in sorted([x for x in crypto_coarse if x.VolumeInUsd], key=lambda x: x.VolumeInUsd, reverse=True)[:5]]

    def OnSecuritiesChanged(self, changes):
        for security in changes.AddedSecurities:
            # Historical data
            history = self.History(security.Symbol, 30, Resolution.Daily)
            self.Debug(f"We got {len(history)} items from our history request")