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

Ask or Bid price gives me unreasonable numbers #91

Closed Mahdi-Roozbahani closed 3 years ago

Mahdi-Roozbahani commented 3 years ago

Hi;

I use MarketDataListener to read the QUOTE for stocks in real-time such as ask or bid price. I realized that either ask or bid gives quite a different price from what is happening in the market. Please take a look at the video I recorded; it shows how suddenly ask or bid price changes. It can create many problems if a user wants to create their strategy based on the real data generated by the stream listeners as it does not reflect the real numbers in the market. For now, I use my paper account as I am testing the library and its classes.

https://www.dropbox.com/s/5c0rckrvy667owq/2021-03-09%2012-49-59.mp4?dl=0

Here is my POM for Alpaca:

        <dependency>
            <groupId>net.jacobpeterson</groupId>
            <artifactId>alpaca-java</artifactId>
            <version>7.0</version>
            <scope>compile</scope>
        </dependency>
Petersoj commented 3 years ago

This is not likely an issue within this library. This is likely due to either Alpaca's data relaying of IEX data or just the fact that IEX isn't super liquid and thus will have high spreads. I just checked the raw realtime stream (you can too using tools such as wscat) for AMZN and the spread is huge on IEX (over $300). Take a look at the different subscription plans here if you want to get wider market coverage from your realtime data feed.