The CALL instruction in ProBuilder language is used to retrieve values from a user-defined indicator. This function is essential when you need to use custom indicators within your trading strategies or when analyzing data.
myValue = CALL "myIndicator"[parameter1, parameter2]
This basic syntax allows you to call a custom indicator named “myIndicator” with the specified parameters. If the indicator returns multiple values, you can capture these as follows:
myValue1, myValue2, myValue3 = CALL "myIndicator"[parameter1, parameter2]
In scenarios where the custom indicator returns multiple values but not all are needed, use the keyword ignored to skip unnecessary values:
myValue1, ignored, myValue3 = CALL "myIndicator"[parameter1, parameter2]
If the indicator utilizes a specific price constant such as Close, High, or Low, it should be specified in the CALL statement to ensure consistency:
myValue = CALL "myIndicator"[parameter1, parameter2] (Close)
Here is a simple example of how to use the CALL instruction:
myValue = CALL "my Personal Indicator Name"[7, 14]
a = myValue / 2
RETURN a
In this example, “my Personal Indicator Name” is a custom indicator that takes two parameters. The result from the indicator is stored in myValue, then halved and returned.
This instruction is particularly useful for traders and analysts who create complex strategies that rely on custom indicators, allowing for dynamic data retrieval and manipulation within the ProBuilder environment.