Heiliger Gral für heikin aschi

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #245427 quote
    nepu77
    Participant
    Average
    
    //@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)
    
    #245428 quote
    nepu77
    Participant
    Average

    ein copyright möcht ich noch einfügen

     

    copyright to Jürgen Strasser Salzburg

    #245761 quote
    Iván González
    Moderator
    Master

    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"
    robertogozzi thanked this post
    #246334 quote
    nepu77
    Participant
    Average

    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 😉

    #246415 quote
    nepu77
    Participant
    Average
    //@version=5
    strategy(“(HTF)”, overlay=true, default_qty_type=strategy.fixed)
    // Benutzerdefinierter Timeframe
    htf = input.timeframe(“60”, “Signal Timeframe”)
    // HTF-Daten
    htf_open = request.security(syminfo.tickerid, htf, open)
    // HTF-Open anzeigen
    plot(htf_open, title=”HTF Open”, color=color.orange, linewidth=2)
    // Einstieg bei grüner HTF-Kerze
    if close > htf_open
    strategy.entry(“Buy”,strategy.long)
    if close < htf_open
    strategy.entry(“Sell”,strategy.short)
    #258522 quote
    nepu77
    Participant
    Average

    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)


    #258538 quote
    Iván González
    Moderator
    Master
    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"
    


    robertogozzi thanked this post
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Heiliger Gral für heikin aschi


Allgemeines Trading: Marktanalyse & Manuelles Trading

New Reply
Author
author-avatar
nepu77 @nepu77 Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by Iván González
1 week, 4 days ago.

Topic Details
Forum: Allgemeines Trading: Marktanalyse & Manuelles Trading
Language: German
Started: 03/30/2025
Status: Active
Attachments: No files
Logo Logo
Loading...