동력 이중 이동 평균 거래 전략

저자:차오장, 날짜: 2023-12-01 18:13:21
태그:

img

전반적인 설명

모멘텀 이중 이동 평균 거래 전략 (Momentum Dual Moving Average Trading Strategy) 은 가격 모멘텀과 트렌드 지표를 모두 활용하는 단기 거래 전략이다. 이 전략은 폐쇄 가격, 개시 가격, 가격 채널, 빠른 RSI 및 기타 지표를 사용하여 거래 신호를 생성합니다. 가격 브레이크 또는 지표 신호가 나타날 때 긴 또는 짧은 포지션을 설정합니다. 또한 손실이 특정 수준에 도달하면 청산을 강요하기 위해 스톱 로스 조건을 설정합니다.

전략 원칙

전략은 주로 다음 판단 지표에 기초하여 거래 결정을 합니다.

  1. 가격 채널: 채널 범위를 결정하기 위해 지난 30 개의 촛불의 가장 높고 가장 낮은 가격을 계산합니다. 채널 중점 이상의 폐쇄 가격은 상승으로 간주됩니다. 채널 중점 이하의 폐쇄 가격은 하락으로 간주됩니다.

  2. 빠른 RSI: 최근 2 개의 촛불의 RSI 값을 계산합니다. 25 이하의 RSI는 과판된 것으로 간주되며 75 이상의 RSI는 과반된 것으로 간주됩니다.

  3. 진양선: 최근 2개의 촛불의 개체 크기를 계산합니다. 두 개의 빨간 촛불은 하향 신호를 제안하고 두 개의 녹색 촛불은 상승 신호를 제안합니다.

  4. 손실을 멈추는 조건: 손실을 제한하기 위해 손실이 특정 비율에 도달하면 강제 청산.

트렌드, 모멘텀 및 과잉 구매/ 과잉 판매 지표의 조합 신호로, 이 단기 전략은 반전을 효과적으로 식별하고 적시에 거래 신호를 생성할 수 있습니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 여러 지표를 결합하여 신호의 정확성을 향상시켜서 잘못된 신호를 필터링하는 데 도움이됩니다.

  2. 일반 RSI보다 민감한 빠른 RSI의 사용으로 전환점에 대한 더 빠른 반응.

  3. 다양한 제품과 시간 프레임에 걸쳐 높은 신뢰성, 백테스트 중에 엄격한 매개 변수 최적화 덕분에.

  4. 예상 이상의 잠재적 손실을 제어하기 위한 자동 스톱 로스 메커니즘

위험 분석

이 전략의 몇 가지 위험:

  1. 부적절한 가격 채널 매개 변수 설정은 충격을 유발할 수 있습니다. 너무 좁은 채널은 잘못된 브레이크를 유발할 수 있습니다.

  2. 일방적 포지션 보유 시간은 강한 트렌드 중 너무 길어 예측을 초과 할 수 있습니다.

  3. 잘못된 스톱 손실 포인트 설정은 손실을 증가시킬 수 있습니다. 이 매개 변수는 신중한 구성이 필요합니다. 너무 높거나 너무 낮으면 불리 할 수 있습니다.

우리는 채널 매개 변수를 조정하고, 입력 시기를 최적화하고, 동적으로 스톱 손실 지점을 조정함으로써 이러한 위험을 완화하고 줄일 수 있습니다.

최적화 방향

이 전략이 더 이상 최적화 될 수 있는 몇 가지 방향:

  1. 기계 학습 알고리즘을 통합하여 자동 매개 변수 최적화를 달성하여 적응력을 향상시킵니다.

  2. 뉴스 같은 더 많은 데이터 소스를 결합하여 거래 결정과 신호 정확성을 향상시킵니다.

  3. 시장 조건에 기반한 역동적 위치 크기 메커니즘을 개발하여 위험을 더 잘 제어합니다.

  4. 미래에셋 중재 거래에 적용 가능성을 확대하여 절대 수익률을 더욱 높일 수 있습니다.

결론

이 전략은 가격 브레이크, 지표 신호, 스톱 로스 등 다양한 기술을 결합합니다. 백테스트 및 라이브 트레이딩에서 안정성과 성능을 입증했습니다. 알고리즘 및 데이터 기술이 발전함에 따라 이 전략에는 상당한 상승점이 남아 있습니다. 지속적인 개선이 예상 될 수 있습니다.


/*backtest
start: 2023-11-23 00:00:00
end: 2023-11-30 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2018

//@version=2
strategy(title = "Noro's Price Channel Strategy v1.2", shorttitle = "Price Channel str 1.2", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0)

//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
capital = input(100, defval = 100, minval = 1, maxval = 100000, title = "capital, %")
uset = input(true, defval = true, title = "Use trend entry")
usect = input(true, defval = true, title = "Use counter-trend entry")
usersi = input(true, defval = true, title = "Use RSI strategy")
pch = input(30, defval = 30, minval = 2, maxval = 200, title = "Price Channel Period")
showcl = input(true, defval = true, title = "Price Channel")
fromyear = input(2018, defval = 2018, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
src = close

//Price channel
lasthigh = highest(src, pch)
lastlow = lowest(src, pch)
center = (lasthigh + lastlow) / 2
trend = low > center ? 1 : high < center ? -1 : trend[1]
col = showcl ? blue : na
col2 = showcl ? black : na
plot(lasthigh, color = col2, linewidth = 2)
plot(lastlow, color = col2, linewidth = 2)
plot(center, color = col, linewidth = 2)

//Bars
bar = close > open ? 1 : close < open ? -1 : 0
rbars = sma(bar, 2) == -1
gbars = sma(bar, 2) == 1

//Fast RSI
fastup = rma(max(change(src), 0), 2)
fastdown = rma(-min(change(src), 0), 2)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))

//Signals
body = abs(close - open)
abody = sma(body, 10)
up1 = rbars and close > center and uset
dn1 = gbars and close < center and uset
up2 = close <= lastlow and close < open and usect
dn2 = close >= lasthigh and close > open and usect
up3 = fastrsi < 25 and close > center and usersi
dn3 = fastrsi > 75 and close < center and usersi
exit = (((strategy.position_size > 0 and close > open) or (strategy.position_size < 0 and close < open)) and body > abody / 2)
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 : lot[1]

//Trading
if up1 or up2 or up3
    if strategy.position_size < 0
        strategy.close_all()
        
    strategy.entry("Long", strategy.long, needlong == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))

if dn1 or dn2 or dn3
    if strategy.position_size > 0
        strategy.close_all()
        
    strategy.entry("Short", strategy.short, needshort == false ? 0 : lot, when=(time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)))
    
if time > timestamp(toyear, tomonth, today, 23, 59) or exit
    strategy.close_all()

더 많은