1. Entry and Exit Conditions: The buy entry is triggered based on the close breaking the high of the previous green candle, and it checks that the close is below the lower band. The individual exit commands for each target (target1 and target2) and stop loss are set correctly.
2. Sell Entry and Exit: The sell entry checks for a close below the low of the previously detected bearish candle, and it also checks that the price is above the upper band. The sell exit properly sets the target sell condition based on the lower band.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.