The “Two-Bar Auction” Framework
Below you’ll find:
- A formal model that converts the narrative idea into an unambiguous rule set.
- “Bi-Bar Auction Oscillator” (BBAO) – a multi-time-frame indicator you can code in MT4/MT5, TradingView, etc.
- A single, complete trading strategy (entry, exit, filter, risk, walk-forward ideas).
- Pseudocode / MQL4 snippets so a quant or discretionary trader can implement immediately.
1. Formalising the Two-Bar Auction
1.1 The States
Every bar is stamped with a Bias determined by where it closes in its own range:
| Label | Formula (using absolute, not Heikin-Ashi) | Market Psychology |
|---|
| U1 (Drive-Up) | Close ≥ High – 0.15·Range | One-way auction up – little resistance |
| U2 (Rejection-Up) | Low = session low AND (High-Close) ≥ 0.5·Range | Probe ↓, buyers absorbed, price rockets up |
| U3 (Collapse-Up) | Close ≤ Low + 0.20·Range AND High-Close ≥ 0.5·Range (close still above open) | Rally sold aggressively but still ends green |
| D1 / D2 / D3 | Symmetric to above, reversed | Mirror images |
(You may change 0.15 / 0.20 / 0.5 after optimisation.)
A bar that is not classified above is marked “N” (neutral) and ignored by the oscillator.
1.2 The Cycle
Rule: Every confirmed U-bar is expected to be followed by a D-bar and vice-versa.
Therefore, a two-bar pair = (U?, D?) or (D?, U?).
If the second bar does not deliver the opposite label, the cycle is “incomplete” and the next bar is still expected to deliver it (max 2-bar extension).
This mechanical rule is what makes the pattern “continuous”.
2. Bi-Bar Auction Oscillator (BBAO)
2.1 Single-Time-Frame Version
BBAO_t =
+1 if current bar is U-type AND previous classified bar was D-type
-1 if current bar is D-type AND previous classified bar was U-type
0 otherwise
Plot as a histogram at the OPEN of every bar; do not repaint.
2.2 Multi-Time-Frame Stacking
Calculate BBAO on e.g. M5, M15, H1, H4, D1.
Composite Auction Index (CAI):
CAI_t = Σ ( w_i · BBAO_t(i) )
Weights (example):
M5 w = 1
M15 w = 2
H1 w = 3
H4 w = 4
D1 w = 5
Range: –15 … +15.
Visual: green bars above zero, red below.
A ±8 threshold means at least three higher-weights agree on direction.
3. The Actionable Strategy
3.1 Context Filter
Trade only when:
• CAI ≥ +8 → long-only window
• CAI ≤ –8 → short-only window
Else = flat / manage open positions.
3.2 Entry (Intra-Session Scalps)
- Work off the execution chart = M5.
- Wait for the very first pullback against CAI direction (1-3 candles).
- Enter at market the moment BBAO(M5) flips back in line with CAI.
Example long:
CAI = +10 → bias long.
M5 prints a red (D) bar, BBAO(M5)=-1.
Next bar turns U, BBAO(M5)=+1 → buy immediately at that bar’s open.
3.3 Initial Stop
Stop = max(
• Opposite extreme of the pair (low of the last D-bar for longs) + safety buffer,
• 0.8 × ATR(14) on M5
)
3.4 Target & Management
• First scale = 1 × risk.
• Move stop to breakeven immediately.
• Second scale or trail = exit when BBAO(M5) flips again OR at session close.
3.5 Risk & Position Sizing
• 0.5 % account equity per trade.
• Max 3 open positions per bias window.
• Daily loss limit 2 %.
4. Implementation Snippets (MQL4)
//+------------------------------------------------------------------+
double Weight(string tf) {
if(tf=="M5") return 1;
if(tf=="M15") return 2;
if(tf=="H1") return 3;
if(tf=="H4") return 4;
if(tf=="D1") return 5;
return 0;
}
// classify a bar
int Bias(int shift) {
double O = iOpen(Symbol(),0,shift);
double H = iHigh(Symbol(),0,shift);
double L = iLow(Symbol(),0,shift);
double C = iClose(Symbol(),0,shift);
double R = H-L;
if(R==0) return 0;
// U1
if(C >= H - 0.15*R && C>O) return 1;
// U2
if(L==Low[shift] && (H-C) >= 0.5*R && C>O) return 1;
// U3
if(C <= L + 0.2*R && (H-C)>=0.5*R && C>O) return 1;
// Mirror for D
if(C <= L + 0.15*R && C<O) return -1;
if(H==High[shift] && (C-L)>=0.5*R && C<O) return -1;
if(C >= H - 0.2*R && (C-L)>=0.5*R && C<O) return -1;
return 0;
}
int OnCalculate(...) {
// compute BBAO on this TF
for(int i=Bars-2; i>=0; i--) {
int b = Bias(i);
int prev = 0;
// find previous classified bar
for(int j=i+1; j<Bars && prev==0; j++) prev = Bias(j);
if( b==1 && prev==-1) buffer[i] = 1;
else if( b==-1 && prev== 1) buffer[i] = -1;
else buffer[i]=0;
}
return(rates_total);
}
(Replicate in higher time-frames and pass the buffer via iCustom to main chart, then compute CAI.)
5. Why It Works
- The two-bar pattern is a micro expression of auction theory: initiative vs responsive activity.
- By forcing alignment across nested time-frames you ride the path of least resistance—institutional flows echo across scales.
- Risk is bounded to one micro-cycle; reward exploits momentum when multiple cycles align.
6. Forward Testing & Optimisation Checklist
• Walk-forward 2016-18, 2019-21, 2022-24 on EURUSD, XAUUSD, ES.
• Optimise the close-position thresholds (0.15/0.2/0.5) and CAI threshold (6-10).
• Monte-Carlo randomise sequence – expectancy must stay > 0.35 R per trade.
• Incorporate specific session filters (e.g., London, NY) for intraday futures.
7. Final Notes & Extensions
• Turning BBAO into a Market-Making Map: treat each new opposite bar that fails to appear as “unfinished business”; expect price magnetism back to that extreme.
• Can be merged with VWAP deviations for institutions.
• On H4/D1 the same logic becomes an intra-week swing tool—BBAO(H4)=+1 while BBAO(D1)=-1 ⇒ fade the last push into higher-time-frame supply.
Use the above as a skeleton; adapt numbers, choose your instruments, and test first before going live. Happy auction hunting!