juliangonzaconde

Bollinger Bands strategy with RSI and MACD v1.0

This is a strategy based on the Bollinger Bands, where buy trades are made when the price crosses the lower line of the Bollinger Bands upwards, and sell trades are made when the price crosses the upper line downwards.

In addition, it is possible through the inputs to enable trading with RSI and MACD, so that buy or sell trades are supported by these two indicators.

Trades are partially and fully closed in the following way, a buy trade will close half of the position when the price touches the middle line of the Bollinger bands and will be fully closed when the price touches the upper band. In the case of a sell position, half of the position will be closed if the price touches the middle band and the entire position will be closed when the price touches the lower band. Alternatively, a fixed take profit can be placed. In case the price moves against us, trailing stops can be placed.

In case of selecting to use RSI, MACD, or MACD variation, trades will be executed as long as The Bollinger Bands, and all the above-mentioned indicators give the same signals, either buy or sell.

For example in the case of selecting only Use RSI, buy trades would be made as long as RSI and BB give buy signals.

Strategy inputs:

-BB source: Bollinger Bands price source.

-Bollinger Bands SMA length: Bollinger Bands simple moving average length.

-Bollinger Bands StdDev length: Bollinger Bands standard deviation length.

-Trail Long Loss (%): Distance in percentage at which the stop loss will initially be placed for buy trades.

-Trail Short Loss (%): Distance in percentage at which the stop loss will be initially placed for sell trades.

-Maximum orders: Maximum of simultaneous operations, for example, if it is 3, up to 3 parallel operations of buy and up to 3 parallel operations of sell will be carried out.

-Position size: Number of contracts per trade.

-Use RSI: If selected, the strategy will also trade based on oversold or overbought signals provided by the RSI.

-RSI source: RSI price source.

-RSI period: The RSI period to use.

-RSI value for buy: If the RSI is below this value, it will give a buy signal.

-RSI value for sell: If the RSI value is above this value, it will give a sell signal.

-Use MACD: If selected, buy trades will be made when the MACD crosses 0 upwards, and sell trades will be made when the MACD crosses 0 downwards.

-Use MACD variation: Only available if MACD is previously selected. In this case, buy trades are made if the MACD value in the last 3 candles has been decreasing, and sell trades are made if the MACD value has been increasing.

-MACD source: MACD price source.

-MACD fast length: MACD fast EMA lenght.

-MACD slow length: MACD slow EMA lenght.

-MACD signal length: MACD signal EMA lenght.

-Use maximum TP long: If selected, a fixed take profit will be placed for buy trades. The position could be closed before reaching this take profit if the price touches one of the lower or upper lines first.

-Maximum take profit long (%): Distance in percentage at which the take profit will be placed for buy trades.

-Use maximum TP short: if selected, a fixed take profit will be placed for sell trades. The position could be closed before reaching this take profit if the price touches one of the lower or upper lines first.

-Maximum take profit short (%): Distance in percentage at which the take profit will be set for sell trades.

I hope you like it and as always all feedback is welcome.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?