Exemplo n.º 1
0
        /// <summary>
        ///     Конструктор
        /// </summary>
        internal IQFeedGateway(IQFeedParameters parameters)
        {
            var ip = IQFeedParser.ParseIpAddressOrDns(parameters.IQConnectAddress, AddressFamily.InterNetwork);

            socketL1 = new Level1SocketWrapper(ip);

            socketL1.OnFundamentalMsg += L1OnFundamentalMsg;
            socketL1.OnSummaryMsg     += L1OnUpdateMsg;
            socketL1.OnUpdateMsg      += L1OnUpdateMsg;
            socketL1.OnSystemMsg      += L1OnSystemMsg;
            //socketL1.OnTimestampMsg += socketLevelOne_OnTimestampMsg;
            //socketL1.OnRegionalMsg += LevelOne_OnRegionalMsg;
            //socketL1.OnNewsMsg += LevelOne_OnNewsMsg;
            socketL1.OnErrorMsg += L1OnErrorMsg;
            //socketL1.OnOtherMsg += LevelOne_OnOtherMsg;
            socketL1.OnSubscriptionErrorMsg += L1OnSubscriptionErrorMsg;

            historySocket = new HistorySocketWrapper(ip);
            historySocket.OnHistoryMsg    += HistoryOnHistoryMsg;
            historySocket.OnHistoryEndMsg += HistoryOnHistoryEndMsg;
            historySocket.OnErrorMsg      += HistoryOnErrorMsg;

            lookupSocket = new LookupSocketWrapper(ip);
            lookupSocket.OnSecurityTypeMsg += LookupOnSecurityTypeMsg;
            lookupSocket.OnResultMsg       += LookupOnResultMsg;
            lookupSocket.OnErrorMsg        += LookupOnErrorMsg;

            instrumentConverter = parameters.InstrumentConverter;
        }
Exemplo n.º 2
0
 public QLAdapter(string ipAddress, int port, IDateTimeProvider dateTimeProvider, bool receiveMarketdata, InstrumentConverter <InstrumentData> instrumentConverter)
 {
     this.dateTimeProvider = dateTimeProvider;
     ip        = IPAddress.Parse(!string.IsNullOrEmpty(ipAddress) ? ipAddress : "127.0.0.1");
     this.port = port == 0 ? 1248 : port;
     this.receiveMarketdata = receiveMarketdata;
     InstrumentConverter    = instrumentConverter;
 }
 public SpimexParameters(
     CommClientSettings infoClientSettings,
     CommClientSettings transClientSettings,
     InstrumentConverter <SpimexInstrumentData> instrumentConverter)
 {
     InfoClientSettings  = infoClientSettings;
     TransClientSettings = transClientSettings;
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 4
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public IBParameters(InstrumentConverter <IBInstrumentData> instrumentConverter)
 {
     Host                = "127.0.0.1";
     Port                = 7496;
     ClientId            = 0;
     SessionUid          = Guid.NewGuid().ToString("N").Substring(0, 5);
     RouterMode          = OrderRouterMode.ExternalSessionsRenewable;
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 5
0
        public CQGCInstrumentResolver(
            CQGCAdapter adapter,
            InstrumentConverter <InstrumentData> instrumentConverter)
        {
            this.adapter = adapter;

            this.adapter.MarketDataResolved       += MarketDataResolved;
            this.adapter.MarketDataNotResolved    += MarketDataNotResolved;
            this.adapter.ContractMetadataReceived += ContractMetadataReceived;

            InstrumentConverter = instrumentConverter;

            requestBatchTimer = new Timer(_ => SendBatchRequest(), null, 0, RequestBatchTimerInterval);
        }
Exemplo n.º 6
0
        /// <summary>
        ///     .ctor
        /// </summary>
        public SpimexConnector(
            CommClientSettings infoClientSettings,
            CommClientSettings transClientSettings,
            InstrumentConverter <SpimexInstrumentData> instrumentConverter)
        {
            infoClient  = new InfoCommClient(infoClientSettings);
            transClient = new TransCommClient(transClientSettings);
            this.instrumentConverter = instrumentConverter;

            feed   = new SpimexFeed(this, infoClient);
            router = new SpimexRouter(this, infoClient, transClient);

            ConnectionStatusProviders = new IConnectionStatusProvider[] { this };

            infoClient.OnError  += OnError;
            transClient.OnError += OnError;
        }
Exemplo n.º 7
0
 public MoexInfoCXParameters(InstrumentConverter <InfoCXInstrumentData> instrumentConverter)
 {
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 8
0
 public IBAdapter(IBConnector connector, InstrumentConverter <IBInstrumentData> instrumentConverter)
 {
     this.connector           = connector;
     this.instrumentConverter = instrumentConverter;
     Socket = new LoggingEClientSocketFacade(new EClientSocket(this));
 }
Exemplo n.º 9
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public ContractContainer(IBAdapter adapter, InstrumentConverter <IBInstrumentData> instrumentConverter)
 {
     this.adapter             = adapter;
     this.instrumentConverter = instrumentConverter;
 }
Exemplo n.º 10
0
 public CGateInstrumentResolver(InstrumentConverter <InstrumentData> instrumentConverter)
 {
     this.instrumentConverter = instrumentConverter;
 }
Exemplo n.º 11
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public QLParameters(InstrumentConverter <InstrumentData> instrumentConverter)
 {
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 12
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public CQGCParameters(InstrumentConverter <InstrumentData> instrumentConverter)
 {
     ConnectionUrl       = DefaultUrl;
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 13
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public IQFeedParameters(InstrumentConverter <IQFeedInstrumentData> instrumentConverter)
 {
     IQConnectAddress    = "localhost";
     TreatCommodityAs    = SecurityType.SPOT;
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 14
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public SpectraFixSettings(InstrumentConverter <InstrumentData> instrumentConverter)
 {
     InstrumentConverter = instrumentConverter;
 }
Exemplo n.º 15
0
 /// <summary>
 ///     Конструктор
 /// </summary>
 public CGateParameters(InstrumentConverter <InstrumentData> instrumentConverter)
 {
     OrderBooksEnabled   = true;
     InstrumentConverter = instrumentConverter;
 }