Esempio n. 1
0
 /// <summary>
 /// 从文件导入日K线数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void BtnImpKLineClick(object sender, EventArgs e)
 {
     ProgressStatus status = new ProgressStatus();
     this._progressController.Start("从文件导入日K线", status);
     var tm = new MThreadManager<string>(THREAD_COUNT, typeof(ImpKJapaneseWorker), status);
     tm.SetContext("connection-string", this.txtDatabase.Text)
         .AddItem(Directory.GetFiles(this.txtKLineDir.Text))
         .Start();
 }
Esempio n. 2
0
        void BtnFilterStockClick(object sender, EventArgs e)
        {
            Database db = new Database(this.txtDatabase.Text);
            db.Open();
            IList<Stock> stocks = Stock.FindAll(db);
            db.Close();

            string corssStar = "AM-Open-Close=0.006; AM-Min-Max=0.05; AM-Prev=0.015; AM-Matched-Days=0.03; RatioVolReduce=50; Min-Matched-Days=4; Starting-Point=99999; Regression=true";
            IList<StrategyConfig> confList = new List<StrategyConfig>();
            confList.Add(new StrategyConfig("MicroPriceTrendStrategy", corssStar));

            ProgressStatus status = new ProgressStatus();
            this._progressController.Start("执行策略选股...", status);
            var tm = new MThreadManager<Stock>(THREAD_COUNT, typeof(PickingStrategyWorker), status);
            tm.SetContext("connection-string", this.txtDatabase.Text)
                .SetContext("executors", confList)
                .AddItem(stocks)
                .Start();
        }
Esempio n. 3
0
        void BtnKTrendClick(object sender, EventArgs e)
        {
            Database db = new Database(this.txtDatabase.Text);
            db.Open();
            IList<Stock> stocks = Stock.RemoveBlackList(Stock.FindAll(db));
            db.Close();

            ProgressStatus status = new ProgressStatus();
            this._progressController.Start("计算K线趋势", status);
            var tm = new MThreadManager<Stock>(THREAD_COUNT, typeof(CalKTrendWorker), status);
            tm.SetContext("connection-string", this.txtDatabase.Text)
                .AddItem(stocks)
                .Start();
        }
Esempio n. 4
0
        void BtnUpdateShareholdersNumClick(object sender, EventArgs e)
        {
            int startId = 1;
            int.TryParse(this.txtStartStockId.Text, out startId);

            Database db = new Database(this.txtDatabase.Text);
            db.Open();
            IList<Stock> stocks = Stock.FindAll(db);
            db.Close();
            while (startId > 1 && stocks.Count > 0 && stocks[0].StockId < startId){
                stocks.RemoveAt(0);
            }

            ProgressStatus status = new ProgressStatus();
            this._progressController.Start("抓取最新股东数", status);
            var tm = new MThreadManager<Stock>(THREAD_COUNT, typeof(ImpShareHoldersNumWorker), status);
            tm.SetContext("connection-string", this.txtDatabase.Text)
                .AddItem(stocks)
                .Start();
        }
Esempio n. 5
0
        void BtnImpStockExtInfoClick(object sender, EventArgs e)
        {
            Database db = new Database(this.txtDatabase.Text);
            db.Open();
            IList<Stock> stocks = Stock.FindAll(db);
            db.Close();

            ProgressStatus status = new ProgressStatus();
            this._progressController.Start("抓取股票基础信息", status);
            var tm = new MThreadManager<Stock>(THREAD_COUNT, typeof(ImpStockBasInfoWorker), status);
            tm.SetContext("connection-string", this.txtDatabase.Text)
                .AddItem(stocks)
                .Start();
        }