Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orders does not include the 'Fill Price' #17

Closed
Adam48521 opened this issue Sep 14, 2022 · 1 comment
Closed

Orders does not include the 'Fill Price' #17

Adam48521 opened this issue Sep 14, 2022 · 1 comment

Comments

@Adam48521
Copy link

Hi,

The order extract is missing several details including the fill price, exchange rate and FX Fee. Would it be possible to include these in the dictionary you extract with trading212.get_orders(older_than=older_than, newer_than=newer_than please?

Thanks,
Adam

@HellAmbro
Copy link
Owner

Hi, thanks for the report, I just added the api to do this, you can refer to this example, also added in example.py.

orders = trading212.get_orders(older_than=older_than, newer_than=newer_than)
for o in orders['data']:
        order_details = trading212.get_order_details(o['detailsPath'])
        fx_fee = order_details['sections'][3]['rows'][0]['value']['context']['amount']
        total = order_details['sections'][3]['rows'][1]['value']['context']['amount']
        exchange_rate = order_details['sections'][2]['rows'][4]['value']['context']['quantity']

You can parse the response to get all data that you needs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants