MQL5 v1.23: Pfeile wieder gruen/rot, Beschriftungen weiss + rechtsbuendig-Fix

User-Vorgaben: Pfeile rot/gruen behalten, Beschriftungen komplett rechtsbuendig,
alle Beschriftungen weiss, Liquiditaets-Trendlinie neongruen wie der Up-Pfeil.

(a) Pfeile zurueck: Bid NEONGRUEN #00FF7F, Ask ROT #FF4500 (statt Gold).
(b) Liquiditaets-Trendlinie neongruen statt pink.
(c) FIX "nicht komplett rechtsbuendig": auf den Linien war OBJPROP_TEXT gesetzt --
    diesen Text zeichnet MT5 IMMER LINKS am Chartrand (Option
    "Objektbeschreibungen"). Jetzt OBJPROP_TOOLTIP + CHART_SHOW_OBJECT_DESCR=false.
    Betrifft S/R-Linien und Kanal.
(d) Alle Beschriftungen weiss (InpLabelColor) -- die Linien behalten ihre Farbe,
    nur der Text ist einheitlich. Kurs oben rechts ebenfalls weiss.
(e) MT5-Positions-Labels ("sell 0.36 ...") stehen systembedingt LINKS und lassen
    sich NICHT verschieben -- nur ab-/anschaltbar via InpShowTradeLevels.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Axel Hocks
2026-07-30 18:54:23 +02:00
co-authored by Claude Opus 4.8
parent 73712b5ea7
commit a58c6804ba
2 changed files with 31 additions and 10 deletions
+30 -9
View File
@@ -12,7 +12,17 @@
//| 4) Der Bot muss laufen (schreibt die CSV alle ~5 s). |
//+------------------------------------------------------------------+
#property copyright "Oil Trading Bot"
#property version "1.22"
#property version "1.23"
// v1.23 (2026-07-30): (a) Pfeile wieder NEONGRUEN/ROT statt Gold (User-Wunsch).
// (b) Liquiditaets-Trendlinie neongruen wie der Up-Pfeil (statt pink).
// (c) FIX „Beschriftungen nicht komplett rechtsbuendig": auf den Linien war
// OBJPROP_TEXT gesetzt — den zeichnet MT5 LINKS am Chartrand. Jetzt
// OBJPROP_TOOLTIP + CHART_SHOW_OBJECT_DESCR=false.
// (e) ALLE Beschriftungen weiss (InpLabelColor) — die Linien behalten
// ihre Farbe, nur der Text ist einheitlich weiss.
// (d) MT5-Positions-Labels ("sell 0.36") stehen systembedingt LINKS und
// koennen nicht verschoben werden -> nur ab-/anschaltbar via
// InpShowTradeLevels.
// v1.22 (2026-07-30): Aufraeumen nach User-Feedback „das Bild sieht komisch aus":
// (a) Trade-Umrandungen ENTFERNT (InpShowTrades=false, Export im Bot aus).
// (b) Liquiditaets-Trendlinie nicht mehr RAY_RIGHT — eine 60-min-Regression
@@ -85,10 +95,10 @@ input bool InpRangeFill = false; // Range füllen (aus = nur Umris
input bool InpShowChannel = true; // Regressionskanal (M30) zeichnen
input color InpChanColor = clrYellow; // Kanal-Farbe
input bool InpShowWalls = true; // echte Liquiditäts-Wände (Hyperliquid-Orderbuch)
input color InpWallBidColor = C'245,158,11'; // Liquidität Nachfrage (Bid) — Gold
input color InpWallAskColor = C'245,158,11'; // Liquidität Angebot (Ask) — Gold
input color InpWallBidColor = C'0,255,127'; // Liquiditaet Nachfrage (Bid) — NEONGRUEN
input color InpWallAskColor = C'255,69,0'; // Liquiditaet Angebot (Ask) — ROT
input bool InpShowLiqTrend = true; // Liquiditäts-Trendlinie zeichnen
input color InpLiqTrendColor = clrMagenta; // Liquiditäts-Trend (pink)
input color InpLiqTrendColor = C'0,255,127'; // Liquiditaets-Trend — NEONGRUEN (wie Up-Pfeil)
input bool InpLiqTrendLabel = false; // Beschriftung der Trendlinie (aus per User-Wunsch)
input bool InpShowTrades = false; // Trade-Kerzen umranden (AUS per User-Wunsch)
input color InpTradeOpenColor = C'134,239,172'; // Eroeffnung — hellgruen
@@ -99,7 +109,8 @@ input int InpLiqZoneAlpha = 10; // Deckkraft der Zonenfuellung in
input bool InpShowPrice = true; // aktuellen Kurs oben rechts anzeigen
input int InpPriceSize = 20; // Schriftgroesse des Kurses
input int InpLabelSize = 12; // Schriftgroesse der Linien-Beschriftungen (+4 per User-Wunsch)
input color InpPriceColor = C'230,237,243'; // Kurs-Farbe
input color InpLabelColor = clrWhite; // Farbe ALLER Linien-Beschriftungen (User-Wunsch: weiss)
input color InpPriceColor = clrWhite; // Kurs oben rechts (weiss)
// ── Chart-THEME (User-Vorgabe 2026-07-30 „Farben im MT5 wie im Bild") ────────
// Setzt beim Start die Chart-Eigenschaften auf die Dashboard-Palette, damit MT5
// und die PWA gleich aussehen. Farben in MQL5-Notation C'R,G,B'.
@@ -115,6 +126,7 @@ input color InpThemeGrid = C'16,21,28'; // Gitternetz (dezent)
input color InpThemeText = C'139,148,158'; // Achsen/Text
input color InpThemeBidLine = clrWhite; // aktuelle Kurslinie (Bid) — weiss
input double InpShiftPct = 12.0; // Platz rechts fuer Pfeile/Labels (% der Chartbreite)
input bool InpShowTradeLevels = true; // MT5-Positionslinien+Labels (stehen immer LINKS)
const string PFX = "SRB_"; // Präfix S/R-Linien (aus Datei)
const string RPFX = "SRR_"; // Präfix dynamische Range (aus Chart)
@@ -184,6 +196,12 @@ void ApplyTheme()
// Beschriftungen hinpassen. Ohne Begrenzung stand der Kursverlauf ganz links
// gequetscht (User-Feedback „das Bild sieht komisch aus", 2026-07-30).
ChartSetDouble(0, CHART_SHIFT_SIZE, InpShiftPct);
// MT5 zeichnet Objekt-BESCHREIBUNGEN immer LINKS an den Chartrand — aus, damit
// nur die eigenen, rechtsbuendigen Labels sichtbar sind (User-Vorgabe).
ChartSetInteger(0, CHART_SHOW_OBJECT_DESCR, false);
// Positions-/Order-Beschriftungen ("sell 0.36 ...") stehen bei MT5 fest LINKS und
// lassen sich NICHT nach rechts holen — nur ganz aus- oder einschalten.
ChartSetInteger(0, CHART_SHOW_TRADE_LEVELS, InpShowTradeLevels);
ChartRedraw();
}
//+------------------------------------------------------------------+
@@ -366,7 +384,10 @@ void Redraw()
ObjectSetInteger(0, nm, OBJPROP_WIDTH, 1);
ObjectSetInteger(0, nm, OBJPROP_BACK, true);
ObjectSetInteger(0, nm, OBJPROP_SELECTABLE, false);
ObjectSetString (0, nm, OBJPROP_TEXT, lbl); // Tooltip
// ⚠ TOOLTIP, NICHT OBJPROP_TEXT: den TEXT zeichnet MT5 LINKS am
// Chartrand (Option „Objektbeschreibungen") — das war die
// linksbuendige Beschriftung. Als Tooltip stoert er nicht.
ObjectSetString (0, nm, OBJPROP_TOOLTIP, lbl);
}
// Beschriftung als eigenes Text-Objekt — RECHTSBÜNDIG am rechten Chart-
// Rand (User-Vorgabe 2026-07-30; vorher horizontal zentriert). Bleibt via
@@ -376,7 +397,7 @@ void Redraw()
if(ObjectCreate(0, tn, OBJ_TEXT, 0, RightTime(), price))
{
ObjectSetString (0, tn, OBJPROP_TEXT, lbl);
ObjectSetInteger(0, tn, OBJPROP_COLOR, col);
ObjectSetInteger(0, tn, OBJPROP_COLOR, InpLabelColor);
ObjectSetInteger(0, tn, OBJPROP_FONTSIZE, InpLabelSize);
ObjectSetInteger(0, tn, OBJPROP_ANCHOR, ANCHOR_RIGHT_LOWER);
ObjectSetInteger(0, tn, OBJPROP_BACK, false);
@@ -406,7 +427,7 @@ void Redraw()
ObjectSetInteger(0, nm, OBJPROP_RAY_LEFT, false);
ObjectSetInteger(0, nm, OBJPROP_BACK, true);
ObjectSetInteger(0, nm, OBJPROP_SELECTABLE, false);
ObjectSetString (0, nm, OBJPROP_TEXT, "Kanal " + kind);
ObjectSetString (0, nm, OBJPROP_TOOLTIP, "Kanal " + kind);
}
continue;
}
@@ -625,7 +646,7 @@ void Redraw()
if(ObjectCreate(0, tl, OBJ_TEXT, 0, t2, q2))
{
ObjectSetString (0, tl, OBJPROP_TEXT, tt);
ObjectSetInteger(0, tl, OBJPROP_COLOR, InpLiqTrendColor);
ObjectSetInteger(0, tl, OBJPROP_COLOR, InpLabelColor);
ObjectSetInteger(0, tl, OBJPROP_FONTSIZE, InpLabelSize);
ObjectSetInteger(0, tl, OBJPROP_ANCHOR, ANCHOR_LOWER);
ObjectSetInteger(0, tl, OBJPROP_SELECTABLE, false);