모멘텀 2.0

저자:차오장, 날짜: 2022-05-10 10:24:44
태그:추세

모멘텀 2.0은 움직이는 기본 레벨을 가진 정규화된 모멘텀 오시일레이터이다. 오시일레이터 값은 z 점수 기술과 비슷하게 표준편차로 정규화된다. 제로 레벨 대신 지표는 오시일레이터의 반전된 장기 평균 값으로 계산된 기본 레벨을 사용합니다. 모멘텀 오시일레이터에서 사용되는 제로 레벨 교차 신호와 비슷하게, 우리 오시일레이터는 기본 레벨 교차 신호를 계산합니다. 움직이는 기본 수준은 잘못된 신호의 수를 줄이는 데 도움이됩니다. 상승 추세에서 기본 수준은 0 이하이고 하락 추세에서는 그 위에 있습니다. 이것은 트렌드 안정 효과를 고려 할 수 있습니다. 이 경우 반전 신호를 형성하기 위해 오시레이터는 상승 추세에서 낮은 값과 하락 추세에서 더 높은 값을 넘어야합니다.

사용 방법 오시일레이터가 베이스 레벨 위를 넘을 때 상승 신호를 주고 아래를 넘을 때 하락 신호를 낸다. 신호는 각각 녹색과 빨간색 라벨로 표시된다. 히스토그램의 색은 현재 가격 동력의 방향을 나타냅니다. 녹색은 상승 움직임을 나타냅니다. 빨간색은 하락 움직임을 나타냅니다. 파란색 선은 기본 수준을 나타냅니다.

설정 오시레이터 기간 - 모멘텀 오시레이터의 기간을 결정합니다. 기본 레벨 기간 - 기본 레벨을 계산하고 오시레이터를 정상화 할 때 장기 평균화 위해 사용되는 기간을 결정합니다.

백테스트

img


/*backtest
start: 2022-04-09 00:00:00
end: 2022-05-08 23:59:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AstrideUnicorn

//@version=5
indicator("Momentum 2.0", overlay = false)

source = close

// Script Inputs 
window = input(defval=15, title="Oscillator Period")
base_level_window = input.int(defval=450, title="Base Level Period", minval=300)

// Calculate normalized and smoothed momentum oscillator
momentum = ta.mom(source, window) 
momentum_normalized = ( momentum ) / ta.stdev(momentum, base_level_window)
momentum_smoothed = ta.linreg(momentum_normalized, 30,0)

// Calculated the base-level
momentum_base = -ta.ema(momentum_normalized,base_level_window)

// Calculate base-level cross signals
bullish = ta.crossover(momentum_smoothed, momentum_base)  
bearish = ta.crossunder(momentum_smoothed, momentum_base) 

if bullish
    strategy.entry("Enter Long", strategy.long)
else if bearish
    strategy.entry("Enter Short", strategy.short)

관련

더 많은