Skip to content

GetData Function

By Optuma Team · Updated 2020-02-11

The GETDATA() function can be used to retrieve data for a security different from the chart displayed on the screen.

Here’s an example using the custom bar colour scheme to colour the bars of the S&P500 index red when the VIX volatility index is above its 22 day moving average. The GetData function is used to retrieve the data for the VIX (variable V1) and then V1 is nested in a moving average function MA() (note: VIX data requires access to the CBOE Index exchange):

V1 = GETDATA(CODE=VIX:CBOEI);
V1 > MA(V1, BARS=22, CALC=Close)

Custom Bar Colour Scheme

Click on the GETDATA text in the script editor window and type the required symbol in the Code property and select it from the list:

GetData Properties

Here’s a variation of the above which could be used on a Show Bar or Signal Test on the SPX signalling when the VIX crosses above 20:

V1=GETDATA(CODE=VIX:CBOEI);
V1 CrossesAbove 20

GetData Example

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.