MQL5 v1.29: Konsolidierungs-Box als Anzeige (CO;lo;hi;tight)

User: "schauen wir uns das mal an" (nach dem verworfenen Konsolidierungs-Backtest).

Der Bot exportiert die Spanne der letzten 10 M5-Bars -- exakt die Box, aus der der
validierte Squeeze-Ausbruch kommt (wave._squeeze_one liefert jetzt box_hi/box_lo in
allen Rueckgaben). Der Indikator zeichnet sie als transparentes blaues Rechteck;
ist sie KOMPRIMIERT (<=2.5xATR, also armed/active), wird sie mit doppelter Deckkraft
gezeichnet -> "Ausbruch steht bevor" ist auf einen Blick sichtbar.

Schalter: InpShowConsol / InpConsolColor / InpConsolAlpha / InpConsolBars.

⚠ REINE ANZEIGE. Alle Konsolidierungs-SETUPS sind gemessen verworfen
(backtest_consolidation.py: False Breakout, Distribution, Accumulation, Retest --
inkl. Kontrolltest, der die Distribution-Hypothese kippte). Die Box zeigt WO
gestaut wird, nicht WOHIN es geht. Validiert ist ausschliesslich der Ausbruch.

Verifiziert: CO;84.105;84.815;0 (0.710$ = 2.68xATR = knapp ueber der Schwelle,
daher korrekt als "nicht komprimiert" markiert).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Axel Hocks
2026-07-30 20:14:11 +02:00
co-authored by Claude Opus 4.8
parent 0d2d8679a7
commit 11e13cdb5a
4 changed files with 75 additions and 6 deletions
+51 -1
View File
@@ -12,7 +12,12 @@
//| 4) Der Bot muss laufen (schreibt die CSV alle ~5 s). |
//+------------------------------------------------------------------+
#property copyright "Oil Trading Bot"
#property version "1.28"
#property version "1.29"
// v1.29 (2026-07-30): KONSOLIDIERUNGS-BOX (CO;lo;hi;tight) — die Spanne der letzten
// 10 M5-Bars, aus der der validierte Squeeze-Ausbruch kommt. Komprimiert
// (<=2,5xATR) wird sie deutlicher gezeichnet. ⚠ REINE ANZEIGE: alle
// Konsolidierungs-SETUPS sind gemessen verworfen (backtest_consolidation.py) —
// die Box zeigt WO gestaut wird, nicht WOHIN es geht.
// v1.28 (2026-07-30): G/V der offenen Position direkt UNTER dem Kurs oben rechts
// (User-Wunsch) — PL;wert;waehrung, NETTO wie im Dashboard (WHT-Quellensteuer
// bei Gewinn bereits abgezogen). Gruen im Plus, rot im Minus; ohne offene
@@ -136,6 +141,10 @@ input int InpLabelSize = 12; // Schriftgroesse der Linien-Besc
input bool InpShowPBreak = true; // Durchbruchwahrscheinlichkeit am S/R-Label
input color InpLabelColor = clrWhite; // Farbe ALLER Linien-Beschriftungen (User-Wunsch: weiss)
input color InpPriceColor = clrWhite; // Kurs oben rechts (weiss)
input bool InpShowConsol = true; // Konsolidierungs-Box (10 M5-Bars) zeichnen
input color InpConsolColor = C'88,166,255'; // Box-Farbe (blau)
input int InpConsolAlpha = 8; // Deckkraft in % (komprimiert: x2)
input int InpConsolBars = 10; // Box-Laenge in Bars (= _SQ_N im Bot)
input bool InpShowPnL = true; // G/V der offenen Position unter dem Kurs
input color InpPnLUpColor = C'0,255,127'; // G/V im Plus (neongruen)
input color InpPnLDownColor = C'255,69,0'; // G/V im Minus (rot)
@@ -578,6 +587,47 @@ void Redraw()
}
continue;
}
// KONSOLIDIERUNGS-BOX: CO;lo;hi;<0|1> — die Spanne der letzten 10 M5-Bars
// (dieselbe Box, aus der der validierte Squeeze-Ausbruch kommt). Feld 3 = 1
// bedeutet KOMPRIMIERT (≤2,5×ATR) → Ausbruch steht bevor, dann kräftiger.
// ⚠ REINE ANZEIGE: alle Konsolidierungs-SETUPS (False Breakout, Distribution,
// Accumulation, Retest) sind gemessen verworfen — die Box sagt WO gestaut
// wird, nicht WOHIN es geht.
if(typ == "CO")
{
if(k < 3) continue;
if(!InpShowConsol) continue;
double clo = StringToDouble(p[1]), chi = StringToDouble(p[2]);
bool tight = (k > 3 && p[3] == "1");
if(clo <= 0 || chi <= clo) continue;
datetime ct0 = iTime(_Symbol, PERIOD_CURRENT, 0)
- (datetime)(PeriodSeconds() * InpConsolBars);
datetime ct1 = RightTime();
string cn = PFX + "CONSOL";
if(ObjectCreate(0, cn, OBJ_RECTANGLE, 0, ct0, clo, ct1, chi))
{
ObjectSetInteger(0, cn, OBJPROP_STYLE, STYLE_SOLID);
ObjectSetInteger(0, cn, OBJPROP_WIDTH, 1);
ObjectSetInteger(0, cn, OBJPROP_FILL, true);
ObjectSetInteger(0, cn, OBJPROP_BACK, true);
ObjectSetInteger(0, cn, OBJPROP_SELECTABLE, false);
}
else
{
ObjectMove(0, cn, 0, ct0, clo);
ObjectMove(0, cn, 1, ct1, chi);
}
// komprimiert = deutlicher sichtbar (Ausbruch steht bevor)
ObjectSetInteger(0, cn, OBJPROP_COLOR,
BlendBg(InpConsolColor, tight ? InpConsolAlpha * 2
: InpConsolAlpha));
ObjectSetString (0, cn, OBJPROP_TOOLTIP,
(tight ? "Konsolidierung (komprimiert - Ausbruch steht bevor)"
: "aktuelle 10-Bar-Spanne")
+ " " + DoubleToString(clo, (int)_Digits) + " - "
+ DoubleToString(chi, (int)_Digits));
continue;
}
// AKTUELLER KURS oben rechts, fett (User-Wunsch): PX;bid
if(typ == "PX")
{