골든 비율 평균 반전 트렌드 거래 전략

저자:차오장, 날짜: 2023-12-07 11:03:20
태그:

img

전반적인 설명

골든 비율 평균 역행 트렌드 거래 전략은 채널 지표와 이동 평균을 사용하여 더 강한 트렌드 방향을 식별하고 특정 비율로 가격 인하 후 트렌드 방향으로 포지션을 개척합니다. 이 전략은 더 강한 트렌드 특성을 가진 시장에 적합하며 트렌딩 시장에서 잘 수행 할 수 있습니다.

전략 논리

이 전략의 핵심 지표는 채널 지표, 이동 평균 및 인하 트리거 라인을 포함합니다. 구체적으로:

  1. 채널 지표는 가격 채널을 식별하기 위해 가장 높은 최고와 가장 낮은 최저에서 계산됩니다.
  2. 이동 평균은 가격의 전체 추세 방향을 결정하는 데 사용됩니다.
  3. 그 후, 이 리드백 트리거 라인은 가격이 일정 비율로 채널 경계로부터 반등한 후에 포지션을 개척합니다.

가격이 채널의 바닥에 닿을 때, 전략은 가장 낮은 지점을 기준점으로 기록하고 판매 신호를 설정합니다. 가격이 상승하면 상승률이 풀백 비율에 도달하면 리바운드 지점 주위에서 쇼트 포지션이 열립니다.

반대로, 가격이 채널의 꼭대기에 도달하면 전략은 가장 높은 지점을 기준점으로 기록하고 구매 신호를 허용합니다. 가격이 떨어지면, 감소가 인출 비율 요구 사항을 충족하면 그 지점 주위에서 긴 지점이 열립니다.

따라서 이 전략의 거래 논리는 가격 채널을 추적하고 반전 신호가 나타날 때 기존 트렌드에 개입하는 것입니다. 이것은 평균 반전 트렌드 거래 전략의 일반적인 일상에 속합니다.

이점 분석

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

  1. 강한 트렌드 시장에서 좋은 성과를 낼 수 있습니다.
  2. 트레이드 시작의 공격성은 풀백 비율 매개 변수를 통해 조정될 수 있습니다.
  3. 적당한 마취 통제는 단일 거래 손실을 제한할 수 있습니다.

특히, 전략은 주로 트렌드 반전 지점에서 포지션을 개설하기 때문에 더 큰 가격 변동과 더 명백한 트렌드가있는 시장에서 더 잘 작동합니다. 또한, 풀백 비율 매개 변수를 조정하면 트렌드를 따라 전략의 공격성 수준을 제어 할 수 있습니다. 마지막으로, 스톱 로스는 단일 거래 손실을 매우 잘 제어 할 수 있습니다.

위험 분석

이 전략의 주요 위험은 또한 다음을 포함합니다.

  1. 이 전략은 거래 도구의 트렌드 특성에 민감합니다.
  2. 부적절한 풀백 비율 설정은 과도한 공격성 또는 과도한 보수성으로 이어질 수 있습니다.
  3. 포지션 보유 시간이 너무 길고, 오버나이트 리스크는 주의가 필요합니다.

특히, 전략에 사용되는 거래 도구가 약한 경향과 작은 변동을 가지고 있다면 성능이 손상 될 수 있습니다. 또한, 너무 큰 또는 너무 작은 풀백 비율은 전략 성능에 영향을 줄 것입니다. 마지막으로, 전략의 포지션 보유 기간이 길어질 수 있기 때문에, 오버나이트 리스크 제어 또한 주의가 필요합니다.

위 위험 을 피 하기 위해 다음 과 같은 측면 을 최적화 하는 것 을 고려 하십시오.

  1. 더 명백한 트렌드 특성을 가진 거래 도구를 선택합니다.
  2. 가장 좋은 매개 변수 조합을 찾기 위해 풀백 비율 매개 변수를 조정합니다.
  3. 적당한 유지 시간을 제어하기 위해 수익을 취하는 출구를 설정합니다.

결론

골든 비율은 단순한 지표를 통해 가격 추세와 인하 신호를 판단하고, 강한 시장의 추세를 추적하기 위해 포지션을 열고, 전형적인 트렌드 시스템에 속한다. 이 전략은 큰 매개 변수 조정 공간을 가지고 있으며, 최적화를 통해 더 많은 시장 환경에 적응할 수 있으며, 위험 통제 또한 합리적입니다. 따라서 라이브 거래에서 검증하고 개선할 가치가있는 전략 아이디어입니다.


/*backtest
start: 2022-11-30 00:00:00
end: 2023-12-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
//
// A port of the TradeStation EasyLanguage code for a mean-revision strategy described at
//     http://traders.com/Documentation/FEEDbk_docs/2017/01/TradersTips.html
//
// "In “Mean-Reversion Swing Trading,” which appeared in the December 2016 issue of STOCKS & COMMODITIES, author Ken Calhoun
//  describes a trading methodology where the trader attempts to enter an existing trend after there has been a pullback. 
//  He suggests looking for 50% pullbacks in strong trends and waiting for price to move back in the direction of the trend
//  before entering the trade."
//
//  See Also:
//    - 9 Mistakes Quants Make that Cause Backtests to Lie (https://blog.quantopian.com/9-mistakes-quants-make-that-cause-backtests-to-lie-by-tucker-balch-ph-d/)
//    - When Backtests Meet Reality (http://financial-hacker.com/Backtest.pdf)
//    - Why MT4 backtesting does not work (http://www.stevehopwoodforex.com/phpBB3/viewtopic.php?f=28&t=4020)
//
// 
// -----------------------------------------------------------------------------
// Copyright 2018 sherwind
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// The GNU General Public License can be found here
// <http://www.gnu.org/licenses/>.
//
// -----------------------------------------------------------------------------
//

strategy("Mean-Reversion Swing Trading Strategy v1", shorttitle="MRST Strategy v1", overlay=true)
channel_len  = input(defval=20, title="Channel Period", minval=1)
pullback_pct = input(defval=0.5, title="Percent Pull Back Trigger", minval=0.01, maxval=1, step=0.01)
trend_filter_len = input(defval=50, title="Trend MA Period", minval=1)


upper_band = highest(high, channel_len)
lower_band = lowest(low, channel_len)
trend      = sma(close, trend_filter_len)

low_ref  = 0.0
low_ref  :=  nz(low_ref[1])
high_ref = 0.0
high_ref := nz(high_ref[1])
long_ok  = false
long_ok  := nz(long_ok[1])
short_ok = false
short_ok := nz(short_ok[1])
long_ok2 = false
long_ok2  := nz(long_ok2[1])

if (low == lower_band)
    low_ref  := low
    long_ok  := false
    short_ok := true
    long_ok2 := false

if (high == upper_band)
    high_ref := high
    long_ok  := true
    short_ok := false
    long_ok2  := true

// Pull Back Level
trigger = long_ok2 ? high_ref - pullback_pct * (high_ref - low_ref) : low_ref + pullback_pct * (high_ref - low_ref)

plot(upper_band, title="Upper Band", color=long_ok2?green:red)
plot(lower_band, title="Lower Band", color=long_ok2?green:red)
plot(trigger, title="Trigger", color=purple)
plot(trend, title="Trend", color=orange)

enter_long = long_ok[1] and long_ok and crossover(close, trigger) and close > trend and strategy.position_size <= 0
enter_short = short_ok[1] and short_ok and crossunder(close, trigger) and close < trend and strategy.position_size >= 0

if (enter_long)
    long_ok := false
    strategy.entry("pullback-long", strategy.long, stop=close, comment="pullback-long")
else
    strategy.cancel("pullback-long")

if (enter_short)
	short_ok := false
    strategy.entry("pullback-short", strategy.short, stop=close, comment="pullback-short")
else
    strategy.cancel("pullback-short")

strategy.exit("exit-long", "pullback-long", limit=upper_band, stop=lower_band)
strategy.exit("exit-short", "pullback-short", limit=lower_band, stop=upper_band)


더 많은