File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,9 +151,9 @@ class WSApiTest:
151151
152152 # Cash and positions balances
153153 balances = ws.get_account_balances(account[' id' ])
154- cash_balance_key = ' sec-c-usd' if account[ ' currency ' ] == ' USD ' else ' sec-c-cad'
155- cash_balance = float (balances.get(cash_balance_key, 0 ))
156- print (f " Available (cash) balance: { cash_balance} { account[ ' currency ' ] } " )
154+ for cash_balance_key in [ ' sec-c-usd' , ' sec-c-cad' ]:
155+ cash_balance = float (balances.get(cash_balance_key, 0 ))
156+ print (f " Available (cash) balance: { cash_balance} { cash_balance_key.split( ' - ' )[ - 1 ].upper() } " )
157157
158158 if len (balances) > 1 :
159159 print (" Assets:" )
@@ -199,4 +199,4 @@ if __name__ == "__main__":
199199Projects Using It
200200-----------------
201201
202- - [ wealthgrabber] ( https://github.com/ebastos/wealthgrabber ) - Wealthsimple portfolio analytics
202+ - [ wealthgrabber] ( https://github.com/ebastos/wealthgrabber ) - Wealthsimple portfolio analytics
You can’t perform that action at this time.
0 commit comments