멀티 모멘텀 지표 컴보 전략

저자:차오장, 날짜: 2023-09-24 13:24:47
태그:

전반적인 설명

이 실험 전략은 데 모멘텀, RMI, 트리플 HMA RSI, 더블 EVW RSI, 트리플 EMA RSI 및 다른 모멘텀 지표를 결합하여 모든 지표가 정렬 된 신호를 줄 때 위치를 입력합니다. 다중 요소 실험 모델.

전략 논리

  1. 드 모멘텀을 계산하고 구매 및 판매 라인을 설정합니다.

  2. RMI, 트리플 HMA RSI, 트리플 EVW RSI, 트리플 EMA RSI 및 기타 지표를 계산합니다.

  3. 각 지표에 대한 구매 및 판매 라인을 설정합니다.

  4. 드 모멘텀이 구매 라인 위에 넘어가면 다른 지표가 해당 구매 라인 아래에 있는지 확인합니다. 모든 조건이 충족되면 긴 신호를 생성합니다.

  5. 반대로 데 모멘텀이 판매선 아래를 넘어가고 다른 지표가 판매선을 넘어가면 짧은 신호를 생성합니다.

장점

  1. 지표를 결합하면 서로 검증되면서 잘못된 신호를 피할 수 있습니다.

  2. 데 모멘텀은 트렌드 변화를 민감하게 포착합니다.

  3. RMI는 과잉 구매/ 과잉 판매 수준을 식별하기 위한 모멘텀 레벨을 나타냅니다.

  4. HMA RSI, EVW RSI 등으로 다른 RSI 계산을 테스트합니다.

  5. 유연한 다중 지표 조합으로 지표 효과 테스트가 가능합니다.

위험성

  1. 다중 지표 조합에 대한 요구 사항은 충족하기가 더 어렵고 거래가 적고 기회를 놓치고 있습니다.

  2. 스톱 로스 같은 위험 통제 메커니즘이 없습니다.

  3. 시간 프레임에 의존하는 지표 성능은 모든 기간에 작동하지 않을 수 있습니다.

  4. 매개 변수 최적화가 불가능하고 매개 변수 조정이 불가능합니다.

  5. 전략의 검증을 위해 백테스트 데이터가 충분하지 않습니다.

가능한 해결책:

  1. 더 많은 거래에 대한 지표 기준을 느슨하게 합니다.

  2. 손실을 제한하기 위해 후속 손실 또는 하드 스톱 손실을 포함합니다.

  3. 최적의 매개 변수를 찾기 위해 다양한 제품과 시간 프레임을 테스트합니다.

  4. 매개 변수 최적화를 위해 기계 학습이나 그리드 검색을 사용하세요.

  5. 안정성을 확보하기 위해 더 많은 시장에서 백테스트

최적화 방향

  1. 최적의 구성을 찾기 위해 다른 매개 변수 세트를 테스트합니다.

  2. 적응 가능한 다중 시간 스케일 모멘텀 표시기를 추가합니다.

  3. 트렌드 검출을 포함하여 트렌드 반대 거래를 피합니다.

  4. 머신러닝을 사용하여 다중 지표 가중을 개선합니다.

  5. 이동 평균 시스템과 결합하여 항목을 개선합니다.

요약

이 전략은 여러 동력 지표를 결합하여 더 신뢰할 수있는 트렌드 전환점을 식별하려고합니다. 다각화된 논리는 매개 변수 선택, 지표 가중, 위험 제어 등과 같은 분야에서 확장성과 최적화 잠재력이 있습니다. 안정성을 보장하면서 더 많은 품질 신호를 획득하기 위해, 그러나 곡선 적합성 같은 위험이 관리되어야합니다.


/*backtest
start: 2023-08-24 00:00:00
end: 2023-09-23 00:00:00
period: 1h
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/
// © burgercrisis

//@version=4
strategy("RMI + Triple HMRSI + Double EVWRSI + TERSI Strategy")

//* Backtesting Period Selector | Component *//
//* https://www.tradingview.com/script/eCC1cvxQ-Backtesting-Period-Selector-Component *//
//* https://www.tradingview.com/u/pbergden/ *//
//* Modifications made *//
testStartYear = input(2021, "Backtest Start Year") 
testStartMonth = input(1, "Backtest Start Month")
testStartDay = input(1, "Backtest Start Day")
testPeriodStart = timestamp(testStartYear,testStartMonth,testStartDay,0,0)

testStopYear = input(999999, "Backtest Stop Year")
testStopMonth = input(9, "Backtest Stop Month")
testStopDay = input(26, "Backtest Stop Day")
testPeriodStop = timestamp(testStopYear,testStopMonth,testStopDay,0,0)

testPeriod() => true
/////////////// END - Backtesting Period Selector | Component ///////////////


src = input(close, "Price", type = input.source)
CMOlength = input(9, minval=1, title="Alpha Chande Momentum Length")

//CMO
momm = change(src)
f1(m) => m >= 0.0 ? m : 0.0
f2(m) => m >= 0.0 ? 0.0 : -m
m1 = f1(momm)
m2 = f2(momm)
sm1 = sum(m1, CMOlength)
sm2 = sum(m2, CMOlength)
percent(nom, div) => 100 * nom / div
chandeMO = percent(sm1-sm2, sm1+sm2)
plot(chandeMO, "Chande MO", color=color.blue)




//RMI
// Copyright (c) 2018-present, Alex Orekhov (everget)
// Relative Momentum Index script may be freely distributed under the MIT license.
length3 = input(title="RMI Length", type=input.integer, minval=1, defval=30)
momentumLength3 = input(title="RMI Momentum ", type=input.integer, minval=1, defval=25)
up3 = rma(max(change(src, momentumLength3), 0), length3)
down3 = rma(-min(change(src, momentumLength3), 0), length3)

rmi3 = (down3 == 0 ? 100 : up3 == 0 ? 0 : 100 - (100 / (1 + up3 / down3)))-50
//
//
// end RMI, end Alex Orekhov copywrite
//
//

lengthMA = input(7)
lengthRSI = input(14)
thrsi = hma(hma(hma(rsi(src, lengthRSI), lengthMA), lengthMA), lengthMA)
thrsi1 = (thrsi-50)*10

lengthMA2 = input(7)
lengthRSI2 = input(14)
devwrsi = ((ema(ema(vwma(rsi(src, lengthRSI2), lengthMA2), lengthMA2), lengthMA2))-50)*5

lengthMA3 = input(7)
lengthRSI3 = input(14)
tersi = ((ema(ema(ema(rsi(src, lengthRSI3), lengthMA3), lengthMA3), lengthMA3))-50)*10

rmirsi = ((thrsi*rmi3/25))

//Boundary Lines

obLevel1 = input(0, title="Chande Sellline")
osLevel1 = input(0, title="Chande Buyline")
hline(obLevel1, color=#0bc4d9)
hline(osLevel1, color=#0bc4d9)

obLevel2 = input(0, title="Triple HMRSI Sellline")
osLevel2 = input(0, title="Triple HMRSI Buyline")
hline(obLevel2, color=#5a0bd9)
hline(osLevel2, color=#5a0bd9)

obLevel3 = input(0, title="DEVWRSI Sellline")
osLevel3 = input(0, title="DEVWRSI Buyline")
hline(obLevel3, color=#5a0bd9)
hline(osLevel3, color=#5a0bd9)

obLevel4 = input(0, title="TERSI Sellline")
osLevel4 = input(0, title="TERSI Buyline")
hline(obLevel4, color=#5a0bd9)
hline(osLevel4, color=#5a0bd9)

obLevel5 = input(0, title="RMI Sellline")
osLevel5 = input(0, title="RMI Buyline")
hline(obLevel5, color=#5a0bd9)
hline(osLevel5, color=#5a0bd9)

obLevel6 = input(0, title="RMI*RSI Sellline")
osLevel6 = input(0, title="RMI*RSI Buyline")
hline(obLevel6, color=#5a0bd9)
hline(osLevel6, color=#5a0bd9)

plot((thrsi1), title="THRSI")
plot(devwrsi, color=color.red, title="DEVWRSI")
plot(tersi, color=color.yellow, title="TERSI")
plot(rmirsi, color=color.purple, title="RMI*HMRSI")
plot(rmi3, color=color.orange, title="RMI")




longcondition1 = crossover(chandeMO, osLevel1)
shortcondition1 = crossunder(chandeMO, obLevel1)
longcondition2 = rmirsi<osLevel6 and rmi3<osLevel5 and tersi<osLevel4 and devwrsi<osLevel3 and thrsi1<osLevel2  and longcondition1
shortcondition2 = rmirsi>obLevel6 and rmi3>obLevel5 and tersi>obLevel4 and devwrsi>obLevel3 and thrsi1>obLevel2  and shortcondition1

if testPeriod()
    if longcondition2
        strategy.entry("Buy", strategy.long)
    if shortcondition2
        strategy.entry("Sell", strategy.short)






hline(0, color=#C0C0C0, linestyle=hline.style_dashed, title="Zero Line")

더 많은