Petersoj / alpaca-java

A Java API for Alpaca, the commission free, algo friendly, stock trading broker. https://alpaca.markets
https://petersoj.github.io/alpaca-java/
MIT License
197 stars 82 forks source link

StockBarsResponse.getBars() is always null #134

Closed XavierMB289 closed 1 year ago

XavierMB289 commented 1 year ago
ZonedDateTime start = ZonedDateTime.of(prevDate.getYear(), prevDate.getMonth()+1, prevDate.getDate(), prevDate.getHours(), prevDate.getMinutes(), 0, 0, EST);
ZonedDateTime end = ZonedDateTime.of(date.getYear(), date.getMonth()+1, date.getDate(), date.getHours(), date.getMinutes(), 0, 0, EST);
try {
    StockBarsResponse barsResponse = alpaca.stockMarketData().getBars(
            symbol,
            start,
            end,
            null, null,
            1,
            BarTimePeriod.HOUR,
            BarAdjustment.RAW,
            BarFeed.IEX);

Always returns null. The symbol has even changed and yet it will not return anything else when calling .getBars()

XavierMB289 commented 1 year ago

Go ahead and close it. It's an issue with ZoneId