Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study("My Script", overlay=true)
- sma1 = sma(close, 8)
- sma2 = sma(close, 13)
- plot(sma1, color=color.green)
- plot(sma2, color=color.red)
- cross_bull = crossover(sma1, sma2)
- plotshape(cross_bull, style=shape.triangleup, location=location.bottom, color=color.green)
- low0 = low[0] < low[1] and low[0] < low[2] and low[0] < low[3]
- low1 = low[1] < low[0] and low[1] < low[2] and low[1] < low[3]
- low2 = low[2] < low[0] and low[2] < low[1] and low[2] < low[3]
- low3 = low[3] < low[0] and low[3] < low[1] and low[3] < low[2]
- lowestx = low0 ? 0 : low1 ? 1 : low2 ? 2 : low3 ? 3 : 0
- delay = 0
- delay := cross_bull ? lowestx : 0
- bgcolor(cross_bull ? color.yellow : na, offset=-lowestx)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement