Interactive brokers simulated trading account updating
They won't take trades into account very well, and if you have sold something completely or hadn't bought it for the first snapshot the comparision wont' work.
Finally also be very careful about using these snapshots to work out what positions you have.
Although the code is rather trivial, interpreting the results requires some understanding.
once again you need to get the code from the following repo. This will give your results with live or simulated Gateway / TWS session running (it probably won't produce anything of interest with a demo account but you can still follow the code).
So I can convert my ill gotten gains in monopoly money ECB issued Euros 4359.32 * 0.815491 = £3,555 in real money.
For more information see the online documentation C Note be careful about using comparisions between these portfolio snapshots from different times to calculate your profits.
However both of these are going to be looking at streamed accounting updates.
The account_value output will be a very long list of tuples.Here is the corresponding exchange rate from the account_value output.From this we can make out that my base currency is GBP, and 1 Euro is worth 0.815491 GBP.I compare this to the IB snapshot throughout the day.
If there are any breaks in the reconciliation I temporarily halt trading.
Each one consists of (keyname, value, currency, account number).