Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get lastPrice from market maker? #70

Open
tommiehansen opened this issue Oct 10, 2021 · 2 comments
Open

Get lastPrice from market maker? #70

tommiehansen opened this issue Oct 10, 2021 · 2 comments

Comments

@tommiehansen
Copy link

A current problem both with Avanza's usual site and accounts and with this API is that it isn't that easy to get the last price (not last trade, there is a difference) from instruments that have a market maker.

This is especially true if its an instrument that is traded less frequently like some index futures.

eg:

MINI L DAX 363
lastPrice: 14.9

...but last price, as of writing this, from MM (Market Maker) is 17.07:
image

Any way of getting the so called marketMakerBidPoints ?

@ausrasul
Copy link
Contributor

The most reliable way of getting it is by looking at the volume.
The market maker has a fixed volume which is way higher than anyone in the order depth.
So it usually lays in the top of the order depth, but not necessarily.

You can make a rule to look at the order depth from top to bottom and take the first price that is higher than a set volume like 7000 (depends on the finance level).

Here is a complete message from channel "order depths"
There you'll find marketMakerLevelAsk and bid, I think it means which level is the market maker's bid.
But what do you care if there is someone with more volume and better price? hence my decision to look for volume and price instead of MM level.

image

@tommiehansen
Copy link
Author

Wouldn't the most reliable way to get it to look at the chart data since that does have the data i'm after?

There is an endpoint for it eg:
https://www.avanza.se/_mobile/chart/orderbook/1186214?timePeriod=one_month

However that endpoint does not work since it doesn't actually return the chart data but instead returns trades and not the chart data (mm bidpoints) like on the site and on the mobile app.

The endpoint for the regular chart data is:
https://www.avanza.se/ab/component/highstockchart/getchart/orderbook

..but uses POST instead of a GET.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants