Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sync Ghostfolio with IBKR

NotificationsYou must be signed in to change notification settings

agusalex/ghostfolio-ibkr-sync

Repository files navigation

Docker Hub package

Sync your Ghostfolio with IBKR( more to come? Help is always welcome! )

Setup

IBKR

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)For dividends, also include:
  • Change in Dividend Accruals: Quantity, Gross Rate, Action ID, Currency, Symbol, ISIN, FIGI, Date, Fee, Code

Follow this guide to configure your Flex Queries in your Interactive Brokers account:https://portfellow.com/how-to-configure-ib-import

Important: If you dont want ghostfolio-sync to sync everything everytime and make it quicker, just set a shorter window for the query. Keep in mind that what was not synced by ghostfolio-sync in that period of time will be lost (ie when the window moves and content was not uploaded to ghostfolio). This can be avoided at the cost of a longer window of time and longer sync

Ghostfolio

  • Take note of your userKEY (generated upon user creation and used to login to Ghostfolio)
  • Run the following on the terminal (replaceghostfol.io withlocalhost or your host url if you are self-hosting):
curl -X POST -H "Content-Type: application/json" \-d '{ "accessToken": "YOUR-USER-KEY-GOES-HERE }' \    https://ghostfol.io/api/v1/auth/anonymous
  • Take note of the token{"authToken":"12cd45.... That is yourGHOST_TOKEN

Run in Docker

docker run -e IBKR_ACCOUNT_ID=$IBKR_ACCOUNT_ID -e GHOST_TOKEN=YOUR_GHOST_TOKEN -e IBKR_TOKEN=YOUR-IBKR-TOKEN -e IBKR_QUERY=YOUR-IBKR-QUERY agusalex/ghostfolio-sync

In Podman

podman run -e IBKR_ACCOUNT_ID=$IBKR_ACCOUNT_ID -e GHOST_TOKEN=YOUR_GHOST_TOKEN -e IBKR_TOKEN=$IBKR_TOKEN -e IBKR_QUERY=$IBKR_QUERY -e GHOST_HOST=http://$GHOST_URL -e GHOST_CURRENCY=EUR -e GHOST_IBKR_PLATFORM=$IBKR_PLATFORM -v ./mapping.yaml:/usr/app/src/mapping.yaml:Z agusalex/ghostfolio-sync

Symbol mapping

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

More Options

EnvsMutiple ( Comma-separated )Description
IBKR_ACCOUNT_IDYesYour IBKR Account ID (Example: U7649433)
IBKR_TOKENYesYour Token
IBKR_QUERYYesYour Query ID
GHOST_TOKENYesThe token for your ghostfolio account
GHOST_KEYYesThe key for your ghostfolio account, if this is used you don't needGHOST_TOKEN and vice-versa
GHOST_HOSTYes(optional) Ghostfolio Host, only add if using custom ghostfolio
GHOST_CURRENCYYes(optional) Ghostfolio Account Currency, only applied if the account doesn't exist
GHOST_IBKR_PLATFORMYes(optional) For self-hosted, specify the Platform ID
CRONNo(optional) To run on aCron Schedule
OPERATIONYes(optional) SYNCIBKR (default) or DELETEALL (will erase all operations of all accounts)

Configuring / Retrieving Platform ID

If you are using ghostfolio self-hosted option, you need to go into Ghostfolio and add a platform for IBKR.

Then make a request to/account to find the relevant platform ID and store it in the IBKR_PLATFORM env variable

curl"http://10.0.0.2:3333/api/v1/account" \     -H"Authorization: Bearer$GHOST_TOKEN"export IBKR_PLATFORM=<PUT PLATFORM ID HERE>

Contributing

  • Feel free to submit any issue or PR's you think necessary
  • If you like the work and want to buy me a coffee you are more than welcome :)

Buy Me A Coffee


[8]ページ先頭

©2009-2026 Movatter.jp