//@version=4
study("SARs v1.1.8", shorttitle="SARs", overlay=true)
import header
AF_initial = input(0.02)
AF_increment = input(0.02)
AF_maximum = input(0.2)
import LUCID_SAR
L_SAR = LUCID_SAR(AF_initial, AF_increment, AF_maximum)
import TSR
[TC, T, SS, SC, S, SE, EC, up] = TSR()
plotshape(SC and not up, color = color.yellow, style = shape.triangleup, location = location.belowbar, size = size.auto, transp = 0, title = "Setup to Buy")
plotshape(TC and up, color = color.green, style = shape.triangleup, location = location.belowbar, size = size.auto, title = "Trigger to Buy")
plotshape(SC and up, color = color.yellow, style = shape.triangledown, location = location.abovebar, size = size.auto, transp = 0, title = "Setup to Sell")
plotshape(TC and not up, color = color.red, style = shape.triangledown, location = location.abovebar, size = size.auto, title = "Trigger to Sell")
plot(L_SAR, color = color.blue, style = plot.style_cross, linewidth = 2)