Number Frame
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © fvideira

//@version=5
indicator("Number Frame", overlay=true)

// Study of number levels from Eliza123123's quantative trading series: https://youtu.be/S7UMA__wz74

// number Const.

numberStd = input.bool(true, "Standard Multiples", group = "Number Multiples")

numberPrime = input(true, "Prime Multiples", group = "Number Multiples")

numberMulti = input(true, "Multiples of 10", group = "Number Multiples")

nb = input.float(3.14159, "Number Input", minval = 0, maxval = 10, step = 0.00001, tooltip = "Up to 5 decimal places")

// Scale Factors & Constants

scale = 0.0

if close >= 10000
    scale := 1000

if close >= 1000 and close <=9999.999999
    scale := 100

if close >= 100 and close <=999.999999
    scale := 10

if close >= 10 and close <=99.999999
    scale := 1
    
if close >= 1 and close <=9.999999
    scale := 0.1
    
if close >= 0.1 and close <=0.999999
    scale := 0.01

if close >= 0.01 and close <=0.099999
    scale := 0.001
    
if close >= 0.001 and close <=0.009999
    scale := 0.0001
    
    
    
// Variables

number = nb * scale

number1 = 0.0
number2 = 0.0
number3 = 0.0
number4 = 0.0
number5 = 0.0
number6 = 0.0
number7 = 0.0
number8 = 0.0
number9 = 0.0
number10 = 0.0
number11 = 0.0
number12 = 0.0
number13 = 0.0
number14 = 0.0
number15 = 0.0
number16 = 0.0
number17 = 0.0
number18 = 0.0
number19 = 0.0
number20 = 0.0
number21 = 0.0
number22 = 0.0
number23 = 0.0
number24 = 0.0
number25 = 0.0
number26 = 0.0
number27 = 0.0
number28 = 0.0
number29 = 0.0
number30 = 0.0
number31 = 0.0
number32 = 0.0
number33 = 0.0
number34 = 0.0
number35 = 0.0
number36 = 0.0
number37 = 0.0
number38 = 0.0



// If clauses (for inputs to work as on/off)

if numberStd
    number4 := number*4
    number6 := number*6
    number8 := number*8
    number9 := number*9
    number12 := number*12
    number14 := number*14
    number15 := number*15
    number16 := number*16
    number18 := number*18
    number21 := number*21
    number22 := number*22
    number24 := number*24
    number25 := number*25
    number26 := number*26
    number27 := number*27
    number28 := number*28
    number32 := number*32
    number33 := number*33
    number34 := number*34
    number35 := number*35
    number36 := number*36
    number38 := number*38
else
    number4 := na
    number6 := na
    number8 := na
    number9 := na
    number12 := na
    number14 := na
    number15 := na
    number16 := na
    number18 := na
    number21 := na
    number22 := na
    number24 := na
    number25 := na
    number26 := na
    number27 := na
    number28 := na
    number32 := na
    number33 := na
    number34 := na
    number35 := na
    number36 := na
    number38 := na

if numberPrime
    number1 := number*1
    number2 := number*2
    number3 := number*3
    number5 := number*5
    number7 := number*7
    number11 := number*11
    number13 := number*13
    number17 := number*17
    number19 := number*19
    number23 := number*23
    number29 := number*29
    number31 := number*31
    number37 := number*37
else
    number1 := na
    number2 := na
    number3 := na
    number5 := na
    number7 := na
    number11 := na
    number13 := na
    number17 := na
    number19 := na
    number23 := na
    number29 := na
    number31 := na
    number37 := na
    
if numberMulti
    number10 := number*10
    number20 := number*20
    number30 := number*30
else
    number10 := na
    number20 := na
    number30 := na
    
    
// Plots

plot(number, color = color.new(color.silver, 10)), plot(number2, color = color.new(color.silver, 0)),
plot(number3, color = color.new(color.silver, 0)), plot(number4, color = color.new(color.black, 0)),
plot(number5, color = color.new(color.silver, 0)), plot(number6, color = color.new(color.black, 0)),
plot(number7, color = color.new(color.silver, 0)), plot(number8, color = color.new(color.black, 0)),
plot(number9, color = color.new(color.black, 0)), plot(number10, color = color.new(color.orange, 10)),
plot(number11, color = color.new(color.silver, 0)), plot(number12, color = color.new(color.black, 0)),
plot(number13, color = color.new(color.silver, 0)), plot(number14, color = color.new(color.black, 0)),
plot(number15, color = color.new(color.black, 0)), plot(number16, color = color.new(color.black, 0)),
plot(number17, color = color.new(color.silver, 0)), plot(number18, color = color.new(color.black, 0)),
plot(number19, color = color.new(color.silver, 0)), plot(number20, color = color.new(color.orange, 10)),
plot(number21, color = color.new(color.black, 0)), plot(number22, color = color.new(color.black, 0)),
plot(number23, color = color.new(color.silver, 0)), plot(number24, color = color.new(color.black, 0)),
plot(number25, color = color.new(color.black, 0)), plot(number26, color = color.new(color.black, 0)),
plot(number27, color = color.new(color.black, 0)), plot(number28, color = color.new(color.black, 0)),
plot(number29, color = color.new(color.silver, 0)), plot(number30, color = color.new(color.orange, 10)),
plot(number31, color = color.new(color.silver, 0)), plot(number32, color = color.new(color.black, 0)),
plot(number33, color = color.new(color.black, 0)), plot(number34, color = color.new(color.black, 0)),
plot(number35, color = color.new(color.black, 0)), plot(number36, color = color.new(color.black, 0)),
plot(number37, color = color.new(color.silver, 0)), plot(number38, color = color.new(color.black, 0))

///