This ProBuilder code snippet demonstrates how to draw a horizontal line on a chart at the highest high of the last 30 bars. This can be useful for visualizing resistance levels or significant price points over a given period.
DEFPARAM DRAWONLASTBARONLY = true
hh = highest[30](high)
DRAWSEGMENT(barindex-30,hh,barindex,hh)coloured(0,128,0,255)
RETURN
Here’s a step-by-step explanation of the code:
This example is particularly useful for traders or analysts who want to highlight significant price levels automatically without manually drawing lines on the chart.
Check out this related content for more information:
https://www.prorealcode.com/topic/darwing-a-horizontal-ray/#post-92474
Visit Link