ProRealCode - Trading & Coding with ProRealTime™
//@version=5
strategy(“Heiliger Gral (Heikin Ashi)”, overlay=true)
// Auswahl des Timeframes für externe Berechnungen
tf = input.timeframe(“1D”, title=”Timeframe für Berechnung”) // Standardmäßig 1 Tag
// Auswahl: Trading Direction (Long, Short oder Long and Short)
tradeDirection = input.string(“Long and Short”, title=”Trading Direction”, options=[“Long”, “Short”, “Long and Short”])
// Kopierschutz: Definiere das feste Enddatum für den Backtest
int backtest_end_date = timestamp(2035, 2, 14, 0, 0)
current_time = time
// *** Heikin Ashi für den aktuellen Timeframe ***
ha_close_curr = (open + high + low + close) / 4
var float ha_open_curr = (open + close) / 2
ha_open_curr := (ha_open_curr + ha_close_curr[1]) / 2
ha_high_curr = math.max(high, math.max(ha_open_curr, ha_close_curr))
ha_low_curr = math.min(low, math.min(ha_open_curr, ha_close_curr))
// *** Heikin Ashi-Kerzen aus dem anderen Timeframe berechnen ***
ha_close_ext = request.security(syminfo.tickerid, tf, (open + high + low + close) / 4)
ha_open_ext_pre = request.security(syminfo.tickerid, tf, (open[1] + close[1]) / 2)
ha_open_ext = request.security(syminfo.tickerid, tf, na(ha_open_ext_pre[1]) ? ha_open_ext_pre : (ha_open_ext_pre[1] + ha_close_ext[1]) / 2)
ha_high_ext = request.security(syminfo.tickerid, tf, math.max(high, math.max(ha_open_ext, ha_close_ext)))
ha_low_ext = request.security(syminfo.tickerid, tf, math.min(low, math.min(ha_open_ext, ha_close_ext)))
// **Berechnung von z1 und z2 basierend auf externen Heikin Ashi-Kerzen**
a = request.security(syminfo.tickerid, tf, ta.highest(ha_high_ext, 3))
b = request.security(syminfo.tickerid, tf, ta.lowest(ha_low_ext, 3))
var float z1 = na
var float z2 = na
float z1_plot = na
float z2_plot = na
float z3 = na
if (current_time <= backtest_end_date)
ifha_close_ext[1]>ha_open_ext[1]andha_close_ext<ha_open_ext
z1:=a
ifha_close_ext[1]<ha_open_ext[1]andha_close_ext>ha_open_ext
z2:=b
// Berechne z3, wenn z1 und z2 gültig sind
ifnotna(z1)andnotna(z2)
z3:=(z1+z2)/2
// Entry-Logik
iftradeDirection==”Long”ortradeDirection==”Long and Short”
ifha_close_curr>z3
strategy.entry(“Long”,strategy.long)
iftradeDirection==”Short”ortradeDirection==”Long and Short”
ifha_close_curr<z3
strategy.entry(“Short”,strategy.short)
// Exit-Logik basierend auf z3
ifnotna(z3)
ifclose>z3
strategy.close(“Short”)
ifclose<z3
strategy.close(“Long”)
z1_plot:=z1
z2_plot:=z2
else
strategy.close(“Long”)
strategy.close(“Short”)
label.new(bar_index,high,”No Live Trading”,color=color.red,textcolor=color.white,style=label.style_label_down)
// Plotting
plot(z1_plot, title=”z1 – Höchster Wert”, color=color.blue, linewidth=2, style=plot.style_stepline)
plot(z2_plot, title=”z2 – Tiefster Wert”, color=color.red, linewidth=2, style=plot.style_stepline)
plot(z3, title=”z3 – Mitte von z1 und z2″, color=color.gray, linewidth=2, style=plot.style_line)
ein copyright möcht ich noch einfügen
copyright to Jürgen Strasser Salzburg
Hier sind sie:
tradeDirection=2
//------------------------------------------------//
// Heikin Ashi candles Current time frame
//------------------------------------------------//
once haopen=open
haclose=(open+close+high+low)/4
if barindex> 0 then
haopen=(haopen+haclose[1])/2
endif
halow=min(low,min(haclose,haopen))
hahigh=max(high,max(haclose,haopen))
//------------------------------------------------//
// Heikin Ashi candles External timeframe
//------------------------------------------------//
timeframe(daily,updateonclose)
once haopenext=open
hacloseext=(open+close+high+low)/4
if barindex> 0 then
haopenext=(haopenext+hacloseext[1])/2
endif
halowext=min(low,min(hacloseext,haopenext))
hahighext=max(high,max(hacloseext,haopenext))
a=highest[3](hahighext)
b=lowest[3](halowext)
timeframe(default)
// Z1 and Z2
if hacloseext[1]>haopenext[1] and hacloseext<haopenext then
z1=a
elsif hacloseext[1]<haopenext[1] and hacloseext>haopenext then
z2=b
endif
// Z3
if z1<>undefined and z2<>undefined then
z3=(z1+z2)/2
endif
//------------------------------------------------//
// Long and Short trades
//------------------------------------------------//
if not onmarket then
if tradeDirection=1 and haclose>z3 then
buy 1 contract at market
elsif tradeDirection=-1 and haclose<z3 then
sellshort 1 contract at market
elsif tradeDirection=2 and haclose>z3 then
buy 1 contract at market
elsif tradeDirection=2 and haclose<z3 then
sellshort 1 contract at market
endif
endif
if longonmarket and close<z3 then
sell at market
elsif shortonmarket and close>z3 then
exitshort at market
endif
//------------------------------------------------//
// Graph
//------------------------------------------------//
graphonprice z1 coloured("blue") as "Z1 max"
graphonprice z2 coloured("red") as "Z2 min"
graphonprice z3 coloured("orange") as "Z3 med"
Danke für Übersetzung für Prorealtime.
Es ist erstaunlich , da eigentlich der Heikin Ashi bereits der Heilige Gral für mich ist. Alleine bei der ersten grünen Kerze Kaufen und bei der ersten roten Kerze zu Shorten hat einen rechnerischen wert von ca 3 -5 Gewinnfaktor. Und das in allen Timeframes auf allen Märkten.
2 Kerzen sind die Looser und 7 Kerzen sind die Gewinner.
Es scheint auch so im Volumentrading zu sein, wenn man hohes Volumen nimmt und die Heikin Kerze nehmen – Dann sollte sich das auch gut rechnen.
Das 50% Retracement hätte halt einen Stop von 1 Kerze ( Mein Heiliger Gral ).
Warum es auf einen “Normalen Chat” eher Bescheiden aussieht kann ich nicht genau sagen.
Aber wenn man nicht an den Heiligen Gral glaubt — dann ist er es auch nicht 😉
Das Spiel heißt : 1 wird verlieren
//@version=5
strategy(“Heiliger Gral Wave”, overlay=true)
// === INPUTS ===
tf = input.timeframe(“1D”, title=“Timeframe für Berechnung”)
tradeDirection = input.string(“Long and Short”, title=“Trading Direction”, options=[“Long”, “Short”, “Long and Short”])
int backtest_end_date = timestamp(2035, 2, 14, 0, 0)
// === HEIKIN ASHI AKTUELLER TIMEFRAME ===
ha_close = (open + high + low + close) / 4
var float ha_open = na
ha_open := na(ha_open[1]) ? (open + close) / 2 : (ha_open[1] + ha_close[1]) / 2
ha_high = math.max(high, math.max(ha_open, ha_close))
ha_low = math.min(low, math.min(ha_open, ha_close))
// === HTF HEIKIN ASHI ===
ha_close_ext = request.security(syminfo.tickerid, tf, (open + high + low + close) / 4)
ha_open_ext = request.security(syminfo.tickerid, tf, (open + close) / 2)
ha_high_ext = request.security(syminfo.tickerid, tf, high)
ha_low_ext = request.security(syminfo.tickerid, tf, low)
// === ZONEN ===
a = request.security(syminfo.tickerid, tf, ta.highest(ha_high_ext, 3))
b = request.security(syminfo.tickerid, tf, ta.lowest(ha_low_ext, 3))
var float z1 = na
var float z2 = na
if time <= backtest_end_date
if ha_close_ext[1] > ha_open_ext[1] and ha_close_ext < ha_open_ext
z1 := a
if ha_close_ext[1] < ha_open_ext[1] and ha_close_ext > ha_open_ext
z2 := b
if tradeDirection == “Long” or tradeDirection == “Long and Short”
if not na(z1) and close > z1
strategy.entry(“Long”, strategy.long)
if tradeDirection == “Short” or tradeDirection == “Long and Short”
if not na(z2) and close < z2
strategy.entry(“Short”, strategy.short)
else
strategy.close_all()
// === z3 = HA OPEN AKTUELL ===
z3 = ha_open_ext
// === PLOTS ===
plot(z1, title=“z1 – Höchster Wert”, color=color.blue, linewidth=2, style=plot.style_stepline)
plot(z2, title=“z2 – Tiefster Wert”, color=color.red, linewidth=2, style=plot.style_stepline)
plot(z3, title=“z3 – HA Open Current”, color=color.orange, linewidth=2, style=plot.style_stepline)
DEFPARAM CumulateOrders = False
// tradeDirection: 1 = Long, -1 = Short, 2 = Long and Short
tradeDirection = 2
//------------------------------------------------//
// Heikin Ashi candles Current time frame
//------------------------------------------------//
ONCE haOpen = open
haClose = (open + close + high + low) / 4
IF barindex > 0 THEN
haOpen = (haOpen + haClose[1]) / 2
ENDIF
haLow = min(low, min(haClose, haOpen))
haHigh = max(high, max(haClose, haOpen))
//------------------------------------------------//
// Heikin Ashi candles External timeframe (Daily)
//------------------------------------------------//
TIMEFRAME(daily, updateonclose)
haCloseExt = (open + close + high + low) / 4
haOpenExt = (open + close) / 2
haHighExt = high
haLowExt = low
a = highest[3](haHighExt)
b = lowest[3](haLowExt)
TIMEFRAME(default)
//------------------------------------------------//
// Z1, Z2 y Z3
//------------------------------------------------//
ONCE z1 = 0
ONCE z2 = 0
IF haCloseExt[1] > haOpenExt[1] AND haCloseExt < haOpenExt THEN
z1 = a
ENDIF
IF haCloseExt[1] < haOpenExt[1] AND haCloseExt > haOpenExt THEN
z2 = b
ENDIF
z3 = haOpenExt
//------------------------------------------------//
// Long and Short trades
//------------------------------------------------//
IF tradeDirection = 1 OR tradeDirection = 2 THEN
IF z1 <> 0 AND close > z1 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
ENDIF
IF tradeDirection = -1 OR tradeDirection = 2 THEN
IF z2 <> 0 AND close < z2 THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
ENDIF
//------------------------------------------------//
// Graph
//------------------------------------------------//
GRAPHONPRICE z1 COLOURED(0, 0, 255) AS "Z1 max"
GRAPHONPRICE z2 COLOURED(255, 0, 0) AS "Z2 min"
GRAPHONPRICE z3 COLOURED(255, 165, 0) AS "Z3 med"
Nehmt das Open vom heikin ashi zb vom wochenchart . Higher timeframes win. Das low und high ist mir fast zu langsam.hedging ist damit sehr interessant weil nur 1 Kerze risk ist
Und wenn du das Open vom heikin nimmst und eine grüne Kerze kommt dann ist nach Elliott schon ein Kaufsignal in einem kleineren timeframes passiert. Du brauchst nur den heikin und Geld einteilen
Es gibt 3 Märkte die 1 Million erreichen werden. Dow bitcoin gold. Nimm den dow im monatschart und lass long ewig laufen.
Eine idee für den monatschart. Du nimmst ein markanntes low mit viel volumen als stop und lässt jahrelang laufen
Wichtig. Chart ist chart. Sie sind alle gleich. Egal ob öl oder bitcoin oder dow egal welcher timeframe.chart ist chart. Man kann ein system im 5 min chart testen aber umsetzen dann im wochenchart
Jeder Trader hat so seinen Gral .. Das sind halt meine. Besser bekomm ich sie nicht hin leider.
Aber es soll dir nur Selbstvertrauen geben in dem was du da tust.
//@version=5
strategy(“God Part II “, overlay=true)
// === INPUTS ===
systemChoice = input.string(“Waves”, title=“Handelssystem wählen”, options=[“Waves”, “Mein Gral (EMA 20)”, “Beide”])
tradeMode = input.string(“Beides”, title=“Handelsrichtung”, options=[“Beides”, “Long”, “Short”])
int backtest_end_date = timestamp(2050, 2, 14, 0, 0)
// — Timeframe Inputs —
tf = input.timeframe(“W”, title=” Waves”)
emaTf = input.timeframe(“W”, title=“Mein Gral”)
// === RECHTLICHER ECHTHEITSSCHUTZ ===
bool live_trading_allowed = not barstate.isrealtime
// ==========================================
// SYSTEM 1: WAVES LOGIK
// ==========================================
high_ext = request.security(syminfo.tickerid, tf, high)
low_ext = request.security(syminfo.tickerid, tf, low)
close_ext = request.security(syminfo.tickerid, tf, close)
open_ext = request.security(syminfo.tickerid, tf, open)
a = request.security(syminfo.tickerid, tf, ta.highest(high, 4))
b = request.security(syminfo.tickerid, tf, ta.lowest(low, 4))
var float z1 = na
var float z2 = na
var float z3 = na
if time <= backtest_end_date
if close_ext[1] > open_ext[1] and close_ext < open_ext
z1 := a
if close_ext[1] < open_ext[1] and close_ext > open_ext
z2 := b
z3 := (z1 + z2) / 2
// Waves Signale
wavesLongEntry = ta.crossover(close, z1) and barstate.isconfirmed
wavesShortEntry = ta.crossunder(close, z2) and barstate.isconfirmed
// ==========================================
// SYSTEM 2: MEIN GRAL (EMA 20 mit Multi-TF)
// ==========================================
// Berechnet den EMA 20 auf dem gewählten EMA-Timeframe (z.B. Wochenchart) und holt ihn auf den Chart
ema20_htf = request.security(syminfo.tickerid, emaTf, ta.ema(close, 20))
// Entry-Signale (beim Kreuzen des HTF-EMA 20 auf Basis des aktuellen Charts/Schlusskurses)
gralLongEntry = ta.crossover(close, ema20_htf) and barstate.isconfirmed
gralShortEntry = ta.crossunder(close, ema20_htf) and barstate.isconfirmed
// Exit-Bedingungen laut Vorgabe (bezogen auf den HTF-EMA):
gralLongExit = close < ema20_htf and barstate.isconfirmed
gralShortExit = close > ema20_htf and barstate.isconfirmed
// ==========================================
// SYSTEM-AUSWAHL & HANDELSLOGIK
// ==========================================
if live_trading_allowed
// — AUSWAHL 1: WAVES —
if systemChoice == “Waves”
if tradeMode == “Long” or tradeMode == “Beides”
if wavesLongEntry and strategy.position_size <= 0
if tradeMode == “Beides” and strategy.position_size < 0
strategy.close(“Short”)
strategy.entry(“Waves Long”, strategy.long)
if wavesShortEntry and strategy.position_size > 0 and tradeMode == “Long”
strategy.close(“Waves Long”)
if tradeMode == “Short” or tradeMode == “Beides”
if wavesShortEntry and strategy.position_size >= 0
if tradeMode == “Beides” and strategy.position_size > 0
strategy.close(“Long”)
strategy.entry(“Waves Short”, strategy.short)
if wavesLongEntry and strategy.position_size < 0 and tradeMode == “Short”
strategy.close(“Waves Short”)
if tradeMode == “Beides”
if wavesLongEntry
strategy.close(“Waves Short”)
strategy.entry(“Waves Long”, strategy.long)
if wavesShortEntry
strategy.close(“Waves Long”)
strategy.entry(“Waves Short”, strategy.short)
// — AUSWAHL 2: MEIN GRAL (EMA 20) —
else if systemChoice == “Mein Gral (EMA 20)”
if tradeMode == “Long” or tradeMode == “Beides”
if gralLongEntry and strategy.position_size <= 0
strategy.entry(“Gral Long”, strategy.long)
if gralLongExit and strategy.position_size > 0
strategy.close(“Gral Long”)
if tradeMode == “Short” or tradeMode == “Beides”
if gralShortEntry and strategy.position_size >= 0
strategy.entry(“Gral Short”, strategy.short)
if gralShortExit and strategy.position_size < 0
strategy.close(“Gral Short”)
// — AUSWAHL 3: BEIDE SYSTEME KOMBINIERT —
else if systemChoice == “Beide”
bool combinedLong = (wavesLongEntry or gralLongEntry)
bool combinedShort = (wavesShortEntry or gralShortEntry)
if (tradeMode == “Long” or tradeMode == “Beides”) and combinedLong
if strategy.position_size < 0
strategy.close_all()
strategy.entry(“Kombi Long”, strategy.long)
if (tradeMode == “Short” or tradeMode == “Beides”) and combinedShort
if strategy.position_size > 0
strategy.close_all()
strategy.entry(“Kombi Short”, strategy.short)
// Ausstiege für Gral-Logik im Kombi-Modus
if gralLongExit and strategy.position_size > 0
strategy.close(“Kombi Long”)
if gralShortExit and strategy.position_size < 0
strategy.close(“Kombi Short”)
else
strategy.close_all(comment = “Live-Modus: Nur Signale aktiv”)
// === PLOTS (VISUALISIERUNG) ===
plot(z1, title=“z1 HTF High”, color=color.blue, linewidth=2, style=plot.style_stepline)
plot(z2, title=“z2 HTF Low”, color=color.red, linewidth=2, style=plot.style_stepline)
plot(z3, title=“z3 Mitte”, color=color.purple, linewidth=2, style=plot.style_stepline)
plot(ema20_htf, title=“EMA 20 (Multi-TF Mein Gral)”, color=color.orange, linewidth=2)
Nicht vergessen , umstellen auf heikin ashi.
Das war das letzte Posting dazu .. die Arbeit von 30 Jahren forschen
Ich hab zwar ein ähnliches schon geschrieben aber 1 hab ich noch.
Für mich fast das beste der Heikin Ashi – Aktuelle Kerze. Der Heikin hat irgend einen mechanismus drinnen der höhere Zeiteinheiten glatter darstellt. Meine Empfehlung wäre dieses Programm im Monats oder 3 Monatschart zu verwenden. Man hat dann eine Make-it-or-break-it Linie die rechtzeitig da ist wenn man sie braucht.
//@version=5
strategy(“God Part II”, overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// — Eingaben —
tfInput = input.timeframe(“D”, title=“Timeframe nur für Z1”)
tradeDirection = input.string(“Beides”, title=“Handelsrichtung”, options=[“Nur Long”, “Nur Short”, “Beides”])
// — Nur Z1 im ausgewählten Timeframe berechnen —
f_z1() =>
(open + close) / 2
// Z1 aus dem gewählten Timeframe holen
htfZ1 = request.security(syminfo.tickerid, tfInput, f_z1(), barmerge.gaps_off, barmerge.lookahead_off)
// — Bedingungen im AKTUELLEN Chart vergleichen —
// Der Close ist immer der Schlusskurs deines aktuellen Charts
isLong = close > htfZ1
isShort = close < htfZ1
// Prüfen, welche Richtungen erlaubt sind
allowLong = (tradeDirection == “Beides” or tradeDirection == “Nur Long”)
allowShort = (tradeDirection == “Beides” or tradeDirection == “Nur Short”)
// — Order-Ausführung & Exits —
// LONG LOGIK
if allowLong
if isLong
strategy.entry(“Long”, strategy.long)
if isShort
strategy.close(“Long”)
// SHORT LOGIK
if allowShort
if isShort
strategy.entry(“Short”, strategy.short)
if isLong
strategy.close(“Short”)
// — Visualisierung —
plot(htfZ1, title=“Z1”, color=color.orange, linewidth=2)
Heiliger Gral für heikin aschi
This topic contains 15 replies,
has 2 voices, and was last updated by nepu77
14 hours, 9 minutes ago.
| Forum: | Allgemeines Trading: Marktanalyse & Manuelles Trading |
| Language: | German |
| Started: | 03/30/2025 |
| Status: | Active |
| Attachments: | No files |
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR. For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.