You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just tried to use Java API to get AAPL daily bars, but it seems to return the wrong data that is different from Alpaca python API, which returns the correct data. Wonder if it's a bug or a wrong use of API. I put the java code's output in section 2), and I also put python code's output in section 3). You can see most of close, high, low and volume data don't match. But I double checked the output from python code, which seems to be aligned with Yahoo, Tradeview data, but the data obtained from Alpaca Java API, always seems to be off a bit. Thanks for your help in advance.
Hello,
I just tried to use Java API to get AAPL daily bars, but it seems to return the wrong data that is different from Alpaca python API, which returns the correct data. Wonder if it's a bug or a wrong use of API. I put the java code's output in section 2), and I also put python code's output in section 3). You can see most of close, high, low and volume data don't match. But I double checked the output from python code, which seems to be aligned with Yahoo, Tradeview data, but the data obtained from Alpaca Java API, always seems to be off a bit. Thanks for your help in advance.
Here is the code
Here is the response of the last 10 bars
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@54c5a2ff[timestamp=2023-11-08T05:00Z,open=182.29,high=183.435,low=181.62,close=182.89,tradeCount=9599,vwap=182.625857,volume=862999]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@6d4d66d2[timestamp=2023-11-09T05:00Z,open=182.93,high=184.07,low=181.82,close=182.48,tradeCount=9572,vwap=182.900363,volume=906460]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@2a265ea9[timestamp=2023-11-10T05:00Z,open=183.92,high=186.555,low=183.58,close=186.335,tradeCount=16304,vwap=185.137374,volume=1769685]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@11392934[timestamp=2023-11-13T05:00Z,open=185.83,high=186.015,low=184.24,close=184.76,tradeCount=9956,vwap=184.782387,volume=899630]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@6892b3b6[timestamp=2023-11-14T05:00Z,open=187.63,high=188.1,low=186.34,close=187.41,tradeCount=13996,vwap=187.288773,volume=1413535]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@6e6f2380[timestamp=2023-11-15T05:00Z,open=187.99,high=189.49,low=187.785,close=188.15,tradeCount=9738,vwap=188.517042,volume=816730]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@76a4ebf2[timestamp=2023-11-16T05:00Z,open=189.59,high=190.945,low=188.735,close=189.8,tradeCount=12849,vwap=189.691769,volume=1032052]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@2e8c1c9b[timestamp=2023-11-17T05:00Z,open=190.255,high=190.35,low=188.58,close=189.75,tradeCount=7781,vwap=189.578897,volume=591204]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@53fe15ff[timestamp=2023-11-20T05:00Z,open=189.995,high=191.9,low=189.94,close=191.52,tradeCount=8736,vwap=191.30822,volume=716956]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@449a4f23[timestamp=2023-11-21T05:00Z,open=191.485,high=191.485,low=189.75,close=190.66,tradeCount=7083,vwap=190.474958,volume=671770]
net.jacobpeterson.alpaca.model.endpoint.marketdata.stock.historical.bar.StockBar@1530c739[timestamp=2023-11-22T05:00Z,open=191.58,high=192.93,low=190.84,close=191.31,tradeCount=7212,vwap=191.79077,volume=706624]
timestamp close high low trade_count open volume vwap
2023-11-08 05:00:00+00:00 182.890 183.4500 181.5900 542542 182.350 49345307 182.656617
2023-11-09 05:00:00+00:00 182.410 184.1200 181.8100 545850 182.960 53780415 182.911582
2023-11-10 05:00:00+00:00 186.400 186.5650 183.5300 610940 183.970 66204156 185.410765
2023-11-13 05:00:00+00:00 184.800 186.0300 184.2100 530523 185.820 43631574 184.831737
2023-11-14 05:00:00+00:00 187.440 188.1100 186.3000 609334 187.700 60113030 187.203828
2023-11-15 05:00:00+00:00 188.010 189.5000 187.7800 564663 187.845 53818016 188.420726
2023-11-16 05:00:00+00:00 189.710 190.9600 188.6500 621003 189.570 54426521 189.710967
2023-11-17 05:00:00+00:00 189.690 190.3800 188.5700 509736 190.250 50929177 189.600596
2023-11-20 05:00:00+00:00 191.450 191.9050 189.8800 554091 189.890 46543084 191.298471
2023-11-21 05:00:00+00:00 190.640 191.5200 189.7400 450941 191.410 38142232 190.510023
2023-11-22 05:00:00+00:00 191.310 192.9300 190.8250 463217 191.490 39620045 191.722436
The text was updated successfully, but these errors were encountered: