Loading…

Value Area Rotation System

On a day where price rotated within a fairly contained range, the value area (where most of the previous day's volume traded) is a reasonable map of where the market is likely to keep rotating. On a day where price broke away and trended, that map is stale and edge-fade trades are the wrong tool entirely. This system builds that map from the previous day's M15 bars - bucketing each bar's tick volume into the price bin containing its own midpoint, then finding the point of control (highest-volume bin) and expanding outward, adding whichever neighbouring bin carries more volume, until a configurable share of the day's total volume is enclosed. That gives the value area high and low. The previous day is then classified BALANCED only if its full range stayed within a configurable multiple of that value area's width - otherwise it is classified a trend day and the EA does not trade at all for the current session. On a balanced day, price touching the current day's value area edges is faded back toward the point of control (or the opposite edge, if configured), with a stop beyond the touched edge. This is a coarse approximation of a real market-profile engine, stated plainly: MQL4 exposes tick volume per bar, not individual trade prices, so each bar's volume is bucketed at its midpoint rather than genuinely distributed across its intrabar range. It captures the shape of a volume profile well enough to classify balance and locate the value area's rough edges, not a tick-accurate reconstruction. Notes and limitations - The profile is bucketed at each M15 bar's midpoint, not its true intrabar volume distribution - stated above, repeated here because it is the single most important limitation of this approach. - Requires sufficient M15 history loaded for the previous calendar day; on a freshly attached chart with no history downloaded yet, the EA reports "no profile" and stays flat rather than guessing. - Only one position at a time; further edge touches are ignored while a rotation trade is open. - A balanced-day classification can still be followed by a trend move intraday - the classification is a base rate from yesterday's shape, not a guarantee about today. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.

Expert advisor · MT5 · v1.0 · Free

About Value Area Rotation System

Value Area Rotation System is an expert advisor (trading robot) for MetaTrader 5. It can size trades from your balance and risk percent. It has 13 settings, such as Bin size pips, Value area percent and Balanced range multiple. MQL source code included.

Files in the download: ValueAreaRotationSystem.ex5, ValueAreaRotationSystem.mq5, ValueAreaRotationSystem.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Bin size pips10.0Width of one profile bin, in pips
Value area percent70.0Percent of the day's volume that defines the value area
Balanced range multiple1.6Day classified BALANCED only if dayRange <= this x value-area width
Edge touch pips5.0How close price must get to VAH/VAL to count as a "touch"
Stop beyond edge pips15.0Stop distance beyond the touched edge, in pips
Target is poctrueTarget the point of control; if false, target the opposite edge
Use risk sizingtrueSize by percent risk to the stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a sizing fallback
Magic number35901Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

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 → Experts.
  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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Volume · Trend · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria