Overall Statistics |
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 51.089% Drawdown 17.900% Expectancy 0 Net Profit 22.843% Sharpe Ratio 1.794 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.268 Beta 1.374 Annual Standard Deviation 0.244 Annual Variance 0.06 Information Ratio 1.663 Tracking Error 0.189 Treynor Ratio 0.319 Total Fees $2.94 |
class ModulatedDynamicChamber(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 2, 13) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.AddEquity("AAPL", Resolution.Daily) self.AddEquity("SPY", Resolution.Daily) self.SetBenchmark("SPY") mainChart = Chart("Equity Curve With Benchmark") mainChart.AddSeries(Series("Equity Curve", SeriesType.Candle, 0)) mainChart.AddSeries(Series("Benchmark", SeriesType.Line, 0)) self.AddChart(mainChart) self.scale = None def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' if self.scale == None: self.scale = 100000 / data["SPY"].Price if not self.Portfolio.Invested: self.SetHoldings("AAPL", 1) self.Plot("Equity Curve With Benchmark", "Equity Curve", self.Portfolio.TotalPortfolioValue) self.Plot("Equity Curve With Benchmark", "Benchmark", self.Benchmark.Evaluate(self.Time) * self.scale)