OPEN-SOURCE SCRIPT

CSPD

Updated
Most Advanced & Accurate CandleStick Pattern Detector
Looking All Over of All Markets for All Important Powerful Reversal | Corrective Patterns (25 type)
Filtering the Results with Optional Features like Oscillator, Bollinger Bands, Volume Confirmation, Prior and Following Candles Confirmation which are Fully Customizable.



With this you can detect:
  • Hammer | Shooting star
  • Inverted Hammer | Hanging
  • Long legged Doji | Dragonfly Doji | Gravestone Doji
  • Bullish tweezers | Bearish tweezers
  • Bullish inside bar | Bearish inside bar
  • Bullish three line strike | Bearish three line strike
  • Bullish engulfing | Bearish engulfing
  • Piercing line | Dark cloud cover
  • Bullish abandoned baby | Bearish abandoned baby
  • Morning star | Evening star
  • Three white soldiers | Three black crows
  • *Bullish kayo | *Bearish kayo


Features:
  • *Prior and Following candles Confirmation
       You can set prior and following candle as basic prerequisites for marking candles as pattern to make sure you are at the top or bottom of the trend.
    *Volume confirmation
       You can active volume increasing confirmation for some of pattern with adjustable increase % relative to prior candle | candles.
    *Oscillator Confirmation
       Active oscillator confirmation. Select your approved oscillator from list (Stochastic, RSI, StochRSI, MFI, StochMFI) then enter desired value for marking candles as bullish | bearish pattern.
    *Bollinger Bands Confirmation
       Active BB confirmation. Configure your Bollinger Bands. Now only see the patterns which reached or crossed from Bands. Also you can enable BB clod to have your BB indicator at the same time.
    *Adjustable Flexibility and Precision
       You can set tolerance% for Osc and BB Confirmation - each one separately - for more control.
    *Self-adaptability
       The properties of markets change over time, for example the amplitude of fluctuations and the intensity of movements. The script is designed in such a way that you can examine the price history as a benchmark for changes in market properties to adopt determinants. Also you can control those manually.
    *Self-regulatory
       The user has the ability to change input factors depending on their point of view.
    Behind the pattern recognition algorithms, there are relationships and similarities in their appearance that cause them to be influenced by each other. Simultaneously with changing the determining factors of each pattern by you, script automatically adjusts other details in accordance with your changes.
    *Alerts
       You can set for type of pattern or each one of pattern have been detected.
    *Fully Costumizable
       All of these options can be change and adjust.



Note 1.
   The patterns are based on extensive study of reference and famous sources and the experience of me and my friends in trading and analysis with price action methods.

Note 2.
   Due to the Pine limitations in the number of outputs | plots for each script, our attempt has been made to select the best and most important patterns.

Note 3.
   So far, many scripts have been written in this field, but our experience with all of them and even the build in version was not satisfactory, and this was the initial motivation for making the script.
We strive to improve progress and elimination of shortcomings and we will continue to make this better.

Note 4.
   Through personal experience and based on the principles of market and candlestick psychology, we discovered a new type of pattern and named it as Kayo.
kayo is a two candle pattern which formed when:
    1.We have a pivot point with prior candles as left bars and following candles as right bar. Pivot candle called as second candle.
    2.In a bullish kayo, first candle must closed descending and second candle must closed as ascending. For bearish kayo vise versa.
    3.In a bullish kayo, second candle's lower wick must be longer then upper wick.
    4.A pattern marked as kayo when its conditions do not correspond to any of the other patterns(include the confirmation that user added), ie it has the last naming priority over the other patterns.

Note 5.
   When you active confirmation options for patterns like hammer, engulf and etc which they conditions are like kayo in some extent, if they can't pass the confirmation steps, they can be marked as kayo pattern.

Note 6.
   If you active volume confirmation for Three white soldiers | Three black crows, the confirmation get passed if the volume of forth or third candle increased as value as entered relative to volume EMA3 of 3 candles.

Note 7.
   In a bullish pattern all highs of following candles MUST be higher than prior highs and all lows of following candles MUST be higher than prior lows. For bearish patterns vise versa.
This type of confirmation depends on High and Low NOT close!



Gift to price action lovers!
Support us with your like and comments. let us know your experience, points and idea to make this better together.
Release Notes
Major Update
Big technical improvements to have more optimal and faster performance
Syncing with the latest updates of Pine

Changes:
  • Settings panel rearrangement
  • Algorithm of Auto mode redesigned
  • alert() replaced with alertcondtion()

Now..
Settings panel looks better thanks to new pine features
Auto mode will use ATPR (Average True Percentile Range) of price (RMA) for better results.
No need to set a separate alert for each of patterns, just choose alert() func in creating alert panel, you will get alert of each patterns which you have chosen to be shown. also num of plots reduced by half since this change so we have faster performance.

This is the first and final update of CSDP v1
We are working on CSPD v2.
Thanks for your attentions.

Bollinger Bands (BB)Candlestick AnalysisCandlestick analysiscandlestickpatternEngulfing CandleHammerInside BarRelative Strength Index (RSI)xbtbax

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer