// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © relevantLeader16058
//@version=5
strategy(title='Bollinger bands + Aroon [Alorse]', shorttitle='BB + Aroon [Alorse]', overlay=true, pyramiding=0, currency=currency.USD, default_qty_type=strategy.percent_of_equity, default_qty_value=100, commission_type=strategy.commission.percent, commission_value=0.1)
// BB inputs and calculations
lengthBB = input.int(20, minval=1)
src = input(close, title='Source')
mult = input.float(2.0, minval=0.001, maxval=50, title='StdDev')
basis = ta.sma(src, lengthBB)
dev = mult * ta.stdev(src, lengthBB)
upper = basis + dev
lower = basis - dev
lengthAr = input.int(288, minval=1)
AroonUP = 100 * (ta.highestbars(high, lengthAr + 1) + lengthAr) / lengthAr
AroonDown = 100 * (ta.lowestbars(low, lengthAr + 1) + lengthAr) / lengthAr
Confirmation = input(90, 'Aroon Confirmation')
Stop = input(70, 'Aroon Stop')
Bullish = ta.crossunder(close, lower)
Bearish = ta.crossunder(close, upper)
//Entry
strategy.entry('Long', strategy.long, when=Bullish and AroonUP > Confirmation)
strategy.close('Long', when=Bearish or AroonUP < Stop)