Supertrend Screener PanelScript to display Supertrend trend state of 8 different securities in a panel. Timeframe & Tickers which are to be displayed can be configured from settings.
Part of code is from the ADX DI Monitoring Panel script by u/wugamlo with his permission. Thanks to him for that and do please check out his work also.
Average True Range (ATR)
Volatility Bands by DGTVolatility represents how large an asset's prices swing around the mean price, the degree of variation of a trading price over time, and is commonly measured with beta (β) coefficients, standard deviations (σ) of returns where tools such as Average True Range, Bollinger Bands, Keltner Channel, Squeeze Indicator, etc presents volatility concept
Volatility often refers to the amount of uncertainty or risk related to the size of changes in a security's value. The higher the volatility, the riskier the security - the price of the security can change dramatically over a short time period in either direction. A lower volatility - security's value does not fluctuate dramatically, and tends to be more steady
This study, Volatility Bands , attempts to present a way to measure and visualize volatility , using standard deviations (σ) and average true range indicator, and aims to point out areas that might indicate potential trading opportunities
I will try to explain the usage with examples,
same setup with different option selected
as you may observe from the examples different setting may have advantages and disadvantages over one another, it is recommended to verify a trading setup with different available options.
Additionally, It is recommended to use this indicator in conjunction with other technical indicators, or verify using chart/candle patterns. Below is an usage example using in conjunction with other indicator, in the given example “Neglected Volume by DGT” is selected
Similarities and Differences
Bollinger Bands depicts two standard deviations above and below a simple moving average, and Keltner Channel depicts two times average true range (ATR) above and below an exponential moving average
Volatility Bands study combines the approach of both Bollinger Bands and Keltner Channel, with different settings and different visualization
Default settings are one standard deviations and one time average true range (ATR) above and below 13 period exponential moving average. Setting can be adjusted by users but let me remind all testes are performed with the default settings.
Mathematically expressed as
Upper band area between “ema + stdev” and “ema + atr”
Lower band area between “ema – stdev” and “ema – atr”
A different display is added with the inspiration I get from one of the @quantgym ‘s study, many thanks @quantgym 😉
When difference band display is selected the study will reflect the area between “ema + stdev – atr” and “ema – stdev + atr”. As shown in the examples above
Note: standard deviation calculation can be adjusted based on price action or its moving average.
Other differentiation between BB and KC is with V-BANDS mostly we look for trade opportunities when price action move out of the bands and in most cases we assume market is consolidating when the price action is within the bands
The other indicator that presents similarities to Volatility Bands is Squeeze Indicator, which measures the relationship between Bollinger Bands and Keltner's Channels to help identify consolidations and signal when prices are likely to break out. Mainly Volatility Bands is different version of Squeeze indicator, in fact the purpose is almost same but visualization is completely different. Additionally Volatility Bands Offers trading opportunities whereas Squeeze indicator only presents market states unless a momentum indicator is adapted to Squeeze indicator.
Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
High/low crypto strategy with MACD/PSAR/ATR/EWaveToday I am glad to bring you another great creation of mine, this time suited for crypto markets.
MARKET
Its a high and low strategy, designed for crypto markets( btcusd , btcusdt and so on), and suited for for higher time charts : like 1hour, 4hours, 1 day and so on.
Preferably to use 1h time charts.
COMPONENTS
Higher high and lower low between different candle points
MACD with simple moving average
PSAR for uptrend and downtrend
Trenddirection made of a modified moving average and ATR
And lastly elliot wave oscillator to have an even better precision for entries and exits.
ENTRY DESCRIPTION
For entries we have : when the first condition is meet(we have a succession on higher high or lower lows), then we check the macd histogram level, then we pair that with psar for the direction of the trend, then we check the trend direction based on atr levels with MA applied on it and lastly to confirm the direction we check the level of elliot wave oscillator. If they are all on the same page we have a short or a long entry.
STATS
Its a low win percentage , we usually have between 10-20% win rate, but at the same time we use a 1:30 risk reward ratio .
By this we achieve an avg profit factor between 1.5- 2.5 between different currencies.
RISK MANAGEMENT
In this example, the stop loss is 0.5% of the price fluctuation ( 10.000 -> 9950 our sl), and tp is 15% (10.000 - > 11500).
In this example also we use a 100.000 capital account, risking 5% on each trade, but since its underleveraged, we only use 5000 of that ammount on every trade. With leveraged it can be achieved better profits and of course at the same time we will encounter bigger losses.
The comission applied is 5$ and a slippage of 5 points aswell added.
For any questions or suggestions regarding the script , please let me know.
ATR Stop Buy StrategyThis strategy trial is let you to giving sell and buy orders with ATR (average true range) and an coefficent for them. it is my first strategy work, needs to be upgraded. USE IT WITH YOUR OWN RISK. IT IS NOT EVEN GUARANTEED TO WORK.
IFR2The IFR2 strategy is based on the RSI indicator.
If the two period RSI is less than the overbought level (25 is the default, but you can configure it to be lower), a long position is placed at the close of the candle. If you are doing it live, you'd have to enter the market ~ 10 minutes before it closes, check the RSI, and buy if it is lower than your overbought level. This generates a discrepancy in the backtesting, but since it is a very small difference, it can be disregarded. Higher overbought levels generate more signals, but they mostly are unreliable. Lower values generates better yields, but they won't occur very often. This strategy is designed to be used in a daily graph, and I don't recommend using it in intraday periods, since you'll make too little money to compensate for the operational cost.
The strategy exits when the high price of two previous candles is reached. If the exit price is higher than the closing price of when you entered, you'll be at a profit, otherwise you'll be at a loss. The exit price is plotted in the graph and it's colors depends on the current open profit: positive values will be green, negative will be red.
This strategy completely disregards the current trend. Long orders will be placed even if you are at a strong down trend. This may seem odd, but you have to keep in mind that this is a volatility based strategy , not a trend following one.
This setup was designed by Alexandre Wolwacz, a.k.a. Stormer.
2 Candles Inside ATR2 agitated candles falling inside ATR range, awaiting possibly a big move.
Buy / Sell signals at combined high / low can be used as order with other as stop loss.
Counter trade, when this minimal stop loss is hit, is also as useful. However, wait till the SL candle closes, before opening position on the other side.
Works quite well on 15 mins chart, with settings of ATR duration 25 and multiplier 0.6. These settings are configurable, so feel free.
Popgun Bar PatternI created this script to research the trading effectiveness of the Popgun Bar Pattern.
The Popgun Bar Pattern is found when 3 candlesticks in order form the following pattern:
0. Any bar that is then followed by:
1. An inside bar. This is a bar that is completely engulfed by the bar before it. It will have a lower high and a higher low than the previous bar.
2. An outside bar immediately after. This is a bar that completely engulfs the prior inside bar. It will have a higher high and a lower low than the previous bar.
Simply put, the Popgun Bar Pattern is an inside bar followed by an outside bar.
I would highly recommend incorporating this signal as a "trigger" for existing technical analysis. Used in isolation it may not have a high probability of success.
To make it more effective as a trigger to a trading signal I incorporated into my code an Entry, Stop, and a Target dot.
The Entry dot is offset from the low of a bearish Popgun Bar Pattern or the high of a bullish Popgun Bar Pattern by a factor of ATR. The default ATR percentage is 33% but can be adjusted.
The Stop dot is based on the recent highest high (bearish) or lowest low (bullish) of a set range (default is 9 bars) plus/minus the ATR percentage buffer.
The Target dot is automatically calculated from the entry based on a configurable reward factor (default is 3) from the entry to stop distance. This projects a potential 3:1 reward/risk trade by default.
There is an additional alert condition which can be configured at the end of the script.
ATR color zones with volume radar [LM]Hello Guys,
I would like to introduce you the ATR color zones with volume radar indicator. It's a fork of @GlobalMarketSignals "GMS: Mr. Yen's Color Zone" shout-out to him.
I have enriched it -> that zones are calculated based on the ATR and percentages as described below and volume radar on candle bars. You can select from which timeframe color zones are calculated.
Zones:
white line is the previous period close
red zone = +/- 20% ATR of previous period
yellow zone = +/- 40% ATR of previous period
green zone = +/- 60% ATR of previous period
blue zone = +/- 100% ATR of previous period
Volume radar:
lime = above volume MA average multiplied by multiplier up bar
maroon = above volume MA average multiplied by multiplier down bar
black = volume is decreasing but is not below half of volume MA
navy = volume is decreasing and is below half of volume MA
markers are shown when volume is increasing two consecutive candle in row in direction of the candle
Any suggestions are welcomed
CC - Array-meta Consolidated Interval Display (ACID)This script extends my other two Array examples (which I've also provided to you open source):
The Ticker-centric 5m,15m,45m,1h,4h,1d resolution labels using arrays:
And the more Macro VIX,GLD,TLT,QQQ,SPY,IWM 1d resolution labels using arrays:
This script aims to show how to use min/max/avg with Arrays easily. My next example after this will be exploring the usage of variance versus covariance ratios over different periodic interval resolutions. Currently, this is using the following intervals: 5m,15m,45m,1h,4h,1d. It takes these intervals, calculates the values at those resolutions and puts the absolute min and max from the 5 minute to the 1 day resolutions.
It's more of an example of the power that arrays can hold, as all this truly is right now is a min/max bound calculator. The real gem lies in the avg calculators for multiple resoltuions tied into a single label with readable data. Check out the code and let me know what you think. If you need more examples, the other two scripts I mentioned before are also open source.
Using this on intervals of less than 1D sometimes times out, the way I wrote it is memory intensive, may not work for non-pro users.
Thanks!
NONE OF THIS IS FOREWARD LOOKING STATEMENTS, THIS IS NOT A PREDECTIVE ANALYSIS TOOL. THIS IS A RESEARCH ATTEMPT AT A NOVEL INDICATOR. I am not responsible for outcomes using it.
Please use and give criticisms freely. I am experimenting with combining resolutions and comparing covariance values at different levels right now, so let me know your thoughts! The last indicator will likely not be open source, but may be depending on how complex I get.
CC - Macro Consolidated Interval Display (MCID)Ever wish you didn't have to rapidly flip between 6 different tickers to get the full picture?
Yeah, me too. Do you also wish that you kind of understood how the shift / unshift function works for arrays?
Yeah, I did too. Both of those birds are taken care of with one stone!
The Macro Consolidated Interval Display uses the new Array structure and security to display data for VIX, GLD, TLT, QQQ, SPY and IWM (at a 1D interval) SIMUTANEOUSLY! Regardless of which ticker you're looking at you can get the full picture of macro futures data without flipping around to get it.
This is my first script trying to use arrays. It basically shows the following a 1d interval:
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for VIX.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for GLD.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for TLT.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for QQQ.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for SPY.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP for IWM
To make it more or less busy, I've allowed you to toggle off any of the levels you wish. I've also chosen to leave this as open source, as it's nothing too experimental, and I hope that it can gain some traction as an Array example that the public can use! If you don't like the different values that are shown, use this source code example as a spring-board to put values that you do care about onto the labels.
If this code has helped you at all please drop me a like or some constructive criticism if you do not think it's worth a like.
Good luck and happy trading friends. This should be compatible with my CID as well:
If this gets traction, I will post something similar for a dynamic combination of tickers and intervals that you can set yourself.
CC - Consolidated Interval Display (CID)Ever wish you didn't have to rapidly flip between 6 different intervals to get the full picture?
Yeah, me too. Do you also wish that you kind of understood how the shift / unshift function works for arrays?
Yeah, I did too. Both of those birds are taken care of with one stone!
The Consolidated Interval Display uses the new Array structure and security to display data for 5m, 15m, 45m, 1h, 4h and 1d intervals SIMUTANEOUSLY! Regardless of which interval you're looking at you can get the full picture of numerical data without flipping around to get it.
This is my first script trying to use arrays. It basically shows the following for the given ticker:
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 5 minute level.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 15 minute level.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 45 minute level.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 1 hour level.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 4 hour level.
ATR14, RSI7, RSI14, SMA50, SMA200 and VWAP at the 1 day level.
To make it more or less busy, I've allowed you to toggle off any of the levels you wish. I've also chosen to leave this as open source, as it's nothing too experimental, and I hope that it can gain some traction as an Array example that the public can use! If you don't like the different values that are shown, use this source code example as a spring-board to put values that you do care about onto the labels.
If this code has helped you at all please drop me a like or some constructive criticism if you do not think it's worth a like.
Good luck and happy trading friends.
If this gets traction, I will post something similar for a combination of SPY, VIX, GOLD, QQQ, IWM and TLT.
[SCL] Bitcoin Hashrate Dips (Miner Capitulation)Gives long-term buy signals for Bitcoin from dips and recoveries in the hashrate (the "miner capitulation" theory). It has an overlay and a standalone mode and is fully configurable. It uses Williams Lows and ATR instead of moving averages.
Features that might be interesting for Pinescripters:
+ Automatic (as far as is possible currently) adjustment of plots for overlay and standalone display modes.
+ A neat label function for debugging floats
+ Fully commented
+ The debug that I used to overcome problems in developing it is left in
+ Ideas for how to deal with a wildly oscillating and exponentially increasing data source
You need to run this indicator on the Bitcoin daily chart for it to make any sense. The best is a BTC/USD chart with a long history, such as BNC:BLX.
Daily Average True RangeThis script should give you a quick idea how far your stock has moved intraday compared to the ATR.
Label Display DemoA label function for display an arbitrary value above or below the chart.
There is no convenient way to display the value of a variable in pinescript. This is most convenient way I found.
It will follow the current bar (the position is calculated with highest/lowest and atr value, as such it will never display over the chart)
In this script we display ATR for the example
Volatility GuppyBased on my previous script "Turtle N Normalized," this script plots the CM SuperGuppy on the value of N to identify changing trends in the volatility of any instrument.
Turtle rules taken from an online PDF:
"The Turtles used a concept that Richard Dennis and Bill Eckhardt called N to represent the underlying volatility of a particular market.
N is simply the 20-day exponential moving average of the True Range, which is now more commonly known as the ATR. Conceptually, N represents the average range in price movement that a particular market makes in a single day, accounting for opening gaps. N was measured in the same points as the underlying contract.
The Turtles built positions in pieces which we called Units. Units were sized so that 1 N represented 1% of the account equity. Thus, a unit for a given market or commodity can be calculated using the following formula:
Unit = 1% of Account/(N x Dollars per Point)"
To normalize the Unit formula, this script instead takes the value of (close/N). Dollars per point = 1 for stocks and crypto, but will change depending on the contract specifications for individual futures .
"Since the Turtles used the Unit as the base measure for position size, and since those units were volatility risk adjusted, the Unit was a measure of both the risk of a position, and of the entire portfolio of positions."
When the EMA's are green, volatility is decreasing.
When the EMA's are red, volatility is increasing.
When the EMA's are grey, the trend is changing.
Turtle N NormalizedSimple script that calculates the normalized value of N. Rules taken from an online PDF containing the original Turtle system:
"The Turtles used a volatility-based constant percentage risk position sizing algorithm. The Turtles used a concept that Richard Dennis and Bill Eckhardt called N to represent the underlying volatility of a particular market.
N is simply the 20-day exponential moving average of the True Range, which is now more commonly known as the ATR. Conceptually, N represents the average range in price movement that a particular market makes in a single day, accounting for opening gaps. N was measured in the same points as the underlying contract.
The Turtles built positions in pieces which we called Units. Units were sized so that 1 N represented 1% of the account equity. Thus, a unit for a given market or commodity can be calculated using the following formula:
Unit = 1% of Account/(N x Dollars per Point)"
To normalize the Unit formula, this script instead takes the value of (close/N). Dollars per point = 1 for stocks and crypto, but will change depending on the contract specifications for individual futures.
"Since the Turtles used the Unit as the base measure for position size, and since those units were volatility risk adjusted, the Unit was a measure of both the risk of a position, and of the entire portfolio of positions."
When the value of N is high, volatility is low and you should be more risk-on.
When the value of N is low, volatility is high and you should be more risk-off.
ATR Trailing Stop Strategy by ceyhunSame coding only coloring and strategy version added
//Barcolor
Green = Trail1 > Trail2 and close > Trail2 and low > Trail2
Blue = Trail1 > Trail2 and close > Trail2 and low < Trail2
Red = Trail2 > Trail1 and close < Trail2 and high < Trail2
Yellow = Trail2 > Trail1 and close < Trail2 and high > Trail2
//It gives White color where there is deterioration.
Let's not use InfoPanel in strategy, it would be wrong as it signals the next day.
ATR Trailing Stoploss StrategyI am sharing the strategy version of the indicator used before. It is very simple to use.
These are the settings I use, you can change, test and use as you wish.
Atr Period 5
Highest High Period 10
Multiplier 2.5
It can generate more signals in shorter time frames.
The success rate will be higher in longer time frames.
Supertrend Screener LABELThis screens for Supertrend reversal's in 10 different securities. The main logic for the screener is taken from "Simple Custom Screener in Pinescript" by QuantNomad with his permission. If the label color is not visible due to the text in it being white colored, then choose a different color from settings. Also added a simple supertrend to it.
Terminology explanation:
Confirmed Reversal: Supertrend reversal that happened in the last bar and cannot be repainted.
Potential Reversal: Supertrend reversal that might happen in the current bar but can also not happen depending upon the timeframe closing price.
Uptrend/Downtrend : Shows all the tickers that are either currently in uptrend or downtrend.
Dual Volatility StopThis merges Volatility Stop & its MTF version both published by u/TradingView . Background is colored green or red when both the current timeframe Vstop and higher timeframe Vstop point in same direction. Aim is to take the standard Vstop script which differentiates market from only uptrend/downtrend to uptrend/downtrend/sideways. There is a tradeoff with this, that there is no need for the Vstop to be always in a position which reduces trade time & frees up capital. However this leads to situations where it takes slightly more time to catch on to a trend after a reversal.
Green Background = Buy
Red Background = Sell
No Background = Flat
ATR Daily LevelsPlots the daily ATR on the chart as upper and lower levels.
It can be use to adapt your trading in high and low periods of market volatility, determine reasonable target or take profit, entry at likely mean reversion, stop loss beyond normal flows etc...
More on the script behavior:
- Daily ATR upper/lower levels are applied on the current day low/high;
- The ATR value is defined by the last D1 bar;
- Shows up to D1 timeframe;
- Configuration for the indicator's period (default: 20 period ATR);
- Configuration for plotting the indicator on the the x axis with an offset/at begining of the day (default: offset);
Daily Range 1) Daily high - low range as a column chart
2) If differentiates the days of the week, Wednesday - Blue, Thursday - Red
Stop Loss PanelHere is a label panel that shows the stop-loss number for Long or Short trades based on volatility using average true range and and a mult of that.