Updating Equity

There is a mismatch between the Equity I’m getting from Alpaca Trading API and the Equity shown in my Alpaca Account. It sometimes shows the correct value, and in others, both values aren’t the same. I’d like to know if there is something I could do to avoid this issue.