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
-2.237
Tracking Error
0.13
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
class FormalGreenDragonfly(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 1, 1)  
        self.SetEndDate(2021, 5, 11) 
        self.SetCash(100000)
        res = Resolution.Daily
        self.stock = self.AddEquity('SPY', res).Symbol
        period = 21
        self.SetWarmUp(period * 5)
        
        self.ema = self.EMA(self.stock, period, res)
        self.ema_std = IndicatorExtensions.Of(StandardDeviation(period), self.ema)
        
        self.std = self.STD(self.stock, period, res)
        self.ema_std_2 = IndicatorExtensions.Of(self.std, self.ema)

    def OnData(self, data):
        if self.IsWarmingUp or  not (self.ema.IsReady and self.ema_std.IsReady): 
            return 
        
        self.Plot(f"EMA", 'Value', self.ema.Current.Value)
        self.Plot(f"EMA_STD", 'Value', self.ema_std.Current.Value)
        self.Plot(f"EMA_STD", 'Value 2', self.ema_std_2.Current.Value)