private void AddList(StockOpeItem[] items, int type, string buyrule, string sellrule) { int tradetimes = 0; double next1 = 0; double next1Rate = 0; if (items.Length == 0) { return; } for (int i = 0; i < items.Length; i++) { tradetimes++; if (items[i].sellprice > items[i].buyprice) { next1++; } next1Rate += (items[i].sellprice - items[i].buyprice) / items[i].buyprice; } object[] strs = new object[12]; //处理得到每一行分析数据 strs[0] = type; strs[1] = buyrule.ToString(); strs[2] = sellrule.ToString(); strs[3] = StockApp.GetBuy(buyrule).defaultSell; strs[4] = tradetimes; strs[5] = Math.Round(next1 / tradetimes, 4).ToString(); strs[6] = Math.Round(next1Rate / tradetimes, 4).ToString(); dg_overview.Rows.Add(strs); }
static void Main(string[] args) { StockApp app = new StockApp(); app.ShowStockHistory("AAPL"); Console.ReadKey(); }
//得到需要分析的股票列表 //2018-03-14 Reviewed private void SyncList() { StockApp.InitStockHeader(); pnl_list.Init(); }