Overall Statistics |
Total Trades 116 Average Win 2.06% Average Loss -1.18% Compounding Annual Return 92.615% Drawdown 14.200% Expectancy 0.544 Net Profit 38.651% Sharpe Ratio 2.928 Probabilistic Sharpe Ratio 81.765% Loss Rate 44% Win Rate 56% Profit-Loss Ratio 1.75 Alpha 0.78 Beta 0.001 Annual Standard Deviation 0.267 Annual Variance 0.071 Information Ratio 1.534 Tracking Error 0.49 Treynor Ratio 670.511 Total Fees $116.00 |
from random import random class ModulatedMultidimensionalContainmentField(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 12, 21) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.spy = self.AddEquity("SPY", Resolution.Daily).Symbol self.tsla = self.AddEquity("TSLA", Resolution.Daily).Symbol self.strategy_1_portion = 0.1 self.strategy_2_portion = 0.9 def OnData(self, data): # Strategy #1 if random() > 0.5: if not self.Portfolio[self.spy].Invested: self.SetHoldings(self.spy, random() * self.strategy_1_portion) else: self.SetHoldings(self.spy, 0) # Strategy #2 if random() > 0.5: if not self.Portfolio[self.tsla].Invested: self.SetHoldings(self.tsla, random() * self.strategy_2_portion) else: self.SetHoldings(self.tsla, 0)