> For the complete documentation index, see [llms.txt](https://start.atas.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://start.atas.net/cn/di-si-bu-zi-zhu-lian-jie-jiao-yi-zhang-hu/qi-huo/metatrader-5.md).

# MetaTrader 5

本指南提供了如何连接 MetaTrader 5 平台的说明。

***

{% hint style="info" %}
要使用此连接，您需要在计算机上运行 MetaTrader 5 平台，并已连接交易账户和行情数据。
{% endhint %}

{% embed url="<https://youtu.be/lhyNOfktptU?si=3XIAtyCP7yaj6ntD>" %}

{% hint style="info" %}
可通过 MT5 连接至 ATAS 的经纪商包括：AMP、BCS、FXFlat、Just2Trade。
{% endhint %}

要将 MT5 连接至 ATAS，首先需要配置 MT5：

1\. 在菜单中选择「服务」-「设置」，打开「智能交易系统（EA）」选项卡，勾选「允许自动交易」和「允许 DLL 导入」。

<figure><img src="/files/DtSqSTzqQhRpmiQvhfrO" alt=""><figcaption></figcaption></figure>

2\. 关闭 MT5 平台。

3\. 在 ATAS 的 MT5 连接器中点击“安装 MT5 专家文件”按钮，安装 MT5 专家文件。连接器的创建过程在下方有说明。

<figure><img src="/files/V0tGg54DGUUQFGDBHLXr" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
每次 ATAS 平台更新后，都需要更新 EA 文件，即在 MT5 连接器中点击“安装 MT5 专家文件”按钮。
{% endhint %}

4\. 要将 OFT 智能交易顾问添加到图表中，请在导航器中进入“顾问”部分，找到 OFT，右键单击并选择“附加到图表”，或直接将 OFT 拖到图表上。

<figure><img src="/files/N4rFF2jvJ8f9Xv3OTiXR" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
在添加顾问时，请确保设置中的 “AppPath” 参数指向 ATAS 的安装目录。
{% endhint %}

{% hint style="info" %}
在“常规”选项卡中确认勾选了“允许自动交易”。
{% endhint %}

<figure><img src="/files/hbdWkTWUpNBGvYxVsnSm" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
请注意，添加顾问的 MT5 图表时间周期不可更改，否则将停止接收在线数据。
{% endhint %}

要将 MT5 账户连接到 ATAS，请依次打&#x5F00;**「连接**」-**「添加**」-**「MT5**」-**「下一步」**。

<figure><img src="/files/EEiG0ouY8JZkiJ4RHc1q" alt=""><figcaption></figcaption></figure>

随后将弹出协议签署窗口：

<figure><img src="/files/Uzdz9v7MwYHqeX4LerbZ" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
MT5 的 OCO（One Cancels Other）订单在本地计算机上进行模拟。这意味着平台必须保持与您的经纪商连接，OCO 订单才能正常运行。如果断线且其中一个 OCO 订单被执行，则同组中的其他订单**不会被自动取消**！如果您接受此条件，请点击“我接受，请继续”。
{% endhint %}

在 ATAS 中设置连接：

<figure><img src="/files/FHEwWuIJkVY4gBU0cmzw" alt=""><figcaption></figcaption></figure>

* 连接类型 - 选择您的经纪商。
* MT5 地址 - 默认本地 IP 地址。

配置完成后，连接将作为单独一行显示在连接列表中。

有关此窗口设置的详细信息，请参阅以下链接: [连接设置窗口](https://help.atas.net/en/support/solutions/articles/72000612212)

<figure><img src="/files/E7F3JoOJ69wdD1B8oKfa" alt=""><figcaption></figcaption></figure>

1. 添加（Add）– 添加新连接。
2. 类型（Type）– 连接来源。
3. 名称（Name）– 您可自行设置的连接名称。
4. 状态（Status）– 连接状态。
5. 行情提供商（Quote Provider）– 选择行情数据提供商的选项（此连接将作为行情源）。
6. 自动连接（Auto-Connect）– 若希望在平台启动时自动连接，请启用此选项。
7. 连接设置按钮（Connection settings button）。
8. 从列表中删除连接按钮（Remove connection from the list button）。
9. 连接/断开（Connect/Disconnect）– 连接或断开该连接器。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://start.atas.net/cn/di-si-bu-zi-zhu-lian-jie-jiao-yi-zhang-hu/qi-huo/metatrader-5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
