Loading…

Book Direction Compass

It is easy to lose track, mid-session, of whether the positions currently open are actually working with the trend the chart is showing or against it. This panel adds up every open trade's lots (long positive, short negative) into one net figure, compares the chart symbol's own trend state (last close against a moving average) against that lean, and shows one arrow: up for a net-long book, down for net-short, a flat glyph when the book is empty or exactly hedged to zero. The colour carries the actual message: green means the book direction and the trend agree, red means the book is positioned against the trend, grey covers a flat book or a flat (no-trend) market. This is a read-only awareness tool - it places no orders and gives no signal beyond "here is the current relationship," which is deliberately honest about what a single moving-average comparison can and cannot tell you about trend quality. Notes and limitations - Trend state is a single moving-average comparison, not a full trend filter - it will disagree with more sophisticated trend reads on choppy data, by design (it is meant to be simple and transparent). - The book direction ignores pending orders entirely; only open OP_BUY/OP_SELL market positions count toward net lots. - With InpAllSymbols true, the book figure can mix exposure from symbols with very different volatility and lot sizing into one number - read it as a rough net-direction gauge, not a risk figure. - Wingdings glyphs are drawn on an OBJ_LABEL by writing the raw character code into the label's text (OBJ_LABEL has no ARROWCODE property - that belongs only to OBJ_ARROW).

Indicator · MT4 · v1.0 · Free

About Book Direction Compass

Book Direction Compass is an indicator for MetaTrader 4 based on Moving Average. It has 10 settings, such as Trend ma period, Trend ma method and All symbols. MQL source code included.

Files in the download: BookDirectionCompass.ex4, BookDirectionCompass.mq4, BookDirectionCompass.txt.

Settings

SettingDefaultWhat it does
Trend ma period50Trend moving average period
Trend ma methodMODE_SMATrend MA method (0=SMA 1=EMA 2=SMMA 3=LWMA)
All symbolsfalseBook = every open order (false = this chart symbol only)
Aligned colorclrLimeGreenColour when book agrees with trend
Against colorclrCrimsonColour when book fights the trend
Flat colorclrSilverColour when book is flat or empty
Arrow size3Arrow size (1-5)
CornerCORNER_LEFT_UPPERPanel screen corner (0-3)
X offset10Panel horizontal offset
Y offset20Panel vertical offset

How to install

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

Download the PDF guide

Tags: Moving Average · Buy/Sell Arrows · Trend · Trading Sessions · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria