kleine korrektur
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// =================================================================================================
|
||||
// Croc Vibes by Telgos – Version 4.2.0
|
||||
// Croc Vibes by Telgos – Version 4.2.1
|
||||
// Lizenz: Mozilla Public License 2.0 – https://mozilla.org/MPL/2.0/
|
||||
// Danksagung (Basis/Ideen): amper04, ray_duke, husky, Audidriver13
|
||||
// =================================================================================================
|
||||
@@ -41,7 +41,7 @@ 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 (der Block ist derzeit auskommentiert)", group="Darstellung")
|
||||
show_price_labels = input.bool(true, "Preis-Textboxen an Blues-Linien anzeigen (steuert auch die blauen Linien im Chart)", group="Darstellung")
|
||||
|
||||
// ========= Helper =========
|
||||
asBool(src) => nz(src) > 0
|
||||
@@ -135,6 +135,7 @@ short_blue_now = r_inZone and f_rise(blauer_punkt_long)
|
||||
long_start_ok = long_blue_now and not na(g_zoneHigh_prev)
|
||||
short_start_ok = short_blue_now and not na(r_zoneLow_prev)
|
||||
|
||||
// --- State & Zeichnungsobjekte ---
|
||||
var bool long_pending_active = false
|
||||
var float long_refHigh = na
|
||||
var label startLblLong = na
|
||||
@@ -145,6 +146,7 @@ var float short_refLow = na
|
||||
var label startLblShort = na
|
||||
var line shortPendingLine = na
|
||||
|
||||
// --- Events (für Alerts) ---
|
||||
var bool ev_long_start = false
|
||||
var bool ev_short_start = false
|
||||
var bool ev_long_done = false
|
||||
@@ -158,30 +160,63 @@ ev_short_done := false
|
||||
ev_long_break := false
|
||||
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
|
||||
if short_pending_active
|
||||
if not na(startLblShort)
|
||||
label.delete(startLblShort)
|
||||
startLblShort := na
|
||||
if not na(shortPendingLine)
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := na
|
||||
short_pending_active := false
|
||||
short_refLow := na
|
||||
|
||||
long_pending_active := true
|
||||
long_refHigh := g_zoneHigh_prev
|
||||
ev_long_start := true
|
||||
|
||||
if high < long_refHigh
|
||||
if not na(startLblLong)
|
||||
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)
|
||||
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)
|
||||
|
||||
// Linie nur zeichnen, wenn Preis-Textboxen-Toggle an ist
|
||||
if show_price_labels
|
||||
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
|
||||
if long_pending_active
|
||||
if not na(startLblLong)
|
||||
label.delete(startLblLong)
|
||||
startLblLong := na
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := na
|
||||
long_pending_active := false
|
||||
long_refHigh := na
|
||||
|
||||
short_pending_active := true
|
||||
short_refLow := r_zoneLow_prev
|
||||
ev_short_start := true
|
||||
|
||||
if low > short_refLow
|
||||
if not na(startLblShort)
|
||||
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)
|
||||
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)
|
||||
|
||||
// Linie nur zeichnen, wenn Preis-Textboxen-Toggle an ist
|
||||
if show_price_labels
|
||||
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)
|
||||
|
||||
// --- Fulfillment / Cloud-Break ---
|
||||
long_fulfilled_now = long_pending_active and high >= long_refHigh
|
||||
short_fulfilled_now = short_pending_active and low <= short_refLow
|
||||
long_cloud_break = long_pending_active and not g_active
|
||||
@@ -199,6 +234,7 @@ if short_cloud_break
|
||||
end_long = long_pending_active and (long_fulfilled_now or long_cloud_break)
|
||||
end_short = short_pending_active and (short_fulfilled_now or short_cloud_break)
|
||||
|
||||
// --- End Long (inline) ---
|
||||
if end_long
|
||||
if not na(startLblLong)
|
||||
label.delete(startLblLong)
|
||||
@@ -209,6 +245,7 @@ if end_long
|
||||
long_pending_active := false
|
||||
long_refHigh := na
|
||||
|
||||
// --- End Short (inline) ---
|
||||
if end_short
|
||||
if not na(startLblShort)
|
||||
label.delete(startLblShort)
|
||||
@@ -219,6 +256,15 @@ if end_short
|
||||
short_pending_active := false
|
||||
short_refLow := na
|
||||
|
||||
// --- Wenn Preis-Textboxen-Toggle AUS: evtl. vorhandene Linien entfernen ---
|
||||
if not show_price_labels
|
||||
if not na(longPendingLine)
|
||||
line.delete(longPendingLine)
|
||||
longPendingLine := na
|
||||
if not na(shortPendingLine)
|
||||
line.delete(shortPendingLine)
|
||||
shortPendingLine := 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}}")
|
||||
@@ -315,41 +361,13 @@ telgos_2bar_prime_cond = long_pending_active and trigger_now_or_prev and (not re
|
||||
alertcondition(telgos_2bar_prime_cond, title="Telgos 2-Bar-Prime", message="Telgos 2-Bar-Prime – {{ticker}} {{interval}}")
|
||||
|
||||
// ========= Preis-Textboxen an blauen Linien (Toggle) =========
|
||||
// Der gesamte Block ist auskommentiert, damit keine Zahlen-Labels mehr auf den Linien erscheinen.
|
||||
// Zum Reaktivieren einfach die '//' entfernen.
|
||||
|
||||
// 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)
|
||||
// int lx1 = line.get_x1(longPendingLine)
|
||||
// float ly1 = line.get_y1(longPendingLine)
|
||||
// string tL = str.tostring(ly1, format.mintick)
|
||||
// if na(priceLblLong)
|
||||
// priceLblLong := label.new(lx1, ly1, tL, 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, lx1)
|
||||
// label.set_y(priceLblLong, ly1)
|
||||
// label.set_text(priceLblLong, tL)
|
||||
// else
|
||||
// if not na(priceLblLong)
|
||||
// label.delete(priceLblLong)
|
||||
// priceLblLong := na
|
||||
|
||||
// ...
|
||||
// if show_price_labels and short_pending_active and not na(shortPendingLine)
|
||||
// int sx1 = line.get_x1(shortPendingLine)
|
||||
// float sy1 = line.get_y1(shortPendingLine)
|
||||
// string tS = str.tostring(sy1, format.mintick)
|
||||
// if na(priceLblShort)
|
||||
// priceLblShort := label.new(sx1, sy1, 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, sx1)
|
||||
// label.set_y(priceLblShort, sy1)
|
||||
// label.set_text(priceLblShort, tS)
|
||||
// else
|
||||
// if not na(priceLblShort)
|
||||
// label.delete(priceLblShort)
|
||||
// priceLblShort := na
|
||||
// ...
|
||||
|
||||
// ========= Preisskala-Labels =========
|
||||
grpPS = "Preisskala-Labels"
|
||||
@@ -376,17 +394,8 @@ ps_blues_val = show_ps_blues and short_pending_active ? short_refLow : na
|
||||
ps_bluel_last = barstate.islast ? ps_bluel_val : na
|
||||
ps_blues_last = barstate.islast ? ps_blues_val : na
|
||||
|
||||
plot(ps_bluel_last,
|
||||
title = "Blues Long-Level",
|
||||
color = col_ps_bluel,
|
||||
trackprice = true,
|
||||
display = display.price_scale)
|
||||
|
||||
plot(ps_blues_last,
|
||||
title = "Blues Short-Level",
|
||||
color = col_ps_blues,
|
||||
trackprice = true,
|
||||
display = display.price_scale)
|
||||
plot(ps_bluel_last, title="Blues Long-Level", color=col_ps_bluel, trackprice=true, display=display.price_scale)
|
||||
plot(ps_blues_last, title="Blues Short-Level", color=col_ps_blues, trackprice=true, display=display.price_scale)
|
||||
|
||||
// ========= Dezente Labels / Shapes =========
|
||||
if isPearlLong
|
||||
|
Reference in New Issue
Block a user