
이 전략은 여러 가지 기술 지표를 결합하여 모든 기능을 갖춘 단선 거래 전략을 구현합니다. 이 전략은 동시 트렌드 추적, 브레이크 거래, 반전 거래와 같은 여러 가지 거래 방법을 가지고 있으며 대부분의 시장 환경에 적합하며 매우 보편적이고 실용적인 단선 전략입니다.
위의 여러 가지 세부 전략이 결합되어, 이 전략은 중간주기의 트렌드를 포착할 수 있고, 장기주기를 기준으로 전체적인 트렌드 방향을 판단할 수 있게 하여, 다재다능한 일반 거래 전략을 구현할 수 있다.
이 전략의 가장 큰 장점은 여러 가지 기술 지표를 통합적으로 사용하여 포트폴리오 거래를 하는 데 있습니다. 동시 트렌드 추적, 반전 거래, 돌파 거래와 같은 여러 가지 거래 방식을 구현 할 수 있습니다.
특히, 이 전략의 주요 장점은 다음과 같습니다.
이 전략은 여러 지표들을 결합하여 일반적인 거래 전략을 구현한다. 그러나 거래에는 위험이 있습니다. 주요 위험점은 다음과 같습니다:
위와 같은 위험 요소에 대해, 우리는 다음과 같은 몇 가지 측면에서 최적화할 수 있습니다.
위와 같은 분석에 따르면, 이 전략은 다음과 같은 방향으로 최적화될 수 있습니다.
이 전략은 복합적으로 여러 지표를 사용하여 조합 거래를 수행하고, 트렌드 추적, 브레이크 거래, 반전 거래의 여러 거래 방법을 유기적으로 결합하여 매우 보편적이고 보편적인 단선 거래 전략입니다. 이 전략의 가장 큰 장점은 대부분의 시장 환경에 적용할 수 있다는 것입니다.
/*backtest
start: 2022-12-13 00:00:00
end: 2023-12-19 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=2
//╭╮╱╱╭╮╭╮╱╱╭╮
//┃╰╮╭╯┃┃┃╱╱┃┃
//╰╮┃┃╭┻╯┣╮╭┫╰━┳╮╭┳━━╮
//╱┃╰╯┃╭╮┃┃┃┃╭╮┃┃┃┃━━┫
//╱╰╮╭┫╰╯┃╰╯┃╰╯┃╰╯┣━━┃
//╱╱╰╯╰━━┻━━┻━━┻━━┻━━╯
//╭━━━┳╮╱╱╱╱╱╱╱╭╮
//┃╭━╮┃┃╱╱╱╱╱╱╱┃┃
//┃┃╱╰┫╰━┳━━┳━╮╭━╮╭━━┫┃
//┃┃╱╭┫╭╮┃╭╮┃╭╮┫╭╮┫┃━┫┃
//┃╰━╯┃┃┃┃╭╮┃┃┃┃┃┃┃┃━┫╰╮
//╰━━━┻╯╰┻╯╰┻╯╰┻╯╰┻━━┻━╯
//━╯
// http://www.vdubus.co.uk/
strategy(title='Vdub FX SniperVX3 / Strategy v3', shorttitle='Vdub_FX_SniperVX3_Strategy', overlay=true, pyramiding=0, initial_capital=1000, currency=currency.USD)
//Candle body resistance Channel-----------------------------//
len = 34
src = input(close, title="Candle body resistance Channel")
out = sma(src, len)
last8h = highest(close, 13)
lastl8 = lowest(close, 13)
bearish = cross(close,out) == 1 and falling(close, 1)
bullish = cross(close,out) == 1 and rising(close, 1)
channel2=input(false, title="Bar Channel On/Off")
ul2=plot(channel2?last8h:last8h==nz(last8h[1])?last8h:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level top", offset=0)
ll2=plot(channel2?lastl8:lastl8==nz(lastl8[1])?lastl8:na, color=black, linewidth=1, style=linebr, title="Candle body resistance level bottom", offset=0)
//fill(ul2, ll2, color=black, transp=95, title="Candle body resistance Channel")
//-----------------Support and Resistance
RST = input(title='Support / Resistance length:', defval=10)
RSTT = valuewhen(high >= highest(high, RST), high, 0)
RSTB = valuewhen(low <= lowest(low, RST), low, 0)
RT2 = plot(RSTT, color=RSTT != RSTT[1] ? na : red, linewidth=1, offset=+0)
RB2 = plot(RSTB, color=RSTB != RSTB[1] ? na : green, linewidth=1, offset=0)
//--------------------Trend colour ema------------------------------------------------//
src0 = close, len0 = input(13, minval=1, title="EMA 1")
ema0 = ema(src0, len0)
direction = rising(ema0, 2) ? +1 : falling(ema0, 2) ? -1 : 0
plot_color = direction > 0 ? lime: direction < 0 ? red : na
plot(ema0, title="EMA", style=line, linewidth=1, color = plot_color)
//-------------------- ema 2------------------------------------------------//
src02 = close, len02 = input(21, minval=1, title="EMA 2")
ema02 = ema(src02, len02)
direction2 = rising(ema02, 2) ? +1 : falling(ema02, 2) ? -1 : 0
plot_color2 = direction2 > 0 ? lime: direction2 < 0 ? red : na
plot(ema02, title="EMA Signal 2", style=line, linewidth=1, color = plot_color2)
//=============Hull MA//
show_hma = input(false, title="Display Hull MA Set:")
hma_src = input(close, title="Hull MA's Source:")
hma_base_length = input(8, minval=1, title="Hull MA's Base Length:")
hma_length_scalar = input(5, minval=0, title="Hull MA's Length Scalar:")
hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length)))
plot(not show_hma ? na : hullma(hma_src, hma_base_length+hma_length_scalar*6), color=black, linewidth=2, title="Hull MA")
//============ signal Generator ==================================//
Piriod=input('720')
ch1 = request.security(syminfo.tickerid, Piriod, open)
ch2 = request.security(syminfo.tickerid, Piriod, close)
longCondition = crossover(request.security(syminfo.tickerid, Piriod, close),request.security(syminfo.tickerid, Piriod, open))
if (longCondition)
strategy.entry("BUY", strategy.long)
shortCondition = crossunder(request.security(syminfo.tickerid, Piriod, close),request.security(syminfo.tickerid, Piriod, open))
if (shortCondition)
strategy.entry("SELL", strategy.short)
///////////////////////////////////////////////////////////////////////////////////////////