Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
45.951%
Drawdown
6.600%
Expectancy
0
Net Profit
20.831%
Sharpe Ratio
3.216
Probabilistic Sharpe Ratio
86.114%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0.996
Annual Standard Deviation
0.151
Annual Variance
0.023
Information Ratio
-3.909
Tracking Error
0.001
Treynor Ratio
0.488
Total Fees
$1.46
Estimated Strategy Capacity
$58000000.00
from QuantConnect.Statistics import *

class CrawlingYellowGoat(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 10, 20)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Minute)
        self.performance = []

    def OnData(self, data):
      
        if not self.Portfolio.Invested:
            self.SetHoldings("SPY", 1)
        else:
            self.performance.append(self.Portfolio.TotalPortfolioValue)
            if len(self.performance) > 10:
                sharpe = Statistics.SharpeRatio(self.performance, 0)