Fibonacci Ghost Cloud
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © cryptofilio

//@version=5
indicator("Fibonacci Ghost Cloud", overlay=true, timeframe="", timeframe_gaps=false)

// Integer Series Input

a=(input.int(2,  title = "1",  inline="Integer Series", group="Integer Series"))
b=(input.int(3,  title = "2",  inline="Integer Series", group="Integer Series"))
c=(input.int(5,  title = "3",  inline="Integer Series", group="Integer Series"))
d=(input.int(8,  title = "4",  inline="Integer Series", group="Integer Series"))
e=(input.int(13, title = "5",  inline="Integer Series", group="Integer Series"))
f=(input.int(21, title = "6",  inline="Integer Series", group="Integer Series"))
g=(input.int(34, title = "7",  inline="Integer Series", group="Integer Series"))
h=(input.int(55, title = "8",  inline="Integer Series", group="Integer Series"))
i=(input.int(89, title = "9",  inline="Integer Series", group="Integer Series"))
j=(input.int(144,title = "10", inline="Integer Series", group="Integer Series"))
k=(input.int(233,title = "11", inline="Integer Series", group="Integer Series"))

//************************************* Highest *************************************************************

fib1o = ta.highest(open,  a)
fib1h = ta.highest(high,  a)
fib1l = ta.highest(low,   a)
fib1c = ta.highest(close, a)

fib2o = ta.highest(open,  a+b)
fib2h = ta.highest(high,  a+b)
fib2l = ta.highest(low,   a+b)
fib2c = ta.highest(close, a+b)

fib3o = ta.highest(open,  b+c)
fib3h = ta.highest(high,  b+c)
fib3l = ta.highest(low,   b+c)
fib3c = ta.highest(close, b+c)

fib4o = ta.highest(open,  c+d)
fib4h = ta.highest(high,  c+d)
fib4l = ta.highest(low,   c+d)
fib4c = ta.highest(close, c+d)

fib5o = ta.highest(open,  d+e)
fib5h = ta.highest(high,  d+e)
fib5l = ta.highest(low,   d+e)
fib5c = ta.highest(close, d+e)

fib6o = ta.highest(open,  e+f)
fib6h = ta.highest(high,  e+f)
fib6l = ta.highest(low,   e+f)
fib6c = ta.highest(close, e+f)

fib7o = ta.highest(open,  f+g)
fib7h = ta.highest(high,  f+g)
fib7l = ta.highest(low,   f+g)
fib7c = ta.highest(close, f+g)

fib8o = ta.highest(open,  g+h)
fib8h = ta.highest(high,  g+h)
fib8l = ta.highest(low,   g+h)
fib8c = ta.highest(close, g+h)

fib9o = ta.highest(open,  h+i)
fib9h = ta.highest(high,  h+i)
fib9l = ta.highest(low,   h+i)
fib9c = ta.highest(close, h+i)

fib10o = ta.highest(open,  i+j)
fib10h = ta.highest(high,  i+j)
fib10l = ta.highest(low,   i+j)
fib10c = ta.highest(close, i+j)

fib11o = ta.highest(open,  j+k)
fib11h = ta.highest(high,  j+k)
fib11l = ta.highest(low,   j+k)
fib11c = ta.highest(close, j+k)

//

transp_teal1  = color.new(color.teal, 45)
transp_teal2  = color.new(color.teal, 50)
transp_teal3  = color.new(color.teal, 55)
transp_teal4  = color.new(color.teal, 45)
transp_teal5  = color.new(color.teal, 50)
transp_teal6  = color.new(color.teal, 55)
transp_teal7  = color.new(color.teal, 60)
transp_teal8  = color.new(color.teal, 65)
transp_teal9  = color.new(color.teal, 70)
transp_teal10 = color.new(color.teal, 75)
transp_teal11 = color.new(color.teal, 80)

// Plotting

//1

//fib1_op = plot(fib1o, display=display.none)
fib1_hp = plot(fib1h, display=display.none, editable=false)
fib1_lp = plot(fib1l, display=display.none, editable=false)
//fib1_cp = plot(fib1c, display=display.none)
//fill(fib1_op, fib1_hp, transp_teal1)
fill(fib1_hp, fib1_lp, transp_teal1, editable=false)
//fill(fib1_lp, fib1_cp, transp_teal1)

//2

//fib2_op = plot(fib2o, display=display.none)
fib2_hp = plot(fib2h, display=display.none, editable=false)
fib2_lp = plot(fib2l, display=display.none, editable=false)
//fib2_cp = plot(fib2c, display=display.none)
//fill(fib2_op, fib2_hp, transp_teal2)
fill(fib2_hp, fib2_lp, transp_teal2, editable=false)
//fill(fib2_lp, fib2_cp, transp_teal2)

//3

//fib3_op = plot(fib3o, display=display.none)
fib3_hp = plot(fib3h, display=display.none, editable=false)
fib3_lp = plot(fib3l, display=display.none, editable=false)
//fib3_cp = plot(fib3c, display=display.none)
//fill(fib3_op, fib3_hp, transp_teal3)
fill(fib3_hp, fib3_lp, transp_teal3, editable=false)
//fill(fib3_lp, fib3_cp, transp_teal3)

//4

//fib4_op = plot(fib4o, display=display.none, editable=false)
fib4_hp = plot(fib4h, display=display.none, editable=false)
fib4_lp = plot(fib4l, display=display.none, editable=false)
//fib4_cp = plot(fib4c, display=display.none, editable=false)
//fill(fib4_op, fib4_hp, transp_teal4, editable=false)
fill(fib4_hp, fib4_lp, transp_teal4, editable=false)
//fill(fib4_lp, fib4_cp, transp_teal4, editable=false)

//5

//fib5_op = plot(fib5o, display=display.none, editable=false)
fib5_hp = plot(fib5h, display=display.none, editable=false)
fib5_lp = plot(fib5l, display=display.none, editable=false)
//fib5_cp = plot(fib5c, display=display.none, editable=false)
//fill(fib5_op, fib5_hp, transp_teal5, editable=false)
fill(fib5_hp, fib5_lp, transp_teal5, editable=false)
//fill(fib5_lp, fib5_cp, transp_teal5, editable=false)

//6

//fib6_op = plot(fib6o, display=display.none, editable=false)
fib6_hp = plot(fib6h, display=display.none, editable=false)
fib6_lp = plot(fib6l, display=display.none, editable=false)
//fib6_cp = plot(fib6c, display=display.none, editable=false)
//fill(fib6_op, fib6_hp, transp_teal6, editable=false)
fill(fib6_hp, fib6_lp, transp_teal6, editable=false)
//fill(fib6_lp, fib6_cp, transp_teal6, editable=false)

//7

//fib7_op = plot(fib7o, display=display.none, editable=false)
fib7_hp = plot(fib7h, display=display.none, editable=false)
fib7_lp = plot(fib7l, display=display.none, editable=false)
//fib7_cp = plot(fib7c, display=display.none, editable=false)
//fill(fib7_op, fib7_hp, transp_teal7, editable=false)
fill(fib7_hp, fib7_lp, transp_teal7, editable=false)
//fill(fib7_lp, fib7_cp, transp_teal7, editable=false)

//8

//fib8_op = plot(fib8o, display=display.none, editable=false)
fib8_hp = plot(fib8h, display=display.none, editable=false)
fib8_lp = plot(fib8l, display=display.none, editable=false)
//fib8_cp = plot(fib8c, display=display.none, editable=false)
//fill(fib8_op, fib8_hp, transp_teal8, editable=false)
fill(fib8_hp, fib8_lp, transp_teal8, editable=false)
//fill(fib8_lp, fib8_cp, transp_teal8, editable=false)

//9

//fib9_op = plot(fib9o, display=display.none, editable=false)
fib9_hp = plot(fib9h, display=display.none, editable=false)
fib9_lp = plot(fib9l, display=display.none, editable=false)
//fib9_cp = plot(fib9c, display=display.none, editable=false)
//fill(fib9_op, fib9_hp, transp_teal9, editable=false)
fill(fib9_hp, fib9_lp, transp_teal9, editable=false)
//fill(fib9_lp, fib9_cp, transp_teal9, editable=false)

//10

//fib10_op = plot(fib10o, display=display.none, editable=false)
fib10_hp = plot(fib10h, display=display.none, editable=false)
fib10_lp = plot(fib10l, display=display.none, editable=false)
//fib10_cp = plot(fib10c, display=display.none, editable=false)
//fill(fib10_op, fib10_hp, transp_teal10, editable=false)
fill(fib10_hp, fib10_lp, transp_teal10, editable=false)
//fill(fib10_lp, fib10_cp, transp_teal10, editable=false)

//11

//fib11_op = plot(fib11o, display=display.none, editable=false)
fib11_hp = plot(fib11h, display=display.none, editable=false)
fib11_lp = plot(fib11l, display=display.none, editable=false)
//fib11_cp = plot(fib11c, display=display.none, editable=false)
//fill(fib11_op, fib11_hp, transp_teal11, editable=false)
fill(fib11_hp, fib11_lp, transp_teal11, editable=false)
//fill(fib11_lp, fib11_cp, transp_teal11, editable=false)

//*********************************************** LOWEST **************************************

//fiba1o = ta.lowest(open,  a)
fiba1h = ta.lowest(high,  a)
fiba1l = ta.lowest(low,   a)
//fiba1c = ta.lowest(close, a)

//fiba2o = ta.lowest(open,  a+b)
fiba2h = ta.lowest(high,  a+b)
fiba2l = ta.lowest(low,   a+b)
//fiba2c = ta.lowest(close, a+b)

//fiba3o = ta.lowest(open,  b+c)
fiba3h = ta.lowest(high,  b+c)
fiba3l = ta.lowest(low,   b+c)
//fiba3c = ta.lowest(close, b+c)

//fiba4o = ta.lowest(open,  c+d)
fiba4h = ta.lowest(high,  c+d)
fiba4l = ta.lowest(low,   c+d)
//fiba4c = ta.lowest(close, c+d)

//fiba5o = ta.lowest(open,  d+e)
fiba5h = ta.lowest(high,  d+e)
fiba5l = ta.lowest(low,   d+e)
//fiba5c = ta.lowest(close, d+e)

//fiba6o = ta.lowest(open,  e+f)
fiba6h = ta.lowest(high,  e+f)
fiba6l = ta.lowest(low,   e+f)
//fiba6c = ta.lowest(close, e+f)

//fiba7o = ta.lowest(open,  f+g)
fiba7h = ta.lowest(high,  f+g)
fiba7l = ta.lowest(low,   f+g)
//fiba7c = ta.lowest(close, f+g)

//fiba8o = ta.lowest(open,  g+h)
fiba8h = ta.lowest(high,  g+h)
fiba8l = ta.lowest(low,   g+h)
//fiba8c = ta.lowest(close, g+h)

//fiba9o = ta.lowest(open,  h+i)
fiba9h = ta.lowest(high,  h+i)
fiba9l = ta.lowest(low,   h+i)
//fiba9c = ta.lowest(close, h+i)

//fiba10o = ta.lowest(open,  i+j)
fiba10h = ta.lowest(high,  i+j)
fiba10l = ta.lowest(low,   i+j)
//fiba10c = ta.lowest(close, i+j)

//fiba11o = ta.lowest(open,  j+k)
fiba11h = ta.lowest(high,  j+k)
fiba11l = ta.lowest(low,   j+k)
//fiba11c = ta.lowest(close, j+k)

//

transp_maroon1 = color.new(color.maroon, 35)
transp_maroon2 = color.new(color.maroon, 40)
transp_maroon3 = color.new(color.maroon, 45)
transp_maroon4 = color.new(color.maroon, 50)
transp_maroon5 = color.new(color.maroon, 55)
transp_maroon6 = color.new(color.maroon, 60)
transp_maroon7 = color.new(color.maroon, 65)
transp_maroon8 = color.new(color.maroon, 70)
transp_maroon9 = color.new(color.maroon, 75)
transp_maroon10 = color.new(color.maroon,80)
transp_maroon11 = color.new(color.maroon,85)

// Plotting

//1

//fiba1_op = plot(fiba1o, display=display.none)
fiba1_hp = plot(fiba1h, display=display.none)
fiba1_lp = plot(fiba1l, display=display.none)
//fiba1_cp = plot(fiba1c, display=display.none)
//fill(fiba1_op, fiba1_hp, transp_maroon1)
fill(fiba1_hp, fiba1_lp, transp_maroon1)
//fill(fiba1_lp, fiba1_cp, transp_maroon1)

//2

//fiba2_op = plot(fiba2o, display=display.none)
fiba2_hp = plot(fiba2h, display=display.none)
fiba2_lp = plot(fiba2l, display=display.none)
//fiba2_cp = plot(fiba2c, display=display.none)
//fill(fiba2_op, fiba2_hp, transp_maroon2)
fill(fiba2_hp, fiba2_lp, transp_maroon2)
//fill(fiba2_lp, fiba2_cp, transp_maroon2)

//3

//fiba3_op = plot(fiba3o, display=display.none)
fiba3_hp = plot(fiba3h, display=display.none)
fiba3_lp = plot(fiba3l, display=display.none)
//fiba3_cp = plot(fiba3c, display=display.none)
//fill(fiba3_op, fiba3_hp, transp_maroon3)
fill(fiba3_hp, fiba3_lp, transp_maroon3)
//fill(fiba3_lp, fiba3_cp, transp_maroon3)

//4

//fiba4_op = plot(fiba4o, display=display.none, editable=false)
fiba4_hp = plot(fiba4h, display=display.none, editable=false)
fiba4_lp = plot(fiba4l, display=display.none, editable=false)
//fiba4_cp = plot(fiba4c, display=display.none, editable=false)
//fill(fiba4_op, fiba4_hp, transp_maroon4, editable=false)
fill(fiba4_hp, fiba4_lp, transp_maroon4, editable=false)
//fill(fiba4_lp, fiba4_cp, transp_maroon4, editable=false)

//5

//fiba5_op = plot(fiba5o, display=display.none, editable=false)
fiba5_hp = plot(fiba5h, display=display.none, editable=false)
fiba5_lp = plot(fiba5l, display=display.none, editable=false)
//fiba5_cp = plot(fiba5c, display=display.none, editable=false)
//fill(fiba5_op, fiba5_hp, transp_maroon5, editable=false)
fill(fiba5_hp, fiba5_lp, transp_maroon5, editable=false)
//fill(fiba5_lp, fiba5_cp, transp_maroon5, editable=false)

//6

//fiba6_op = plot(fiba6o, display=display.none, editable=false)
fiba6_hp = plot(fiba6h, display=display.none, editable=false)
fiba6_lp = plot(fiba6l, display=display.none, editable=false)
//fiba6_cp = plot(fiba6c, display=display.none, editable=false)
//fill(fiba6_op, fiba6_hp, transp_maroon6, editable=false)
fill(fiba6_hp, fiba6_lp, transp_maroon6, editable=false)
//fill(fiba6_lp, fiba6_cp, transp_maroon6, editable=false)

//7

//fiba7_op = plot(fiba7o, display=display.none, editable=false)
fiba7_hp = plot(fiba7h, display=display.none, editable=false)
fiba7_lp = plot(fiba7l, display=display.none, editable=false)
//fiba7_cp = plot(fiba7c, display=display.none, editable=false)
//fill(fiba7_op, fiba7_hp, transp_maroon7, editable=false)
fill(fiba7_hp, fiba7_lp, transp_maroon7, editable=false)
//fill(fiba7_lp, fiba7_cp, transp_maroon7, editable=false)

//8

//fiba8_op = plot(fiba8o, display=display.none, editable=false)
fiba8_hp = plot(fiba8h, display=display.none, editable=false)
fiba8_lp = plot(fiba8l, display=display.none, editable=false)
//fiba8_cp = plot(fiba8c, display=display.none, editable=false)
//fill(fiba8_op, fiba8_hp, transp_maroon8, editable=false)
fill(fiba8_hp, fiba8_lp, transp_maroon8, editable=false)
//fill(fiba8_lp, fiba8_cp, transp_maroon8, editable=false)

//9

//fiba9_op = plot(fiba9o, display=display.none, editable=false)
fiba9_hp = plot(fiba9h, display=display.none, editable=false)
fiba9_lp = plot(fiba9l, display=display.none, editable=false)
//fiba9_cp = plot(fiba9c, display=display.none, editable=false)
//fill(fiba9_op, fiba9_hp, transp_maroon9, editable=false)
fill(fiba9_hp, fiba9_lp, transp_maroon9, editable=false)
//fill(fiba9_lp, fiba9_cp, transp_maroon9, editable=false)

//10

//fiba10_op = plot(fiba10o, display=display.none, editable=false)
fiba10_hp = plot(fiba10h, display=display.none, editable=false)
fiba10_lp = plot(fiba10l, display=display.none, editable=false)
//fiba10_cp = plot(fiba10c, display=display.none, editable=false)
//fill(fiba10_op, fiba10_hp, transp_maroon10, editable=false)
fill(fiba10_hp, fiba10_lp, transp_maroon10, editable=false)
//fill(fiba10_lp, fiba10_cp, transp_maroon10, editable=false)

//11

//fiba11_op = plot(fiba11o, display=display.none, editable=false)
fiba11_hp = plot(fiba11h, display=display.none, editable=false)
fiba11_lp = plot(fiba11l, display=display.none, editable=false)
//fiba11_cp = plot(fiba11c, display=display.none, editable=false)
//fill(fiba11_op, fiba11_hp, transp_maroon11, editable=false)
fill(fiba11_hp, fiba11_lp, transp_maroon11, editable=false)
//fill(fiba11_lp, fiba11_cp, transp_maroon11, editable=false)

average_fib  = (fib1h +fib2h +fib3h +fib4h +fib5h +fib6h +fib7h +fib8h +fib9h +fib10h + fib11h)/11
average_fiba = (fiba1h+fiba2h+fiba3h+fiba4h+fiba5h+fiba6h+fiba7h+fiba8h+fiba9h+fiba10h+fiba11h)/11

plot (average_fib, color=color.new(color.green, 20), linewidth=2)
plot (average_fiba,color=color.new(color.red,   20), linewidth=2)