public TrendBar(long startTime, float openPrice, float closePrice, float highPrice, float lowPrice) {
        if (startTime < 0) {
            throw new IllegalArgumentException("startTime should be non negative");
        }
        if (openPrice < 0) {
            throw new IllegalArgumentException("openPrice should be non negative");
        }
        if (closePrice < 0) {
            throw new IllegalArgumentException("closePrice should be non negative");
        }
        if (highPrice < 0) {
            throw new IllegalArgumentException("highPrice should be non negative");
        }
        if (lowPrice < 0) {
            throw new IllegalArgumentException("lowPrice should be non negative");
        }
        this.startTime = startTime;
        this.openPrice = openPrice;
        this.closePrice = closePrice;
        this.highPrice = highPrice;
        this.lowPrice = lowPrice;
    }