Close Location Value Study
Close Location Value (CLV) is (Close-Low) / (High-Low): a value near 1.0 means the bar closed at, or near, its own high; near 0.0 means it closed at its own low. On its own, an average CLV is a curiosity. What makes it useful is whether it predicts anything, so this script goes one step further than a plain average: bars are split into "closed near the high" and "closed near the low" groups (controlled by InpExtremeThreshold), and each group's average NEXT-bar log return is reported alongside the plain average CLV, per session. Sessions are read directly from the bar's own open hour in the terminal's time base (broker/server time, whatever the chart already shows) - there is no separate timezone conversion, and the three session start hours are configurable inputs rather than fixed assumptions about which broker's clock is in use. Notes and limitations A bar with zero range (High equals Low) is skipped - CLV is undefined for it. The next-bar return figures are averages over the whole studied window; they describe what happened on this symbol and sample, not a prediction. A near-zero average for a group simply means that closing near the extreme had, on average, no measurable follow-through in the next bar over the studied history. Session assignment is purely hour-of-day based on the chart's own clock. If your broker's server time shifts with daylight saving and the studied window spans both sides of a transition, session boundaries will shift by an hour partway through the sample - this is not corrected for.
Script · MT5 · v1.0 · Free
About Close Location Value Study
Close Location Value Study is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 7 settings, such as Timeframe, Bars to study and Asian start hour. MQL source code included.
Files in the download: CloseLocationValueStudy.ex5, CloseLocationValueStudy.mq5, CloseLocationValueStudy.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Timeframe | PERIOD_M15 | Intraday timeframe the CLV is measured on |
| Bars to study | 5000 | Completed bars to include |
| Asian start hour | 0 | Asian session start hour (terminal time, 0-23) |
| London start hour | 8 | London session start hour (terminal time, 0-23) |
| New york start hour | 13 | New York session start hour (terminal time, 0-23) |
| Extreme threshold | 0.20 | CLV within this of 0 or 1 counts as "near the low/high" |
| Save csv | true | Write the per-session table to a CSV file |
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: Trading Sessions · Alerts · MT5 Script · MQL5 Source Code