Market Scanner

About 4 min

Market Scanner MarketScannerRequest

Description

Screening full market symbol by underlying, cumulative, and financial metrics.

Argument

ArgumentTypeRequiredDescription
marketenumYesUS: US Stocks, SG: Singapore Stocks,HK: HongKong Stocks
baseFilterListlist<BaseFilter>NoSimple indicator filtering conditions, including price (high open, low close, latest price, etc.), volume, equity, market capitalization, up or down, P/E ratio, turnover rate and other factors. Screening field meanings: Screening field description
accumulateFilterListlist<AccumulateFilter>NoCumulative indicators screening criteria, including cumulative increase or decrease, asset growth rate, net profit growth rate, earnings per share, net profit, operating profit, operating income, ROA (return on net assets), operating cash flow, gearing ratio, etc. Cumulative indicator period can be: last five minutes, last 5 days, 10 days, 20 days, last six months, one year, two years, five years, quarterly report, quarterly report, mid-term report, etc. The meaning of the filter field is explained: Filter field description
financialFilterListlist<FinancialFilter>NoFinancial indicators filter criteria, including gross profit, net profit margin, total debt/shareholders' equity, total debt/total assets, current ratio, return on assets, net income, operating cash flow, total assets, HKEx net buying, annualized yield, etc. Financial indicators currently only support LTM (annual report indicators for the last 12 months) type of financial report query. The meaning of the filter field is explained: Filter field description
multiTagsRelationFilterListlist<MultiTagsRelationFilter>NoMulti-label correlation screening criteria to select stocks based on industry, concept, historical stock price new high (stock price on that day compared to historical price), stock price new high within 52 weeks (stock price on that day compared to last 52 weeks), whether it is OTC, whether it supports options, stock type (stock, ETF), whether it is broken, and other indicators. The meaning of the filter field is explained: Filter field description
sortFieldDataobjectNoThe sort field object, which contains three main properties, is as follows
∟ fieldNamestringNoSort Field Name
∟ fieldTypestringNoSort Attribute Category, Sort Attribute Category Enumeration: Field Category
∟ sortDirstringNoSorting direction, including: unsorted, ascending, descending, sorting direction enumeration: sort field
pageintYesCurrent page number, start from 0
pageSizeintYesThe amount of data returned per page is configured to support a maximum of 200

The currency corresponding to the price field in the filtering parameter is consistent with the currency type of the market in which the underlying is located, e.g. US: USD, HK: HKD, SG: SGD, etc.

Filter Field Description

/** Basic Indicator Filters **/
BaseFilter {
    /** StockField Property */
    private StockField fieldName;
    /** The lower limit of the interval (closed interval), without passing the lower limit of the representative -∞ */
    private Double filterMin;
    /** The upper limit of the interval (closed interval), without passing the upper limit of the representative +∞ */
    private Double filterMax;
    /** This field indicates whether filtering is not required,True:No Filter,False:Filter.Defaul is False, */
    /** The role of this field: 1. debug code, can not determine which indicator is in effect, you can set the field one by one to confirm each attribute to filter out which subject. 2. only want to filter by a few conditions, but other conditions need to query the value of the corresponding indicators for display, you can display the class indicator isNoFilter set to True, that is, no filter.**/
    private boolean isNoFilter = false;
}

/** Cumulative indicator filter **/
AccumulateFilter {
  /** AccumulateField Property */
  private AccumulateField fieldName;
  /** Lower limit of the interval (closed interval), do not pass means the lower limit is -∞. If the percentile, no need to add %, for example, 10%, the value is 10 */
  private Double filterMin;
  /** The upper limit of the interval (closed interval), without passing the upper limit of the representative +∞ */
  private Double filterMax;
   /** This field indicates whether filtering is not required,True:No Filter,False:Filter.Defaul is False, */
    /** The role of this field: 1. debug code, can not determine which indicator is in effect, you can set the field one by one to confirm each attribute to filter out which subject. 2. only want to filter by a few conditions, but other conditions need to query the value of the corresponding indicators for display, you can display the class indicator isNoFilter set to True, that is, no filter.**/
  private boolean isNoFilter = false;
  /** Time Period AccumulatePeriod Not Required */
  private AccumulatePeriod period;
}

/** Financial Metrics Filter **/
FinancialFilter {
    /** FinancialField Property */
    private FinancialField fieldName;
    /** Lower limit of the interval (closed interval), do not pass means the lower limit is -∞ If the percentile, no need to add %, for example, 10%, the value is 10 */
    private Double filterMin;
    /** The upper limit of the interval (closed interval), without passing the upper limit of the representative +∞ */
    private Double filterMax;
    /**The same as above description**/
    private boolean isNoFilter = false;
    /** FinancialQuarter Earnings Accumulation Time */
    private FinancialPeriod quarter;
}

/** Multi-label indicator filter **/
MultiTagsRelationFilter {
    /** MultiTagField Enum */
    private MultiTagField fieldName;
    /** Multi Tag List */
    private List<String> tagList;
    /**The same as above description**/
    private boolean isNoFilter = false;
}

Field Category

public enum FieldBelongType {
    StockField_Type(1), //Types of base indicators
    AccumulateField_Type(2), //Types of Cumulative indicators
    FinancialField_Type(3), //Types of Financial indicators
    MultiTagField_Type(5); //Types of MultiTag indicators
}

Sort Field

public enum SortDir {
    SortDir_No(0), // No Sort
    SortDir_Ascend(1), // Sort Ascend
    SortDir_Descend(2); // Sort Descend
}

Response

com.tigerbrokers.stock.openapi.client.https.response.quote.MarketScannerResponsesourceopen in new window

Structured as follow:

public class MarketScannerResponse extends TigerResponse {
    @JSONField(name = "data")
    private MarketScannerBatchItem marketScannerBatchItem;
}

public class MarketScannerBatchItem extends ApiModel {
    /** Index of the requested page, default is 0 */
    private int page;
    /** Total Page */
    private int totalPage;
    /** Total Count */
    private int totalCount;
    /** Page Size */
    private int pageSize;
    /** response items */
    private List<MarketScannerItem> data;
}

public class MarketScannerItem implements Serializable {
    /** market */
    private Market market;
    private String symbol;
    private List<MarketIndicatorValue> baseDataList;
    private List<MarketIndicatorValue> accumulateDataList;
    private List<MarketIndicatorValue> financialDataList;
    private List<MarketIndicatorValue> multiTagDataList;
}

public class MarketIndicatorValue implements Serializable {
    /** Indicator index **/
    private Integer index;
    /** Indicator name **/
    private String name;
    /** indicator value **/
    private Object value;
}

Example

//Build a list of base indicator screening parameters
List<BaseFilter> baseFilterList = new ArrayList<>();
baseFilterList.add(BaseFilter.builder()
                   .fieldName(StockField.StockField_MarketValue.getIndex())
                   .filterMin(1000000000D)
                   .filterMax(2000000000D)
                   .build());
//Build stock selection request
MarketScannerRequest marketScannerRequest =  MarketScannerRequest.newRequest(Market.HK, baseFilterList, null, null, null, null, 1, 200);
//Submit stock selection request and get return results
MarketScannerResponse marketScanList = client.execute(marketScannerRequest);
System.out.println(JSONObject.toJSONString(marketScanList));

Response Example

{
	"code": 0,
	"data": {
		"items": [{
			"accumulateDataList": [],
			"baseDataList": [{
				"index": 17,
				"name": "marketValue",
				"value": 1.83502671E+9
			}],
			"financialDataList": [],
			"market": "HK",
			"multiTagDataList": [],
			"symbol": "02175"
		}, {
			"accumulateDataList": [],
			"baseDataList": [{
				"index": 17,
				"name": "marketValue",
				"value": 1282107783.79
			}],
			"financialDataList": [],
			"market": "HK",
			"multiTagDataList": [],
			"symbol": "01233"
		}, {
			"accumulateDataList": [],
			"baseDataList": [{
				"index": 17,
				"name": "marketValue",
				"value": 1.825395E+9
			}],
			"financialDataList": [],
			"market": "HK",
			"multiTagDataList": [],
			"symbol": "02809"
		}],
		"page": 1,
		"pageSize": 200,
		"totalCount": 274,
		"totalPage": 2
	},
	"message": "success",
	"sign": "W616mK2gxowk4KtkUzuRy5ApV+FqjHhearw3+TB/kyXTtvKaeaeMqw6UH7S32qHlLyWMDxA5ojucoNjnE31R2adFmoTVGsDhB3DFtSGnn6ek3dQq0lhrYo9kX1EPvjlCshdC4dtrDObz6kbu6ooegX6/FxuR1/lnK7PbPl0u+N4=",
	"success": true,
	"timestamp": 1667889996612
}
Last update: