Sentiment Extreme Fade System
MQL4 has no built-in retail-positioning feed, and no network access suitable for pulling one live. This EA does not attempt to fake that - it reads a plain CSV file the trader (or a separate scheduled export, script, or manual copy from a broker's published positioning page) drops into the terminal's MQL4\Files\ (or MQL5\Files\ on the native MQL5 build) folder, in a documented format: one header row, then rows of Symbol,LongPercent,ShortPercent,Timestamp. When the row matching the chart's symbol reports one side at or beyond a configurable extreme threshold, the EA takes the other side, on the standard contrarian premise that a heavily one-sided retail book is a poor-odds crowd to join. Every read is defensive: a missing file, a missing row for the symbol, an unparseable timestamp, an out-of-range percentage, or data older than InpMaxDataAgeMinutes all leave the EA flat rather than trading on a guess - the Comment panel always shows the last read status so a stale or broken feed is visible at a glance, not a silent failure. Notes and limitations - This EA is only as good as the feed it is pointed at. It validates the file's structure and freshness, but cannot verify that the numbers themselves are accurate - garbage in the CSV is still garbage the EA will act on if it parses and passes the freshness check. - The retail-positioning contrarian premise is a documented heuristic, not a guaranteed edge; it has historically worked better as one input among several than as a standalone signal. - Only one position at a time; a new extreme reading is ignored while a trade from a previous reading is still open. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.
Expert advisor · MT5 · v1.0 · Free
About Sentiment Extreme Fade System
Sentiment Extreme Fade System is an expert advisor (trading robot) for MetaTrader 5 based on ATR. It can size trades from your balance and risk percent. It has 15 settings, such as Data file name, Extreme long percent and Extreme short percent. MQL source code included.
Files in the download: SentimentExtremeFade.ex5, SentimentExtremeFade.mq5, SentimentExtremeFade.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Data file name | SentimentExtremeFade_sentiment.csv | File in MQL5\Files\ - see .txt for the exact format |
| Extreme long percent | 70.0 | Fade to SHORT once reported long% is at/above this |
| Extreme short percent | 70.0 | Fade to LONG once reported short% is at/above this |
| Max data age minutes | 240 | Refuse to trade if the file's timestamp is older than this |
| File recheck seconds | 300 | Minimum seconds between re-reading the file |
| Atr period | 14 | ATR period used for the stop and target |
| Stop atr multiple | 2.0 | Stop distance as a multiple of ATR |
| Target atr multiple | 3.0 | Target distance as a multiple of ATR |
| Use risk sizing | true | Size by percent risk to the stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a sizing fallback |
| Magic number | 35501 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Risk & Lot Size · ATR · MT5 Expert Advisor · MQL5 Source Code