Closed feng612266 closed 6 years ago
if (mData.contains(hisData)) { int index = mData.indexOf(hisData); klineSet.removeEntry(index); padding.removeFirst(); // ma比较特殊,entry数量和k线的不一致,移除最后一个 ma5Set.removeLast(); ma10Set.removeLast(); ma20Set.removeLast(); ma30Set.removeLast(); volSet.removeEntry(index); macdSet.removeEntry(index); difSet.removeEntry(index); deaSet.removeEntry(index); kSet.removeEntry(index); dSet.removeEntry(index); jSet.removeEntry(index); mData.remove(index); } mData.add(hisData); mChartPrice.setRealCount(mData.size()); int klineCount = klineSet.getEntryCount(); klineSet.addEntry(new CandleEntry(klineCount, (float) hisData.getHigh(), (float) hisData.getLow(), (float) hisData.getOpen(), (float) hisData.getClose())); volSet.addEntry(new BarEntry(volSet.getEntryCount(), hisData.getVol(), hisData));
macdSet.addEntry(new BarEntry(macdSet.getEntryCount(), (float) hisData.getMacd()));
新增一条数据时,为何删除包含的
if (mData.contains(hisData)) { int index = mData.indexOf(hisData); klineSet.removeEntry(index); padding.removeFirst(); // ma比较特殊,entry数量和k线的不一致,移除最后一个 ma5Set.removeLast(); ma10Set.removeLast(); ma20Set.removeLast(); ma30Set.removeLast(); volSet.removeEntry(index); macdSet.removeEntry(index); difSet.removeEntry(index); deaSet.removeEntry(index); kSet.removeEntry(index); dSet.removeEntry(index); jSet.removeEntry(index); mData.remove(index); } mData.add(hisData); mChartPrice.setRealCount(mData.size()); int klineCount = klineSet.getEntryCount(); klineSet.addEntry(new CandleEntry(klineCount, (float) hisData.getHigh(), (float) hisData.getLow(), (float) hisData.getOpen(), (float) hisData.getClose())); volSet.addEntry(new BarEntry(volSet.getEntryCount(), hisData.getVol(), hisData));
新增一条数据时,为何删除包含的