Skip to content

Commit e8f8240

Browse files
committed
Readme, clearer
1 parent fdbb75b commit e8f8240

File tree

1 file changed

+58
-44
lines changed

1 file changed

+58
-44
lines changed

README.md

Lines changed: 58 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,98 @@
1-
# ⚡️ Meta Trader 5 + WebSockets + Real-time Ticker Messages
2-
An example on how to push real-time ticker updates from MetaTrader 5 over WebSockets to any server.
1+
# ⚡️ MetaTrader 5 + WebSockets + Real-time Ticker Messages
2+
3+
A solution for streaming real-time ticker updates from MetaTrader 5 over WebSockets to any server.
34

45
![Real-time Tickers](/Readme-assets/Tickers.gif)
56

6-
- 📘 Uses the robust WebSocket library implementation found in the MQL5 Book
7-
- ⚡️ Sets a super tight update interval to have near-zero latency ticker updates
8-
- 🚚 Combines ticker updates for symbols that changed in the same interval
9-
- 📚 Uses JAson library to serialize/deserialize json
7+
- 📘 Leverages the robust WebSocket library implementation from the MQL5 Book
8+
- ⚡️ Implements tight update intervals for near-zero latency ticker updates
9+
- 🚚 Batches ticker updates for symbols that changed within the same interval
10+
- 📚 Utilizes JAson library for JSON serialization/deserialization
1011

11-
In use for our trade signaling website: [https://solidsignals.xyz](https://solidsignals.xyz) — Consistent Profitable Trades\
12+
Currently powering our trade signaling platform: [https://solidsignals.xyz](https://solidsignals.xyz) — Consistent Profitable Trades
1213
Written in MQL5, by polyclick
1314

14-
# Important
15+
## Important Note
16+
17+
MetaTrader 5 restricts symbol tracking to those listed in the Market Watch window. When configuring the Expert Advisor, ensure that:
18+
1. All symbols you want to track are added to the Market Watch
19+
2. Symbol names in your configuration array match exactly with those in Market Watch
20+
3. Spelling is correct for all symbol names
1521

16-
MetaTrader 5 limits the symbols we can track. You can only request data from symbols that are listed in the Market Watch window. Keep this in mind when configuring the Expert Advisor. You'll find an array of strings for the symbols you want to track. Make sure you add those symbols in the Market Watch. Make sure the symbol name in the script is spelled correctly.
22+
## Setup Instructions
1723

18-
# Instructions
19-
## 1. Download this github project
24+
### 1. Download this GitHub project
2025

2126
Shouldn't be too hard :)
2227

28+
### 2. Install the MQL5Book library
2329

24-
## 2. Install the MQL5Book library
30+
Place the `MQL5Book` directory in your MetaTrader 5 include directory:
31+
```
32+
/MQL5/Include/MQL5Book
33+
```
2534

26-
Place the `MQL5Book` directory in the default `/MQL5/Include/` directory, resulting in the full path being: `/MQL5/Include/MQL5Book`
35+
When installed correctly, your directory structure should look like this:
2736

28-
When installed correctly your file structure should look like this:
37+
![Include Directory Structure](/Readme-assets/Include.png)
2938

30-
![Include](/Readme-assets/Include.png)
39+
### 3. Set up your Expert Advisor folder
3140

32-
## 3. Create your custom Expert Advisor folder & Copy files
41+
1. Create a custom Expert Advisor folder at `/MQL5/Experts/{YOUR_FOLDER_NAME}`
42+
2. Copy all files from the `Expert/` directory in this repo to your custom folder
3343

34-
Create your own custom Expert Advisor folder under `/MQL5/Experts/{FOLDER_NAME}` \
35-
Copy everything in this repo from `Expert/` into your custom folder
44+
![Expert Directory Structure](/Readme-assets/Expert.png)
3645

37-
![Include](/Readme-assets/Expert.png)
46+
### 4. Compile the Expert Advisor
3847

39-
## 4. Compile
48+
1. Open MetaEditor
49+
2. Compile the Expert Advisor
50+
3. Resolve any include path issues that may arise
4051

41-
Compile & pray 🙏🏼 \
42-
Fix any include path issues
52+
### 5. Whitelist WebSocket URL
4353

44-
## 6. Whitelist the WebSocket url in Tools > Options
54+
In MetaTrader 5:
55+
1. Navigate to Tools > Options
56+
2. Add your WebSocket server URL to the allowed URLs list
4557

46-
![Whitelist](/Readme-assets/Whitelist.png)
58+
![Whitelist Configuration](/Readme-assets/Whitelist.png)
4759

48-
## 7. Attach compiled expert to any chart
60+
### 6. Attach the Expert Advisor to a chart
4961

50-
Although the Expert Advisor doesn't really use the `onTick()` event, we need to add it to a chart to start its execution.
62+
Even though the Expert Advisor doesn't primarily use the `onTick()` event, it needs to be attached to a chart to initialize and run.
5163

52-
There are some print statements in the code to help you debug.
64+
Debug messages are included in the code to assist with troubleshooting.
5365

54-
# Extra
66+
## Development Tools
5567

56-
## Start A Local, Temporary WebSocket Server
57-
During development, setting up a temporary WebSocket server helps monitoring the sent Expert Advisor messages. For this, I suggest you use `wscat`:
68+
### Local WebSocket Server Setup
5869

59-
Starts a temporary WebSocket server on your local machine:
60-
```
70+
For development and testing, you can create a temporary WebSocket server:
71+
72+
1. Start a local WebSocket server using `wscat`:
73+
```bash
6174
npx wscat -l 8080
6275
```
63-
Then, use `untun` to expose the local server for incoming public traffic using CloudFlare (Free):
64-
```
76+
77+
2. Expose your local server to the internet using `untun` (CloudFlare-based tunneling):
78+
```bash
6579
npx untun@latest tunnel http://localhost:8080
6680
```
67-
![Tunnel](/Readme-assets/Tunnel.png)
6881

69-
Untun will return a public url that routes public traffic to your local machine.
82+
![Tunnel Configuration](/Readme-assets/Tunnel.png)
7083

71-
- Use the public url in the `Tools > Options` dialog (whitelist)
72-
- Fill in the public url as an input for the Expert Advisor
73-
74-
If connection fails, try different variations of the same url in both the `Tools > Options` (whitelist dialog) and the EA input parameter (WebSocket address):
84+
3. Use the public URL provided by `untun` in:
85+
- The MetaTrader 5 Tools > Options whitelist
86+
- The Expert Advisor input parameters
7587

88+
If connection fails, try these URL variations in both the whitelist and EA parameters:
7689
- `http://random-url.trycloudflare.com`
7790
- `https://random-url.trycloudflare.com`
7891
- `ws://random-url.trycloudflare.com`
7992
- `wss://random-url.trycloudflare.com`
8093

81-
# Getting help
82-
- Open an issue
83-
- Check out our website: Solid Signals — [https://solidsignals.xyz](https://solidsignals.xyz)
84-
- Join us on Discord: [https://discord.gg/NMVSE5mGkX](https://discord.gg/NMVSE5mGkX)
94+
## Support
95+
96+
- Open an issue on GitHub
97+
- Visit our website: [https://solidsignals.xyz](https://solidsignals.xyz)
98+
- Join our Discord community: [https://discord.gg/NMVSE5mGkX](https://discord.gg/NMVSE5mGkX)

0 commit comments

Comments
 (0)