ChillLax Percent Up and Down
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © chilllaxtrader

//@version=5

// mark the point when a stock is up or down more than 5% (default) from the previous close.

indicator(title='ChillLax Percent Up or Down', shorttitle='ChillLax Percent Up or Down', overlay=true)

percentup = input(defval=5, title='percentage up')
percentdown = input(defval=5, title='percentage down')

upday = (close - close[1]) / close[1] * 100 >= percentup
downday = (close - close[1]) / close[1] * 100 <= -percentdown

plotshape(upday, style=shape.triangleup, location=location.belowbar, size=size.normal, color=color.new(color.blue, 0))
plotshape(downday, style=shape.triangledown, location=location.abovebar, size=size.normal, color=color.new(color.red, 0))




