MATCHFUNFIELD() Function
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:
Only codes with an Asset Class of Stock would be displayed in the scans results.
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)
Note
If the MatchType is set to ‘Contains’ and Health is entered in the Field Value then all sectors containing Health in the name will be returned, eg Health Services, Health Technology.
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)