예제 #1
0
            public StudioEntityFactory(StudioConnector parent)
            {
                if (parent == null)
                {
                    throw new ArgumentNullException("parent");
                }

                _parent = parent;

                _parent.NewSecurities     += OnSecurities;
                _parent.SecuritiesChanged += OnSecurities;

                _parent.NewPortfolios     += OnPortfolios;
                _parent.PortfoliosChanged += OnPortfolios;

                _parent.NewNews     += OnNews;
                _parent.NewsChanged += OnNews;
            }
예제 #2
0
        public static void AddStockSharpFixConnection(this StudioConnector connector, string serverAddress = "localhost:5001")
        {
            if (connector.BasketSessionHolder.InnerSessions.Count > 1)
            {
                return;
            }

            var client = ConfigManager.GetService <AuthenticationClient>();

            var login = client.Credentials.Login;
            var pass  = client.Credentials.Password;

            var fixSessionholder = new FixSessionHolder(connector.TransactionIdGenerator)
            {
                MarketDataSession =
                {
                    Login         = login,
                    Password      = pass,
                    Address       = serverAddress.To <EndPoint>(),
                    TargetCompId  = "StockSharpMD",
                    SenderCompId  = login,
                    MarketData    = FixMarketData.MarketData,
                    ExchangeBoard = ExchangeBoard.Forts,
                    Version       = FixVersions.Fix44
                },
                TransactionSession =
                {
                    Login                = login,
                    Password             = pass,
                    Address              = serverAddress.To <EndPoint>(),
                    TargetCompId         = "StockSharpTS",
                    SenderCompId         = login,
                    MarketData           = FixMarketData.None,
                    ExchangeBoard        = ExchangeBoard.Forts,
                    Version              = FixVersions.Fix44,
                    RequestAllPortfolios = true
                },
                IsMarketDataEnabled  = true,
                IsTransactionEnabled = true,
            };

            connector.BasketSessionHolder.InnerSessions.Add(fixSessionholder, 0);
        }
예제 #3
0
        public static void AddStockSharpFixConnection(this StudioConnector connector, string serverAddress = "localhost:5001")
        {
            if (((BasketMessageAdapter)connector.MarketDataAdapter).InnerAdapters.Count > 1)
            {
                return;
            }

            var client = ConfigManager.GetService <AuthenticationClient>();

            var login = client.Credentials.Login;
            var pass  = client.Credentials.Password;

            var mdAdapter = (BasketMessageAdapter)connector.MarketDataAdapter;
            var tsAdapter = (BasketMessageAdapter)connector.TransactionAdapter;

            mdAdapter.InnerAdapters.Add(new FixMessageAdapter(connector.TransactionIdGenerator)
            {
                Login         = login,
                Password      = pass,
                Address       = serverAddress.To <EndPoint>(),
                TargetCompId  = "StockSharpMD",
                SenderCompId  = login,
                MarketData    = FixMarketData.MarketData,
                ExchangeBoard = ExchangeBoard.Forts,
                Version       = FixVersions.Fix44
            });

            tsAdapter.InnerAdapters.Add(new FixMessageAdapter(connector.TransactionIdGenerator)
            {
                Login                = login,
                Password             = pass,
                Address              = serverAddress.To <EndPoint>(),
                TargetCompId         = "StockSharpTS",
                SenderCompId         = login,
                MarketData           = FixMarketData.None,
                ExchangeBoard        = ExchangeBoard.Forts,
                Version              = FixVersions.Fix44,
                RequestAllPortfolios = true
            });
        }
예제 #4
0
			public StudioEntityFactory(StudioConnector parent)
			{
				if (parent == null)
					throw new ArgumentNullException("parent");

				_parent = parent;

				_parent.NewSecurities += OnSecurities;
				_parent.SecuritiesChanged += OnSecurities;

				_parent.NewPortfolios += OnPortfolios;
				_parent.PortfoliosChanged += OnPortfolios;

				_parent.NewNews += OnNews;
				_parent.NewsChanged += OnNews;
			}