Overall Statistics |
Total Trades 2725 Average Win 0.09% Average Loss -0.02% Compounding Annual Return 13.949% Drawdown 10.400% Expectancy 3.627 Net Profit 269.458% Sharpe Ratio 1.168 Probabilistic Sharpe Ratio 66.915% Loss Rate 15% Win Rate 85% Profit-Loss Ratio 4.46 Alpha 0.033 Beta 0.542 Annual Standard Deviation 0.084 Annual Variance 0.007 Information Ratio -0.303 Tracking Error 0.075 Treynor Ratio 0.181 Total Fees $2745.91 Estimated Strategy Capacity $41000.00 Lowest Capacity Asset VXZB WRBPJAJZ2Q91 |
import numpy as np class spyVXXAlgo(QCAlgorithm): def Initialize(self): self.SetStartDate(2012,1, 1) # Set Start Date self.SetEndDate(2022,1,1) # Set End Date self.SetCash(100000) # Set Strategy Cash # Define the security universe self.tickers = ["SPY","VXZ"] for symbol in self.tickers: self.AddEquity(symbol, Resolution.Daily) def OnData(self, data): # Rebalance portfolio daily for symbol in self.tickers: if symbol=="SPY": self.SetHoldings(symbol,0.74) else: self.SetHoldings(symbol,0.25)