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

How could I to get volume of previous trades? #57

Open
gEssayas opened this issue Feb 17, 2021 · 2 comments
Open

How could I to get volume of previous trades? #57

gEssayas opened this issue Feb 17, 2021 · 2 comments

Comments

@gEssayas
Copy link

I have tested the APIs it all works fine. Thanks. But could not figure out how to get the volume of previous trades like getChartdata with volume. Same information like Avanza.TRADES but for previous trades. Do know how or if this is available in this project?

@tarentula
Copy link

tarentula commented Apr 8, 2021

Not sure how to use the mobile api for that. I would use the web api instead, so if you post to https://www.avanza.se/ab/component/highstockchart/getchart/orderbook with this body

{
    "orderbookId": 5447,
    "chartType": "CANDLESTICK",
    "widthOfPlotContainer": 558,
    "chartResolution": "MINUTE",
    "navigator": false,
    "percentage": false,
    "volume": true,
    "owners": false,
    "timePeriod": "today",
    "ta": [
        {
            "type": "sma",
            "timeFrame": 50
        }
    ],
    "compareIds": [
        19002
    ]
}

you will get a response including an array of "volumePoints".
Play around with it in Postman and you will soon get a hang of all possible combos in the json.

@JakobWestergarden
Copy link

Not sure how to use the mobile api for that. I would use the web api instead, so if you post to https://www.avanza.se/ab/component/highstockchart/getchart/orderbook with this body

{
    "orderbookId": 5447,
    "chartType": "CANDLESTICK",
    "widthOfPlotContainer": 558,
    "chartResolution": "MINUTE",
    "navigator": false,
    "percentage": false,
    "volume": true,
    "owners": false,
    "timePeriod": "today",
    "ta": [
        {
            "type": "sma",
            "timeFrame": 50
        }
    ],
    "compareIds": [
        19002
    ]
}

you will get a response including an array of "volumePoints".
Play around with it in Postman and you will soon get a hang of all possible combos in the json.

I tried this, but it would always be missing the 15min latest volumePoints. I assume this is due to avanza blocking non customers from accessing the latest 15mins, as seen if looking at any stock in avanza when not logged in. Does the web-api have any way of authenticating to simulate a login, so that we can access all the volume for the day and not miss the last 15 min?

Thanks in advance

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

3 participants