klinecharts / KLineChart

📈Lightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.(可高度自定义的轻量级k线图,无第三方依赖,支持移动端)
https://klinecharts.com/
Apache License 2.0
2.46k stars 621 forks source link

updateData cause full recalculation of technical indicators #203

Open ovresko opened 2 years ago

ovresko commented 2 years ago
liihuu commented 2 years ago

The calculation of most technical indicators requires some intermediate values that have been calculated before, and this part is difficult.

kimboox44 commented 2 years ago

exactly, since most TA requires known timeperiod, why not create (update shape) when updateData is used get X last TA values and instead of calcTechnicalIndicator: (kLineDataList: any[], { params, plots }) where kLineDataList is full timeseries calcTechnicalIndicator: (kLinePeriodDataList: any[], { params, plots }) where kLinePeriodDataList is X last timeseries