Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Check USD balance

Maybe this us obvious, but I haven't really found the answer to this question. Is there anyway to check USD cash balance as oppossed to just 'cash'?

If I understand correctly the "context.portfolio.cash" will be total cash and as I'll be funding in non-USD currency I want to make sure it is in USD before it is spent.

5 responses

Wouldnt it just be easier to denominate USD as your base currency in interactive?
As an Australian I have to buy USD before I can trade US shares (theres no margin/conversion on purchase but im not sure about other countries)

I am funding in AUD and converting to USD to trade in base currency USD. (Quantopian currently have it set to USD base currency only).

My issue is that when you use the context.portfolio.cash it gets the USD + AUD and trades off that.

I want it to trade only on the USD balance and leave the AUD balance alone.

@Jeremy Steele did you ever figure this out? I have this exact same problem, but even worse... I can't put other currencies in my live account because it affects the 'cash' balance and my trades start to get rejected (because there is not enough USD in the account to support the trade being sent to IB).

You could create an IB sub account and fund that account with the amount of UDS (and nothing else) you want to trade. See here a good explanation from Simon on how to create a sub account for each Q algorithm.

Thanks Luca. I guess this is a way to solve my problem, but I consider it more of a workaround than a real solution. But desperate times...