getrennte schalter für blaue linie und textbox
This commit is contained in:
@@ -41,7 +41,14 @@ src1 = input.source(close, "Day OverBought 1", group="MSI")
|
||||
|
||||
// ========= Darstellung =========
|
||||
label_offset_mult = input.float(1.5, title="Label-Abstand (ATR x)", minval=0.1, step=0.1, group="Darstellung")
|
||||
show_price_labels = input.bool(true, "Preis-Textboxen an Blues-Linien anzeigen (steuert auch die blauen Linien im Chart)", group="Darstellung")
|
||||
show_price_textbox = input.bool(true, "Preis-Textboxen an Blues-Level anzeigen", group="Darstellung")
|
||||
show_blues_lines = input.bool(true, "Blaue Pending-Linien im Chart anzeigen", group="Darstellung")
|
||||
show_ps_wolke = input.bool(true, "Wolke Linie Pink auf Preisskala", group="Darstellung")
|
||||
show_ps_bluel = input.bool(true, "Blues Long-Level auf Preisskala (nur aktiv)", group="Darstellung")
|
||||
show_ps_blues = input.bool(true, "Blues Short-Level auf Preisskala (nur aktiv)", group="Darstellung")
|
||||
col_ps_wolke = input.color(color.new(color.fuchsia, 0), "Farbe: Wolke Pink", group="Darstellung")
|
||||
col_ps_bluel = input.color(color.new(color.blue, 0), "Farbe: Blues Long", group="Darstellung")
|
||||
col_ps_blues = input.color(color.new(color.blue, 0), "Farbe: Blues Short", group="Darstellung")
|
||||
|
||||
// ========= Helper =========
|
||||
asBool(src) => nz(src) > 0
|
||||
@@ -146,6 +153,10 @@ var float short_refLow = na
|
||||
var label startLblShort = na
|
||||
var line shortPendingLine = na
|
||||
|
||||
// --- Preis-Textboxen (Labels) ---
|
||||
var label priceLblLong = na
|
||||
var label priceLblShort = na
|
||||
|
||||
// --- Events (für Alerts) ---
|
||||
var bool ev_long_start = false
|
||||
var bool ev_short_start = false
|
||||
@@ -162,7 +173,7 @@ ev_short_break := false
|
||||
|
||||
// --- Start Long ---
|
||||
if long_start_ok and not long_pending_active
|
||||
// Gegen-Zone beenden → es darf immer nur 1 Zone aktiv sein
|
||||
// Gegen-Zone beenden → immer nur 1 Zone aktiv
|
||||
if short_pending_active
|
||||
if not na(startLblShort)
|
||||
label.delete(startLblShort)
|
||||
@@ -170,6 +181,9 @@ if long_start_ok and not long_pending_active
|
||||
if not na(shortPendingLine)
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := na
|
||||
if not na(priceLblShort)
|
||||
label.delete(priceLblShort)
|
||||
priceLblShort := na
|
||||
short_pending_active := false
|
||||
short_refLow := na
|
||||
|
||||
@@ -182,15 +196,15 @@ if long_start_ok and not long_pending_active
|
||||
label.delete(startLblLong)
|
||||
startLblLong := label.new(bar_index, high + atr * label_offset_mult, "Ein Hoch kommt noch", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_down, color=color.blue, textcolor=color.white, size=size.small)
|
||||
|
||||
// Linie nur zeichnen, wenn Preis-Textboxen-Toggle an ist
|
||||
if show_price_labels
|
||||
// Linie nur, wenn Haken gesetzt
|
||||
if show_blues_lines
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := line.new(bar_index, long_refHigh, bar_index + 1, long_refHigh, xloc=xloc.bar_index, extend=extend.right, color=color.blue, width=2)
|
||||
|
||||
// --- Start Short ---
|
||||
if short_start_ok and not short_pending_active
|
||||
// Gegen-Zone beenden → es darf immer nur 1 Zone aktiv sein
|
||||
// Gegen-Zone beenden → immer nur 1 Zone aktiv
|
||||
if long_pending_active
|
||||
if not na(startLblLong)
|
||||
label.delete(startLblLong)
|
||||
@@ -198,6 +212,9 @@ if short_start_ok and not short_pending_active
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := na
|
||||
if not na(priceLblLong)
|
||||
label.delete(priceLblLong)
|
||||
priceLblLong := na
|
||||
long_pending_active := false
|
||||
long_refHigh := na
|
||||
|
||||
@@ -210,8 +227,8 @@ if short_start_ok and not short_pending_active
|
||||
label.delete(startLblShort)
|
||||
startLblShort := label.new(bar_index, low - atr * label_offset_mult, "Ein Tief kommt noch", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_up, color=color.blue, textcolor=color.white, size=size.small)
|
||||
|
||||
// Linie nur zeichnen, wenn Preis-Textboxen-Toggle an ist
|
||||
if show_price_labels
|
||||
// Linie nur, wenn Haken gesetzt
|
||||
if show_blues_lines
|
||||
if not na(shortPendingLine)
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := line.new(bar_index, short_refLow, bar_index + 1, short_refLow, xloc=xloc.bar_index, extend=extend.right, color=color.blue, width=2)
|
||||
@@ -242,6 +259,9 @@ if end_long
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := na
|
||||
if not na(priceLblLong)
|
||||
label.delete(priceLblLong)
|
||||
priceLblLong := na
|
||||
long_pending_active := false
|
||||
long_refHigh := na
|
||||
|
||||
@@ -253,11 +273,14 @@ if end_short
|
||||
if not na(shortPendingLine)
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := na
|
||||
if not na(priceLblShort)
|
||||
label.delete(priceLblShort)
|
||||
priceLblShort := na
|
||||
short_pending_active := false
|
||||
short_refLow := na
|
||||
|
||||
// --- Wenn Preis-Textboxen-Toggle AUS: evtl. vorhandene Linien entfernen ---
|
||||
if not show_price_labels
|
||||
// --- Linien entfernen, wenn Haken aus ---
|
||||
if not show_blues_lines
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := na
|
||||
@@ -265,6 +288,38 @@ if not show_price_labels
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := na
|
||||
|
||||
// --- Preis-Textboxen zeichnen / aktualisieren ---
|
||||
if show_price_textbox and long_pending_active
|
||||
// x-Position: wenn Linie existiert, nimm deren Start; sonst aktuelle Kerze
|
||||
int lx = na(longPendingLine) ? bar_index : line.get_x1(longPendingLine)
|
||||
float ly = long_refHigh
|
||||
string t = str.tostring(ly, format.mintick)
|
||||
if na(priceLblLong)
|
||||
priceLblLong := label.new(lx, ly, t, xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_right, textcolor=color.blue, color=color.new(color.white, 100), size=size.normal)
|
||||
else
|
||||
label.set_x(priceLblLong, lx)
|
||||
label.set_y(priceLblLong, ly)
|
||||
label.set_text(priceLblLong, t)
|
||||
else
|
||||
if not na(priceLblLong)
|
||||
label.delete(priceLblLong)
|
||||
priceLblLong := na
|
||||
|
||||
if show_price_textbox and short_pending_active
|
||||
int sx = na(shortPendingLine) ? bar_index : line.get_x1(shortPendingLine)
|
||||
float sy = short_refLow
|
||||
string ts = str.tostring(sy, format.mintick)
|
||||
if na(priceLblShort)
|
||||
priceLblShort := label.new(sx, sy, ts, xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_right, textcolor=color.blue, color=color.new(color.white, 100), size=size.normal)
|
||||
else
|
||||
label.set_x(priceLblShort, sx)
|
||||
label.set_y(priceLblShort, sy)
|
||||
label.set_text(priceLblShort, ts)
|
||||
else
|
||||
if not na(priceLblShort)
|
||||
label.delete(priceLblShort)
|
||||
priceLblShort := na
|
||||
|
||||
// ========= Alerts: Standard =========
|
||||
alertcondition(isPearlLong, title="Pearl Long", message="Pearl Diver erkannt – {{ticker}} {{interval}}")
|
||||
alertcondition(isPearlShort, title="Pearl Short", message="Oyster Farmer erkannt – {{ticker}} {{interval}}")
|
||||
@@ -360,26 +415,9 @@ cond_since_start = not na(since_start) and not na(since_trigger) and since_trigg
|
||||
telgos_2bar_prime_cond = long_pending_active and trigger_now_or_prev and (not require_since_start or cond_since_start)
|
||||
alertcondition(telgos_2bar_prime_cond, title="Telgos 2-Bar-Prime", message="Telgos 2-Bar-Prime – {{ticker}} {{interval}}")
|
||||
|
||||
// ========= Preis-Textboxen an blauen Linien (Toggle) =========
|
||||
// Der frühere Zahlen-Textbox-Block ist deaktiviert (auskommentiert). Zum Reaktivieren '//' entfernen.
|
||||
// var label priceLblLong = na
|
||||
// var label priceLblShort = na
|
||||
// if show_price_labels and long_pending_active and not na(longPendingLine)
|
||||
// ...
|
||||
// if show_price_labels and short_pending_active and not na(shortPendingLine)
|
||||
// ...
|
||||
|
||||
// ========= Preisskala-Labels =========
|
||||
grpPS = "Preisskala-Labels"
|
||||
show_ps_wolke = input.bool(true, "Wolke Linie Pink auf Preisskala", group=grpPS)
|
||||
show_ps_bluel = input.bool(true, "Blues Long-Level auf Preisskala (nur aktiv)", group=grpPS)
|
||||
show_ps_blues = input.bool(true, "Blues Short-Level auf Preisskala (nur aktiv)", group=grpPS)
|
||||
|
||||
col_ps_wolke = input.color(color.new(color.fuchsia, 0), "Farbe: Wolke Pink", group=grpPS)
|
||||
col_ps_bluel = input.color(color.new(color.blue, 0), "Farbe: Blues Long", group=grpPS)
|
||||
col_ps_blues = input.color(color.new(color.blue, 0), "Farbe: Blues Short", group=grpPS)
|
||||
|
||||
// Wolke (Pink): Linie im Pane + Preisskaleneintrag
|
||||
// Wolke (Pink) – Linie im Pane + Preisskaleneintrag
|
||||
plot(show_ps_wolke ? wolke_Line_pink : na,
|
||||
title = "Wolke Pink",
|
||||
color = col_ps_wolke,
|
||||
|
Reference in New Issue
Block a user