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
-469.988
Tracking Error
0.611
Treynor Ratio
0
Total Fees
$0.00
from QuantConnect.Data.Custom.Tiingo import *

class TransdimensionalResistanceCircuit(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 4, 5)  # Set Start Date
        self.SetEndDate(2020, 4, 7)
        self.SetCash(100000)
        
        self.symbol = Symbol.Create("AAPL", SecurityType.Equity, Market.USA)
        self.SetUniverseSelection( ManualUniverseSelectionModel([self.symbol]) )
        self.UniverseSettings.Resolution = Resolution.Daily
        
        self.alpha = MyAlpha()
        self.SetAlpha(self.alpha)

        self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
        
        self.SetExecution(ImmediateExecutionModel())


    def OnData(self, data):

        if data.ContainsKey(self.symbol) and data[self.symbol] is not None:
            self.Log("New price data")
        elif self.alpha.tiingo_symbol is not None and data.ContainsKey(self.alpha.tiingo_symbol): 
            self.Log("New Tiingo data")
            
    
class MyAlpha(AlphaModel):
    tiingo_symbol = None

    def Update(self, algorithm, data):
        return []
    
    def OnSecuritiesChanged(self, algorithm, changes):
        for security in changes.AddedSecurities:
            self.tiingo_symbol = algorithm.AddData(TiingoNews, security.Symbol).Symbol