# MetaTrader 5

This guide provides instructions on how to connect the MetaTrader 5 platform.

***

{% hint style="info" %}
To use this connection, you need to have the MetaTrader 5 platform running on your computer with a connected trading account and quotes.
{% endhint %}

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

{% hint style="info" %}
The list of brokers that can be connected to ATAS via MT5 includes: AMP, BCS, FXFlat, Just2trade.
{% endhint %}

*To connect MT5 to ATAS, you first need to configure MT5:*

1\. In the menu, select **Service - Settings**, open the **Advisors tab**, and check the boxes for **Allow automated trading** and **Allow DLL imports.**

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2FC6T52BErwE2GuF2Ueg7M%2F1.png?alt=media&#x26;token=1b491d62-d072-4b2f-ad75-f7dcfab3e7b8" alt=""><figcaption></figcaption></figure>

2\. **Close the MT5 platform.**

3\. **Install MT5 expert** files by pressing the respective button in the MT5 connector in ATAS. The process of the connector creation is described below.

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2F52mQO0eHIsxNmKD6RJdY%2F2.png?alt=media&#x26;token=fde2134c-f66e-487d-9232-8d2f2d0cefc1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
After each update in the ATAS platform you need to update the EA files, i.e. click the “Install MT5 expert files” button in the MT5 connector.
{% endhint %}

4\. **To add the OFT** expert advisor to a chart, go to the **"Advisors"** section in the **Navigator,** **find OFT**, and right-click on it. Then, choose **"Attach to chart"** or simply drag OFT onto the chart.&#x20;

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2FKKO5aBtPJTbsJz8keRWm%2F3.png?alt=media&#x26;token=089746c9-2dd1-4ffc-8a36-c27dfdd8bda1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
When adding the advisor in the settings, make sure that the ‘AppPath’ parameter specifies the correct path to the folder where ATAS is installed.
{% endhint %}

{% hint style="info" %}
Make sure that ‘Allow automatic trading’ is checked in the ‘General’ tab.
{% endhint %}

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2FU7Aq0LknauPSTfeKlyT0%2F4.png?alt=media&#x26;token=542efaf7-a7aa-4e0d-8cb1-66e5ba7c5a23" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
You cannot change the timeframe of the chart in MT5 where the advisor is added, otherwise the online data will stop coming.
{% endhint %}

To connect an MT5 account to ATAS, you need to open **Connections - Add - MT5 - Next.**

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2F0rkoTX4OHTJ0PWg8S8K8%2F5.png?alt=media&#x26;token=4d6af05f-eca6-416d-b872-9ececa57893e" alt=""><figcaption></figcaption></figure>

Next, windows for signing an agreement will open:

<figure><img src="https://content.gitbook.com/content/hMlO74lsSnDKFkMvdN10/blobs/ZddskIdSNactbei3ReIN/6.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
OCO (One Cancels Other) orders for connecting MT5 are simulated locally on your computer. This means that the platform must be connected to your broker for OCO orders to work properly. If you get disconnected and one of the OCO orders is executed, the other orders in the group WILL NOT BE canceled! If you are okay with this, click ‘I Accept, Please continue’.
{% endhint %}

Setting up the connection in ATAS:

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2FVEsmjgiM47Sz0Sj9Ikl3%2F7.png?alt=media&#x26;token=d0f53d34-830e-4397-be4b-e7f2dcb9644b" alt=""><figcaption></figcaption></figure>

* **Connection type** - select your broker.
* **MT5 address** - default local IP address.

After configuring the connection, it will appear as a separate line in the list of connections.

You can read about the settings of this window at the following link: [Connection Settings Window](https://help.atas.net/en/support/solutions/articles/72000612212)

<figure><img src="https://3095753190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhMlO74lsSnDKFkMvdN10%2Fuploads%2Feof6RqQvdpRLfiqL99v3%2F8.png?alt=media&#x26;token=de0939dd-4be2-4fc0-a20f-feb09ddb2ac9" alt=""><figcaption></figcaption></figure>

1\. **Add** – add a new connection.

2\. **Type** – connection source.

3\. **Name** – connection name which you can set yourself.

4\. **Status** – connection status.

5\. **Quote Provider** – option to select a quote provider (this connection will be used as a quote provider).

6\. **Auto-Connect** – if you want the connection to automatically occur when the platform is launched, you need to enable this option.

7\. **Connection settings button.**

8\. **Remove connection from the list button.**

9\. **Connect/Disconnect** – connect/disconnect the connector.
