Heiliger Gral für heikin aschi

Viewing 5 posts - 1 through 5 (of 5 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)
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Heiliger Gral für heikin aschi


Generelle Trading-Themen

New Reply
Author
author-avatar
nepu77 @nepu77 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by nepu77
9 months ago.

Topic Details
Forum: Generelle Trading-Themen
Language: German
Started: 03/30/2025
Status: Active
Attachments: No files
Logo Logo
Loading...