Pro screeners/trend-reversal-continuation patterns

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #163739 quote
    Manu L.
    Participant
    Average

    Bonjour,

    existe-t-il un screnner en partant de celui-ci https://www.prorealcode.com/prorealtime-market-screeners/trend-reversal-continuation-patterns/

    mais pourrait ressortir uniquement les figures qu’on lui demande de sortir via une sélection ou validation à 0 ou 1 dans le programme.

     

    Merci pour votre aide

    #163740 quote
    Nicolas
    Keymaster
    Master

    Avec le code ci-dessous tu actives / désactives les patterns de bougies que tu souhaites avec les variables qui commencent par Active… (0 = désactiver ; 1 = activer).

    // Five Candlestick Patterns
    //
    // The 5 most powerful classical Candlestick Patterns
    // Trend reversal and continuation patterns
    
    // Coded by Violet
    // 4-12-2017
    //
    // Based on the work of Thomas Bulkowski in his book: "Encyclopedia of Candlestick Charts", 2008
    // Read a summary here: https://www.investopedia.com/articles/active-trading/092315/5-most-powerful-candlestick-patterns.asp
    //
    // This *market-wide screener* works along similar lines as this *fund-specific indicator* in the PRC library list: "Candlestick patterns recognition"
    
    //
    // Signal codes and pattern types
    //**************************************************************************
    //                          Type      Direction    Bulkowski's    Occurrence
    //     Name of pattern                             accuracy rate
    //                          -------   ------------ ------------   ----------
    // 1 = ThreeLineStrikeUp    Bullish   Reversal         84%        truly rare
    // 2 = TwoBlackGappingDown  Bearish   Continuation     68%        common
    // 3 = ThreeBlackCrows      Bearish   Continuation     78%        common
    // 4 = EveningStar          Bearish   Reversal         72%        very low
    // 5 = AbandonedBaby        Bullish   Reversal         70%        low
    //**************************************************************************
    //
    
    ActiveThreeLineStrikeUp   = 1
    ActiveTwoBlackGappingDown = 1
    ActiveThreeBlackCrows     = 1
    ActiveEveningStar         = 1
    ActiveAbandonedBaby       = 1
    
    // ---------------------------------------
    
    ThreeLineStrikeUp   = 0
    TwoBlackGappingDown = 0
    ThreeBlackCrows     = 0
    EveningStar         = 0
    AbandonedBaby       = 0
    
    signal              = 0
    
    
    // 1 - Three Line Strike Up *************************************
    // Bulkowski accuracy rate 84%, frequency: very rare
    t1 = close[3] < open[3]   // candle 4 = red candle
    t2 = close[2] < open[2] and low[2] < low[3] and open[2] < open[3] // candle 3 = red candle, lower low & open than previous candle
    t3 = close[1] < open[1] and low[1] < low[2] and open[1] < open[2] // candle 2 = red candle and lower low & open than previous candle
    t4 = open[0] < low[1]  and close[0] > open[3] // candle 1 = green candle, opens lower than previous candle and closes above open of 4th candle. The candle engulfs the bodies of the three preceding black candles
    
    if t1 and t2 and t3 and t4 then
    ThreeLineStrikeUp = 1
    endif
    
    
    // 2 - Bearish Two Black Gapping *************************
    // Bulkowski accuracy rate 68%, frequency: common
    b1 = close[1] < open[1]  // red candle
    b2 = close[0] < open[0]  // followed by another red candle
    b3 = high[0]  < low[1]   // with a down gap in between
    
    if b1 and b2 and b3 then
    TwoBlackGappingDown = 1
    endif
    
    
    // 3 - Three Black Crows *********************************
    // Bulkowski accuracy rate 78%, frequency: very common
    c1 = close[2] < open[2]
    c2 = close[1] < open[1] and close[1] < low[2]
    c3 = close[0] < open[0] and close[0] < low[1]
    // Closing prices are less than 1/3 from lows
    c4 = abs(close[2] -low[2]) < range[2] / 3
    c5 = abs(close[1] -low[1]) < range[1] / 3
    c6 = abs(close[0] -low[0]) < range[0] / 3
    
    if c1 and c2 and c3 and c4 and c5 and c6 then
    ThreeBlackCrows = 1
    endif
    
    
    // 4 Evening Star **************************************************
    // Bulkowski accuracy rate 72%, frequency low
    e1 = close[2] > open[2]  // green candle
    e2 = open[1] > close[2] and close[1] > close[2] and low[1] > close[2] // candle entirely above predecessor's body
    e3 = close[0] < open[0] and high[0] < low[1]  // red candle with a gap
    e4 = range[1] < (range[2] / 2 )   // evening star's range is small compared to preceding candle
    
    if e1 and e2 and e3 and e4 then
    EveningStar = 1
    endif
    
    
    // 5 - Abandoned baby, aka Morning star ***********************
    // Bulkowski accuracy rate 70%, frequenc": low
    a1 = high[1] < low[2]  // gap
    a2 = high[1] < low[0]  // gap
    a3 = abs(open[1]-close[1]) < ( range[1] / 2 )  // doji like
    
    if a1 and a2 and a3 then
    AbandonedBaby = 1
    endif
    
    
    // Results ******************
    if ThreeLineStrikeUp and ActiveThreeLineStrikeUp then
    signal = 1
    elsif TwoBlackGappingDown and ActiveTwoBlackGappingDown  then
    signal = 2
    elsif ThreeBlackCrows and ActiveThreeBlackCrows then
    signal = 3
    elsif EveningStar and ActiveEveningStar then
    signal = 4
    elsif AbandonedBaby and ActiveAbandonedBaby then
    signal = 5
    endif
    
    
    //
    // Pattern types
    //**************************
    //Type = Name of pattern
    //----   -------------------
    //   1 = ThreeLineStrikeUp
    //   2 = TwoBlackGappingDown
    //   3 = ThreeBlackCrows
    //   4 = EveningStar
    //   5 = AbandonedBaby
    //**************************
    //
    screener [ signal > 0 ] sort by signal as "Type"
    #163741 quote
    Manu L.
    Participant
    Average

    Merci Nicolas pour ta réactivité

    donc si je ne veux que les étoiles du matin, il faut saisir ce paramétrage ?

     

    ActiveThreeLineStrikeUp = 0
    ActiveTwoBlackGappingDown = 0
    ActiveThreeBlackCrows = 0
    ActiveEveningStar = 0
    ActiveAbandonedBaby = 1

    // —————————————

    ThreeLineStrikeUp = 0
    TwoBlackGappingDown = 0
    ThreeBlackCrows = 0
    EveningStar = 0
    AbandonedBaby = 0

    signal = 0

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

Pro screeners/trend-reversal-continuation patterns


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
Manu L. @manu-l Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Manu L.
4 years, 11 months ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 03/10/2021
Status: Active
Attachments: No files
Logo Logo
Loading...