-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsar.pine
27 lines (15 loc) · 967 Bytes
/
sar.pine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//@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)