static void Main(string[] args) { // Establish an event handler to process CTRL-C Console.CancelKeyPress += new ConsoleCancelEventHandler(myHandler); ServicePointManager.DefaultConnectionLimit = 200; Console.WriteLine("DefaultConnectionLimit:" + ServicePointManager.DefaultConnectionLimit); BinanceClient bClient = new BinanceClient(); bClient.UpdateExchangeInfo(); if (!BinanceSpot.settings.KeysSet) { Logger.ConsoleOut("API keys are not set! Please set the keys in the Config.txt"); } while (!Terminated) { Thread.Sleep(1000); bClient.UpdatePrices(); if (BinanceSpot.CheckUsedWeight()) { bClient.TestSequence(); } Console.Write("\r Working ... Orders: {0} UsedWeight: {1}" + " ", algo.workersCount, BinanceSpot.used_weight); algo.checkState(); } Console.WriteLine("\nWaiting workers...."); algo.waitWorkers(); }
public void checkState() { if ((workersCount == 0) & BinanceSpot.settings.KeysSet & BinanceSpot.CheckUsedWeight()) { newIteration(); } }