다중 기술 지표 모멘텀 트렌드 전략


생성 날짜: 2024-01-26 11:45:55 마지막으로 수정됨: 2024-01-26 11:45:55
복사: 0 클릭수: 575
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

다중 기술 지표 모멘텀 트렌드 전략

개요

이 전략은 이동 평균, 상대적으로 약한 지표 ((RSI), 양변 지표 ((VFI) 및 실제 강도 지표 ((TSI) 와 같은 여러 가지 기술 지표를 통합하여 시장의 전반적인 움직임과 추세를 판단하여 중·장선 가격 움직임을 캡처합니다.

전략 원칙

  1. 빠른 라인 RSI ((7일), 정상적인 라인 RSI ((14일), 느린 라인 RSI ((50일) 의 이동 평균을 계산하여 RSI의 다공간 경향과 동력을 판단하십시오.

  2. VFI와 VFI의 이동 평균 EMA (25일), SMA (25일) 을 계산하여 시장의 자금 유입과 유출 상황을 판단한다.

  3. TSI의 장기 평균선과 단기 평균선의 비율을 계산하여 시장의 경향 강도를 판단한다.

  4. RSI, VFI, TSI의 결과를 통합하여 시장의 전반적인 동적 방향을 도출한다.

  5. 시장의 역동성이 있다고 판단했을 때, 코스; 시장의 역동성이 있다고 판단했을 때, 공평하게 평평하게하십시오.

우위 분석

  1. 여러 지표가 결합되어 전체 시장의 움직임과 추세를 보다 포괄적이고 정확하게 판단할 수 있습니다.

  2. VFI는 시장의 자금 유입과 유출을 반영하여 거래 역전을 방지합니다.

  3. TSI 필터는 진동 시를 가려서 신호를 더 안정적으로 전달한다.

  4. 전체적으로 볼 때, 이 전략은 신뢰성이 높고, 승률이 높습니다.

위험 분석

  1. 여러 지표가 결합되어, 파라미터를 설정하는 것은 복잡하며, 최적의 파라미터를 얻기 위해 반복 테스트가 필요합니다.

  2. 엔트리 및 엑시트 전략은 단순하고, 지표가 제공하는 정보를 충분히 활용할 수 없으며, 초단계 반전 손실이 발생할 수 있다.

  3. 하지만, 이 시장은 위기상태에 처해있기 때문에 잘못된 신호와 소액 손실을 초래할 수 있습니다.

최적화 방향

  1. 지표 변수 조합을 최적화하여 최적의 변수를 찾습니다.

  2. 출구 규칙을 추가하여, 역으로 출구를 판단하기 위한 지표들을 사용한다.

  3. 수익보호 제도를 강화하고 소액 손실을 줄여라.

요약하다

이 전략은 여러 지표를 종합적으로 사용하여 시장의 전반적인 동력을 판단하고 시장이 하향 동력을 판단할 때 적자를 취한다. 이 전략은 신뢰성이 높지만, 엔트리 및 엑시트 메커니즘은 간단하며 지표 정보는 충분히 활용되지 않습니다. 매개 변수를 지속적으로 최적화하고 엑시트 규칙을 강화함으로써 전략의 안정성과 수익성을 더욱 향상시킬 수 있습니다.

]

전략 소스 코드
//@version=2
//credit to LazyBear, Lewm444, and others for direct and indirect inputs/////////////////////////////////
//script is very rough, publishing more for collaborative input value than as a finished product/////////
strategy("Momo", overlay=true)
length = input( 50 )
overSold = input( 50 )
overBought = input( 65 )
price = ohlc4

/////////////////////////////////////////////////////macd/////////////////////////////////////////////////

fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)

fast = 12, slow = 26
fastMA = ema(close, fast)
slowMA = ema(close, slow)
MACD = (fastMA - slowMA)
Msignal = (sma(MACD, 9))*40
//plot(Msignal, color=blue, linewidth=3)

/////////////////////////////////////////////////rsi spread/////////////////////////////////////////////////

source = price

RSIFast  = rsi(source, input(7))
RSINorm  = rsi(source, input(14))
RSISlow = rsi(source, input(50))

//plot(RSIFast, color=silver, style=area, histbase=50)
//plot(RSINorm, color=#98b8be, style=area, histbase=50)
//plot(RSISlow, color=#be9e98, style=area, histbase=50)

//plot(RSIFast, color=gray, style=line, linewidth=1)
//plot(RSINorm, color=purple, style=line, linewidth=2)
//plot(RSISlow, color=black, style=line, linewidth=3)

exponential = input(true, title="Exponential MA")

src = (RSIFast)

ma05 = exponential ? ema(src, 05) : sma(src, 05)
ma30 = exponential ? ema(src, 30) : sma(src, 30)
ma50 = exponential ? ema(src, 50) : sma(src, 50)
ma70 = exponential ? ema(src, 70) : sma(src, 70)
ma90 = exponential ? ema(src, 90) : sma(src, 90)
ma100 = exponential ? ema(src, 100) : sma(src, 100)

exponential1 = input(true, title="Exponential MA")

src1 = (RSINorm)

ma051 = exponential1 ? ema(src1, 05) : sma(src1, 05)
ma301 = exponential1 ? ema(src1, 30) : sma(src1, 30)
ma501 = exponential1 ? ema(src1, 50) : sma(src1, 50)
ma701 = exponential1 ? ema(src1, 70) : sma(src1, 70)
ma901 = exponential1 ? ema(src1, 90) : sma(src1, 90)
ma1001 = exponential1 ? ema(src1, 100) : sma(src1, 100)


exponential2 = input(true, title="Exponential MA")

src2 = (RSINorm)

ma052 = exponential2 ? ema(src2, 05) : sma(src2, 05)
ma302 = exponential2 ? ema(src2, 30) : sma(src2, 30)
ma502 = exponential2 ? ema(src2, 50) : sma(src2, 50)
ma702 = exponential2 ? ema(src2, 70) : sma(src2, 70)
ma902 = exponential2 ? ema(src2, 90) : sma(src2, 90)
ma1002 = exponential2 ? ema(src2, 100) : sma(src2, 100)


////////////////////////////////////////////////vfi by LazyBear, modified////////////////////////////////////

VFIlength = input(130, title="VFI length")
coef = input(0.2)
vcoef = input(2.5, title="Max. vol. cutoff")
signalLength=input(10)
signalLength2 = input(100)
smoothVFI=input(false, type=bool)

ma(x,y) => smoothVFI ? sma(x,y) : x

typical=hlc3
inter = log( typical ) - log( typical[1] )
vinter = stdev(inter, 30 )
cutoff = coef * vinter * close
vave = sma( volume, VFIlength )[1]
vmax = vave * vcoef
vc = iff(volume < vmax, volume, vmax) //min( volume, vmax )
mf = typical - typical[1]
vcp = iff( mf > cutoff, vc, iff ( mf < -cutoff, -vc, 0 ) )

vfi = ma(sum( vcp , VFIlength )/vave, 3)
vfima = ema( vfi, 25 )
vfimaS = (sma(vfima, 25))
zima = ema( vfima, signalLength2 )
d=vfi-vfima
vfi_avg = avg(vfi, vfima, vfimaS)
vfi_avgS = (sma(vfi_avg,5))

plot( zima, title="EMA of vfima", color=fuchsia, linewidth=1)
plot( vfimaS, title="SMA of vfima", color=blue, linewidth=1)
plot( vfima , title="EMA of vfi", color=black, linewidth=1)
//plot( vfi, title="vfi", color=green,linewidth=1)
//plot( vfi_avg, title="vfi_avg", color=blue, linewidth=2)
//plot( vfi_avgS, title="vfi_avgS", color=maroon, linewidth=2)

/////////////////////////////////////////////////////tsi////////////////////////////////////////////////

long2 = input(title="Long Length",  defval=24)
short2 = input(title="Short Length",  defval=7)
signal2 = input(title="Signal Length",  defval=13)
pc = change(price)
double_smooth2(src, long2, short2) =>
    fist_smooth2 = ema(src, long2)
    ema(fist_smooth2, short2)
double_smoothed_pc2 = double_smooth2(pc, long2, short2)
double_smoothed_abs_pc2 = double_smooth2(abs(pc), long2, short2)
tsi_value2 = 60 * (double_smoothed_pc2 / double_smoothed_abs_pc2)
//plot( tsi_value2, title="tsi2", color=black, linewidth=1)

////////////////////////////////////////////////////////mjb////////////////////////////////////////////////

trendSignal = avg(tsi_value2, Msignal, vfi)*1.75
T1 = sma(trendSignal, 5)
T2 = ema(trendSignal, 25)
T3 = ema(T2, 25)
//plot( T1, title="Trend", color=red, linewidth=3)
plot( T3, title="Trend3", color=black, linewidth=3)

/////////////////////////////////////////////////////mjb////////////////////////////////////////////////

Momentum = avg (T3, vfimaS, vfima)
plot( Momentum, title="Momentum", color=blue, linewidth=2)
vrsi = rsi(price, length)
clearance = abs(zima - Msignal)

/////////////////////////////////////////////////////mjb////////////////////////////////////////////////

if (not na(vrsi)) 
    if (zima > T3) and (clearance > 5) and (falling(zima, 1) == 1) and (zima > vfimaS) and (zima > vfima) and (falling(T3, 1) == 1) and (zima > 6)
        strategy.entry("ss", strategy.short)
    if (T3 > zima) and (rising(zima, 1) == 1)
        strategy.entry("Zcover", strategy.long)
    if (strategy.openprofit > 750) and (rising(T2, 1) == 1) and (T2 > 10)
        strategy.entry("ProfitTake", strategy.long)
// strategy.risk.allow_entry_in(strategy.direction.short)
// strategy.risk.max_intraday_loss(2000, strategy.cash)