Fibonacci Volatility Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar

//@version=5
indicator("Fibonacci Volatility Bands", overlay = true)

first_boll_upper     = ta.sma(high, 5)   + (ta.stdev(high, 5)   * 2)
second_boll_upper    = ta.sma(high, 8)   + (ta.stdev(high, 8)   * 2)
third_boll_upper     = ta.sma(high, 13)  + (ta.stdev(high, 13)  * 2)
fourth_boll_upper    = ta.sma(high, 21)  + (ta.stdev(high, 21)  * 2)
fifth_boll_upper     = ta.sma(high, 34)  + (ta.stdev(high, 34)  * 2)
sixth_boll_upper     = ta.sma(high, 55)  + (ta.stdev(high, 55)  * 2)
seventh_boll_upper   = ta.sma(high, 89)  + (ta.stdev(high, 89)  * 2)
eigth_boll_upper     = ta.sma(high, 144) + (ta.stdev(high, 144) * 2)

av_boll_upper = (first_boll_upper + 
           second_boll_upper + 
           third_boll_upper + 
           fourth_boll_upper +
           fifth_boll_upper + 
           sixth_boll_upper +
           seventh_boll_upper + 
           eigth_boll_upper) / 8

first_boll_lower     = ta.sma(low, 5)   - (ta.stdev(low, 5)   * 2)
second_boll_lower    = ta.sma(low, 8)   - (ta.stdev(low, 8)   * 2)
third_boll_lower     = ta.sma(low, 13)  - (ta.stdev(low, 13)  * 2)
fourth_boll_lower    = ta.sma(low, 21)  - (ta.stdev(low, 21)  * 2)
fifth_boll_lower     = ta.sma(low, 34)  - (ta.stdev(low, 34)  * 2)
sixth_boll_lower     = ta.sma(low, 55)  - (ta.stdev(low, 55)  * 2)
seventh_boll_lower   = ta.sma(low, 89)  - (ta.stdev(low, 89)  * 2)
eigth_boll_lower     = ta.sma(low, 144) - (ta.stdev(low, 144) * 2)

av_boll_lower = (first_boll_lower + 
           second_boll_lower + 
           third_boll_lower + 
           fourth_boll_lower +
           fifth_boll_lower + 
           sixth_boll_lower +
           seventh_boll_lower + 
           eigth_boll_lower) / 8

plot(av_boll_lower, color = color.aqua)
plot(av_boll_upper, color = color.purple)