SCRIPT() Function

Author: Optuma Team Last updated: Oct 12, 2018 17:55

Overview

The SCRIPT() function allows you to refer back to a previously saved script without having to duplicate the original.

When you click on the SCRIPT() text in the script editor a window will display the Script Properties where you can select the script to use.

Script Function 1

The following example is referencing the default Moving Average Crossover script with the additional criteria where the close is greater than the open.

SCRIPT(SCRIPTNAME=MA Crossover - MA1 Above MA2) and CLOSE() > OPEN()

This is demonstrated in the below chart using the Show Bar tool:

Script Function 2

Where the existing script has multiple outputs - such as the Price Percentage Oscillator created here - then you can select which plot to be used in the new script. This example will return a result when the histogram (Plot 3) in the PPO turns down from a peak:

SCRIPT(SCRIPTNAME=PPO, PLOTNAME=Plot3) TurnsDown

Script Function 3