Level Objectivity Demonstrator
Traders who draw levels tend to remember the bounces and forget the misses - the ruler makes confirmation bias look like evidence. This EA runs the uncomfortable control most level-drawers never run: it reads every horizontal line (OBJ_HLINE) already on the chart as the "user" group, generates a matching set of levels at uniformly random prices across the recent trading range as the "random" group, and then applies one identical measurement rule to both for as long as it runs. A touch is counted whenever a closed bar trades through a level's price, within a small tolerance. A reaction is counted if price then moves at least a configurable multiple of ATR away from that level within a configurable number of bars, without touching it again first - the same rule, on the same clock, regardless of which group the level belongs to. The chart comment and journal report a running touch count, reaction count and reaction rate for each group side by side, so a trader can see directly whether their drawn levels react meaningfully more often than chance would produce on the same instrument, or whether the difference is within the noise a random level set already shows. Every touch and reaction is also appended to a CSV file for anyone who wants to run their own statistics offline rather than trust the running percentage on the chart. Notes and limitations This measures reaction FREQUENCY, not trade profitability - a level that reacts often is not automatically a good trading level, and this EA makes no such claim. The random levels are drawn once at start-up from the price range visible at that moment; a market that later trends well outside that original range will leave the random group's levels increasingly irrelevant to current price while user levels drawn later stay current, which biases any very long-running comparison in the random group's favour. Restart the EA periodically on a strongly trending market to keep the random range representative. It never sends orders.
Expert advisor · MT5 · v1.0 · Free
About Level Objectivity Demonstrator
Level Objectivity Demonstrator is a script for MetaTrader 5 based on ATR. It has 9 settings, such as Random level count, Price range lookback and Atr period. MQL source code included.
Files in the download: LevelObjectivityDemo.ex5, LevelObjectivityDemo.mq5, LevelObjectivityDemo.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Random level count | 0 | 0 = match the number of user levels found at start-up, otherwise a fixed count |
| Price range lookback | 500 | Bars used to bound the random price range (the recent high/low) |
| Atr period | 14 | Period or timeframe used by the calculation |
| Reaction atr multiple | 1.0 | A touch counts as a "reaction" once price moves this many ATRs away |
| Reaction window bars | 20 | Bars allowed for the reaction to develop after a touch |
| Touch tolerance points | 20 | A bar counts as touching a level if it trades within this many points of it |
| Report every bars | 50 | Print/refresh the comparison report every this many closed bars |
| Random level colour | clrGray | Colour on the chart |
| Write csv log | true | Also write every touch/reaction to a CSV file for offline review |
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 → Scripts.
- 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 script onto a chart to run it once.
Tags: Support & Resistance · ATR · MT5 Expert Advisor · MQL5 Source Code