Exemplo n.º 1
0
        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
        }