
이 전략의 핵심 아이디어는 슈퍼 트렌드 지표와 평균 트렌드 지표 ((ADX) 를 결합하여 트렌드를 판단하고 추적하는 것입니다. 슈퍼 트렌드 지표는 현재 가격 트렌드 방향을 식별하는 데 사용되며, ADX는 트렌드 강도를 판단하는 데 사용되며, 강한 트렌드 아래에서만 거래됩니다. 또한, 전략은 K선 엔티티 컬러, 거래량 지표 등을 사용하여 확인하여 비교적 완전한 거래 규칙을 형성합니다.
일반적으로, 이 전략은 트렌드 추적 전략에 속하며, 중장선에서 명확한 트렌드를 포착하고, 평형과 진동의 방해를 피하는 것을 목표로 한다.
슈퍼 트렌드 지표를 사용하여 가격 트렌드 방향을 판단한다. 가격이 상승할 때 슈퍼 트렌드가 다면 신호이며, 하락할 때 슈퍼 트렌드가 공중 신호이다.
ADX를 사용하여 트렌드 강도를 판단하십시오. ADX가 설정된 문턱보다 크면 거래 신호가 생성됩니다. 이는 조정이 불분명한 기간을 필터링 할 수 있습니다.
K선 엔터티 색상은 현재 상승 패턴 또는 하락 패턴으로 판단하고, 슈퍼 트렌드 지표와 조합하여 확인을 형성한다.
거래량이 커지면 확증 신호로 쓰인다. 거래량이 증가할 때만 포지션이 만들어진다.
수익을 고정하고 위험을 통제하기 위해 스톱로스 및 스톱 포스트를 설정합니다.
설정된 디스크의 시간이 끝날 때까지 모든 포지션을 청산하십시오.
중·장기 선의 명확한 추세를 추적하고, 흔들림을 피하여, 높은 수익률을 얻을 수 있다.
전략의 매개 변수가 적고, 이해하기 쉽고, 실행하기 쉽다.
리스크 컨트롤이 위치해 있고, 스톱로즈와 스톱이 설정되어 있다.
여러 지표를 사용하여 확인하면 잘못된 신호를 줄일 수 있습니다.
이 경우, 상장 깊이를 조정할 때 큰 손실이 발생할 수 있습니다.
개인 주식 실적의 변화로 인해 급격한 반전이 발생할 수 있습니다.
“블랙 스완” 사건은 정책에 큰 변화를 가져왔다.
위험과 대응하는 방법:
ADX 파라미터를 적절히 조정하여 강세를 보이는 경우에만 거래하도록 한다.
단독 손실을 통제하기 위해 손해배상도를 높여라.
정책과 중요한 사건에 집중하고, 필요한 경우 손해를 막기 위해 적극적으로 행동하십시오.
다양한 슈퍼 트렌드 파라미터 조합을 테스트할 수 있으며, 신호를 생성하는 보다 안정적인 파라미터를 선택할 수 있다.
ADX의 다양한 변수를 테스트하여 최적의 변수 조합을 결정할 수 있다.
다른 지표들을 추가하여 확인을 할 수 있습니다. 예를 들어, 변동률, 브린 대역 등으로, 가짜 신호를 더욱 줄일 수 있습니다.
트렌드가 끊어질 때 적시에 상쇄할 수 있는 브레이크와 같은 전략과 결합할 수 있다.
이 전략은 전체적인 생각이 명확하며, 슈퍼 트렌드를 사용하여 가격 트렌드 방향을 판단하고, ADX를 사용하여 트렌드 강도를 판단하고, 강한 트렌드 아래에서 트렌드 추적을 한다. 동시에 스톱 로스 스톱을 설정하여 위험을 제어한다. 전략 파라미터는 적은 편이며, 최적화하기 쉽다. 간단한 효과적인 트렌드 전략의 예로서 학습할 수 있다.
/*backtest
start: 2023-02-15 00:00:00
end: 2024-02-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Intraday Strategy Template
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vikris
//@version=4
strategy("[VJ]Hulk Smash Intra", overlay=true, calc_on_every_tick = false, pyramiding=0,default_qty_type=strategy.percent_of_equity, default_qty_value=100,initial_capital=2000)
// ********** Strategy inputs - Start **********
// Used for intraday handling
// Session value should be from market start to the time you want to square-off
// your intraday strategy
// Important: The end time should be at least 2 minutes before the intraday
// square-off time set by your broker
var i_marketSession = input(title="Market session", type=input.session,
defval="0915-1455", confirm=true)
// Make inputs that set the take profit % (optional)
longProfitPerc = input(title="Long Take Profit (%)",
type=input.float, minval=0.0, step=0.1, defval=1) * 0.01
shortProfitPerc = input(title="Short Take Profit (%)",
type=input.float, minval=0.0, step=0.1, defval=1) * 0.01
// Set stop loss level with input options (optional)
longLossPerc = input(title="Long Stop Loss (%)",
type=input.float, minval=0.0, step=0.1, defval=0.5) * 0.01
shortLossPerc = input(title="Short Stop Loss (%)",
type=input.float, minval=0.0, step=0.1, defval=0.5) * 0.01
var float i_multiplier = input(title = "ST Multiplier", type = input.float,
defval = 2, step = 0.1, confirm=true)
var int i_atrPeriod = input(title = "ST ATR Period", type = input.integer,
defval = 10, confirm=true)
len = input(title="ADX Length", type=input.integer, defval=14)
th = input(title="ADX Threshold", type=input.integer, defval=20)
adxval = input(title="ADX Momemtum Value", type=input.integer, defval=25)
// ********** Strategy inputs - End **********
// ********** Supporting functions - Start **********
// A function to check whether the bar or period is in intraday session
barInSession(sess) => time(timeframe.period, sess) != 0
// ********** Supporting functions - End **********
// ********** Strategy - Start **********
[superTrend, dir] = supertrend(i_multiplier, i_atrPeriod)
colResistance = dir == 1 and dir == dir[1] ? color.new(color.red, 0) : color.new(color.red, 100)
colSupport = dir == -1 and dir == dir[1] ? color.new(color.green, 0) : color.new(color.green, 100)
// Super Trend Long/short condition
stlong = close > superTrend
stshort = close < superTrend
// Figure out take profit price
longExitPrice = strategy.position_avg_price * (1 + longProfitPerc)
shortExitPrice = strategy.position_avg_price * (1 - shortProfitPerc)
// Determine stop loss price
longStopPrice = strategy.position_avg_price * (1 - longLossPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortLossPerc)
//Vol Confirmation
vol = volume > volume[1]
//Candles colors
greenCandle = (close > open)
redCandle = (close < open)
// See if intraday session is active
bool intradaySession = barInSession(i_marketSession)
// Trade only if intraday session is active
TrueRange = max(max(high - low, abs(high - nz(close[1]))), abs(low - nz(close[1])))
DirectionalMovementPlus = high - nz(high[1]) > nz(low[1]) - low ? max(high - nz(high[1]), 0) : 0
DirectionalMovementMinus = nz(low[1]) - low > high - nz(high[1]) ? max(nz(low[1]) - low, 0) : 0
SmoothedTrueRange = 0.0
SmoothedTrueRange := nz(SmoothedTrueRange[1]) - nz(SmoothedTrueRange[1]) / len + TrueRange
SmoothedDirectionalMovementPlus = 0.0
SmoothedDirectionalMovementPlus := nz(SmoothedDirectionalMovementPlus[1]) -
nz(SmoothedDirectionalMovementPlus[1]) / len + DirectionalMovementPlus
SmoothedDirectionalMovementMinus = 0.0
SmoothedDirectionalMovementMinus := nz(SmoothedDirectionalMovementMinus[1]) -
nz(SmoothedDirectionalMovementMinus[1]) / len + DirectionalMovementMinus
DIPlus = SmoothedDirectionalMovementPlus / SmoothedTrueRange * 100
DIMinus = SmoothedDirectionalMovementMinus / SmoothedTrueRange * 100
DX = abs(DIPlus - DIMinus) / (DIPlus + DIMinus) * 100
ADX = sma(DX, len)
// a = plot(DIPlus, color=color.green, title="DI+", transp=100)
// b = plot(DIMinus, color=color.red, title="DI-", transp=100)
//Final Long/Short Condition
longCondition = stlong and redCandle and vol and ADX>adxval
shortCondition = stshort and greenCandle and vol and ADX >adxval
//Long Strategy - buy condition and exits with Take profit and SL
if (longCondition and intradaySession)
stop_level = longStopPrice
profit_level = longExitPrice
strategy.entry("My Long Entry Id", strategy.long)
strategy.exit("TP/SL", "My Long Entry Id",stop=stop_level, limit=profit_level)
//Short Strategy - sell condition and exits with Take profit and SL
if (shortCondition and intradaySession)
stop_level = shortStopPrice
profit_level = shortExitPrice
strategy.entry("My Short Entry Id", strategy.short)
strategy.exit("TP/SL", "My Short Entry Id", stop=stop_level, limit=profit_level)
// Square-off position (when session is over and position is open)
squareOff = (not intradaySession) and (strategy.position_size != 0)
strategy.close_all(when = squareOff, comment = "Square-off")
// ********** Strategy - End **********