might be usefull to ya
Code: Select all
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © spiritualhealer117
//@version=4
study("HSRL")
length = input(title="Length", type=input.integer, defval=150)
resistanceChange = (highest(close,length)-highest(close,length)[length])/highest(close,length)[length]
supportChange = (lowest(close,length)-lowest(close,length)[length])/lowest(close,length)[length]
HSRL = resistanceChange-supportChange
line1=plot(resistanceChange,color=color.green)
line2=plot(supportChange,color=color.red)
fill(line1,line2,color=resistanceChange>supportChange?(resistanceChange>0?color.new(color.green,50):color.new(color.red,50)):(resistanceChange>0?color.new(color.yellow,25):color.new(color.yellow,50)))