Advertisement
Guest User

Untitled

a guest
Jan 13th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © stoktehk22
  3.  
  4. //@version=6
  5. indicator("mtf box plotter test", overlay = true)
  6.  
  7. open_5m = request.security(syminfo.tickerid, "5", open)
  8. close_5m = request.security(syminfo.tickerid, "5", close)
  9. high_5m = request.security(syminfo.tickerid, "5", high)
  10. low_5m = request.security(syminfo.tickerid, "5", low)
  11. time_5m_array = request.security_lower_tf(syminfo.tickerid, '5', time)
  12.  
  13. time_5m = time_5m_array.min()
  14.  
  15. rounded_time = time_5m - (time_5m % (15 * 60 * 1000)) // Round down to nearest 15m
  16.  
  17. if time_5m == 1736539500000.00
  18. box.new(rounded_time, open_5m, rounded_time + (25*15*60*1000), close_5m, xloc= xloc.bar_time, border_color = color.new(color.white,50), bgcolor=color.new(color.red,90), text_size=size.small, text= "Box 1 rounded down", text_color=color.white, text_halign="right", text_valign="center")
  19. if time_5m == 1736727900000.00
  20. box.new(rounded_time, open_5m, rounded_time + (25*15*60*1000), close_5m, xloc= xloc.bar_time, border_color = color.new(color.white,50), bgcolor=color.new(color.red,90), text_size=size.small, text= "Box 2 rounded down", text_color=color.white, text_halign="right", text_valign="center")
  21. if time_5m == 1736727600000.00
  22. box.new(time_5m, open_5m, time_5m + (25*15*60*1000), close_5m, xloc= xloc.bar_time, border_color = color.new(color.white,50), bgcolor=color.new(color.red,90), text_size=size.small, text= "Box 3 exact", text_color=color.white, text_halign="right", text_valign="center")
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement