func (stockMoney *StockMoneyFlow) ParseFromStr(stockMoneyFlow string) { infoAry := strings.Split(stockMoneyFlow, "~") if len(infoAry) < 13 { return } stockMoney.SID = infoAry[0] stockMoney.MainFlowIn, _ = common.StrtoFloat64(infoAry[1]) stockMoney.MainFlowOut, _ = common.StrtoFloat64(infoAry[2]) stockMoney.MainFlowInReal, _ = common.StrtoFloat64(infoAry[3]) stockMoney.MainFlowRatio, _ = common.StrtoFloat64(infoAry[4]) stockMoney.RetailFlowIn, _ = common.StrtoFloat64(infoAry[5]) stockMoney.RetailFlowOut, _ = common.StrtoFloat64(infoAry[6]) stockMoney.RetailFlowInReal, _ = common.StrtoFloat64(infoAry[7]) stockMoney.RetailFlowRatio, _ = common.StrtoFloat64(infoAry[8]) stockMoney.MoneyFlowTotal, _ = common.StrtoFloat64(infoAry[9]) stockMoney.Date = infoAry[13] }
func (stock *StockInfo) ParseFromStr(stockInfo string) { infoAry := strings.Split(stockInfo, "~") if len(infoAry) < 48 { return } stock.SID = infoAry[2] stock.SName = infoAry[1] stock.Price, _ = common.StrtoFloat64(infoAry[3]) stock.YPrice, _ = common.StrtoFloat64(infoAry[4]) stock.TBPrice, _ = common.StrtoFloat64(infoAry[5]) stock.DoneCount, _ = common.StrtoInt(infoAry[6]) stock.OutsideCount, _ = common.StrtoInt(infoAry[7]) stock.InsideCount, _ = common.StrtoInt(infoAry[8]) stock.Buy1, _ = common.StrtoFloat64(infoAry[9]) stock.Buy1Count, _ = common.StrtoInt(infoAry[10]) stock.STime = infoAry[30] stock.Changed, _ = common.StrtoFloat64(infoAry[31]) stock.ChangePersent, _ = common.StrtoFloat64(infoAry[32]) stock.Highest, _ = common.StrtoFloat64(infoAry[33]) stock.Lowest, _ = common.StrtoFloat64(infoAry[34]) stock.ExtInfo = infoAry[35] stock.DoneCount1, _ = common.StrtoInt(infoAry[36]) stock.DoneTotal, _ = common.StrtoInt(infoAry[37]) stock.ChangePersent, _ = common.StrtoFloat64(infoAry[38]) stock.PE, _ = common.StrtoFloat64(infoAry[39]) stock.Swing, _ = common.StrtoFloat64(infoAry[43]) stock.CMarketValue, _ = common.StrtoFloat64(infoAry[44]) stock.MarketValue, _ = common.StrtoFloat64(infoAry[45]) stock.PB, _ = common.StrtoFloat64(infoAry[46]) stock.LimitUp, _ = common.StrtoFloat64(infoAry[47]) stock.LimitDown, _ = common.StrtoFloat64(infoAry[48]) }