A Metatrader 5 server is hosted on a PC, which broadcasts MQTT data. This data is received by an ESP32 microcontroller board via WiFi and sent to an E-Paper display driver which displays the received data into a readable format, like a trading profile dashboard.
- ESP32-WROOM32 Development Board
- Waveshare 4.2inch EPaper Display Module (Rev2.1)
- 8 Jumper cables
- 3D Printed Display Case
The server must be able to run the Metatrader 5 terminal. Currently, Linux, Windows and MacOS are supported: https://www.metatrader5.com/en/download
Make sure python
and pip
are installed and available on the server's command-line.
pip install paho-mqtt Metatrader5
python mt5server.py
You may choose to run this script in the background or as a service.
- Open
mt5client.ino
in the Arduino IDE. - Update the WiFi SSID, password and the MQTT server IP address in the above file.
- Connect and select your ESP32 board in the Arduino IDE.
Upload
themt5client.ino
sketch to your board.- The ESP32 board should now be connected to your configured WiFi from step 2 and soon update the display.
- Better case lid that remains flush.
- Better access to the board's reset button.
- Use of battery-operated power instead of external USB.
- Display open trade positions as a dynamic list.
ESP32-WROOM32 DevKit
is an integrated development board with easy pinouts for interfacing with common components. This project utilizes the SPI interface on ESP32-WROOM32 development kit
to drive the SPI-based E-Ink display module. The development board also connects to the WiFi to receive the MQTT broadcast messages from the MQTT server.
Waveshare 400x300, 4.2inch E-Ink display module, three-color
was used for this project. An E-Paper display was chosen because of its low-power consumption and a portable display solution.
https://www.waveshare.com/product/displays/e-paper/epaper-2/4.2inch-e-paper-module-b.htm
- Operating voltage: 3.3V~5V
- Interface: 3-wire SPI, 4-wire SPI
- Outline dimension: 103.0mm × 78.5mm
- Display size: 84.8mm × 63.6mm
- Dot pitch: 0.212 × 0.212
- Resolution: 400 × 300
- Display color: red, black, white
- Grey level: 2
- Full refresh time: 15s
- Refresh power: 26.4mW(typ.)
- Standby power: <0.017mW
- Viewing angle: >170°
Python integration to use Metatrader 5 functionality in python programs.
https://pypi.org/project/MetaTrader5/
https://www.mql5.com/en/docs/python_metatrader5
MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.
A C library that enables and simplifies working with E-Paper displays using Adafruit_GFX, an Arduino graphics library as the base. It is designed specifically for displays that use SPI interface.