Overall Statistics
Total Trades
1
Average Win
0%
Average Loss
0%
Compounding Annual Return
45.335%
Drawdown
5.600%
Expectancy
0
Net Profit
3.337%
Sharpe Ratio
1.965
Probabilistic Sharpe Ratio
58.145%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0.345
Beta
0.099
Annual Standard Deviation
0.195
Annual Variance
0.038
Information Ratio
-0.02
Tracking Error
0.262
Treynor Ratio
3.883
Total Fees
$1.45
import pickle

class DynamicTachyonCircuit(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2020, 10, 23)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Daily)
        self.portfolio_values = []
        
    def OnEndOfAlgorithm(self):
        self.ObjectStore.SaveBytes('data', pickle.dumps(self.portfolio_values))
    
    def OnEndOfDay(self):
        self.portfolio_values.append(self.Portfolio.TotalPortfolioValue)
    
    def OnData(self, data):
        if not self.Portfolio.Invested:
            self.SetHoldings('SPY', 1)
            
        # artificially cause an error in November
        if self.Time.month == 11:
            pass
            # x = 10/0  # uncomment this line to cause the error