Menu

Parsing a TradingView alert message in MQL5 so a bad alert never becomes a trade
📰

Parsing a TradingView alert message in MQL5 so a bad alert never becomes a trade

DEV Community: tutorial·Omais Ali·7 days ago
#pcj4RhD3
#devtotutorial#devto#dev#string#reason
Reading 0:00
15s threshold

A TradingView to MT5 bridge has two halves. One half gets the alert from TradingView to the terminal, usually a webhook to a small server that the EA polls. The other half decides what the alert means. Most bridge failures I see are in the second half: a typo in the message template, a symbol that does not exist on the broker, a missing stop loss, or the same alert delivered twice. Each of those can turn into a wrong trade if the EA trusts the text.

This post shows a small parser and validator for a plain key and value message. It does not cover the transport, only what happens once the EA has the string.

The message format

Keep the format simple enough to read in a log.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.