How to upload historical prices from Binance to MT5 format via api

12 апреля 2024, 14:52
Kristian Kafarov
0
33

Run this Python 3.12 script. 

Put your api key from Binance into api_key variable. Put your secret into api_secret variable.

You can find how to create api keys here. "Enable reading" option is enough.

api_key=''
api_secret=''

By default it will load 15M history of ETHUSDT spot prices from 17.08.2017 to 11.04.2024. You can change this in line 17:

klines = client.get_historical_klines("ETHUSDT", Client.KLINE_INTERVAL_15MINUTE, "1 Jan, 2017", "11 Apr, 2024") #, klines_type=HistoricalKlinesType.FUTURES)
At the end you will receive ETHUSDT_Binance_15m_ticks_MT5.csv file in your .spyder-py3 folder (if using Spyder IDE).
Поделитесь с друзьями: