Screener für Trendfolge Ausbruch

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

    Hallo,


    ist es möglich aus diesem code hier einen Screener für Aktien auf Tagesbasis zu machen?

    Der Sreener solle alle Aktien finden, die ein Handelsvolumen von über 500 000 haben und die gestern über das HH ausgebrochen sind.


    Vielen Dank


    //defparam calculateonlastbars=30000

    ONCE HH   = 0

    ONCE HHprec = 0

    ONCE LL   = 0

    ONCE LLprec = 0


    if Not OnMarket Then

    UseST = 0

    ENDIF

    // if NOT LongOnMarket then

    //

    //cp=3

    //

    //

    //

    //LLbar=BOTx

    //

    //EndIf


    cp = 3


    IF TradePrice = 0 THEN

    PositionSize1 = 1


    ELSE

    PositionSize1 = 1000 / sp //Compute PositionSize


    ENDIF

    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


    lastpoint = 1

    lastX = TOPx

    lastY = TOPy

    HHprec= HH

    HH  = TOPy

    HHbar = TOPx

    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,10) coloured(0,200,0,255)

    lastpoint = -1

    lastX = BOTx

    lastY = BOTy

    LLprec= LL

    LL  = BOTy

    LLbar = BOTx

    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”


    sp = close – 0

    // Long

    IF not longonmarket and (close crosses over HH) AND (HH > 0) AND (LL > LLprec) AND (LLprec > 0)and (HH > HHprec) and (HH > LL) and (HHprec > LLprec) THEN //

    #257144 quote
    Iván González
    Moderator
    Master

    Bitte schön

    cp = 3
    
    IF High[cp] >= Highest[2 * cp + 1](High) THEN
       Peak = 1
    ELSE
       Peak = 0
    ENDIF
    
    IF Peak = 1 THEN
       HH = High[cp]
    ENDIF
    
    ConditionVolume = Volume > 500000
    
    ConditionBreakout = Close[1] > HH[1] AND Close[2] <= HH[1]
    
    SCREENER[ConditionVolume AND ConditionBreakout] (Volume AS "Volume")
    


    #257154 quote
    axmichi
    Participant
    Senior

    Hallo, Danke!! es werden leider auch Aktien gefunden, wo dass HHprec höher ist als das letzte HH.


    Können Sie bitte dieses noch ändern.

    Es wird ein Ausbruch gesucht, wenn diese Bedingungen stimmen

    and (close crosses over HH) AND (HH > 0) AND (LL > LLprec) AND (LLprec > 0)and (HH > HHprec) and (HH > LL) and (HHprec > LLprec) 


    Danke

    #257170 quote
    Iván González
    Moderator
    Master

    Okay, versuchen Sie es mal mit diesem.

    // --- ProScreener Parameters ---
    cp = 3
    
    // Peak and Trough detection logic
    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
    
    // Variable assignment and history tracking
    ONCE lastPoint = 0
    ONCE HH = 0
    ONCE HHprec = 0
    ONCE LL = 0
    ONCE LLprec = 0
    
    IF Peak = 1 AND (lastPoint = -1 OR lastPoint = 0) THEN
       lastPoint = 1
       HHprec = HH
       HH = High[cp]
    ENDIF
    
    IF Trough = -1 AND (lastPoint = 1 OR lastPoint = 0) THEN
       lastPoint = -1
       LLprec = LL
       LL = Low[cp]
    ENDIF
    
    // conditions
    ConditionVolume = Volume > 500000
    
    ConditionTrend = (HH > 0) AND (LL > LLprec) AND (LLprec > 0) AND (HH > HHprec) AND (HH > LL) AND (HHprec > LLprec)
    ConditionBreakout = Close CROSSES OVER HH
    
    // Combine all filters
    ValidSignal = ConditionVolume AND ConditionTrend AND ConditionBreakout
    
    SCREENER[ValidSignal] (Volume AS "Volume")
    


    robertogozzi thanked this post
    #257303 quote
    axmichi
    Participant
    Senior

    Hallo,

    vielen Dank, das funktioniert sehr gut.

    Kann ich diesen Screener auch auf einer anderen zeitebene verwenden?

    Ich möchte werte suchen, die in einem Aufwärtstrensd sind, so wie in ihrem Code, auf Tagesbasis!!

    Zusätzlich möchte ich noch versuchen, ob die Werte auf Wochenbasis auch in einem Aufwärtstrend sind.

    Muss ich dann den HH und LLs sowie HHprec und LLprec neue Namen geben? Oder reicht es, wenn ich im Code einen weiteren Timeframe (Wochenbasis) hinzufüge

    wie hier

    TIMEFRAME(weekly)

    c1 = (close > LL) and (HH > LL)

    Damit will ich eine Kombination aus Trend auf Wochen und auf Tagesbasis.

    Es sollen nur Werte gesucht werden deren Close auf Wochenbasis über dem LL sind und natürlich wenn ein neues LL entstanden ist, der Trend also auf Wochenbasis noch funktioniert.

    Praktisch soll der übergeordnete Trend auch ok sein.

    #257311 quote
    Iván González
    Moderator
    Master

    Hallo, Sie können den Timeframe verwenden, den Sie möchten; Sie müssen ihn nur im Konfigurationsfenster des Screeners auswählen.

    axmichi thanked this post
    #257348 quote
    axmichi
    Participant
    Senior

    Ok, Danke!!

    #257355 quote
    axmichi
    Participant
    Senior

    Ich habe versucht, diesen Screener so zu ändern, das ich nicht nur Trends auf Tagesbasis screene sonder auch Trend auf Wochenbasis.

    Ich habe dem Code noch Conditiontrend2 hinzu gefügt und wollte das nur Ausbrüche aus dem HH auf Tagebasis gefunden werden wenn auch der Trend auf Wochenbasis OK ist.

    Leider scheint das nicht zu funktionieren


    Leider funktioniert das nicht??

    ConditionVolume = Volume > 500000


    ConditionTrend = (HH > 0) AND (LL > LLprec) AND (LLprec > 0) AND (HH > HHprec) AND (HH > LL) AND (HHprec > LLprec)

    ConditionBreakout = Close CROSSES OVER HH


    Timeframe (weekly)

    ConditionTrend2 = (HH > 0) AND (LL > LLprec) AND (LLprec > 0) AND (HH > HHprec) AND (HH > LL) AND (HHprec > LLprec)



    // Combine all filters

    ValidSignal = ConditionVolume AND ConditionTrendand and Conditiontrend2 AND ConditionBreakout


    SCREENER[ValidSignal] (Volume AS “Volume”)

    #257360 quote
    robertogozzi
    Moderator
    Master

    Jeder Zeitrahmen muss unterschiedliche Variablennamen haben.


    Ich habe einfach eine 2 hinzugefügt, um sie zu unterscheiden.

    Wenn Sie später einen anderen Zeitrahmen benötigen, können Sie den wöchentlichen Zeitrahmen kopieren und die 2 in den Variablennamen durch eine 3 usw. ersetzen.

    Timeframe(Weekly)
    // --- ProScreener Parameters ---
    cp2 = 3
    
    // Peak and Trough detection logic
    IF High[cp2] >= Highest[2 * cp2 + 1](High) THEN
       Peak2 = 1
    ELSE
       Peak2 = 0
    ENDIF
    
    IF Low[cp2] <= Lowest[2 * cp2 + 1](Low) THEN
       Trough2 = -1
    ELSE
       Trough2 = 0
    ENDIF
    
    // Variable assignment and history tracking
    ONCE lastPoint2 = 0
    ONCE HH2     = 0
    ONCE HH2prec = 0
    ONCE LL2     = 0
    ONCE LL2prec = 0
    
    IF Peak2 = 1 AND (lastPoint2 = -1 OR lastPoint2 = 0) THEN
       lastPoint2 = 1
       HH2prec = HH2
       HH2 = High[cp2]
    ENDIF
    
    IF Trough2 = -1 AND (lastPoint2 = 1 OR lastPoint2 = 0) THEN
       lastPoint2 = -1
       LL2prec = LL2
       LL2 = Low[cp2]
    ENDIF
    
    // conditions
    ConditionVolume2 = Volume > 500000
    
    ConditionTrend2 = (HH2 > 0) AND (LL2 > LL2prec) AND (LL2prec > 0) AND (HH2 > HH2prec) AND (HH2 > LL2) AND (HH2prec > LL2prec)
    ConditionBreakout2 = Close CROSSES OVER HH2
    
    // Combine all filters
    ValidSignal2 = ConditionVolume2 AND ConditionTrend2 AND ConditionBreakout2
    //
    // -------------------------------------------------------------------------------------
    //
    Timeframe(default)
    // --- ProScreener Parameters ---
    cp = 3
    
    // Peak and Trough detection logic
    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
    
    // Variable assignment and history tracking
    ONCE lastPoint = 0
    ONCE HH = 0
    ONCE HHprec = 0
    ONCE LL = 0
    ONCE LLprec = 0
    
    IF Peak = 1 AND (lastPoint = -1 OR lastPoint = 0) THEN
       lastPoint = 1
       HHprec = HH
       HH = High[cp]
    ENDIF
    
    IF Trough = -1 AND (lastPoint = 1 OR lastPoint = 0) THEN
       lastPoint = -1
       LLprec = LL
       LL = Low[cp]
    ENDIF
    
    // conditions
    ConditionVolume = Volume > 500000
    
    ConditionTrend = (HH > 0) AND (LL > LLprec) AND (LLprec > 0) AND (HH > HHprec) AND (HH > LL) AND (HHprec > LLprec)
    ConditionBreakout = Close CROSSES OVER HH
    
    // Combine all filters
    ValidSignal = ConditionVolume AND ConditionTrend AND ConditionBreakout
    
    SCREENER[ValidSignal AND ValidSignal2] (Volume AS "Volume")
    
    axmichi thanked this post
    #257380 quote
    axmichi
    Participant
    Senior
    <p>Hallo vielen Dank, </p><p><br></p><p>das ist gut, dann kann ich auf 3 zeitebenen nach Trends suchen.</p><p><br></p><p>Wenn ich diesen Code als Tradingsystem verwenden will, muss ich dann auch 2 Namen für die Variablen vergeben? </p><p><br></p>
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Screener für Trendfolge Ausbruch


Plattform-Support: Charts, Daten & Broker

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by axmichi
2 days, 10 hours ago.

Topic Details
Forum: Plattform-Support: Charts, Daten & Broker
Language: German
Started: 01/30/2026
Status: Active
Attachments: 1 files
Logo Logo
Loading...