public static ScannerSubscription GetScannerSubscription()
 {
     ScannerSubscription scanSub = new ScannerSubscription();
     scanSub.Instrument = "STOCK.EU";
     scanSub.LocationCode = "STK.EU.IBIS";
     scanSub.ScanCode = "HOT_BY_VOLUME";
     return scanSub;
 }
Esempio n. 2
0
 private void scannerRequest_Button_Click(object sender, EventArgs e)
 {
     if (isConnected)
     {
         ScannerSubscription subscription = new ScannerSubscription();
         subscription.ScanCode = scanCode.Text;
         subscription.Instrument = scanInstrument.Text;
         subscription.LocationCode = scanLocation.Text;
         subscription.StockTypeFilter = scanStockType.Text;
         subscription.NumberOfRows = Int32.Parse(scanNumRows.Text);
         scannerManager.AddRequest(subscription);
         ShowTab(marketData_MDT, scannerTab);
     }
 }
Esempio n. 3
0
 /**
  * @brief Starts a subscription to market scan results based on the provided parameters.
  * @param reqId the request's identifier
  * @param subscription summary of the scanner subscription including its filters.
  * @sa reqScannerParameters, ScannerSubscription, EWrapper::scannerData
  */
 public void reqScannerSubscription(int reqId, ScannerSubscription subscription)
 {
     if (!CheckConnection())
         return;
     const int VERSION = 3;
     List<byte> paramsList = new List<byte>();
     paramsList.AddParameter(OutgoingMessages.RequestScannerSubscription);
     paramsList.AddParameter(VERSION);
     paramsList.AddParameter(reqId);
     paramsList.AddParameterMax(subscription.NumberOfRows);
     paramsList.AddParameter(subscription.Instrument);
     paramsList.AddParameter(subscription.LocationCode);
     paramsList.AddParameter(subscription.ScanCode);
     paramsList.AddParameterMax(subscription.AbovePrice);
     paramsList.AddParameterMax(subscription.BelowPrice);
     paramsList.AddParameterMax(subscription.AboveVolume);
     paramsList.AddParameterMax(subscription.MarketCapAbove);
     paramsList.AddParameterMax(subscription.MarketCapBelow);
     paramsList.AddParameter(subscription.MoodyRatingAbove);
     paramsList.AddParameter(subscription.MoodyRatingBelow);
     paramsList.AddParameter(subscription.SpRatingAbove);
     paramsList.AddParameter(subscription.SpRatingBelow);
     paramsList.AddParameter(subscription.MaturityDateAbove);
     paramsList.AddParameter(subscription.MaturityDateBelow);
     paramsList.AddParameterMax(subscription.CouponRateAbove);
     paramsList.AddParameterMax(subscription.CouponRateBelow);
     paramsList.AddParameter(subscription.ExcludeConvertible);
     if (serverVersion >= 25)
     {
         paramsList.AddParameterMax(subscription.AverageOptionVolumeAbove);
         paramsList.AddParameter(subscription.ScannerSettingPairs);
     }
     if (serverVersion >= 27)
     {
         paramsList.AddParameter(subscription.StockTypeFilter);
     }
     Send(paramsList, EClientErrors.FAIL_SEND_REQSCANNER);
 }
Esempio n. 4
0
 public void AddRequest(ScannerSubscription scannerSubscription)
 {
     ibClient.ClientSocket.reqScannerSubscription(currentTicker, scannerSubscription, new List<TagValue>());
 }
Esempio n. 5
0
        /**
         * @brief Starts a subscription to market scan results based on the provided parameters.
         * @param reqId the request's identifier
         * @param subscription summary of the scanner subscription including its filters.
         * @sa reqScannerParameters, ScannerSubscription, EWrapper::scannerData
         */
        public void reqScannerSubscription(int reqId, ScannerSubscription subscription, List<TagValue> scannerSubscriptionOptions)
        {
            if (!CheckConnection())
                return;
            const int VERSION = 4;
            var paramsList = new BinaryWriter(new MemoryStream());
            var lengthPos = prepareBuffer(paramsList);

            paramsList.AddParameter(OutgoingMessages.RequestScannerSubscription);
            paramsList.AddParameter(VERSION);
            paramsList.AddParameter(reqId);
            paramsList.AddParameterMax(subscription.NumberOfRows);
            paramsList.AddParameter(subscription.Instrument);
            paramsList.AddParameter(subscription.LocationCode);
            paramsList.AddParameter(subscription.ScanCode);
            paramsList.AddParameterMax(subscription.AbovePrice);
            paramsList.AddParameterMax(subscription.BelowPrice);
            paramsList.AddParameterMax(subscription.AboveVolume);
            paramsList.AddParameterMax(subscription.MarketCapAbove);
            paramsList.AddParameterMax(subscription.MarketCapBelow);
            paramsList.AddParameter(subscription.MoodyRatingAbove);
            paramsList.AddParameter(subscription.MoodyRatingBelow);
            paramsList.AddParameter(subscription.SpRatingAbove);
            paramsList.AddParameter(subscription.SpRatingBelow);
            paramsList.AddParameter(subscription.MaturityDateAbove);
            paramsList.AddParameter(subscription.MaturityDateBelow);
            paramsList.AddParameterMax(subscription.CouponRateAbove);
            paramsList.AddParameterMax(subscription.CouponRateBelow);
            paramsList.AddParameter(subscription.ExcludeConvertible);
            if (serverVersion >= 25)
            {
                paramsList.AddParameterMax(subscription.AverageOptionVolumeAbove);
                paramsList.AddParameter(subscription.ScannerSettingPairs);
            }
            if (serverVersion >= 27)
            {
                paramsList.AddParameter(subscription.StockTypeFilter);
            }

            if (serverVersion >= MinServerVer.LINKING)
            {
                //int tagValuesCount = scannerSubscriptionOptions == null ? 0 : scannerSubscriptionOptions.Count;
                //paramsList.AddParameter(tagValuesCount);
                paramsList.AddParameter(TagValueListToString(scannerSubscriptionOptions));
            }

            CloseAndSend(paramsList, lengthPos, EClientErrors.FAIL_SEND_REQSCANNER);
        }
        /// <summary>
        /// Starts a subscription to market scan results based on the provided parameters.
        /// </summary>
        /// <param name="reqId">The request's identifier.</param>
        /// <param name="subscription">Summary of the scanner subscription including its filters.</param>
        /// <param name="scannerSubscriptionOptions"></param>
        public void ReqScannerSubscription(int reqId, ScannerSubscription subscription, List<TagValue> scannerSubscriptionOptions)
        {
            CheckConnection();
            const int VERSION = 4;
            List<byte> paramsList = new List<byte>();
            paramsList.AddParameter(OutgoingMessages.RequestScannerSubscription);
            paramsList.AddParameter(VERSION);
            paramsList.AddParameter(reqId);
            paramsList.AddParameterMax(subscription.NumberOfRows);
            paramsList.AddParameter(subscription.Instrument);
            paramsList.AddParameter(subscription.LocationCode);
            paramsList.AddParameter(subscription.ScanCode);
            paramsList.AddParameterMax(subscription.AbovePrice);
            paramsList.AddParameterMax(subscription.BelowPrice);
            paramsList.AddParameterMax(subscription.AboveVolume);
            paramsList.AddParameterMax(subscription.MarketCapAbove);
            paramsList.AddParameterMax(subscription.MarketCapBelow);
            paramsList.AddParameter(subscription.MoodyRatingAbove);
            paramsList.AddParameter(subscription.MoodyRatingBelow);
            paramsList.AddParameter(subscription.SpRatingAbove);
            paramsList.AddParameter(subscription.SpRatingBelow);
            paramsList.AddParameter(subscription.MaturityDateAbove);
            paramsList.AddParameter(subscription.MaturityDateBelow);
            paramsList.AddParameterMax(subscription.CouponRateAbove);
            paramsList.AddParameterMax(subscription.CouponRateBelow);
            paramsList.AddParameter(subscription.ExcludeConvertible);
            if (ibClientConnection.ServerVersion >= 25)
            {
                paramsList.AddParameterMax(subscription.AverageOptionVolumeAbove);
                paramsList.AddParameter(subscription.ScannerSettingPairs);
            }
            if (ibClientConnection.ServerVersion >= 27)
            {
                paramsList.AddParameter(subscription.StockTypeFilter);
            }

            if (ibClientConnection.ServerVersion >= MinServerVer.LINKING)
            {
                //int tagValuesCount = scannerSubscriptionOptions == null ? 0 : scannerSubscriptionOptions.Count;
                //paramsList.AddParameter(tagValuesCount);
                paramsList.AddParameter(TagValueListToString(scannerSubscriptionOptions));
            }

            ibClientConnection.IbWriter.Send(paramsList, EClientErrors.FAIL_SEND_REQSCANNER);
        }
 public void AddRequest(ScannerSubscription scannerSubscription)
 {
     ibClient.ClientSocket.reqScannerSubscription(currentTicker, scannerSubscription);
 }