Step by step: create a Flex report and a read-only token in Interactive Brokers, then enter them on the FolioCast setup page and connect @FolioCastBot in Telegram.
What you need
About 5 minutes.
Your login for IBKR Client Portal.
A FolioCast subscription: the FolioCast setup page opens right after checkout.
Why this is needed: FolioCast makes your morning episode from your IBKR report. The Flex Query decides what goes into the report, and the token lets FolioCast fetch it.
Is it safe?
The token can only read reports. It cannot trade or move money.
FolioCast checks the token once with IBKR, then stores it encrypted and uses it only to fetch your reports.
You can revoke the token in IBKR at any time.
Faster: create the report with AI in IBKR
IBKR can build the Flex report from a short text. You still check the result and create the token by hand. If something does not work, use the manual steps below.
In IBKR Client Portal open Performance & Reports → Flex Queries and click Configure with AI.
Performance & Reports›Flex Queries›Configure with AI
Paste this ready text. The Copy button puts it on your clipboard.
Create an Activity Flex Query named foliocast. Period: Last Business Day. Output format: XML. Include these sections: Account Information; Change in NAV; Mark-to-Market Performance Summary in Base; Open Positions with Level of Detail Summary; Trades with Level of Detail Executions; Cash Transactions; Cash Report; Financial Instrument Information. Select all fields in each section.
Click Generate Flex Query and look through the result.
Generate Flex Query
Click Edit Manually and check:
Edit Manually
Name: foliocast.
All sections from the list in Part 1 are there: Account Information, Change in NAV, Mark-to-Market Performance Summary in Base, Open Positions (Level of Detail: Summary), Trades (Level of Detail: Executions), Cash Transactions, Cash Report, Financial Instrument Information.
Delivery Configuration: Format XML.
Period Last Business Day.
IBKR warns that the AI result may be incomplete, so this check is required. The name, XML and the period are sometimes not applied — then set them by hand.
Click Save Query.
Save Query
Open the info icon next to the query and copy its Query ID. Then go to Part 2.
foliocastⓘ›Query ID
AI does not switch on Flex Web Service and does not create the token: always do Part 2 by hand.
Part 3. Enter them in FolioCast and connect @FolioCastBot
Open the FolioCast setup page. It opens right after checkout.
In step 01, paste the token and the Query ID, choose the episode language and press Check with IBKR and save.
Flex tokenQuery IDCheck with IBKR and save
In step 02, press Get my Telegram link, open the link and press Start in the chat with @FolioCastBot. The link works once, for one hour.
Get my Telegram link›Open in Telegram›Start
If you like, press Send my first episode now in step 03. After that, a new episode arrives after every US trading day, around 05:00 UTC.
You do not send the token or the Query ID in the Telegram chat: they are entered only on the setup page or in your account.
To replace the token later, send /account to @FolioCastBot, open the one-time link, enter the new token and your Query ID and press Check with IBKR and save.
If something goes wrong
“IBKR rejected the token.” Copy it again from Flex Web Service Configuration, or generate a new one.
“IBKR does not know this Query ID for this token.” Check the number next to your Activity Flex Query and copy it again.
“This token is limited to certain IP addresses.” Generate a new token without an IP restriction.
“Flex Web Service is switched off or the token has expired.” Switch it on and generate a new token.
The bot says your token has expired or is invalid. Generate a new token in IBKR, then send /account to the bot, open the one-time link and press Check with IBKR and save with the new token and your Query ID. Your subscription stays as it is.
You generated a new token. A new token cancels the old one. Update it in FolioCast: send /account to the bot, open the one-time link and press Check with IBKR and save with the new token and your Query ID.
IBKR is busy or does not answer. Nothing is saved until the check passes. Wait a few minutes and try again.
No episode on Sunday. Episodes arrive after US trading days. On Monday the episode covers Friday’s close and the week ahead. If IBKR prepares the report late, FolioCast tries again later the same morning.
Пошагово: создайте в Interactive Brokers отчёт Flex и токен только для чтения, затем введите их на странице настройки FolioCast и подключите @FolioCastBot в Telegram.
Что понадобится
Около 5 минут.
Логин и пароль от IBKR Client Portal.
Подписка FolioCast: страница настройки FolioCast открывается сразу после оплаты.
Зачем это нужно: утренний выпуск FolioCast собирает из вашего отчёта IBKR. Flex Query определяет, что попадёт в отчёт, а токен позволяет FolioCast его получить.
Безопасно ли это
Токен только читает отчёты. Торговать или выводить деньги им нельзя.
FolioCast один раз проверяет токен в IBKR, затем хранит его в зашифрованном виде и использует только для получения ваших отчётов.
Токен можно отозвать в IBKR в любой момент.
Быстрее: создать отчёт через AI в IBKR
IBKR может собрать отчёт Flex по короткому тексту. Результат всё равно нужно проверить, а токен создать вручную. Если что-то не получилось, используйте ручные шаги ниже.
В IBKR Client Portal откройте Performance & Reports → Flex Queries и нажмите Configure with AI.
Performance & Reports›Flex Queries›Configure with AI
Вставьте готовый текст. Кнопка «Скопировать» кладёт его в буфер обмена.
Create an Activity Flex Query named foliocast. Period: Last Business Day. Output format: XML. Include these sections: Account Information; Change in NAV; Mark-to-Market Performance Summary in Base; Open Positions with Level of Detail Summary; Trades with Level of Detail Executions; Cash Transactions; Cash Report; Financial Instrument Information. Select all fields in each section.
Нажмите Generate Flex Query и просмотрите результат.
Generate Flex Query
Нажмите Edit Manually и проверьте:
Edit Manually
Название: foliocast.
Есть все секции из списка в части 1: Account Information, Change in NAV, Mark-to-Market Performance Summary in Base, Open Positions (Level of Detail: Summary), Trades (Level of Detail: Executions), Cash Transactions, Cash Report, Financial Instrument Information.
Delivery Configuration: Format XML.
Period Last Business Day.
IBKR предупреждает, что результат AI может быть неполным, поэтому проверка обязательна. Название, XML и период иногда не применяются — тогда выставьте их вручную.
Нажмите Save Query.
Save Query
Откройте значок информации у запроса и скопируйте Query ID. Затем переходите к части 2.
foliocastⓘ›Query ID
AI не включает Flex Web Service и не создаёт токен: часть 2 всегда делается вручную.
Часть 3. Введите их в FolioCast и подключите @FolioCastBot
Откройте страницу настройки FolioCast. Она открывается сразу после оплаты.
В шаге 01 вставьте токен и Query ID, выберите язык выпусков и нажмите «Проверить в IBKR и сохранить».
Flex-токенQuery IDПроверить в IBKR и сохранить
В шаге 02 нажмите «Получить ссылку на Telegram», откройте ссылку и нажмите Start в чате с @FolioCastBot. Ссылка одноразовая и действует час.
Получить ссылку на Telegram›Открыть в Telegram›Start
Если хотите, в шаге 03 нажмите «Прислать первый выпуск сейчас». Дальше новый выпуск приходит после каждого торгового дня в США, около 05:00 UTC.
Токен и Query ID не нужно отправлять в чат Telegram: их вводят только на странице настройки или в личном кабинете.
Чтобы позже заменить токен, отправьте @FolioCastBot команду /account, откройте одноразовую ссылку, введите новый токен и ваш Query ID и нажмите «Проверить в IBKR и сохранить».
Если что-то не так
«IBKR отклонил токен». Скопируйте его заново из Flex Web Service Configuration или создайте новый.
«Для этого токена IBKR не знает такой Query ID». Проверьте число рядом с вашим Activity Flex Query и скопируйте его заново.
«Токен ограничен по IP-адресам». Создайте новый токен без ограничения по IP.
«Flex Web Service выключен или токен истёк». Включите его и создайте новый токен.
Бот пишет, что токен истёк или недействителен. Создайте новый токен в IBKR, отправьте боту /account, откройте одноразовую ссылку и нажмите «Проверить в IBKR и сохранить», указав новый токен и ваш Query ID. Подписка при этом не меняется.
Вы создали новый токен. Новый токен аннулирует старый. Обновите его в FolioCast: отправьте боту /account, откройте одноразовую ссылку и нажмите «Проверить в IBKR и сохранить», указав новый токен и ваш Query ID.
IBKR занят или не отвечает. Пока проверка не прошла, ничего не сохраняется. Подождите несколько минут и попробуйте снова.
В воскресенье выпуска нет. Выпуски приходят после торговых дней в США. В понедельник выпуск — об итогах пятницы и неделе впереди. Если IBKR готовит отчёт позже обычного, FolioCast пробует ещё раз позже тем же утром.