Breakout mit kleiner Korrektur

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #250661 quote
    axmichi
    Participant
    Senior

    Hallo,

    Ich möchte gern den Ausbruch aus einer Bewegung handeln, aber nur dann, wenn die Korrektur nach der Bewegung kleiner als 30 % der Bewegung war.

     

    Ist das möglich?

    Den Bewegungsarm würde ich so definieren:

    Der Beginn der Bewegung ist am tiefsten Tief der letzten 3 Kerzen, wenn es keinen tieferen Kurs danach gegeben hat.

    Das Ende der Bewegung ist am höchsten Hoch der letzten 3 Kerzen, wenn es keinen höheren Kurs mehr gegeben hat.

    Im Bild ist der Indikator zu sehen, der eine Bewegung und die  Korrektur anzeigt.

    Ein Long-Trade soll eröffnet werden wenn

    1. Der Ausbruch über das letzte Hoch, soll nur dann gehandelt werden, wenn die Korrektur nicht tiefer als 30 % der Bewegungslänge war.
    2. Der Trade soll nur eingegangen werden, wenn das letzte Korrekturtief (Kreis Gelb) höher liegt als das Korrekturtief davor (Kreis Blau)
    3. Nach dem Ausbruch, wird eine Position eröffnet! Im Bild grüner Pfeil
    4. Der Stop Loss liegt 0,5 % unter dem letzten Korrekturtief (Kreis Gelb)
    5. Der Take Profit soll so sein, dass das CRV 2:1 ergibt

    Es wäre schön wenn das geht…

    Vielen Dank

    Fals das benötigt wird, hier ist der Code vom Indikator, der den Trend in den Chart macht:

     

    defparam calculateonlastbars=30000
    cp = 3

    once lastpoint = 0

    if high[cp] >= highest[2*cp+1](high) then
    PEAK = 1
    else
    PEAK = 0
    endif

    if low[cp] <= lowest[2*cp+1](low) then
    TROUGH = -1
    else
    TROUGH = 0
    endif

    if PEAK = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif

    if TROUGH = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif

    if PEAK>0 and (lastpoint=-1 or lastpoint=0) then
    DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(127,255,0,1000)
    DRAWTEXT(“■”,TOPx,TOPy,Dialog,Bold,15) coloured(200,0,0,255)
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    endif

    if TROUGH<0 and (lastpoint=1 or lastpoint=0) then
    DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(255,0,0,255)
    DRAWTEXT(“■”,BOTx,BOTy,Dialog,Bold,15) coloured(0,200,0,255)
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    endif

    //TREND ATTEMPT
    atr=AverageTrueRange[14](close)
    if TOPy > TOPy[1] and topy<>lasttop then
    //drawarrowup(barindex,low-atr/2) coloured(0,200,0)
    lasttop=topy
    trendup = 1
    else
    trendup = 0
    endif

    RETURN TOPy as “TOPy”, BOTY as “BOTy”, trendup as “trendup”

    #250695 quote
    Iván González
    Moderator
    Master

    Ich habe es hier gemacht, indem ich die Tiefstwerte betrachtet und den Höchstwert unter diesen lokalisiert habe. Von dort aus habe ich den maximal zulässigen Rückgang berechnet.

    prd = 3
    th = 30
    atr = averagetruerange[14](close)
    
    if low > low[prd] and lowest[prd](low) > low[prd] and low[prd] < lowest[prd](low)[prd+1] then
       
       pl1 = pl2
       pl2 = low[prd]
       
       pl1x = pl2x
       pl2x = barindex[prd]
       
       ph1 = highest[max(0,(pl2x-pl1x))](high)[barindex-pl2x]
       ph1x = 0
       
       bars = pl2x-pl1x
       
       for i=prd to prd+bars do
          if ph1=high[i] then
             ph1x=barindex[i]
             break
          endif
       next
       
       distUp=ph1-pl1
       distDn=ph1-pl2
       
       if pl2>pl1 and (distDn/distUp < th/100) then
          
          drawsegment(ph1x,ph1,barindex,ph1)style(line,2)coloured("red")
          drawsegment(pl1x,ph1-distUp*th/100,barindex,ph1-distUp*th/100)style(dottedline,2)coloured("red")
          drawsegment(ph1x,ph1,pl1x,pl1)style(line,1)coloured("orange")
          drawsegment(ph1x,ph1,pl2x,pl2)style(line,1)coloured("orange")
          drawtext("(2)",pl2x,pl2-0.5*atr)coloured("blue")
          drawtext("(1)",pl1x,pl1-0.5*atr)coloured("blue")
          drawtext("H",ph1x,ph1+0.5*atr)coloured("red")
          drawpoint(pl1x,pl1,2)coloured("blue")
          drawpoint(pl1x,pl1,5)coloured("blue",30)
          drawpoint(pl2x,pl2,2)coloured("blue")
          drawpoint(pl2x,pl2,5)coloured("blue",30)
          drawpoint(ph1x,ph1,2)coloured("red")
          drawpoint(ph1x,ph1,5)coloured("red",30)
       endif
       
    endif
    
    return
    
    #250710 quote
    robertogozzi
    Moderator
    Master

    Hier ist der Code. Beachten Sie jedoch, dass der Indikator REPAINTING ist, sodass das Signal einige Kerzen später erkannt wird als im Diagramm angegeben.
    Tatsächlich ist das Signal korrekt, wird aber einige Kerzen früher im Diagramm angezeigt, sodass die roten und grünen Punkte, die Sie sehen, NICHT die Stelle darstellen, an der das Signal tatsächlich generiert wurde:

    ONCE HH  = 0
    ONCE LL  = 0
    ONCE HHp = 0
    ONCE LLp = 0
    ONCE PC  = 0.30      //30%
    ONCE Gap = 0
    ONCE Sig = 0
    //ù
    IF OnMarket THEN
    Sig = 0
    ENDIF
    
    //defparam calculateonlastbars=30000
    cp = 3
    once lastpoint = 0
    if high[cp] >= highest[2*cp+1](high) then
    PEAK = 1
    else
    PEAK = 0
    endif
    if low[cp] <= lowest[2*cp+1](low) then
    TROUGH = -1
    else
    TROUGH = 0
    endif
    if PEAK = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
    if TROUGH = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    if PEAK>0 and (lastpoint=-1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(127,255,0,1000)
    //DRAWTEXT("■",TOPx,TOPy,Dialog,Bold,15) coloured(200,0,0,255)
    HHp       = HH
    HH        = TOPy
    HB        = TOPx
    Sig       = 0
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    endif
    if TROUGH<0 and (lastpoint=1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(255,0,0,255)
    //DRAWTEXT("■",BOTx,BOTy,Dialog,Bold,15) coloured(0,200,0,255)
    LLp       = LL
    LL        = BOTy
    LB        = BOTx
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    endif
    //TREND ATTEMPT
    atr=AverageTrueRange[14](close)
    if TOPy > TOPy[1] and topy<>lasttop then
    //drawarrowup(barindex,low-atr/2) coloured(0,200,0)
    lasttop=topy
    trendup = 1
    else
    trendup = 0
    endif
    //RETURN TOPy as "TOPy", BOTY as "BOTy", trendup as "trendup"
    IF (HHp <> 0) AND (LLp <> 0) THEN
    IF (HH <> HH[1]) THEN
    Gap   = HHp - LL
    Spike = HHp - LLp
    Ratio = Gap * 100 / Spike
    IF (Ratio > 0) AND (Ratio < PC) THEN
    Sig = 1
    ENDIF
    ENDIF
    ENDIF
    IF Not OnMarket AND Sig = 1 THEN
    BUY 1 CONTRACT AT HH STOP
    SL      = HH - LL - (LL * 0.005)      //0.5% below the last LL
    SLprice = HH - SL
    TP      = SL * 2
    TPprice = HH + TP
    SET STOP   PRICE SLprice
    SET TARGET PRICE TPprice
    ENDIF
    graphonprice LL      coloured("Brown")
    GraphOnPrice HH      coloured("Black")
    GraphOnPrice SLprice coloured("Fuchsia")
    GraphOnPrice TPprice coloured("Cyan")
    graph Spike
    graph Gap
    graph Ratio
    #250748 quote
    axmichi
    Participant
    Senior

    Vielen Dank!

     

    Ich habe das system im Mini Nasdaq zu laufen auf Tagesbasis. Leider gibt es keinen Trade??

    #250762 quote
    robertogozzi
    Moderator
    Master

    Ich habe einige Fehler bei der Prozentberechnung und der Umsatzart gefunden.
    Hier ist der neue Code:

    ONCE HH  = 0
    ONCE LL  = 0
    ONCE HHp = 0
    ONCE LLp = 0
    ONCE PC  = 30      //30%
    ONCE Gap = 0
    ONCE Sig = 0
    //ù
    IF OnMarket THEN
    Sig = 0
    ENDIF
     
    //defparam calculateonlastbars=30000
    cp = 3
    once lastpoint = 0
    if high[cp] >= highest[2*cp+1](high) then
    PEAK = 1
    else
    PEAK = 0
    endif
    if low[cp] <= lowest[2*cp+1](low) then
    TROUGH = -1
    else
    TROUGH = 0
    endif
    if PEAK = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
    if TROUGH = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    if PEAK>0 and (lastpoint=-1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(127,255,0,1000)
    //DRAWTEXT("■",TOPx,TOPy,Dialog,Bold,15) coloured(200,0,0,255)
    HHp       = HH
    HH        = TOPy
    HB        = TOPx
    Sig       = 0
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    endif
    if TROUGH<0 and (lastpoint=1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(255,0,0,255)
    //DRAWTEXT("■",BOTx,BOTy,Dialog,Bold,15) coloured(0,200,0,255)
    LLp       = LL
    LL        = BOTy
    LB        = BOTx
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    endif
    //TREND ATTEMPT
    atr=AverageTrueRange[14](close)
    if TOPy > TOPy[1] and topy<>lasttop then
    //drawarrowup(barindex,low-atr/2) coloured(0,200,0)
    lasttop=topy
    trendup = 1
    else
    trendup = 0
    endif
    //RETURN TOPy as "TOPy", BOTY as "BOTy", trendup as "trendup"
    IF (HHp <> 0) AND (LLp <> 0) THEN
    IF (LL <> LL[1]) THEN
    Gap   = HH  - LL
    Spike = HH  - LLp
    Ratio = Gap * 100 / Spike
    IF (Ratio > 0) AND (Ratio < PC) THEN
    Sig = 1
    ENDIF
    ENDIF
    ENDIF
    IF Not OnMarket AND Sig = 1 THEN
    IF close > HH THEN
    BUY 1 CONTRACT AT HH LIMIT
    ELSIF close < HH THEN
    BUY 1 CONTRACT AT HH STOP
    ELSE
    BUY 1 CONTRACT AT MARKET
    ENDIF
    SL      = HH - LL - (LL * 0.005)      //0.5% below the last LL
    SLprice = HH - SL
    TP      = SL * 2
    TPprice = HH + TP
    SET STOP   PRICE SLprice
    SET TARGET PRICE TPprice
    ENDIF
    graphonprice LL      coloured("Brown")
    GraphOnPrice HH      coloured("Black")
    GraphOnPrice SLprice coloured("Fuchsia")
    GraphOnPrice TPprice coloured("Cyan")
    graph Spike
    graph Gap
    graph Ratio
    #250792 quote
    axmichi
    Participant
    Senior

    Hallo und Danke

    das funktioniert gut!!

    Entschuldigung!, mir ist gerade aufgefallen, das ich noch eine Bedingung brauche.

    Es soll nur der Ausbruch gehandelt werden wenn das HH mindestens 3 Tage und höchstens 10 Tage her ist?

     

    Vielen Dank

    #250873 quote
    robertogozzi
    Moderator
    Master

    Dies ist die neue Version, die mit Ihrer letzten Anfrage aktualisiert wurde:

    ONCE HH  = 0
    ONCE LL  = 0
    ONCE HHp = 0
    ONCE LLp = 0
    ONCE PC  = 30      //30%
    ONCE Gap = 0
    ONCE Sig = 0
    //ù
    IF OnMarket THEN
    Sig = 0
    ENDIF
     
    //defparam calculateonlastbars=30000
    cp = 3
    once lastpoint = 0
    if high[cp] >= highest[2*cp+1](high) then
    PEAK = 1
    else
    PEAK = 0
    endif
    if low[cp] <= lowest[2*cp+1](low) then
    TROUGH = -1
    else
    TROUGH = 0
    endif
    if PEAK = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
    if TROUGH = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    if PEAK>0 and (lastpoint=-1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(127,255,0,1000)
    //DRAWTEXT("■",TOPx,TOPy,Dialog,Bold,15) coloured(200,0,0,255)
    HHp       = HH
    HBp       = HB
    HH        = TOPy
    HB        = TOPx
    Sig       = 0
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    endif
    if TROUGH<0 and (lastpoint=1 or lastpoint=0) then
    //DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(255,0,0,255)
    //DRAWTEXT("■",BOTx,BOTy,Dialog,Bold,15) coloured(0,200,0,255)
    LLp       = LL
    LBp       = LB
    LL        = BOTy
    LB        = BOTx
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    endif
    //TREND ATTEMPT
    atr=AverageTrueRange[14](close)
    if TOPy > TOPy[1] and topy<>lasttop then
    //drawarrowup(barindex,low-atr/2) coloured(0,200,0)
    lasttop=topy
    trendup = 1
    else
    trendup = 0
    endif
    //RETURN TOPy as "TOPy", BOTY as "BOTy", trendup as "trendup"
    IF (HHp <> 0) AND (LLp <> 0) THEN
    IF (LL <> LL[1]) THEN
    Gap   = HH  - LL
    Spike = HH  - LLp
    Ratio = Gap * 100 / Spike
    IF (Ratio > 0) AND (Ratio < PC) AND (HB <= Barindex[3]) AND (HB >= Barindex[10]) THEN
    Sig = 1
    ELSE
    Sig = 0
    ENDIF
    ENDIF
    ENDIF
    IF Not OnMarket AND Sig = 1 THEN
    IF close > HH THEN
    BUY 1 CONTRACT AT HH LIMIT
    ELSIF close < HH THEN
    BUY 1 CONTRACT AT HH STOP
    ELSE
    BUY 1 CONTRACT AT MARKET
    ENDIF
    SL      = HH - LL - (LL * 0.005)      //0.5% below the last LL
    SLprice = HH - SL
    TP      = SL * 2
    TPprice = HH + TP
    SET STOP   PRICE SLprice
    SET TARGET PRICE TPprice
    ENDIF
    //graphonprice LL      coloured("Brown")
    //GraphOnPrice HH      coloured("Black")
    //GraphOnPrice SLprice coloured("Fuchsia")
    //GraphOnPrice TPprice coloured("Cyan")
    //graph Spike
    //graph Gap
    //graph Ratio
    //graph HBp
    //graph HB
    //graph BarIndex
    //graph Sig
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Breakout mit kleiner Korrektur


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by robertogozzi
4 months, 3 weeks ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 09/10/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...