OPEN-SOURCE SCRIPT

Aurous - Horizontal Rays

Define Pip Size:
Since 1 pip for XAUUSD is usually considered as 0.1, the pip Size is set to 0.1. A 50-pip interval is therefore 50 * 0.1 = 5.0.

Nearest Pip Level Calculation:
We find the nearest 50-pip level based on the current price of XAUUSD. The formula nearestPipLevel = round(close / pipInterval) * pipInterval rounds the current price to the nearest multiple of the 50-pip interval.

Loop for Multiple Lines:
We use a loop that runs from -20 to 20 to plot horizontal ray lines 50 pips above and below the current price. The range (-20 to 20) ensures there are enough lines plotted both above and below the price.

Horizontal Ray Lines:
The line.new function is used to draw the horizontal rays, extending to the right.

Plot Current Price:
We also plot the closing price with a blue line to make it easier to track the price against the horizontal rays.
Chart patternsPivot points and levelsregressions

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer