Recently my semi-automated trading system got two feature upgrades: first, extended Telegram functionality allowing buy/sell operations directly via tags in notification messages; second, integrated LLM (large language model) tools for analyzing holdings and position changes.
Executing Buy/Sell Operations Directly in Telegram
The previous semi-automated mode was: the program detects a stock price change, automatically sends a notification to Telegram, and I place the order in the broker software based on the reminder.
Recently I optimized this flow — now I can execute buy/sell operations directly by adding tags to Telegram notification messages, greatly improving efficiency and convenience.

Implementation Principle
The core logic: the backend checks whether the message sender is an admin and whether the tag (icon) meets requirements; only when both conditions are satisfied does it proceed with the buy/sell operation. Here is part of the implementation code:
1 | async def conv_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: |
This way, users only need to add a designated tag (like “👏”) to a Telegram message and the system automatically completes the buy/sell operation — no manual switching to broker software.
Using LLM Tools to Analyze Holdings and Position Adjustments
I referenced the TauricResearch/TradingAgents project. Although it mainly supports OpenAI and is terminal-interactive, I borrowed its prompt design and integrated LLM analysis tools into my own system. Now automated code generation and model calls are very efficient, quickly completing analysis tasks.

TradingAgents’ Feature Highlights
TradingAgents uses OpenAI’s function calling capability (Function Calling) to automatically fetch stock quotes, check news, and generate analysis reports through multiple rounds of interaction. The whole process is roughly as follows:

This approach lets the model proactively call backend functions, automatically completing data fetching and analysis — greatly raising the intelligence level.
My Actual Application
I don’t have OpenAI’s API, but I’d previously topped up DeepSeek’s, so I use it directly for holdings analysis. Currently the project’s LLM interaction flow is fairly simple: the system organizes recent holdings data, uploads it to DeepSeek for analysis, and the model gives position-change suggestions and operation advice.

Currently I review the model-generated report once a week, which already satisfies my daily holdings management and strategy adjustment needs.
