Comments (10)
I found the error! DeGiro doesn't keep an updated margin, also happens on the web. Sometimes you will make an operation, but the margin will take a while to update. Did you know about the issue and any workaround?
from degiro-connector.
Hi,
I think you are referring to the session timeout
, there is a limit of time a session is valid when unused.
Here are the sections related to session timeout
in the documentation :
- https://github.com/Chavithra/degiro-connector#25-is-there-a-timeout-
- https://github.com/Chavithra/degiro-connector#38-is-there-a-timeout-
Is that what you are looking for ?
from degiro-connector.
I am referring to that the problem only happens with Orders, not Update's. I don't know why, I will try to debug. The final exception is
NoneType' object has no attribute 'confirmation_id'.
It then shouldn't have relation with timeouts
from degiro-connector.
Issue
Can you describe how to reproduce this issue ?
Code
Is it possible to show the code which fails ?
from degiro-connector.
Sorry for the late reply. I can confirm it is still failing:
order = Order(
action=actionType,
order_type=orderType,
price=lastPrice,
product_id=productId,
size=shares,
time_type=Order.TimeType.GOOD_TILL_DAY,)
checking_response = self.trading_api.check_order(order=order)
time.sleep(0.7)
try:
confirmation_id = checking_response.confirmation_id
free_space_new = checking_response.free_space_new
response_datetime = checking_response.response_datetime
transaction_fees = checking_response.transaction_fees
transaction_opposite_fees = checking_response.transaction_opposite_fees
transaction_taxes = checking_response.transaction_taxes
logging.debug(f"DEGIRO_{actionType}_CHECK_RESPONSE confirmation_id {confirmation_id} free_space_new {free_space_new} response_datetime {response_datetime} transaction_fees {transaction_fees} transaction_opposite_fees {transaction_opposite_fees} transaction_taxes {transaction_taxes}")
confirmation_response = self.trading_api.confirm_order(
confirmation_id=confirmation_id, order=order
)
logging.debug(f"DEGIRO_{actionType}_RESPONSE confirmation_response {confirmation_response} checking_response {checking_response}")
except Exception as e:
The exception e contains:
'NoneType' has no attribute 'confirmationId
And right before an exception is caught in action_check_order:134
try:
response_raw = session.send(prepped, verify=False)
response_raw.raise_for_status()
response_dict = response_raw.json()
except Exception as e:
Exception e:
400 Client Error: Bad Request for url: https://trader.degiro.nl/trading/secure/v5/checkOrder;jsessionid=D1AA41FB58C704CXXXXXXXXX.prod_a_XXX_X?intAccount=XXXXXXXX&sessionId=D1AA41FB58C704CXXXXXX.prod_a_XXX_X
Other API calls still seem to work properly (such as fetching portfolio). And the problem seems to happen after some hours of the API running, but still can't tell.
from degiro-connector.
Questions
1/ So the call to check_order
method failed ?
2/ Is it failing at every single call of check_order
? randomly ? or after a certain duration ?
Looks like Degiro's website is being updated these days, that might be related.
from degiro-connector.
How did you find out about the margin ?
from degiro-connector.
Making operations and checking the website margin showed. If lucky it will refresh in a couple of seconds, but there are times that it take up to 20 minutes to refresh. Degiro's website actually provides the date of the margin calculation.
Using the margin to calculate ops (let say you want to use 10% of the available margin) can lead to failures as it's incorrect data.
from degiro-connector.
The website doesn't seem to use any API call to calculate this margin
.
I am interested in knowing more on that margin
.
Feel free to join me on Discord if you want to see that together.
Thanks
from degiro-connector.
I will eventually have to deal with that margin, so expect me on Discord. Thank you again.
from degiro-connector.
Related Issues (20)
- Retrieve Portfolio content from the past HOT 5
- EstimatesSummaries error HOT 3
- Order only succeeds when logged in once via browser HOT 18
- Documentation example at section 6.6 now working HOT 2
- Favourite list management HOT 3
- Error on quotecast_api.logout() HOT 2
- New DDoS protection on DeGiro blocking this library? HOT 4
- unable to login HOT 2
- Historical intraday data HOT 1
- Running into issue with totp_secret_key HOT 2
- Getting None on TransactionsHistory and AccountOverview after weekend update HOT 1
- Automated Tools to be disallowed from October 1st? HOT 5
- Quotecast API freezes after exactly 1 hour since August 30, 2022 HOT 2
- "Get Portfolio" does not returns the tickers names HOT 1
- Access to Order Book HOT 2
- Closing price end of day
- Protobuffer generated code out of date HOT 3
- Portfolio values not up to date
- Account blocked due to too many login attempts HOT 1
- Real-time data fetch issue
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.