SK-Trading ABC Indicator Script
SK-Trading ABC Indicator Script
0
at [Link]
// Join our channel for more free tools: [Link]
//@version=6
indicator("SK-Trading ABC - Stefan Style ULTIMATE", overlay=true,
max_boxes_count=150, max_lines_count=200, max_labels_count=120)
// ============================================================================
// INPUTS
// ============================================================================
swingLength = [Link](10, "Swing Length", minval=5, maxval=30, group="Struktur")
showProjection = [Link](true, "Zeige Ziel-Box C (1.618-2.0)", group="Display")
showActivation = [Link](true, "Zeige Aktivierungslinie", group="Display")
showRMultiples = [Link](true, "Zeige R-Multiples (2R, 3R)", group="Display")
showGKL = [Link](true, "Zeige GKL-Box nach C", group="Display")
// Trade Settings
stopLossPips = [Link](20, "Stop Loss (Pips)", minval=5, maxval=100,
group="Trade")
minRR = [Link](2.5, "Mindest RR für Trade", minval=1.0, maxval=5.0, step=0.5,
group="Trade")
maxSequences = [Link](1, "Max Sequenzen", minval=1, maxval=5, group="Display")
// SK-System Spezifisch
useCloseActivation = [Link](true, "✅ Close-basierte Aktivierung", group="SK
System")
showGKLPreActivation = [Link](true, "Zeige GKL-Zone (0→A) vor Aktivierung",
group="SK System")
showBCZone = [Link](true, "Zeige BC-Zone (B→A2) nach Aktivierung", group="SK
System")
// ============================================================================
// PIVOT DETECTION
// ============================================================================
var array<float> confirmedHighs = [Link]<float>()
var array<int> confirmedHighBars = [Link]<int>()
var array<float> confirmedLows = [Link]<float>()
var array<int> confirmedLowBars = [Link]<int>()
// ============================================================================
// SEQUENZ STRUKTUR (MIT ALERT-TRACKING)
// ============================================================================
type Sequence
float point0
float pointA
float pointB
float pointC
int bar0
int barA
int barB
int barC
string trend
bool activated
bool cReached
int setupBar
float a2High
int a2Bar
bool gklActive
bool locked
bool alertActivated
bool alertEntry1
bool alertEntry2
bool alertEntry3
bool alertEntry4
bool alertSL
bool alertTP1
bool alertTP2
bool alertTP3
bool alertGKLEntry1
bool alertGKLEntry2
bool alertGKLEntry3
bool alertGKLEntry4
// ============================================================================
// ABC STRUKTUR ERKENNUNG
// ============================================================================
var bool newSetup = false
if lastLowBar1 < lastHighBar2 and lastHighBar2 < lastLowBar2 and lastLow2 >
lastLow1 and retrace >= 0.382 and retrace <= 0.786
seq = [Link](
point0 = lastLow1,
pointA = lastHigh2,
pointB = lastLow2,
pointC = na,
bar0 = lastLowBar1,
barA = lastHighBar2,
barB = lastLowBar2,
barC = na,
trend = "BULLISH",
activated = false,
cReached = false,
setupBar = lastLowBar2,
a2High = na,
a2Bar = na,
gklActive = false,
locked = false,
alertActivated = false,
alertEntry1 = false,
alertEntry2 = false,
alertEntry3 = false,
alertEntry4 = false,
alertSL = false,
alertTP1 = false,
alertTP2 = false,
alertTP3 = false,
alertGKLEntry1 = false,
alertGKLEntry2 = false,
alertGKLEntry3 = false,
alertGKLEntry4 = false)
if not exists
[Link](sequences, seq)
newSetup := true
if [Link](sequences) > maxSequences
[Link](sequences)
if not exists
[Link](sequences, seq)
newSetup := true
if [Link](sequences) > maxSequences
[Link](sequences)
// ============================================================================
// AKTIVIERUNGSLOGIK & A2 ERKENNUNG (MIT LOCKING!)
// ============================================================================
if [Link](sequences) > 0
i = 0
while i < [Link](sequences)
seq = [Link](sequences, i)
shouldRemove = false
// ALERT: AKTIVIERT
if not [Link]
[Link] := true
alert("🚀 " + [Link] + " AKTIVIERT!\n📍 BC-ZONE AKTIV
(B→A2)\nSetze Limit Orders:\nEntry: " + [Link]([Link] +
[Link]([Link] - [Link]) * 0.5, [Link]) + "\nSL: " +
[Link]([Link] - ([Link] * 10 * stopLossPips), [Link]),
alert.freq_once_per_bar)
[Link](sequences, i, seq)
// ALERT: AKTIVIERT
if not [Link]
[Link] := true
alert("🚀 " + [Link] + " AKTIVIERT!\n📍 BC-ZONE AKTIV
(B→A2)\nSetze Limit Orders:\nEntry: " + [Link]([Link] -
[Link]([Link] - [Link]) * 0.5, [Link]) + "\nSL: " +
[Link]([Link] + ([Link] * 10 * stopLossPips), [Link]),
alert.freq_once_per_bar)
[Link](sequences, i, seq)
if [Link] == "BULLISH"
gklEntry1 = seq.point0 + range0A * 0.500
gklEntry2 = seq.point0 + range0A * 0.559
gklEntry3 = seq.point0 + range0A * 0.618
gklEntry4 = seq.point0 + range0A * 0.667
if [Link] == "BULLISH"
entry1 = [Link] + rangeBA2 * 0.500
entry2 = [Link] + rangeBA2 * 0.559
entry3 = [Link] + rangeBA2 * 0.618
entry4 = [Link] + rangeBA2 * 0.667
// INVALIDIERUNG: SL durchbrochen
if [Link] and not [Link]
pipValue = [Link] * 10
slDistance = stopLossPips * pipValue
sl = [Link] == "BULLISH" ? [Link] - slDistance : [Link] +
slDistance
// TP ALERTS
if [Link] and not [Link]
move0A = [Link]([Link] - seq.point0)
tp1 = [Link] == "BULLISH" ? [Link] + move0A * 1.618 : [Link]
- move0A * 1.618
tp2 = [Link] == "BULLISH" ? [Link] + move0A * 1.809 : [Link]
- move0A * 1.809
tp3 = [Link] == "BULLISH" ? [Link] + move0A * 2.000 : [Link]
- move0A * 2.000
if [Link] == "BULLISH"
if not seq.alertTP1 and high >= tp1
seq.alertTP1 := true
alert("💰 TAKE PROFIT 1 (1.618) ERREICHT!\nPreis: " +
[Link](tp1, [Link]) + "\n✅ Move SL to Break-Even!",
alert.freq_once_per_bar)
[Link](sequences, i, seq)
if not seq.alertTP2 and high >= tp2
seq.alertTP2 := true
alert("💰 TAKE PROFIT 2 (1.809) ERREICHT!\nPreis: " +
[Link](tp2, [Link]), alert.freq_once_per_bar)
[Link](sequences, i, seq)
if not seq.alertTP3 and high >= tp3
seq.alertTP3 := true
alert("💰💰 TAKE PROFIT 3 (2.0) ERREICHT!\nPreis: " +
[Link](tp3, [Link]) + "\n🎉 FULL TARGET!", alert.freq_once_per_bar)
[Link](sequences, i, seq)
else
if not seq.alertTP1 and low <= tp1
seq.alertTP1 := true
alert("💰 TAKE PROFIT 1 (1.618) ERREICHT!\nPreis: " +
[Link](tp1, [Link]) + "\n✅ Move SL to Break-Even!",
alert.freq_once_per_bar)
[Link](sequences, i, seq)
if not seq.alertTP2 and low <= tp2
seq.alertTP2 := true
alert("💰 TAKE PROFIT 2 (1.809) ERREICHT!\nPreis: " +
[Link](tp2, [Link]), alert.freq_once_per_bar)
[Link](sequences, i, seq)
if not seq.alertTP3 and low <= tp3
seq.alertTP3 := true
alert("💰💰 TAKE PROFIT 3 (2.0) ERREICHT!\nPreis: " +
[Link](tp3, [Link]) + "\n🎉 FULL TARGET!", alert.freq_once_per_bar)
[Link](sequences, i, seq)
if shouldRemove
[Link](sequences, i)
else
i := i + 1
// ============================================================================
// ✅ SK ORIGINAL: ENTRY VON B→A2 (BC-ZONE)!
// ============================================================================
f_calculateEntryLevels(seq) =>
entries = [Link]<float>()
if not na(seq.a2High)
rangeBA2 = [Link](seq.a2High - [Link])
if [Link] == "BULLISH"
[Link](entries, [Link] + rangeBA2 * 0.500)
[Link](entries, [Link] + rangeBA2 * 0.559)
[Link](entries, [Link] + rangeBA2 * 0.618)
[Link](entries, [Link] + rangeBA2 * 0.667)
else
[Link](entries, [Link] - rangeBA2 * 0.500)
[Link](entries, [Link] - rangeBA2 * 0.559)
[Link](entries, [Link] - rangeBA2 * 0.618)
[Link](entries, [Link] - rangeBA2 * 0.667)
entries
// ============================================================================
// GKL-ENTRY-LEVELS (0→A) VOR AKTIVIERUNG
// ============================================================================
f_calculateGKLEntryLevels(seq) =>
entries = [Link]<float>()
if [Link] == "BULLISH"
[Link](entries, seq.point0 + range0A * 0.500)
[Link](entries, seq.point0 + range0A * 0.559)
[Link](entries, seq.point0 + range0A * 0.618)
[Link](entries, seq.point0 + range0A * 0.667)
else
[Link](entries, seq.point0 - range0A * 0.500)
[Link](entries, seq.point0 - range0A * 0.559)
[Link](entries, seq.point0 - range0A * 0.618)
[Link](entries, seq.point0 - range0A * 0.667)
entries
// ============================================================================
// CONSUMED ZONES TRACKING
// ============================================================================
var array<float> consumedEntries = [Link]<float>()
// ============================================================================
// ZEICHNE ALLE SEQUENZEN
// ============================================================================
var array<line> allLines = [Link]<line>()
var array<label> allLabels = [Link]<label>()
var array<box> allBoxes = [Link]<box>()
if newSetup
if [Link](allLines) > 0
for i = 0 to [Link](allLines) - 1
[Link]([Link](allLines, i))
if [Link](allLabels) > 0
for i = 0 to [Link](allLabels) - 1
[Link]([Link](allLabels, i))
if [Link](allBoxes) > 0
for i = 0 to [Link](allBoxes) - 1
[Link]([Link](allBoxes, i))
[Link](allLines)
[Link](allLabels)
[Link](allBoxes)
[Link](consumedEntries)
// Wellen 0->A->B
line0A = [Link](seq.bar0, seq.point0, [Link], [Link],
color=waveColor, width=2, style=line.style_solid)
lineAB = [Link]([Link], [Link], [Link], [Link],
color=waveColor, width=2, style=line.style_solid)
[Link](allLines, line0A)
[Link](allLines, lineAB)
//
============================================================================
// GKL-BOX VOR AKTIVIERUNG (0→A)
//
============================================================================
if showGKLPreActivation and not [Link]
range0A = [Link]([Link] - seq.point0)
[Link](allLines, lineGKLPre500)
[Link](allLines, lineGKLPre559)
[Link](allLines, lineGKLPre618)
[Link](allLines, lineGKLPre667)
[Link](allLabels, lblGKLPre500)
[Link](allLabels, lblGKLPre559)
[Link](allLabels, lblGKLPre618)
[Link](allLabels, lblGKLPre667)
[Link](allLines, proj1618)
[Link](allLines, proj2000)
[Link](allLabels, lbl1618)
[Link](allLabels, lbl2000)
//
============================================================================
// ✅ BC-ZONE: ENTRY-BOX VON B→A2! (HAUPTENTRY NACH AKTIVIERUNG)
//
============================================================================
if showBCZone and [Link] and not na(seq.a2High)
entryLevels = f_calculateEntryLevels(seq)
if [Link](entryLevels) == 4
fib500 = [Link](entryLevels, 0)
fib559 = [Link](entryLevels, 1)
fib618 = [Link](entryLevels, 2)
fib667 = [Link](entryLevels, 3)
[Link](allLabels, lbl500)
[Link](allLabels, lbl559)
[Link](allLabels, lbl618)
[Link](allLabels, lbl667)
entry1 = [Link](entryLevels, 0)
move0A = [Link]([Link] - seq.point0)
tp1 = [Link] == "BULLISH" ? [Link] + move0A * 1.618 :
[Link] - move0A * 1.618
//
============================================================================
// A2-LINIE (NEUES HOCH NACH AKTIVIERUNG)
//
============================================================================
if [Link] and not na(seq.a2High)
a2Line = [Link](seq.a2Bar, seq.a2High, bar_index + 30, seq.a2High,
color=[Link]([Link], 0), width=3, style=line.style_dashed,
extend=[Link])
a2Label = [Link](bar_index + 18, seq.a2High, "A2 (H*): " +
[Link](seq.a2High, [Link]), style=label.style_label_left,
color=[Link]([Link], 20), textcolor=[Link], size=[Link])
[Link](allLines, a2Line)
[Link](allLabels, a2Label)
// AKTIVIERUNGSLINIE
if showActivation
activationLine = [Link]([Link], [Link], bar_index + 30,
[Link], color=[Link] ? [Link]([Link], 0) :
[Link]([Link], 50), width=2, style=line.style_solid, extend=[Link])
[Link](allLines, activationLine)
// R-MULTIPLES & SL
if showRMultiples and [Link]
pipValue = [Link] * 10
slDistance = stopLossPips * pipValue
entryLevels = f_calculateEntryLevels(seq)
if [Link](entryLevels) > 0
entry1 = [Link](entryLevels, 0)
risk = [Link](entry1 - sl)
[Link](allLines, line2R)
[Link](allLines, line3R)
[Link](allLabels, lbl2R)
[Link](allLabels, lbl3R)
//
============================================================================
// GKL-BOX NACH C (0→C Retracement) - NEUER ZYKLUS
//
============================================================================
if showGKL and [Link] and [Link]
range0C = [Link]([Link] - seq.point0)
[Link](allLines, lineGKL500)
[Link](allLines, lineGKL559)
[Link](allLines, lineGKL618)
[Link](allLines, lineGKL667)
[Link](allLabels, lblC)
[Link](allLabels, lblGKL)
// ============================================================================
// DASHBOARD
// ============================================================================
var table dashboard = [Link](position.top_right, 7, 25, border_width=2,
border_color=[Link]([Link], 50))
pipValue = [Link] * 10
slDistance = stopLossPips * pipValue
sl = [Link] == "BULLISH" ? [Link] - slDistance : [Link] + slDistance
entryLevels = f_calculateEntryLevels(seq)
entry1 = [Link](entryLevels) > 0 ? [Link](entryLevels, 0) : na
entry2 = [Link](entryLevels) > 1 ? [Link](entryLevels, 1) : na
entry3 = [Link](entryLevels) > 2 ? [Link](entryLevels, 2) : na
entry4 = [Link](entryLevels) > 3 ? [Link](entryLevels, 3) : na
// ============================================================================
// GKL-ZONE INFO (VOR AKTIVIERUNG)
// ============================================================================
if not [Link]
[Link](dashboard, 0, 3, "⚠️ GKL-ZONE AKTIV (0→A) - Aggressiv",
bgcolor=[Link]([Link], 30), text_color=[Link], text_size=[Link])
table.merge_cells(dashboard, 0, 3, 6, 3)
gklEntries = f_calculateGKLEntryLevels(seq)
if [Link](gklEntries) == 4
gklEntry1 = [Link](gklEntries, 0)
gklEntry2 = [Link](gklEntries, 1)
pipValue = [Link] * 10
slDistance = stopLossPips * pipValue
gklSL = [Link] == "BULLISH" ? seq.point0 - slDistance : seq.point0 +
slDistance
// ============================================================================
// BC-ZONE INFO (NACH AKTIVIERUNG) - ✅ WICHTIG!
// ============================================================================
if [Link] and not na(seq.a2High)
bcColor = [Link](0, 150, 255)
[Link](dashboard, 0, 3, "📍 BC-ZONE AKTIV (B→A2) - HAUPTENTRY",
bgcolor=[Link](bcColor, 30), text_color=[Link], text_size=[Link])
table.merge_cells(dashboard, 0, 3, 6, 3)
// A2-PREIS ANZEIGEN
[Link](dashboard, 0, 4, "A2 (H*):", bgcolor=[Link]([Link], 70),
text_color=[Link], text_size=[Link])
[Link](dashboard, 1, 4, [Link](seq.a2High, [Link]),
bgcolor=[Link]([Link], 60), text_color=[Link], text_size=[Link])
table.merge_cells(dashboard, 1, 4, 6, 4)
if not na(entry1)
rr1_calc = [Link](tp1 - entry1) / [Link](entry1 - sl)
[Link](dashboard, 0, 7, "BC 1 (0.5)", bgcolor=[Link]([Link],
70), text_color=[Link], text_size=[Link])
[Link](dashboard, 1, 7, [Link](entry1, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 2, 7, [Link](sl, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 3, 7, [Link](tp1, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 4, 7, [Link](tp2, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 5, 7, [Link](tp3, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 6, 7, "1:" + [Link](rr1_calc, "#.#"),
bgcolor=rr1_calc >= minRR ? [Link]([Link], 60) : [Link]([Link], 60),
text_color=[Link], text_size=[Link])
if not na(entry2)
rr2_calc = [Link](tp1 - entry2) / [Link](entry2 - sl)
[Link](dashboard, 0, 8, "BC 2 (0.559)",
bgcolor=[Link]([Link], 70), text_color=[Link], text_size=[Link])
[Link](dashboard, 1, 8, [Link](entry2, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 2, 8, [Link](sl, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 3, 8, [Link](tp1, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 4, 8, [Link](tp2, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 5, 8, [Link](tp3, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 6, 8, "1:" + [Link](rr2_calc, "#.#"),
bgcolor=rr2_calc >= minRR ? [Link]([Link], 60) : [Link]([Link], 60),
text_color=[Link], text_size=[Link])
if not na(entry3)
rr3_calc = [Link](tp1 - entry3) / [Link](entry3 - sl)
[Link](dashboard, 0, 9, "BC 3 (0.618)",
bgcolor=[Link]([Link], 70), text_color=[Link], text_size=[Link])
[Link](dashboard, 1, 9, [Link](entry3, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 2, 9, [Link](sl, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 3, 9, [Link](tp1, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 4, 9, [Link](tp2, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 5, 9, [Link](tp3, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 6, 9, "1:" + [Link](rr3_calc, "#.#"),
bgcolor=rr3_calc >= minRR ? [Link]([Link], 60) : [Link]([Link], 60),
text_color=[Link], text_size=[Link])
if not na(entry4)
rr4_calc = [Link](tp1 - entry4) / [Link](entry4 - sl)
[Link](dashboard, 0, 10, "BC 4 (0.667)",
bgcolor=[Link]([Link], 70), text_color=[Link], text_size=[Link])
[Link](dashboard, 1, 10, [Link](entry4, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 2, 10, [Link](sl, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 3, 10, [Link](tp1, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 4, 10, [Link](tp2, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 5, 10, [Link](tp3, [Link]),
text_color=[Link], text_size=[Link])
[Link](dashboard, 6, 10, "1:" + [Link](rr4_calc, "#.#"),
bgcolor=rr4_calc >= minRR ? [Link]([Link], 60) : [Link]([Link], 60),
text_color=[Link], text_size=[Link])