Advertisement
JustUncleL

Sample Renko Arrows

Dec 2nd, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. //@version=3
  2. study(title = "Sample Renko Arrows by JustUncleL", shorttitle="REN_ARROWS", overlay=true)
  3.  
  4. //
  5. // When dealing directly with Renko Charts, there is no need to calculate the Renko bricks.
  6. // Just use the candle Brick's "open" and "close" parameters like a standard candle.
  7. //
  8.  
  9. hlen = input(1,minval=1,title="How Many Bricks to Swing Confirm")
  10.  
  11. // Initialise up and down counters counters
  12. up = 0
  13. down = 0
  14. // Check is this the 1st green after red? or is this already going up count up bars, otherwise zero count
  15. up := close[2]<open[2] and close[1]<open[1] and close>open? 1 : up[1]>0 and close>open? up[1]+1 : 0
  16. // Check is this the 1st red after green? or is this already going down count down bars, otherwise zero count
  17. down := close[2]>open[2] and close[1]>open[1] and close<open? 1 : down[1]>0 and close<open? down[1]+1 : 0
  18.  
  19. // - Plot Alerts
  20. plotarrow(up==hlen?1:na, title="BUY Arrow", colorup=lime, maxheight=60, minheight=50, transp=20,offset=0)
  21. plotarrow(down==hlen?-1:na, title="SELL Arrow", colordown=red, maxheight=60, minheight=50, transp=20,offset=0)
  22. //
  23.  
  24. alertcondition(up==hlen,message="BUY",title="BUY alert")
  25. alertcondition(down==hlen,message="SELL",title="SELL alert")
  26.  
  27. //EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement