Using IB_insync accountvalues() returns none for 'SettledCash'

Viewed 23

I have the following code running to return the specified account value.

def returnAccountValue(tag="SettledCash", currency="USD"):

         accountValueString = ib.accountValues()

                 for a in accountValueString:

                        if a.tag == tag and a.currency == currency:

                                return float(a.value)

Unfortunately this returns none, but when I use a different tag such as 'AvailableFunds' it returns the correct value. Has anyone else experienced this? Are there any issues with my code? Please let me know.

0 Answers
Related