Overall Statistics
Total Trades
65
Average Win
0.86%
Average Loss
-0.80%
Compounding Annual Return
-8.753%
Drawdown
11.900%
Expectancy
-0.151
Net Profit
-4.489%
Sharpe Ratio
-0.448
Probabilistic Sharpe Ratio
12.891%
Loss Rate
59%
Win Rate
41%
Profit-Loss Ratio
1.08
Alpha
-0.064
Beta
0.001
Annual Standard Deviation
0.142
Annual Variance
0.02
Information Ratio
-2.097
Tracking Error
0.202
Treynor Ratio
-100.531
Total Fees
$126.94
Estimated Strategy Capacity
$850000000.00
class MuscularAsparagusGoat(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 10, 1)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.symbol = self.AddEquity("SPY", Resolution.Daily).Symbol
        self.ema = self.EMA(self.symbol, int(self.GetParameter('fast')))


    def OnData(self, data):
        if not (data.ContainsKey(self.symbol) and data[self.symbol] is not None):
            return

        if data[self.symbol].Price > self.ema.Current.Value:
            self.SetHoldings("SPY", 1)
        else:
            self.SetHoldings("SPY", -1)