Scanners

In [1]:
from ib_insync import *
util.startLoop()  

ib = IB()
ib.connect('127.0.0.1', 7497, clientId=17)
Out[1]:
<IB connected to 127.0.0.1:7497 clientId=17>

Basic Scanner

To create a scanner, create a ScannerSubscription to submit to the reqScannerData method. For any scanner to work, at least these three fields must be filled: instrument (the what), locationCode (the where), and scanCode (the ranking).

For example, to find the top ranked US stock percentage gainers:

In [2]:
sub = ScannerSubscription(
    instrument='STK', 
    locationCode='STK.US.MAJOR', 
    scanCode='TOP_PERC_GAIN')

scanData = ib.reqScannerData(sub)

print(f'{len(scanData)} results, first one:')
print(scanData[0])
50 results, first one:
ScanData(rank=0, contractDetails=ContractDetails(contract=Contract(secType='STK', conId=409806996, symbol='CTIB', exchange='SMART', currency='USD', localSymbol='CTIB', tradingClass='SCM'), marketName='SCM', minTick=0.0, orderTypes='', validExchanges='', priceMagnifier=0, underConId=0, longName='', contractMonth='', industry='', category='', subcategory='', timeZoneId='', tradingHours='', liquidHours='', evRule='', evMultiplier=0, mdSizeMultiplier=0, aggGroup=0, underSymbol='', underSecType='', marketRuleIds='', secIdList=[], realExpirationDate='', lastTradeTime='', stockType='', cusip='', ratings='', descAppend='', bondType='', couponType='', callable=False, putable=False, coupon=0, convertible=False, maturity='', issueDate='', nextOptionDate='', nextOptionType='', nextOptionPartial=False, notes=''), distance='', benchmark='', projection='', legsStr='')

The displayed error 162 can be ignored

The scanner returns a list of contract details, without current market data (this can be obtained via seperate market data requests).

Filtering scanner results, the old way

The ScannerSubscription object has addional parameters that can be set to filter the results, such as abovePrice, aboveVolume, marketCapBelow or spRatingAbove.

For example, to reuse the previous sub and query only for stocks with a price above 200 dollar:

In [3]:
sub.abovePrice = 200
scanData = ib.reqScannerData(sub)

symbols = [sd.contractDetails.contract.symbol for sd in scanData]
print(symbols)
Error 162, reqId 3: Historical Market Data Service error message:API scanner subscription cancelled: 3
['FVRR', 'BA', 'AMGN', 'VRTX', 'LMT']

Filtering, the new way

In the new way there is a truly vast number of parameters available to use for filtering. These new scanner parameters map directly to the options available through the TWS "Advanced Market Scanner." The parameters are dynamically available from a huge XML document that is returned by reqScannerParameters:

In [4]:
xml = ib.reqScannerParameters()

print(len(xml), 'bytes')
Error 162, reqId 4: Historical Market Data Service error message:API scanner subscription cancelled: 4
2000323 bytes

To view the XML in a web browser:

In [5]:
path = 'scanner_parameters.xml'
with open(path, 'w') as f:
    f.write(xml)

import webbrowser
webbrowser.open(path)
Out[5]:
True
In [6]:
# parse XML document
import xml.etree.ElementTree as ET
tree = ET.fromstring(xml)

# find all tags that are available for filtering
tags = [elem.text for elem in tree.findall('.//AbstractField/code')]
print(len(tags), 'tags:')
print(tags)
1352 tags:
['priceAbove', 'priceBelow', 'usdPriceAbove', 'usdPriceBelow', 'volumeAbove', 'usdVolumeAbove', 'usdVolumeBelow', 'avgVolumeAbove', 'avgVolumeBelow', 'avgUsdVolumeAbove', 'avgUsdVolumeBelow', 'ihNumSharesInsiderAbove', 'ihNumSharesInsiderBelow', 'ihInsiderOfFloatPercAbove', 'ihInsiderOfFloatPercBelow', 'iiNumSharesInstitutionalAbove', 'iiNumSharesInstitutionalBelow', 'iiInstitutionalOfFloatPercAbove', 'iiInstitutionalOfFloatPercBelow', 'marketCapAbove1e6', 'marketCapBelow1e6', 'moodyRatingAbove', 'moodyRatingBelow', 'spRatingAbove', 'spRatingBelow', 'ratingsRelation', 'bondCreditRating', 'maturityDateAbove', 'maturityDateBelow', 'currencyLike', 'excludeConvertible', 'couponRateAbove', 'couponRateBelow', 'optVolumeAbove', 'optVolumeBelow', 'avgOptVolumeAbove', 'optVolumePCRatioAbove', 'optVolumePCRatioBelow', 'impVolatAbove', 'impVolatBelow', 'impVolatOverHistAbove', 'impVolatOverHistBelow', 'imbalanceAbove', 'imbalanceBelow', 'displayImbalanceAdvRatioAbove', 'displayImbalanceAdvRatioBelow', 'regulatoryImbalanceAbove', 'regulatoryImbalanceBelow', 'displayRegulatoryImbAdvRatioAbove', 'displayRegulatoryImbAdvRatioBelow', 'avgRatingAbove', 'avgRatingBelow', 'numRatingsAbove', 'numRatingsBelow', 'avgPriceTargetAbove', 'avgPriceTargetBelow', 'numPriceTargetsAbove', 'numPriceTargetsBelow', 'avgAnalystTarget2PriceRatioAbove', 'avgAnalystTarget2PriceRatioBelow', 'stkTypes', 'hasOptionsIs', 'leadFutOnly', 'dividendFrdAbove', 'dividendFrdBelow', 'dividendYieldFrdAbove', 'dividendYieldFrdBelow', 'dividendNextDateAbove', 'dividendNextDateBelow', 'dividendNextAmountAbove', 'dividendNextAmountBelow', 'histDividendFrdAbove', 'histDividendFrdBelow', 'histDividendFrdYieldAbove', 'histDividendFrdYieldBelow', 'minGrowthRate', 'maxGrowthRate', 'minPeRatio', 'maxPeRatio', 'minQuickRatio', 'maxQuickRatio', 'minRetnOnEq', 'maxRetnOnEq', 'minPrice2Bk', 'maxPrice2Bk', 'minPrice2TanBk', 'maxPrice2TanBk', 'firstTradeDateAbove', 'firstTradeDateBelow', 'changePercAbove', 'changePercBelow', 'afterHoursChangePercAbove', 'afterHoursChangePercBelow', 'changeOpenPercAbove', 'changeOpenPercBelow', 'openGapPercAbove', 'openGapPercBelow', 'priceRangeAbove', 'priceRangeBelow', 'tradeCountAbove', 'tradeCountBelow', 'tradeRateAbove', 'tradeRateBelow', 'volumeRateAbove', 'volumeRateBelow', 'stVolume3minAbove', 'stVolume3minBelow', 'stVolume5minAbove', 'stVolume5minBelow', 'stVolume10minAbove', 'stVolume10minBelow', 'prodCatIs', 'bondUSStateLike', 'issuerCountryIs', 'bondStkSymbolIs', 'bondIssuerLike', 'bondCallableIs', 'unshortableIs', 'haltedIs', 'shortSaleRestrictionIs', 'sharesAvailableManyAbove', 'sharesAvailableManyBelow', 'feeRateAbove', 'feeRateBelow', 'rebateRateAbove', 'rebateRateBelow', 'utilizationAbove', 'utilizationBelow', 'bondDefaultedIs', 'bondTradingFlatIs', 'bondExchListedIs', 'bondFdicInsIs', 'bondVarCouponRateIs', 'bondInsuredIs', 'bondGeneralObligationIs', 'bondRevenueIs', 'bondSubjectToAmtIs', 'bondRefundedIs', 'bondNoFederalTaxIs', 'bondBankQualifiedIs', 'bondBuildAmericaIs', 'bondValidBidOrAskOnly', 'bondBidAbove', 'bondBidBelow', 'bondAskAbove', 'bondAskBelow', 'bondBidOrAskAbove', 'bondBidOrAskBelow', 'bondBidSizeValueAbove', 'bondBidSizeValueBelow', 'bondAskSizeValueAbove', 'bondAskSizeValueBelow', 'bondBidOrAskSizeValueAbove', 'bondBidOrAskSizeValueBelow', 'bondBidYieldAbove', 'bondBidYieldBelow', 'bondAskYieldAbove', 'bondAskYieldBelow', 'bondBidOrAskYieldAbove', 'bondBidOrAskYieldBelow', 'bondSpreadAbove', 'bondSpreadBelow', 'bondPaymentFreqIs', 'bondAmtOutstandingAbove', 'bondAmtOutstandingBelow', 'bondNextCallDateAbove', 'bondNextCallDateBelow', 'bondDurationAbove', 'bondDurationBelow', 'bondConvexityAbove', 'bondConvexityBelow', 'bondStkMarketCapAbove', 'bondStkMarketCapBelow', 'bondDebtOutstandingAbove', 'bondDebtOutstandingBelow', 'bondDebtOutstandingMuniAbove', 'bondDebtOutstandingMuniBelow', 'bondDebt2EquityRatioAbove', 'bondDebt2EquityRatioBelow', 'bondDebt2BookRatioAbove', 'bondDebt2BookRatioBelow', 'bondDebt2TanBookRatioAbove', 'bondDebt2TanBookRatioBelow', 'bondEquity2BookRatioAbove', 'bondEquity2BookRatioBelow', 'bondEquity2TanBookRatioAbove', 'bondEquity2TanBookRatioBelow', 'bondStructRelated', 'bondAssetSubTypeStrBeginsWithOneOf', 'underConID', 'socialSentimentNetAbove', 'socialSentimentNetBelow', 'socialSentimentActivityAbove', 'socialSentimentActivityBelow', 'etfDistribFreqIs', 'etfAssetsAbove', 'etfAssetsBelow', 'etfExpenseAbove', 'etfExpenseBelow', 'etfALTARAbove', 'etfALTARBelow', 'etfAvgALTARAbove', 'etfAvgALTARBelow', 'etfTRytdAbove', 'etfTRytdBelow', 'etfTR1yrAbove', 'etfTR1yrBelow', 'etfTR5yrAbove', 'etfTR5yrBelow', 'etfTR10yrAbove', 'etfTR10yrBelow', 'etfTRIncepAbove', 'etfTRIncepBelow', 'etfTrackingDiffPctAbove', 'etfTrackingDiffPctBelow', 'etfBidAskPctAbove', 'etfBidAskPctBelow', 'etfEmgAbove', 'etfEmgBelow', 'etfDevAbove', 'etfDevBelow', 'etf5yrEPSAbove', 'etf5yrEPSBelow', 'etfLeverageAbove', 'etfLeverageBelow', 'etfAssetTurnsAbove', 'etfAssetTurnsBelow', 'etf1moChngAbove', 'etf1moChngBelow', 'etf3moChngAbove', 'etf3moChngBelow', 'etfPayoutAbove', 'etfPayoutBelow', 'etfFwd_PEAbove', 'etfFwd_PEBelow', 'etfFwd_PCFAbove', 'etfFwd_PCFBelow', 'etfFwd_YldAbove', 'etfFwd_YldBelow', 'etfBetaSPXAbove', 'etfBetaSPXBelow', 'etfLTGAbove', 'etfLTGBelow', 'etfSht_IntAbove', 'etfSht_IntBelow', 'etfRSIAbove', 'etfRSIBelow', 'etfYTM_WgtAvgAbove', 'etfYTM_WgtAvgBelow', 'etfCPN_WgtAvgAbove', 'etfCPN_WgtAvgBelow', 'etfCurYld_WgtAvgAbove', 'etfCurYld_WgtAvgBelow', 'etfMaturity_WgtAvgAbove', 'etfMaturity_WgtAvgBelow', 'etfDUR_WgtAvgAbove', 'etfDUR_WgtAvgBelow', 'etfMOD_DUR_WgtAvgAbove', 'etfMOD_DUR_WgtAvgBelow', 'etfCONVEX_WgtAvgAbove', 'etfCONVEX_WgtAvgBelow', 'etfNum_DistinctAbove', 'etfNum_DistinctBelow', 'etfComponent_CountAbove', 'etfComponent_CountBelow', 'etfPct_FixedAbove', 'etfPct_FixedBelow', 'etfPct_at_MtyAbove', 'etfPct_at_MtyBelow', 'etfMoodyRatingAbove', 'etfMoodyRatingBelow', 'etfSPRatingAbove', 'etfSPRatingBelow', 'prevYrETFFYBVPerShareAbove', 'prevYrETFFYBVPerShareBelow', 'prevYrETFFYDividendYieldAbove', 'prevYrETFFYDividendYieldBelow', 'prevYrETFFYDPSAbove', 'prevYrETFFYDPSBelow', 'prevYrETFFYEPSAbove', 'prevYrETFFYEPSBelow', 'prevYrETFFYEPSGrowthAbove', 'prevYrETFFYEPSGrowthBelow', 'prevYrETFFYNetMarginAbove', 'prevYrETFFYNetMarginBelow', 'prevYrETFFYPriceToBookValueAbove', 'prevYrETFFYPriceToBookValueBelow', 'prevYrETFFYPriceToCashFlowAbove', 'prevYrETFFYPriceToCashFlowBelow', 'prevYrETFFYPriceToEarningsAbove', 'prevYrETFFYPriceToEarningsBelow', 'prevYrETFFYPriceToGrowthAbove', 'prevYrETFFYPriceToGrowthBelow', 'prevYrETFFYPriceToSalesAbove', 'prevYrETFFYPriceToSalesBelow', 'prevYrETFFYRoEAbove', 'prevYrETFFYRoEBelow', 'prevYrETFFYSPSAbove', 'prevYrETFFYSPSBelow', 'prevYrETFFYSPSGrowthAbove', 'prevYrETFFYSPSGrowthBelow', 'currYrETFFYBVPerShareAbove', 'currYrETFFYBVPerShareBelow', 'currYrETFFYDividendYieldAbove', 'currYrETFFYDividendYieldBelow', 'currYrETFFYDPSAbove', 'currYrETFFYDPSBelow', 'currYrETFFYEPSAbove', 'currYrETFFYEPSBelow', 'currYrETFFYEPSGrowthAbove', 'currYrETFFYEPSGrowthBelow', 'currYrETFFYNetMarginAbove', 'currYrETFFYNetMarginBelow', 'currYrETFFYPriceToBookValueAbove', 'currYrETFFYPriceToBookValueBelow', 'currYrETFFYPriceToCashFlowAbove', 'currYrETFFYPriceToCashFlowBelow', 'currYrETFFYPriceToEarningsAbove', 'currYrETFFYPriceToEarningsBelow', 'currYrETFFYPriceToGrowthAbove', 'currYrETFFYPriceToGrowthBelow', 'currYrETFFYPriceToSalesAbove', 'currYrETFFYPriceToSalesBelow', 'currYrETFFYRoEAbove', 'currYrETFFYRoEBelow', 'currYrETFFYSPSAbove', 'currYrETFFYSPSBelow', 'currYrETFFYSPSGrowthAbove', 'currYrETFFYSPSGrowthBelow', 'nextYrETFFYBVPerShareAbove', 'nextYrETFFYBVPerShareBelow', 'nextYrETFFYDividendYieldAbove', 'nextYrETFFYDividendYieldBelow', 'nextYrETFFYDPSAbove', 'nextYrETFFYDPSBelow', 'nextYrETFFYEPSAbove', 'nextYrETFFYEPSBelow', 'nextYrETFFYEPSGrowthAbove', 'nextYrETFFYEPSGrowthBelow', 'nextYrETFFYNetMarginAbove', 'nextYrETFFYNetMarginBelow', 'nextYrETFFYPriceToBookValueAbove', 'nextYrETFFYPriceToBookValueBelow', 'nextYrETFFYPriceToCashFlowAbove', 'nextYrETFFYPriceToCashFlowBelow', 'nextYrETFFYPriceToEarningsAbove', 'nextYrETFFYPriceToEarningsBelow', 'nextYrETFFYPriceToGrowthAbove', 'nextYrETFFYPriceToGrowthBelow', 'nextYrETFFYPriceToSalesAbove', 'nextYrETFFYPriceToSalesBelow', 'nextYrETFFYRoEAbove', 'nextYrETFFYRoEBelow', 'nextYrETFFYSPSAbove', 'nextYrETFFYSPSBelow', 'nextYrETFFYSPSGrowthAbove', 'nextYrETFFYSPSGrowthBelow', 'btOptObj', 'btOptVendor', 'btNotional', 'btLeverageLong', 'btLeverageShort', 'btIndex', 'researchProviderIs', 'btLongPosTopBottom', 'btLongPosRank', 'btShortPosTopBottom', 'btShortPosRank', 'btWeight', 'Rebalance', 'btRebalanceFrequency', 'btTestPeriod', 'btBenchmark', 'sort_weights', 'street_ratingsAbove', 'street_ratingsBelow', 'valuengineAbove', 'valuengineBelow', 'sadif_analyticsAbove', 'sadif_analyticsBelow', 'market_edgeAbove', 'market_edgeBelow', 'validea_guruAbove', 'validea_guruBelow', 'market_graderAbove', 'market_graderBelow', 'morningstarAbove', 'morningstarBelow', 'constructs_researchAbove', 'constructs_researchBelow', 'zacksAbove', 'zacksBelow', 'shortInterestChgAbove', 'shortInterestChgBelow', 'shortOutstandingRatioAbove', 'shortOutstandingRatioBelow', 'reutEPSChgPct_TTMAbove', 'reutEPSChgPct_TTMBelow', 'reutPENorm_MRYAbove', 'reutPENorm_MRYBelow', 'reutPayoutRatioPct_TTMAbove', 'reutPayoutRatioPct_TTMBelow', 'reutRev_TTMAbove', 'reutRev_TTMBelow', 'reutEBT_TTMAbove', 'reutEBT_TTMBelow', 'reutTotDebtTotEquityRatio_MRQ_Above', 'reutTotDebtTotEquityRatio_MRQ_Below', 'reutRevChgPct_TTMAbove', 'reutRevChgPct_TTMBelow', 'reutPrice2CashFlowPerShare_TTMAbove', 'reutPrice2CashFlowPerShare_TTMBelow', 'reutCurrentRatio_MRQAbove', 'reutCurrentRatio_MRQBelow', 'reutLongTermDebt2Equity_MRQAbove', 'reutLongTermDebt2Equity_MRQBelow', 'reutNetIncomeAvlble2Common_TTMAbove', 'reutNetIncomeAvlble2Common_TTMBelow', 'reutNetProfitMarginPct_TTMAbove', 'reutNetProfitMarginPct_TTMBelow', 'reutRevChgPctAbove', 'reutRevChgPctBelow', 'reutPrice2SalesRatio_TTMAbove', 'reutPrice2SalesRatio_TTMBelow', 'reutGrossMargin_TTMAbove', 'reutGrossMargin_TTMBelow', 'reutEBTNorm_MRYAbove', 'reutEBTNorm_MRYBelow', 'reutNetIncomeAvlble2CommonNorm_MRYAbove', 'reutNetIncomeAvlble2CommonNorm_MRYBelow', 'reutReturnOnAvgAssetsPct_TTMAbove', 'reutReturnOnAvgAssetsPct_TTMBelow', 'reutReturnOnInvestmentPct_TTMAbove', 'reutReturnOnInvestmentPct_TTMBelow', 'reutOperatingMargin_TTMAbove', 'reutOperatingMargin_TTMBelow', 'reutEPSChgPctAbove', 'reutEPSChgPctBelow', 'reutPretaxMarginPct_MRYAbove', 'reutPretaxMarginPct_MRYBelow', 'reutEBITD_TTMAbove', 'reutEBITD_TTMBelow', 'ibPriceYTDPctAbove', 'ibPriceYTDPctBelow', 'ibFrac52wkAbove', 'ibFrac52wkBelow', 'reutPretaxMargin_TTMAbove', 'reutPretaxMargin_TTMBelow', 'reutFreeCashFlow_TTMAbove', 'reutFreeCashFlow_TTMBelow', 'reutNetDebtIAbove', 'reutNetDebtIBelow', 'reutBetaAbove', 'reutBetaBelow', 'ibPriceYTDPctR_Above', 'ibPriceYTDPctR_Below', 'reutEnterpriseValueCurAbove', 'reutEnterpriseValueCurBelow', 'curEMA20Above', 'curEMA20Below', 'curEMA50Above', 'curEMA50Below', 'curEMA100Above', 'curEMA100Below', 'curEMA200Above', 'curEMA200Below', 'lastVsEMAChangeRatio20Above', 'lastVsEMAChangeRatio20Below', 'lastVsEMAChangeRatio50Above', 'lastVsEMAChangeRatio50Below', 'lastVsEMAChangeRatio100Above', 'lastVsEMAChangeRatio100Below', 'lastVsEMAChangeRatio200Above', 'lastVsEMAChangeRatio200Below', 'curMACDAbove', 'curMACDBelow', 'curMACDSignalAbove', 'curMACDSignalBelow', 'curMACDDistAbove', 'curMACDDistBelow', 'curPPOAbove', 'curPPOBelow', 'curPPOSignalAbove', 'curPPOSignalBelow', 'curPPODistAbove', 'curPPODistBelow', 'reutCurrentAssets_MRQAbove', 'reutCurrentAssets_MRQBelow', 'reutCurrentAssets_MRYAbove', 'reutCurrentAssets_MRYBelow', 'reutCashFlowPerShare_MRYAbove', 'reutCashFlowPerShare_MRYBelow', 'reutEBIT_MRQAbove', 'reutEBIT_MRQBelow', 'reutEBIT_MRYAbove', 'reutEBIT_MRYBelow', 'reutEPS_MRYAbove', 'reutEPS_MRYBelow', 'reutIssuanceOfDebt_MRQAbove', 'reutIssuanceOfDebt_MRQBelow', 'reutIssuanceOfDebt_MRYAbove', 'reutIssuanceOfDebt_MRYBelow', 'reutIssuanceOfStock_MRQAbove', 'reutIssuanceOfStock_MRQBelow', 'reutIssuanceOfStock_MRYAbove', 'reutIssuanceOfStock_MRYBelow', 'reutShortTermDebt_MRQAbove', 'reutShortTermDebt_MRQBelow', 'reutShortTermDebt_MRYAbove', 'reutShortTermDebt_MRYBelow', 'reutCurrentLiabilities_MRQAbove', 'reutCurrentLiabilities_MRQBelow', 'reutCurrentLiabilities_MRYAbove', 'reutCurrentLiabilities_MRYBelow', 'reutCashFromOperating_MRQAbove', 'reutCashFromOperating_MRQBelow', 'reutCashFromOperating_MRYAbove', 'reutCashFromOperating_MRYBelow', 'reutRevenuePerShare_MRYAbove', 'reutRevenuePerShare_MRYBelow', 'reutReturnOnAvgAssetsPct_MRYAbove', 'reutReturnOnAvgAssetsPct_MRYBelow', 'reutReturnOnInvestmentPct_MRYAbove', 'reutReturnOnInvestmentPct_MRYBelow', 'reutCapitalExpenditures_MRQAbove', 'reutCapitalExpenditures_MRQBelow', 'reutCapitalExpenditures_MRYAbove', 'reutCapitalExpenditures_MRYBelow', 'reutCashFromFinancing_MRQAbove', 'reutCashFromFinancing_MRQBelow', 'reutCashFromFinancing_MRYAbove', 'reutCashFromFinancing_MRYBelow', 'reutCashFromInvesting_MRQAbove', 'reutCashFromInvesting_MRQBelow', 'reutCashFromInvesting_MRYAbove', 'reutCashFromInvesting_MRYBelow', 'reutInterestExpense_MRQAbove', 'reutInterestExpense_MRQBelow', 'reutInterestExpense_MRYAbove', 'reutInterestExpense_MRYBelow', 'reutOperatingIncome_MRQAbove', 'reutOperatingIncome_MRQBelow', 'reutOperatingIncome_MRYAbove', 'reutOperatingIncome_MRYBelow', 'reutEnterpriseValueToEBITDAAbove', 'reutEnterpriseValueToEBITDABelow', 'ibPrice1WKPctAbove', 'ibPrice1WKPctBelow', 'ibPrice4WKPctAbove', 'ibPrice4WKPctBelow', 'ibPrice13WKPctAbove', 'ibPrice13WKPctBelow', 'ibPrice52WKPctAbove', 'ibPrice52WKPctBelow', 'reutYieldAbove', 'reutYieldBelow', 'reutCash_MRQAbove', 'reutCash_MRQBelow', 'reutEBITDA_MRQAbove', 'reutEBITDA_MRQBelow', 'reutPrice2SalesRatio_MRQAbove', 'reutPrice2SalesRatio_MRQBelow', 'reutPrice2CashFlowPerShare_MRQAbove', 'reutPrice2CashFlowPerShare_MRQBelow', 'reutTotalAssets_MRQAbove', 'reutTotalAssets_MRQBelow', 'reutTotalLiabilities_MRQAbove', 'reutTotalLiabilities_MRQBelow', 'reutTotalCommonEquity_MRQAbove', 'reutTotalCommonEquity_MRQBelow', 'reutTotalLongTermDebt_MRQAbove', 'reutTotalLongTermDebt_MRQBelow', 'reutBookValueTanPerShare_MRQAbove', 'reutBookValueTanPerShare_MRQBelow', 'reutCashFlowPerShare_TTMAbove', 'reutCashFlowPerShare_TTMBelow', 'reutEPS_TTMAbove', 'reutEPS_TTMBelow', 'reutRev2Share_TTMAbove', 'reutRev2Share_TTMBelow', 'sharesOutstandingAbove', 'sharesOutstandingBelow', 'esgScoreAbove', 'esgScoreBelow', 'esgCombinedScoreAbove', 'esgCombinedScoreBelow', 'esgControversiesScoreAbove', 'esgControversiesScoreBelow', 'esgResourceUseScoreAbove', 'esgResourceUseScoreBelow', 'esgEmissionsScoreAbove', 'esgEmissionsScoreBelow', 'esgEnvInvScoreAbove', 'esgEnvInvScoreBelow', 'esgWorkforceScoreAbove', 'esgWorkforceScoreBelow', 'esgHrScoreAbove', 'esgHrScoreBelow', 'esgCommunityScoreAbove', 'esgCommunityScoreBelow', 'esgProdRespScoreAbove', 'esgProdRespScoreBelow', 'esgManagementScoreAbove', 'esgManagementScoreBelow', 'esgShareholdersScoreAbove', 'esgShareholdersScoreBelow', 'esgStrategyScoreAbove', 'esgStrategyScoreBelow', 'esgEnvPillarScoreAbove', 'esgEnvPillarScoreBelow', 'esgSocialPillarScoreAbove', 'esgSocialPillarScoreBelow', 'esgCorpGovPillarScoreAbove', 'esgCorpGovPillarScoreBelow', 'ivRank13wAbove', 'ivRank13wBelow', 'ivRank26wAbove', 'ivRank26wBelow', 'ivRank52wAbove', 'ivRank52wBelow', 'ivPercntl13wAbove', 'ivPercntl13wBelow', 'ivPercntl26wAbove', 'ivPercntl26wBelow', 'ivPercntl52wAbove', 'ivPercntl52wBelow', 'hvRank13wAbove', 'hvRank13wBelow', 'HVRank26wAbove', 'HVRank26wBelow', 'HVRank52wAbove', 'HVRank52wBelow', 'HVPercntl13wAbove', 'HVPercntl13wBelow', 'HVPercntl26wAbove', 'HVPercntl26wBelow', 'HVPercntl52wAbove', 'HVPercntl52wBelow', 'mfTotalReturnScoreOverallAbove', 'mfTotalReturnScoreOverallBelow', 'mfConsistentReturnScoreOverallAbove', 'mfConsistentReturnScoreOverallBelow', 'mfPreservationScoreOverallAbove', 'mfPreservationScoreOverallBelow', 'mfTaxEfficiencyScoreOverallAbove', 'mfTaxEfficiencyScoreOverallBelow', 'mfExpenseScoreOverallAbove', 'mfExpenseScoreOverallBelow', 'mfTotalReturnScore3yrAbove', 'mfTotalReturnScore3yrBelow', 'mfConsistentReturnScore3yrAbove', 'mfConsistentReturnScore3yrBelow', 'mfPreservationScore3yrAbove', 'mfPreservationScore3yrBelow', 'mfTaxEfficiencyScore3yrAbove', 'mfTaxEfficiencyScore3yrBelow', 'mfExpenseScore3yrAbove', 'mfExpenseScore3yrBelow', 'mfTotalReturnScore5yrAbove', 'mfTotalReturnScore5yrBelow', 'mfConsistentReturnScore5yrAbove', 'mfConsistentReturnScore5yrBelow', 'mfPreservationScore5yrAbove', 'mfPreservationScore5yrBelow', 'mfTaxEfficiencyScore5yrAbove', 'mfTaxEfficiencyScore5yrBelow', 'mfExpenseScore5yrAbove', 'mfExpenseScore5yrBelow', 'mfTotalReturnScore10yrAbove', 'mfTotalReturnScore10yrBelow', 'mfConsistentReturnScore10yrAbove', 'mfConsistentReturnScore10yrBelow', 'mfPreservationScore10yrAbove', 'mfPreservationScore10yrBelow', 'mfTaxEfficiencyScore10yrAbove', 'mfTaxEfficiencyScore10yrBelow', 'mfExpenseScore10yrAbove', 'mfExpenseScore10yrBelow', 'mfDistributionYield1yrValueAbove', 'mfDistributionYield1yrValueBelow', 'mfPercentageGrowthCumulativeValueAbove', 'mfPercentageGrowthCumulativeValueBelow', 'mfAnnualizedPerformance3yrValueAbove', 'mfAnnualizedPerformance3yrValueBelow', 'mfAnnualizedPerformance5yrValueAbove', 'mfAnnualizedPerformance5yrValueBelow', 'mfAnnualizedPerformance10yrValueAbove', 'mfAnnualizedPerformance10yrValueBelow', 'mfPriceChangeValueAbove', 'mfPriceChangeValueBelow', 'mfYieldValueAbove', 'mfYieldValueBelow', 'mfProjectedYieldValueAbove', 'mfProjectedYieldValueBelow', 'mfPctChangeAbove', 'mfPctChangeBelow', 'mfAdjustedRSquared1yrAbove', 'mfAdjustedRSquared1yrBelow', 'mfAlpha1yrAbove', 'mfAlpha1yrBelow', 'mfAverageLoss1yrAbove', 'mfAverageLoss1yrBelow', 'mfAverageReturn1yrAbove', 'mfAverageReturn1yrBelow', 'mfBearBeta1yrAbove', 'mfBearBeta1yrBelow', 'mfBeta1yrAbove', 'mfBeta1yrBelow', 'mfBullBeta1yrAbove', 'mfBullBeta1yrBelow', 'mfCovariance1yrAbove', 'mfCovariance1yrBelow', 'mfCorrelation1yrAbove', 'mfCorrelation1yrBelow', 'mfDownsideDeviationPopulation1yrAbove', 'mfDownsideDeviationPopulation1yrBelow', 'mfInformationRatio1yrAbove', 'mfInformationRatio1yrBelow', 'mfMaxGain1yrAbove', 'mfMaxGain1yrBelow', 'mfMaxLoss1yrAbove', 'mfMaxLoss1yrBelow', 'mfMaximumDrawdown1yrAbove', 'mfMaximumDrawdown1yrBelow', 'mfPositivePeriods1yrAbove', 'mfPositivePeriods1yrBelow', 'mfRSquared1yrAbove', 'mfRSquared1yrBelow', 'mfReturnRiskRatio1yrAbove', 'mfReturnRiskRatio1yrBelow', 'mfSRRI1yrAbove', 'mfSRRI1yrBelow', 'mfSemiDeviation1yrAbove', 'mfSemiDeviation1yrBelow', 'mfSemiVariance1yrAbove', 'mfSemiVariance1yrBelow', 'mfSharpeRatio1yrAbove', 'mfSharpeRatio1yrBelow', 'mfSortino1yrAbove', 'mfSortino1yrBelow', 'mfStandardDeviation1yrAbove', 'mfStandardDeviation1yrBelow', 'mfTrackingError1yrAbove', 'mfTrackingError1yrBelow', 'mfTreynorRatio1yrAbove', 'mfTreynorRatio1yrBelow', 'mfValueAtRiskNormal1yrAbove', 'mfValueAtRiskNormal1yrBelow', 'mfValueAtRiskNormalETL1yrAbove', 'mfValueAtRiskNormalETL1yrBelow', 'mfValueAtRiskQuantile1yrAbove', 'mfValueAtRiskQuantile1yrBelow', 'mfValueAtRiskQuantileETL1yrAbove', 'mfValueAtRiskQuantileETL1yrBelow', 'mfVariance1yrAbove', 'mfVariance1yrBelow', 'mfNumberOfSecuritiesAbove', 'mfNumberOfSecuritiesBelow', 'mfDividendPayoutRatioAbove', 'mfDividendPayoutRatioBelow', 'mfDividendPayoutRatio5yrAbove', 'mfDividendPayoutRatio5yrBelow', 'mfDividendPerShare1yrAbove', 'mfDividendPerShare1yrBelow', 'mfDividendPerShare3yrAbove', 'mfDividendPerShare3yrBelow', 'mfPrice2DividendAbove', 'mfPrice2DividendBelow', 'mfDividendYieldWAvgAbove', 'mfDividendYieldWAvgBelow', 'mfEBIT2InterestAbove', 'mfEBIT2InterestBelow', 'mfMktCapAvgLatestAbove', 'mfMktCapAvgLatestBelow', 'mfOperCashFlowGrowthRate3yrAbove', 'mfOperCashFlowGrowthRate3yrBelow', 'mfSalesGrowth1yrAbove', 'mfSalesGrowth1yrBelow', 'mfSalesGrowth3yrAbove', 'mfSalesGrowth3yrBelow', 'mfSalesGrowth5yrAbove', 'mfSalesGrowth5yrBelow', 'mfLatestPrice2EarningsRatioAbove', 'mfLatestPrice2EarningsRatioBelow', 'mfLatestPrice2BookRatioAbove', 'mfLatestPrice2BookRatioBelow', 'mfLatestPrice2SalesRatioAbove', 'mfLatestPrice2SalesRatioBelow', 'mfLatestReturnOnEquityWAvgAbove', 'mfLatestReturnOnEquityWAvgBelow', 'mfLatestSalesPerShareGrowth3yrAbove', 'mfLatestSalesPerShareGrowth3yrBelow', 'mfLTDebt2ShareholdersEquityAbove', 'mfLTDebt2ShareholdersEquityBelow', 'mfEPSGrowth1yrAbove', 'mfEPSGrowth1yrBelow', 'mfEPSGrowth3yrAbove', 'mfEPSGrowth3yrBelow', 'mfEPSGrowth5yrAbove', 'mfEPSGrowth5yrBelow', 'mfPrice2EarningsRatioAbove', 'mfPrice2EarningsRatioBelow', 'mfPrice2BookRatioAbove', 'mfPrice2BookRatioBelow', 'mfPrice2SalesRatioAbove', 'mfPrice2SalesRatioBelow', 'mfReturnOnAssets1yrAbove', 'mfReturnOnAssets1yrBelow', 'mfReturnOnAssets3yrAbove', 'mfReturnOnAssets3yrBelow', 'mfReturnOnEquity1yrAbove', 'mfReturnOnEquity1yrBelow', 'mfReturnOnEquity3yrAbove', 'mfReturnOnEquity3yrBelow', 'mfReturnOnInvestment1yrAbove', 'mfReturnOnInvestment1yrBelow', 'mfReturnOnInvestment3yrAbove', 'mfReturnOnInvestment3yrBelow', 'mfSales2TotalAssetsAbove', 'mfSales2TotalAssetsBelow', 'mfSalesPerShareGrowth1yrAbove', 'mfSalesPerShareGrowth1yrBelow', 'mfSalesPerShareGrowth3yrAbove', 'mfSalesPerShareGrowth3yrBelow', 'mfTotalAssets2TotalEquityAbove', 'mfTotalAssets2TotalEquityBelow', 'mfTotalDebt2TotalCapitalAbove', 'mfTotalDebt2TotalCapitalBelow', 'mfTotalDebt2TotalEquityAbove', 'mfTotalDebt2TotalEquityBelow', 'mfPrice2CashAbove', 'mfPrice2CashBelow', 'mfRelativeStrengthAbove', 'mfRelativeStrengthBelow', 'mfReturnOnCapitalAbove', 'mfReturnOnCapitalBelow', 'mfReturnOnCapital3yrAbove', 'mfReturnOnCapital3yrBelow', 'mfLatestCompositeZScoreAbove', 'mfLatestCompositeZScoreBelow', 'mfLatestPrice2EarningsZScoreAbove', 'mfLatestPrice2EarningsZScoreBelow', 'mfLatestPrice2BookZScoreAbove', 'mfLatestPrice2BookZScoreBelow', 'mfLatestPrice2SalesZScoreAbove', 'mfLatestPrice2SalesZScoreBelow', 'mfLatestSPSGrowthZScoreAbove', 'mfLatestSPSGrowthZScoreBelow', 'mfAverageFinalCompositeZScoreAbove', 'mfAverageFinalCompositeZScoreBelow', 'mfWeightedFinalCompositeZScoreAbove', 'mfWeightedFinalCompositeZScoreBelow', 'mfDividendYieldZScoreAbove', 'mfDividendYieldZScoreBelow', 'mfReturnOnEquityZScoreAbove', 'mfReturnOnEquityZScoreBelow', 'mfYieldToMaturityAbove', 'mfYieldToMaturityBelow', 'mfNominalMaturityAbove', 'mfNominalMaturityBelow', 'mfEffectiveMaturityAbove', 'mfEffectiveMaturityBelow', 'mfAverageCouponAbove', 'mfAverageCouponBelow', 'mfCalculatedAverageQualityAbove', 'mfCalculatedAverageQualityBelow', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'bidAskPriceType', 'seperatorType', 'seperatorTypeSym', 'btFilteringCriteria', 'reutEBTNorm_MRYAbove', 'reutEBTNorm_MRYBelow', 'reutNetIncomeAvlble2CommonNorm_MRYAbove', 'reutNetIncomeAvlble2CommonNorm_MRYBelow', 'reutPENorm_MRYAbove', 'reutPENorm_MRYBelow', 'reutPretaxMarginPct_MRYAbove', 'reutPretaxMarginPct_MRYBelow', 'avgAnalystTarget2PriceRatioAbove', 'avgAnalystTarget2PriceRatioBelow', 'avgPriceTargetAbove', 'avgPriceTargetBelow', 'avgRatingAbove', 'avgRatingBelow', 'reutEPSChgPctAbove', 'reutEPSChgPctBelow', 'histDividendFrdYieldAbove', 'histDividendFrdYieldBelow', 'reutLongTermDebt2Equity_MRQAbove', 'reutLongTermDebt2Equity_MRQBelow', 'reutPrice2SalesRatio_TTMAbove', 'reutPrice2SalesRatio_TTMBelow', 'reutReturnOnInvestmentPct_TTMAbove', 'reutReturnOnInvestmentPct_TTMBelow', 'ibFrac52wkAbove', 'ibFrac52wkBelow', 'ihInsiderOfFloatPercAbove', 'ihInsiderOfFloatPercBelow', 'ihNumSharesInsiderAbove', 'ihNumSharesInsiderBelow', 'iiNumSharesInstitutionalAbove', 'iiNumSharesInstitutionalBelow', 'numPriceTargetsAbove', 'numPriceTargetsBelow', 'numRatingsAbove', 'numRatingsBelow', 'minPeRatio', 'maxPeRatio', 'minPrice2TanBk', 'maxPrice2TanBk', 'minPrice2Bk', 'maxPrice2Bk', 'reutCurrentRatio_MRQAbove', 'reutCurrentRatio_MRQBelow', 'minQuickRatio', 'maxQuickRatio', 'reutRevChgPctAbove', 'reutRevChgPctBelow', 'reutEPSChgPct_TTMAbove', 'reutEPSChgPct_TTMBelow', 'reutEBITD_TTMAbove', 'reutEBITD_TTMBelow', 'reutEBT_TTMAbove', 'reutEBT_TTMBelow', 'reutGrossMargin_TTMAbove', 'reutGrossMargin_TTMBelow', 'reutNetIncomeAvlble2Common_TTMAbove', 'reutNetIncomeAvlble2Common_TTMBelow', 'reutNetProfitMarginPct_TTMAbove', 'reutNetProfitMarginPct_TTMBelow', 'reutOperatingMargin_TTMAbove', 'reutOperatingMargin_TTMBelow', 'reutPayoutRatioPct_TTMAbove', 'reutPayoutRatioPct_TTMBelow', 'reutPrice2CashFlowPerShare_TTMAbove', 'reutPrice2CashFlowPerShare_TTMBelow', 'reutRev_TTMAbove', 'reutRev_TTMBelow', 'reutRevChgPct_TTMAbove', 'reutRevChgPct_TTMBelow', 'reutReturnOnAvgAssetsPct_TTMAbove', 'reutReturnOnAvgAssetsPct_TTMBelow', 'minRetnOnEq', 'maxRetnOnEq', 'ibPriceYTDPctAbove', 'ibPriceYTDPctBelow', 'reutPretaxMargin_TTMAbove', 'reutPretaxMargin_TTMBelow', 'reutFreeCashFlow_TTMAbove', 'reutFreeCashFlow_TTMBelow', 'reutNetDebtIAbove', 'reutNetDebtIBelow', 'shortInterestChgAbove', 'shortInterestChgBelow', 'shortOutstandingRatioAbove', 'shortOutstandingRatioBelow', 'market_edgeAbove', 'market_edgeBelow', 'market_graderAbove', 'market_graderBelow', 'morningstarAbove', 'morningstarBelow', 'constructs_researchAbove', 'constructs_researchBelow', 'sadif_analyticsAbove', 'sadif_analyticsBelow', 'street_ratingsAbove', 'street_ratingsBelow', 'validea_guruAbove', 'validea_guruBelow', 'valuengineAbove', 'valuengineBelow', 'zacksAbove', 'zacksBelow', 'marketCapAbove1e6', 'marketCapBelow1e6', 'reutEnterpriseValueCurAbove', 'reutEnterpriseValueCurBelow', 'ibPriceYTDPctR_Above', 'ibPriceYTDPctR_Below', 'reutTotDebtTotEquityRatio_MRQ_Above', 'reutTotDebtTotEquityRatio_MRQ_Below', 'reutCurrentAssets_MRQAbove', 'reutCurrentAssets_MRQBelow', 'reutCurrentAssets_MRYAbove', 'reutCurrentAssets_MRYBelow', 'reutCashFlowPerShare_MRYAbove', 'reutCashFlowPerShare_MRYBelow', 'reutEBIT_MRQAbove', 'reutEBIT_MRQBelow', 'reutEBIT_MRYAbove', 'reutEBIT_MRYBelow', 'reutEPS_MRYAbove', 'reutEPS_MRYBelow', 'reutIssuanceOfDebt_MRQAbove', 'reutIssuanceOfDebt_MRQBelow', 'reutIssuanceOfDebt_MRYAbove', 'reutIssuanceOfDebt_MRYBelow', 'reutIssuanceOfStock_MRQAbove', 'reutIssuanceOfStock_MRQBelow', 'reutIssuanceOfStock_MRYAbove', 'reutIssuanceOfStock_MRYBelow', 'reutShortTermDebt_MRQAbove', 'reutShortTermDebt_MRQBelow', 'reutShortTermDebt_MRYAbove', 'reutShortTermDebt_MRYBelow', 'reutCurrentLiabilities_MRQAbove', 'reutCurrentLiabilities_MRQBelow', 'reutCurrentLiabilities_MRYAbove', 'reutCurrentLiabilities_MRYBelow', 'reutCashFromOperating_MRQAbove', 'reutCashFromOperating_MRQBelow', 'reutCashFromOperating_MRYAbove', 'reutCashFromOperating_MRYBelow', 'reutRevenuePerShare_MRYAbove', 'reutRevenuePerShare_MRYBelow', 'reutReturnOnAvgAssetsPct_MRYAbove', 'reutReturnOnAvgAssetsPct_MRYBelow', 'reutReturnOnInvestmentPct_MRYAbove', 'reutReturnOnInvestmentPct_MRYBelow', 'reutCapitalExpenditures_MRQAbove', 'reutCapitalExpenditures_MRQBelow', 'reutCapitalExpenditures_MRYAbove', 'reutCapitalExpenditures_MRYBelow', 'reutCashFromFinancing_MRQAbove', 'reutCashFromFinancing_MRQBelow', 'reutCashFromFinancing_MRYAbove', 'reutCashFromFinancing_MRYBelow', 'reutCashFromInvesting_MRQAbove', 'reutCashFromInvesting_MRQBelow', 'reutCashFromInvesting_MRYAbove', 'reutCashFromInvesting_MRYBelow', 'reutInterestExpense_MRQAbove', 'reutInterestExpense_MRQBelow', 'reutInterestExpense_MRYAbove', 'reutInterestExpense_MRYBelow', 'reutOperatingIncome_MRQAbove', 'reutOperatingIncome_MRQBelow', 'reutOperatingIncome_MRYAbove', 'reutOperatingIncome_MRYBelow', 'reutEnterpriseValueToEBITDAAbove', 'reutEnterpriseValueToEBITDABelow', 'ibPrice1WKPctAbove', 'ibPrice1WKPctBelow', 'ibPrice4WKPctAbove', 'ibPrice4WKPctBelow', 'ibPrice13WKPctAbove', 'ibPrice13WKPctBelow', 'ibPrice52WKPctAbove', 'ibPrice52WKPctBelow', 'reutYieldAbove', 'reutYieldBelow', 'reutCash_MRQAbove', 'reutCash_MRQBelow', 'reutEBITDA_MRQAbove', 'reutEBITDA_MRQBelow', 'reutPrice2SalesRatio_MRQAbove', 'reutPrice2SalesRatio_MRQBelow', 'reutPrice2CashFlowPerShare_MRQAbove', 'reutPrice2CashFlowPerShare_MRQBelow', 'reutTotalAssets_MRQAbove', 'reutTotalAssets_MRQBelow', 'reutTotalLiabilities_MRQAbove', 'reutTotalLiabilities_MRQBelow', 'reutTotalCommonEquity_MRQAbove', 'reutTotalCommonEquity_MRQBelow', 'reutTotalLongTermDebt_MRQAbove', 'reutTotalLongTermDebt_MRQBelow', 'reutBookValueTanPerShare_MRQAbove', 'reutBookValueTanPerShare_MRQBelow', 'reutCashFlowPerShare_TTMAbove', 'reutCashFlowPerShare_TTMBelow', 'reutEPS_TTMAbove', 'reutEPS_TTMBelow', 'reutRev2Share_TTMAbove', 'reutRev2Share_TTMBelow', 'sharesOutstandingAbove', 'sharesOutstandingBelow', 'btFundamentalsCriteria', 'reutEBTNorm_MRYAbove', 'reutEBTNorm_MRYBelow', 'reutNetIncomeAvlble2CommonNorm_MRYAbove', 'reutNetIncomeAvlble2CommonNorm_MRYBelow', 'reutPENorm_MRYAbove', 'reutPENorm_MRYBelow', 'reutPretaxMarginPct_MRYAbove', 'reutPretaxMarginPct_MRYBelow', 'avgAnalystTarget2PriceRatioAbove', 'avgAnalystTarget2PriceRatioBelow', 'avgPriceTargetAbove', 'avgPriceTargetBelow', 'avgRatingAbove', 'avgRatingBelow', 'reutEPSChgPctAbove', 'reutEPSChgPctBelow', 'histDividendFrdYieldAbove', 'histDividendFrdYieldBelow', 'reutLongTermDebt2Equity_MRQAbove', 'reutLongTermDebt2Equity_MRQBelow', 'reutPrice2SalesRatio_TTMAbove', 'reutPrice2SalesRatio_TTMBelow', 'reutReturnOnInvestmentPct_TTMAbove', 'reutReturnOnInvestmentPct_TTMBelow', 'ibFrac52wkAbove', 'ibFrac52wkBelow', 'ihInsiderOfFloatPercAbove', 'ihInsiderOfFloatPercBelow', 'ihNumSharesInsiderAbove', 'ihNumSharesInsiderBelow', 'iiNumSharesInstitutionalAbove', 'iiNumSharesInstitutionalBelow', 'numPriceTargetsAbove', 'numPriceTargetsBelow', 'numRatingsAbove', 'numRatingsBelow', 'minPeRatio', 'maxPeRatio', 'minPrice2TanBk', 'maxPrice2TanBk', 'minPrice2Bk', 'maxPrice2Bk', 'reutCurrentRatio_MRQAbove', 'reutCurrentRatio_MRQBelow', 'minQuickRatio', 'maxQuickRatio', 'reutRevChgPctAbove', 'reutRevChgPctBelow', 'reutEPSChgPct_TTMAbove', 'reutEPSChgPct_TTMBelow', 'reutEBITD_TTMAbove', 'reutEBITD_TTMBelow', 'reutEBT_TTMAbove', 'reutEBT_TTMBelow', 'reutGrossMargin_TTMAbove', 'reutGrossMargin_TTMBelow', 'reutNetIncomeAvlble2Common_TTMAbove', 'reutNetIncomeAvlble2Common_TTMBelow', 'reutNetProfitMarginPct_TTMAbove', 'reutNetProfitMarginPct_TTMBelow', 'reutOperatingMargin_TTMAbove', 'reutOperatingMargin_TTMBelow', 'reutPayoutRatioPct_TTMAbove', 'reutPayoutRatioPct_TTMBelow', 'reutPrice2CashFlowPerShare_TTMAbove', 'reutPrice2CashFlowPerShare_TTMBelow', 'reutRev_TTMAbove', 'reutRev_TTMBelow', 'reutRevChgPct_TTMAbove', 'reutRevChgPct_TTMBelow', 'reutReturnOnAvgAssetsPct_TTMAbove', 'reutReturnOnAvgAssetsPct_TTMBelow', 'minRetnOnEq', 'maxRetnOnEq', 'ibPriceYTDPctAbove', 'ibPriceYTDPctBelow', 'reutPretaxMargin_TTMAbove', 'reutPretaxMargin_TTMBelow', 'reutFreeCashFlow_TTMAbove', 'reutFreeCashFlow_TTMBelow', 'reutNetDebtIAbove', 'reutNetDebtIBelow', 'shortInterestChgAbove', 'shortInterestChgBelow', 'shortOutstandingRatioAbove', 'shortOutstandingRatioBelow', 'market_edgeAbove', 'market_edgeBelow', 'market_graderAbove', 'market_graderBelow', 'morningstarAbove', 'morningstarBelow', 'constructs_researchAbove', 'constructs_researchBelow', 'sadif_analyticsAbove', 'sadif_analyticsBelow', 'street_ratingsAbove', 'street_ratingsBelow', 'validea_guruAbove', 'validea_guruBelow', 'valuengineAbove', 'valuengineBelow', 'zacksAbove', 'zacksBelow', 'marketCapAbove1e6', 'marketCapBelow1e6', 'reutEnterpriseValueCurAbove', 'reutEnterpriseValueCurBelow', 'ibPriceYTDPctR_Above', 'ibPriceYTDPctR_Below', 'reutTotDebtTotEquityRatio_MRQ_Above', 'reutTotDebtTotEquityRatio_MRQ_Below', 'reutCurrentAssets_MRQAbove', 'reutCurrentAssets_MRQBelow', 'reutCurrentAssets_MRYAbove', 'reutCurrentAssets_MRYBelow', 'reutCashFlowPerShare_MRYAbove', 'reutCashFlowPerShare_MRYBelow', 'reutEBIT_MRQAbove', 'reutEBIT_MRQBelow', 'reutEBIT_MRYAbove', 'reutEBIT_MRYBelow', 'reutEPS_MRYAbove', 'reutEPS_MRYBelow', 'reutIssuanceOfDebt_MRQAbove', 'reutIssuanceOfDebt_MRQBelow', 'reutIssuanceOfDebt_MRYAbove', 'reutIssuanceOfDebt_MRYBelow', 'reutIssuanceOfStock_MRQAbove', 'reutIssuanceOfStock_MRQBelow', 'reutIssuanceOfStock_MRYAbove', 'reutIssuanceOfStock_MRYBelow', 'reutShortTermDebt_MRQAbove', 'reutShortTermDebt_MRQBelow', 'reutShortTermDebt_MRYAbove', 'reutShortTermDebt_MRYBelow', 'reutCurrentLiabilities_MRQAbove', 'reutCurrentLiabilities_MRQBelow', 'reutCurrentLiabilities_MRYAbove', 'reutCurrentLiabilities_MRYBelow', 'reutCashFromOperating_MRQAbove', 'reutCashFromOperating_MRQBelow', 'reutCashFromOperating_MRYAbove', 'reutCashFromOperating_MRYBelow', 'reutRevenuePerShare_MRYAbove', 'reutRevenuePerShare_MRYBelow', 'reutReturnOnAvgAssetsPct_MRYAbove', 'reutReturnOnAvgAssetsPct_MRYBelow', 'reutReturnOnInvestmentPct_MRYAbove', 'reutReturnOnInvestmentPct_MRYBelow', 'reutCapitalExpenditures_MRQAbove', 'reutCapitalExpenditures_MRQBelow', 'reutCapitalExpenditures_MRYAbove', 'reutCapitalExpenditures_MRYBelow', 'reutCashFromFinancing_MRQAbove', 'reutCashFromFinancing_MRQBelow', 'reutCashFromFinancing_MRYAbove', 'reutCashFromFinancing_MRYBelow', 'reutCashFromInvesting_MRQAbove', 'reutCashFromInvesting_MRQBelow', 'reutCashFromInvesting_MRYAbove', 'reutCashFromInvesting_MRYBelow', 'reutInterestExpense_MRQAbove', 'reutInterestExpense_MRQBelow', 'reutInterestExpense_MRYAbove', 'reutInterestExpense_MRYBelow', 'reutOperatingIncome_MRQAbove', 'reutOperatingIncome_MRQBelow', 'reutOperatingIncome_MRYAbove', 'reutOperatingIncome_MRYBelow', 'reutEnterpriseValueToEBITDAAbove', 'reutEnterpriseValueToEBITDABelow', 'ibPrice1WKPctAbove', 'ibPrice1WKPctBelow', 'ibPrice4WKPctAbove', 'ibPrice4WKPctBelow', 'ibPrice13WKPctAbove', 'ibPrice13WKPctBelow', 'ibPrice52WKPctAbove', 'ibPrice52WKPctBelow', 'reutYieldAbove', 'reutYieldBelow', 'reutCash_MRQAbove', 'reutCash_MRQBelow', 'reutEBITDA_MRQAbove', 'reutEBITDA_MRQBelow', 'reutPrice2SalesRatio_MRQAbove', 'reutPrice2SalesRatio_MRQBelow', 'reutPrice2CashFlowPerShare_MRQAbove', 'reutPrice2CashFlowPerShare_MRQBelow', 'reutTotalAssets_MRQAbove', 'reutTotalAssets_MRQBelow', 'reutTotalLiabilities_MRQAbove', 'reutTotalLiabilities_MRQBelow', 'reutTotalCommonEquity_MRQAbove', 'reutTotalCommonEquity_MRQBelow', 'reutTotalLongTermDebt_MRQAbove', 'reutTotalLongTermDebt_MRQBelow', 'reutBookValueTanPerShare_MRQAbove', 'reutBookValueTanPerShare_MRQBelow', 'reutCashFlowPerShare_TTMAbove', 'reutCashFlowPerShare_TTMBelow', 'reutEPS_TTMAbove', 'reutEPS_TTMBelow', 'reutRev2Share_TTMAbove', 'reutRev2Share_TTMBelow', 'sharesOutstandingAbove', 'sharesOutstandingBelow', 'minPeRatio', 'maxPeRatio', 'reutReturnOnInvestmentPct_TTMAbove', 'reutReturnOnInvestmentPct_TTMBelow', 'reutPretaxMarginPct_MRYAbove', 'reutPretaxMarginPct_MRYBelow', 'reutEnterpriseValueCurAbove', 'reutEnterpriseValueCurBelow', 'btMarketCapCriteria', 'marketCapAbove1e6', 'marketCapBelow1e6', 'marketCapAbove1e6', 'marketCapBelow1e6', 'researchProviderIs', 'market_edgeAbove', 'market_edgeBelow', 'market_graderAbove', 'market_graderBelow', 'morningstarAbove', 'morningstarBelow', 'constructs_researchAbove', 'constructs_researchBelow', 'sadif_analyticsAbove', 'sadif_analyticsBelow', 'street_ratingsAbove', 'street_ratingsBelow', 'validea_guruAbove', 'validea_guruBelow', 'valuengineAbove', 'valuengineBelow', 'zacksAbove', 'zacksBelow', 'market_edgeAbove', 'market_edgeBelow', 'market_graderAbove', 'market_graderBelow', 'morningstarAbove', 'morningstarBelow', 'constructs_researchAbove', 'constructs_researchBelow', 'sadif_analyticsAbove', 'sadif_analyticsBelow', 'street_ratingsAbove', 'street_ratingsBelow', 'validea_guruAbove', 'validea_guruBelow', 'valuengineAbove', 'valuengineBelow', 'zacksAbove', 'zacksBelow']

Notice how abovePrice is now called priceAbove...

Using three of these filter tags, let's perform a query to find all US stocks that went up 20% and have a current price between 5 and 50 dollar, sorted by percentage gain:

In [7]:
sub = ScannerSubscription(
    instrument='STK',
    locationCode='STK.US.MAJOR',
    scanCode='TOP_PERC_GAIN')

tagValues = [
    TagValue("changePercAbove", "20"),
    TagValue('priceAbove', 5),
    TagValue('priceBelow', 50)]

# the tagValues are given as 3rd argument; the 2nd argument must always be an empty list
# (IB has not documented the 2nd argument and it's not clear what it does)
scanData = ib.reqScannerData(sub, [], tagValues)

symbols = [sd.contractDetails.contract.symbol for sd in scanData]
print(symbols)
[]

Any scanner query that TWS can do can alse be done through the API. The scanCode parameter maps directly to the "Parameter" window in the TWS "Advanced Market Scanner." We can verify this by printing out the scanCode values available:

In [8]:
scanCodes = [e.text for e in tree.findall('.//scanCode')]

print(len(scanCodes), 'scan codes, showing the ones starting with "TOP":')
print([sc for sc in scanCodes if sc.startswith('TOP')])
762 scan codes, showing the ones starting with "TOP":
['TOP_PERC_GAIN', 'TOP_PERC_LOSE', 'TOP_TRADE_COUNT', 'TOP_TRADE_RATE', 'TOP_PRICE_RANGE', 'TOP_VOLUME_RATE', 'TOP_OPEN_PERC_GAIN', 'TOP_OPEN_PERC_LOSE', 'TOP_AFTER_HOURS_PERC_GAIN', 'TOP_AFTER_HOURS_PERC_LOSE', 'TOP_OPT_IMP_VOLAT_GAIN', 'TOP_OPT_IMP_VOLAT_LOSE', 'TOP_STOCK_BUY_IMBALANCE_ADV_RATIO', 'TOP_STOCK_SELL_IMBALANCE_ADV_RATIO', 'TOP_STOCK_BUY_REG_IMBALANCE_ADV_RATIO', 'TOP_STOCK_SELL_REG_IMBALANCE_ADV_RATIO', 'TOP_PERC_GAIN', 'TOP_PERC_LOSE', 'TOP_TRADE_RATE', 'TOP_PERC_GAIN']

Queries are not limited to stocks. To get a list of all supported instruments:

In [9]:
instrumentTypes = set(e.text for e in tree.findall('.//Instrument/type'))
print(instrumentTypes)
{'BOND.AGNCY', 'ETF.FI.US', 'STOCK.EU', 'SSF.NA', 'BOND.MUNI', 'BOND.GOVT', 'BOND.CD', 'SSF.HK', 'WAR.EU', 'STOCK.HK', 'SSF.EU', 'IND.EU', 'IND.HK', 'FUND.ALL', 'STK', 'FUT.HK', 'BOND', 'FUT.US', 'STOCK.NA', 'BOND.GOVT.NON-US', 'PORTSTK', 'Global', 'IND.US', 'FUT.EU', 'STOCK.ME', 'SLB.US', 'NATCOMB', 'FUT.NA', 'ETF.EQ.US'}

To find all location codes:

In [10]:
locationCodes = [e.text for e in tree.findall('.//locationCode')]
print(locationCodes)
['STK.US', 'STK.US.MAJOR', 'STK.NYSE', 'STK.AMEX', 'STK.ARCA', 'STK.NASDAQ', 'STK.NASDAQ.NMS', 'STK.NASDAQ.SCM', 'STK.BATS', 'STK.US.MINOR', 'STK.PINK', 'STK.OTCBB', 'ETF.EQ.US', 'ETF.EQ.US.MAJOR', 'ETF.EQ.ARCA', 'ETF.EQ.NASDAQ.NMS', 'ETF.EQ.BATS', 'ETF.FI.US', 'ETF.FI.US.MAJOR', 'ETF.FI.ARCA', 'ETF.FI.NASDAQ.NMS', 'ETF.FI.BATS', 'FUT.US', 'FUT.GLOBEX', 'FUT.ECBOT', 'FUT.IPE', 'FUT.NYBOT', 'FUT.NYMEX', 'FUT.NYSELIFFE', 'FUT.CFE', 'FUT.CFECRYPTO', 'FUT.CMECRYPTO', 'FUT.ICECRYPTO', 'IND.US', 'BOND.WW', 'BOND.US', 'BOND.EU.EURONEXT', 'BOND.CD.US', 'BOND.AGNCY.US', 'BOND.GOVT.US', 'BOND.MUNI.US', 'BOND.GOVT.NON-US', 'BOND.GOVT.US.NON-US', 'BOND.GOVT.EU.EURONEXT', 'BOND.GOVT.HK.SEHK', 'SLB.PREBORROW', 'FUND.ALL', 'FUND.US', 'FUND.NON-US', 'STK.NA', 'STK.NA.CANADA', 'STK.NA.TSE', 'STK.NA.VENTURE', 'STK.NA.MEXI', 'FUT.NA', 'FUT.NA.CDE', 'FUT.NA.MEXDER', 'SSF.NA', 'SSF.NA.MEXDER', 'STK.EU', 'STK.EU.VSE', 'STK.EU.SBF', 'STK.EU.IBIS', 'STK.EU.IBIS-XETRA', 'STK.EU.IBIS-EUSTARS', 'STK.EU.IBIS-USSTARS', 'STK.EU.IBIS-ETF', 'STK.EU.IBIS-NEWX', 'STK.EU.BVME', 'STK.EU.AEB', 'STK.EU.BM', 'STK.EU.SFB', 'STK.EU.SWISS', 'STK.EU.VIRTX', 'STK.EU.EBS', 'STK.EU.LSE', 'STK.EU.OTHER', 'STK.EU.PRA', 'STK.EU.CPH', 'STK.EU.HEX', 'STK.EU.OSE', 'STK.EU.BVL', 'STK.EU.MOEX', 'FUT.EU', 'FUT.EU.BELFOX', 'FUT.EU.DTB', 'FUT.EU.FTA', 'FUT.EU.IDEM', 'FUT.EU.UK', 'FUT.EU.ICEEU', 'FUT.EU.LMEOTC', 'FUT.EU.MEFFRV', 'FUT.EU.MONEP', 'FUT.EU.OMS', 'FUT.EU.SOFFEX', 'IND.EU', 'IND.EU.BELFOX', 'IND.EU.DTB', 'IND.EU.FTA', 'IND.EU.ICEEU', 'IND.EU.MONEP', 'SSF.EU', 'SSF.EU.DTB', 'SSF.EU.IDEM', 'SSF.EU.ICEEU', 'SSF.EU.MEFFRV', 'SSF.EU.OMS', 'SSF.EU.SOFFEX', 'WAR.EU.ALL', 'STK.ME', 'STK.ME.TASE', 'STK.HK', 'STK.HK.TSE_JPN', 'STK.HK.SEHK', 'STK.HK.SEHKNTL', 'STK.HK.SEHKSZSE', 'STK.HK.ASX', 'STK.HK.NSE', 'STK.HK.SGX', 'FUT.HK', 'FUT.HK.HKFE', 'FUT.HK.KSE', 'FUT.HK.NSE', 'FUT.HK.OSE_JPN', 'FUT.HK.SGX', 'FUT.HK.SNFE', 'IND.HK', 'IND.HK.HKFE', 'IND.HK.KSE', 'IND.HK.NSE', 'IND.HK.OSE_JPN', 'IND.HK.SGX', 'IND.HK.SNFE', 'SSF.HK', 'SSF.HK.HKFE', 'SSF.HK.KSE', 'SSF.HK.NSE', 'SSF.HK.SGX', 'NATCOMB', 'NATCOMB.OPT.US', 'NATCOMB.OPT.AMEX', 'NATCOMB.OPT.CBOE', 'NATCOMB.OPT.ISE', 'NATCOMB.OPT.PHLX', 'NATCOMB.OPT.PSE', 'NATCOMB.GLOBEX', 'BACKTEST']
In [11]:
ib.disconnect()
In [ ]: