Candlestickpattern
Smart PatternsHi Traders, and welcome to Smart Patterns.
Patterns can be very profitable, yet hard to trade, even when combined with other indicators and techniques. This script aims to increase the accuracy of signals by adding a statistical approach to candle patterns, along with tools to filter them.
For example, if the Success Rate is above a certain threshold, it means that the pattern has resulted in a higher ratio of profitable trades and hence it has a higher likelihood of succeeding in the current market conditions. However, should that pattern fall below the desired Success Rate, the script will "hide" it and won't trigger a signal, but still keeping track of its performance to start firing it again when coming back above the Success Rate.
Key Features
The script features custom patterns as well as some of TradingView's built-in patterns. Not all patterns can be added of course, but let me know if I missed other interesting ones and I will do my best to add them in future updates.
When a Pattern reaches the Min. Target % within the Candles Range selected, it is then considered valid. Please remember that doesn't take into account possible draw-downs or stop-losses.
Patterns are constantly evaluated inside the script; when a pattern's overall score (Success Rate %) is below the required minimum, the signal won't be triggered. However, the script will keep monitoring it in the background, and trigger a signal again when its score comes back above the minimum Success Rate.
The Patterns' signals can be filtered by Success Rate, Minimum Patterns detected and candle size (calculated via ATR).
The Data Panel will show individual statistics for Enabled Patterns as well as final statistics for Triggered Patterns.
Tooltips in the settings panel will further explain available options.
Alerts: simple alerts can be added by selecting "any alert() function call" when adding an Alert. Customizable alerts can also be created through dropdown menu ( Bullish \ Bearish Patterns Detected).
Fully customizable to adapt to light and dark themes
Notes and Recommendations
Always be realistic when tweaking settings, making sure the output makes sense in a normal trading environment. Statistics are helpful but shouldn't be the only factor to base your decisions on - even if a pattern reaches 100% Success Rate, it doesn't mean it will keep being profitable.
Since the script crunches quite some data it may give output errors especially if settings are not properly tweaked - or if the filters are too liberal (e.g. Min Target % set to 0.1) - hence triggering lots of signals. Please adjust the settings or enable only the Patterns you are trading.
If the script gives the error "Too many drawings, cannot clean oldest" it means your settings give too many signals and that is usually not a good sign - it's recommended to double-check your settings as mentioned above.
Credits
Trading View for built-in patterns
Special thanks go to PineCoders community for their incredible efforts and learning material to help mastering PineScript!
Modified morning and evening starsThis script highlights modified version of evening and morning star candlestick patterns. Volume has also been added in the script to create convergence of volume with price action.
It is recommended to use these patterns for positional trading. It is advised to use
Morning star at the bottom of the downtrend
Evening star at the top of the uptrend
Avoid entries against above recommendations
Candilator RSI [AstrideUnicorn]OVERVIEW
The name Candilator comes from blending the words "candlestick" and "oscillator". And as the name suggests, this indicator is a good old RSI plotted as a candlestick chart. To produce a candlestick chart, Candilator RSI calculates four RSI's based on the open, high, low, and close time series. It also has a candlestick patterns detection feature.
HOW TO USE
You can use Candilator RSI as a normal RSI to analyze momentum, detect overbought and oversold markets, and find the oscillator's divergences with the price. You can also get creative and apply all sorts of technical analysis to the RSI candlestick chart, including candlestick patterns analysis.
Candilator RSI can automatically scan the price for some candlestick patterns in the overbought and oversold zones. This feature can help detect price reversals early.
SETTINGS
The indicator settings are divided into two groups: Main Settings and Pattern Detection. In the Main Settings, you can find standard RSI settings. In the Pattern Detection part, you can turn on and off the automatic search for a particular candlestick pattern.
Bar█ OVERVIEW
This indicator demonstrates how we can use Pine script for collecting data to study the market.
By building a statistical report based on the chart candlestick analysis, discover if there is an edge or not, when and where?
Compare it with a specific candlestick pattern and know how its behavior diverges. I have already covered some here .
I hope it can bring you ideas for researching new edges, testing, and trying new things.
█ FEATURES
Sections
The report organizes the data into the following sections: retracement , invalidation , continuation , breakout , and state . Each of them provides insights into the price behavior and answers to questions such as: How often does price retrace? Does the pattern often invalidate? If it does not, does it break in the pattern's direction? How far does the price go? What are the odds of a false breakout? What is the likelihood of the next bar being a down candle?
Highlighter
The indicator highlights flat bars (open and close at the same price). It also highlights bullish and bearish bars once a filter is applied.
Settings
Filtering of bars closing beyond their prior bar’s high and low;
Filtering of reversal bars (two modes available);
Displaying distances relative to the bars length or Average True Range;
Collapsing/expanding each section;
Changing the report’s coloring and positioning;
█ NOTES
Computation
The script computation occurs on bar close.
Distances in ATR
When using a period of 20, for example, the first 19 candles are ignored because the ATR is not defined yet.
Candlestick Trading (Malaysia Stock Market)1. This indicator will indicate signals of bearish/bullish candlestick as below:
- 10 Bear Candles: Dark Cloud Cover, Bearish Kickers, Bearish Engulfing, Evening Star, Three Black Crows, Hanging Man, Shooting Star, Tweezer Top, Bearish Harami, Doji
- 10 Bull Candles: Piercing, Bullish Kickers, Bullish Engulfing, Morning Star, Three White Soldiers, Hammer, Inverted Hammer, Tweezer Bottom, Bearish Harami, Doji
2. In order for the Bear Candle signals to appear, these conditions should be met:
- Price must be above MA 1 (preset at SMA 20)
- Price must be above MA 2 (preset at SMA 50)
- Price must be above MA 3 (preset at SMA 200)
- In the range of specified trading days (preset at latest 10 days of trading)
3. For a strong bearish signal, a namely 'Potential Top' signal will appear on the top of the bearish candlestick signal. This 'Potential Top' signal will only appear under the condition of:
- Stochastic is at overbought area (preset at 75%)
4. In order for the Bull Candle signals to appear, these conditions should be met:
- Price must be in between MA 4 (preset at EMA 30) and MA 5 (preset at EMA 100)
- In the range of specified trading days (preset at latest 10 days of trading)
5. For a strong bullish signal, a namely 'Potential Bottom' signal will appear at the bottom of the bullish candlestick signal. This 'Potential Bottom' signal will only appear under the condition of:
- Stochastic is at oversold area (preset at 25%)
6. This indicator can help one to enter/exit a trade based on the bullish/bearish candlestick patterns that appear at the beginning/end of a trend, especially when the 'Potential Bottom/Top' appears with any of bullish/bearish candlestick signal.
7. However, this indicator is only designed for Malaysian Stocks Market as the script is based on the bids/pips calculation of the Malaysian Stocks Market. Nevertheless, I let the script open for everyone to modify it based on your own preference markets/instruments.
8. Hope you guys enjoy it. Thanks.
TAPLOT Wick PlayWick play is a candle stick long setup popularized by 2020 US Investing Champion Oliver Kell
Wick Play is a setup in which:
Strong stock with momentum to the upside closes off the highs of the day in yesterdays session.
Today's session opens in the candle "wick" of yesterdays bar.
If stock holds in the wick and doesn't trade in the body of yesterdays candle, it is a sign of strength.
Trigger happens on day 3 when price moves over the high of the wick inside day.
It is important to note that this setup should not be traded in isolation. Not every wick play is buyable.
This is to be used in the context of strong stocks like True Market Leaders and with buying momentum behind them.
Indicator places an up arrow under the candle setup. It also colors the candle itself. All configurable through indicator settings.
Cheers!
Price Action [Morty]This price action indicator uses the higher timeframe SSL channel to identify trends.
The long entry signal is a bullish candlestick pattern when the price retraces to EMA20 in an uptrend.
The short entry signal is a bearish candlestick pattern when the price retraces to the EMA20 in a downrend.
Currently, this indicator shows engulfing patterns, pin bar patterns, 2 bar reversal patterns and harami patterns.
It also shows a volatility squeeze signal when the Bollinger bands is within the Kelter channels.
The buy and sell signal can also be filter by the ADX indicator greater than a threshold.
You can set your stoploss to the previous low/high when you go long/short.
The risk/reward ratio could be 1 to 1.5.
This indicator can be used in any market.
Candlestick Trailing AllocationA simple indicator that calculates the sum of 'Up'(green), 'Down'(red), and 'Doji'(near Doji) candlesticks and portrays the same in an allocation format in percentage. And since it is allocation-based, the total will never exceed 100% of the defined Length period.
The equation is Green + Red + Doji = Total Candles; where total candles = length
When calculating the allocation part, the doji candles are subtracted from the sum of green and red, and the new value is divided by the length period.
For example, the green line = (sum of all green candles - doji / 2) / length; the reason to divide doji by 2 is to eliminate the redundancy it can cause.
When the green line crosses above the red line, the number of green candles is more than red in the defined length period. Similarly, when the red line crossed above the green, there were more red candles than green in that period.
The Doji line shows if any doji or near doji candles have appeared. It acts as a form of resistance against the green and red candles.
There's also the option to change the value of the doji's weight. Default is at 0.1.
The indicator does not show trend nor momentum, even though it may replicate some of its behavior from time to time. It is purely showing the allocation of the number of candles classified as green, red, and doji within the length provided.
Bar Replay (Basic mode)This script simulates the TradingView's "Bar Replay" mode.
The "Bar Replay" mode works only for time-frames greater than daily in free accounts. By using this script, one can easily apply this mode on an arbitrary time-frame particularly in free accounts.
Note that to use it properly, one should turn off the main candlestick chart from symbol description tool bar. then set the number of bars they like to hide.
I hope you enjoy using this script
Aurora Candle with AlertThe indicator is derived from the concept of Aurora Candles (Credit to RK Arora)
Description
The script instantly calculates and highlights the largest candle (from high to low) in a user specified lookback period. It then plots the expected support, resistance, supply and demand levels. When a larger candle is printed, it will immediately plot the new levels.
How To Use
Use the indicator to find the largest candle in a specified lookback period.
• As soon as the Aurora candle is printed, future levels are plotted.
• If a larger candle is printed it will reset and create a new roadmap as big money dictates the market.
• The Aurora candle will mirror itself above and below X amount of times based on your settings.
• Colours, levels and lookback period are customizable.
• There is only 1 look back period. You can add more than one indicator if you want to set different lookback periods for long and short term levels.
• Alert function has been added
Access the indicator
• Contact me on TradingView
M.Right Candlestick Patterns & Bulkowski Percentages 1.0Hello Traders!
As a fan of Bulkowski, I figured I'd release this for everyone's benefit as well.
The legendary candlestick pattern expert, Thomas Bulkowski, has over 35 years of trading and analysis experience and is the absolute go-to expert when it comes to candlestick pattern identification.
Bulkowski Candlestick Percentages from his site and books.
Source: Built in "All Candlestick Patterns"
In this version,
--> Added 8 Candles and removed some that are statistically insignificant and others that Bulkowski doesn't use (can add back if requested).
--> Added 2 Colors for Bullish and Bearish Continuations.
----> Assigned Colors Tested performance to Continuations.
--> Built-in Variables and Candles adjusted slightly to conform to Bulkowski pattern principles.
--> Moved inputs back to ABC order.
--> Decided to leave the theoretical performance positioning for the signal (i.e. Top for theoretically bearish ). However..
----> I adjusted the signal color to match Bulkowski's tested performance.
--> Removed Plot Close (obsolete)
--> Hover over signal to see both Theoretical and Tested Performance.
Figured I'd help give an edge to the @TradingView Community like so many before me have been able to.
Please feel free to add comments, share insight, and of course, like!
Cheers,
Mike
*UFX Bullish Candlstick Pattern*The UFX Buy Patern Must Consist of: Red - Blue - Green Bar or Red - Blue - Blue - Green Bar after a decline in price action.
This indicator also shows Bullish Engulfing Pattern.
True BarcolorHeikin Ashi can be useful for understanding trend based on price action but it doesn't take volume in context. Here I have tried to use volume for understanding true bar color and ultimately true trend analysis. It can also help you in not getting trapped in sudden shakeouts. Also, you can use it for averaging of your existing position.
Conditions used:
Relative closing price
Relative volume against previous bar and overall moving average of volume
Volume analysis
Trend analysis
small channel in 5minThis indicator designed for 5min time-frame.
it detects a candlestick pattern in one hour time-frame and draw a channel based on the detected pattern, where two candles and are covered by the third one , in 5 min time-frame.
the bottom, middle and top of the channel are colored by green, gray and red respectively. this channel may help user to use it as a possible support and resistance region.
(the pattern is defined in line 11 to 13.)
enjoy it
Super D2Momentum Indicator based on previous candle structure over past 40 periods
- Blue is momentum score
- Green = 15 ema
- Red = 50 sma
- orange = 100 sma
The indicator looks at the previous candles differences between open, close, high, and low to determine momentum. A high close relative to open or low indicates very strong momentum for example.
[CP]Pivot Boss Candlestick Scanner - No Repainting This indicator is based on the high probability candlestick patterns described in the ’Secrets of a Pivot Boss’ book.
The indicator does not suffer from repainting.
I have kept this indicator open source, so that you can take this indicator and design a complete trading system around it.
Although the patterns have some statistical edge in the markets, blindly using them as Buy/Sell Indicators will certainly result in a heavy loss.
I like some of these setups more than others, and I have listed them in the order of my likeness.
The first one I like the most, the last one, I like the least.
The patterns are universal and work well in both intraday, daily and even larger timeframes.
Signals in the example charts are manually marked by,
Hammer - profitable short signal
Rocket - profitable long signal
X - unprofitable long or short signal
GENERAL USER INPUTS:
These settings exist as the indicator uses ‘Labels’ to mark the patterns and Pine Script limits a maximum of 500 labels on a chart.
If you want to go back in the past and check how the indicator was doing, set the Start and End dates both and check the ’Use the date range above to mark the Candlestick Setups?’ option.
EXTREME REVERSAL SETUP:
This is by far my favorite setup in the lot. Classic Mean Reversion setup.
The logic, as explained in the book, goes like this,
1. The first bar of the pattern is about two times larger than the average size of the candles in the lookback period.
2. The body of the first bar of the pattern should encompass more than 50 percent of the bar’s total range, but usually not more than 85 percent.
3. The second bar of the pattern opposes the first.
The setup works extremely well in high beta stocks like Vedanta VEDL.
Feel free to play with the settings in order to better align this pattern with your favorite stock.
Check out the examples below,
No indicator is perfect, failed patterns are marked with an X.
OUTSIDE REVERSAL SETUP:
My second favorite setup, it is quite good at catching intraday trends.
Here’s the logic,
1. The engulfing bar of a bullish outside reversal setup has a low that is below the prior bar’s low and a close that is above the prior bar’s high. Reverse the conditions for bearish outside reversal.
2. The engulfing bar is usually 5 to 25 percent larger than the size of the average bar in the lookback period.
Settings for this pattern simply reflect these conditions. Feel free to modify them as you wish.
The pattern is pretty powerful and will sometimes help you catch literally all the highs and lows of the market, as shown in the examples of Vedanta VEDL and RELIANCE stocks below.
As usual, this pattern is not PERFECT either.
DOJI REVERSAL SETUP:
Doji candles signify market indecision and this pattern tries to profit off these market conditions.
Logic:
1. The open and close price of the doji should fall within 10 percent of each other, as measured by the total range of the candlestick.
2. For a bullish doji, the high of the doji candlestick should be below the ten-period simple moving average. Vice-versa for bearish.
3. For a bullish doji setup, one of the two bars following the doji must close above the high of the doji. Vice-versa for bearish.
Feel free to modify the settings and optimize according to the stock you are trading.
Don't optimize too much :)
This pattern works brilliantly well on larger intraday timeframes, like 15m/30m/60m.
This pattern also has a higher propensity to give false indications than the two described above.
Doji reversal typically helps to catch larger trend reversals. Check out the examples below from RELIANCE and NIFTY charts,
Note that the RELIANCE chart below is the same as shown for the Outside Reversal Setup above, notice the confluence of Outside
Reversal and Doji Reversal on the 31st August.
Confluence of patterns usually increases the probability of success.
RELIANCE 15m Chart - Pattern can catch nice trends on higher timeframes
NIFTY 15m Chart
WICK REVERSAL SETUP:
This pattern tries to capture candlesticks with large wick sizes, as they often indicate trend reversal when coupled with significant support and resistance levels.
Logic:
1. The body is used to determine the size of the reversal wick. A wick that is between 2.5 to 3.5 times larger than the size of the body is ideal.
2. For a bullish reversal wick to exist, the close of the bar should fall within the top 35 percent of the overall range of the candle.
3. For a bearish reversal wick to exist, the close of the bar should fall within the bottom 35 percent of the overall range of the candle.
This pattern must always be coupled with important support resistance levels, else there will be a lot of false signals.
The chart below is the same NIFTY chart as above with the Wick Reversal candles marked as well.
You can see that there are a lot of false signals, but the price also indicates ’pausing’ at important levels by printing a wick reversal setup.
You can use this information to your advantage when riding a trend.
FINAL WORDS:
Settings for various patterns simply reflect the logic described.
You will probably need to tweak and optimize the pattern settings for the stock that you are trading.
Higher Beta/Higher Volatility stocks are a great choice for these patterns.
Using these patterns at critical support and resistance levels will result in dramatically high accuracy.
Be creative and try to develop a proper system around this indicator, with rules for position sizing, stop loss etc.
You do not have to trade all the patterns. Even trading just one pattern with a proper system is good enough.
DO NOT USE THIS INDICATOR AS A BUY/SELL SYSTEM, YOU WILL LOSE MONEY.
Feel free to drop any feedback in the comments section below, or if you have any unique candlestick patterns that you would like me to code.
Bull and Bear Marubozus Candlestick PatternMarubozus are an interesting candle pattern wherein the close and open of the candle are also the high / low points of the candle. In other words, a candle with no shadows or wicks.
How reliable are they, though? Probably not very reliable on their own. It may also depend on the size of the candle. You would probably want to incorporate this candle pattern with other filters, like RSI, MACD, to filter trade opportunities.
Candlestick RecognitionCandlestick Recognition
Version 1.0
Fun script to recognize and name candlesticks. Hamers and Highwaves and Marubozus oh my!
All candlestick names can be turned on or off in the settings since sometimes they stack close to each other and are hard to read. If you think I mislabeled any please provide me with an example of what you think it should be and I will review it to see if any changes need to be made. Please keep in mind that each stock will be a little different as the Candlestick Recognition uses ATR (Average True Range) for the calculations.
Abnormal Pin BarPin Bar is one of the most important candlestick patterns. Almost every time you see a pin bar, you can expect the price to turn in the opposite direction.
You should pay more attention to the abnormal ones among the pin bars. What I mean by abnormal pin bar is that the long leg is at least 3 times larger than the body.
With this indicator, you can set your own abnormal pin bar settings. The indicator will highlight abnormal pin bars according to the settings you specified.
The indicator uses the following three factors to indicate abnormal pin bar:
- Minimum body ratio in the pattern in percent
- Minimum ratio of the long shadow to the body
- Minimum ratio of the long shadow to the short shadow
Also, there is a volume strength check to confirm the pin bar. If the volume where the pin bar is formed is greater than the 20 volume average, it indicates that the pin bar is more important. Of course, confirming the pin bar with the volume is optional and you can disable it in settings if you wish.
You can use the highlights of this indicator as an entry signal if the pin bar appears at the trend key levels or in support or resistance zones.
Candles Based On Traded VolumeCBTV - Candlesticks Based on Traded Volume
This is the first robust implementation of volume based candlesticks (bars) on TradingView. This type of bar was describe in the book "Advances in Financial Machine Learning," written by Lopez de Prado, a well-known quant who has managed billions of dollars over the course of his career.
Volume Candlesticks (Bars) are bars that are indexed by total volume, with each set of N shares exchanged forming a separate bar.
This means that on CBTV chart a candle forms not after a specific time interval defined by the time frame of the chart, but when a determined volume was traded.
This approach to price sampling is much better than the time based one, because it does not oversample periods where nothing happens. Traditional candlestick charts show a lot of low volume bars without meaningful price changes in them.
The efficient price sampling results in better results when using volume based bars in machine learning forecasting models. They are also useful for technical analysis. Candlestick patterns on CBTV chart are more pronounced and have more predictive power.
Volume based bars can be constructed only for instruments where volume data is available. These are stocks, futures and crypto currencies.
When you run CBTV it appears in a separate window below the traditional time based chart.
CBTV will be used in pair with a helper indicator which is called Optimal Volume per Candle (OVPC).
When applied to a chart OVPC shows the optimal range for volume per candle to construct volume based candlesticks from this timeframe data. It appears in the blue box above the most recent candle of a standard time based chart.
When you set a Volume Per Candle parameter in CBTV make sure it is within the range that shows OVPC. In this case volume based chart will be easy to read and all the calculations will be performed with the high level of precision.
The most recent unfinished candle is marked with the different set of colors than historical candles. Unfinished candle is colored in orange if it is a falling candle, blue it it is a rising one.
If you leave the CBTV chart opened for a long time you can have multiple blue or orange candles on it. In this case press the “hide” icon with the eye sign twice (it’s on the left side of the indicator panel next to its input parameters). This will refresh the CBTV and remove the artifacts.
While everything comes Real-time you will see the orange or blue bars form but never update. All you need to do is REFRESH THE CHART. Hoping soon to update this with a version you wont have to refresh the chart.
Please drop a like and comment what you guys think and once again thank you Tradingview for such a great platform :)
3B-Play Finder1 - Objective
2 - How to use (Theory)
3 - How to use (Grade System)
4 - Inputs
5 - Extras and Alerts
6 - Notes
Objective
This script aims to mark 3 Bar play patterns (both short and long) by identifying them on the chart, with an arrow pointing up from long and down for short. Aswell, setting alerts based on grade.
Following the base concept, this script comes with a "grade" system (A, B, C), which aims to classify 3B-Play according to input parameters.
2 - How to use (Theory)
The pattern is described by a wide range Ignite bar followed by a narrow resting bar.
Long
Given a 3 Bar play pattern, with a wide range green bar, the entry point should be above the ignite and narrow bar wicks (high) with stop loss set below the resting bar wick low but within ignite wide range bar.
The exit depends on the chart analysis, and there is no set rule for it.
Short
Similar to long but is with a wide range red bar and entry is defined on wick low and stop-loss at wick high.
3 - How to use (Grade System)
Since 3B-play come in all sort of shapes, some are "textbook" perfect, others a bit more "loose". I set a grading system, to differentiate each one.
The way the 3 Bar play quality is determined is based on the percentage size of the resting bar in relation to igniting bar size, starting from de close. An example of how this works is the following. Note: enabling the extra draws lines helps visually to adjust the grades to your preference.
4 - Inputs
3B Quality section
Enable/disable each grade.
CONTROL LONG / SHORT
Set the percentage values for each grade.
Extras
Enable/Disable extra plots.
5 - Extras and Alerts
This script comes with an extra section, enabling it, draws lines on the max and min values, as well, showing the values in text and the set percentage.
Also, you can set alerts based on the grade and short/long, note you should set the alert to bar close to avoid pre-trigger warnings.
6 - Notes
The script can be shorted a lot, by only looking for a single 3 bar play, to less than 30 lines.
Common Candlestick PatternsCommon Candlestick Patters Highlighter.
- TLS: Three Line Strike (Bearish and Bullish)
- AB: Advance Block
- IB: Inside Bar