Candlestick patterns & Bollinger Band

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12461 quote
    Henry
    Participant
    Average

    A request that was addressed to ProRealTime:

     

    Dear ProRealTime programmers.

    I would like a Screener that identifies 4 different candlestick patterns with an upper or lower bollinger band breakout.

    These are the four candlestick patterns that the screener should be able to identify: Bearish Engulfing, Bullish Engulfing, Dark Cloud Cover and Piercing Line.
    For the bearish engulfing and the Dark Cloud Cover the end price of the first candle has to be higher than the upper band level. The start price of the second candle got to be higher than the upper bollinger band as well.
    For bullish engulfing and piercing line it is the opposite, first candle close price is below the lower band and the start price of second candle is below the lower band.

    The settings for the Bollinger should be as default:
    MA nbr periods: 20
    Standard deviation: 2
    Method: Simple
    Apply to: Close

    It got to work on both the deaily, weekly and monthly timeframe.

    If there is some additional info that is necessary for the coding, please let me know.
    Awaiting your response with anticipiation!
    Regards

    Suggestion for an anwser:

    Here below you can find the code that you can launch in daily or weekly timeframes. (Please note that the timeframe monthly does not exist in ProScreener):

    //bollinger
    P=20 //period
    S=2 // Standard deviation
    
    BollingerMA = Average[p](close)
    STDDEV=STD[P](close)
    
    bollUP = BollingerMA + s * STDDEV
    bollDOWN = BollingerMA - s * STDDEV
    
    // Detection bearish engulfing
    bearishengulfing = CLOSE[1] > OPEN[1] AND OPEN > CLOSE[1] AND CLOSE < OPEN[1]
    
    // Detection bullish engulfing
    BullishEngulfing= CLOSE[1] < OPEN[1] AND OPEN < CLOSE[1] AND CLOSE > OPEN[1]
    
    // Detection dark cloud cover (bearish reversal)
    darkcloudcover = CLOSE[1] < OPEN[1] AND OPEN < CLOSE[1] AND CLOSE > OPEN[1]
    
    // Detection piercing
    piercing = CLOSE[1]<OPEN[1] AND OPEN< CLOSE[1] AND CLOSE>(CLOSE[1]+(OPEN[1]-CLOSE[1])/2) AND CLOSE < OPEN[1]
    
    
    priceoverupperband=close[1] > bollUP and open > BollUP
    priceunderlowerband=close[1] < bollDOWN and open < bollDOWN
    
    condition=((bearishengulfing or darkcloudcover) and priceoverupperband) or ((BullishEngulfing or piercing) and priceunderlowerband)
    
    screener[condition]
    NeraVeem thanked this post
    #12501 quote
    mykologen
    Participant
    Average

    Thanks for the help, much appreciated!

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

Candlestick patterns & Bollinger Band


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Henry @henry Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by mykologen
9 years, 6 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 08/30/2016
Status: Active
Attachments: No files
Logo Logo
Loading...