Institutionalized Balanced Signal - Design Specification (MT4, XAUUSD is supported first) ## Overview - Goal: Convert institutional order-making ideas (balance vs price discovery vs cost/impact) into two types of usable signals - breakthrough and regression, without using any traditional technical indicators. - Data constraints: only use O/H/L/C, tick volume, spread, and time. Disable moving averages, RSI, etc. - Verifiability: non-redrawing - only the signal is engraved at the closing price; before the closing price, it is only used as an "early warning" and does not drop the mark. - Filtering: multi-cycle filtering (slow cycle = M15) based on value zone direction; session and event blacklist filtering. - XAUUSD priority: Adaptively raise the threshold to reduce false positives in large fluctuation/expanded spread environments. ## Institutionalization Motivation and Mapping - Balance Zone (Value Zone) ≈ Internalization Bandwidth: The market is more likely to have passive/active flows intersect in this zone, and prices are "accepted". - Price discovery (breakthrough): The price leaves the value zone, and at the same time there are microstructural signs of "tightening liquidity + enhanced active transactions". - Rebalancing (Return): The out-of-the-money advance fails and returns to the value zone, while trading conditions "normalize" (spreads fall, velocity weakens, imbalances ease). - Cost/Impact Priority: Use spread, speed (fluctuation of fluctuations), and tick volume imbalance as microstructure agents. If the conditions are not met, no transaction will occur. ## Data and Limitations - Input: Open, High, Low, Close, tick_volume, spread, time on the chart period; slow period data is read through the i* series. - No order book/real trading volume: Use tick_volume to approximate activity; use spread to approximate liquidity. - The historical spread/tick quality of brokers varies greatly: fault tolerance and downgrade strategies are required. ## Core components### 1) Value area construction (fast cycle) - Use minutes as the window (non-fixed number of bars): such as 480 minutes (≈8 hours), convert bars according to minutes*60/PeriodSeconds(). - Use the price histogram to express "stay at price": the bin size is binUsd, the weight is max(tick_volume,1), and the price is HL2. - POC: histogram mode; expand from POC to both sides to cover ValueAreaPercent (such as 70%), and get VAL/VAH. - XAUUSD adaptive bin: - binUsd = max(BinSpreadFactor*spread median value, BinRealizedFactor*real fluctuation median, MinBinUSD). ### 2) Dynamic threshold and baseline - Spread baseline: spread rolling median in the past 1–3 hours. - Implement volatility baseline: the median of nearly N High-Low; the MAD of price speed is used for z normalization. - Breakout buffer: bufferUsd = max(BufferSpreadFactor*spread median value, MinBufferUSD). - Tick volume imbalance: near the root of ConfirmBars, the rise and fall of the K-line are divided into (buy-sell)/total ticks, evenly divided. ### 3) Risk guard (suppress noise/false positives) - Value zone width bottom line: VAH-VAL >= max(MinVAWidthUSD, MinVAWidthSpreadMult*spread median value). - Kill-switch: If |z_speed| >= ExtremeZFactor or spread >= ExtremeSpreadFactor*baseline, disable the signal. - Session and hourly filtering: only within the configured period; signals are banned for ±N minutes before and after the hour. - Event Blacklist: Suppress signals around a given time window (see format below). ## Signal Definition### Breakout (price discovery) Closing mark, all must be met: - Price out of bounds: Close > VAH + bufferUsd (long) or Close < VAL - bufferUsd (empty). - Speed anomaly: z_speed = (Close[1]-Close[1+ConfirmBars])/MAD reaches the threshold and the direction is consistent. - Volume imbalance: multidirectional imbalance >= ImbalanceThreshold; empty direction <= -ImbalanceThreshold. - Spread expansion: spread >= SpreadWidenFactor_Breakout * Spread baseline. - Multi-cycle gating: Slow-cycle POC direction support (such as multi-order requirements Close >= POC_slow). - Cooldown: Same direction signals are not repeated within the CooldownBars root. ### Return (Rebalancing) Closing mark, all must be met: - Out-of-the-money → In-the-money: The previous root is outside the value zone, and the current root returns to the [VAL, VAH] zone. - Speed: |z_speed| >= ReversionSpeedZ and direction supports regression. - Imbalance: The return direction is consistent or approaches zero (such as shorting from above, requiring imbalance ≤ 0). - Spread recovery: spread <= SpreadNormalize_Reversion * spread baseline. - Multi-cycle gating: does not conflict with the slow cycle direction; tighten or filter when conflicting. - Cooldown: Same direction cooldown as breakthrough. ### Early warning (only observation, no target placement) - On the current unclosed K line, if most of the breakthrough conditions are close to the threshold (such as ≥80%), a small status label will be displayed (no arrows will be drawn, no history will be left). - Cleared when a new K line arrives or conditions fall back. ## Multi-cycle filtering (slow cycle = M15) - On SlowTF=M15, also press LookbackMinutes and binUsd to build the slow value area. - Gating logic: - Long breakthrough: Close_fast >= POC_slow (or close to slow VAH) is released; short breakthrough: Close_fast <= POC_slow is released. - Consistency enhancement: When fast/slow are consistent, the threshold can be slightly relaxed; otherwise, the threshold can be tightened or filtered directly. - The slow cycle is only used for gating, and the fast cycle history is not written back or modified (to avoid redrawing). ## Session and event filtering - Session: Configure [SessionStartHour, SessionEndHour] (including endpoints) in broker server time. - Hourly hour: Avoid NoTradeMinutesAroundHour minutes before and after the hour. - Event blacklist input format (string): - "yyyy.mm.dd HH:MM|M;yyyy.mm.dd HH:MM|M;...", M is the time radius (minutes). - Example: 2025.01.31 21:30|15;2025.02.01 03:00|10. ## Non-redraw guarantee - Only when a new K line arrives, the previous one (index 1) will be judged and marked; index 0 (not closed) will not be marked. - The engraved historical arrows and values will not be modified; the value area line is a historical sequence "calculated at the time" and does not need to be backfilled with future data. - The warning is only displayed currently, is temporarily visible, and is not written into the history. ## Recommended default parameters - window and value area: LookbackMinutes=480, ValueAreaPercent=70. - bin and buffering (adaptive): BinSpreadFactor=0.5, BinRealizedFactor=0.15, MinBinUSD=0.20; BufferSpreadFactor=1.2, MinBufferUSD=0.10. - Confirmation and thresholds: ConfirmBars=5, BreakoutSpeedZ=1.4 (M1)/1.2 (M5), ReversionSpeedZ=0.8 (M1)/0.6 (M5), ImbalanceThreshold=0.20. - Spread status: SpreadWidenFactor_Breakout=1.8, SpreadNormalize_Reversion=1.3. - Risk guards: ExtremeZFactor=3.0, ExtremeSpreadFactor=3.0, MinVAWidthUSD=1.0, MinVAWidthSpreadMult=15.0, CooldownBars=10. - Filter mode: UseMTFFilter=true, SlowTF=M15; session default 7–22, signals are banned for ±1 minute on the hour. - Function switches: EnableBreakout=true, EnableReversion=true, EnablePrewarn=true. ## XAUUSD Special Adaptation - All thresholds scale with the median spread and the true median fluctuation, and the threshold is automatically raised in the scenario of large fluctuations/expanded spreads (it is better to be deficient than excessive). - The width of the value zone is restricted by double lower limits of US dollars and spread multiples to avoid "false balance". - Kill-switch avoids false positives during periods of extreme volatility such as breaking news/London PM Fix. ## Boundaries and degradation - When the tick_volume or spread baseline is distorted (lots of 0s), extend the window or simply pause the signal. - Signals are skipped when the value zone is too narrow until a valid equilibrium is re-established. - Weekend/gap opening: Set a minimum warm-up period or a stricter threshold before resuming. ## Pseudocode (high-level) on_new_bar(): Calculate medSpread, medTR, MAD binUsd = max(BinSpreadFactor*medSpread*Point, BinRealizedFactor*medTR, MinBinUSD) buffer = max(BufferSpreadFactor*medSpread*Point, MinBufferUSD) fVA = build_value_area(fast cycle, LookbackMinutes, binUsd) sVA = build_value_area(slow cycle, LookbackMinutes, binUsd) if UseMTFFilter if !in_session() or in_event_blackout(): return if kill_switch() or va_too_narrow(): return z = (Close[1] - Close[1+ConfirmBars]) / MAD im = tick_imbalance(ConfirmBars) spd_wide = spread[1] >= medSpread * SpreadWidenFactor_Breakout spd_norm = spread[1] <= medSpread * SpreadNormalize_Reversion gate_long = !UseMTFFilter || (Close[1] >= POC_slow) gate_short =!UseMTFFilter || (Close[1] <= POC_slow) if EnableBreakout: if Close[1] > fVAH + buffer and z>BreakoutSpeedZ and im>ImbalanceThreshold and spd_wide and gate_long and cooldown_ok(LONG): stamp_long_arrow() if Close[1] < fVAL - buffer and z<-BreakoutSpeedZ and im<-ImbalanceThreshold and spd_wide and gate_short and cooldown_ok(SHORT): stamp_short_arrow() if EnableReversion: if was_above(fVAH, bar=2) and inside(fVA, bar=1) and z<-ReversionSpeedZ and im<=0 and spd_norm and gate_short and cooldown_ok(SHORT): stamp_short_arrow() if was_below(fVAL, bar=2) and inside(fVA, bar=1) and z> ReversionSpeedZ and im>=0 and spd_norm and gate_long and cooldown_ok(LONG): stamp_long_arrow() on_tick(): if EnablePrewarn: Calculate the near threshold condition of the current bar (0.8×threshold) If most of the breakout conditions are met and the gate passes: display a small label; otherwise clear ## Verification (TCA-like) - Time-based: Asia/London/New York separately count the trigger rate, false alarm rate, and maximum adverse fluctuation (MAE). - Spread points: the difference in performance under tight/normal/wide spread environments. - Event comparison: Comparison of the impact of blacklist on/off on false positives. - Tradeability proxy: Slippage estimate of N-root arrival price deviation after signal and simplified VWAP. ## Broker server time zone and session settings (implementation guide) - Goal: Make "active period filtering" and "hourly avoidance" consistent with the server time zone to reduce false positives and costs. - Steps: - Confirm the time difference between the server and UTC and whether it adopts daylight saving time (check the time in the market observation window, or compare the news release time and the server time difference). - Select your target active period (it is recommended to cover the opening of London to the second half of New York). - Convert the target period from UTC to server time and fill in SessionStartHour/SessionEndHour. - Recommended (generally conservative): SessionStartHour=7, SessionEndHour=22 (available on most brokers). - Recommended (common UTC+2 servers) - Winter (UTC+2): London 08–17 UTC ⇒ 10–19 server; New York 13–22 UTC ⇒ 15–24 server. - The integrated active period can be set to: 09–23 (more complete), or fine-tuned according to your liquidity preference. - Daylight Savings (UTC+3): The corresponding whole time is forwarded by 1 hour, such as 08–23. - Avoid on the hour: NoTradeMinutesAroundHour=1 (recommended to keep). - Event blacklist: Enter the server timestamp, for example: - 2025.03.14 21:30|15;2025.04.10 21:30|15 (Example: high-impact US data, radius 15 minutes). ## M1 / M5 default parameter refinement (starting suggestions) - Common: LookbackMinutes=480, ValueAreaPercent=70, AutoBin/AutoBuffer=on. - M1 (more conservative to deal with noise) - ConfirmBars=5 - BreakoutSpeedZ=1.4, ReversionSpeedZ=0.8 - ImbalanceThreshold=0.20 - SpreadWidenFactor_Breakout=1.8, SpreadNormalize_Reversion=1.3 - BinSpreadFactor=0.5, BinRealizedFactor=0.15, MinBinUSD=0.20 - BufferSpreadFactor=1.2, MinBufferUSD=0.10 - MinVAWidthUSD=1.0, MinVAWidthSpreadMult=15.0 - CooldownBars=10 - M5 (lower noise, less signal) - ConfirmBars=3 - BreakoutSpeedZ=1.2, ReversionSpeedZ=0.6 - The rest of the parameters start the same as M1; if necessary, you can increase CooldownBars to 12–15 for further reduction. ## Signal determination flow chart (ASCII) [New K-line generation] | Calculate medSpread / medTR / MAD | Dynamic binUsd / bufferUsd generation | Build fast cycle VA and slow cycle VA | Session passed? —— No ——> [End] | Blacklist window? —— Yes ——> [End] | Kill-switch trigger? —— Yes ——> [End] | VA too narrow? —— Yes ——> [End] | Calculate z_speed / imbalance | MTF gate control (POC_slow) | ┌────────────────Breakout───────────────┐ | Price out of bounds + z reaches threshold + imbalance reaches threshold + spread expansion |——Yes——> Cooling passed?——Yes——> [Marked breakthrough arrow] └───────────────────────────────────┘ | | no| v ┌──────────────Reversion─────────────┐ [Finish] | Out of the money→In price+ z reach threshold+ unbalanced support+ Spreads restored|——yes——> cooling through?——yes——> [engraved return arrow] └───────────────────────────────────┘ | | novv [Finish] [Finish] (Tick period) likeEnablePrewarn: by0.8× threshold evaluation currentbar Breakthrough tendency& If the gate is satisfied, the "PREWARN" label will be displayed; if it is not satisfied, it will be cleared ## Subsequent scalability - adaptive double buffering based on tail risk quantification. - A higher slow cycle (such as H1) serves as enhanced gating when news is intensive. - Lightweight execution of EA using different order rhythms to simulate implementation shortfall. ## Instructions for use (quick start) - Installation and loading - Put InstitutionalBalanceSignal.mq4 into MQL4/Indicators/, compile it in MT4 "Navigator-Indicators" and load it into the M1/M5 chart of XAUUSD. - For the first time, it is recommended to observe whether the value zone line is reasonable on M5, and then switch to M1. - Recommended first set of settings (can be kept as default) - LookbackMinutes=480, ValueAreaPercent=70; AutoBin/AutoBuffer=true. - ConfirmBars=5(M1)/3(M5), BreakoutSpeedZ=1.4/1.2, ReversionSpeedZ=0.8/0.6, ImbalanceThreshold=0.20. - SpreadWidenFactor_Breakout=1.8, SpreadNormalize_Reversion=1.3. - UseMTFFilter=true, SlowTF=M15; SessionStartHour=7, SessionEndHour=22, NoTradeMinutesAroundHour=1. - EnablePrewarn=true (only corner prompts are displayed, no markings are dropped). - Event blacklist - Enter the server timestamp and radius (minutes) in EventBlackoutCsv, in the format: 2025.03.14 21:30|15;2025.04.10 21:30|15. ### Parameter overview (grouped by purpose) - Window and value area: LookbackMinutes (minute window), ValueAreaPercent (coverage ratio). - Adaptive granularity and buffering: AutoBin, BinSpreadFactor, BinRealizedFactor, MinBinUSD; AutoBuffer, BufferSpreadFactor, MinBufferUSD. - Trigger confirmation: ConfirmBars, BreakoutSpeedZ, ReversionSpeedZ, ImbalanceThreshold. - Spread status: SpreadWidenFactor_Breakout, SpreadNormalize_Reversion. - Risk guards: ExtremeZFactor, ExtremeSpreadFactor, MinVAWidthUSD, MinVAWidthSpreadMult, CooldownBars. - Filter: UseMTFFilter, SlowTF, SessionStartHour/EndHour, NoTradeMinutesAroundHour, EventBlackoutCsv. - Modes: EnableBreakout, EnableReversion, EnablePrewarn. ### Operation suggestions - first use M5 to observe and fine-tune (confirm that VAH/VAL/POC can depict "stay-leave-rebalance"), and then switch to M1. - Prioritize blacklist suppression before and after strong events; observe early warnings' instead of immediate real-time trading based on signals. - When the point difference is abnormal or the value area is too narrow, it is better to be less than excessive (keep the default guard threshold or be stricter). ### Frequently Asked Questions and Adjustments - Too few signals: - Slightly relax but remain conservative: reduceBreakoutSpeedZ(slightly),ImbalanceThreshold; shortenCooldownBars; confirm whetherUseMTFFilteris over-gated. - Still need to be cautious: do not significantly relax the spread and speed threshold at the same time to avoid excessive noise. - Too many signals: - IncreaseSpreadWidenFactor_Breakout,BreakoutSpeedZ; increaseCooldownBars; increaseMinVAWidthUSDorMinVAWidthSpreadMult. - The value area is not displayed/abnormal: - Insufficient data or the window is too short: increaseLookbackMinutes; confirm that the variety, cycle, and data are loaded correctly. - Prewarning does not appear: - ConfirmEnablePrewarn=true`; check whether chart labels are obscured (zoom/switch theme). ### Non-redrawing and consistency - the arrow will only mark the previous one when the new K line arrives, and the history will not be modified; the warning will only be displayed currently, leaving no trace. - Multi-cycle (M15) only performs direction gating, does not change the fast cycle history, and the playback is consistent with real-time.
💡 Featured Recommendations
🔗 You May Be Interested In