Posts: 2 since Feb 2023
Thanks Given: 0
Thanks Received: 0
|
Over the years, I have tested several ways of sending orders generated in MultiCharts to MetaTrader 5.
My first attempts were based on CSV and text files. MultiCharts would write the order instructions to a file, while an Expert Advisor on MT5 would continuously read it and execute the corresponding trades.
It worked, but I encountered some practical limitations. Both platforms generally needed access to the same local or shared folder, and concurrent reading and writing could create file-locking and synchronization issues. It was possible to manage these problems, but the overall process became more complicated than I wanted.
When MultiCharts 15 introduced native Telegram notifications, I tried a different approach.
MultiCharts now sends each trading instruction as a structured Telegram message. I then use a Python relay to receive, validate and route the messages, while an MT5 Expert Advisor interprets them and manages the execution.
The Python layer was particularly useful when I started working with multiple MT5 terminals. If several terminals independently request updates from the same Telegram bot, they can consume or interfere with the same message stream. The relay avoids this by receiving each message once and routing it to the correct terminal.
This structure also means that MultiCharts and MT5 do not need to run on the same machine. Multiple MultiCharts strategies and charts can send instructions to different MT5 terminals or VPSs, while each strategy remains separately identifiable on the execution side.
In my live tests, the complete transmission process has generally taken around 100–300 milliseconds under normal network conditions. This has been sufficient for the mainly intraday strategies for which I use it.
Of course, fast transmission does not mean identical execution. The final result still depends on network latency, broker execution, spreads, slippage, symbol mapping and the differences between the instrument used in MultiCharts and the one available on MT5. A futures strategy copied to a CFD, for example, can receive the instruction quickly but still obtain a different fill.
After testing different approaches, this has been the most practical and reliable solution I have found for connecting my MultiCharts research and trading environment to MT5 execution.
I am curious about how other MultiCharts users have solved the same problem:
* Have you built a direct connection between MultiCharts and MT5?
* Are you using files, sockets, web APIs or another messaging system?
* How do you manage multiple terminals, synchronization and order-state reconciliation?
* Have you found a more reliable approach for low-latency execution?
|