managing long positions based on the 9, 21, and 50 simple moving averages (SMAs) into the Pine Script that already includes Bollinger Bands, we need to define the following conditions:
Long Position Conditions: Enter a long position when the 9-period SMA crosses above the 21-period SMA. Confirm the long position when the 9-period SMA bounces off the 21-period SMA. Maintain the long position if the 9-period SMA crosses above the 50-period SMA. The position remains long if the price retraces and then bounces off the 50-period SMA.