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
| Setting | Default | What it does |
|---|---|---|
| Trend ma period | 50 | Trend moving average period |
| Trend ma method | MODE_SMA | Trend MA method (0=SMA 1=EMA 2=SMMA 3=LWMA) |
| All symbols | false | Book = every open order (false = this chart symbol only) |
| Aligned color | clrLimeGreen | Colour when book agrees with trend |
| Against color | clrCrimson | Colour when book fights the trend |
| Flat color | clrSilver | Colour when book is flat or empty |
| Arrow size | 3 | Arrow size (1-5) |
| Corner | CORNER_LEFT_UPPER | Panel screen corner (0-3) |
| X offset | 10 | Panel horizontal offset |
| Y offset | 20 | Panel vertical offset |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Buy/Sell Arrows · Trend · Trading Sessions · MT4 Indicator · MQL4 Source Code