| 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 |
class UncoupledMultidimensionalAutosequencers(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2019, 12, 13) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
tickers = ["SPY", "TLT"]
# Dictionary to hold Symbol Data
self.symbolData = {}
for ticker in tickers:
# Add equity data
symbol = self.AddEquity(ticker, Resolution.Daily).Symbol
# Create symbol data for respective symbol
self.symbolData[symbol] = SymbolData(self, symbol)
class SymbolData:
def __init__(self, algorithm, symbol):
self.algorithm = algorithm
self.symbol = symbol
# Define our indicator
self.adx = algorithm.ADX(symbol, 14, Resolution.Daily)
# Define our rolling window to hold indicator points
self.adxWindow = RollingWindow[IndicatorDataPoint](2)
# Set our event handler
self.adx.Updated += self.OnAdxUpdated
def OnAdxUpdated(self, sender, updated):
self.algorithm.Debug("ADX updated for " + self.symbol.Value + " @ value" + str(updated))
# Add updated indicator data to rolling window
self.adxWindow.Add(updated)