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

Not all trade updates gets reflected in the algo #2

Open
gowthamnirmalraj opened this issue Dec 20, 2019 · 4 comments
Open

Not all trade updates gets reflected in the algo #2

gowthamnirmalraj opened this issue Dec 20, 2019 · 4 comments

Comments

@gowthamnirmalraj
Copy link

This issue is not particularly related to the example provided. The concern I have is that when I tried to run this code, some trade updates doesn't get reflected to the algo via trade_updates. For example: A trade gets executed, but the trade_update doesn't show up in the feed hence the algo thinks that the trade never took place in the first place and then 2 minutes later, it tries to cancel the trade.

Why does certain trade_updates doesn't show up? Please note that I saw this behavior in my paper account.

@umitanuki
Copy link
Contributor

In older version of python SDK, it was swallowing exceptions happening in the event handler without logging. Can you make sure you are using the latest version?

@gowthamnirmalraj
Copy link
Author

I see the behavior when running the following version:
Python: 3.7
alpaca-trade-api: 0.42

In the algo, I use the following code:
api = alpaca.REST(API_KEY, API_SECRET, APCA_API_BASE_URL, api_version='v2')

Are there any dependencies on the version of python and/or asyncio to be used to capture all trade_updates?

@umitanuki
Copy link
Contributor

0.42 should have the fix to log the exception correctly. Are you doing it on live or paper?

@gowthamnirmalraj
Copy link
Author

gowthamnirmalraj commented Dec 22, 2019

This is on the paper account. Would the version of Python be causing this? I am using v3.7.

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