RSI 브레이크업 전략은 양적 거래 전략입니다.

저자:차오장, 날짜: 2023-12-22 14:06:45
태그:

img

전반적인 설명

RSI 브레이크아웃 전략은 상대적 강도 지표 (RSI) 를 기반으로 한 양적 거래 전략이다. 이 전략은 RSI가 미리 설정된 과잉 구매 및 과잉 판매 임계값을 넘어서면 거래 신호를 생성합니다. 즉, RSI가 30보다 낮을 때 길고 RSI가 70보다 높을 때 짧습니다.

전략 논리

RSI 브레이크아웃 전략의 핵심 아이디어는 RSI 지표를 활용하여 시장에서 과소매와 과소매 조건을 결정하는 것입니다. RSI는 주식의 최근 강도 또는 약점을 반영하기 위해 일정 기간 동안 평균 가격 상승과 손실의 비율을 계산합니다. 일반적으로 30 이하의 RSI는 과소매로 간주되며 70 이상의 RSI는 과소매로 간주됩니다.

이 전략은 먼저 30과 70의 기본 값으로 RSI의 과반 판매 및 과반 구매 임계 값을 설정하고, 그 다음 실시간으로 RSI 라인을 모니터링합니다. RSI가 70 임계 이하를 상에서 아래로 넘으면 판매 신호가 생성됩니다. 이것은 시장이 과반 구매 구역에 진입했으며 하향으로 역전될 가능성이 있음을 나타냅니다. 따라서 짧은 지위가 취합니다. 반대로, RSI가 30 임계 이상으로 넘을 때 구매 신호가 생성되며, 과반 판매 시장이 다시 올라갈 가능성이 있음을 나타냅니다. 따라서 긴 지위가 취됩니다.

이 방법으로 전략은 주식 변동 중에 가격 반전 지점을 파악하고 그에 따라 지위를 조정하여 낮은 가격에 구매하고 높은 가격에 판매합니다.

장점

RSI 브레이크업 전략은 다음과 같은 장점을 가지고 있습니다.

  1. 단순하고 명확한 거래 신호. RSI 지표는 지표 라인이 임계 값을 넘어서면 관찰하여 계산하고 해석하는 것이 쉽습니다. 복잡한 규칙 없이 신호가 발생하면 신속하게 거래를 할 수 있습니다.

  2. 좋은 백테스트 결과로 완전히 자동화됩니다. 거래는 인간 개입없이 RSI 지표에 의해 생성됩니다. 동시에, RSI 과잉 구매 및 과잉 판매 신호는 효과적이기 때문에 백테스트에서 괜찮은 전략 수익을 가져옵니다.

  3. 매우 사용자 정의 가능. 거래자는 다양한 주식 및 시장 역동성에 맞게 과잉 구매 / 과잉 판매 기준과 같은 RSI 매개 변수를 유연하게 조정할 수 있습니다.

위험성

RSI 브레이크업 전략은 또한 몇 가지 위험을 안고 있습니다.

  1. 윙사 (Whipsaws) 에 유연하다. 지표의 임계 값의 빈번한 교차는 과도한 비효율적인 거래로 이어지며 안정적인 이익을 방해할 수 있다. 매개 변수는 일부 윙사 (Whipsaws) 신호를 필터하기 위해 조정될 수 있다.

  2. 트렌드 판단이 없습니다. RSI는 전반적인 트렌드를 잘 판단하지 않고 과반 구매 / 과반 판매 수준을 기반으로 신호를 생성합니다. 전략은 불안정한 시장에서 고착되는 경향이 있습니다. 트렌드 필터를 추가하여 역 트렌드 거래를 피할 수 있습니다.

  3. 높은 인하 위험. RSI는 종종 RSI 추세가 하락하는 동안 가격이 계속 상승할 때 상승하는 분리를 나타냅니다. 이러한 경우 짧은 거래는 큰 손실을 겪을 것입니다.

개선 영역

RSI 브레이크업 전략은 다음과 같은 방법으로 향상될 수 있습니다.

  1. RSI의 한계를 극복하기 위해 여러 지표를 포함하십시오. 예를 들어 시장 트렌드를 결정하기위한 이동 평균, 강도 지표 및 신호를 확인하기위한 볼륨 필터.

  2. 더 높은 안정성을 위해 RSI 매개 변수를 최적화하십시오. 과잉 구매 / 과잉 판매 임계치를 조정하고 신호 지속 시간 필터를 설정하는 등 엄격한 테스트를 통해. 이것은 비효율적인 신호를 필터합니다.

  3. 스톱 로스를 구현하고 리스크를 제어하기 위해 이윤을 취하십시오. 예를 들어, 비율 또는 포인트 스톱을 설정하십시오. 전체 이익에 대한 단일 거래 손실이 너무 크지 않도록하십시오. 또한 이윤을 취하기위한 트렌드와 기술적 포인트를 고려하십시오.

결론

RSI 브레이크아웃 전략은 과잉 구매 및 과잉 판매 신호를 기반으로 한 평균 반전 양적 전략이다. 간단하고 명확한 신호, 완전한 자동화 기능 및 높은 사용자 정의 기능이 있지만 윙사 및 드라우다운 위험이 있습니다. 지표 콤보 및 위험 통제로 최적화하여 안정적인 전략으로 조정 할 수 있습니다.


/*backtest
start: 2023-11-21 00:00:00
end: 2023-12-21 00:00:00
period: 2h
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/
// © Bunghole 2021

strategy(title="My New Strategy", initial_capital = 100000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 0, currency = 'USD', overlay=true)

//// Stoploss and Take Profit Parameters
// Enable Long Strategy
enable_long_strategy = input(true, title="Enable Long Strategy", group="SL/TP For Long Strategy",inline="1")
long_stoploss_value = input(defval=50, title='Stoploss %', type=input.float, minval=0.1, group="SL/TP For Long Strategy",inline="2")
long_stoploss_percentage = (close * (long_stoploss_value / 100)) / syminfo.mintick
long_takeprofit_value = input(defval=50, title='Take Profit %', type=input.float, minval=0.1, group="SL/TP For Long Strategy",inline="2")
long_takeprofit_percentage = (close * (long_takeprofit_value / 100)) / syminfo.mintick

// Enable Short Strategy
enable_short_strategy = input(true, title="Enable Short Strategy", group="SL/TP For Short Strategy",inline="3")
short_stoploss_value = input(defval=50, title='Stoploss %', type=input.float, minval=0.1, group= "SL/TP For Short Strategy",inline="4")
short_stoploss_percentage = (close * (short_stoploss_value / 100)) / syminfo.mintick
short_takeprofit_value = input(defval=50, title='Take Profit %', type=input.float, minval=0.1, group="SL/TP For Short Strategy",inline="4")
short_takeprofit_percentage = (close * (short_takeprofit_value / 100)) / syminfo.mintick

// Plot Stoploss & Take Profit Levels
long_stoploss_price = strategy.position_avg_price * (1 - long_stoploss_value/100)
long_takeprofit_price = strategy.position_avg_price * (1 + long_takeprofit_value/100)
short_stoploss_price = strategy.position_avg_price * (1 + short_stoploss_value/100)
short_takeprofit_price = strategy.position_avg_price * (1 - short_takeprofit_value/100)
plot(enable_long_strategy and not enable_short_strategy ? long_stoploss_price: na, color=#ff0000, style=plot.style_linebr, linewidth=2, title="Long SL Level")
plot(enable_long_strategy and not enable_short_strategy ? long_takeprofit_price: na, color=#008000, style=plot.style_linebr, linewidth=2, title="Long TP Level")
plot(enable_short_strategy and not enable_long_strategy ? short_stoploss_price: na, color=#ff0000, style=plot.style_linebr, linewidth=2, title="Short SL Level")
plot(enable_short_strategy and not enable_long_strategy ? short_takeprofit_price: na, color=#008000, style=plot.style_linebr, linewidth=2, title="Short TP Level")

// Date Range
start_date = input(title="Start Date", type=input.integer, defval=1, minval=1, maxval=31, group="Date Range")
start_month = input(title="Start Month", type=input.integer, defval=1, minval=1, maxval=12, group="Date Range")
start_year = input(title="Start Year", type=input.integer, defval=1804, minval=1800, maxval=3000, group="Date Range")
end_date = input(title="End Date", type=input.integer, defval=1, minval=1, maxval=3, group="Date Range")
end_month = input(title="End Month", type=input.integer, defval=1, minval=1, maxval=12, group="Date Range")
end_year = input(title="End Year", type=input.integer, defval=2077, minval=1800, maxval=3000, group="Date Range")
in_date_range = (time >= timestamp(syminfo.timezone, start_year, start_month, start_date, 0, 0)) and (time < timestamp(syminfo.timezone, end_year, end_month, end_date, 0, 0))

//// Inputs   **This is where you enter your indicators for your strategy. For example, I added the RSI indicator.**
//RSI
rsi = rsi(close, 14)
rsi_over_sold = rsi < 30
rsi_over_bought = rsi > 70


//// Strategy  **This is where you create your strategy. For example, We have or buy and sell signals.**
// Creating Long and Short Strategy
buy_signal = rsi_over_sold
sell_signal = rsi_over_bought

// Long Strategy
if buy_signal and in_date_range and enable_long_strategy == true
    strategy.entry("Long", true, when=buy_signal, alert_message="Open Long Position")
    strategy.exit("Long  SL/TP", from_entry="Long", loss=long_stoploss_percentage, profit=long_takeprofit_percentage, alert_message="Your Long SL/TP Limit As Been Triggered.")
    strategy.close("Long", when=sell_signal, alert_message="Close Long Position")
    
// Short Strategy
if sell_signal and in_date_range and enable_short_strategy == true
    strategy.entry("Short", false, when = sell_signal, alert_message="Open Short Position")
    strategy.exit("Short SL/TP", from_entry="Short", loss=short_stoploss_percentage, profit=short_takeprofit_percentage, alert_message="Your Short SL/TP Limit As Been Triggered.")
    strategy.close("Short", when=buy_signal, alert_message="Close Short Position")


더 많은