Consecutive Up/Down Strategy with Reverse and SLExtension of the built-in strategy by TradingView. The strategy buys after an X amount of
consecutive bullish bars and viceversa for selling. This logic can be reversed and a Stop Loss
with Take Profit can be added. There's also an option to adapt the SL into a Trailing Stop.
K線分析
Unfilled Gap DetectorThis indicator displays gaps on a chart within a specified range which have not been filled. It offers the ability to set the minimum gap size to detect as a multiple of the average true range (ATR), as well as the allowed distance from a gap fill for the gap to be considered filled. The use of ATR allows the gap threshold to dynamically change as the stock price and volatility change over time. Lastly, it offers the ability to show gaps which have been filled in addition to unfilled gaps.
The following describes each input's effect on the indicator.
Bars to Search Back: specifies how many bars back in the chart to search for gaps and gap fills (maximum 5000).
ATR Length: specifies the length of the ATR() function used for thresholding
Minimum ATR Multiple For Gap Detection: The minimum gap size as a multiple of the ATR
Minimum ATR Multiple For Gap Fill: The minimum distance between a bar high/low and a gap for it to be considered "filled" as a multiple of ATR
Positive Bars % StrategyBased on the calculations by ZenAndTheArtOfTrading. I added stop loss, take profit and reverse code lines.
The Positive Bars % calculates the number of green (positive) bars, relative to a look back period, defined
by the user. If the percentage is low, it means that there was a bigger number of red candles in the
lookback period. The strategy goes long when the percentage is high and short when it's low.
This logic can be reversed with positive results on different time frames.
DAYOFWEEK performance1 -Objective
"What is the ''best'' day to trade .. Monday, Tuesday...."
This script aims to determine if there are different results depending on the day of the week.
The way it works is by dividing data by day of the week (Monday, Tuesday, Wednesday ... ) and perform calculations for each day of the week.
1 - Objective
2 - Features
3 - How to use (Examples)
4 - Inputs
5 - Limitations
6 - Notes
7 - Final Tooughs
2 - Features
AVG OPEN-CLOSE
Calculate de Percentage change from day open to close
Green % (O-C)
Percentage of days green (open to close)
Average Change
Absolute day change (O-C)
AVG PrevD. Close-Close
Percentage change from the previous day close to the day of the week close
(Example: Monday (C-C) = Friday Close to Monday close
Tuesday (C-C) = Monday C. to Tuesday C.
Green % (C1-C)
Percentage of days green (open to close)
AVG Volume
Day of the week Average Volume
Notes:
*Mon(Nº) - Nº = Number days is currently calculated
Example: Monday (12) calculation based on the last 12 Mondays. Note: Discrepancies in numbers example Monday (12) - Friday (11) depend on the initial/end date or the market was closed (Holidays).
3 - How to use (Examples)
For the following example, NASDAQ:AAPL from 1 Jan 21 to 1 Jul 21 the results are following.
The highest probability of a Close being higher than the Open is Monday with 52.17 % and the Lowest Tuesday with 38.46 %. Meaning that there's a higher chance (for NASDAQ:AAPL ) of closing at a higher value on Monday while the highest chance of closing is lower is Tuesday. With an average gain on Tuesday of 0.21%
Long - The best day to buy (long) at open (on average) is Monday with a 52.2% probability of closing higher
Short - The best day to sell (short) at open (on average) is Tuesday with a 38.5% probability of closing higher (better chance of closing lower)
Since the values change from ticker to ticker, there is a substantial change in the percentages and days of the week. For example let's compare the previous example ( NASDAQ:AAPL ) to NYSE:GM (same settings)
For the same period, there is a substantial difference where there is a 62.5% probability Friday to close higher than the open, while Tuesday there is only a 28% probability.
With an average gain of 0.59% on Friday and an average loss of -0.34%
Also, the size of the table (number of days ) depends if the ticker is traded or not on that day as an example COINBASE:BTCUSD
4 - Inputs
DATE RANGE
Initial Date - Date from which the script will start the calculation.
End Date - Date to which the script will calculate.
TABLE SETTINGS
Text Color - Color of the displayed text
Cell Color - Background color of table cells
Header Color - Color of the column and row names
Table Location - Change the position where the table is located.
Table Size - Changes text size and by consequence the size of the table
5 - LIMITATIONS
The code determines average values based on the stored data, therefore, the range (Initial data) is limited to the first bar time.
As a consequence the lower the timeframe the shorter the initial date can be and fewer weeks can be calculated. To warn about this limitation there's a warning text that appears in case the initial date exceeds the bar limit.
Example with initial date 1 Jan 2021 and end date 18 Jul 2021 in 5m and 10 m timeframe:
6 - Notes and Disclosers
The script can be moved around to a new pane if need. -> Object Tree > Right Click Script > Move To > New pane
The code has not been tested in higher subscriptions tiers that allow for more bars and as a consequence more data, but as far I can tell, it should work without problems and should be in fact better at lower timeframes since it allows more weeks.
The values displayed represent previous data and at no point is guaranteed future values
7 - Final Tooughs
This script was quite fun to work on since it analysis behavioral patterns (since from an abstract point a Tuesday is no different than a Thursday), but after analyzing multiple tickers there are some days that tend to close higher than the open.
PS: If you find any mistake ex: code/misspelling please comment.
2nd Grade StrategyThis is a strategy to complement the 2GT indicator. It utilises the same rules as 2GT.
This is comprises of multiple popularly used indicators to help decide on whether to go long or short. This indicator will overlay the MA lines and background colours on your chart.
The heikin-ashi colour will be shown as the background colour. This will help you identify a trend more easily while using bars, candles, hollow candles, etc. When the background is green, it means that it is a green HA and vice versa.
The blue MA line is for showing the short-term trend. The red MA line is for showing the medium-term trend. You can select the moving average flavour of your choice in the settings.
The yellow MA line is the long-term trend that is mainly used as a filter to indicate bullish/bearish trend. The MA type for this filter can be different from the short/mid term MA.
This indicator will also show Stochastic crossovers (GC, DC, BC) on the chart. This will help to always keep your eye on the chart candles.
In the settings, you can also turn on/off bullish/bearish signals.
Rules for bullish signals on this indicator:-
1. MA: Blue > Red > Yellow (FastMA > SlowMA > FilterMA)
2. Stochastic: K > D and both are heading upwards
3. 2nd Green HA
When 2 out of the 3 rules are met, the candle background will be Aqua in colour. When all 3 rules are met, the candle background will be Green .
Rules for bearish signals on this indicator:-
1. MA: Yellow > Red > Blue (FilterMA > SlowMA > FastMA)
2. Stochastic: D > K and both are heading downwards
3. 2nd Red HA
When 2 out of the 3 rules are met, the candle background will be Orange in colour. When all 3 rules are met, the candle background will be Red .
Do note that you can hide any of these elements in via the settings.
If you find this useful, do smash the LIKE and FOLLOW button.
WSLM
2nd Grade TechniqueThis is comprises of multiple popularly used indicators to help decide on whether to go long or short. This indicator will overlay the MA lines and background colours on your chart.
The heikin-ashi colour will be shown as the background colour. This will help you identify a trend more easily while using bars, candles, hollow candles, etc. When the background is green, it means that it is a green HA and vice versa.
The blue MA line is for showing the short-term trend. The red MA line is for showing the medium-term trend. You can select the moving average flavour of your choice in the settings.
The yellow MA line is the long-term trend that is mainly used as a filter to indicate bullish/bearish trend. The MA type for this filter can be different from the short/mid term MA.
This indicator will also show Stochastic crossovers (GC, DC, BC) on the chart. This will help to always keep your eye on the chart candles.
In the settings, you can also turn on/off bullish/bearish signals.
Rules for bullish signals on this indicator:-
1. MA: Blue > Red > Yellow (FastMA > SlowMA > FilterMA)
2. Stochastic: K > D and both are heading upwards
3. 2nd Green HA
When 2 out of the 3 rules are met, the candle background will be Aqua in colour. When all 3 rules are met, the candle background will be Green .
Rules for bearish signals on this indicator:-
1. MA: Yellow > Red > Blue (FilterMA > SlowMA > FastMA)
2. Stochastic: D > K and both are heading downwards
3. 2nd Red HA
When 2 out of the 3 rules are met, the candle background will be Orange in colour. When all 3 rules are met, the candle background will be Red .
Do note that you can show/hide any of these elements via the settings.
If you find this useful, do smash the LIKE and FOLLOW button.
WSLM
Big Bar Strategy// This strategy detects and uses big bars to enter a position. When the Big Bar
// is bearish (red candle) the position will be long and viceversa
// for short positions. The stop loss (optional) is placed on the low of the
// candle used to trigger the position and user inputs allow you to modify the
// size of the SL. Take profit is placed on a reward ratio of 1. User can also modify
// the size of the bar body used to determine if we have a real Big Bar and
// filter out Doji bars. Big Bars are determined relative to the previous X period size,
// which can also be modified, as well as the required size of the Big Bar relative to this period average.
Narrow Range (NR) IndicatorNarrow Range (NR) trading strategy is a breakout-based method that assumes that the price of security trends up or down after a brief consolidation in a narrow range. This indicator can plot:
1. Narrow Range (NR) 4, 7, and 21
2. Narrow Range (NR) 4, 7, and 21 + Inside Bars (IB)
NR 4/NR 7/NR 21 day acts as a confirming factor on where the price will move further. Breakout of NR 4/NR 7/NR 21 candle with high volumes indicates bullishness, while the breakdown candle indicates bearishness.
Doji Hunter█ OVERVIEW
This script is built to search for 8 different Doji candlestick patterns in markets and makes them appear on screen with bar coloring and creating color-coded labels/shapes. It will identify the following variants based upon user input for various rules to abide by:
Gapping Up
Gapping Down
Gravestone
Dragonfly
Long-Legged
Rickshaw Man
Northern (Doji in uptrend)
Southern (Doji in downtrend)
Note: for the remainder of this description, the types for inputs will be marked by italic text.
█ OPTIONS
This script features a wide range of options available to the user to modify how it functions. The first set of inputs dictate how the trend analysis is done with moving averages. The second and third sets of inputs dictate specific rules for how Doji candles are analyzed and the colors used for when they appear.
█ INPUTS (short)
1 — Moving Average Rules:
The Northern and Southern Doji variants require some trend analysis which will be done by Moving Averages. The inputs in this section change various things about the moving average(s) to be used. In the second section of inputs, there is one boolean option that will nullify the need for trend detection and consolidates the Northern and Southern Doji variants into one.
2/3 — Doji Rules and Colors:
The next two sections of inputs correspond to the various rules that dictate how various doji variants will be analyzed, as well as the colors that correspond to each variant. The colors will also apply to each of the labels/shapes used.
4 — Diagnostics:
The last boolean will allow the user to see extra detail with regards to how and when dojis are detected. Note: This is not a part of any prior section and is simply included as a last functional item to the list of all inputs.
An example of multiple labels being shown on screen for various types of Dojis (DJI 1D chart):
█ INPUTS (extended)
1 — Moving Average Rules:
This section consists of 10 different inputs specific to the rules on how the moving average functions for trend analysis.
"Trend Rule" ( string list) determines which Moving Average will be used for trend detection. It has 3 options: "MA 1", "MA 2", or "BOTH". The second input "Trend Source" determines which OHLC (or combination) value to use in comparison to either MA 1 or MA 2 (EX: Trend Rule -> "MA 1" and Trend Source -> "close": if close > MA 1 -> uptrend, downtrend otherwise). If "BOTH" is selected then "Trend Source" is ignored and added nuance in the script ensures that the shorter MA being above the longer MA yields an uptrend (downtrend otherwise).
The next 8 inputs focus on 4 different parts of both MA 1 and 2.
Length ( integer(s) )
Color
Switch between SMA/EMA ( boolean(s) )
Source for MA
Note: Additional attention to detail has been made here as trend direction is ignored if "BOTH" is selected for the MA Rules and the lengths of both Moving Averages are set to be the same.
2/3 — Doji Rules and Colors:
The next two sections include 19 inputs that are related to how this script will analyze and identify the different variants of Doji candles.
"Identify Pattern On Close" ( boolean ) modifies which candles are to be used for determining when Doji candles are recognized. This changes an offset used for historical reference on some global variables which will force the script to only identify patterns after the current candle has closed.
"Doji Body Tolerance" ( float ) tells the script the maximum % the candle body may be of the high-low range to be considered a Doji candle.
"Doji Wick Sample" ( integer ) defines how many prior candles to sample from in calculating the current average upper and lower wick sizes.
"Simplify Northern/Southern Dojis" ( boolean ) makes this script ignore trend direction for Doji detection and consolidates Northern and Southern Dojis into being recognized as the same. This has an added effect of removing the plotted moving averages from the screen.
"Northern/Southern Display" ( string list ) that has multiple options for how Northern and Southern Dojis will be displayed on screen. Because of how labels may be extremely taxing on TradingView's servers to display, the default setting is "shapes" where Northern and Southern (N/S) Dojis will be marked with a colored triangle at the top of the candle. If "Simplify Northern/Southern Dojis" is true, all N/S Dojis will be marked with an x-cross instead. Other options include "labels" which enables the use of labels accompanied by their respective tooltip and color, or "none" where N/S Dojis will be only noticeable by their changed barcolor.
"Allow Gravestone/Dragonfly Shadows" ( boolean ) allows a bit of additional nuance to the definition of Gravestone or Dragonfly Dojis with small shadows.
"Gravestone/Dragonfly Shadow Tolerance" ( float ) defines the maximum % that the lower wick/upper wick (respectively) may be relative to the high-low range for Gravestone or Dragonfly Dojis to still be considered valid.
"Doji Long Wick Setting" ( string list) is a list of settings for three different ways of confirming if a Doji is Long-Legged. The settings are "one", "two", and "average". These define how many wick lengths of a candle need to exceed the calculated average wick lengths (EX: "both" -> upper wick length > upper wick average and lower wick length > lower wick average). The "average" setting will combine the lengths of both wicks and both prior wick averages, divide both of these sums by 2 and compare them instead.
"Doji Long Wick Tolerance" ( float ) defines how large compared to the averages that wick lengths need to be in order for them to be considered "Long-Legged" (EX: 1.50 -> upper/lower wick needs to exceed 150% the average of previous upper/lower wicks).
"Rickshaw Man Body Placement Tolerance" ( float ) defines how close to the high-low range's midpoint the candle body's midpoint needs to be in order for it to be considered a Rickshaw Man Doji candle instead.
The remaining 9 inputs define the colors to use for differentiating between all Doji variants this script will recognize.
█ USAGE
My hope for this script is that users find this easy to use/understand and will tinker with the input values to better identify Doji candlesticks across a wide range of markets.
Suggestions for changes in the future are welcome.
Pinbar-Rejection-IndicatorThis indicator allows you to filter noisy pin bar chart, with pin bars which have been rejected from dynamic support/resistance level also named as 21 Moving Average.
I would consider to work only on higher time frames like 1H and higher, so you really can find only best entries.
Have fun, write your feedback in the comments section:)
P.S This is the first version of the indicator, so be free to contribute, and soon I'm going to improve this indicator.
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.
NSDT Trend CandlesThis script changes the color of the candles based on uptrend (green), downtrend (red), neutral/chop (yellow). It uses an ATR and Pivots to determine the direction, or lack of. Since all markets move differently and market volatility changes, you will need to adjust the settings to find a potential match for the day. It's pretty simple to use. Just enter in the direction of the trend and exit (or reverse) when the candle color changes.
Common Candlestick PatternsCommon Candlestick Patters Highlighter.
- TLS: Three Line Strike (Bearish and Bullish)
- AB: Advance Block
- IB: Inside Bar
HTF Candles by Prosum SolutionsOverview of Features
This indicator was inspired by the work of "informanerd" in the script called "HTF Candles" as well as the built-in script called "Multi-Time Period Charts" by TradingView. The script will provide a highly customizable interface to specify the higher timeframe resolution for the candlesticks, the type of candle, as well as various styling options for the body, borders and wicks.
Usage Information
The indicator can be applied to any chart at any time frame, but resolutions less than 1 minute may demonstrate gaps between bars and the candles may not render properly.
When the "Same as chart" option is chosen for the "Resolution" field, the indicator will attempt to find a higher timeframe resolution to ensure the candlesticks are drawn.
Enjoy! 👍
Fair Value Gap / FVG - HTF Orderflow bias / trendCalculates Fair Value Gap (FVG) as a counter and plots it below price.
FVG Counter value resets to +ve or -ve once the FVG counter reverses direction.
Use this script to find a bias to trade with.
Best used on HTF (like 1W, 1D), so the bias can be transferred to LTF (like 4H, 1H).
If you end up using this script, please leave a comment below on how you used it. I can try to incorporate those ideas in an update.
Cheers!
BTC PairsHi Crypto traders,
As many of you, while trading in altcoins, it is important to look at their BTC pairs also. That is why I created a script like this.
It works under these conditions:
1- The coin you are looking for must have BTC pair in the exchange of the chart. ( If an exchange does not have ADABTC while it has ADAUSDT, the script wont work )
2- The pair in that exchange must be concatenated as follows "PAIR_NAME" + "BTC" in tradingview. Ex: "ADA" + BTC" = "ADABTC"
If you have any questions or suggestion, I would be glad to hear and answer them.
Stay Safe.
I Ching Hexagrams Part 2IMPORTANT!
Get the other indicator I Ching Hexagrams Part 1 for the full set!
Here is the first half of the I Ching's hexagrams.
Each candle generates a hexagram at close, based on that candle and the previous 5.
A green candle is yang and a red candle is yin.
In this way, price action generates a hexagram.
Use this to generate a hexagram for the day or even to find interesting patterns to trade.
Have fun!
I Ching Hexagrams Part 1IMPORTANT!
Get the other indicator I Ching Hexagrams Part 2 for the full set!
Here is the first half of the I Ching's hexagrams.
Each candle generates a hexagram at close, based on that candle and the previous 5.
A green candle is yang and a red candle is yin.
In this way, price action generates a hexagram.
Use this to generate a hexagram for the day or even to find interesting patterns to trade.
Have fun!
SL Hunter Tracker SL Hunter Tracker
coded by Bogdan Vaida
SL Hunter Tracker is a meticulous hunter that tracks SL hunters.
First it plots the fractals on the chart, then it draws lines from them
to the last wick that touched that height. You can add sweep alerts, once
per bar close, so that you get notified when a wick was touched.
Tested on: EURUSD 30'
Line Chart Enhancer by makuchakuTradingview has a good line chart, but I wanted to make it even more awesome.
Some shortcomings which this line chart enhancer script fixes
Colors up move as green, down move as red (you can change them as you like)
Plots high and low - so that one can be aware about what the price is doing
To achieve the look with markers as shown above
Goto Symbol settings > Type > Select "With Markers"
Feedback welcome!
Wide BarsSimple scripts show the wide range bars within in the look back period, visualizing the bigger momentum.
Added four exponential moving averages which define the trend of the instrument.
Wide range candles in the direction of overall trend on higher timeframes; give confluence of higher participation in the same direction.
Note : Decent volume above the average volume with wide range candle adds more value.