예제 #1
0
 public bool Equals(FullInstrumentConfigDto allConfiguration)
 {
     return(EqualInstrument(allConfiguration.InstrumentConfig, true) &&
            EqualPricer(allConfiguration.PricerConfig, true) &&
            EqualHedger(allConfiguration.HedgerConfig, true) &&
            EqualRiskLimit(allConfiguration.RiskLimitsConfig, true));
 }
예제 #2
0
 public AlgorithmInfo(FullInstrumentConfigDto instrument) : this()
 {
     AlgoId = instrument.InstrumentConfig.AlgoId != null ? (long)instrument.InstrumentConfig.AlgoId : -1;
     InstrumentConfigInfo = instrument.InstrumentConfig;
     PricerConfigInfo     = instrument.PricerConfig;
     HedgerConfigInfo     = instrument.HedgerConfig;
     RiskLimitConfigInfo  = instrument.RiskLimitsConfig;
 }
예제 #3
0
        static void Main(string[] args)
        {
            try
            {
                baseUrl = args.Length > 0 ? args[0] : null;
                if (string.IsNullOrEmpty(baseUrl))
                {
                    Console.WriteLine("String is null or empty");
                    return;
                }
                mmRestService = MarketMakerRestServiceFactory.CreateMakerRestService(baseUrl, "/oauth/token", authorization);
                mmRestService.Authorize("admin", "admin");


                var ws = new SubscriptionFactory("wss://18.218.146.41:8990/websocket/v0", mmRestService.Token);

                // Receive instrument by ID
                _instrument          = mmRestService.GetInstrument(_algoId);
                _originalBuyMargins  = _instrument.PricerConfig.BuyMargins;
                _originalSellMargins = _instrument.PricerConfig.SellMargins;

                var tradeStatisticsSubs = ws.CreateTradingStatisticsSubscription();

                // Subscribe for trade statistics
                tradeStatisticsSubs.Subscribe(OnStatisticsMessage);

                Console.ReadLine();
                tradeStatisticsSubs.Unsubscribe(OnStatisticsMessage);
                ws.Close();
                Console.ReadLine();

                /*
                 * Console.Clear();
                 * var menuItems = GetMenuItems();
                 * var options = GetMenuOptions();
                 * ShowOptions(menuItems, options);
                 * while (true)
                 * {
                 * Console.Write("Select option and press Enter:");
                 * var s = Console.ReadLine();
                 * if (string.IsNullOrWhiteSpace(s))
                 * s = " ";
                 * else
                 * s = s.ToLower();
                 * if (s.Contains("clear") || s.Contains("cls"))
                 * {
                 * Console.Clear();
                 * ShowOptions(menuItems, options);
                 * continue;
                 * }
                 * if (s.Contains("exit") || s.Contains("quit"))
                 * {
                 * return;
                 * }
                 * var option = GetChoice(options, s[0]);
                 * if (option == -1 || option >= menuItems.Length)
                 * {
                 * Console.WriteLine("Incorrect choice.");
                 * Console.WriteLine();
                 * ShowOptions(menuItems, options);
                 * continue;
                 * }
                 * try
                 * {
                 * Console.WriteLine($"('{menuItems[option].Item1}' was selected)");
                 * menuItems[option].Item2();
                 * }
                 * catch (Exception ex)
                 * {
                 * Console.WriteLine(ex.ToString());
                 * }
                 * }
                 */
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
        }