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
-3.341
Tracking Error
0.108
Treynor Ratio
0
Total Fees
$0.00
from clr import AddReference
AddReference("System")
AddReference("QuantConnect.Algorithm")
AddReference("QuantConnect.Common")

from System import *
from QuantConnect import *
from QuantConnect.Algorithm import *
from QuantConnect.Data.Consolidators import *
from datetime import timedelta

class TachyonQuantumAutosequencers(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 7, 1)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        
        # list of symbols we want to trade
        self.symbolList = ["BTCUSD","ETHUSD","LTCUSD","BCHUSD"]
        
        # dictionary to hold rolling window for each symbol
        self.daily = {}
        self.window = {}
        
        self.cryptoSymbols = []
        
        for name in self.symbolList:
            cryptoSymbol = self.AddCrypto(name, Resolution.Daily, Market.GDAX).Symbol
            
            self.cryptoSymbols.append(cryptoSymbol)
            
            dailyConsolidator = TradeBarConsolidator(timedelta(days=1))
            dailyConsolidator.DataConsolidated += self.DailyConsolidator
            self.SubscriptionManager.AddConsolidator(cryptoSymbol, dailyConsolidator)
            self.daily[cryptoSymbol] = RollingWindow[TradeBar](2)
            self.window[cryptoSymbol] = RollingWindow[TradeBar](2)
        
    def DailyConsolidator(self, sender, bar):
        self.daily[bar.Symbol].Add(bar)
        
    
    # Accessing requested data
    def OnData(self, data):
        
        for symbol in self.cryptoSymbols: 
            if not data.ContainsKey(symbol):
                return
    
            self.window[symbol].Add(data.Bars[symbol])