RETURN

Category: Instructions

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.

Syntax:

RETURN expression

Example:

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”.

  • The RSI indicator measures the speed and change of price movements. RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30.
  • The COLOURED function is used to set the color of the indicator line on the chart.
  • The AS keyword is used to label the indicator on the chart for clarity and identification purposes.

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.

Logo Logo
Loading...