Ejemplo n.º 1
0
        public void TestLogonWithInvalidPassword()
        {
            var config = new JfdExchangeConfiguration()
            {
                Password = "******",
                TradingFixConfiguration = new[]
                {
                    "[DEFAULT]",
                    "ResetOnLogon=Y",
                    "FileStorePath=store",
                    "FileLogPath=log",
                    "ConnectionType=initiator",
                    "ReconnectInterval=60",
                    "BeginString=FIX.4.4",
                    "DataDictionary=FIX44.xml",
                    "HeartBtInt=15",
                    $"SocketConnectHost={TargetIp}",
                    $"SocketConnectPort={TargetPort}",
                    "[SESSION]",
                    $"SenderCompID={OrderSenderCompId}",
                    $"TargetCompID={OrderTargetCompId}",
                    "StartTime=05:00:00",
                    "EndTime=23:00:00"
                }
            };
            var connectorConfig = new FixConnectorConfiguration(config.Password, config.GetTradingFixConfigAsReader());
            var connector       = new IcmTradeSessionConnector(connectorConfig, new TestOutput(new TestOutputHelperWrapper(_output)));

            connector.Start();

            WaitForState(FixConnectorState.Connected, 5);
        }
Ejemplo n.º 2
0
        public IcmTradingSessionConnectorTest(ITestOutputHelper output)
        {
            _output = output;
            var config = new JfdExchangeConfiguration()
            {
                Password = Password,
                TradingFixConfiguration = new[]
                {
                    "[DEFAULT]",
                    "ResetOnLogon=Y",
                    "FileStorePath=store",
                    "FileLogPath=log",
                    "ConnectionType=initiator",
                    "ReconnectInterval=60",
                    "BeginString=FIX.4.4",
                    "DataDictionary=FIX44.xml",
                    "HeartBtInt=15",
                    "SSLEnable=N",
                    "SSLProtocols=Tls",
                    "SSLValidateCertificates=N",
                    $"SocketConnectHost={TargetIp}",
                    $"SocketConnectPort={TargetPort}",
                    "[SESSION]",
                    $"SenderCompID={OrderSenderCompId}",
                    $"TargetCompID={OrderTargetCompId}",
                    "StartTime=05:00:00",
                    "EndTime=23:00:00"
                }
            };
            var connectorConfig = new FixConnectorConfiguration(config.Password, config.GetTradingFixConfigAsReader());

            _connector = new IcmTradeSessionConnector(connectorConfig, new TestOutput(new TestOutputHelperWrapper(_output)));
        }
 public JfdExchange(JfdExchangeConfiguration config, TranslatedSignalsRepository translatedSignalsRepository, JfdOrderBooksHarvester harvester, IHandler <ExecutionReport> executionHandler, ILog log) : base(Name, config, translatedSignalsRepository, log)
 {
     _connector        = new JfdTradeSessionConnector(new FixConnectorConfiguration(config.Password, config.GetTradingFixConfigAsReader()), log);
     _harvester        = harvester;
     _executionHandler = executionHandler;
     _modelConverter   = new JfdModelConverter(config);
     _log = log.CreateComponentScope(nameof(JfdExchange));
     harvester.MaxOrderBookRate = config.MaxOrderBookRate;
 }
Ejemplo n.º 4
0
 public JfdOrderBooksHarvester(
     JfdExchangeConfiguration configuration,
     JfdModelConverter modelConverter,
     ILog log,
     IHandler <OrderBook> orderBookHandler)
     : base(JfdExchange.Name, configuration, new JfdQuotesSessionConnector(GetConnectorConfig(configuration), log),
            log, orderBookHandler)
 {
     _configuration  = configuration;
     _modelConverter = modelConverter;
     HeartBeatPeriod = TimeSpan.FromSeconds(90); // Just in case if QuickFix doesn't detect connection failure.
 }
Ejemplo n.º 5
0
 private static FixConnectorConfiguration GetConnectorConfig(JfdExchangeConfiguration exchangeConfiguration)
 {
     return(new FixConnectorConfiguration(exchangeConfiguration.Password, exchangeConfiguration.GetQuotingFixConfigAsReader()));
 }
 public JfdModelConverter(JfdExchangeConfiguration configuration) : base(configuration.SupportedCurrencySymbols, JfdExchange.Name, configuration.UseSupportedCurrencySymbolsAsFilter)
 {
     _configuration = configuration;
 }