Closed zRelux closed 1 year ago
You can get overall return, I suspect you can get pie data too but I don't use pies. I can look into that though
You can get overall return by subscribing to t he "account" event
trading212.on('account', (data) => {
the data object has a property cash which has a property "result", this is the overall profit/loss for the account
trading212.on('account', (data) => {
console.log(data.cash);
});
you also have "cash" which is the current cash value of the account, "free", the free amount, "commission" how much you have paid/lost in commission fees, "free" cash free in the account, "freeForStocks" - free cash minus any cash reserved for buys, 2pieCash" - not sure what this does
Oh nice how do I go on to get like the percentage increase or something like that?
You can get overall return, I suspect you can get pie data too but I don't use pies. I can look into that though
You can get overall return by subscribing to t he "account" event
trading212.on('account', (data) => {
the data object has a property cash which has a property "result", this is the overall profit/loss for the account
trading212.on('account', (data) => { console.log(data.cash); });
you also have "cash" which is the current cash value of the account, "free", the free amount, "commission" how much you have paid/lost in commission fees, "free" cash free in the account, "freeForStocks" - free cash minus any cash reserved for buys, 2pieCash" - not sure what this does
How do you scan the API for all this info? E.g. how did you find out all this info?
Hello I was trying to make an api for trading212 and came across this. Is it possible to get user portfolio data with this? Like pies and overall profits