yccheok / jstock

JStock is a free stock market software for 28 countries.
https://jstock.org
663 stars 347 forks source link

Incorrectly calculated lastPrice in candlestick charts on weekly and monthly base #175

Open magellan86 opened 2 years ago

magellan86 commented 2 years ago

Candlestick charts on weekly and monthly base seem to show the wrong final price. Quick analysis found that the price is calculated as average: org.yccheok.jstock.charting.Utils.getWeeklyChartData and getMonthlyChartData generate the lastPrice as average: lastPrice / count, // Average last price.

AFAIK this makes no sense. It should be the last price before the change of week / month.