H4 container mtf
- Indicadores
-
Dragan Joksimovic
MQL4 / MQL5 Expert Advisor and Indicator Developer
I develop and test Expert Advisors, indicators and trading utilities for MetaTrader 4 and MetaTrader 5 based on clearly defined trading rules.
My work includes:
• Expert Advisors for MT4 and MT5
• Custom indicators - Versão: 1.0
H4 CONTAINER MTF BOXES (MetaTrader 5) |
//| |
//| One H4 container box holds every H1, M30, M15, M5 and M1 box |
//| that falls inside it. Each inner timeframe has its own on/off |
//| switch. |
//| |
//| LEVELS |
//| H4 container : 25%, 50% and 75% of its range (quarters). |
//| Inner boxes : the 50% line (middle) only. |
//| |
//| DRAWING |
//| With everything on, one container holds |
//| 4 H1 + 8 M30 + 16 M15 + 48 M5 + 240 M1 = 316 boxes. |
//| The container is 4 edges + 3 levels, every inner box is |
//| 4 edges + 1 level. Objects are created once per container; |
//| afterwards only the boxes that can still move are touched |
//| (the container plus the current and the last closed bar of |
//| every enabled timeframe). M1 is the heavy one: 240 boxes. |
//| |
//| BUFFERS FOR AN EXPERT ADVISOR (iCustom / CopyBuffer) |
//| Nothing is plotted from them (DRAW_NONE), they are data |
//| for an EA. Index -> value, per chart bar: |
//| 0 H4 High 1 H4 Low |
//| 2 H4 25% 3 H4 50% 4 H4 75% |
//| 5 H1 High 6 H1 Low 7 H1 Middle (50%) |
//| 8 M30 High 9 M30 Low 10 M30 Middle |
//| 11 M15 High 12 M15 Low 13 M15 Middle |
//| 14 M5 High 15 M5 Low 16 M5 Middle |
//| 17 M1 High 18 M1 Low 19 M1 Middle |
//| EMPTY_VALUE where nothing is known (older than HistoryBars, |
//| or older than the history of that timeframe). |
//| |
//| BufferMode decides WHICH box a bar refers to: |
//| BOX_FORMING : the box that contains the bar, with the |
//| high/low AS KNOWN AT THAT BAR (running |
//| high/low from the box start up to the bar). |
//| No look-ahead: a backtest sees exactly what |
//| live trading would have seen. |
//| BOX_CLOSED : the LAST CLOSED box of that timeframe, so |
//| the levels are fixed for the whole next |
//| period (like a "previous candle" zone). |
//| A box timeframe lower than the chart timeframe refers to |
//| the last box of that timeframe inside the chart bar. |
//| |
//| The EA-related inputs come FIRST, so an EA can pass only |
//| them and leave the drawing inputs at their defaults: |
//| int h = iCustom(_Symbol, _Period, "H4_Container_MTF_Boxes",|
//| BOX_CLOSED, // BufferMode |
//| 1000, // HistoryBars |
//| false); // DrawObjects (no drawing) |
//| double v[1]; |
//| CopyBuffer(h, 3, 1, 1, v); // H4 50% at closed bar 1 |
//| |
//| Display only - places no orders and modifies no positions.
