Overall Statistics |
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Probabilistic Sharpe Ratio 0% Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio -3.428 Tracking Error 0.655 Treynor Ratio 0 Total Fees $0.00 Estimated Strategy Capacity $0 Lowest Capacity Asset |
# NMA indicator # -------------------------------------------------------------------------------- MA_1 = 120; MA_2 = 12; ALPFA = float(MA_1/ MA_2); BETA = (ALPFA * float(MA_1 - 1)) / float(MA_1 - ALPFA); GAMMA = float(BETA) + 1.0; # -------------------------------------------------------------------------------- class MuscularGreenAlbatross(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 9, 1) self.SetEndDate(2021, 10, 7) self.SetBrokerageModel(BrokerageName.Bitfinex, AccountType.Cash) self.btc = self.AddCrypto("BTCUSD", Resolution.Daily).Symbol self.SetBenchmark("BTCUSD") self.SetWarmUp((MA_1 + MA_2), Resolution.Daily) self.ma1 = self.SMA(self.btc, MA_1, Resolution.Daily) self.ma2_ma1 = IndicatorExtensions.Of(SimpleMovingAverage(MA_2), self.ma1) def OnData(self, data): if self.IsWarmingUp: return if not self.ma1.IsReady or not self.ma2_ma1.IsReady: return ma1 = self.ma1.Current.Value ma2_ma1 = self.ma2_ma1.Current.Value nma = ma1 * GAMMA - ma2_ma1 * BETA self.Plot("Benchmark", "nma", nma) self.Plot("Calc", "step 1", ma1 * GAMMA ) self.Plot("Calc", "step 2", ma2_ma1 * BETA) self.Plot("Calc", "step 3", nma)