Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
222.427%
Drawdown
0.900%
Expectancy
0
Net Profit
1.291%
Sharpe Ratio
15.755
Probabilistic Sharpe Ratio
86.793%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
-1.997
Beta
0.273
Annual Standard Deviation
0.079
Annual Variance
0.006
Information Ratio
-50.865
Tracking Error
0.209
Treynor Ratio
4.581
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
from System.Drawing import Color

class TestAlgorithm(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2021,9,13)
        self.SetEndDate(2021,9,16)
        self.SetCash("BTC", 1)
        self.btc = self.AddCrypto("BTCUSD", Resolution.Minute).Symbol
        self.Consolidate("BTCUSD", timedelta(minutes=15), self.FifteenMinuteBarHandler)
        self.SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash)
        self.SetWarmUp(4320, Resolution.Minute)
        self.smafast = self.SMA("BTCUSD", 1*1440, Resolution.Minute)
        self.smaslow = self.SMA("BTCUSD", 3*1440, Resolution.Minute)
        self.aroon = AroonOscillator(25, 25)
        fifteenMinuteConsolidator = TradeBarConsolidator(timedelta(minutes=15))
        self.SubscriptionManager.AddConsolidator("BTCUSD", fifteenMinuteConsolidator)
        self.RegisterIndicator("BTCUSD", self.aroon, fifteenMinuteConsolidator)

    
    def FifteenMinuteBarHandler(self, consolidated):
        if self.IsWarmingUp: return
        if not self.aroon.IsReady: return    
        if not self.smafast.IsReady or not self.smaslow.IsReady: return    
    
        price = self.Securities["BTCUSD"].Price
        self.Plot("Price Plot", "Price", price)
        self.Plot("Price Plot", "smafast", self.smafast.Current.Value)
        self.Plot("Price Plot", "smaslow", self.smaslow.Current.Value)
        
        self.Plot("AROON", "aroonup", self.aroon.AroonUp.Current.Value)
        self.Plot("AROON", "aroondown", self.aroon.AroonDown.Current.Value)