STDev Bands
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Eliza123123

//@version=4
study("STDev Bands", overlay = true)

mean_last_bars = (sma(ohlc4, 1440))
stdev_last_bars = stdev(ohlc4, 1440)

plot(mean_last_bars, color =color.white)
plot(mean_last_bars + stdev_last_bars, color =color.red)
plot(mean_last_bars - stdev_last_bars, color =color.red)
plot(mean_last_bars + 2* stdev_last_bars, color =color.orange)
plot(mean_last_bars - 2* stdev_last_bars, color =color.orange)
plot(mean_last_bars + 3* stdev_last_bars, color =color.yellow)
plot(mean_last_bars - 3* stdev_last_bars, color =color.yellow)
plot(mean_last_bars + 4* stdev_last_bars, color =color.green)
plot(mean_last_bars - 4* stdev_last_bars, color =color.green)
plot(mean_last_bars + 5* stdev_last_bars, color =color.aqua)
plot(mean_last_bars - 5* stdev_last_bars, color =color.aqua)
plot(mean_last_bars + 6* stdev_last_bars, color =color.purple)
plot(mean_last_bars - 6* stdev_last_bars, color =color.purple)
plot(mean_last_bars + 7* stdev_last_bars, color =color.fuchsia)
plot(mean_last_bars - 7* stdev_last_bars, color =color.fuchsia)