Overall Statistics
Total Trades
6
Average Win
1.78%
Average Loss
0%
Compounding Annual Return
23.991%
Drawdown
3.100%
Expectancy
0
Net Profit
5.425%
Sharpe Ratio
3.069
Probabilistic Sharpe Ratio
78.709%
Loss Rate
0%
Win Rate
100%
Profit-Loss Ratio
0
Alpha
0.162
Beta
0.094
Annual Standard Deviation
0.076
Annual Variance
0.006
Information Ratio
-2.207
Tracking Error
0.242
Treynor Ratio
2.5
Total Fees
$10.30
class ResistanceMultidimensionalFlange(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 4, 12)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.spy = self.AddEquity('SPY', Resolution.Minute).Symbol
        self.sma20 = SimpleMovingAverage(20)
        self.Schedule.On(self.DateRules.EveryDay('SPY'), self.TimeRules.BeforeMarketClose('SPY', 10), self.UpdateSMA)

    def UpdateSMA(self):
        if self.CurrentSlice.ContainsKey(self.spy):
            self.sma20.Update(self.CurrentSlice[self.spy].EndTime, self.CurrentSlice[self.spy].Close)
            if self.sma20.IsReady:
                self.Plot('Custom', 'SMA20', self.sma20.Current.Value)
                if self.sma20.Current.Value > self.CurrentSlice[self.spy].Close:
                    self.SetHoldings(self.spy, 1.0)
                else:
                    self.Liquidate()