TraderAi Algorithmic trading
- Experts
- Razieh Sarani
- Versione: 1.2
- Aggiornato: 27 maggio 2025
AI Trading Agent Powered By ChatGPT
Trade Smarter with AI Trading Agent using Powered By ChatGPT.
Simply describe your trading conditions in plain language, the AI Trading Agent understands your instructions, monitors the market in real time, and executes trades at the optimal moment.
Whether you're running a grid trading strategy, using Martingale techniques, or simply scalping based on price action, just tell the AI Trading Agent what you want to do.
The AI Trading Agent understands your instructions and can execute multiple trades simultaneously while managing each position intelligently. This makes it ideal for strategies involving hedging and maximizing profits across trading pairs.
Traditional algorithmic trading systems require extensive rule-based coding and constant tuning to keep pace with evolving market dynamics. In contrast, Trading Agent augmented with AI enable a paradigm shift: traders can express strategies in natural language, and the trading agent autonomously translates these high-level intents into executable actions in real time.
Have a trading strategy in mind? Simply provide it as a prompt. The integrated AI will interpret your instructions, analyze real-time market data, and execute trades according to your specified strategy. All trades are carried out directly on your selected trading account, based on the prompt you provide.
Instead of hard coding complex logic, you define trading conditions, risk parameters, and strategy constraints using plain English. The AI interprets this input, converts it into structured tasks, and is capable of Real-time market monitoring, Dynamic decision-making and Position management.
Trading Agent enables concurrent execution of diverse strategies (e.g., grid trading, Martingale, momentum-based scalping).
This Expert Advisor (EA) is designed to enable users to interact with an AI model, such as ChatGPT, through natural language prompts. Instead of hard-coding trading strategies, users can define trading logic dynamically using plain language instructions.
Important Disclaimer:
This EA does not guarantee profitability. Merely connecting to an AI model will not result in successful or profitable trades without proper prompt design and strategic input from the user. The effectiveness of the EA heavily depends on the quality and clarity of the prompts provided.
Users are fully responsible for optimizing their own trading prompts and strategies.
To avoid potential financial loss, it is strongly recommended to use a demo account during initial testing and experimentation.
Important Note:
Due to Web Request limitations within the MetaTrader Strategy Tester, AI features are not available in the backtesting environment. This is a technical restriction imposed by the MetaTrader platform itself and is not a limitation of the EA.
EA Parameters:
Enable AI Mode
This EA operates in two distinct modes. By default, it functions as a fully autonomous trading system, executing trades based on support and resistance levels while automatically setting Take Profit (TP) and Stop Loss (SL). This ensures full compliance with MQL Community Rules, which require that all Expert Advisors must be capable of trading independently without reliance on external services.
This EA can leverages powerful external large language models (LLMs) from leading AI providers to assist with trading decisions. To use these AI-driven features, users must supply their own API access credentials for supported AI platforms.
AI Mode is disabled by default. Users must manually enable it in the settings to activate AI functionality. Enabling AI mode will bypass the default automatic trading action and only relying on AI for trading decisions.
By enabling AI Mode, the EA can interact with powerful AI models from leading providers such as OpenAI (ChatGPT), Google Gemini, DeepSeek, and Mistral. These models assist with trading insights and decision-making based on your prompts.
When using AI for trading, you can simply describe your strategy in plain language—no need to write complex code. The AI will interpret your instructions and execute trades accordingly, offering a flexible and intuitive approach to strategy execution.
Important: Without a valid AI configuration, the EA will not perform any trading activity, as it relies entirely on external AI services. Since we have no control over these third-party platforms, all access and usage depend solely on your setup.
AI Engine:
Select the AI platform you wish to use (e.g., Gemini, DeepSeek, OpenAI, Mistral, etc.). Each provider offers unique capabilities tailored to different trading needs.
Reasoning:
Enable this option if you plan to use an AI model with advanced reasoning capabilities. Set to true to activate.
Examples of supported reasoning models include:
- OpenAI’s o-series
- DeepSeek Reasoner
- Gemini Thinker
Temperature:
Adjusts the creativity and randomness of AI-generated responses.
- Low (0.1 – 0.3): Produces more deterministic and consistent outputs. Best suited for precise, rule-based trading strategies.
- Medium (0.4 – 0.7): Offers a balanced mix of structure and creativity, suitable for adaptive or semi-automated strategies.
- High (0.8 – 1.0): Introduces greater randomness and creativity. Useful for exploring unconventional or experimental trading ideas.
Max Tokens:
Specifies the maximum number of tokens the AI model can use in a single response. This includes both your prompt and the AI’s reply.
Reasoning models typically require a higher token limit to handle complex instructions and deliver more accurate, context-aware results.
Execute On:
Defines when the AI should be triggered during market activity.
- Bar: The AI is called once per completed candle/bar on the selected timeframe (e.g., every minute, hour, etc.).
- Tick: The AI is called on every new market tick, allowing for high-frequency decision-making.
Using the Tick option may result in a high number of API requests. Be aware of rate limits imposed by your AI provider to avoid interruptions.
Model Input Configuration:
Configure the market data fed into the AI model for analysis and decision-making:
- Include OHLC: Enable to include candlestick data (Open, High, Low, Close) in the model’s input.
- Number of Past OHLC Data: Specify how many previous candles to include when OHLC data is enabled.
- Include Ticks: Enable to include bid and ask tick data in the model input.
- Number of Past Ticks: Set how many past tick data points should be included.
- Include Market Depth: Enable this option to provide market depth data (order book) to the AI model.
- Minimum Trade Volume Size: Set the smallest trade volume (in lots) the AI is permitted to execute.
- Maximum Trade Volume Size: Set the largest trade volume (in lots) the AI can execute.
Specify the maximum total number of open positions the AI is allowed to maintain simultaneously.
Enter your trading strategy or instructions here. The AI will interpret your prompt, analyze market conditions accordingly, and execute trades based on your specified strategy.
The EA will automatically create a Prompt.txt file in the MT5 Files directory. You can add a longer and more complex prompt there. To use the external prompt from Prompt.txt , simply leave the Command Prompt parameter empty — the system will then fall back to the content of Prompt.txt .
how Edit Prompt.txt
To edit the prompt file:
-
In the MetaTrader 5 terminal, go to the Tools menu and select MetaQuotes Language Editor.
-
In the MetaEditor program, open the Navigator panel, then go to Files → Prompt.txt to edit the prompt.
If you don’t see the Navigator panel in MetaEditor, go to the View menu and select Navigator to enable it.
Model API Configuration:
BOYK: Bring Your Own Key
To access these AI models, you must provide your own API keys. The EA does not supply or manage API keys, so ensure you have valid keys from your chosen AI provider before enabling AI features.
You can use your own free API keys from providers like Google Gemini and Mistral to enable AI-powered features in this EA. This allows you to interact with advanced third-party AI models—such as Google’s Gemini at no additional cost, to receive trading insights or assist in decision-making.
Gemini Configuration
Gemini API Key: To use AI features powered by Google Gemini, you must provide your own Gemini API key. Without a valid key, the EA will not be able to access Gemini’s AI services.
You can Get FREE Gemini API Key at Google AI Studio [https://aistudio.google.com/apikey]
Gemini Model: Enter the exact name of the Gemini model you want to use(e.g., gemini-2.0-flash).
List of Gemini Models:
- gemini-2.5-flash-preview-04-17 (previously known as gemini-2.0-flash-thinking-exp-01-21)
- gemini-2.5-pro-exp-03-25
- gemini-2.0-flash
- gemini-2.0-flash-lite
- gemini-1.5-flash
- gemini-1.5-flash-8b
- learnlm-1.5-pro-experimental
- learnlm-2.0-flash-experimental
- gemma-3-1b-it (hallucinate, can not select the exact ticket id)
- gemma-3-4b-it
- gemma-3-12b-it
- gemma-3-27b-it
- not tested:
- gemini-2.5-pro-preview-05-06 (not tested)
- gemini-1.5-pro (not accessible )
Check official websie for updated list [https://ai.google.dev/gemini-api/docs/models/gemini].
ChatGPT Configuration
ChatGPT API Key: Provide your ChatGPT API key. Get OpenAI API Key [https://platform.openai.com/settings/organization/api-keys].
ChatGPT Model: Enter the exact name of the ChatGPT model you want to use (e.g., gpt-4o-mini).
List of supporrted ChatGPT Models:
- o4-mini
- o3-mini
- o1
- gpt-4.1
- gpt-4o
Cost-optimized models:
- o4-mini
- gpt-4.1-mini
- gpt-4.1-nano
- gpt-4o-mini
Not supported:
- o1-mini (not availale)
- o1-preview (not supported with the Responses API)
Not tested:
- o3
- o1-pro
Check official websie for for updated list. [https://platform.openai.com/docs/models]
Mistral Configuration:
Mistral API Key: Provide your Mistral API key. Get Free Mistral API Key https://console.mistral.ai/api-keys]
Mistral Model: Enter the exact name of the Mistral model you want to use (e.g., mistral-8b-lates).
- mistral-8b-lates
- mistral-large-latest
- codestral-latest
- ministral-3b-latest
- ministral-8b-latest
- pixtral-large-latest
- mistral-small-latest
- open-mistral-nemo
DeepSeek Configuration:
DeepSeek API Key: Provide your DeepSeek API key. Get DeepSeek API Key [http://platform.deepseek.com]
DeepSeek Model: Enter the exact name of the DeepSeek model you want to use (e.g., deepseek-reasoner).
List of DeepSeek Models:
- deepseek-chat
- deepseek-reasoner
Check official website for for updated list [https://api-docs.deepseek.com/quick_start/pricing].
Use of Third-Party AI APIs Disclaimer
This Expert Advisor (EA) integrates optional support for third-party AI services (such as ChatGPT, DeepSeek, Google Gemini) via user-provided API keys. These services are not embedded in the EA itself and are not managed, controlled, or hosted by the EA developer.
All limitations, quotas, and restrictions associated with API usage are solely governed by the terms of the respective third-party providers and depend entirely on the user's API subscription or usage tier. The EA developer has no influence or responsibility over such limitations.
The EA does not implement any external license control, data collection, or update management systems, and fully complies with MetaQuotes rules regarding third-party system integration and user privacy.
All AI interactions are handled through your API key and are not managed, controlled, or limited by the EA itself.
For updates and new features, join the Community Channel.
