static void Main(string[] args) { XmlConfigurator.Configure(new FileInfo("log4net.config")); ILog logger = LogManager.GetLogger("program"); logger.Info("---------------------- begin --------------------------------"); // 初始化 CoinUtils.Init(); var symbols = CoinUtils.GetAllCommonSymbols(); // 初始化kline KlineUtils.Begin(); // 不停的对每个币做操作 BuyOrSellUtils.Begin(); // 状态检查 TradeStateUtils.Begin(); while (true) { Console.ReadLine(); } }
static void Main(string[] args) { // 注册日志 XmlConfigurator.Configure(new FileInfo("log4net.config")); // 启用监听 StartOptions options = new StartOptions(); options.Urls.Add("http://localhost:6666"); options.Urls.Add("http://127.0.0.1:6666"); options.Urls.Add(string.Format("http://{0}:6666", Environment.MachineName)); options.Urls.Add("http://+:6666"); options.Urls.Add("http://localhost:80"); options.Urls.Add("http://127.0.0.1:80"); options.Urls.Add(string.Format("http://{0}:80", Environment.MachineName)); options.Urls.Add("http://+:80"); WebApp.Start <Startup>(options); CoinUtils.Init(); // 状态检查 TradeStateUtils.Begin(); while (true) { Console.ReadLine(); } }
static void Main(string[] args) { // 注册日志 XmlConfigurator.Configure(new FileInfo("log4net.config")); logger.Info("-----------------------Main---------------------------"); CoinUtils.Init(); var client = new RestClient("http://118.31.44.235/api/Control/listAll"); RestRequest req = new RestRequest(Method.GET); req.AddHeader("content-type", "application/json"); req.AddHeader("cache-type", "no-cache"); var response = client.ExecuteTaskAsync(req).Result; var controlList = JsonConvert.DeserializeObject <List <DogControl> >(response.Content); var commonSymbols = new List <CommonSymbol>(); foreach (var control in controlList) { commonSymbols.Add(new CommonSymbol { BaseCurrency = control.SymbolName, QuoteCurrency = control.QuoteCurrency }); } // 开始 RunCoin(commonSymbols); Console.ReadLine(); }
private static void BeginTrade() { // 初始化 CoinUtils.Init(); UserPools.Push("xx"); UserPools.Push("qq"); DogControlUtils.InitAsync(); // 不停的对每个币做操作 BeginTradeAllSymbol(); // 状态检查 TradeStateUtils.Begin(); }
private static void BeginTrade() { // 初始化 CoinUtils.Init(); UserPools.Push("xx"); UserPools.Push("qq"); // 初始化k线 //KlineUtils.Begin(); // 不停的对每个币做操作 BuyOrSellUtils.Begin(); // 状态检查 TradeStateUtils.Begin(); }