question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhance fetchOrder/cancelOrder handling

See original GitHub issue

Usually for fetchOrder/cancelOrder there is only the orderID needed, but sometimes there is also the symbol and/or the side needed to cancel/fetch the order. It is easy to provide the symbol, since there is an extra parameter in the function call and the symbol is ignored if not needed. The side parameter is more annoying, because passing params={'side': 'sell'} can break other exchanges, because they will include this and the exchange does not want this. so there is a check needed, which exchanges need the side and which dont.

An easy solution for this would be to have an api like this:

order = exchange.createOrder(...)
order = exchange.fetchOrder(order)
exchange.cancelOrder(order)

Create Order would always add properties needed for a fetch/cancel and the specific exchange methods could then pick the properties needed. I know, that this would break every code out there and people using databases to safe orderIDs and use them later would need to change a lot of code.

So probably a solution like an additional function: fetchOrderFromOrder / cancelOrderFromOrder. They would just call fetchOrder/cancelOrder with the needed parameters. These could be implemented in the base classes and only overwritten in the specific exchange classes if needed.

Any ideas on that?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
brandsimoncommented, Apr 23, 2020

@kroitor Great, I will create a pull request later today.

1reaction
kroitorcommented, Apr 23, 2020

@brandsimon yep, that makes sense, I would agree with the above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[PDF] Enhanced exception handling in sales order processing ...
It was concluded that exception handling may provide a unifying focus on the dynamic behaviour of workflow systems and should be the focus...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found