RSI 지표 기반 주식 거래 피라미딩 전략

저자:차오장, 날짜: 2024-01-30 15:26:49
태그:

img

전반적인 설명

이 문서에서는 주로 상대적 강도 지수 (RSI) 지표를 기반으로 설계된 주식 거래 피라미딩 전략을 소개합니다. 이 전략은 RSI 지표를 사용하여 주식의 과반 구매 및 과반 판매 지역을 결정하고 피라미딩 원칙을 통해 수익을 창출합니다.

전략 원칙

  • RSI 인디케이터를 사용하여 주가가 과잉 구매 또는 과잉 판매 영역에 진입했는지 판단하십시오. RSI 25 이하는 과잉 판매이며 80 이상은 과잉 구매입니다.
  • RSI가 과판된 영역으로 들어갔을 때, 긴 거리를 시작하십시오. RSI가 과반된 영역으로 들어갔을 때, 짧은 거리를 시작하십시오.
  • 피라미드 방식은 최대 7개의 추가 구매를 통해 매번 추가 구매 후 수익을 취하고 손해를 멈추는 지점을 설정합니다.

이점 분석

  • RSI 인디케이터를 사용하여 과반 구매 및 과반 판매 영역을 결정하면 더 큰 가격 역전 기회를 잡을 수 있습니다.
  • 피라미드 방식은 시장이 올바르게 움직일 때 상대적으로 더 나은 수익을 얻을 수 있습니다.
  • 매번 추가 구매 후 수익을 취하고 손해를 멈추는 것을 설정하면 위험을 조절할 수 있습니다.

위험 분석

  • RSI 지표의 과잉 구매 및 과잉 판매 영역을 결정하는 효과는 불안정하며 잘못된 신호가 발생할 수 있습니다.
  • 추가 구매의 수는 합리적으로 설정되어야 합니다. 너무 많은 추가 구매가 위험을 증가시킬 것입니다.
  • 스톱 로즈 포인트를 설정할 때 변동성을 고려해야 합니다. 너무 작게 설정할 수는 없습니다.

최적화 방향

  • RSI 신호를 필터링하고 KDJ, BOLL 및 기타 지표와 같은 과잉 구매 및 과잉 판매 상태를 결정하는 정확성을 향상시키기 위해 다른 지표를 결합하는 것을 고려하십시오.
  • 유동 스톱 로스를 가격 추적으로 설정할 수 있습니다. 변동성과 위험 관리 요구 사항에 따라 동적으로 조정합니다.
  • 시장 조건에 기반한 적응 매개 변수를 사용하는 것을 고려하십시오 (가시 시장, 곰 시장 등).

요약

이 전략은 RSI 지표와 피라미딩 전략을 결합합니다. 과소매 및 과소매 상태를 판단하는 동안 추가 구매를 통해 더 많은 수익을 얻을 수 있습니다. RSI 판단의 정확도가 개선되어야하지만 합리적인 매개 변수 최적화 및 다른 지표와 결합함으로써 효과적인 거래 전략을 형성 할 수 있습니다. 이 전략은 어느 정도의 보편성을 가지고 있으며 비교적 간단하고 직접적인 수치 거래 방법입니다.


/*backtest
start: 2023-12-30 00:00:00
end: 2024-01-29 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RafaelZioni

strategy(title='Simple RSI strategy', overlay=false)

SWperiod = 1
look = 0
OverBought = input(80, minval=50)
OverSold = input(25, maxval=50)

bandmx = hline(100)
bandmn = hline(0)

band1 = hline(OverBought)
band0 = hline(OverSold)
//band50 = hline(50, color=black, linewidth=1)
fill(band1, band0, color=color.purple, transp=98)


src = close
len = input(5, minval=1, title="RSI Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - 100 / (1 + up / down)

p = 100

//scale
hh = highest(high, p)
ll = lowest(low, p)
scale = hh - ll

//dynamic OHLC
dyno = (open - ll) / scale * 100
dynl = (low - ll) / scale * 100
dynh = (high - ll) / scale * 100
dync = (close - ll) / scale * 100

//candle color
color_1 = close > open ? 1 : 0

//drawcandle
hline(78.6)
hline(61.8)
hline(50)
hline(38.2)
hline(23.6)
plotcandle(dyno, dynh, dynl, dync, title="Candle", color=color_1 == 1 ? color.green : color.red)
plot(10, color=color.green)
plot(55, color=color.black)
plot(80, color=color.black)
plot(90, color=color.red)

long = rsi <= OverSold ? 5 : na

//Strategy
golong = rsi <= OverSold ? 5 : na

longsignal = golong  
//based on https://www.tradingview.com/script/7NNJ0sXB-Pyramiding-Entries-On-Early-Trends-by-Coinrule/
//set take profit

ProfitTarget_Percent = input(3)
Profit_Ticks = close * (ProfitTarget_Percent / 100) / syminfo.mintick

//set take profit

LossTarget_Percent = input(10)
Loss_Ticks = close * (LossTarget_Percent / 100) / syminfo.mintick


//Order Placing

strategy.entry("Entry 1", strategy.long, when=strategy.opentrades == 0 and longsignal)

strategy.entry("Entry 2", strategy.long, when=strategy.opentrades == 1 and longsignal)

strategy.entry("Entry 3", strategy.long, when=strategy.opentrades == 2 and longsignal)

strategy.entry("Entry 4", strategy.long, when=strategy.opentrades == 3 and longsignal)

strategy.entry("Entry 5", strategy.long, when=strategy.opentrades == 4 and longsignal)

strategy.entry("Entry 6", strategy.long, when=strategy.opentrades == 5 and longsignal)

strategy.entry("Entry 7", strategy.long, when=strategy.opentrades == 6 and longsignal)



if strategy.position_size > 0
    strategy.exit(id="Exit 1", from_entry="Entry 1", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 2", from_entry="Entry 2", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 3", from_entry="Entry 3", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 4", from_entry="Entry 4", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 5", from_entry="Entry 5", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 6", from_entry="Entry 6", profit=Profit_Ticks, loss=Loss_Ticks)
    strategy.exit(id="Exit 7", from_entry="Entry 7", profit=Profit_Ticks, loss=Loss_Ticks)


더 많은