CandleEvaluationLibrary "CandleEvaluation"
Contains functions to evaluate bullish and bearish, engulfing, and outsized candles. They are different from the built-in indicators from TradingView in that these functions don't evaluate classical patterns composed of multiple candles, and they reflect my own understanding of what is "bullish" and bearish", "engulfing", and "outsized".
isBullishBearishCandle()
Determines if the current candle is bullish or bearish according to the length of the wicks and the open and close.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns Two values, true or false, for whether it's a bullish or bearish candle respectively.
isTripleBull()
Tells you whether a candle is a "Triple Bull" - that is, one which is bullish in three ways:
It closes higher than it opens
It closes higher than the body of the previous candle
The High is above the High of the previous candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns True or false.
isTripleBear()
Tells you whether a candle is a "Triple Bear" - that is, one which is bearish in three ways:
It closes lower than it opens
It closes lower than the body of the previous candle
The Low is below the Low of the previous candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
returns True or false.
isBigBody()
Tells you if the current candle has a larger than average body size.
int _length - The length of the sma to calculate the average
float _percent - The percentage of the average that the candle body has to be to count as "big". E.g. 100 means it has to be just larger than the average, 200 means it has to be twice as large.
returns True or false
isBullishEngulfing()
Tells you if the current candle is a bullish engulfing candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
int _atrFraction The denominator for the ATR fraction, which is the small amount by which the open can be different from the previous close.
returns True or false
isBearishEngulfing()
Tells you if the current candle is a bearish engulfing candle.
int _barsBack How many bars back is the candle you want to evaluate. By default this is 0, i.e., the current bar.
int _atrFraction The denominator for the ATR fraction, which is the small amount by which the open can be different from the previous close.
returns True or false
Candlestickpattern
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
SeaSide420 StrategyThis Strategy by SeaSide420 uses IchiMoku, Engulfing candles and 3 moving averages to find entry to buy and sell orders. It will hold buys and sells at the same time, it will close orders by StopLoss, or Trailing StopLoss or Target Profit. In the example chart here, only the trailing stop is active. It does have commission already included in this result. The initial test equity is set to 1 (1 BTC) so if you use this on say, a FOREX pair, you might want to check your settings, for example, set the initial equity to 100,000 USD as it normally is. I set this to 1 BTC to show that Holding 1 BTC for 2 years would not be as profitable as trading 1 BTC with this strategy for 2 years. The commission level is the same as Binance (0.1%), and the example pair is a Binance instrument, where Bitcoin trades can be in and out this way (CFD). Here it is shown on Daily chart, and with other timeframes/pairs, you may need to adjust the settings (MA period etc). New settings are achieved by you testing them yourself. This is published as an experimental script for use through API to do Automated trading on crypto exchanges. Questions welcome. Strategy free to use, Script private (PM me about it) I have not tested the alerts, but i did include alerts when open and close orders. Let me know if it works or not.
RSI StrictThis RSI stragety combine RSI with candle stick patterns to give entry signal.
When RSI is over bought or over sold. A long price tail signals a trend reversal in short term period.
HTF Candles by DGThigher timeframe (multi timeframe) candles
a simple study introducing new pine function box.new
[LixxChartz] Engulfing Candle Auto FinderProbably the most complicated script you have seen...
The Engulfing Candle Script that ACCTUALLY finds the engulfing candles.
This indicator is a part of my new script I am creating and I will be realising soon. Hope it helps.
I really don't understand why other people were making it so complicate LOL
DECPDECP is simple and easy to use!
It detects bullish and bearish engulfing candlestick patterns.
After detecting the patterns I've said, it mentions that the pattern is going to continue its direction to up or down.
But remember candlestick patterns don't determine targets and it's possible that predicted directions fail.
So use it carefully and enjoy it!
CandletypesBackground information:
In my price action trading principles, I normally classify the candles into four types and look for trade opportunities. The candles are classified based whether buyers or sellers is dominating, namely, Indecisive candles, Decisive candles, Counter decisive candles and Strong decisive candles. Each of these can either be buyers or sellers dominant. This Philosophy I have attempted to convert into pine script for all traders to analyze and trade.
Indecisive candles: When the strength of the candle cannot be decided and we cant take any decision. Best is stay away. Something similar to conventional doji. Even though the strength is undecided, still the advantage can be towards either buyers or sellers favor. so we have Indecisive buy and indecisive sell candle
Decisive candles: When the strength is tipped towards the buyers or sellers, then I call Decisive bull or Decisive sell. This candles can be used to pyramid the trade position and not for initiating the trade, as many times it could be climatic also.
Counter decisive candles: These are candles , when the initial decision was towards one side and before closing of the candle, the decision was countered by the other side. There are counter decisive buy and sell. Counter decisive buy is actually a sell signal, because first buyers showed the strength later sellers overcome the buyers and become strong. Similarly counter decisive sell is a buy signal. These can be coupled with decisive candles for initiating the trading position
Strong decisive candles: These candles are good for initiating trade as a standalone alert system. It is something similar to pin bar, but more precise. we have both buy and sell and they have strong tendency to move in the direction of alert. These candles at right levels form a profitable trading system.
How the inputs are arranged:
There are total 8 candle types and whichever trader want can be selected for display.
By default,
The indecisive and decisive bull signals are placed on top of the charts as square and round green signal with title "IDB" and "DB"
The indecisive and decisive bear signals are placed on bottom of the charts as square and round red signal with title "IDS" and "DS"
The counter decisive and strong decisive signals are placed on the top and bottom of the candles.
In addition, the first candle of the day in any intraday time frame carries the label to display what type of candle is formed. This is very useful for making intraday trading.
This can be used freely by clicking to favorites. Source code is however not shared. please do contact for any additional info or modification.
happy trading
Hikkake HunterSimple script for finding Hikkake patterns in charts.
This script will:
- Identify bullish / bearish variants of the Hikkake pattern.
- Allow the user to change the color scheme for the bullish / bearish variants.
- Allow the user to specify which Hikkake patterns will be recognized by this hunter (specifically, allowing which of the three candles after the pattern appears will confirm the pattern).
Hammers & Stars StrategyOverview
This script trades basic hammer and shooting star candlestick patterns.
It's an extremely simple strategy with minimal filters, and according to my personal manual backtesting and automated trading results, performs best on the Daily chart on certain forex pairs.
It is intended to be traded on the forex markets but theoretically should work on all markets (especially if you optimize the settings).
The script also comes with complete AutoView automation for Oanda.
Make sure you've connected AutoView to TradingView and Oanda, then simply set an alert using the "alert() function calls only" condition and it will automatically execute trades based on whatever settings you've selected (only recommended for experienced traders - use at your own risk!)
If you're not sure how to set up AutoView, search "The Art of Trading AutoView Guide" on YouTube to find my detailed video guide.
Check out my website and YouTube channel for more information, scripts, resources and free Pine Script & trading lessons (link in my profile).
Best of luck with your trading!
- Matt / The Art of Trading
Settings Menu
Tooltips are included explaining what the various settings do, but here's a quick summary:
Strategy Settings
>= ATR Filter: Minimum size of entry candle compared to ATR
<= ATR Filter: Maximum size of entry candle compared to ATR
Stop Loss ATR: Stop loss multiplier (x ATR)
R:R: Risk:Reward profile
Fib Level: Used to calculate upper/lower third of candle. (For example, setting it to 0.5 will mean hammers must close >= 50% mark of the total candle size)
Start Date Filter: Date & time to begin trading from
End Date Filter: Date & time to stop trading
AutoView Oanda Settings
Use Oanda Demo: If turned on then oandapractice broker prefix will be used for AutoView alerts (demo account). If turned off then live account will be used
Use Limit Order: If turned on then AutoView will use limit orders. If turned off then market orders will be used (recommended to use limit order to mitigate spread issues)
Days To Leave Limit Order: This is your GTD setting (good til day)
Account Balance: Your account balance (used for calculating position size)
Account Currency: Your account balance currency (used for calculating position size)
Risk Per Trade %: Your risk per trade as a % of your account balance
Candlestick Indicator by Crypto_AdhyetaA script to identify possible trend reversal based on Candlesticks. The correct candlestick type is identified by the relative position to Exponential Moving Average.
It detects:
- Hammer - if emerges during a downtrend (close below EMA(5)), the downtrend should end.
- Hanging Man - if comes after a advance (close above EMA(5)), the uptrend should end.
Confirmation:
- for aHammer not required
- a Hanging Man should be confirmed by lower close by the next candle
Japanese Candle Patterns Detector in Potential price zoneThis script would find the 8 famous "Japanese Candle Stick Patterns" in your chart.
Please be aware it find patterns in "Potential price zones" only, which help you to avoid none-important patterns during a price trend.
I used RSI and ATR in my codes to find best candle forms and price conditions.
Bellow patterns are detecting:
Hammer | ShootingStar | Engulfing Candle | Doji | Tweezers Top/Buttom | Three White Soldiers/Three Black Crows | Marubozu | Harami
* You can select your preferred patterns from indicator setting.
* Pattern names are abbreviated for better view on chart.
I hope it helps you to improve your trading.