/// <summary> /// Export data for genotick training /// </summary> /// <param name="pair">Pair.</param> /// <param name="dtstart">Dtstart.</param> /// <param name="dtstop">Dtstop.</param> /// <param name="period">Period.</param> /// <param name="ExportPath">Export path.</param> private static void ExportData(Pair pair, DateTime dtstart, DateTime dtstop, Period period, String ExportPath) { PoloniexWrapper pw = new PoloniexWrapper(); var chart = pw.GetChartData(pair, dtstart, dtstop, period); //write the file InputData.WriteToCSVFile(chart, ExportPath); }
static void runtime() { PoloniexWrapper pw1 = new PoloniexWrapper(); Trading.TradingEnvironment te = new Trading.TradingEnvironment(pw1); te.Buy(); Console.WriteLine("ca marche"); Console.ReadLine(); return; //load config file String sconfigfilePath = Path.Combine(ConfigurationManager.AppSettings["genotick_Path"] , ConfigurationManager.AppSettings["genotick_configfileName"]); if (!File.Exists(sconfigfilePath)) { Console.WriteLine("Config File not found please update genitock config file"); return; } //if we are already up to date do nothing if (GenotickConfig.NextEndingPoint > DateTime.UtcNow) { return; } //backup data InputData.BackupData(); IBroker pw = new PoloniexWrapper(); foreach (Pair pair in GenotickConfig.CurrenciesDataFileName) { //getting the last data //for moment assume that all csv have the same date //retrieve missing candle var chart = pw.GetChartData(pair, GenotickConfig.StartingPoint, DateTime.MaxValue, GenotickConfig.PoloniexPeriod); InputData.AppendChartDataFile(chart); } //reverse data GenotickExec.ReverseData(); //update genotick config file GenotickConfig.SaveConfig(); //call genotick to analyze Console.WriteLine(GenotickExec.SetPrediction()); Console.ReadLine(); //positionner les ordres sur le marché //positionner une limite //cloture la position au bout de 5 minutes }