Mid to High daily % - MA & Threshold
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © slowdavid21

//@version=4
study("MA - Mid to High daily %")

source = (((high-(low+((high-low)/2)))/((low+((high-low)/2))))*100)
lengthfast = input(30,minval=1)
lengthslow= input(90,minval=1)
threshold = input (10, minval=1)


MAfast = sma(source,lengthfast)
MAslow = sma(source,lengthslow)

plot(MAfast,'MAfast',color.red)
plot(MAslow,'MAslow',color.white)
plot(threshold,"threshold",color.yellow)
plot(((high-(low+((high-low)/2)))/((low+((high-low)/2))))*100)