Download executions bug

Thought initially it was because I was in 2.4.0, but migrated to 2.4.1 and got the same errors.

quantrocket.pnl.download_executions in docs here not working.

quantrocket.blotter.download_executions here not working either.
image

download_executions queries your account db to get your base currency, then queries the exchange rates for your base currencies. The error message indicates that one of the base currencies is Nan, and obviously there’s no exchange rate for Nan. The Currency column in the account database has a NOT NULL constraint, so I'm not actually sure how you can have a Nan base currency. I would suggest poking around in /var/lib/quantrocket/quantrocket.v2.account.balance.sqlite and see if there's a NULL currency somewhere.

We will fix the documentation error referencing quantrocket.pnl.

I'm wondering if it's having to do with Alpaca changing clearing brokers within the last week. This is the same account listed twice under the old and new accountID's at Alpaca. I'm wondering if this is also how the leverage issue happened on the other ticket. The bottom, with 23,003.00 is accurate.

I'll plan to re-establish credentials and reconfigure quantrocket.moonshot.allocations to reflect the newest accountID.

I am thinking the query between the old accountID and new ID is causing the download executions error. I don't want to lose the old execution trails under the old accountID's.




Note: It does run fine if I query a specific account not affected by account name changing.

Update:
countdown threw this error when trying newID although the sanity check works. Oddly enough in the error message the newID is listed as valid after stating its invalid. NewID is 9xxxxx8 & old is 0xxxxxU.


The errors you posted since my previous comment are the result of Alpaca switching clearing firms. All account numbers were previously alphanumeric but now are numeric-only. Some parts of QuantRocket are treating the new account numbers as strings and other parts are treating them as integers, which is causing problems.

A fix for this will be included in the upcoming 2.5 release.

1 Like

This issue is fixed in version 2.5.0.

This topic was automatically closed after 4 days. New replies are no longer allowed.