다중 시간 프레임 진동 채널 추세 추종 전략


생성 날짜: 2023-12-25 14:27:06 마지막으로 수정됨: 2023-12-25 14:27:06
복사: 0 클릭수: 687
avatar of ChaoZhang ChaoZhang
1
집중하다
1623
수행원

다중 시간 프레임 진동 채널 추세 추종 전략

[trans]

개요

이 전략은 슈퍼 트렌드 지표에 기반을 두고 있으며, 여러 시간 프레임에 시장의 추세를 분석하고, 진입 시기를 식별하는 충격 통로 방법을 사용합니다.

전략 원칙

  • 전통적인 슈퍼 트렌드 지표를 사용하여 트렌드 방향을 판단합니다.
  • 높은 시간 프레임의 슈퍼 트렌드를 추가하고 높은 시간 프레임의 트렌드를 보장합니다.
  • 두 시간 프레임의 슈퍼 트렌드 지표에 따라 전체 트렌드 방향을 판단하십시오.
  • 가격 돌파 흔들림 통로의 오르락 내리락에 따라 구체적인 진입 시기를 결정합니다.

우위 분석

  • 다중 시간 프레임 분석으로 트렌드를 파악할 수 있습니다.
  • 높은 낮은 시간 프레임의 결합은 큰 추세를 보장하고 단기 기회에 도달합니다.
  • 진동 통로는 스톱포인트를 설정하여 위험을 조절하는 데 도움이 됩니다.

위험과 해결

  • 슈퍼 트렌드는 그 자체로 지연 현상을 가지고 있으며, 트렌드 전환점을 놓칠 수 있습니다.
  • 변수를 최적화하거나 다른 지표와 결합하여 트렌드 전환을 파악하여 뒤처지는 위험을 줄일 수 있습니다.

최적화 방향

  • 슈퍼 트렌드 파라미터를 최적화하여 뒤처진 문제를 줄이십시오.
  • 트렌드 필터링을 추가하여 큰 트렌드를 더 정확하게 판단합니다.
  • 테스트하고 더 적절한 손실 방법을 선택합니다.

요약하다

이 전략은 다중 시간 프레임 분석과 트렌드 추적 지표를 통합하여 주요 트렌드를 파악하면서 특정 진입 시점을 찾습니다. 지속적인 최적화를 통해 장기적으로 안정적인 초과 수익을 얻을 수 있습니다.

||

Overview

This strategy is based on the Supertrend indicator, combined with multiple timeframe market trend analysis, and adopts the oscillation channel method to identify entry opportunities.

Strategy Principle

  • Use the traditional Supertrend indicator to determine the trend direction
  • Add Supertrend of higher timeframe to ensure there is a trend in higher timeframe too
  • Determine the overall trend direction based on the Supertrend indicators of two timeframes
  • Identify specific entry opportunities based on the price breakout of the upper and lower rails of the oscillation channel

Advantage Analysis

  • Multi-timeframe analysis makes trend judgment more reliable
  • Combining high and low timeframes ensures catching the major trend while being able to capture short-term opportunities
  • The oscillation channel setting stops loss points which helps risk control

Risks and Solutions

  • The Supertrend itself has some lagging phenomenon, which may miss trend reversal points
  • The lagging risk can be reduced by optimizing parameters or incorporating other indicators to assist in identifying trend changes

Optimization Directions

  • Optimize Supertrend parameters to reduce lagging
  • Add trend filtering indicators to ensure catching the major trend more accurately
  • Test and select more appropriate stop loss methods

Summary

This strategy integrates multi-timeframe analysis and trend tracking indicators to grasp the major trend while seeking specific entry opportunities. With continuous optimization, it is expected to achieve long-term steady excess returns.

전략 소스 코드
/*backtest
start: 2022-12-18 00:00:00
end: 2023-12-24 00:00:00
period: 1d
basePeriod: 1h
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/
// © ramki_simple
// Thanks to LonesomeTheBlue for the original code
//@version=4
strategy("Multi Supertrend with no-repaint HTF option strategy", overlay = true, shorttitle='Multi Supertrend')
//auto higher time frame
HTFAuto = timeframe.period == '1' ? '5' : 
  timeframe.period == '3' ? '15' : 
  timeframe.period == '5' ? '15' : 
  timeframe.period == '15' ? '60' : 
  timeframe.period == '30' ? '60' : 
  timeframe.period == '45' ? '60' : 
  timeframe.period == '60' ? '240' : 
  timeframe.period == '120' ? '240' : 
  timeframe.period == '180' ? '240' : 
  timeframe.period == '240' ? 'D' : 
  timeframe.period == 'D' ? 'W' :
  '5W'
HTFSelection = input(title='Select HTF Automatically for Additional Supertrend', type=input.bool, defval=false)
HTFUserSel = input(title='Select Higher Timeframe for Additional Supertrend',type=input.resolution, defval ='')
HTF = HTFSelection ? HTFAuto : HTFUserSel


Mult1 = input(title='Multiplier for Default Supertrend', defval=3.0, minval = 0, maxval = 10)
Period1 = input(title='Period for Default Supertrend', defval=10, minval = 1, maxval = 100)
Mult2 = input(title='Multiplier for Additional Supertrend', defval=2.0, minval = 0, maxval = 10)
Period2 = input(title='Period for Additional Supertrend', defval=14, minval = 1, maxval = 100)

chbarcol = input(true, title = "Change Bar Color")

[Trailings, Trend] = supertrend(Mult1, Period1)

linecolor = Trend == -1 and Trend[1] == -1 ? color.teal :
   Trend == 1 and Trend[1] == 1 ? color.red :
   color.new(color.white, 100)
plot(Trailings, color = linecolor,  linewidth = 2,title = "SuperTrend")

f_Security(_symbol, _res, _src) => security(_symbol, _res, _src[1], lookahead = barmerge.lookahead_on)

nonVectorSupertrend(Mult, Period) =>
    [Trail_, Trend_] = supertrend(Mult, Period)
    Trail_*Trend_


[TrailingslHtf, TrendHtf] = supertrend(Mult2, Period2)

if HTF != timeframe.period and HTF != ''
    CompositeTrailHtf = f_Security(syminfo.tickerid, HTF,nonVectorSupertrend(Mult2, Period2) )
    TrailingslHtf := abs(CompositeTrailHtf)
    TrendHtf := CompositeTrailHtf > 0 ? 1 : -1


linecolorHtf = TrendHtf == -1 and TrendHtf[1] == -1 ? color.blue :
   TrendHtf == 1 and TrendHtf[1] == 1 ? color.maroon :
   color.new(color.white, 100)
plot(TrailingslHtf, color = linecolorHtf, linewidth = 3, title = "Supertrend Higher Time Frame")

barcolor_ = Trend == -1 and TrendHtf == -1 ? color.lime :
   Trend == 1 and TrendHtf == 1 ? color.red :
   color.white
barcolor(color = chbarcol ? barcolor_ : na)

vwapfilter = input(false)

Long = Trend == -1 and TrendHtf == -1
Short = Trend == 1 and TrendHtf == 1
strategy.entry("enter long", true, 1, when = Long and not Long[1] and (vwapfilter and close > vwap or not vwapfilter))
strategy.entry("enter short", false, 1, when = Short and not Short[1] and (vwapfilter and close < vwap or not vwapfilter))
strategy.close("enter long", when = Long[1] and not Long)
strategy.close("enter short", when = Short[1] and not Short)