VinsonGuo / android-kline

Android版K线图和分时图
Apache License 2.0
629 stars 120 forks source link

新增一条数据时,为何删除包含的 #21

Closed feng612266 closed 6 years ago

feng612266 commented 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()));

新增一条数据时,为何删除包含的