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

//@version=5

library("RSNPSD")

export EMA5(float source, simple int EMAlength, simple int Smoothlength ) =>
	if EMAlength > 0
        ema1 = ta.ema(source, EMAlength)
        ema2 = ta.ema(ema1, EMAlength)
        ema3 = ta.ema(ema2, EMAlength)
        ema4 = ta.ema(ema3, EMAlength)
        ema5 = ta.ema(ema4, EMAlength)
        ema6 = ta.ema(ema5, EMAlength)
        ema7 = ta.ema(ema6, EMAlength)
        ema8 = ta.ema(ema7, EMAlength)
        out = 8 * ema1 - 28 * ema2 + 56 * ema3 - 70 * ema4 + 56 * ema5 - 28 * ema6 + 8 * ema7 - ema8
        ta.ema(out,Smoothlength)
    else
        na
    

export SLOPE(float source, simple int slopeDistance) =>
	math.atan( ta.change(source) / slopeDistance ) * (180 / math.pi)
	
export print(string txt) => 
    var table t = table.new(position.middle_right, 1, 1)
    table.cell(t, 0, 0, txt, bgcolor = color.yellow)
