Skip to content

Commit

Permalink
Multiple enhancements including support for multiple accounts sync an…
Browse files Browse the repository at this point in the history
…d better symbol mapping to YAHOO (#25)

* Multiple enhancements including support for multiple accounts sync and better symbol mapping to YAHOO.
Using Ghostfolio API filtering to fetch all activities from an account instead of comparing all activities.
Using Ghostfolio API filtering to delete all activities from an account instead of comparing all activities.
Support for flex query output containing multiple IBKR accounts data to sync multiple accounts.
Use ISIN symbol type from IBKR to upload new activities since it provides better mapping to YAHOO data and no need for the mapping file.
Add IBKR trade id to the uploaded activity comment to enable precise comparison when computing the diff. Diff retrocompatibility with previous versions of symbols (mapping file etc).
Find the IBKR account base currency from the flex query.
Get trade fee from the Trade node instead of UnbundledCommissionDetail node.
Use hours, minutes and seconds in the activity date.
Use logging instead of print.
Add operation to print all activities from an account.
Add underscores to some operations to be more readable.
If an environment variable does not have enough comma separated values, use the last one (good for unique stuff like API keys).
Caching of ghostfolio account id in the class for all operations to avoid multiple API calls.
Updated dependencies to remove security issues.
  • Loading branch information
NautillusSs authored Jan 29, 2025
1 parent 912381f commit d62b25f
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 158 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ Sync your Ghostfolio with IBKR
## Setup

### IBKR
**Important**: When you configure your Flex Query give it: **Cash report** and **Cash transactions** and **Trades** and nothing else
**Important**: When you configure your Flex Query give it:
* Account Information: Currency
* Cash Report: Currency, Ending Cash
* Trades: Select All (however there is a risk new IBKR fields will cause issues)

Follow this guide to configure your Flex Queries in your Interactive Brokers account:
https://help.wealthica.com/help/how-to-connect-ib-interactive-brokers-and-configure-the-flex-report
Expand Down Expand Up @@ -44,18 +47,20 @@ In Podman

You can specify the symbol mappings in `mapping.yaml` and you do not need to rebuild the container with the above mount command.

### More Options

### More Options (Some of them have /S indicating you can have multiple comma-separated)
| Envs |Description |
|--|--|
|**IBKR_TOKEN** | Your Token |
|**IBKR_QUERY** | Your Query ID |
|**GHOST_TOKEN** | The token for your ghostfolio account |
|**GHOST_KEY** | The key for your ghostfolio account, if this is used you don't need **GHOST_TOKEN** and vice-versa |
|**GHOST_HOST** | (optional) Ghostfolio Host, only add if using custom ghostfolio |
|**GHOST_CURRENCY** | (optional) Ghostfolio Account Currency, only applied if the account doesn't exist |
|**GHOST_IBKR_PLATFORM** | (optional) For self-hosted, specify the Platform ID |
|**IBKR_ACCOUNT_ID/S** | Your IBKR Account ID |
|**IBKR_TOKEN/S** | Your Token |
|**IBKR_QUERY/S** | Your Query ID |
|**GHOST_TOKEN/S** | The token for your ghostfolio account |
|**GHOST_KEY/S** | The key for your ghostfolio account, if this is used you don't need **GHOST_TOKEN** and vice-versa |
|**GHOST_HOST/S** | (optional) Ghostfolio Host, only add if using custom ghostfolio |
|**GHOST_CURRENCY/S** | (optional) Ghostfolio Account Currency, only applied if the account doesn't exist |
|**GHOST_IBKR_PLATFORM/S** | (optional) For self-hosted, specify the Platform ID |
|**CRON** | (optional) To run on a [Cron Schedule](https://crontab.guru/) |
|**OPERATION** | (optional) SYNCIBKR (default) or DELETEALL (will erase all operations of all accounts) |
|**OPERATION/S** | (optional) SYNCIBKR (default) or DELETEALL (will erase all operations of all accounts) |

### Configuring / Retrieving Platform ID

Expand Down
Loading

0 comments on commit d62b25f

Please sign in to comment.