'generated source for method reqScannerSubscription'

@synchronized(mlock)
def reqScannerSubscription(self, tickerId, subscription):

    if (not self.m_connected):
        self.notConnected()
        return
    if (self.m_serverVersion < 24):
        self.error(EClientErrors.NO_VALID_ID, EClientErrors.UPDATE_TWS, '        It    does    not    support    API    scanner    subscription.')
        return
    VERSION = 3
    try:
        self.send(self.REQ_SCANNER_SUBSCRIPTION)
        self.send(VERSION)
        self.send(tickerId)
        self.sendMax(subscription.numberOfRows())
        self.send(subscription.instrument())
        self.send(subscription.locationCode())
        self.send(subscription.scanCode())
        self.sendMax(subscription.abovePrice())
        self.sendMax(subscription.belowPrice())
        self.sendMax(subscription.aboveVolume())
        self.sendMax(subscription.marketCapAbove())
        self.sendMax(subscription.marketCapBelow())
        self.send(subscription.moodyRatingAbove())
        self.send(subscription.moodyRatingBelow())
        self.send(subscription.spRatingAbove())
        self.send(subscription.spRatingBelow())
        self.send(subscription.maturityDateAbove())
        self.send(subscription.maturityDateBelow())
        self.sendMax(subscription.couponRateAbove())
        self.sendMax(subscription.couponRateBelow())
        self.send(subscription.excludeConvertible())
        if (self.m_serverVersion >= 25):
            self.sendMax(subscription.averageOptionVolumeAbove())
            self.send(subscription.scannerSettingPairs())
        if (self.m_serverVersion >= 27):
            self.send(subscription.stockTypeFilter())
    except Exception as e:
        self.error(tickerId, EClientErrors.FAIL_SEND_REQSCANNER, str(e))
        self.close()
