Loading…

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

SettingDefaultWhat it does
Random level count00 = match the number of user levels found at start-up, otherwise a fixed count
Price range lookback500Bars used to bound the random price range (the recent high/low)
Atr period14Period or timeframe used by the calculation
Reaction atr multiple1.0A touch counts as a "reaction" once price moves this many ATRs away
Reaction window bars20Bars allowed for the reaction to develop after a touch
Touch tolerance points20A bar counts as touching a level if it trades within this many points of it
Report every bars50Print/refresh the comparison report every this many closed bars
Random level colourclrGrayColour on the chart
Write csv logtrueAlso write every touch/reaction to a CSV file for offline review

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Support & Resistance · ATR · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria