ПОЛУЧЕНИЕ API-КЛЮЧЕЙ И НАСТРОЙКА BINANCE ДЛЯ РАБОТЫ С METATRADER 5 (English version)

7 марта 2023, 11:06
Alexey Smirnov
0
241

CONNECTOR for Binance 

User Manual

1. Configuring the MT5 terminal

1.1. In the terminal window, in the menu bar, select Tools  Options (or press Ctrl+O).



1.2. In the Options window select the Expert Advisors tab and make sure the Allow WebRequest for listed URL option is selected and the following Binance API URLs are listed:

1.2.1. USDⓈ-M Futures: https://fapi.binance.com;

1.2.2. USDⓈ-M Futures Test Network: https://testnet.binancefuture.com.

 


1.3. Click OK button to save the changes.

2. Configuring a Binance account

2.1. Register an account at https://www.binance.com or log in to your account if it was previously registered. Account registration guide: https://www.binance.com/en/support/faq/how-to-register-on-binance-website-08f314ad219e45fc9b7a27b67801a5c4.

2.2. Make sure two-factor authentication (2FA) is enabled (guide: https://academy.binance.com/en/articles/binance-2fa-guide).

2.3. Go to your profile page https://www.binance.com/en/my/settings/profile and make sure you have completed Identity Verification and your Verification Level is Verified Plus (guide: https://www.binance.com/en/support/faq/how-to-complete-identity-verification-360027287111).

2.4. If you are going to use the USDⓈ-M Futures derivative and have not used it previously, go to https://www.binance.com/ru/futures/BTCUSDT and make sure this instrument is activated.

2.5. Create an API Key. 

2.5.1. Go to https://www.binance.com/ru/my/settings/api-management and click Create API button:



2.5.2. Select System generated API Key type and click Next button:


 

2.5.3. Enter an arbitrary API Key label and click Next button:


 


2.5.4. Complete security verification including CAPTCHA and 2FA. 

2.5.5. Click Edit restrictions 


 


2.5.6. Make sure Enable Futures option is selected. Select Unrestricted IP access option to allow using the key from any IP address. Click Save button. Copy API Key and Secret Key and save them in a safe place.


 




3. Launching the CONNECTOR

3.1. Launch the Connector Solutions/ Connector Solutions Binance Expert Advisor.

3.1.1. On the Inputs Parameters tab, set the parameter values:

3.1.1.1. Binance – Binance parameters:

3.1.1.1.1. Futures API URL – Binance USDⓈ-M Futures API URL

Default value: https://fapi.binance.com

3.1.1.1.2. API key – previously registered Binance API key

Default value: empty string

3.1.1.1.3. Secret key – secret key associated with the API key

Default value: empty string

3.1.1.1.4. Sync positions at startup – allows to sync MT5 and Binance ac-count positions at startup

Default value: false

3.1.1.2. Common – general CONNECTOR settings: 

3.1.1.2.1. Source Expert Advisor magic IDs (comma separated) – IDs of the Expert Advisors whose trades need to be copied. To copy trades of multiple Expert Advisors separate the IDs by commas. If the value is an empty string, only trades executed manually in the MT5 terminal will be copied. 

Default value: empty string

3.1.1.2.2. Stop when a critical error occures – allows the CONNECTOR to shutdown when a critical error occurs. 

Default value: false 

3.1.1.3. Logging – logging options: 

3.1.1.3.1. Show alert if an error occures – enables displaying errors in the Alert window. If set to false, errors will be logged without displaying the Alert window. 

Default value: true 

3.1.1.3.2. Duplicate log messages to the Expert Log – flag for displaying log records on the Experts tab. If set to false, the log entries will be written to a text log file only. 

Default value: true 

3.1.1.3.3. Print information messages to the Expert Log – flag for displaying informational log records on the Experts tab. If the value is set to false, in-formational log records will be written to a text log file only, and warning and error log records will be displayed on the Experts tab in accordance with the value of the Duplicate log messages to the Expert Log parameter. 

Default value: true 

3.1.1.3.4. Max. log file size (Mbytes) – the maximum size of the log file in megabytes. If the log size exceeds the value of this parameter, a new file will be created. 

Default value: 20

3.1.2. Click OK button to launch the CONNECTOR.


 

4. Description of the operation features of the CONNECTOR

4.1. If the Binance  Sync positions at startup parameter is set to true, then posi-tions will be synchronized between MT5 and Binance at the CONNECTOR startup by sending orders to Binance that bring Binance positions in line with MT5 posi-tions.

4.2. An attempt to synchronize positions between MT5 and Binance will be per-formed in the same way if any error occurs during data exchange between MT5 and Binance.

4.3. The MT5 account type (netting, hedge) must correspond to the Binance Position Mode (one-way, hedge), otherwise the CONNECTOR will not be launched. 

To change the Binance Position Mode in the web-terminal: 

4.3.1. Click settings button


 


4.3.2. Click the Preferences button:


 


4.3.3. Select the Position Mode tab and select required position mode:


 


Поделитесь с друзьями: