[[중국어 간략화]
이 전략은 부린 대역과 상대적으로 약한 지표 RSI를 결합하여 가격 변동성과 최적의 진입 지점을 예측합니다. 전략 논리는 매우 직설적입니다. 우리는 종결 가격이 부린 대역의 경로를 건드렸을 때, 두 가지 상황이 발생할 것입니다. 가격이 부린 대역의 경로를 건드렸을 때, 또는 계속 떨어집니다. 가격 움직임을 확인하기 위해, 우리는 두 번째 지표 RSI를 사용하여 가격 추세를 더 연구합니다. 예를 들어, 가격과 부린 대역의 경로를 건드렸지만 RSI 값은 초매 지역에 들어 가지 않았습니다.
우리는 RSI가 너무 오래 오퍼셀 지역에 머물러서 큰 손실을 피하기 위해 손실을 막아야합니다.
최적의 정지 지역은 가격이 브린 중간 경로 / 상단 경로 또는 RSI가 초과 구매 영역에 도달했을 때, 우선 순위가 됩니다.
많은 사람들이 입학했습니다.
RSI < 30 그리고 마감 가격 < 브린 하향
많은 선수들이 출전했습니다.
RSI > 70
이 전략은 먼저 RSI 지표를 계산하여 상하계를 설정하여 과매매를 판단합니다. 그리고 브린 밴드의 중간 궤도, 상하계 및 하하계를 계산합니다. 종결 가격이 브린 하하계와 RSI가 30보다 낮으면 더 많이하고, RSI가 70보다 높으면 평소합니다.
다자리에 들어가면, 스톱포스트를 설정한다. 스톱포스트는 입시 가격으로 설정한다.(1+ 고정 비율)(1- 고정 비율)
그래서 우리는 부린이 하락할 때 RSI 하위에서 동시에 구매하고 RSI 하위에서 동시에 판매하여 역거래를 이용하여 수익을 얻습니다. 동시에 위험을 통제하기 위해 스톱 손실을 설정합니다.
브린 밴드 매개 변수를 조정하고, 다른 지표와 선택적으로 결합하고, 적절히 느슨한 중지 범위를 사용하여 위험을 줄일 수 있습니다.
이 전략은 전반적인 리스크 수익 균형이 좋으며, 피드백 성능이 좋다. 변수 조정과 지표 최적화를 통해 효과를 더욱 향상시킬 수 있다. 브린 띠 기반의 역거래 사상은 간단하고 신뢰할 수 있으며, 추가 연구 및 개선에 가치가 있다.
||
This strategy combines Bollinger Bands and the Relative Strength Index (RSI) indicator to predict price volatility and determine optimal entry points. The logic is straightforward - we watch for closing prices that touch the Bollinger lower band, after which there are two possible scenarios: either the price bounces back from the lower Bollinger band, or it continues falling. To confirm the price movement, we use a second indicator, RSI, to further investigate the trend. For example, if the price reaches the lower Bollinger band but the RSI value is not in oversold territory, we can conclude the price will continue down. If the RSI value is oversold, we can use this area as our entry point.
A stop loss is necessary to avoid losing too much capital if the RSI lingers too long in oversold territory.
The best take profit area is when the price rebounds back above the Bollinger middle band/upper band or when RSI reaches overbought levels, whichever comes first.
Long entry:
RSI < 30 and close price < Bollinger lower band
Long exit:
RSI > 70
The strategy first calculates the RSI indicator and sets upper/lower boundaries to determine overbought/oversold levels. It then calculates the Bollinger middle, upper and lower bands. When the closing price touches the lower band and RSI is below 30, go long. When RSI is above 70, close the position.
Upon entering long, set stop loss and take profit points. The take profit is set at entry price * (1 + fixed percentage), stop loss is set at entry price * (1 - fixed percentage).
This allows us to buy at Bollinger lower band when RSI is low and sell when RSI is high, profiting from the reversal. Stop loss and take profit control risk.
Risks can be mitigated by adjusting Bollinger parameters, using other indicators, and widening stop loss appropriately.
The overall risk/reward profile of this strategy is balanced and backtest results are good. Further improvements can be made through parameter optimization and indicator enhancements. The reversal trading concept based on Bollinger Bands is simple and reliable, warranting further research and refinement.
[/trans]
/*backtest
start: 2023-09-10 00:00:00
end: 2023-09-17 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
//strategy(title="Bollinger Band with RSI", shorttitle="BB&RSI", format=format.price, precision=2, pyramiding=50, initial_capital=10000, calc_on_order_fills=false, calc_on_every_tick=true, default_qty_type=strategy.cash, default_qty_value=1000, currency="USD")
len = input(14, minval=1, title="Length")
src = input(close, "Source", type = input.source)
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))
plot(rsi, "RSI", color=#8E1599)
band1 = hline(70, "Upper Band", color=#C0C0C0)
band0 = hline(30, "Lower Band", color=#C0C0C0)
fill(band1, band0, color=#9915FF, transp=90, title="Background")
length_bb = input(20,title="BB Length", minval=1)
mult = input(2.0, minval=0.001, maxval=50, title="BB StdDev")
basis = sma(src, length_bb)
dev = mult * stdev(src, length_bb)
upper = basis + dev
lower = basis - dev
offset = input(0, "BB Offset", type = input.integer, minval = -500, maxval = 500)
Plot_PnL = input(title="Plot Cummulative PnL", type=input.bool, defval=false)
Plot_Pos = input(title="Plot Current Position Size", type=input.bool, defval=false)
long_tp_inp = input(10, title='Long Take Profit %', step=0.1)/100
long_sl_inp = input(25, title='Long Stop Loss %', step=0.1)/100
// Take profit/stop loss
long_take_level = strategy.position_avg_price * (1 + long_tp_inp)
long_stop_level = strategy.position_avg_price * (1 - long_sl_inp)
entry_long = rsi < 30 and src < lower
exit_long = rsi > 70
plotshape(entry_long, style=shape.labelup, color=color.green, location=location.bottom, text="L", textcolor=color.white, title="LONG_ORDER")
plotshape(exit_long, style=shape.labeldown, color=color.red, location=location.top, text="S", textcolor=color.white, title="SHORT_ORDER")
strategy.entry("Long",true,when=entry_long)
strategy.exit("TP/SL","Long", limit=long_take_level, stop=long_stop_level)
strategy.close("Long", when=exit_long, comment="Exit")
plot(Plot_PnL ? strategy.equity-strategy.initial_capital : na, title="PnL", color=color.red)
plot(Plot_Pos ? strategy.position_size : na, title="open_position", color=color.fuchsia)