Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study("Big 3",overlay=true)
- // enter on Arrows
- // take profit on touch with 80 SMA, gray, or at discretion
- fast = sma(close,20)
- mid = sma(close,40)
- slow = sma(close,80)
- plot(fast,linewidth=1)
- plot(mid,linewidth=2)
- plot(slow,linewidth=4)
- isUptrend = close > fast and close > mid and close > slow
- isDowntrend = close < fast and close < mid and close < slow
- confirmed = (low > fast and low > mid and low > slow) or (high < fast and high < mid and high < slow)
- barcolor(isUptrend ? green : isDowntrend ? red : gray)
- plotshape(not confirmed[1] and confirmed and isUptrend ? close : na,style=shape.arrowup,location=location.belowbar,color=green)
- plotshape(not confirmed[1] and confirmed and isDowntrend ? close : na,style=shape.arrowdown,location=location.abovebar,color=red)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement