Git Product home page Git Product logo

Comments (10)

VVIERV00 avatar VVIERV00 commented on July 28, 2024 1

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.

Chavithra avatar Chavithra commented on July 28, 2024

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 :

Is that what you are looking for ?

from degiro-connector.

VVIERV00 avatar VVIERV00 commented on July 28, 2024

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.

Chavithra avatar Chavithra commented on July 28, 2024

Issue
Can you describe how to reproduce this issue ?

Code
Is it possible to show the code which fails ?

from degiro-connector.

VVIERV00 avatar VVIERV00 commented on July 28, 2024

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.

Chavithra avatar Chavithra commented on July 28, 2024

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.

Chavithra avatar Chavithra commented on July 28, 2024

How did you find out about the margin ?

from degiro-connector.

VVIERV00 avatar VVIERV00 commented on July 28, 2024

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.

Chavithra avatar Chavithra commented on July 28, 2024

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.

VVIERV00 avatar VVIERV00 commented on July 28, 2024

I will eventually have to deal with that margin, so expect me on Discord. Thank you again.

from degiro-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.