- Desktop
- Scripting
- Formulas and Scripting Functions
- GetData Function
GetData Function
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)
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:

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
Your privacy choices
We use cookies and similar technologies to make the site work, see how it's used, and improve it. Analytics and advertising cookies only run with your consent — see our Privacy Policy for details.