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.534
Tracking Error
0.051
Treynor Ratio
0
Total Fees
$0.00
class QuantumTachyonGearbox(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 11, 17)  # Set Start Date
        self.SetEndDate(2019, 11, 30)
        self.SetCash(100000)  # Set Strategy Cash
        self.sym = self.AddEquity("SPY", Resolution.Daily).Symbol
        self.sma = self.SMA(self.sym, 3)

    def OnData(self, data):
        if "SPY" not in data.Bars:
            return
        
        if not self.sma.IsReady:
            self.sma.Update(data.Time, data["SPY"].Close)
            return
        
        workingBarLast = 100
        s = self.sma.RollingSum.Current.Value
        p = self.sma.Period
        workingBarSMA = (s - (s / p) + workingBarLast) / p
        self.Log(f"WorkingBar SMA: {workingBarSMA}")
        
        self.sma.Update(data.Time, data["SPY"].Close)
        self.Log(f"Regular SMA: {self.sma.Current.Value}")