
이 전략은 부린 밴드, 상대적으로 강한 지수 ((RSI) 와 지수 이동 평균 ((EMA) 의 세 가지 지표를 통합하여, 긴 줄로 보유한 주식 자동 거래 전략을 구현한다. RSI가 오버셀 라인보다 낮고 가격이 부린 밴드 아래로 접근하거나 접촉했을 때 구매 신호를 발생시키고, 가격이 부린 밴드 위로 접촉했을 때 판매 신호를 발생시키고, 부린 밴드를 사용하여 시장 추세와 오버 구매 오버 판매를 판단하는 이중 필터를 구현한다.
이 전략은 주로 브린 밴드, RSI 및 EMA의 세 가지 지표를 기반으로 판단한다. 브린 밴드의 중간 궤도선은 가격의 간단한 이동 평균이며, 상하 궤도선은 각각 가격 표준 차이의 두 배 범위이다. 브린 밴드는 시장의 과매매 과매매 현상을 판단할 수 있으며, 가격이 하하 궤도에 가까워지면 과매매 현상이며, 상하 궤도에 가까워지면 과매 현상이다. RSI 지표는 주식이 과매 여부를 판단하는 중요한 지표 중 하나이며, RSI는 30 시 이상으로 과매, 70 시 이상으로 과매한다.
이 전략의 구매 조건은: RSI 지표가 30보다 낮은 초상 판매 라인을 생성할 때 구매 신호를 생성하고, 동시에 가격이 부린带 하향 궤도에 접근하거나 접촉한 초상 판매 상태를 충족해야 함으로써 가짜 신호를 피할 수 있다.
이 전략의 판매 조건은: 가격이 상승하는 동안, 부린 띠를 터치할 때 판매 신호가 발생한다. comboBox1 ᅳ 이렇게 부린 띠를 사용하여 과매매 상태를 판단하고, 정지 판매를 한다.
위험 해결 방법:
이 전략은 다음과 같은 방향으로 더 개선될 수 있습니다.
이 전략은 브린밴드, RSI, EMA 3개의 지표를 통합하여, 이중 필터 판단의 긴 줄을 보유하는 자동 거래 전략을 구현한다. 오버 바이 오버 셀 상태를 판단하는 이중 필터 메커니즘은 가짜 신호를 효과적으로 피할 수 있으며, EMA 판단 트렌드를 사용하여 역동 거래를 피할 수 있다. 동시에 전략 파라미터는 다양한 주식에 적용할 수 있도록 유연하게 설정할 수 있으며, 간단한 실용적인 수치화 거래 전략이다.
/*backtest
start: 2023-12-21 00:00:00
end: 2023-12-28 00:00:00
period: 3m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Bollinger + RSI + EMA, Double Strategy Long-Only (by ChartArt) v1.3", shorttitle="rsi 30 min ADJ Buy", overlay=true)
///////////// RSI
RSIlength = input(2, title="RSI Period Length") // Adjusted RSI period length
RSIoverSold = input(30, title="RSI Oversold Level") // Adjustable RSI oversold level
RSIoverBought = input(80, title="RSI Overbought Level") // Adjustable RSI overbought level
price = close
vrsi = rsi(price, RSIlength)
///////////// Bollinger Bands
BBlength = input(231, minval=1, title="Bollinger Period Length") // Adjusted Bollinger period length
BBmult = 2
BBbasis = sma(price, BBlength)
BBdev = BBmult * stdev(price, BBlength)
BBupper = BBbasis + BBdev
BBlower = BBbasis - BBdev
///////////// EMA
useEMA = input(true, title="Use EMA?")
emaLength = input(20, title="EMA Period Length")
ema = useEMA ? ema(close, emaLength) : na
source = close
buyEntry = crossover(source, BBlower) or (close < BBlower and close > BBbasis) or (low < BBlower and close > BBbasis) // Add condition for low touching Bollinger Band
sellEntry = crossunder(source, BBupper)
///////////// Plotting
plot(BBbasis, color=color.aqua, title="Bollinger Bands SMA Basis Line")
plot(BBupper, color=color.silver, title="Bollinger Bands Upper Line")
plot(BBlower, color=color.silver, title="Bollinger Bands Lower Line")
plot(ema, color=color.orange, title="EMA") // Plot EMA
///////////// RSI + Bollinger Bands Strategy
long = crossover(vrsi, RSIoverSold) and buyEntry
close_long = close >= BBupper
if (not na(vrsi))
if long
strategy.entry("Buy", strategy.long, qty=10, stop=BBlower, comment="Buy")
else
strategy.cancel(id="Buy")
if close_long
strategy.close("Buy")