Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            if (args.Length != 5)
            {
                Console.WriteLine("Usage MarketDataClient <url> <username> <password> [CFD_DEMO|CFD_LIVE] instrumentId");
                Environment.Exit(-1);
            }

            String      url         = args[0];
            String      username    = args[1];
            String      password    = args[2];
            ProductType productType = (ProductType)Enum.Parse(typeof(ProductType), args[3]);

            do
            {
                Console.WriteLine("Attempting to login to: {0} as {1}", url, username);

                LmaxApi lmaxApi = new LmaxApi(url);

                MarketDataClient marketDataClient = new MarketDataClient(new long[] { Convert.ToInt64(args[4]) });

                lmaxApi.Login(new LoginRequest(username, password, productType), marketDataClient.OnLoginSuccess,
                              failureResponse => Console.WriteLine("Failed to log in"));

                Console.WriteLine("Logged out, pausing for 10s before retrying");
                Thread.Sleep(10000);
            }while (true);
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            LoginClient loginClient = new LoginClient(4001);
            if (args.Length != 4)
            {
                Console.WriteLine("Usage " + loginClient.GetType().Name + " <url> <username> <password> [CFD_DEMO|CFD_LIVE]");
                Environment.Exit(-1);
            }

            String url = args[0];
            String username = args[1];
            String password = args[2];
            ProductType productType = (ProductType)Enum.Parse(typeof(ProductType), args[3].ToUpper());

            LmaxApi lmaxApi = new LmaxApi(url);
            lmaxApi.Login(new LoginRequest(username, password, productType), loginClient.LoginCallback, FailureCallback("log in"));
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            HeartbeatClient loginClient = new HeartbeatClient();

            if (args.Length != 4)
            {
                Console.WriteLine("Usage " + loginClient.GetType().Name + " <url> <username> <password> [CFD_DEMO|CFD_LIVE]");
                Environment.Exit(-1);
            }

            String      url         = args[0];
            String      username    = args[1];
            String      password    = args[2];
            ProductType productType = (ProductType)Enum.Parse(typeof(ProductType), args[3].ToUpper());

            LmaxApi lmaxApi = new LmaxApi(url);

            lmaxApi.Login(new LoginRequest(username, password, productType), loginClient.OnLoginSuccess, FailureCallback("log in"));
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            TradeInsideTheSpreadBot loginClient = new TradeInsideTheSpreadBot(4012, 0.00001m);

            if (args.Length != 4)
            {
                Console.WriteLine("Usage: " + loginClient.GetType() + " <url> <username> <password> [CFD_DEMO|CFD_LIVE]");
                Environment.Exit(-1);
            }

            string      url         = args[0];
            string      username    = args[1];
            string      password    = args[2];
            ProductType productType = (ProductType)Enum.Parse(typeof(ProductType), args[3].ToUpper());

            LmaxApi lmaxApi = new LmaxApi(url);

            lmaxApi.Login(new LoginRequest(username, password, productType), loginClient.LoginCallback,
                          FailureCallback("log in"));
        }
        public static void Main(string[] args)
        {
            var loginClient = new HistoricMarketDataRequester();
            if (args.Length != 4)
            {
                Console.WriteLine("Usage " + loginClient.GetType().Name +
                                  " <url> <username> <password> [CFD_DEMO|CFD_LIVE]");
                Environment.Exit(-1);
            }

            var url = args[0];
            var username = args[1];
            var password = args[2];
            var productType = (ProductType) Enum.Parse(typeof (ProductType), args[3].ToUpper());

            var lmaxApi = new LmaxApi(url);

            lmaxApi.Login(new LoginRequest(username, password, productType), loginClient.OnLoginSuccess,
                          FailureCallback("log in"));
        }
        public static void Main(string[] args)
        {
            if (args.Length != 5)
            {
                Console.WriteLine("Usage MarketDataClient <url> <username> <password> [CFD_DEMO|CFD_LIVE] instrumentId");
                Environment.Exit(-1);
            }

            String url = args[0];
            String username = args[1];
            String password = args[2];
            ProductType productType = (ProductType)Enum.Parse(typeof(ProductType), args[3]);

            do
            {
                Console.WriteLine("Attempting to login to: {0} as {1}", url, username);

                LmaxApi lmaxApi = new LmaxApi(url);

                MarketDataClient marketDataClient = new MarketDataClient(new long[] { Convert.ToInt64(args[4]) });

                lmaxApi.Login(new LoginRequest(username, password, productType), marketDataClient.OnLoginSuccess,
                    failureResponse => Console.WriteLine("Failed to log in"));

                Console.WriteLine("Logged out, pausing for 10s before retrying");
                Thread.Sleep(10000);
            }
            while (true);
            
        }
Exemplo n.º 7
0
 public LmaxApi(string urlBase, string clientIdentifier)
     : this(urlBase, (IHttpInvoker) new HttpInvoker(LmaxApi.TruncateClientId(clientIdentifier)), (IXmlParser) new SaxParser())
 {
 }