Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study(title = "Sample Renko Arrows by JustUncleL", shorttitle="REN_ARROWS", overlay=true)
- //
- // When dealing directly with Renko Charts, there is no need to calculate the Renko bricks.
- // Just use the candle Brick's "open" and "close" parameters like a standard candle.
- //
- hlen = input(1,minval=1,title="How Many Bricks to Swing Confirm")
- // Initialise up and down counters counters
- up = 0
- down = 0
- // Check is this the 1st green after red? or is this already going up count up bars, otherwise zero count
- up := close[2]<open[2] and close[1]<open[1] and close>open? 1 : up[1]>0 and close>open? up[1]+1 : 0
- // Check is this the 1st red after green? or is this already going down count down bars, otherwise zero count
- down := close[2]>open[2] and close[1]>open[1] and close<open? 1 : down[1]>0 and close<open? down[1]+1 : 0
- // - Plot Alerts
- plotarrow(up==hlen?1:na, title="BUY Arrow", colorup=lime, maxheight=60, minheight=50, transp=20,offset=0)
- plotarrow(down==hlen?-1:na, title="SELL Arrow", colordown=red, maxheight=60, minheight=50, transp=20,offset=0)
- //
- alertcondition(up==hlen,message="BUY",title="BUY alert")
- alertcondition(down==hlen,message="SELL",title="SELL alert")
- //EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement