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.744
Tracking Error
0.162
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# OHLC SymbolData


class OHLC_SymbolData(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2017, 4, 21)  
        self.SetEndDate(2022, 4, 20) 
        self.stock = self.AddEquity("SPY", Resolution.Daily).Symbol

        
    def OnData(self, data):
        O = float(SymbolData(self, self.stock).open.Current.Value)
        H = float(SymbolData(self, self.stock).high.Current.Value)
        L = float(SymbolData(self, self.stock).low.Current.Value)
        C = float(SymbolData(self, self.stock).close.Current.Value)

        self.Plot(self.stock, "Open", O)
        self.Plot(self.stock, "High", H)
        self.Plot(self.stock, "Low", L)
        self.Plot(self.stock, "Close", C)

        
class SymbolData:
    
    def __init__(self, algo, symbol):
        
        self.open = algo.Identity(symbol, Resolution.Daily, Field.Open)
        self.high = algo.Identity(symbol, Resolution.Daily, Field.High)
        self.low = algo.Identity(symbol, Resolution.Daily, Field.Low)
        self.close = algo.Identity(symbol, Resolution.Daily, Field.Close)

        history = algo.History(symbol, 2, Resolution.Daily).iloc[-1]
        self.open.Update(pd.to_datetime(history.name[1]), history.open) 
        self.high.Update(pd.to_datetime(history.name[1]), history.high) 
        self.low.Update(pd.to_datetime(history.name[1]), history.low)   
        self.close.Update(pd.to_datetime(history.name[1]), history.close)