
이 전략은 상대적으로 약한 지수 ((RSI) 지표의 과매매 신호를 기반으로, 하루의 낮은 시점에 구매하고, 그 다음 고정된 비율의 정지 및 상실을 설정하여, 전략이 정지 및 상실을 접촉했을 때 재검토한다. 주요 아이디어는 RSI 지표의 과매매 시점에 반전 기회를 이용하고, 하루의 낮은 시점에 개입하여 반전으로 인한 단기 수익을 취하는 것이다. 동시에, 이동 평균선을 사용하여 필터링 트렌드를 사용하여, 평균선보다 가격이 높을 때만 시장을 더 많이 한다.
RSI2 전략은 RSI 지표가 초과된 후 일간 반전 기회를 포착하여 고정 비율의 중지 손실을 설정하여 위험을 제어하고, 장기 주기평균선을 사용하여 역동 신호를 필터링합니다. 이 전략의 아이디어는 간단하며, 짧은 라인 투기 거래자에게 적합합니다. 그러나 트렌드 판단이 부족하여 가장 낮은 시점에 정확하게 구매하는 것이 어렵고 고정된 중지 손실은 전략의 수익 공간을 제한합니다.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © rajk1987
//@version=5
strategy("RSI2 strategy Raj", overlay=true, margin_long=100, margin_short=100)
rsi_len = input.int( 2, title = "RSI Length", group = "Indicators")
rsi_os = input.float(10, title = "RSI Oversold", group = "Indicators")
rsi_ob = input.float(90, title = "RSI OverBrought", group = "Indicators")
max_los = input.float(3,title = "Max Loss Percent", group = "Indicators")
tar_per = input.float(6,title = "Target Percent",group = "Indicators")
//Get the rsi value of the stock
rsi = ta.rsi(close, rsi_len)
sma = ta.sma(close,200)
var ent_dat = 0
var tar = 0.0
var los = 0.0
var bp = 0.0
if ((close > sma) and (rsi < rsi_os))
strategy.entry("RSI2 Long Entry", strategy.long,1)
ent_dat := time(timeframe = timeframe.period)
if(ent_dat == time(timeframe = timeframe.period))
bp := low //high/2 + low/2
tar := bp * (1 + (tar_per/100))
los := bp * (1 - (max_los/100))
if (time(timeframe = timeframe.period) > ent_dat)
strategy.exit("RSI2 Exit", "RSI2 Long Entry",qty = 1, limit = tar, stop = los, comment_profit = "P", comment_loss = "L")
//plot(rsi,"RSI")
//plot(bp,"BP")
//plot(tar,"TAR")
//plot(los,"LOS")