Script Editor Overview

Author: Optuma Team Last updated: Nov 14, 2022 22:26

Overview

The Script Editor is an intuitive and easy to use, Excel-like scripting platform that allows you to create your own tools and indicators. Click on the Settings menu and select the Script Manager to open this window:

Script Editor Overview 1

Scripting Video Tutorials

Tutorial videos can be accessed under the Help > Scripting Resources menu in the Optuma software, or by signing in here with your Optuma username and password:

https://learn.optuma.com/optuma-courses/

Creating a Script

To create and save a new script click on the New button to add a script or a group:

Formula Functions & General Interface 16

For example, if your scripts have a Gann focus, then a Gann group can be created:

Formula Functions & General Interface 17

Scripts can then be moved to the new group by dragging them over. To add new scripts to a group, first, left-click on the group and then select New > Add Script.

Formula Functions & General Interface 18

Note: From Optuma 2.1 and later you can use the keyboard shortcut Ctrl + Space to expand / collapse all folder groups in the script manager window.

ExpandScripManager

Auto Script Update

When you make an adjustment to an existing script, the script will then be updated in each instance that it has been used, e.g. indicators on charts (like Show Bar).

Script Cloning

If the new script is very similar to an existing one, the original can now be cloned so that it doesn’t have to be created from scratch. To clone a script, first left-click on the script name and click the Clone button.

Formula Functions & General Interface 19

A duplicate will then be added with a ‘1’ at the end of the name. If a default script has been cloned, then the new script will be added under My Scripts.

Formula Functions & General Interface 20

It is also possible to make a copy of a script by first selecting it and then selecting Save Script As.

Formula Functions & General Interface 21

You can then save a copy of the script under a new name.

There is now a script search function that makes locating scripts very simple. Just start typing the name of the script you are looking for in the Type to search field.

Script Editor Overview 8

You will then be presented with all the scripts that match your search criteria.

Formula Functions & General Interface 2

Scripting Guidance

Clicking the Scripting Reference and Scripting Forum buttons will provide access to the scripting Knowledge Base and forum in our Support Centre.

Script Editor Overview 10

Scripting Enhancements

Use as an Indicator

If the script you are creating is designed to be used as an indicator, it is now possible to set this whilst creating the script and to nominate whether the indicator is to be plotted in the price chart window (ie Same View, like a moving average or Bollinger Band), or in a separate window below the price chart (ie New Tool View, as per RSI or Volume).

Formula Functions & General Interface 6

After the script has been created it will then be available in the Tools menu so you can apply it to your charts.

Format and Decimal Type

In some instances, you will want the script to return a result or value, such as in an Analysis column in a Watchlist for example. The Format can be set either to text, number, date or currency. When set to either number or currency, you can also set the Decimal Type as required.

Script Editor Overview 12

Add Variable

When compiling more complex scripts it is quite possible that you will have different parameters or variables that you want to specify, to prevent the formula from becoming too cluttered.

Formula Functions & General Interface 7

The Add Variable function makes this job easier by adding a template to the script for you.

Formula Functions & general Interface 8

You are then able to name the variable as needed. Clicking on the function field will invoke the automated script advisor, as you type the function you are seeking the advisor will provide a list of suggested functions to use.

Formula Functions & General Interface 9

This example creates a variable called Range which can then be used in the formula:

Range = HIGH()-LOW();

(Range / OPEN()) > 0.05

Add Output Plot

Similar to how you can select to add a variable template you can also Add Output Plot template.

Formula Functions & General Interface 12

So if you are wanting to add a function for example select Add Output Plot > {function}. The following will be displayed.

Formula Functions & General Interface 13

You can then left-click on the added function which will display function menu. From here you can manually scroll to the desired function, or just start typing the name of the function and it will display for you to select.

Formula Functions & General Interface 14

Incorporating Timeframes

There is now a new Timeframe option in the script pop-up window. The ‘Default’ setting will depend on the chart and feature the formula is being used with.

For example, when used in a Watchlist column the calculation is based on daily values, but by changing the criteria to Weekly, the column will then be based on weekly values.

Formula Functions & General Interface 15