Trend-Range IdentifierTrend trading algorithms fail in ranging market and Swing trading algorithm fail in trending market. Purpose of this indicator is to identify if the instrument is trending or ranging so that you can apply appropriate trading algorithm for the market.
Process:
ATR is calculated based on the input parameter atrLength
Range/Channel containing upLine and downLine is calculated by adding/subtracting atrMultiplier * atr to close price.
This range/channel will remain same until the price breaks either upLine or downLine.
Once price crosses one among upLine and downLine, then new upLine/downLine is calculated based on latest close price.
If price breaks upLine, the trend is considered to be up until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in lime and upLine/downLine are colored in green.
If price breaks downLine, the trend is considered to be down until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in orange and upLine/downLine are colored in red.
If close price does not break either upLine or downLine for rangeLength bars, then the instrument is considered to be in range. During this state, candles are colored in silver and upLine/downLine are colored in purple.
In ranging duration, we display one among Keltner Channel, Bollinger Band or Donchian Band as per input parameter : rangeChannel . Other parameters used for calculation are rangeLength and stdDev
I have not fully optimized parameters. Suggestions and feedback welcome.
市場センチメントを測るインジケーター
Capitalization of BTC vs. Top 5 US CorporationsThis script displays the capitalization of Bitcoin as a percentage of the capitalization of 5 large US corporations: Apple, Microsoft, Amazon, Google, Facebook. According to www.tradingview.com these are (at the current time) the largest US companies.
Market Breadth Indicator (percentage of US stocks above * SMA)This script is a revised version of jchang274's Multi-Sub script.
Add more feature from the original jchang274 script.
1.Compare 4 US STOCK INDEX ( Dowjones 30/NASDAQ100/RUSSELL2000/S&P500 ) in the same index of percentage of stocks above 20 /50/100/200 days simple moving average.
2. Use 4 index of percentage of stocks above 20 /50/100/200 days simple moving average,compare the same stock index ( Dowjones 30/NASDAQ100/RUSSELL2000/S&P500 )
How it begin?
Traders and investors use market breadth in order to assess the index’s overall health. Market breadth can be a reliable, if not an accurate, indicator of an upcoming price rise in the index. Similarly, it can also provide early warning signs for a future price decline.
What is it?
Market breadth indicators analyze the number of stocks advancing relative to those that are declining in a given index or on a stock exchange.
Market breadth refers to how many stocks are participating in a given move in an index or on a stock exchange. An index may be rising yet more than half the stocks in the index are falling because a small number of stocks have such large gains that they drag the whole index higher.
How it works?
Market breadth studies attempt to uncover strength or weakness in the movements of an index that are not visible simply by looking at a chart of the index.
Probability of ATR Index [racer8]Deriving the indicator:
PAI is an indicator I created that tells you the probability of current price moving a specified ATR distance over a specified number of periods into the future. It takes into account 4 variables: the ATR & the standard deviation of price, and the 2 parameters: ATR distance and # bars (time).
The formula is very complex so I will not be able to explain it without confusion arising.
What I can say is that I used integral calculus & the Taylor series to derive a formula that calculates the area under half of the normal distribution function. Thus, the formula was repeated twice in the code to derive the full probability (half + half = whole). If you can read the code, you might be wondering why the formula is so long...
The reason for this is because in Pine Script, the erf function doesn't exist. You see, the formula for normal distribution is: f(x) = (1/sqrt(2pi))*e^(-xx/2), assuming of course that the standard deviation = 1 and mu (mean) = 1. The next step is to take the integral of this formula in order to find the area under f(x). The problem is that I found the integral, F(x), of the normal distribution formula to be equal to F(x) = erf(x/sqrt(2))/2...and the erf function cannot be directly computed into Pinescript.
So I developed a solution...why not estimate the integral function? So that's exactly what I did using a technique involving the Taylor series. The Taylor series is an algebraic function that allows you to create a new function that can estimate the existing function. On a graph, the new function has the same values as the existing one, the only difference is that it uses a differnt formula, in this case, a formula that makes it possible to compute the integral. The disadvantage of using this new formula is that it is super long and if you want it to better represent the original integral over a wider range of x-values, you have to make it longer.
Signal Interpretion:
The hotter the colour, the more likely price will reach your specified distance.
The 2 values of PAI in the bottom window represent probability & average probability of your specifed distance geting hit.
Applications:
Stop loss placement---
This indicator is useful because it gives you an idea of the likelihood that a stop loss at a particular distance away from price (in ATRs) will be hit over a period of time specified. This is helpful in placing stop losses.
Options trading---
PAI can also be used in options trading. For example, you are using a strangle options strategy, and you want to make sure that price stays within the Strangle's profit range. So you only trade when PAI presents a low probability value of moving at a particular distance in ATRs over n periods.
Anyhow, I hope you guys like it. Enjoy! and hit that like button for me :)
Session High and Session LowI have heard many people ask for a script that will identify the high and low of a specific session. So, I made one.
Important Note: This indicator has to be set up properly or you will get an error. Important things to note are the length of the range and the session definition. The idea is that you would set it up for what's relevant to your trading. Going too far back in the chart history will cause errors. Setting the session for a time that is not on the chart can cause errors. If you set it to look farther back than there are bars to display, you may get an error. What I've found is that if you get an error, you just need to change the settings to reflect available data and it will be able to compile the script. At the time of its publishing, the default range start is set to 10/01/2020. If you're looking at this years later, you'll probably have to set the range to something more recent.
Features:
Plot or Lines:
Using Plot (displayed), the indicator will track the high/low from the end of the session into the next session. Then at the start of the next session, it will start tracking the high/low of that session until its end, then track that high/low until the start of the next session then reset.
Using lines, it will extend horizontal lines to the right indefinitely. The number of sessions back that the lines apply to is a user-defined number of sessions. There are limits to the number of lines that can be cast on a chart (roughly 40-50). So, the maximum number of sessions you can apply the lines to is the last 21 sessions (42 lines total). That gets really noisy though so I can't imagine that is a limiting factor.
Colors:
You can change the background color and its transparency, as well as turn the background color on or off.
You can change the highs and lows colors
You can adjust the line width to your preference
Session Length:
You can use a continuous session covering any user-defined period (provided its not tooooo many candles back)
You can define the session length for intraday
You can exclude weekends
Display Options:
You can adjust the colors, transparency, and linewidth
You can display the plotline or horizontal lines
You can show/hide the background color.
You can change how many sessions back the horizontal lines will track
Let me know if there's anything this script is missing or if you run into any issues that I might be able to help resolve.
Here's what it looks like with Lines for the last 5 sessions and different background color.
Know The LevelsAs Mr. Yen says as a day traders we need a reference to work with , this is a chart showing high low of current and previous day, yellow are yesterday's and green are present day's
Improved On balance volume with BB channel and double MAThis is an improved version of the on balance volume indicator.
I made it inside a bollinger band channel, so we can define better the zones. At the same time I applied 2 moving averages on OBV, to get a better idea of the trend and at same time that change direction of the trend.
Green - > uptrend - > we look for buy positions
Red - > downtrend -> we look for sell positions.
At the same time we have to be aware of crosses on bollinger bands, which can indicate a change in the trend .
Divergence of Market Breadth & Price deduction indicatorHow it begin?
Traders and investors use market breadth in order to assess the index’s overall health. Market breadth can be a reliable, if not an accurate, indicator of an upcoming price rise in the index. Similarly, it can also provide early warning signs for a future price decline.
What is it?
market breadth in this case refer to percentage of stocks above 20 Simple Moving Average,which could be used as a barometer for the market.
How it works?
This paticular indicator compare the divergence of Nasdaq 100 and Russell 2000 percentage of stocks above 20 Simple Moving Average.
This indicator also include a deduction price method ,which is inspired from LEI & LoneCapital
Market ProfileHello All,
This is Market Profile script. "Market Profile is an intra-day charting technique (price vertical, time/activity horizontal) devised by J. Peter Steidlmayer. Steidlmayer was seeking a way to determine and to evaluate market value as it developed in the day time frame. The concept was to display price on a vertical axis against time on the horizontal, and the ensuing graphic generally is a bell shape--fatter at the middle prices, with activity trailing off and volume diminished at the extreme higher and lower prices." You better search it on the net for more information, you can find a lot of articles and books about the Market Profile.
You have option to see Value Area, All Channels or only POC line, you can set the colors as you wish.
Also you can choose the Higher Time Frame from the list or the script can choose the HTF for you automatically.
Enjoy!
Stocks Advance/Decline HistogramStocks Advance/Decline Histogram indicator, which I call ADH is my own implementation that plots an histogram of the difference between the number of advancing and declining stocks on a daily basis (or higher time frame) for the NASDAQ and NYSE.
How to use it?
Green: More NYSE stocks are advancing than declining.
Red: More NYSE stocks are declining than advancing.
Light Green: More NASDAQ stocks are advancing than declining.
Light Red: More NASDAQ stocks are declining than advancing.
Note: Advance/Decline data is based on daily or higher time frames.
FANGMAN DIXUpdating the name to FANGMAN DIX after adding NVDA. To use, turn off most plots in the settings and just turn on what you want to see. Adjust the length of MAs in the settings.
MS COT Commercial OscillatorStochastics indicator on the COT commercials net positions. It looks for the actual level of this value inbetween the extreme values of the lookback period. A value above 80 oder 90 percent is interpreted as a bulllish extreme, a value below 20 or 10 percent is interpreted accordingly a bearish. In fact the absolute level of the commercials net positions should be considered as well. The default value for the lookback period is 26 weeks. Higher values reduce the number of signals but increase their quality.
This script actually was inspired by someone but I forgot by whom :-) ... my apology!
MS COT Data Series V0.9This script reads the freely available weekly CoT data from Quandl and displays it as a graph. Threshold values for identifying extremes can be set.
Cumulative High Low IndexThis indicator tells how many days it is making new HighLowPeriod highs or lows in Lookback period.
If bar makes new HighLowPeriod high, HighLow index for that bar is +1
If bar makes new HighLowPeriod low, HighLow index for that bar is -1
Cumulative high low index is sum of HighLow index for Lookback periods.
Optional moving average can also be applied on this index
TKP McClellan Summation Index Stochastics StrategyThis strategy uses NYSE McClellan summation Index as an input for Stochastics to produce Buy/Sell signals. Buy signal is produced when Stochastics K Line Closes over 50, and Sell signal when closes under 50.
Info on McClellan Summation Index: www.investopedia.com
Info on Stochastics: www.investopedia.com
Simple yet effective strategy, let me know if you have any questions!
Buying Selling Volume low lagOriginally written by @ceyhun
I added a low lag filter to key components to smooth the bars. The user can adjust the parameters 'fast' and 'slow' to tune.
capam
The original comments of ceyhun are below repeated:
Buying Selling Volume
-Buy Volume
-Sell Volume
-Buy Volume Percent %
-Sell Volume Percent %
-Volume Index
-Buy Sell Volume-
BuyVolume>SellVolume=Blue barcolor
SellVolume>BuyVolume=Purple barcolor
-Volume Index-
VolumeIndex>length and close > open =Cyan barcolor
VolumeIndex>length and close < open =Gray barcolor
VolumeIndex<=length = Yellow barcolor
NYSE Advance/DeclineAn indicator for traders who trade intraday on the US market. It makes use of the symbols made available by TradingView to show the number of advancing vs declining stocks.
The GREEN AREA represents advancing issues. The INTENSE GREEN AREA represents the advancing issues at daily high.
The RED AREA represents declining issues. The INTENSE RED AREA represents the declining issues at daily low.
The part above the BLUE LINE represents issues which are trading above their VWAP (volume-weighted average prices).
Multi Time Frame CandlesHello Traders,
This script can show (upto) 3 candles of another time frames without changing chart time frame realtime . You can choose the time frame and number of candles in the options. You have option to change body and wick colors as well.
in this example number of candles is 2:
You can set body and wick colors:
In this example, weekly candles are shown on 1h chart:
Enjoy!
Fear/Greed IndexMy goal was to create something akin to the Fear & Greed Index ( money.cnn.com ) that CNN and others do.
A Fear/Greed Index can be used by any trader or investor but I believe it's best viewed with a contrarian's eye--
When the market appears to be signalling Extreme Fear, that is a good place to start buying from emotional players who want to sell no matter the price
When signalling Extreme Greed, that may be a good place to start taking profits off or getting hedged, as there may be too much exuberance in the air
Important to note and remember, however, is that there can often times be fear in the air for good reasons! I like to see this as if we dip into extreme fear and return shortly after, the fear may warrant constraint from buying, or returning back to extreme greed may be a very strong market extension
The script draws from several other tickers which I have read and personally observed to be decent macro correlations for the stock market (specifically the SP500). For the state of each of these metrics I gave a rating, good or bad, then added them together and put it into your standard Stochastic.
These macro correlations include--
The % of stocks in the SP500 above multiple Simple Moving Average lengths
VIX and its term-structure (contango, backwardation)
Treasury Bonds
Gold
Junk/High Yield Bonds
The Put/Call Ratio
The SP500 Options Skew
Advancing and Declining Issues
On some of these I opted to use a function for the Relative Momentum Index instead of RSI, as the RMI oscillates better (in my opinion). I also used a Band-Pass Filter/Double EMA for smoothing the results of the stochastic.
A LOT of these numbers were made to my own observation and discretion and can get out-dated over time. With that said, PLEASE feel free to revise, fine tune, modify this as you wish to optimize yours. And please let me know if I have made any mistakes here or something should be added.
VIX MTF MomentumSweet little momentum gadget to track the VIX Index.
What is the VIX?
The CBOE S&P 500 Volatility Index (VIX) is known as the 'Fear Index' which can measure how worried traders are that the S&P 500 might suddenly drop within the next 30 days.
When the VIX starts moving higher, it is telling you that traders are getting nervous. When the VIX starts moving lower, it is telling you that traders are gaining confidence.
VIX calculation?
The Chicago Board of Options Exchange Market Volatility Index (VIX) is a measure of implied volatility (Of the S&P 500 securities options), based on the prices of a basket of S&P 500 Index options with 30 days to expiration.
How to use:
If VIX Momentum is above 0 (RED) traders are getting nervous.
If VIX Momentum is below 0 (GREEN) traders are gaining confidence.
Follow to get updates and new scripts: www.tradingview.com
Low - High Simple TrackerYet another "Low - High" indicator using the new Pine Script Arrays.
The indicator uses the latests Lows and Highs to plot a trend line and reversal/slowdown.
More detailed explanation inside the script.
Enjoy!
Green - Up Trending
Red - Down Trending
White - Slow Down/Reversal might occur.
Made for educational purposes of how to use Arrays, yet can be very useful.
Support Resistance - Aging [Example]Hello All,
First all of Thanks to Pine Team for adding Arrays to Pine!
In this script I tried to make example for
1. Finding S/R lines using highest/lowest function
2. Using 1D array as 2D (we keep S/R levels and age)
3. "Age" usage for S/R levels, getting older on each candle and changing colors by their age (maximum age is 127 then it disappears)
You can use "Close"/Open " or " High/Low " as source.
There is an option for the background color, by default it's Black, do not forget to set it accordingly :)
Enjoy!
cum1or-1DeepL Translation-------------------------------------------------------------------------------------------------------------------------------------------
If you compare the positive line to 1 and the negative line to -1,
and then add them together, you can see how the shape changes compared to the price chart
This is an indicator that I made to look at.
It is subjective, but I think it is easy to understand the trend.
日本語---------------------------------------------------------------------------------------------------------------------------------------------------------
陽線を1、陰線を-1としその合計を出した価格チャートと比較して形がどのように変化するか、
見てみたいと思い作ったインジケーターです。
主観になりますがトレンドが分かりやすいかなと思います。