The RETURN instruction in ProBuilder language is used to specify the output of a custom indicator or function that should be displayed on a trading chart. This instruction is crucial for visualizing the results of calculations or analyses directly on the chart interface.
RETURN expression
myIndicatorToDraw = RSI[14](close)
RETURN myIndicatorToDraw COLOURED(210,105,30) AS "my RSI"
In this example, the Relative Strength Index (RSI), a popular momentum oscillator used in technical analysis, is calculated over the last 14 periods of the ‘close’ price. The result is then returned and displayed on the chart with a specific color (chocolate, RGB: 210,105,30) and labeled as “my RSI”.
This instruction is essential for traders and analysts who rely on custom indicators for making informed trading decisions, as it allows for immediate visual representation of data directly on the trading charts.