Another example is if you want a 2 hours timeframe TIMEFRAME_H2.īefore start, we have to know the basic structure of a trading request from Python to MT5. There are several options yo can use, for example to get the information from a 5 minutes frame you will use TIMEFRAME_M5, or if you want days you could use TIMEFRAME_D1. In other words, download the last 1000 hours of price information from the symbol you want. ![]() The only MQL statement is TIMEFRAME_H1 that indicates that you will download the last 1000 candles of your desired symbol in 1 hour frame. Rates = mt5.copy_rates_from_pos(symbol, mt5.TIMEFRAME_H1, 0, 1000) The only MQL you need to know to get the dataĪs we seen in previous posts we used to get the data the next line of code: But when i find the mt5 library i realized, luky me, that i have to know only some basic and well documented MQL code to get the data from the desired time frame, select the order type and the needed filling order type. My first thought when i used tools like ZeroMQ or RabbitMQ to try to connect MT4 with Python was that i had to learn not only new highly and complicated architectures and Python functions but also have some intermediate MQL4 or MQL5 language. ![]() But some years ago i faced an ugly truth: I have to know something about MQL# to send my orders to MT5. By now i think you already know me and you know that i don’t like MQL# to create trading robots.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |