Beispiel #1
0
        static void Main(string[] args)
        {
            Console.Title = "Batch Process Manager Console";
            Console.WriteLine("Run-Time Settings\n");
            Console.WriteLine("enable trading: {0}", ConfigurationManager.AppSettings["enableTrading"]);
            Console.WriteLine("enable RDS: {0}", ConfigurationManager.AppSettings["enableRDS"]);
            Console.WriteLine("enable Twitter: {0}", ConfigurationManager.AppSettings["enableTwitter"]);
            Console.WriteLine("enable Emailing: {0}", ConfigurationManager.AppSettings["enableEmailing"]);
            Console.WriteLine("");
            DateTime startTime = DateTime.Now;

            Console.WriteLine("started at {0}", startTime);
            Cache cache = new Cache();

            BatchProcessManager manager = new BatchProcessManager();

            //1 Adds raw_trades to database
            manager.AddBatch(new MtGoxChartsFetcher(null));

            foreach (GroupBy foo in Enum.GetValues(typeof(GroupBy)))
            {
                //2 groups the data
                manager.AddBatch(new Bucketizer(cache, foo));

                //3 Algorithms
                manager.AddBatch(new TradeCommander(cache, new SimpleStochRSI(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleROC(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleMFI(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleCCI(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleDPO(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleMomentum(foo)));

                manager.AddBatch(new TradeCommander(cache, new SimpleWilliamsR(foo)));
            }


            manager.Start();
            while (true)
            {
                Console.WriteLine("{0}", DateTime.Now - startTime);
                Thread.Sleep(1000 * 60 * 60);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes important variables
        /// </summary>
        public void InitBasics()
        {
            EventManager.AddEventHandler(this, EventType.UIStarted | EventType.FileSwitch | EventType.Command);
            String dataPath = Path.Combine(PathHelper.DataDir, "CodeRefactor");

            if (!Directory.Exists(dataPath))
            {
                Directory.CreateDirectory(dataPath);
            }
            this.settingFilename = Path.Combine(dataPath, "Settings.fdb");
            this.pluginDesc      = TextHelper.GetString("Info.Description");

            BatchProcessManager.AddBatchProcessor(new BatchProcessors.FormatCodeProcessor());
            BatchProcessManager.AddBatchProcessor(new BatchProcessors.OrganizeImportsProcessor());
            BatchProcessManager.AddBatchProcessor(new BatchProcessors.TruncateImportsProcessor());
            BatchProcessManager.AddBatchProcessor(new BatchProcessors.ConsistentEOLProcessor());
        }
Beispiel #3
0
        /// <summary>
        /// Initializes the settings and localization
        /// </summary>
        private void InitializeDefaults()
        {
            this.targetComboBox.FlatStyle    = PluginBase.Settings.ComboBoxFlatStyle;
            this.operationComboBox.FlatStyle = PluginBase.Settings.ComboBoxFlatStyle;
            this.targetComboBox.Items.AddRange(new Object[]
            {
                TextHelper.GetString("Info.OpenFiles"),
                TextHelper.GetString("Info.ProjectSources")
            });
            //Add processors from BatchProcessManager
            var customProcessors = BatchProcessManager.GetAvailableProcessors();

            foreach (var proc in customProcessors)
            {
                this.operationComboBox.Items.Add(new BatchProcessorItem(proc));
            }
            this.Text = " " + TextHelper.GetString("Title.BatchProcessDialog");
            this.targetComboBox.SelectedIndex    = 0;
            this.operationComboBox.SelectedIndex = 0;
            this.processButton.Focus();
        }
Beispiel #4
0
        public void ProcessProject(IProject project)
        {
            var files = BatchProcessManager.GetAllProjectFiles(project);

            Process(files);
        }
Beispiel #5
0
 private void AddEventHandlers()
 {
     BatchProcessManager.AddBatchProcessor(new BatchProcess.LintProcessor());
     EventManager.AddEventHandler(this, EventType.FileOpen | EventType.FileSave | EventType.FileModify | EventType.Command);
 }