Discussing the article: "Python + LLM API + MetaTrader 5: Real-World Experience Building an Autonomous Trading Bot"
Once again, we’re relying on other people’s ready-made models and servers
Where can I read about “ready-made models and servers”? Please share. I’ve actually come across solutions involving the fine-tuning of local LLMs.
the word “autonomous”
In my view, modern models have a comprehensive ‘worldview’, know a whole host of strategies, understand time series and do not require further training. They correctly identify support and resistance levels, as well as highs and lows; this is evident from the LLM’s ‘reasoning’. Via the API, you can select powerful models without being tied to local hardware.
Where can I read about ‘pre-trained models and servers’? Please do share. I’ve actually come across solutions involving the fine-tuning of local LLMs.
I’ve just mentioned that this article uses pre-trained models and servers.
In the discussion of another article (where the model is downloaded and run locally), in which you also participated, I provided a link to a comparative study of general language models (which were not trained on time series) and those specifically trained on time series. The results do not favour large language models.
From my experience with general-purpose LLMs, it appears that they are very prone to making up facts in the factual part of their responses, particularly when it comes to numerical figures.
- 2025.11.12
- www.mql5.com
I’ve just mentioned that this article uses ready-made models and servers.
In the discussion of another article (where the model is downloaded and run locally), in which you also took part, I provided a link to a comparative study of general language models (which were not trained on time series) and those specifically trained on time series. The results do not favour large language models.
From my experience with general-purpose LLMs, it appears that they are very prone to making up facts in the factual part of their responses, particularly when it comes to numerical figures.
In the discussion of another article (where the model is downloaded and run locally), in which you also participated, I provided a link to a comparative study of general language models (which were not trained on time series) and those trained specifically on time series. The results do not favour large language models.
Stanislav, thank you for the article; I’ve found it, and it’s very useful. I must have missed it somehow – I suppose I was too lazy to translate it.
Translation:
In fact, recent work points to a multitude of interesting and promising ways in which language and time series interact, such as time series reasoning [25, 7, 45, 42, 37], social understanding [6] and financial reasoning [36, 20].
From my experience with general-purpose LLMs, it seems they are very prone to stretching the truth in the factual parts of their answers, particularly when it comes to numerical figures.
Oh yes. That’s certainly food for thought. Choosing the right model, formulating a strategy in the prompt and setting clear boundaries is no easy task. Models from the leaderboards usually provide more accurate answers. They analyse situations sensibly and make informed decisions.
I agree with this comment:
Forum on trading, automated trading systems and testing trading strategies
Edgar Akhmadeev, 13 November 2025 00:33
I started working on this topic not long ago. I’m writing the OpenAI API in pure MQL5. And the server for the model is llama.cpp.
You need to give the model instructions that are as mathematically precise as possible and demand clear answers, without any fluff. Lower the temperature to the minimum (0–0.2) so that it doesn’t start fantasising. Select the largest local models that the system can handle (on my 12 Gb VRAM – up to 15B, and with a slight slowdown – up to 30B). Test them and select the best one (and there are plenty to choose from). Whilst you’re doing this, model development continues, and small, smart models are emerging. You can then fine-tune the model (LoRA). If, God forbid, there’s a hint that the project might be profitable, you can switch to large, paid online models. Or at least upgrade your computer to 2 GPUs with 24 Gb and plenty of memory.
There’s work galore. We’ll see. We’ll try working with the models, taking their charming quirks into account.
- 2025.11.12
- www.mql5.com
Hello. My article on the back-testing of the local Ollama model using 1,000 trades will be published shortly. Surprisingly, the results on synthetic, artificial samples of ideal trades are several times better than those on actual real-world trades.
An interesting study. I’m really looking forward to the rest of the season )).
A dataset with synthetic trades – that’s something new.
Tokens vs Hardware.
Would anyone be willing to write a good back-tester for the LLM APIs? As it stands, it’s not really clear what we’re discussing :)
Related: 5 LLMs traded autonomously for 8 months using market data and news (the model training approach has not been disclosed).
The script is perfectly fine and, in my opinion, provides a very good foundation for an educational example of how an LLM can be integrated into a trading system. However, I think the biggest room for improvement is not necessarily in the script itself, but in the way market data is presented to the LLM and, especially, in the prompt engineering.
In its current implementation, the prompt is relatively basic and is more of a demonstration of the concept than a complete trading decision-making framework. The LLM receives OHLCV data, looks for support/resistance levels and price-action patterns, and then essentially chooses between BUY, SELL, and HOLD. That is perfectly sufficient to demonstrate the concept, but a real trading system could provide the LLM with much richer market context.
For example, the prompt could define market structure, trend and trend strength, volatility, ATR, momentum, multiple timeframes, distance from support/resistance zones, the quality of the price-action setup, potential risk/reward, and perhaps most importantly explicit conditions under which the LLM must not trade and should return HOLD.
I would also avoid using the LLM simply as a signal generator. Instead, I would use it as a decision layer on top of traditional market data and deterministic trading rules. The strategy can calculate the indicators and relevant features, while the LLM evaluates their combined context and the quality of the overall setup.
I would also separate market analysis from trade execution. The LLM could return a structured decision containing confidence/quality score, market bias, entry zone, invalidation level, and SL/TP proposal, while the EA itself should remain responsible for risk validation, position sizing, spread conditions, trading sessions, and all execution rules.
This creates a much more robust architecture:
Market Data → Feature/Market Structure Layer → LLM Analysis → Decision Layer → Risk Manager → MT5 Execution
In my opinion, the author has already built a good concept and demonstrated the most important part how to connect an LLM to a trading system. With some additional work on prompt engineering, market context, response validation, and the risk layer, this example could quite easily evolve into a solid LLM-assisted trading system.
So I would describe this as a very good starting point rather than a finished trading system, and that is exactly what makes the concept interesting, because there is a lot of room for further development.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use


Check out the new article: Python + LLM API + MetaTrader 5: Real-World Experience Building an Autonomous Trading Bot.
Most traders have no idea that AI is capable of:
This is neither an indicator nor an algorithm but an intelligent add-on that can be adapted to your personal trading system.
And most importantly, it does not need to be taught how to program. It understands ordinary human language.
Author: Aleh Daikou