Candlesticks patterns indicator

Candlesticks patterns indicator

This indicator is a complete candlesticks patterns recognizer indicator. It is a different one and more complete than the other you can find already in the library here.

This indicator recognizes about 40 candlestick patterns and draw their names with green and red arrows on chart (Windows, i.e. gaps, are drawn as “W”):

  • Doji
  • Evening star
  • Morning star
  • Shooting star
  • Hammer
  • Inverted hammer
  • Bearish harami
  • Bearish harami cross
  • Bullish harami
  • Bullish harami cross
  • Bearish engulfing
  • Bullish engulfing
  • Piercing line
  • Hanging man
  • Dark cloud cover
  • Abandoned baby bottom
  • Three White soldiers
  • Three Inside Up
  • Three Outside Up
  • Concealing Baby Swallow
  • Dragonfly Doji Bottom
  • Gravestone Doji Bottom
  • Three Stars in the South
  • Bullish Breakaway
  • Rising Three Methods
  • Bullish Three Line Strike
  • Bullish Mathold
  • Abandoned Baby Top
  • Three Black Crows
  • Three Inside Down
  • Three Outside Down
  • Upside Gap Two Crows
  • Dragonfly Doji Top
  • Gravestone Doji Top
  • Advance Block
  • Two Crows
  • Bearish Breakaway
  • Falling Three Methods
  • Bearish Three Line Strike
  • Bearish Mathold
  • Windows (Gaps Up & Gaps Down)

Since Candlesticks have a meaning only if related to the underlying trend, at the beginning of the code there is also the possibility to change the method used to identify the “trend direction” (1=MACD, 2=SAR [default], 3=Directional Movement)

Original idea and discussions from this topic on forum:
https://www.prorealcode.com/topic/mt4-candlesticks-recognizer-to-be-converted-to-prt-code/

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. criscolci • 02/27/2017 #

    wow!

  2. Ernesto1 • 02/27/2017 #

    Good Job !!! Ciccio

  3. ALE • 02/27/2017 #

    great! 🙂

  4. sincitytrader • 02/27/2017 #

    Very comprehensive. Bravo

  5. Ciccio • 02/27/2017 #

    Slightly integrated
    Added the possibilty to display all candles (with no reference to uptrend/downtrend, choose TDS=0) or by determining trend using moving averages (3 days/12 days, choose TDS=4)
    Most important, at the end of the code I added some rare candlesticks used by Steve Nison in his DVD’s (Bull Sash, Bull Separating Line, Bullish Counter Attack, Bear Sash, Bear Separating Line, Bearish Counter Attack)… hoping I didn’t mistakes
    // Trend direction identification
    //(choose 0=No Trend check, 1=MACD, 2=SAR[default], 3=Directional Movement, 4=Moving Averages crossing)

    //text color
    // white = 255,255,255 ; black = 0,0,0
    r = 0
    g = 0
    b = 0

    atr = averagetruerange[10](close)*0.5

    body=close-open

    abody=abs(body)

    if range>0 then
    ratio=abody/range
    else
    ratio=0
    endif

    middle=(open+close)/2

    bodytop=max(open, close)

    bodybottom=min(open, close)

    shadowtop=high-bodytop

    shadowbottom=bodybottom-low

    longcandle= (ratio>0.6)

    DojiSize = 0.05
    data=(abs(open - close) <= (high - low) * DojiSize)
    if data then
    DRAWTEXT(\"Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    if TDS=0 then
    TrendUp=1
    TrendDown=1
    else
    if TDS=1 then
    TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
    TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
    else
    if TDS=2 then
    TrendUp=(SAR[0.02,0.02,0.2]<low)
    TrendDown=(SAR[0.02,0.02,0.2]>high)
    else
    if TDS=3 then
    TrendUp=(ADX[14]>23 AND DI[14](close)>0)
    TrendDown=(ADX[14]>23 AND DI[14](close)<0)
    else
    if TDS=4 then
    TrendUp=(Average[3](close)>Average[12](close))
    TrendDown=(Average[3](close)<Average[12](close))
    endif
    endif
    endif
    endif
    endif

    //Bullish Signal

    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[3] AND MorningStar then
    DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif

    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[3] AND AbandonedBabyBottom then
    DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if TrendDown[3] AND ThreeInsideUp then
    DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if TrendDown[3] AND ThreeOutsideUp then
    DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if TrendDown[3] AND ThreeWhiteSoldiers then
    DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if TrendDown[4] AND ConcealingBabySwallow then
    DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    DRAWTEXT(\"Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if TrendDown[3] AND ThreeStarsInTheSouth then
    DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if TrendDown[5] AND BullishBreakaway then
    DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND RisingThreeMethods then
    DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if TrendUp[4] AND BullishThreeLineStrike then
    DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND BullishMatHold then
    DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal

    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[3] AND EveningStar then
    DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif

    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[3] AND AbandonedBabyTop then
    DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
    if TrendUp[3] AND ThreeInsideDown then
    DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
    if TrendUp[3] AND ThreeOutsideDown then
    DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
    if TrendUp[3] AND ThreeBlackCrows then
    DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
    if TrendUp[3] AND UpsideGapTwoCrows then
    DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(\"Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
    if TrendUp[3] AND AdvanceBlock then
    DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
    if TrendUp[3] AND TwoCrows then
    DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
    if TrendUp[5] AND BearishBreakaway then
    DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND FallingThreeMethods then
    DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
    if TrendDown[4] AND BearishThreeLineStrike then
    DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND BearishMatHold then
    DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
    else
    if GapDown then
    DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
    endif
    endif

    //Steve Nison Candles
    BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND close>open[1] AND shadowtop<0.1*abody)
    if BullSash then
    DRAWTEXT(\"Bull Sash\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
    if TrendDown[2] AND BullishCounterAttack then
    DRAWTEXT(\"Bullish Counter Attack\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND close<open[1] AND shadowbottom<0.1*abody)
    if BearSash then
    DRAWTEXT(\"Bear Sash\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
    if BearSeparatingLine then
    DRAWTEXT(\"Bear Separating Line\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
    if TrendUp[2] AND BearishCounterAttack then
    DRAWTEXT(\"Bearish Counter Attack\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    RETURN
     

    • philippe59139 • 02/27/2017 #

      bonjour Ciccio,
      encore bravo pour ton travail et partage !
      j’aurai aimer savoir si il etait possible d’entourer par un cercle ou un rectangle simplement le ou les chandelier reconnu et de preciser en haut du graphique ce à quoi la figure correspond.
      surtout dans un souci de ne pas encombrer les écrans.
      dans l’attente de te lire.
      cordialement

  6. Ciccio • 02/27/2017 #

    Final version (so far 🙂 )
    A small integration Added the possibility to show all candles (with no reference to the trend) and choose Moving Averages crossing to determine uptrend/downtrend
    Added also Tweezers Top/Bottom and 6 more candles (Bull Sash, Bear Sash, Bull Separating Line, Bear Separating, Line, Bullish Counter Attack, Bear Counter Attack)
    50 in total
     

    This indicator recognizes 50 candlestick patterns and draw their names with green and red arrows on chart:•Doji•Evening star•Morning star•Shooting star•Hammer•Inverted hammer•Bearish harami•Bearish harami cross•Bullish harami•Bullish harami cross•Bearish engulfing•Bullish engulfing•Piercing line•Hanging man•Dark cloud cover•Abandoned baby bottom•Three White soldiers•Three Inside Up•Three Outside Up•Concealing Baby Swallow•Dragonfly Doji Bottom•Gravestone Doji Bottom•Three Stars in the South•Bullish Breakaway•Rising Three Methods•Bullish Three Line Strike•Bullish Mathold•Abandoned Baby Top•Three Black Crows•Three Inside Down•Three Outside Down•Upside Gap Two Crows•Dragonfly Doji Top•Gravestone Doji Top•Advance Block•Two Crows•Bearish Breakaway•Falling Three Methods•Bearish Three Line Strike•Bearish Mathold•Windows (Gaps Up & Gaps Down)•Bull Sash•Bull Separating Line•Bullish Counter Attack•Bear Sash•Bear Separating Line•Bearish Counter Attack•Tweezers Top•Tweezers Bottom
    Since Candlesticks have a meaning only if related to the underlying trend, at the beginning of the code there is also the possibility to change the method used to identify the “trend direction”(0=No Trend check, 1=MACD, 2=SAR [default], 3=Directional Movement, 4=Moving Averages crossing)

     
    // Trend direction identification
    //(choose 0=No Trend check, 1=MACD, 2=SAR[default], 3=Directional Movement, 4=Moving Averagea crossing)
    // TDS=2

    //text color
    // white = 255,255,255 ; black = 0,0,0
    r = 0
    g = 0
    b = 0

    atr = averagetruerange[10](close)*0.5

    body=close-open

    abody=abs(body)

    if range>0 then
    ratio=abody/range
    else
    ratio=0
    endif

    middle=(open+close)/2

    bodytop=max(open, close)

    bodybottom=min(open, close)

    shadowtop=high-bodytop

    shadowbottom=bodybottom-low

    longcandle= (ratio>0.6)

    DojiSize = 0.05
    data=(abs(open - close) <= (high - low) * DojiSize)
    if data then
    DRAWTEXT(\"Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    //Trend Detection
    if TDS=0 then
    TrendUp=1
    TrendDown=1
    else
    if TDS=1 then
    TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
    TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
    else
    if TDS=2 then
    TrendUp=(SAR[0.02,0.02,0.2]<low)
    TrendDown=(SAR[0.02,0.02,0.2]>high)
    else
    if TDS=3 then
    TrendUp=(ADX[14]>23 AND DI[14](close)>0)
    TrendDown=(ADX[14]>23 AND DI[14](close)<0)
    else
    if TDS=4 then
    TrendUp=(Average[3](close)>Average[12](close))
    TrendDown=(Average[3](close)<Average[12](close))
    endif
    endif
    endif
    endif
    endif

    //Bullish Signal

    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[3] AND MorningStar then
    DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif

    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[3] AND AbandonedBabyBottom then
    DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if TrendDown[3] AND ThreeInsideUp then
    DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if TrendDown[3] AND ThreeOutsideUp then
    DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if TrendDown[3] AND ThreeWhiteSoldiers then
    DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if TrendDown[4] AND ConcealingBabySwallow then
    DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    DRAWTEXT(\"Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if TrendDown[3] AND ThreeStarsInTheSouth then
    DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if TrendDown[5] AND BullishBreakaway then
    DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND RisingThreeMethods then
    DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if TrendUp[4] AND BullishThreeLineStrike then
    DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND BullishMatHold then
    DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal

    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[3] AND EveningStar then
    DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif

    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[3] AND AbandonedBabyTop then
    DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
    if TrendUp[3] AND ThreeInsideDown then
    DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
    if TrendUp[3] AND ThreeOutsideDown then
    DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
    if TrendUp[3] AND ThreeBlackCrows then
    DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
    if TrendUp[3] AND UpsideGapTwoCrows then
    DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(\"Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
    if TrendUp[3] AND AdvanceBlock then
    DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
    if TrendUp[3] AND TwoCrows then
    DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
    if TrendUp[5] AND BearishBreakaway then
    DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND FallingThreeMethods then
    DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
    if TrendDown[4] AND BearishThreeLineStrike then
    DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND BearishMatHold then
    DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
    else
    if GapDown then
    DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
    endif
    endif

    //Steve Nison Candles
    BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
    if BullSash then
    DRAWTEXT(\"Bull Sash\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
    if TrendDown[2] AND BullishCounterAttack then
    DRAWTEXT(\"Bullish Counter Attack\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
    if BearSash then
    DRAWTEXT(\"Bear Sash\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
    if BearSeparatingLine then
    DRAWTEXT(\"Bear Separating Line\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
    if TrendUp[2] AND BearishCounterAttack then
    DRAWTEXT(\"Bearish Counter Attack\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Tweezers Top and Bottom
    TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1])
    if TrendUp[2] AND TweezersTop then
    DRAWTEXT(\"Tweezers Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1])
    if TrendDown[2] AND TweezersBottom then
    DRAWTEXT(\"Tweezers Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RETURN

     

    • Bard • 02/27/2017 #

      Wow, amazing job Ciccio, thanks. Patterns are supposed to be more stable and robust than indicators which need optimising. According to Earik Beann (William Tell Bonds system and his Mechanical Trading Systems book) such optimised indicator systems will fail after about 40 to 50% of the length of time used in the backtest. eg: Backtest on 10 years of data and the system will start to fail after about 4 to 5 years of live trading.

  7. François Gonin • 02/27/2017 #

    Bonjour, lorsque je rentre le code cela m’indique: 
    Erreur de syntaxe
    veuillez définir la variable suivante tds
     
    Auriez-vous une piste ? 
     
    Merci François

    • Ste • 02/27/2017 #

      ligne 3 enlève \\ devant tds =3, et  essaie encore, salut, Ste

  8. François Gonin • 02/27/2017 #

    Merci beaucoup cela fonctionne a merveille !

  9. Victorio • 02/27/2017 #

    Joli travail, merci beaucoup.
    Bravo !

  10. Bard • 02/27/2017 #

    See Thomas Bulkowski’s site for Statistical Significance of Candlestick Patterns:http://thepatternsite.com/CandleEntry.html For Chart Patterns: http://thepatternsite.com/chartpatterns.html(Sorry I cant use the insert URL link fucntion due to some tech issues)

  11. elzootero • 02/27/2017 #

    i downloaded and added the indicator to prorealtime but the indicator isnt displaying anything …please give us some step by step instructions on how to set the indicator up..thanks in advance
     

    • Nicolas • 02/27/2017 #

      Please add it on price chart using the wrench on the left upper side of the price window.

  12. Ciccio • 02/27/2017 #

    Nicolas,
    could you please put in the first post the “final release” (and its final decription and  .itf file)?
    As in my latest post
    Thanks in advance

  13. ImAlreadyRich • 02/27/2017 #

    i have set this indicator up and it works very well, is it possible to enter trades based on a candle of your selection, using simplified creation ? or will that type of trade entry need to be coded?

  14. Marius • 02/27/2017 #

    Does not work with me. I imported the itf file but instead of writing candlestick information in the price field, it only opened one of these indicator fields below the price field. And it is empty-… what´s wrong here?

  15. Marius • 02/27/2017 #

    It was my fault, it is working now as I installed it via the upper side of the price window. I copied the code that Ciccio  posted • 13 days ago, because I want only to see all candles, without uptrend/downtrend, but it gives me a syntax error. Where can I find the .itf file of the last version? The original itf file shows only dojis when set to zero.
     

    • Ciccio • 02/27/2017 #

      Unfortunately it gives me “http error” when I try to upload the new itf file
      Anyway that’s the final cose… maybe your error is due to the fact that you don’t delete the two // at line 4 (you have to uncomment that line and manually set TDS=0, otherwise you have to set TDS variable in the window)

  16. Ciccio • 02/27/2017 #

    Unfortunately it gives me “http error” when I try to upload the new itf file
    Anyway that’s the final code… maybe your error is due to the fact that you don’t delete the two // at line 4 (you have to uncomment that line and manually set TDS=0, otherwise you have to set TDS variable in the window)

  17. Victorio • 02/27/2017 #

    Bonsoir, après avoir consulté le lien:
    http://thepatternsite.com/CandleEntry.html%C2%A0
    Les taux de réussite de chaque configuration sont exprimé en % au-dessus de chaque condition; j’ai neutralisé ceux qui étaient inférieurs à 65% avec ” //”:
    //Bullish Signal
    //78
    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[3] AND MorningStar then
    DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif
    //64
    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    //DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //70
    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[3] AND AbandonedBabyBottom then
    DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //65
    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if TrendDown[3] AND ThreeInsideUp then
    //DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //75
    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if TrendDown[3] AND ThreeOutsideUp then
    DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //82
    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if TrendDown[3] AND ThreeWhiteSoldiers then
    DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //75
    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if TrendDown[4] AND ConcealingBabySwallow then
    DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //53
    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    //DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //63
    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    //DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //50
    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    //DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //51
    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    //DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //64
    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    //DRAWTEXT(\"Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif
    //55
    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    //DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //86
    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if TrendDown[3] AND ThreeStarsInTheSouth then
    DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //59
    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if TrendDown[5] AND BullishBreakaway then
    //DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //60
    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    //DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //65
    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    //DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //74
    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND RisingThreeMethods then
    DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif
    //65
    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if TrendUp[4] AND BullishThreeLineStrike then
    //DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND BullishMatHold then
    //DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    //DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal
    //72
    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[3] AND EveningStar then
    DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif
    //60
    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //69
    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[3] AND AbandonedBabyTop then
    DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //60
    ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
    if TrendUp[3] AND ThreeInsideDown then
    DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //69
    ThreeOutsideDown=v and(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
    if TrendUp[3] AND ThreeOutsideDown then
    DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //78
    ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
    if TrendUp[3] AND ThreeBlackCrows then
    DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //60
    UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
    if TrendUp[3] AND UpsideGapTwoCrows then
    //DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //53
    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    //DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //79
    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif
    //50
    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    //DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //51
    GravestoneDojiTop=v and(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    //DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //69
    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(\"Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(R,G,B)
    endif
    //57
    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    //DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //64
    AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
    if TrendUp[3] AND AdvanceBlock then
    //DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //54
    TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
    if TrendUp[3] AND TwoCrows then
    //DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //63
    BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
    if TrendUp[5] AND BearishBreakaway then
    //DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //60
    ShootingStar=v and(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    //DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //59
    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    //DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //71
    FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND FallingThreeMethods then
    DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif
    //84
    BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
    if TrendDown[4] AND BearishThreeLineStrike then
    DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND BearishMatHold then
    //DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    //DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
    else
    if GapDown then
    DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
    endif
    endif
     

  18. JohnVS • 02/27/2017 #

    Ciccio,
    This is amazing, great work, much respect.
    I do have one question/wish : Is there a possibility for you to add the Stochastic indicator as TDS as #5
    That would really make it 100% for me !
    Thanks for all your hard work
    rgds
    JOhn

    • Ciccio • 02/27/2017 #

      Sorry to be late, but I didn’t have any notification so far.
      Which would be the rule to determine if Trend Up/Down using stochastic?

    • Ciccio • 02/27/2017 #

      Done
      Take into account that I also added 4 more candlestick patterns
      •Descending Hawk•Homing Pigeon
      •Last engulfing bottom•Last engulfing top
       

      This indicator recognizes 54 candlestick patterns and draw their names with green and red arrows on chart:•Doji•Evening star•Morning star•Shooting star•Hammer•Inverted hammer•Bearish harami•Bearish harami cross•Bullish harami•Bullish harami cross•Descending Hawk•Homing Pigeon•Bearish engulfing•Bullish engulfing•Last engulfing bottom•Last engulfing top•Piercing line•Hanging man•Dark cloud cover•Abandoned baby bottom•Three White soldiers•Three Inside Up•Three Outside Up•Concealing Baby Swallow•Dragonfly Doji Bottom•Gravestone Doji Bottom•Three Stars in the South•Bullish Breakaway•Rising Three Methods•Bullish Three Line Strike•Bullish Mathold•Abandoned Baby Top•Three Black Crows•Three Inside Down•Three Outside Down•Upside Gap Two Crows•Dragonfly Doji Top•Gravestone Doji Top•Advance Block•Two Crows•Bearish Breakaway•Falling Three Methods•Bearish Three Line Strike•Bearish Mathold•Windows (Gaps Up & Gaps Down)•Bull Sash•Bull Separating Line•Bullish Counter Attack•Bear Sash•Bear Separating Line•Bearish Counter Attack•Tweezers Top•Tweezers Bottom
      Since Candlesticks have a meaning only if related to the underlying trend, at the beginning of the code there is also the possibility to change the method used to identify the “trend direction”(0=No Trend check, 1=MACD, 2=SAR [default], 3=Directional Movement, 4=Moving Averages crossing, 5=Stochastic)

      // Trend direction identification
      //(choose 0=No Trend check, 1=MACD, 2=SAR[default], 3=Directional Movement, 4=Moving Averagea crossing, 5=Stochastic)
      // TDS=2

      //text color
      // white = 255,255,255 ; black = 0,0,0
      r = 0
      g = 0
      b = 0

      atr = averagetruerange[10](close)*0.5

      body=close-open

      abody=abs(body)

      if range>0 then
      ratio=abody/range
      else
      ratio=0
      endif

      middle=(open+close)/2

      bodytop=max(open, close)

      bodybottom=min(open, close)

      shadowtop=high-bodytop

      shadowbottom=bodybottom-low

      longcandle= (ratio>0.6)

      DojiSize = 0.05
      data=(abs(open - close) <= (high - low) * DojiSize)
      if data then
      DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
      endif

      //Trend Detection
      if TDS=0 then
      TrendUp=1
      TrendDown=1
      else
      if TDS=1 then
      TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
      TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
      else
      if TDS=2 then
      TrendUp=(SAR[0.02,0.02,0.2]<low)
      TrendDown=(SAR[0.02,0.02,0.2]>high)
      else
      if TDS=3 then
      TrendUp=(ADX[14]>23 AND DI[14](close)>0)
      TrendDown=(ADX[14]>23 AND DI[14](close)<0)
      else
      if TDS=4 then
      TrendUp=(Average[3](close)>Average[12](close))
      TrendDown=(Average[3](close)<Average[12](close))
      else
      if TDS=5 then
      TrendUp=(Stochastic[14,3](close)>Average[5](Stochastic[14,3](close)))
      TrendDown=(Stochastic[14,3](close)<Average[5](Stochastic[14,3](close)))
      endif
      endif
      endif
      endif
      endif
      endif

      //Bullish Signal

      MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
      if TrendDown[3] AND MorningStar then
      DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
      endif

      PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
      if TrendDown[2] AND PiercingLine then
      DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
      if TrendDown[3] AND AbandonedBabyBottom then
      DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
      if TrendDown[3] AND ThreeInsideUp then
      DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
      if TrendDown[3] AND ThreeOutsideUp then
      DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
      if TrendDown[3] AND ThreeWhiteSoldiers then
      DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
      if TrendDown[4] AND ConcealingBabySwallow then
      DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
      if TrendDown[2] AND BullishHarami then
      DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
      if TrendDown[2] AND HomingPigeon then
      DRAWTEXT(\"Homing Pigeon\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
      if TrendDown[2] AND BullishEngulfing then
      DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
      if TrendDown[2] AND LastEngulfingBottom then
      DRAWTEXT(\"Last Engulfing Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
      if TrendDown[2] AND DragonflyDojiBottom then
      DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
      if TrendDown[2] AND GravestoneDojiBottom then
      DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
      if TrendDown[2] AND DojiStarBottom then
      DRAWTEXT(\"Doji\", barindex, low-atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
      endif

      BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
      if TrendDown[2] AND BullishHaramiCross then
      DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
      if TrendDown[3] AND ThreeStarsInTheSouth then
      DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
      if TrendDown[5] AND BullishBreakaway then
      DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
      if TrendDown[2] AND Hammer then
      DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
      if TrendDown[2] AND InvertedHammer then
      DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
      if TrendUp[5] AND RisingThreeMethods then
      DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
      if TrendUp[4] AND BullishThreeLineStrike then
      DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
      if TrendUp[5] AND BullishMatHold then
      DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      //Bearish Signal

      EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
      if TrendUp[3] AND EveningStar then
      DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
      endif

      DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
      if TrendUp[2] AND DarkCloudCover then
      DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
      if TrendUp[3] AND AbandonedBabyTop then
      DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
      if TrendUp[3] AND ThreeInsideDown then
      DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
      if TrendUp[3] AND ThreeOutsideDown then
      DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
      if TrendUp[3] AND ThreeBlackCrows then
      DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
      if TrendUp[3] AND UpsideGapTwoCrows then
      DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
      if TrendUp[2] AND BearishHarami then
      DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      DescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
      if TrendUp[2] AND DescendingHawk then
      DRAWTEXT(\"Descending Hawk\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
      if TrendUp[2] AND BearishEngulfing then
      DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
      endif

      LastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
      if TrendUp[2] AND LastEngulfingTop then
      DRAWTEXT(\"Last Engulfing Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
      endif

      DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
      if TrendUp[2] AND DragonflyDojiTop then
      DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
      if TrendUp[2] AND GravestoneDojiTop then
      DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
      if TrendUp[2] AND DojiStarTop then
      DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
      endif

      BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
      if TrendUp[2] AND BearishHaramiCross then
      DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
      if TrendUp[3] AND AdvanceBlock then
      DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
      if TrendUp[3] AND TwoCrows then
      DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
      if TrendUp[5] AND BearishBreakaway then
      DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
      if TrendUp[2] AND ShootingStar then
      DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
      if TrendUp[2] AND HangingMan then
      DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
      if TrendDown[5] AND FallingThreeMethods then
      DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
      if TrendDown[4] AND BearishThreeLineStrike then
      DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
      if TrendDown[5] AND BearishMatHold then
      DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      //Gaps
      GapUp=(low>high[1])
      GapDown=(high<low[1])
      if GapUp then
      DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
      else
      if GapDown then
      DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
      endif
      endif

      //Steve Nison Candles
      BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
      if BullSash then
      DRAWTEXT(\"Bull Sash\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
      if BullSeparatingLine then
      DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
      if TrendDown[2] AND BullishCounterAttack then
      DRAWTEXT(\"Bullish Counter Attack\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
      if BearSash then
      DRAWTEXT(\"Bear Sash\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
      if BearSeparatingLine then
      DRAWTEXT(\"Bear Separating Line\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
      if TrendUp[2] AND BearishCounterAttack then
      DRAWTEXT(\"Bearish Counter Attack\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      //Tweezers Top and Bottom
      TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1])
      if TrendUp[2] AND TweezersTop then
      DRAWTEXT(\"Tweezers Top\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif

      TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1])
      if TrendDown[2] AND TweezersBottom then
      DRAWTEXT(\"Tweezers Bottom\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      RETURN

       

  19. Johan Swarts • 02/27/2017 #

    Excellent – congrats and thank you fot putting in the efford!
     

  20. JohnVS • 02/27/2017 #

    Ciccio, this is really great!
    As said much respect for you making this. saves a lot of time studying the charts 🙂
    Thank you very much !
     
    rgds
    John

  21. JohnVS • 02/27/2017 #

    Hi Ciccio,
    Would it possible for you to add this signal to the code ?
    It’s the kicker signal
    would be great
    thx in advance
    rgds
    John
     

    DescriptionThe kicker signal, as stated above, is the most powerful signal of all and it works equally well in both directions whether bullish or bearish. Its relevance is magnified when it occurs in overbought or oversold areas and it is formed by two candles. The first candle opens and moves in the direction of the current trend and the second candle opens at the same open of the previous day (a gap open), and then heads in the opposite direction of the previous day’s candle. The bodies of the candles are opposite colors and this formation is indicative of a dramatic change in investor sentiment. The candlesticks really do visually depict the magnitude of the change.

    • Ciccio • 02/27/2017 #

      I think they are already there as
      -Bull Separating Line
      http://candlecharts.com/candlestick-patterns/separating-line-bullish-pattern/
      -Bear Separating Line
      http://candlecharts.com/candlestick-patterns/separating-line-bearish-pattern/
      Check if it is what you mean 😉
       

  22. Ciccio • 02/27/2017 #

    Anyway this is the version I am using now
    I only changed:

    Default is TDS=4 (Moving Averages Crossing)
    Moving Averages are now 2 days and 4 days, because in my opinion previous 3 and 6 days are too slow to identify an Uptrend or a Downtrend (anyway you can tweak those numbers at your leisure)

    Here is the listing
    // Trend direction identification
    //(choose 0=No Trend check, 1=MACD, 2=SAR, 3=Directional Movement, 4=Moving Averages crossing [default], 5=Stochastic)
    // TDS=4

    //text color
    // white = 255,255,255 ; black = 0,0,0
    r = 0
    g = 0
    b = 0

    atr = averagetruerange[10](close)*0.5

    body=close-open

    abody=abs(body)

    if range>0 then
    ratio=abody/range
    else
    ratio=0
    endif

    middle=(open+close)/2

    bodytop=max(open, close)

    bodybottom=min(open, close)

    shadowtop=high-bodytop

    shadowbottom=bodybottom-low

    longcandle= (ratio>0.6)

    DojiSize = 0.05
    data=(abs(open - close) <= (high - low) * DojiSize)
    if data then
    DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    //Trend Detection
    if TDS=0 then
    TrendUp=1
    TrendDown=1
    else
    if TDS=1 then
    TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
    TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
    else
    if TDS=2 then
    TrendUp=(SAR[0.02,0.02,0.2]<low)
    TrendDown=(SAR[0.02,0.02,0.2]>high)
    else
    if TDS=3 then
    TrendUp=(ADX[14]>23 AND DI[14](close)>0)
    TrendDown=(ADX[14]>23 AND DI[14](close)<0)
    else
    if TDS=4 then
    TrendUp=(Average[2](close)>Average[4](close))
    TrendDown=(Average[2](close)<Average[4](close))
    else
    if TDS=5 then
    TrendUp=(Stochastic[14,3](close)>Average[5](Stochastic[14,3](close)))
    TrendDown=(Stochastic[14,3](close)<Average[5](Stochastic[14,3](close)))
    endif
    endif
    endif
    endif
    endif
    endif

    //Bullish Signal

    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[3] AND MorningStar then
    DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif

    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[3] AND AbandonedBabyBottom then
    DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if TrendDown[3] AND ThreeInsideUp then
    DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if TrendDown[3] AND ThreeOutsideUp then
    DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if TrendDown[3] AND ThreeWhiteSoldiers then
    DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if TrendDown[4] AND ConcealingBabySwallow then
    DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND HomingPigeon then
    DRAWTEXT(\"Homing Pigeon\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND LastEngulfingBottom then
    DRAWTEXT(\"Last Engulfing Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    DRAWTEXT(\"Doji\", barindex, low-atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if TrendDown[3] AND ThreeStarsInTheSouth then
    DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if TrendDown[5] AND BullishBreakaway then
    DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND RisingThreeMethods then
    DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if TrendUp[4] AND BullishThreeLineStrike then
    DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND BullishMatHold then
    DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal

    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[3] AND EveningStar then
    DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif

    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[3] AND AbandonedBabyTop then
    DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
    if TrendUp[3] AND ThreeInsideDown then
    DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
    if TrendUp[3] AND ThreeOutsideDown then
    DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
    if TrendUp[3] AND ThreeBlackCrows then
    DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
    if TrendUp[3] AND UpsideGapTwoCrows then
    DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND DescendingHawk then
    DRAWTEXT(\"Descending Hawk\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    LastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND LastEngulfingTop then
    DRAWTEXT(\"Last Engulfing Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
    if TrendUp[3] AND AdvanceBlock then
    DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
    if TrendUp[3] AND TwoCrows then
    DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
    if TrendUp[5] AND BearishBreakaway then
    DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND FallingThreeMethods then
    DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
    if TrendDown[4] AND BearishThreeLineStrike then
    DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND BearishMatHold then
    DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
    else
    if GapDown then
    DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
    endif
    endif

    //Steve Nison Candles
    BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
    if BullSash then
    DRAWTEXT(\"Bull Sash\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
    if TrendDown[2] AND BullishCounterAttack then
    DRAWTEXT(\"Bullish Counter Attack\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
    if BearSash then
    DRAWTEXT(\"Bear Sash\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
    if BearSeparatingLine then
    DRAWTEXT(\"Bear Separating Line\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
    if TrendUp[2] AND BearishCounterAttack then
    DRAWTEXT(\"Bearish Counter Attack\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Tweezers Top and Bottom
    TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1])
    if TrendUp[2] AND TweezersTop then
    DRAWTEXT(\"Tweezers Top\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1])
    if TrendDown[2] AND TweezersBottom then
    DRAWTEXT(\"Tweezers Bottom\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RETURN

     

  23. JohnVS • 02/27/2017 #

    Hi ciccio,
     
    Those patterns do not look the same to me.
    The bearish one is a few ups and then 1 down opening starting at or lower then last days open
    The bullish one is a few downs and then an UP cadle opening at previous day opening 
    Hope u see what i mean 🙂
    rgds
    John

    • Ciccio • 02/27/2017 #

      Well… the code for Bull Separating Line (like Steve Nison calls it) is this
      BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
      if BullSeparatingLine then
      DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif
      that means that

      first candle is black and long
      second candle is white and long
      second candle opens at a price greater than or equal to the previous candle and its shadow is very little (0.1  times white body)
      trend is not important

      if we read kicker’s description here
      http://stephenbigalow.com/blog/kicker-signals/

      The first day’s open and the second day’s open are the same.

      The price movement is in opposite directions from the opening price.

      The trend has no relevance in a kicker situation.

      The signal is usually formed by surprise news before or after market hours.

      The price never retraces into the previous day’s trading range.

      the only difference I see is the latest criterium (price never retraces….)
      If we read here
      http://www.candlescanner.com/candlestick-patterns/kicking-up-bullish-kicking/
      and use the “marubozu” criterium it seems a very very rare candlestick pattern
      All this to say that the “kicker” seems to me just a sub-set of the “separating line” and if we create this rule, both descriptions will appear.
      Anyway, if you want, you can add by yourself these lines at the Indicator listing
      BullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0)
      if BullishKicking then
      DRAWTEXT(\"BullishKicking\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
      DRAWARROWUP(barindex,low) COLOURED(0,155,10)
      endif

      BearishKicking=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowtop=0 AND shadowbottom=0)
      if BearishKicking then
      DRAWTEXT(\"Bearish Kicking\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
      DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
      endif
      Hear from you 🙂

  24. Ciccio • 02/27/2017 #

    … anyway here you are 🙂

    This indicator recognizes 56 candlestick patterns and draw their names with green and red arrows on chart:•Doji•Evening star•Morning star•Shooting star•Hammer•Inverted hammer•Bearish harami•Bearish harami cross•Bullish harami•Bullish harami cross•Descending Hawk•Homing Pigeon•Bearish engulfing•Bullish engulfing•Last engulfing bottom•Last engulfing top•Piercing line•Hanging man•Dark cloud cover•Abandoned baby bottom•Three White soldiers•Three Inside Up•Three Outside Up•Concealing Baby Swallow•Dragonfly Doji Bottom•Gravestone Doji Bottom•Three Stars in the South•Bullish Breakaway•Rising Three Methods•Bullish Three Line Strike•Bullish Mathold•Abandoned Baby Top•Three Black Crows•Three Inside Down•Three Outside Down•Upside Gap Two Crows•Dragonfly Doji Top•Gravestone Doji Top•Advance Block•Two Crows•Bearish Breakaway•Falling Three Methods•Bearish Three Line Strike•Bearish Mathold•Windows (Gaps Up & Gaps Down)•Bull Sash•Bull Separating Line•Bullish Counter Attack•Bear Sash•Bear Separating Line•Bearish Counter Attack•Tweezers Top•Tweezers Bottom•Bullish Kicker•Bearish Kicker
    Since Candlesticks have a meaning only if related to the underlying trend, at the beginning of the code there is also the possibility to change the method used to identify the “trend direction”(0=No Trend check, 1=MACD, 2=SAR, 3=Directional Movement, 4=Moving Averages crossing [default], 5=Stochastic)

     
    // Trend direction identification
    //(choose 0=No Trend check, 1=MACD, 2=SAR, 3=Directional Movement, 4=Moving Averages crossing [default], 5=Stochastic)
    // TDS=4

    //text color
    // white = 255,255,255 ; black = 0,0,0
    r = 0
    g = 0
    b = 0

    atr = averagetruerange[10](close)*0.5

    body=close-open

    abody=abs(body)

    if range>0 then
    ratio=abody/range
    else
    ratio=0
    endif

    middle=(open+close)/2

    bodytop=max(open, close)

    bodybottom=min(open, close)

    shadowtop=high-bodytop

    shadowbottom=bodybottom-low

    longcandle= (ratio>0.6)

    DojiSize = 0.05
    data=(abs(open - close) <= (high - low) * DojiSize)
    if data then
    DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    //Trend Detection
    if TDS=0 then
    TrendUp=1
    TrendDown=1
    else
    if TDS=1 then
    TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
    TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
    else
    if TDS=2 then
    TrendUp=(SAR[0.02,0.02,0.2]<low)
    TrendDown=(SAR[0.02,0.02,0.2]>high)
    else
    if TDS=3 then
    TrendUp=(ADX[14]>23 AND DI[14](close)>0)
    TrendDown=(ADX[14]>23 AND DI[14](close)<0)
    else
    if TDS=4 then
    TrendUp=(Average[2](close)>Average[4](close))
    TrendDown=(Average[2](close)<Average[4](close))
    else
    if TDS=5 then
    TrendUp=(Stochastic[14,3](close)>Average[5](Stochastic[14,3](close)))
    TrendDown=(Stochastic[14,3](close)<Average[5](Stochastic[14,3](close)))
    endif
    endif
    endif
    endif
    endif
    endif

    //Bullish Signal

    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[3] AND MorningStar then
    DRAWTEXT(\"Morning Star\", barindex, low[1]-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif

    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    DRAWTEXT(\"Piercing Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[3] AND AbandonedBabyBottom then
    DRAWTEXT(\"Abandoned Baby Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeInsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishHarami[1] and close>close[1])
    if TrendDown[3] AND ThreeInsideUp then
    DRAWTEXT(\"Three Inside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeOutsideUp=(body[2]<0 and body[1]>0 and body>0 and BullishEngulfing[1] and close>close[1])
    if TrendDown[3] AND ThreeOutsideUp then
    DRAWTEXT(\"Three Outside Up\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeWhiteSoldiers=(body[2]>0 and body[1]>0 and body>0 and high[1]>high[2] and high>high[1] and close[1]>close[2] and close>close[1] and open[1]>open[2] and open[1]<close[2] and open>open[1] and open<close[1])
    if TrendDown[3] AND ThreeWhiteSoldiers then
    DRAWTEXT(\"Three White Soldiers\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ConcealingBabySwallow=(body[3]<0 and body[2]<0 and body[1]<0 and body<0 and ratio[3]>0.8 and ratio[2]>0.8 and ratio>0.8 and open[1]<close[2] and high[1]>close[2] and shadowtop[1]>0.6*(abody[1]+shadowbottom[1]) and bodybottom<bodybottom[1] and bodytop>high[1])
    if TrendDown[4] AND ConcealingBabySwallow then
    DRAWTEXT(\"Concealing Baby Swallow\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    DRAWTEXT(\"Bullish Harami\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    HomingPigeon=(body[1]<0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND HomingPigeon then
    DRAWTEXT(\"Homing Pigeon\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    DRAWTEXT(\"Bullish Engulfing\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    LastEngulfingBottom=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND LastEngulfingBottom then
    DRAWTEXT(\"Last Engulfing Bottom\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    DRAWTEXT(\"Dragonfly Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    DRAWTEXT(\"Gravestone Doji\", barindex, low-atr, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    DRAWTEXT(\"Doji\", barindex, low-atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    DRAWTEXT(\"Bullish Harami Cross\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    ThreeStarsInTheSouth=(body[2]<0 and body[1]<0 and body<0 and shadowtop[2]<range[2]/4 and shadowbottom[2]>abody[2]/2 and low[1]>low[2] and high[1]<high[2] and abody[1]<abody[2] and shadowtop[1]<range[1]/4 and shadowbottom[1]>abody[1]/2 and low>low[1] and high<high[1] and abody<abody[1] and shadowtop<range/4 and shadowbottom<range/4)
    if TrendDown[3] AND ThreeStarsInTheSouth then
    DRAWTEXT(\"Three Stars In The South\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishBreakaway=(body[4]<0 and body[3]<0 and body>0 and open[3]<close[4] and close[2]<close[3] and close[1]<close[2] and longcandle and close<close[4] and close>open[3])
    if TrendDown[5] AND BullishBreakaway then
    DRAWTEXT(\"Bullish Breakaway\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    DRAWTEXT(\"Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    DRAWTEXT(\"Inverted Hammer\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    RisingThreeMethods=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and longcandle and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND RisingThreeMethods then
    DRAWTEXT(\"Rising Three Methods\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishThreeLineStrike=(body[3]>0 and body[2]>0 and body[1]>0 and body<0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]>close[3] and close[1]>close[2] and open>close[1] and close<open[3])
    if TrendUp[4] AND BullishThreeLineStrike then
    DRAWTEXT(\"Bullish Three Line Strike\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishMatHold=(body[4]>0 and body[3]<0 and body[1]<0 and body>0 and longcandle[4] and close[3]>close[4] and close[2]<close[3] and close[1]<close[2] and high[2]<high[3] and high[1]<high[2] and low[1]>low[4] and open>close[1] and close>high[4] and close>high[3] and close>high[2] and close>high[1])
    if TrendUp[5] AND BullishMatHold then
    DRAWTEXT(\"Bullish Mat Hold\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal

    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[3] AND EveningStar then
    DRAWTEXT(\"Evening Star\", barindex, high[1]+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif

    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(\"Dark Cloud Cover\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[3] AND AbandonedBabyTop then
    DRAWTEXT(\"Abandoned Baby Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeInsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishharami[1] and close<close[1])
    if TrendUp[3] AND ThreeInsideDown then
    DRAWTEXT(\"Three Inside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeOutsideDown=(body[2]>0 and body[1]<0 and body<0 and bearishengulfing[1] and close<close[1])
    if TrendUp[3] AND ThreeOutsideDown then
    DRAWTEXT(\"Three Outside Down\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ThreeBlackCrows=(body[2]<0 and body[1]<0 and body<0 and longcandle[2] and longcandle[1] and longcandle and low[1]<low[2] and low<low[1] and close[1]<close[2] and close<close[1] and open[1]<open[2] and open[1]>close[2] and open<open[1] and open>close[1])
    if TrendUp[3] AND ThreeBlackCrows then
    DRAWTEXT(\"Three Black Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    UpsideGapTwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and bodytop>bodytop[1] and bodybottom<bodybottom[1] and close>close[2])
    if TrendUp[3] AND UpsideGapTwoCrows then
    DRAWTEXT(\"Upside Gap Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    DRAWTEXT(\"Bearish Harami\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DescendingHawk=(body[1]>0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND DescendingHawk then
    DRAWTEXT(\"Descending Hawk\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(\"Bearish Engulfing\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    LastEngulfingTop=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND LastEngulfingTop then
    DRAWTEXT(\"Last Engulfing Top\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    DRAWTEXT(\"Dragonfly Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    DRAWTEXT(\"Gravestone Doji\", barindex, high+atr, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(\"Doji\", barindex, high+atr*0.75, Dialog, Standard, 12) COLOURED(R,G,B)
    endif

    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    DRAWTEXT(\"Bearish Harami Cross\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AdvanceBlock=(body[2]>0 and body[1]>0 and body>0 and high[2]<high[1] and high[1]<high and open[1]>bodybottom[2] and open[1]<bodytop[2] and open>bodybottom[1] and open<bodytop[1] and abody[1]<abody[2] and abody<abody[1])
    if TrendUp[3] AND AdvanceBlock then
    DRAWTEXT(\"Advance Block\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TwoCrows=(body[2]>0 and body[1]<0 and body<0 and longcandle[2] and open[1]>close[2] and close[1]>close[2] and open<bodytop[1] and open>bodybottom[1] and close<bodytop[2] and close>bodybottom[2])
    if TrendUp[3] AND TwoCrows then
    DRAWTEXT(\"Two Crows\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishBreakaway=(body[4]>0 and body[3]>0 and body<0 and open[3]>close[4] and close[2]>close[3] and close[1]>close[2] and longcandle and close>close[4] and close<open[3])
    if TrendUp[5] AND BearishBreakaway then
    DRAWTEXT(\"Bearish Breakaway\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    DRAWTEXT(\"Shooting Star\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    DRAWTEXT(\"Hanging Man\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    FallingThreeMethods=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and longcandle and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND FallingThreeMethods then
    DRAWTEXT(\"Falling Three Methods\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishThreeLineStrike=(body[3]<0 and body[2]<0 and body[1]<0 and body>0 and longcandle[3] and longcandle[2] and longcandle[1] and close[2]<close[3] and close[1]<close[2] and open<close[1] and close>open[3])
    if TrendDown[4] AND BearishThreeLineStrike then
    DRAWTEXT(\"Bearish Three Line Strike\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishMatHold=(body[4]<0 and body[3]>0 and body[1]>0 and body<0 and longcandle[4] and close[3]<close[4] and close[2]>close[3] and close[1]>close[2] and low[2]>low[3] and low[1]>low[2] and high[1]<high[4] and open<close[1] and close<low[4] and close<low[3] and close<low[2] and close<low[1])
    if TrendDown[5] AND BearishMatHold then
    DRAWTEXT(\"Bearish Mat Hold\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(\"w\", barindex, (high[1]+low)/2, Dialog, Bold, 12) COLOURED(0,0,255)
    else
    if GapDown then
    DRAWTEXT(\"w\", barindex, (high+low[1])/2, Dialog, Bold, 12) COLOURED(255,0,255)
    endif
    endif

    //Steve Nison Candles
    BullSash=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>close[1] AND open<open[1] AND close>open[1] AND shadowtop<0.1*abody)
    if BullSash then
    DRAWTEXT(\"Bull Sash\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    DRAWTEXT(\"Bull Separating Line\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishCounterAttack=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND close<=close[1])
    if TrendDown[2] AND BullishCounterAttack then
    DRAWTEXT(\"Bullish Counter Attack\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BearSash=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open>open[1] AND open<close[1] AND close<open[1] AND shadowbottom<0.1*abody)
    if BearSash then
    DRAWTEXT(\"Bear Sash\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
    if BearSeparatingLine then
    DRAWTEXT(\"Bear Separating Line\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishCounterAttack=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND close>=close[1])
    if TrendUp[2] AND BearishCounterAttack then
    DRAWTEXT(\"Bearish Counter Attack\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Tweezers Top and Bottom
    TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1])
    if TrendUp[2] AND TweezersTop then
    DRAWTEXT(\"Tweezers Top\", barindex, high+atr*1.20, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1])
    if TrendDown[2] AND TweezersBottom then
    DRAWTEXT(\"Tweezers Bottom\", barindex, low-atr*1.20, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //kicker candlestick patterns
    BullishKicking=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop=0 AND shadowbottom=0)
    if BullishKicking then
    DRAWTEXT(\"Bullish Kicking\", barindex, low-atr*1.5, Dialog, Standard, 12) COLOURED(0,155,10)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BearishKicking=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowtop=0 AND shadowbottom=0)
    if BearishKicking then
    DRAWTEXT(\"Bearish Kicking\", barindex, high+atr*1.5, Dialog, Standard, 12) COLOURED(255,0,10)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    RETURN

     
     

  25. finplus • 02/27/2017 #

    Bravo pour ce travail hallucinant. Il me faudra un peu de patience pour mettre ces codes en Heiken Ashi.

    • Nicolas • 02/27/2017 #

      Rechercher /remplacer les open high low et close par les noms de tes variables heikin ashi te prendra 2 minutes 🙂

  26. finplus • 02/27/2017 #

    merci.

  27. Nicolas • 02/27/2017 #

    Hi Ciccio, you made a great job here, warm thanks again for your sharing spirit! 

  28. M-AURELE • 02/27/2017 #

    Bravo pour tout ce travail !!

  29. haimamar • 02/27/2017 #

    HiCan someone instruct me how to install this code?Thank you
     

  30. baaz • 02/27/2017 #

    Hi’ guys,
     
    Brilliant code. I’ve been looking for the candlestick for a while.
    However, when I add it as an indicator, it doesn’t work. I get a separate blank window. No markings on the price window.
     
    Any suggestions?
     
    Thanks.
     
    Regards,
    Mubashar

    • Ciccio • 02/27/2017 #

      You have to add it by clicking on the wrench at the top left of each stock chart

  31. baaz • 02/27/2017 #

    Thanks Ciccio! It works the way you suggested it.

  32. Aporio • 02/27/2017 #

    Qué bueno!!! felicidades.
    Es posible hacer screener de velas de suelo tipo hammer, envolventes bullish engulfing, además de doble suelo o una divergencia alcista?
    Saludos
    Luis

  33. mcha • 02/27/2017 #

    Hi , very good
    Do you try to program Fry pan bottom pattern?
    Best regards

  34. klintistwood • 02/27/2017 #

    Hello Ciccio, thanks for the sharing. Which time unit would be best to use candles ? Day ? Hour ? Minute ?
    Thanks!

  35. redz • 02/27/2017 #

    programme dont work with me

  36. BennieHofer • 02/27/2017 #

    Would love to get these. I tried to import them via .itf file but got a error message and it sent it to prorealtime.I was using quite a bit of RAM when doing the .itf import. the copy and paste didnt work. error message said , Drawtext is only used for indicator programming,{Probuilder}. any sugestions Thanks

  37. Gianco • 02/27/2017 #

    Buongiorno Ciccio , mi chiamo Gianluigi , sono di Biella , mi piacerebbe contattarLa per il codice che ha fatto , lo trovo interessante , l’ho visto e però mi serve un consiglio

    • Ciccio • 02/27/2017 #

      Meglio che chiedi direttamente sul Forum (inglese, che è frequentato da più persone)
      Ho solo tradotto il codice da uno mq4.

      Better to ask directly in the English Forum
      I only translated the code from an original mq4

  38. CRIS • 02/27/2017 #

    Ciccio! Good afternoon I tried to code in mt4 and this error is appearing in your code, can you help me please!
    ‘r’ – declaration without type trendeclander.mq4

    • Nicolas • 02/27/2017 #

      Hi, our website is dedicated to ProRealTime trading platform programming. This is not MT4 code!

  39. singha • 02/27/2017 #

    Hi, I have one question in the form of candles, source code and I do not know the number of range.

  40. Dilip Vasudeva • 02/27/2017 #

    Hi ,I tried adding this to the indicator list keeps popping up with syntax error that tds is undefined. Could you kindly help me please

  41. Ciccio • 02/27/2017 #

    There is a new version that I posted in the library
    Here
    https://www.prorealcode.com/prorealtime-indicators/candlestick-pattern-indicator-2-0/

  42. Sagal • 02/27/2017 #

    Thanks Ciccio, very much appreciated.

  43. christophe11560 • 02/27/2017 #

    thinks very much for your job!!! how an i integrate a double/triple bottom or a double/triple top?

    • Ciccio • 02/27/2017 #

      They have nothing to do with candlesticks, so I don’t know.
      Anyway take into account that I posted an upgrade of this pattern indicator here https://www.prorealcode.com/prorealtime-indicators/candlestick-pattern-indicator-2-0/

    • christophe11560 • 02/27/2017 #

      ok merci

  44. kaq52 • 02/27/2017 #

    Could someone please confirm if attachment above contains all the code changes discussed in comments? That is, is the attachmentlatest version or do I need to copy from comments?

  45. Jan • 02/27/2017 #

    Awesome, Ciccio.
    I tend to have the same question as kaq52, (however I can work with the itf attached), could you confirm that the latest version after all the discussions/request is attached in the itf above ?
    Thanks a lot, the candlestick patterns in combination with the trends give lots of new trading ideas .

    • Ciccio • 02/27/2017 #

      As written some posts above, there is an update here
      https://www.prorealcode.com/prorealtime-indicators/candlestick-pattern-indicator-2-0/
      that adds some new candles

  46. Mrmamps079 • 02/27/2017 #

    Hi Admin, I can’t plug this indicator on my metatrader 4 on my laptop. When I add it on my indicators it doesn’t wanna appear. What can I do Please help me.

    • Nicolas • 02/27/2017 #

      Sorry but we do not provide any help for mt4 users. Our website is dedicated to ProRealTime trading platform only.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+57 more likes

Related users ' posts
Vinks_o_7 Hi Bruno Could you tell me where I can find more info about Laguerre candlesick please ?
Vinks_o_7 oops sorry did not see that one had to untick the standard Price to see your candle...
avatar
Anonymous This is very useful, look forward to testing it out. Thank you very much
idunnomuch IS this working in the latest version of prorealtime? I get the indicator, but not over my c...
bernardmorel egalement apparait en dessous du graphique mais vide
bernardmorel Bonjour est t il possible de remettre en ligne the strat car il y a une indication qui d...
bibifricotin Je pense avoir compris dans la première colonne exemple 92 le 9 indique la période et le 2 ...
Leo_da_Pisa It seems to work very well. Good for confirmation. Thanks for sharing Vivien.
joguemon Buenas, he instalado el screener pero no me aparecen los números que indicas...tengo que mon...
enriquem Hola, No, los numeros no aparecen, Proscreener no permite rotular, Lo que devuelve el sc...
PeytoLake Hi Enriquem, How do I change the timeframe from 'Daily' to "5 min"? Thank you.
quibe56 Bonjour, à priori les couleurs pour le Katana ne fonctionnent pas ( départ haussier ou élan...
swapping Bonjour quibe56, n'ayant pas rencontré ce défaut je continu néanmoins à structurer le code p...
Pablo Carmona del Moral hola juanjo, muchas gracias por este screener que nos has compartido. creo que lo voy a util...
Pablo Carmona del Moral para el volumen he cambiado: // Volumen significativo VS=volume>2*(average[10](volume[1...
Juanjo Muchas Gracias Pablo, ...Tengo varios screener, uno lo tengo adaptado para operar intradía, ...
RGKP Hi Vonasi, great work! But what I do not understand is that the statistics change according ...
mr_delta Hi https://www.prorealcode.com/user/vonasi/ I am interested in in scanning for a similar set...
Vonasi Minor Bug Fix Please download an updated version with a minor bug fix from here: https://www...
Jesper Great share!
capgros Bonjour @Nicolas, Thanks a lot for this tool, it is very useful for me. I would like to s...
Hans63 Would you add the possibility to color also the Heikin Ashi and bar chart?
Nicolas That's possible, please open a new topic in the indicator forum explaining what you need exa...
Victor.Strand Hi Pableitor, the code is just great; i was playing a lil bit with these factors, darwsegmen...
micky_red Hi, I have tried to use this indicator in version 12 and it doesn't work. Do you know how...
Victor.Strand Hey Micky, indicator works well, justpaste the code on the platform, or save it as an "itf" ...
ckat55 Thank you Nicolas, is there any way that an alert can be set for when the dot appears?
Nicolas yes, change the last line with: RETURN wrb,qh and set an alarm with the alert tool for ea...
ckat55 Thank you Nicolas, I will try it.
JohnScher After a small error crept in, a correct itf.file has been uploaded.
dougie80 Great Indicator, Is there a way to use this as an alert ?
JohnScher I created the screener with some help here from PRT. It is surely somewhere in one of the fo...
Ravindra Khanna copied it to pro real time not working. what to do?

Top