private void updateTrend(TrendBar bar, Quote quote) {
        double quotePrice = quote.getPrice();
        if (bar.getTimestamp() < 0) {
            bar.setOpenPrice(quotePrice);
            bar.setTimestamp(1);
        } else {
            bar.setClosePrice(quotePrice);
        }
        if (quotePrice < bar.getLowPrice()) {
            bar.setLowPrice(quotePrice);
        }
        if (quotePrice > bar.getHighPrice()) {
            bar.setHighPrice(quotePrice);
        }
    }