Advanced Telegram Trading Journal Bot by Questionist. π Automates PnL calculations, tracks Long/Short positions, and generates Daily/Weekly/Monthly reports. Built with high-performance Python Asyncio & PostgreSQL. The smart way to journal trades.
Your Ultimate Personal Trading Journal on Telegram
Stop wasting time with messy Excel sheets or manual calculations. TradeTracker Bot, developed by Questionist, is a powerful, high-performance Telegram bot designed to automate your trading journal, verify your trades, and track your PnL (Profit & Loss) with absolute precision.
Whether you are a scalper or a swing trader, this bot helps you stay disciplined by keeping a clean record of every single trade, calculating your exact risk/reward, and summarizing your performance over time.
- β‘ Instant Math: No more calculators. Just input your entry, targets, and lots. The bot handles the complex PnL math for both Long and Short positions, including split entries and multiple take-profit targets.
- π Professional Reports: Instantly generate Daily, Weekly, and Monthly reports. Know exactly how much you made (or lost) in a specific period.
- π‘οΈ Data Integrity: Uses a robust PostgreSQL database to store every trade securely. Your data is yours.
- π Async Performance: Built with Python's
asyncioandtelebot, it handles multiple requests lightning fast without blocking. - π― Split Targets Support: Have a complex strategy with 2 entries and 2 TP levels? We got you. The bot calculates the weighted average result automatically.
Here is a breakdown of the core functions, just like an API documentation:
Calculates the raw dollar value of a trade based on entry and exit points.
- Input: Entry price, Target price, Lots size, Trade type (Long/Short).
- Logic: Automatically adjusts for Short positions where a lower target means profit.
- Output: Returns the exact profit or loss in USD.
Determines the percentage impact of a trade on the current account balance.
- Input: Current Account Balance, Calculated PnL.
- Output: Returns the percentage growth or drawdown (e.g., +2.5% or -1.2%).
Generates a dynamic, paginated inline keyboard for navigating through trade history.
- Input: List of items (trades), current page number, mode (daily/weekly/monthly).
- Features: Efficiently handles lists with 100+ items by splitting them into pages of 10, preventing UI clutter.
An intelligent step-by-step conversation handler that guides the user.
- Logic: Instead of one complex command, it asks for data piece by piece (Currency -> Balance -> Lots...).
- Validation: Ensures inputs are valid numbers and logically correct before saving to the database.
-
Clone the repository:
git clone https://github.com/Questionist/TradeTracker.git cd TradeTracker -
Install Dependencies: First, try installing all requirements at once:
pip install -r requirements.txt
If you encounter version conflicts, you can install the core libraries manually:
pip install pyTelegramBotAPI psycopg2-binary
-
Database Configuration:
- Make sure you have PostgreSQL installed and running.
- Create a database named
postgres(or change it in the code). - Update the
DB_USER,DB_PASS, andDB_HOSTvariables inmain_en.py.
-
Bot Token:
- Get your token from @BotFather on Telegram.
- Paste it into the
TOKENvariable inmain_en.py.
-
Run the Bot:
python main_en.py
- Start the Bot:
/start - New Trade: Click New Report.
- Input Details:
- Currency:
XAUUSD - Balance:
10000(First time only) - Lots:
0.1 - Type:
Short - Entry:
2035.50 - Target:
2030.00 - Stop Loss:
2040.00
- Currency:
- Result:
Saved. PnL: $55.00 New Balance: $10,055.00
TradeTracker is built to be flexible. You can easily modify the following in main_en.py:
SUDOS: Add your Telegram User ID to this tuple to grant yourself access.PER_PAGE: Change pagination size (default is 10 items).
We love open source! If you have ideas for new features (like chart generation, CSV export, or AI analysis), feel free to fork the repo and submit a pull request.
Built with β€οΈ by Questionist. (Check us out at Questionist.ir)