Subscribe to channel `Avanza.POSITIONS` not working?
See original GitHub issueFirst of all, awesome project man 👏
Issue
When trying to subscribe for my own positions, using subscribe
I don’t get any responses.
Does this work for you? If so, could you provide some example code?
This is what my code looks like
// where accountId is something like "5298387"
avanza.subscribe(Avanza.POSITIONS, accountId, (quote) => {
console.log('Received quote:', quote)
})
Other
Also, when I read the documentation for channel Avanza.POSITIONS
:
Data about your own positions. Expects an accountId or a combination of orderbookId_accountId.
I wonder, when are you using accountId
and when are you using orderbookId_accountId
?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Subscribing to ORDERS does not produce updates ... - GitHub
I'm trying to subscribe to ORDERS by specifying a string of account ids ... a list of accountIds and it does not seem...
Read more >WHAT ARE THE DIFFERENT SENSORS OF TOYOTA ...
A car sensor is an intelligent device that monitors the condition of a vehicle and sends information to the user to know when...
Read more >Channel Subscriptions Not Working - Apple Community
I checked my subscription and it's current along with all my other subscribed channels. But any channel I try to watch is giving...
Read more >How to Subscribe - Twitch
This article explains how to support broadcasters through monthly channel subscriptions.
Read more >Subscribe to YouTube channels - Android - Google Support
You can find a Subscribe button under any YouTube video or on a channel's page. ... Troubleshoot a problem with your YouTube subscriptions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! Sorry for the late response, very busy at the moment.
orderbookId
is almost always the ID representing an instrument/stock, but Avanza seems to model orderbooks and instruments as separate entities, and so there is no guarantee that there exists one orderbook for every instrument and vice versa.I agree, it might seem misleading. This module is really only a wrapper around some endpoints I found, which the iPhone app (as well as the Avanza website) uses to retrieve data. Because of this, most endpoints are specifically made for a certain screen. In the
POSITIONS
-case, it is used on the website while you’re placing orders (look at the bottom of the screen).In the same manner, converting this unofficial API into a nice RESTful
getOrder(), addOrder(), ...
type of thing becomes very inefficient. Calls to an endpoint might leave you without the data you expected because that data is not used in the screen which the endpoint was designed for.Hopefully PSD2 makes this module obsolete in 2018! 😃
The
DEALS
-channel should work exactly likePOSITIONS
minus theorderbookId
. Let’s again assume that 123, 456, and 789 are the accountIds for all of my accounts. Hit me up if you’re still not receiving any data and I’ll have a look at it.It’s actually really uncomplicated. Have a look at Charles Proxy.
@fhqvst Hi there,
This subscribe function doesn’t work on the
positions
channel, I tried parameters such as:<stockid>_<accountid1>,<accountid2>
_<accountid1>,<accountid2>
<stockid>_<accountid1>
<accountid1>
<stockid>
And yet doesn’t get anything. so I’m interested, how can I access the protocols and some deeper documentation of the Avanza API? Also, do I do anything wrong here? or it is a real issue? thank you in advance.