public void OnTickAction(TickReport atick) { DataInfo ldatainfo = getDataInfo(atick.abbrname); //logger.Info("push data into dataInfo..." + atick.abbrname + "..." + ldatainfo.getAbbrname()); ldatainfo.push(atick); }
public void push(TickReport aTick) { int intTime = Convert.ToInt32(aTick.time); if (time.Count == 0) { time.Add(intTime); trade.Add(aTick.trade); oi.Add(Convert.ToInt32(aTick.oi)); volume.Add(Convert.ToInt32(aTick.volume)); } else { int ltime = time.Last(); int lastIdx = time.Count - 1; //logger.Info("data in " + ltime.ToString()); if (intTime == ltime) { trade[lastIdx] = aTick.trade; oi[lastIdx] = Convert.ToInt32(aTick.oi); volume[lastIdx] = volume[lastIdx] + Convert.ToInt32(aTick.volume); } else { time.Add(intTime); trade.Add(aTick.trade); oi.Add(Convert.ToInt32(aTick.oi)); volume.Add(Convert.ToInt32(aTick.volume)); } } }
private void OnData(string strSymbol, int nStatus, int nCount) { string lsymbol = qc.SymbolGetStringData(strSymbol, -1, 0); string labbrname = utility.getAbbrnameFromICEID(lsymbol); double ltime = qc.SymbolGetValueData(strSymbol, -1, 2); double ltrade = qc.SymbolGetValueData(strSymbol, -1, 3) / 1000000; double lvolume = qc.SymbolGetValueData(strSymbol, -1, 6); double lbid = qc.SymbolGetValueData(strSymbol, -1, 30) / 1000000; double lask = qc.SymbolGetValueData(strSymbol, -1, 50) / 1000000; double loi = qc.SymbolGetValueData(strSymbol, -1, 91); if (lvolume < 0) { return; } if (ltrade < 0) { return; } TickReport atick = new TickReport(labbrname, ltime, ltrade, lvolume, lbid, lask, loi); logger.Info(atick.info()); onTick(atick); }
private void OnTick(TickReport aTick) { if (!activate) { return; } // order entry condition monitor }