Euler Price Levels
// 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("Euler Price Levels", overlay=true)

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



// Inputs

euStd = input.bool(true, "Standard Multiples", group = "Euler Constant 2.71828")

euPrime = input.bool(true, "Prime Multiples", group = "Euler Constant 2.71828")

euMulti = input.bool(true, "Multples of 10", group = "Euler Constant 2.71828")




// 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

e = 2.71828 * scale
pi = 3.14159

e1 = 0.0
e2 = 0.0
e3 = 0.0
e4 = 0.0
e5 = 0.0
e6 = 0.0
e7 = 0.0
e8 = 0.0
e9 = 0.0
e10 = 0.0
e11 = 0.0
e12 = 0.0
e13 = 0.0
e14 = 0.0
e15 = 0.0
e16 = 0.0
e17 = 0.0
e18 = 0.0
e19 = 0.0
e20 = 0.0
e21 = 0.0
e22 = 0.0
e23 = 0.0
e24 = 0.0
e25 = 0.0
e26 = 0.0
e27 = 0.0
e28 = 0.0
e29 = 0.0
e30 = 0.0
e31 = 0.0
e32 = 0.0
e33 = 0.0
e34 = 0.0
e35 = 0.0
e36 = 0.0
e37 = 0.0
e38 = 0.0



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

if euStd
    e4 := e*4
    e6 := e*6
    e8 := e*8
    e9 := e*9
    e12 := e*12
    e14 := e*14
    e15 := e*15
    e16 := e*16
    e18 := e*18
    e21 := e*21
    e22 := e*22
    e24 := e*24
    e25 := e*25
    e26 := e*26
    e27 := e*27
    e28 := e*28
    e32 := e*32
    e33 := e*33
    e34 := e*34
    e35 := e*35
    e36 := e*36
    e38 := e*38
else
    e4 := na
    e6 := na
    e8 := na
    e9 := na
    e12 := na
    e14 := na
    e15 := na
    e16 := na
    e18 := na
    e21 := na
    e22 := na
    e24 := na
    e25 := na
    e26 := na
    e27 := na
    e28 := na
    e32 := na
    e33 := na
    e34 := na
    e35 := na
    e36 := na
    e38 := na
    
if euPrime
    e1 := e*1
    e2 := e*2
    e3 := e*3
    e5 := e*5
    e7 := e*7
    e11 := e*11
    e13 := e*13
    e17 := e*17
    e19 := e*19
    e23 := e*23
    e29 := e*29
    e31 := e*31
    e37 := e*37
else
    e1 := na
    e2 := na
    e3 := na
    e5 := na
    e7 := na
    e11 := na
    e13 := na
    e17 := na
    e19 := na
    e23 := na
    e29 := na
    e31 := na
    e37 := na
    
if euMulti
    e10 := e*10
    e20 := e*20
    e30 := e*30
else
    e10 := na
    e20 := na
    e30 := na
    
    
    
// Plots

plot(e, color = color.new(color.white, 0)), plot(e2, color = color.new(color.white, 0)),
plot(e3, color = color.new(color.white, 0)), plot(e4, color = color.new(color.navy, 0)),
plot(e5, color = color.new(color.white, 0)), plot(e6, color = color.new(color.navy, 0)),
plot(e7, color = color.new(color.white, 0)), plot(e8, color = color.new(color.navy, 0)),
plot(e9, color = color.new(color.navy, 0)), plot(e10, color = color.new(color.fuchsia, 10)),
plot(e11, color = color.new(color.white, 0)), plot(e12, color = color.new(color.navy, 0)),
plot(e13, color = color.new(color.white, 0)), plot(e14, color = color.new(color.navy, 0)),
plot(e15, color = color.new(color.navy, 0)), plot(e16, color = color.new(color.navy, 0)),
plot(e17, color = color.new(color.white, 0)), plot(e18, color = color.new(color.navy, 0)),
plot(e19, color = color.new(color.white, 0)), plot(e20, color = color.new(color.fuchsia, 10)),
plot(e21, color = color.new(color.navy, 0)), plot(e22, color = color.new(color.navy, 0)),
plot(e23, color = color.new(color.white, 0)), plot(e24, color = color.new(color.navy, 0)),
plot(e25, color = color.new(color.navy, 0)), plot(e26, color = color.new(color.navy, 0)),
plot(e27, color = color.new(color.navy, 0)), plot(e28, color = color.new(color.navy, 0)),
plot(e29, color = color.new(color.white, 0)), plot(e30, color = color.new(color.fuchsia, 10)),
plot(e31, color = color.new(color.white, 0)), plot(e32, color = color.new(color.navy, 0)),
plot(e33, color = color.new(color.navy, 0)), plot(e34, color = color.new(color.navy, 0)),
plot(e35, color = color.new(color.navy, 0)), plot(e36, color = color.new(color.navy, 0)),
plot(e37, color = color.new(color.white, 0)), plot(e38, color = color.new(color.navy, 0))

//////