알파 트렌드 크로스 페리오드 전략

저자:차오장, 날짜: 2023-09-28 11:05:27
태그:

전반적인 설명

이 전략은 RSI 및 MFI 지표의 장점을 결합한 AlphaTrend 지표에 기반하고 있으며, 상승 및 하락 트렌드 시장에서 좋은 결과를 얻을 수 있습니다. 전략은 주로 가격이 AlphaTrend 곡선을 통과하는지 여부에 따라 트렌드의 방향을 판단합니다.

전략 논리

  1. 시장 변동성을 측정하기 위한 ATR 지표를 계산합니다.
  2. 부피 데이터가 없는 경우 RSI를 사용하여 시장 방향을 결정합니다. 부피 데이터가 있는 경우 MFI를 사용합니다.
  3. ATR 및 시장 방향에 따라 상위 및 하위 대역을 계산합니다.
  4. 동적 상위 및 하위 대역을 포함하는 알파 트렌드 곡선을 계산
  5. 가격이 알파 트렌드 곡선 위 또는 아래를 넘을 때 구매 및 판매 신호를 생성합니다

이 전략은 주로 알파 트렌드 곡선에 의존하여 가격 트렌드 방향을 결정합니다. ATR, RSI / MFI를 고려하고 트렌드를 효과적으로 추적 할 수 있습니다. 가격이 곡선을 침투하면 트렌드의 변화를 신호하고 입구점을 형성합니다.

장점

  1. 알파트렌드는 RSI와 MFI의 강점을 결합하여 황소 시장과 곰 시장에 적응할 수 있습니다.
  2. 동적 상위 및 하위 대역은 시장 변동성에 따라 자동으로 조정됩니다.
  3. 가격과 부피 정보를 모두 포함하고 잘못된 신호를 피합니다.
  4. 브레이크아웃 접근 방식은 트렌드 방향을 명확히 파악합니다.
  5. 단순하고 이해하기 쉬운 논리

요약하자면, 이 전략은 상승과 하락 시장에 모두 효과가 있고, 시장 소음을 효과적으로 필터링하고, 추세를 정확하게 식별하며, 효율적인 추세를 따르는 전략입니다.

위험성

  1. 알파 트렌드 곡선에는 다른 지표로부터 확인을 필요로 하는 잘못된 파열이 있을 수 있습니다.
  2. 시장 통합 도중 많은 잘못된 신호가 발생할 수 있습니다.
  3. 패러미터 조정이 좋지 않은 결과
  4. 스피크 도중 스톱 로스를 취하여 큰 손실을 발생시킬 수 있습니다.

위험을 해결하기 위해, 스톱 로스는 단일 거래 손실을 제어 할 수 있습니다. 잘못된 신호를 피하기 위해 다른 지표와 결합; 다른 시장에 기반한 매개 변수를 조정합니다.

더 나은 기회

  1. 최적화된 설정을 위해 다른 매개 변수 조합을 테스트
  2. 확인 조건을 형성하기 위해 다른 지표를 포함
  3. 리스크를 제어하기 위해 동적 또는 후속 스톱 손실을 사용
  4. 시장 조건에 따라 다른 시간 프레임 (5m, 15m 등) 에서 거래
  5. 보다 정확한 입력을 위해 입력 시계를 정비

다른 시장과 매개 변수들에 대한 테스트를 통해 더 많은 최적화를 할 수 있습니다. 따라서 전략은 더 많은 시장 조건에 적응 할 수 있습니다.

결론

전반적으로 이 알파 트렌드 전략은 단순하고 효율적인 트렌드 추적 시스템이다. 상승 및 하락 시장에 적응하기 위해 가격 및 부피 정보를 모두 포함한다. 브레이크아웃 메커니즘은 명확한 입시 신호를 제공한다. 적절한 위험 통제로 좋은 결과를 얻을 수 있다. 추가 테스트와 향상은 더 많은 시장 조건에서 수익성을 안정시키는 데 도움이 될 수 있다.


/*backtest
start: 2023-09-20 00:00:00
end: 2023-09-26 00:00: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/
// author © KivancOzbilgic
// developer © KivancOzbilgic
// pv additions, simplification and strategy conversion @ treigen
//@version=5
strategy('AlphaTrend For ProfitView', overlay=true, calc_on_every_tick=true, process_orders_on_close=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1, initial_capital=1000)
coeff = input.float(1.5, 'Multiplier', step=0.1)
AP = input(15, 'Common Period')
ATR = ta.sma(ta.tr, AP)
novolumedata = input(title='Change calculation (no volume data)?', defval=false)

i_startTime = input(defval = timestamp("01 Jan 2014 00:00 +0000"), title = "Backtesting Start Time", inline="timestart", group='Backtesting')
i_endTime = input(defval = timestamp("01 Jan 2100 23:59 +0000"), title = "Backtesting End Time", inline="timeend", group='Backtesting')
timeCond = true

pv_ex = input.string('', title='Exchange', tooltip='Leave empty to use the chart ticker instead (Warning: May differ from actual market name in some instances)', group='PV Settings')
pv_sym = input.string('', title='Symbol', tooltip='Leave empty to use the chart ticker instead (Warning: May differ from actual market name in some instances)', group='PV Settings')
pv_acc = input.string("", title="Account", group='PV Settings')
pv_alert_long = input.string("", title="PV Alert Name Longs", group='PV Settings')
pv_alert_short = input.string("", title="PV Alert Name Shorts", group='PV Settings')
pv_alert_test = input.bool(false, title="Test Alerts", tooltip="Will immediately execute the alerts, so you may see what it sends. The first line on these test alerts will be excluded from any real alert triggers" ,group='PV Settings')

upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(close, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT < nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT : downT > nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT


k1 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3)
k2 = plot(AlphaTrend[2], color=color.new(#FC0400, 0), linewidth=3)

buySignalk = ta.crossover(AlphaTrend, AlphaTrend[2])
sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])

var exsym = ""
if barstate.isfirst
    exsym := pv_ex == "" ? "" : "ex=" + pv_ex + ","
    exsym := pv_sym == "" ? exsym : exsym + "sym=" + pv_sym + ","


if barstate.isconfirmed and timeCond 
    if strategy.position_size <= 0 and buySignalk
        strategy.entry("Buy", strategy.long)
        alert(pv_alert_long + "(" + exsym + "acc=" + pv_acc + ")", alert.freq_once_per_bar_close)
    if strategy.position_size >= 0 and sellSignalk
        strategy.entry("Sell", strategy.short)
        alert(pv_alert_short + "(" + exsym + "acc=" + pv_acc + ")", alert.freq_once_per_bar_close)


//  Only used for testing/debugging alert messages
if pv_alert_test
    alert("<![Alert Test]!>\n" + pv_alert_long + "(" + exsym + "acc=" + pv_acc + ")", alert.freq_once_per_bar)
    alert("<![Alert Test]!>\n" + pv_alert_short + "(" + exsym + "acc=" + pv_acc + ")", alert.freq_once_per_bar)


더 많은