
개요: 이 전략은 3개의 다른 주기의 이동 평균을 기반으로 금 포크 사형 포크 거래를 실현한다. 짧은 주기 평균선 상에서 긴 주기 평균선을 통과할 때 더 많이 하고, 짧은 주기 평균선 아래에서 긴 주기 평균선을 통과할 때 공백한다. 동시에 장기 트렌드 평균선과 결합하여 트렌드 방향을 판단한다.
전략적 원칙:
세 개의 이동 평균을 정의합니다. 단기 평균, 장기 평균 및 추세 평균. 단기 평균 주기는 20이며, 장기 평균 주기는 200이며, 추세 평균 주기는 50입니다.
단기평균선 상에서 장기평균선을 뚫을 때 구매 신호가 더 많이 발생하고, 단기평균선 아래에서 장기평균선을 뚫을 때 판매 신호가 빈 채로 발생한다.
동시에 단기평균선과 장기평균선이 트렌드평균선 위에 있는지 확인하고, 만족하지 않으면 신호를 필터링한다. 이것은 역동작업을 피할 수 있다.
스톱로즈와 스톱은 입점 가격의 일정한 비율로 설정되어 있으며, 실제 상황에 따라 최적화될 수 있다.
평행선의 교차점을 그리는 것은 진입 시간을 보는데 도움이 된다.
우위 분석:
전략은 간단하고 직관적이며, 이해하기 쉽고, 실행하기 쉽습니다.
중·단기적 추세를 효과적으로 파악할 수 있는 방법.
트렌드 일등선과 결합하면 역전작업을 피하기 위해 신호를 더욱 필터링 할 수 있습니다.
세 개의 평행선의 파라미터를 조정하여 다른 시장의 특성에 맞게 조정할 수 있습니다.
사용자 정의 할 수 있는 손해 차단 매개 변수를 사용하여 위험을 제어하십시오.
위험 분석:
시장의 급격한 변동으로 인해 손실이 발생할 수 있습니다.
“전파가 변하면 더 큰 손실이 발생할 수 있습니다”.
잘못된 매개 변수 설정은 거래의 빈도나 놓친 기회를 초래할 수 있다.
거래비용의 영향에 주의를 기울여야 합니다.
최적화 방향:
진동률 지표와 결합하여 ATR 등과 같은 신호를 더욱 필터링할 수 있다.
기계 학습 알고리즘을 도입하여 동적으로 최적화 파라미터를 도입할 수 있다.
MACD 등과 같은 더 많은 지표의 추세 판단을 결합할 수 있다.
이윤을 잠금하기 위해 이동 스톱을 설정할 수 있다.
재검토를 통해 스탠드피드 패러미터를 최적화할 수 있다.
결론:
이 전략의 전체적인 아이디어는 명확하고 실행하기 쉬운데, 골드 포크 사시포크를 통해 체계적으로 트렌드를 포착한다. 트렌드 평행선과 스톱 스톱을 결합하여 위험을 제어한다. 특정 시장 상황에 따라 파라미터 설치는 최적화되어야 한다. 효과를 높이기 위해 더 많은 지표를 추가로 결합 할 수 있다. 이 전략은 중장기 트렌드 거래에 적합하며, 재검토 및 데모 거래에서 더 잘 작동한다. 그러나 실물에서는 트렌드 전환과 트렌드 전환으로 인한 위험을 방지하는 데 주의를 기울여야 한다.
/*backtest
start: 2022-10-23 00:00:00
end: 2023-10-29 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("XAU M15", overlay=true)
// Define input parameters
long_length = input.int(64, title="Long MA Length")
short_length = input.int(1, title="Short MA Length")
trend_length = input.int(200, title="Trend MA Length")
// Calculate moving averages
long_ma = ta.sma(close, long_length)
short_ma = ta.sma(close, short_length)
trend_ma = ta.sma(close, trend_length)
// Plot moving averages on chart
plot(long_ma, color=color.blue, title="Long MA")
plot(short_ma, color=color.red, title="Short MA")
plot(trend_ma, color=color.green, title="Trend MA")
// Entry conditions
enterLong = ta.crossover(long_ma, short_ma) and long_ma > trend_ma and short_ma > trend_ma
enterShort = ta.crossunder(long_ma, short_ma) and long_ma < trend_ma and short_ma < trend_ma
if (enterLong)
strategy.entry("Long", strategy.long)
if (enterShort)
strategy.entry("Short", strategy.short)
// Exit conditions
exitLong = ta.crossunder(long_ma, short_ma)
exitShort = ta.crossover(long_ma, short_ma)
if (exitLong)
strategy.close("Long")
if (exitShort)
strategy.close("Short")
// Set stop loss and take profit levels
long_stop_loss_percentage = input(1, title="Long Stop Loss (%)") / 100
long_take_profit_percentage = input(3, title="Long Take Profit (%)") / 100
short_stop_loss_percentage = input(1, title="Short Stop Loss (%)") / 100
short_take_profit_percentage = input(3, title="Short Take Profit (%)") / 100
strategy.exit("Take Profit/Stop Loss", "Long", stop=close * (1 - long_stop_loss_percentage), limit=close * (1 + long_take_profit_percentage))
strategy.exit("Take Profit/Stop Loss", "Short", stop=close * (1 + short_stop_loss_percentage), limit=close * (1 - short_take_profit_percentage))
plotshape(series=enterLong, title="Buy Entry", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.tiny)
plotshape(series=enterShort, title="Sell Entry", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.tiny)