/// <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(); }
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(); }
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(); }
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(); }
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(); }