Comments (6)
Hello,
if you need TOTALPORTFOLIO
you need to add it in the request_list
like this :
request_list = Update.RequestList()
request_list.values.extend([
Update.Request(option=Update.Option.TOTALPORTFOLIO, last_updated=0),
])
Right now you are asking for the PORTFOLIO
only : these are two separate things in Degiro`s API.
Hope that helps
from degiro-connector.
Hello,
if you need
TOTALPORTFOLIO
you need to add it in therequest_list
like this :request_list = Update.RequestList() request_list.values.extend([ Update.Request(option=Update.Option.TOTALPORTFOLIO, last_updated=0), ])Right now you are asking for the
PORTFOLIO
only : these are two separate things in Degiro`s API.Hope that helps
same result. KeyError: 'total_portfolio'
from degiro-connector.
Can you send me your new code ?
Thanks
from degiro-connector.
@Chavithra exactly the same but with what you proposed
import json
import logging
import degiro_connector.quotecast.helpers.pb_handler as pb_handler
import pandas as pd
from IPython.display import display
from degiro_connector.trading.api import API as TradingAPI
from degiro_connector.trading.pb.trading_pb2 import (Credentials, Update)
# SETUP LOGGING LEVEL
logging.basicConfig(level=logging.INFO)
# SETUP CONFIG DICT
with open('config/config.json') as config_file:
config_dict = json.load(config_file)
# SETUP CREDENTIALS
username = config_dict['username']
password = config_dict['password']
totp_secret_key = config_dict['totp_secret_key']
credentials = Credentials(
int_account=None,
username=username,
password=password,
totp_secret_key=totp_secret_key
)
# SETUP TRADING API
trading_api = TradingAPI(credentials=credentials)
# CONNECT
trading_api.connect()
# ACCESS SESSION_ID
session_id = trading_api.connection_storage.session_id
# print('You are now connected, with the session id :', session_id)
# SETUP REQUEST
request_list = Update.RequestList()
request_list.values.extend([
Update.Request(option=Update.Option.TOTALPORTFOLIO, last_updated=0),
])
update = trading_api.get_update(request_list=request_list)
update_dict = pb_handler.message_to_dict(message=update)
total_portfolio_df = pd.DataFrame(update_dict['total_portfolio']['values'])```
from degiro-connector.
Ok, I think I have found a second blocking point :
int_account
needs to be set
I have tested your last code by adding int_account
and it worked.
You can fetch it using this code :
client_details_table = trading_api.get_client_details()
More information about int_account
is available in the README
.
An example of TOTALPORTFOLIO
fetching with the int_account
setup is available in this file :
examples/trading/update.py
from degiro-connector.
Closing this issue since there is no more feedback.
Feel free to open a new issue if you still have questions.
from degiro-connector.
Related Issues (20)
- OptionsSearch not providing all products HOT 1
- Search for underlyings HOT 2
- Quotecast API connect fails HOT 1
- get_update() Error 403 HOT 1
- orjson dependency missing HOT 2
- URL of favorites list has changed HOT 2
- Extend LeveragedsRequest class HOT 2
- mamba/conda installation of degiro_connector HOT 4
- Unwanted console output HOT 1
- Valid search but without products found trading.actions.action_product_search HOT 1
- TickerToDF.parse() problem when parsing ticker of vwd_id '61316189' HOT 4
- dividend calender: aditional filter request parameter HOT 5
- `get_account_overview` doesn't return the proper information. HOT 2
- Response status code 412 'joinAccountPersonNeeded' HOT 1
- Unable to place an order HOT 3
- Validation errors for TransactionsHistory: data.75.feeInBaseCurrency, data.75.orderTypeId, ... HOT 1
- update.py not working HOT 3
- map_elements function without return_dtype in ticker_to_df HOT 2
- Not an Issue - just remark on class HOT 1
- how to check that ChartRequest will create an URL which is too long for Degiro? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from degiro-connector.