ATR Trading SetupThis simple script base on function of ATR Trailing Stop (aka SuperTrend) to plot Trading Setup on chart with detail as below:
1. Type of Average True Range (ATR)
+ The function calculate ATR may base on 1 of 3 type of Average: RMA, SMA, EMA
2. Trading Setup
2.1 Long setup
+ SuperTrend is upTrend
+ Entry Long at (or below) last value ATR Trailing Stop of Previous Trend (DownTrend)
+ Stop loss at first value ATR Trailing Stop of now Trend (upTrend)
+ Take profit at first value ATR Trailing Stop of Previous Trend (downTrend)
+ Move stop loss follow ATR Trailing Stop (green dot)
2.1 Short setup
+ SuperTrend is downTrend
+ Entry Short at (or above) last value ATR Trailing Stop of Previous Trend (upTrend)
+ Stop loss at first value ATR Trailing Stop of now Trend (downTrend)
+ Take profit at first value ATR Trailing Stop of Previous Trend (upTrend)
+ Move stop loss follow ATR Trailing Stop (red dot)
ATR
4c ATR ThresholdThe 4C ATR Threshold is a simple indicator that paints the chart background red when the ATR goes below the user defined ATR minimum.
Some trading setups have specific criteria that require a minimum ATR on a certain timeframe for the instrument to be playable.
The painting of the chart background based on the ATR value is useful as a quick visual reference.
The minimum ATR value can be adjusted to any specific level for any timeframe.
If the ATR dips below the user defined minimum, the trader can quickly see that the ATR is below the minimum criteria, and should not trade that instrument (based on their personal trade criteria).
If the background is not painted by the indicator, then the ATR is above the user defined minimum.
Parts of this script used the default/stock Tradingview ATR indicator to build from.
Multi-TimeFrame Extremum Points Support/ResistanceIntroduction
This is my newest Support/Resistance indicator based on the idea of my previous script which had been featured in Editors' Picks .
Everyone seems to have their own idea of how you should measure support and resistance levels. This code finds the exact highest and lowest price points (Extrema) on the chart and then draws the support and resistance levels on them.
In my opinion, the advantage of this method is that the most powerful resistance/support levels which usually cover the supply/demand areas would be formed on these extremum points, as the following facts state.
Facts
1. Support and resistance levels are one of the key concepts used by technical analysts and form the basis of a wide variety of technical analysis tools. Technical analysts use support and resistance levels to identify price points on a chart where the probabilities favor a pause or reversal of a prevailing trend.
2. Supply and demand zones are natural support and resistance levels and a popular analysis technique used in day trading. The zones are the periods of sideways price action that come before explosive price moves. A supply zone forms before a downtrend and a demand zone forms before an uptrend. When the price leaves the supply/demand zone and starts trending, the strong imbalance between buyers and sellers leads to strong and explosive price movements.
3. Based on Dow Theory, trends persist until a clear reversal occurs. A reversal is a change in the price direction of an asset. Reversals typically refer to large price changes, where the trend changes direction.
Challenges
The most challenging part in implementing a S/R indicator which draws all the levels on the chart is the problem of congestion!
But we should notice two other facts:
1. The more times the price tests a support or resistance area, the more significant the level becomes.
2. A previous support level will sometimes become a resistance level when the price attempts to move back up, and conversely, a resistance level will become a support level as the price temporarily falls back.
So, I solved the problem using these two approaches:
Merging nearby levels and showing the role of the levels in colors and numbers
Avoiding many weaker levels by checking higher time frames
Settings and Usage
There are some options in the indicator settings as described below:
Calculations Time Frame: By changing the time frame, user could keep only the stronger S/R levels on the chart.
Level Colors: By default, lowest points (Supports) are green, highest points (Resistances) are red and merged levels are blue. Note that the transparency of the colors would be calculated automatically; The more opaque the color is, the stronger the level is!
Lines Style and Width: The style of the levels could be solid, dashed or dotted and user could also change the lines width in pixels.
Length of the lines: This option is based on the count of bars, but user could simply choose to extend the levels
Merge Nearby Levels: The proximity of the levels would be calculated automatically based on ATR (Average True Range) and the default length of the formula could be changed.
Labels: Each level could have a label consisting the count of merged levels into one, the percentage of merged supports/resistances and the price of the level. Note that if user choose to see the percentage of S/R roles, the color of each label changes automatically based on the main role of corresponding merged level (e.g., a blue level with a red label means that the level more acted as resistance).
I think the users of my previous S/R indicators could check this one
That's it for now! Feel free to send me your thoughts!
Stairs Gain Strategy - MGI will explain step by step.
1- The position order filtering option is used to filter out duplicate positions.
2- The reason I use an ATR multiplier is to balance the ATR value that differs in instruments.
3- ATR lower limit and ATR upper limit values are to reduce unnecessary transactions and commission expenses in the horizontal market.
4- Strategy take profit and stop loss levels are calculated as percentages. The reason why there is no point account is that it can be used in the stock market.
5- Developer friends can get a more efficient result in forex market instruments by converting this to a point account.
Notice :
Variables are different in each instrument. Therefore, this strategy should be optimized for each instrument used.
4C ATR w/ Reference LineThe 4C ATR is a simple indicator that plots a horizontal line on the ATR indicator, which can be used as a minimum or maximum reference value.
Some trading setups have specific criteria that require a minimum ATR on a certain timeframe for the instrument to be playable. The horizontal line is useful as a quick visual reference, and can be adjusted to any specific level for any timeframe. If the ATR dips below the horizontal line, the trader can quickly see that the ATR is below the minimum criteria, and should not trade that instrument (based on their personal trade criteria).
This indicator also features a color change of the ATR line based on trend direction. If the ATR is trending up, it is painted blue, and if it starts to trend down, it is painted red. It uses a hidden simple moving average of the ATR, and the slope direction of the moving average paints the ATR line. The moving average length can be adjusted, and is set at a length of 8 for default. The ATR is set at a default value of 14.
Parts of this script used the default/stock Tradingview ATR indicator to build off of.
[BA] ATR Stop LineThis indicator helps you to set your stoploss levels by using ATR. Traders often use atr values in order to calculate their stoploss levels.
This indicator does the calculation for you and draw two tiny lines without messing up the chart so that you can easily see your stoploss levels and get an idea about the volatility and risk amount as well.
One line is below the last candle as a long trade stop loss level and the other one is above the last candle as a short trade stop loss level.
Calculation is simple:
For short trades, 2 times ATR added to last price;
For long trades, 2 times ATR subtracted from last price.
You can change ATR length, ATR multiplier and the line length.
Good luck.
MTF ATR Levels by makuchakuKnowing how big a range one is operating in (from a higher time frame perspective) is very important to understand where the reversals could potentially come from.
This indicator uses the closing price of previous HTF candle and plots its ATR range - and several levels on top of it.
+/- 75%
+/- 100%
+/- 150%
+/- 200%
+/- 300%
adx: Configurable ADX (library) Library "adx"
Calculate ADX (and its constituent parts +DI, -DI, ATR),
using different moving averages and periods.
adx(atrMA, diMA, adxMA, atrLen, diLen, adxLen, h, l, c)
Parameters:
atrMA : Moving Average used for calculating the Average True Range.
Traditionally RMA, but using SMA here and in adxMA gives good results too.
diMA : Moving Average used for calculating the Directional Index.
Traditionally, RMA.
adxMA : Moving Average used for calculating the Average Directional
Index. Traditionally RMA, but using SMA here and in atrMA gives good results
too.
atrLen : Length of the Average True Range.
diLen : Length of the Directional Index.
adxLen : Length (smoothing) of the Average Directional Index.
h : Candle's high.
l : Candle's low.
c : Candle's close.
Returns:
Flat Detect By Bollinger BandsThis simple script indicate the potential flat market zones, calculated based on the Bollinger Bands width.
It's showing the Bollinger Bands in red when the market is detected as flat.
You can adjust the Width Threshold with precision on the inputs settings.
Enjoy :)
Bar By Bar ATR [upslidedown]After seeing strategy after strategy refer to calculating ATR values using a "calculator" (how barbaric!), I thought I'd take a stab at one possible solution to the "problem" as an overlay indicator on the main chart that replaces traditional standard ATR bands. This indicator presents ATR within a channel with a slick trick: invisible hover-able tooltips for you to know the ATR value for your strategy from bar to bar. Just zoom in and hover over the high ATR range and you'll see take profit and stop loss values for whatever strategy you might be running. I defaulted the indicator to a 1:1.5 ATR standard setup because that is good for many strategies but this is as configurable as you'd like to make it. One notable improvement for this indicator over standard ATR bands is that many existing ATR bands only use integers and this one uses a float value, so you can endlessly customize based on whatever strategy you might be running.
Note: Because labels are limited by default, the best way to historically see ATR values is to use TV's replay feature. I did this on purpose to limit resource usage. One could certainly print more labels but I felt it unnecessary to go beyond the default number of labels.
3 Candle Strike StretegyMainly developed for AMEX:SPY trading on 1 min chart. But feel free to try on other tickers.
Basic idea of this strategy is to look for 3 candle reversal pattern within trending market structure. The 3 candle reversal pattern consist of 3 consecutive bullish or bearish candles,
followed by an engulfing candle in the opposite direction. This pattern usually signals a reversal of short term trend. This strategy also uses multiple moving averages to filter long or short
entries. ie. if the 21 smoothed moving average is above the 50, only look for long (bullish) entries, and vise versa. There is option change these moving average periods to suit your needs.
I also choose to use Linear Regression to determine whether the market is ranging or trending. It seems the 3 candle pattern is more successful under trending market. Hence I use it as a filter.
There is also an option to combine this strategy with moving average crossovers. The idea is to look for 3 candle pattern right after a fast moving average crosses over a slow moving average.
By default , 21 and 50 smoothed moving averages are used. This gives additional entry opportunities and also provides better results.
This strategy aims for 1:3 risk to reward ratio. Stop losses are calculated using the closest low or high values for long or short entries, respectively, with an offset using a percentage of
the daily ATR value. This allows some price fluctuation without being stopped out prematurely. Price target is calculated by multiplying the difference between the entry price and the stop loss
by a factor of 3. When price target is reach, this strategy will set stop loss at the price target and wait for exit condition to maximize potential profit.
This strategy will exit an order if an opposing 3 candle pattern is detected, this could happen before stop loss or price target is reached, and may also happen after price target is reached.
*Note that this strategy is designed for same day SPY option scalping. I haven't determined an easy way to calculate the # of contracts to represent the equivalent option values. Plus the option
prices varies greatly depending on which strike and expiry that may suits your trading style. Therefore, please be mindful of the net profit shown. By default, each entry is approximately equal
to buying 10 of same day or 1 day expiry call or puts at strike $1 - $2 OTM. This strategy will close all open trades at 3:45pm EST on Mon, Wed, and Fri.
**Note that this strategy also takes into account of extended market data.
***Note pyramiding is set to 2 by default, so it allows for multiple entries on the way towards price target.
Remember that market conditions are always changing. This strategy was only able to be back-tested using 1 month of data. This strategy may not work the next month. Please keep that in mind.
Also, I take no credit for any of the indicators used as part of this strategy.
Enjoy~
Supertrend Ext1st it exactly looks like the original Supertrend indicator. But if you see the options, you can see it is totally different:
It uses my other indicator inside: Zero Lag Keltner Channels, so you can use smoothed ATR bands for calculation instead of the raw ATR. By default it's length is 1 so it works like the original Supertrend.
You can choose different sources and moving averages for Keltner Channel calculation
It can filter outliers in ATR calculation
The indicator code is in my TAExt library, so it can easily be used in custom strategies.
Average True Range (VStop) Cloud SignalsThis indicator extends the built-in Volatility Stop indicator to a visual signals type indicator based on the crossover of a small VStop value (default 1.5x ATR) and a larger VStop value (default 3x ATR). The two values form a "cloud" with default coloring based on RSI/strength of trend.
Minimalistic ATRI have a thing for efficiency, as I'm sure many of you do as well. One could say we are minimalist. As such, wasting precious chart space is absolutely unacceptable. Such precious commodity should only be used for things that are pleasing to the eye and mind. This minimalistic ATR filter will give you all the functions a regular ATR provide, without all the clutter of plotting on the chart. Enjoy
The height of cultivation always runs to simplicity.
Chandelier Exit - StrategyI created a strategy version for the Chandelier Exit indicator, originally owned by @everget . With the strategy I prepared, you can try both short-long and stop loss - trailing stop and take profit rates. I have also added a date filter feature so that you can test the strategy in the date range you want.
Orjinali @everget 'e ait olan Chandelier Exit indicator için strateji versiyonu oluşturdum. Hazırladığım strateji ile hem short-long deneyebilir hem de zarar durdur - takip eden stop ve kar al oranları denemeleri yapabilirsiniz. İstediğiniz tarih aralığında strateji testi yapabilmeniz için tarih filtre özelliği de ekledim.
ATR TREXTry to visualize TREX method.
-4 types of candle based on TR :
1. Spinning ( Candle < 0.8*ATR )
2. Standard ( 0.8*ATR < Candle < 1.2*ATR )
3. Long bar ( 1.2*ATR < Candle < 2.5*ATR )
4. Spike ( 2.5*ATR < Candle )
ATR length is different base on FRACTAL timeframes.
you can now find what is type of candle as colored ATR.
-Time frames :
1 Min
5 Min
15 Min
1 Hour
4 Hour
1 Day
1 Week
1 Month
I am working on TREX method and this indicator will change and improve . (V1.0)
Br
Amin
CHOPperIt is based on the Choppiness Index indicator. It can show you when the market is in range. If the lines are below the lower band, it can be a strong trend, if it is inside the 2 bands, it is considered to be a choppy market, and if it is crossed down the upper band, it can be a developing trend.
This indicator does not show you the trend direction! This may be used as a confirmation indicator.
The improvements this indicator provides over the original:
It uses ATR instead of just TR (if ATR length is 1, it is the original TR)
It uses my ATRWO (ATR Without Outliers) indicator inside, which can remove extreme highs and lows from calculation. You can tune this by the "ATRWO STDev Mult" parameter. Higher value means more outliers are allowed.
It has 2 lines, one uses ATR(WO) (the blue one), which can be similar to the original Choppiness Index, the other uses standard deviation (the teal one).
The 2 lines can be used together, or you can hide one of them.
TAExtLibrary "TAExt"
Indicator functions can be used in other indicators and strategies. This will be extended by time with indicators I use in my strategies and studies.
atrwo(length, stdev_length, stdev_mult) ATR without outliers
Parameters:
length : The length of the ATR
stdev_length : The length of the standard deviation, used for detecting outliers
stdev_mult : The multiplier of the standard deviation, used for detecting outliers
Returns: The ATR value
atrwma(src, period, type, atr_length, stdev_length, stdev_mult) ATR without outlier weighted moving average
Parameters:
src : The source of the moving average
period : The period of the moving average
type : The type of the moving average, possible values: SMA, EMA, RMA
atr_length : The length of the ATR
stdev_length : The length of the standard deviation, used for detecting outliers
stdev_mult : The multiplier of the standard deviation, used for detecting outliers
Returns: The moving average value
jma(src, period, phase, power) Jurik Moving Average
Parameters:
src : The source of the moving average
period : The period of the moving average calculation
phase : The phase of jurik MA calculation (-100..100)
power : The power of jurik MA calculation
Returns: The Jurik MA series
anyma(src, period, type, offset, sigma, phase, power) Moving Average by type
Parameters:
src : The source of the moving average
period : The period of the moving average calculation
type : The type of the moving average
offset : Used only by ALMA, it is the ALMA offset
sigma : Used only by ALMA, it is the ALMA sigma
phase : The phase of jurik MA calculation (-100..100)
power : The power of jurik MA calculation
Returns: The moving average series
wae(macd_src, macd_fast_length, macd_slow_length, macd_sensitivity, bb_base_src, bb_upper_src, bb_lower_src, bb_length, bb_mult, dead_zone_length, dead_zone_mult) Waddah Attar Explosion (WAE)
Parameters:
macd_src : The source series used by MACD
macd_fast_length : The fast MA length of the MACD
macd_slow_length : The slow MA length of the MACD
macd_sensitivity : The MACD diff multiplier
bb_base_src : The source used by stdev
bb_upper_src : The source used by the upper Bollinger Band
bb_lower_src : The source used by the lower Bollinger Band
bb_length : The lenth for Bollinger Bands
bb_mult : The multiplier for Bollinger Bands
dead_zone_length : The ATR length for dead zone calculation
dead_zone_mult : The ATR multiplier for dead zone
Returns:
ssl(length, high_src, low_src) Semaphore Signal Level channel (SSL)
Parameters:
length : The length of the moving average
high_src : Source of the high moving average
low_src : Source of the low moving average
Returns:
adx(atr_length, di_length, adx_length, high_src, low_src, atr_ma_type, di_ma_type, adx_ma_type) Average Directional Index + Direction Movement Index (ADX + DMI)
Parameters:
atr_length : The length of ATR
di_length : DI plus and minus smoothing length
adx_length : ADX smoothing length
high_src : Source of the high moving average
low_src : Source of the low moving average
atr_ma_type : MA type of the ATR calculation
di_ma_type : MA type of the DI calculation
adx_ma_type : MA type of the ADX calculation
Returns:
Hourly Bias on BTC in Bullish USA Session “Green Eagle”Name: Hourly Bias on BTC in Bullish USA Session
Category: Hourly Bias
Operating mode: Spot, only long
Trades duration: Intraday, 11 bars
Timeframe: 1H
Suggested usage: When the market is compressed, USA session has a bullish bias.
Entry: enter Long at 15:00 on specific days of the week. There is a volatility filter based on ATR which identifies compression.
Exit: exit at a pre-defined time at 01:00
Usage:
⁃ It can be useful to use alerts or webhooks to automate this strategy.
⁃ This is a core system that can be improved in different ways (e.g. Stop-loss, take-profit, position sizing) or studying more the behaviour in the specific days of the week or short when is red.
Configuration:
- N/A
Backtesting
⁃ Exchange: BINANCE
⁃ Pair: BTCUSDT
⁃ Timeframe: 1H
⁃ Fee 0.075%
⁃ Slippage 2
- Start : 2019-01-06
We decided to release this free BTC strategy.
How you or we can improve? Source code is open so share your ideas!
ATR vs Day Trading Range and PercentageThis indicator displays the Current Daily ATR vs the current Day Range and displays the percentage.
For example if the Daily ATR is $5 and the current range of the day is $10 this would be 200% the original move.
It is color coded (and can be modified) to change color when the Daily range is over 100% the ATR.
The time frame can be changed from Daily just be aware you must be on a lower timeframe then selected. So if you want to compare the current 30 minute ATR to the current 30 minute range you will need to be showing a 30 min chart or lower for it to calculate correctly.
ATR Position Size AutomationAll you have to fill out is your account balance, the % amount of your account you want to risk, and the percentage of ATR you want calculated. If you have 100% it will do a full ATR calculation. So if the ATR is $2 then your risk per share would be $2. If you had 50% in the same example it would be risking $1 per share.
You can also customize what time frame you want the ATR to be calculating off of. Just be aware the calculation will only be right if you are showing a lower time frame on your chart then the one selected on the indicator. (If you are calculating a daily dont be on a weekly chart. You have to be on a Daily or lower)
You can select what boxes you want displayed and if you want the ATR lines on the chart.
Average True Range (ATR) invisible price markers / linesThis script provides the ATR price when added to the top and bottom of the currently hovered candle.
The prices are shown top left next to the indicators' name.
This means you do not have to manually subtract or add ATR to price.
Line opacity allows you to show the lines where the ATR is, however, I recommend to keep this disabled.
Line type allows you to choose where ATR is calculated from (LowHigh or LowHighBody), the second ignoring the wicks, however LH is standard.
I also recommend to keep the other parameters as default.
I hope this indicator provides useful to you and your trading.
action zone - ATR stop reverse order strategy v0.1 by 9nckACTION ZONE-ATR MOD v0.1 DOCUMENTATION
Overview
This tradingview pine script strategy is mainly created to enrich my coding skill. It is a combination of “CDC-ACTIONZONE” and my personal studies of trading techniques in various sources e.g.book, course or blog. This strategy purposefully built to connect with my automatic trading bot. However, It will be very useful to aid your trading routine by diminishing mental distraction which possibly leads to bad trades.
How does it work?
This strategy will do a basic simple thing that most traders do by creating entry signals on both sides long/short and also set the stop loss. Furthermore, It will also reverse the order (from long to short and vice versa (if long/short conditions are met). Finally, it will recalculate the stop loss/take profit price in every complete bar to increase the chance of winning and limit our loss.
Entry rules(Long/Short)
If you have no open order, an order will be created when a fast EMA crosses(up(long)/down(short) the slow EMA(It’s as simple as that).
If you have an open order, the current order will be (sold if long, covered if short) and the opposite side order will be created.
Exit and Reverse rules(Long/Short)
If fast EMA cross (DOWN(long), UP(short)), the current order will be closed, THE OPPOSITE SIDE ORDER WILL ALSO BE CREATED.
Risk management
FLEX STOP PRICE : initial value will be set at the bar which order created. It is a fast ema (+/-) MIDDLE ATR value.
If MIDDLE ATR value rises, it will be our new stop price.
If MIDDLE ATR value falls, stop price unchanged
If Price OVERBOUGHT(long)/SOLD(short), LOW of that bar will be a new stop price.
Minimum position hold period
In order to eliminate risk of repeatedly open, close orders in sideway trends. Minimum hold period must be passed to start exit our position. However, It always respects stop loss prices. The value refers to the number of bars.
MUST READ!!!
This strategy uses only MARKET ORDER. If you trade with a bot, make sure you choose only enormous market cap tokens.
This strategy is bi-direction strategy. It will work best in the DERIVATIVE market.
It was initially designed to compete in the cryptocurrency market which has very high volume and volatility.
I only use this strategy in 1HR (acceptable change rate, optimum trade frequency)
How (should) we use it?
Choose crypto future pairs (recommend only top 10-15 market volume pairs in Binance, let’s say 1000M+ trade value)
Choose your time frame (1H is strongly recommended)
Setup your portfolio profile (Setting->Properties) such as Initial cap, order size, commission. DO NOT USE CAL ON EVERY TICK IT WILL CAUSE REPAINTING AND YOUR CAPITAL IS BLEEDING !!!
BACKTEST FIRST!! Back test is a combination of art, math and statis(and a bit of luck). You can apply to train and test methods or whatever you are familiar with. In my opinion, your test period should include UPTREND, SIDEWAY, DOWNTREND. Fine tune fast, slow ema first(my best ema length of 1H timeframe around 7-10, 17-22). Try to eliminate fault breakout trade and use other options only necessary. Hopefully we can use automatic optimization on Pine Script soon.
Don’t forget to turn off using a specific backtest date option to start your strategy.A
THIS IS NOT A PERFECT (OR EVEN PROFITABLE) STRATEGY. USE AT YOUR OWN RISK AND TRADE RESPONSIBLY. DYOR DUDE.