
이 전략은 RSI 지표와 그 평균선의 교차를 통해 매매점을 결정하며, 단선 거래 전략에 속한다. 이 전략은 RSI 지표가 그 평균선보다 낮을 때 구매하고, 그 평균선보다 높을 때 판매하며, 전형적인 낮은 가격으로 높은 가격으로 판매하는 전략에 속한다.
이것은 전형적인 트렌드 리버스 전략으로 RSI 지표의 오버 바이 오버 셀 특성을 이용해서 구매 시점을 결정한다. 이 전략에는 다음과 같은 장점이 있다:
전체적으로 볼 때, 이것은 간단하고 실용적인 단선 거래 전략입니다.
이 전략에는 몇 가지 위험도 있습니다.
이러한 위험은 매개 변수 최적화, 필터링 조건을 추가하는 등의 방법으로 완화될 수 있다.
이 전략은 다음과 같은 차원에서 최적화될 수 있습니다.
다중 지표 조합, 손해 관리, 변수 최적화 등의 수단으로 전략 성과를 크게 향상시킬 수 있다.
이 전략은 전체적으로 매우 전형적이고 실용적인 짧은 라인 거래 전략이다. RSI 지표의 오버 바이 오버 셀 상태를 사용하여 매매 시기를 판단하고, 평평한 필터링으로 보조한다. 전략 논리는 간단하고 명확하며, 매개 변수를 조정하는 것은 유연하며, 구현하기 쉽다.
/*backtest
start: 2022-11-24 00:00:00
end: 2023-11-30 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © I11L
//@version=5
strategy("I11L - Meanreverter 4h", overlay=false, pyramiding=3, default_qty_value=10000, initial_capital=10000, default_qty_type=strategy.cash,process_orders_on_close=false, calc_on_every_tick=false)
frequency = input.int(10)
rsiFrequency = input.int(40)
buyZoneDistance = input.int(5)
avgDownATRSum = input.int(3)
useAbsoluteRSIBarrier = input.bool(true)
barrierLevel = 50//input.int(50)
momentumRSI = ta.rsi(close,rsiFrequency)
momentumRSI_slow = ta.sma(momentumRSI,frequency)
isBuy = momentumRSI < momentumRSI_slow*(1-buyZoneDistance/100) and (strategy.position_avg_price - math.sum(ta.atr(20),avgDownATRSum)*strategy.opentrades > close or strategy.opentrades == 0 ) //and (momentumRSI < barrierLevel or not(useAbsoluteRSIBarrier))
isShort = momentumRSI > momentumRSI_slow*(1+buyZoneDistance/100) and (strategy.position_avg_price - math.sum(ta.atr(20),avgDownATRSum)*strategy.opentrades > close or strategy.opentrades == 0 ) and (momentumRSI > barrierLevel or not(useAbsoluteRSIBarrier))
momentumRSISoftClose = (momentumRSI > momentumRSI_slow) and (momentumRSI > barrierLevel or not(useAbsoluteRSIBarrier))
isClose = momentumRSISoftClose
plot(momentumRSI,color=isClose ? color.red : momentumRSI < momentumRSI_slow*(1-buyZoneDistance/100) ? color.green : color.white)
plot(momentumRSI_slow,color=color.gray)
plot(barrierLevel,color=useAbsoluteRSIBarrier ? color.white : color.rgb(0,0,0,0))
plot(momentumRSI_slow*(1-buyZoneDistance/100),color=color.gray)
plot(momentumRSI_slow*(1+buyZoneDistance/100),color=color.gray)
plot(momentumRSI_slow*(1+(buyZoneDistance*2)/100),color=color.gray)
// plot(strategy.wintrades - strategy.losstrades)
if(isBuy)
strategy.entry("Buy",strategy.long, comment="#"+str.tostring(strategy.opentrades+1))
// if(isShort)
// strategy.entry("Sell",strategy.short, comment="#"+str.tostring(strategy.opentrades+1))
if(isClose)
strategy.exit("Close",limit=close)