MATCHFUNFIELD() Function

Author: Optuma Team Last updated: May 14, 2024 19:37

The MATCHFUNFIELD() scripting function allows you to reference any fundamental / data value, including text such as Sectors or Asset Class, or data imported via External Data Fields.

Examples

If you wanted to run a scan across an entire exchange, but limit the results to just symbols that are Stocks (excluding ETFs, etc), you can add the following criteria to your script using the Asset Class field:

MATCHFUNFIELD(FEED=MA, FIELD=Asset Class, FIELDVALUE=Stock)

Click on the Field option to select the required data from the data lilst, and enter Field Value:

Capture

Only codes with an Asset Class of Stock would be displayed in the scans results.

Match

Using the example script above, only codes in the Watchlist with an Asset Class of STOCK passes the criteria.

Sector Scan

If you have Fundamental Data available on your account you can use MATCFUNFIELD() to filter for stocks in certain sectors. For example, for stocks in Health Services:

MATCHFUNFIELD(FEED=FD, FIELD=SectorName, FIELDVALUE=Health Services)

Capture

Nasdaq-only scan

To scan for only Nasdaq stocks from the US Equities exchange use the following with the market identifier MIC field and XNAS:

MATCHFUNFIELD(FEED=MA, FIELD=MIC, FIELDVALUE=XNAS)

Capture