Customizable Non-Repainting HTF MACD MFI Scalper Bot StrategyThis script was originally shared by Wunderbit as a free open source script for the community to work with.
WHAT THIS SCRIPT DOES:
It is intended for use on an algorithmic bot trading platform but can be used for scalping and manual trading.
This strategy is based on the trend-following momentum indicator . It includes the Money Flow index as an additional point for entry.
HOW IT DOES IT:
It uses a combination of MACD and MFI indicators to create entry signals. Parameters for each indicator have been surfaced for user configurability.
Take profits are fixed, but stop loss uses ATR configuration to minimize losses and close profitably.
HOW IS MY VERSION ORIGINAL:
I started trying to deploy this script myself in my algorithmic trading but ran into some issues which I have tried to address in this version.
Delayed Signals : The script has been refactored to use a time frame drop down. The higher time frame can be run on a faster chart (recommended on one minute chart for fastest signal confirmation and relay to algotrading platform.)
Repainting Issues : All indicators have been recoded to use the security function that checks to see if the current calculation is in realtime, if it is, then it uses the previous bar for calculation. If you are still experiencing repainting issues based on intended (or non intended use), please provide a report with screenshot and explanation so I can try to address.
Filtering : I have added to additional filters an ABOVE EMA Filter and a BELOW RSI Filter (both can be turned on and off)
Customizable Long and Close Messages : This allows someone to use the script for algorithmic trading without having to alter code. It also means you can use one indicator for all of your different alterts required for your bots.
HOW TO USE IT:
It is intended to be used in the 5-30 minute time frames, but you might be able to get a good configuration for higher time frames. I welcome feedback from other users on what they have found.
Find a pair with high volatility (example KUCOIN:ETH3LUSDT ) - I have found it works particularly well with 3L and 3S tokens for crypto. although it the limitation is that confrigurations I have found to work typically have low R/R ratio, but very high win rate and profit factor.
Ideally set one minute chart for bots, but you can use other charts for manual trading. The signal will be delayed by one bar but I have found configurations that still test well.
Select a time frame in configuration for your indicator calculations.
Select the strategy config for time frame. I like to use 5 and 15 minutes for scalping scenarios, but I am interested in hearing back from other community memebers.
Optimize your indicator without filters (trendFilter and RSI Filter)
Use the TrendFilter and RSI Filter to further refine your signals for entry. You will get less entries but you can increase your win ratio.
I will add screenshots and possibly a video provided that it passes community standards.
Limitations: this works rather well for short term, and does some good forward testing but back testing large data sets is a problem when switching from very small time frame to large time frame. For instance, finding a configuration that works on a one minute chart but then changing to a 1 hour chart means you lose some of your intra bar calclulations. There are some new features in pine script which might be able to address, this, but I have not had a chance to work on that issue.
真实波动幅度均值(ATR)
Bollinger Bands + Keltner Channel Refurbished█ Goals
This is an indicator that brings together Bollinger Bands and Keltner's Channels in one thing.
Both are very similar, so I decided to make a merge of the best features I found out there.
Here there is the possibility of choosing one of these two as needed.
In addition, I added the following resources:
1. Pre-Defined intermediate bands with Fibonacci values;
2. Detachment of the bands in which the price was present;
3. Choice of Moving Average:
"Simple", "Exponential", "Regularized Exponential", "Hull", "Arnaud Legoux", "Weighted Moving Average", "Least Squares Moving Average (Linear Regression)", "Volume Weighted Moving Average", "Smoothed Moving Average", "Median", "VWAP");
4. Statistics: bars count within the bands.
█ Concepts
Keltner Channels vs. Bollinger Bands
"These two indicators are quite similar.
Keltner Channels use ATR to calculate the upper and lower bands while Bollinger Bands use standard deviation instead.
The interpretation of the indicators is similar, although since the calculations are different the two indicators may provide slightly different information or trade signals."
(Investopedia)
Bollinger Bands (BB)
"Bollinger Bands (BB) are a widely popular technical analysis instrument created by John Bollinger in the early 1980’s.
Bollinger Bands consist of a band of three lines which are plotted in relation to security prices.
The line in the middle is usually a Simple Moving Average (SMA) set to a period of 20 days (the type of trend line and period can be changed by the trader; however a 20 day moving average is by far the most popular).
The SMA then serves as a base for the Upper and Lower Bands which are used as a way to measure volatility by observing the relationship between the Bands and price.
Typically the Upper and Lower Bands are set to two standard deviations away from the SMA (The Middle Line); however the number of standard deviations can also be adjusted by the trader."
(TradingView)
Keltner Channels (KC)
"The Keltner Channels (KC) indicator is a banded indicator similar to Bollinger Bands and Moving Average Envelopes.
They consist of an Upper Envelope above a Middle Line as well as a Lower Envelope below the Middle Line.
The Middle Line is a moving average of price over a user-defined time period.
Either a simple moving average or an exponential moving average are typically used. The Upper and Lower Envelopes (user defined) are set a range away from the Middle Line.
This can be a multiple of the daily high/low range, or more commonly a multiple of the Average True Range."
(TradingView)
█ Examples
Bollinger Bands with 200 REMA:
Keltner Channel with 200 REMA:
Bollinger Bands with 55 ALMA:
Keltner Channel with 55 ALMA:
Bollinger Bands with 55 Least Squares Moving Average:
█ Thanks
- TradingView (BB, KC, ATR, MA's)
- everget (Regularized Exponential Moving Average)
- TimeFliesBuy ("Triple Bollinger Bands")
- Rashad ("Fibonacci Bollinger Bands")
- Dicargo_Beam ("Is the Bollinger Bands assumption wrong?")
No Climactic BarsThis script can be used to detect large candles, similiar to ATR, using the variance of a sliding windows and certain threshold.
SL and TP - ATRThis indicator is using ATR ( Average True Range ) to set the Target point and Stop loss.
Use the pink number as target, always.
If you are in Long position, use the green number as stop loss, so the red number is not useful in Buys.
If you are in Short position, use the Red number as stop loss, so the green number is not useful in Sells.
** Need to enter the numbers in ticks --> VERY IMPORTANT: Write it completely, even the numbers after the point sign but DO NOT WRITE the point sign itself. e.g. : if the target tick on indicator is 123.75, you have to write 12375 ticks for your TP. ( one more example: If the number is 0.0001203 , write 1203 ticks. )
Enter the information of the opening candle.
Most of the times, risk/reward ratio is a bit higher than 1.
Works on multi timeframes. P.S: Haven't checked the weekly timeframe.
Not trying to oversell the indicator, but this is perhaps the best TP/SL specifier.
For beauty purposes, change (Sl @ buy) and (TP @ sell) to histograms.
Histograms are only for visual purposes. Customize the indicator as you want :)) Hope you enjoy
ATR with MAOVERVIEW
The Average True Range Moving Average (ATRMA) is a technical indicator that gauges the amount of volatility currently present in the market, relative to the historical average volatility that was present before. It adds a moving average to the Average True Range (ATR) indicator.
This indicator is extremely similar to the VOXI indicator, but instead of measuring volume, it measures volatility. Volume measures the amount of shares/lots/units/contracts exchanged per unit of time. Volatility, on the other hand, measures the range of price movement per unit of time.
The purpose of this indicator is to help traders filter between non-volatile periods in the market from volatile periods in the market without introducing subjectivity. It can also help long-term investors to determine market regime using volatility without introducing subjectivity.
CONCEPTS
This indicator assumes that trends are more likely to start during periods of high volatility, and consolidation is more likely to persist during periods of low volatility. The indicator also assumes that the average true range (ATR) of the last 14 candles is reflective of the current volatility in the market. ATR is the average height of all the candles, where height = |high - low|.
Suppose the ATR of the last 14 candles is greater than a moving average of the ATR(14) of the last 20 candles (this occurs whenever the indicator's filled region is colored BLUE). In that case, we can assume that the current volatility in the market is high.
Suppose the ATR of the last 14 candles is less than the moving average of the ATR(14) of the last 20 candles (this occurs whenever the indicator's filled region is colored RED). In that case, we can assume that the current volatility in the market is low.
HOW DO I READ THIS INDICATOR?
If the ATR line is above the ATR MA line (indicated by the blue color), the current volatility is greater than the historical average volatility.
If the ATR line is above the ATR MA line (indicated by the red color), the current volatility is less than the historical average volatility.
Supertrend with TP by Furkan SancuSimple Supertrend strategy with Take Profit levels.
Note: Make sure TP amounts add up to 100.
Opens a position with Supertrends strategy then adds Take Profit points with certain amounts of current position.
Multiple MAs + No Trend Zone + ATR WidgetThis is my first Pine Script attempt. Nothing special, just an "all in one" for the most common things I use, and what I have found to be the most common in a lot of strategies.
Great for free and limited accounts as it combines 7 total indicators into one.
-- First 5 indicators are Independant Moving Averages:
-Each one can be set for length, as well as source and type (SMA, EMA, SMMA, WMA, VWMA) individually
-- Second type (6th) of indicator is one I find extremly useful for staying OUT of consolidation trading. It's called a "No Trend Zone" indicator I swipped from the Hoffman Startegy. Basically, its set for a small deviation (0.5) of a 35 EMA, which creates a "Band" around the 35 line. When you have this "Band" flat or with no discernable incline/decline, with price action OR some or multiple moving averages inside this banded zone, it typically indicates a zone of consolidation. This will help you identify when you may be in one of those zones, that way you don't get trapped "waiting for paint to dry" before the market starts to move again with your position, and keep you from entering should you be considering the market at that time.
The last indicator is my favorite, and one I will refine a little deeper soon.
-- The ATR widget finishes us out. This widget can be customized for colors, turned on or off, and automatically rounds the ATR (ATR period based on the chart timeframe) to a nice readable number for what you're trading. It has settings to show or not, the length, what rounding style to use (forex pip 0.0001, forex/stock/etf/indicies 0.01) where to show it on the pane, a Multiplier Factor (for stop loss calculations automatically) and the colors.
***NOTE ABOUT ATR WIDGET:
I am primarily a forex trader, so the defaults are for Forex 0.0001. If you see some odd numbers (like 55798 on a current chart), check the inputs tab on the settings, and change the "ATR Style" from "Forex 0.0001" to "Forex/Stock/ETF/Indicies 0.01", and you should arrive with the correct number.
Trend MasterThis is a trend aggregator for confirmation and trend signals. It basically aggregates many buy/sell signals and confirmation and by combining them provides a strong buy/sell signal or trend confirmation.
The actual layout idea and trend confirmation is derived from Trend Meter and this indicator uses few other indicator, such as Chandelier Exit, WaveTrend, QQE Signals, Parabolic SAR and AlphaTrend. This indicator aggregates signal from different methods to find out more powerful and confirmed Trend and combines them into one Signal. It also uses Technical Ratings from TradingView team to filter out false signal, it tremendously opts out false signals and improve profitability.
The first seven dots are these
All 3 Trend Meters Now Align
MACD Crossover - Fast - 8, 21, 5
RSI 13: > or < 50
RSI 5: > or < 50
MA Crossover
MA Crossover
Chaikin Money Flow
Alphatrend
Technical Ratings
Then trend
Chandelier Exit
WaveTrend
QQE Signals
Parabolic Sar
All 3 Trend Meters aligns and A signal from trend i
Instructions
Change buy/sell policy based on market trend
Works on all TimeFrame but gives more accuracy on 4H, 1D.
Buy when green big dot appears at the bottom.
Sell when red big dot appears at the bottom.
Red/green dot at the top line appears when three trend meter is aligned and this is a good confirmation.
Any red/green dot below horizontal bars are trend signals.
Big red/green got at the bottom appears whenever there's a good confirmation from trend meter and a buy/sell signal comes from any trend signals.
Also look on the technical ratings bar, green means buy, red means sell and yellow means neutral.
Look for Support or Resistance Levels for price to be attracted to.
Find confluence with other indicators.
The more Trend meters are lit up the better.
Alert
01 Buy Signal = Strong Buy Signal
02 Sell Signal = Strong Sell Signal
03 Buy Signal = Strong Buy Signal
04 Sell Signal = Strong Sell Signal
Thanks to TradingView Technical Ratings authors, evergot, Lij_MC, KivancOzbilgic for their work. This indicator was heavily inspired from their work.
Stochastic ATR Volatility OscillatorNOTES: As x, k and d use;
21-10-3 for 1 Hour candles
5-4-2 for 4 Hour candles
21-21-3 for 1 Day candles
Yellow plot is the main oscillator. Orange plot, and hlines at 20, 50 and 80 can be used as signal lines.
I personally use hlines as the signal in 1H as it's the best timeframe for the indicator.
If you are in a long position, sell when yellow plot crosses 80 or 50 line downwards;
and buy when the line crosses 20, 50 or 75 upwards while you are not in a trade.
Stop Loss With Average True Range (ATR)Stop Loss With Average True Range (ATR)
It simplifies the calculation of stop loss price for stop loss method using the average true range (ATR).
For example;
You want to stop loss below 3 ATR. Let's assume the price is 100, the average true range is 5. You will multiply the average true range by 3 and subtract from the price and enter a stop loss order at the 85 price you have reached. Instead of doing this calculation every time, you just need to use this script and set the multiplier to 3. A stop loss line will be drawn below the price candles.
You can set the method to be used when averaging the true range. Methods you can use to average: EMA (exponentially moving average), HMA (hull moving average), RMA (moving average used in RSI), SMA (simple moving average), SWMA (symmetrically weighted moving average), VWMA (volume-weighted moving average), WMA (weighted moving average).
You can set the length to be used when averaging the true range.
You can set the multiplier to be used when determining the stop loss price.
Turkish
Ortalama Gerçek Aralıkla (ATR) Zarar Durdurma
Gerçek aralığın ortalamasını kullanarak zarar durdurma yöntemi için zarar durdurma fiyatının hesaplanmasını kolaylaştırır.
Örneğin;
3 ATR kadar aşağıda zarar durdurmak istiyorsunuz. Fiyatın 100, ortalama gerçek aralığın 5 olduğunu varsayalım. Ortalama gerçek aralığı 3 ile çarparak fiyattan çıkaracaksınız ve ulaştığınız 85 fiyatına zarar durdurma emri gireceksiniz. Bu hesabı her seferinde yapmak yerine bu betiği kullanmanız ve çarpanı 3 olarak ayarlamanız yeterli. Bu sayede fiyat mumlarının altına zarar durdurma çizgisi çizilecektir.
Gerçek aralığın ortalaması alınırken kullanılacak yöntemi ayarlayabilirsiniz. Ortalama almak için seçebileceğiniz yöntemler: EMA (üstel hareketli ortalama), HMA (gövde hareketli ortalama), RMA (göreceli hareketli ortalama), SMA (basit hareketli ortalama), SWMA (simetrik ağırlıklı hareketli ortalama), VWMA (hacim ağırıklı hareketli ortalama), WMA (ağırlıklı hareketli ortalama).
Gerçek aralığın ortalaması alınırken kullanılacak periyot uzunluğunu ayarlayabilirsiniz.
Zarar durdurma fiyatını belirlerken kullanılacak çarpanı ayarlayabilirsiniz.
ATR SL + Position Size Calculator [DoctaBot]Props to @Veryfid for his original script 'ATR Stop Loss Finder'.
The concept is simple. We use the average true range to determine an appropriate stop loss distance based on recent volatility. The original script calculated the stop loss offset from the current candle's high or low. Here, I've added the option to offset stop loss from the recent local low or local high (a better way in my opinion).
I have also added a feature to automatically calculate position size by either dollar amount or as a percent of your account size to suit your risk profile (percent of account at risk per trade). This calculator supports use of leverage to calculate the amount of margin required to open desired position size.
ATR Day Grid by RSUATR at the daily and intraday prompt lines, it is recommended to trade within 50%, and if it exceeds 50%, there is a risk of chasing high.
At the minute level,Day-level ATR grid line is displayed.
Heikin Ashi Mini BarIt is used to display the k-line status of heikin nash in the main image, without frequently switching the k-line display mode, and does not take up screen space.
CCI SupertrendCCI Supertrend
+ This simple scripts base on CCI level to plot "Supertrend".
+ When CCI move above level 0, SuperTrend lowerBand is plotted.
+ When CCI move below level 0, SuperTrend upperBand is plotted.
ATR BandsIn many strategies, it's quite common to use a scaled ATR to help define a stop-loss, and it's not uncommon to use it for take-profit targets as well. While it's possible to use the built-in ATR indicator and manually calculate the offset value, we felt this wasn't particularly intuitive or efficient, and could lead to the potential for miscalculations. And while there are quite a few indicators that plot ATR bands in some form or another already on TV, we could not find one that actually performed the exact way that we wanted. They all had at least one of the following gaps:
The ATR offset was not configurable (usually hard-coded to be based off the high or low, while we generally prefer to use close)
It would only print a single band (either the upper or lower), which would require the same indicator to be added twice
The ATR scaling factor was either not configurable or only stepped in whole numbers (often time fractional factors like 1.5 yield better results)
To that end, we took to making this enhanced version to meet all of the above requirements. While we were doing so, we decided to take this opportunity to also make some non-functional enhancements as well:
Updated the indicator to the most recent version of Pine
Updated the indicator definition to allow alternate (non-chart) timeframe usage
Made the input types explicitly defined to improve consistency
Updated the inputs with appropriate minimum values and step sizes where appropriate
Separated settings into logical groups
Added helptext to the indicator settings noting usage and common settings values
Explicitly titled the on-chart plots of the ATR bands so that they can more easily be identified and referenced in other indicators/scripts, as well as the Data Window
Food for thought : When looking at some of the behaviors of these ATR bands, you can see that when price first levels out, you can draw a "consolidation zone" from the first peak of the upper ATR band to the first valley of the lower ATR band that price will generally respect. Look for price to break and close outside of that zone. When that happens, price will usually (but not always) make a notable move in that direction, which can be used as either a potential trigger or as an additional confluence with other indicators/price action.
Finally, while we have made what we feel are some noteworthy updates and enhancements to this indicator, and have every intention of continuing to do so as we find worthy opportunities for enhancement, credit is still due to the original author: AlexanderTeaH
StopLossThat indicator helps us to determine the stop loss levels or prices in terms of atr levels. It includes 4 (four) options which are 1-Don't Risk, 2-Low Risk, 3-High Risk, 4-Risk Lover their exploding rates are 1-2.4% , 2-3.9% , 3-6.7% , 4-16.7% in sort. It helps us to produce new methods to decreace our risk/reward ratio. It is ATR Trailing StopLoss indicator. The indicator is awesome in terms of comfortable. Thanks and waiting for your feedbacks.
Average True Range - ImprovedAverage True Range - Improved is a small variation I have made to the standard ATR indicator. It will test the current ATR against the Historic Average ATR of your preference to see if the current volatility is high or low.
Once it has determined if it is high or low it will color code the circles at the top based on this information. Green means the current volatility is low and red means the current volatility is higher than the historic average.
In the settings I have also placed a couple styles, if you wish to show the ATR and Historic ATR in percent format instead of normal you can turn them on in the style settings. If you are using the percent format I recommend setting the Precision to 2-3 decimal places.
I hope you all enjoy this indicator, if you have any questions please feel free to post them in the comments.
Average True Range (VStop) GuppyThis script allows Volatility Stop, an average true range-based indicator, to be plotted like a "Guppy" multiple moving average indicator. Backtesting results seem pretty good when a solid majority of the lines are in agreement.
Of course, as is customary with my scripts, the user can select the length, source, and multiple for any of the ATR lines plotted and customize the visuals how they want.
Value added:
As far as I know, there aren't any ATR-based indicators that quite do this -- setting up a "Guppy" actually seems to help quite a lot with seeing the overall big picture & capturing the meat of a trend.
True Range with Context BandsThis is a very simple script which puts current price action magnituted into a larger context.
Red is true range of the current candle.
Blue is Average True Range x1, x2, x3
The idea is to use this to filter out too weak price action signals by taking only above average ones.
IR% - Intraday Range (% or $)Shows the percentage difference between the High and Low of the price bar expressed as a percent of the Open of that bar. In the settings, you can change to Price Change instead of percent change. This will show the price change between the High and Low for each price bar.
It can be used on any time frame.
I use it on the daily chart . I note the daily figure, and that lets me know how far the price tends to move during a typical day (no gaps included).
If using on another time frame other than the daily, then it is an intrabar calculation, not intraday.
Apply a moving average to it to see the average intraday movement after the open when using a daily chart .
The IR% of a 1-minute chart tells you the price range of that one-minute price bar, and a weekly chart will show the price range of each weekly price bar.
It only measures high to low versus the candle's open price. It does not include gaps between candles, which makes it different than the ATR. ATR is more useful for swing trading, where the trader may be holding through gaps in price, and thus wants to factor them in.
The IR% is useful for day traders because it shows how much a stock tends to move during the day (intraday range), when using a daily chart . ATR is not as effective for this because it includes gaps, which day traders can't generally capitalize on.
If the IR% is fluctuating between 5% and 10% over the last 50 days or so (on the daily chart ), day traders know that AFTER the open, the price is likely to move 5% to 10% from high point to low point. This can help with establishing profit targets, seeking out stocks that tend to move a lot within the day, or avoid these types of stocks if they are undesirable to you. Seek out low IR% stocks if you prefer lower movement during your selected time frame.
A stock may have an ATR% of 5% but ATR doesn't tell us if that movement occurred after the open or includes a gap. Some stocks are prone to gaps. They may gap 4% most days, and then only move 1% during the day. This will still be a 5% ATR%, but most of that movement ISN'T capturable each day. The IR% for this stock would only be 1%, not 5% like the ATR suggests.
I developed this because I like day trading volatile stocks, and I wanted a measure that ONLY includes movement during the day, and doesn't include price gaps in the calculation. Because as a day trader, gaps don't matter to me. I can only make money on what happens during the day, after the open.
It is similar to another indicator called Average Day Range (ADR). Although most ADR calculations are already calculated as an average (so I don't see each individual value) or plots things on the chart. This may be useful for some people, but I wanted to see the data on each price bar, have the option to add a moving average or not, and not have anything plotted on the price chart. It also nice to be able to flip from % to $ dollar movement if desired.
Fusion: ATR Ranging using PercentileA simple (but improved on my first attempt) way to determine a ranging market.
The defaults are for a specific use of my own so by no means feel a need to use them, adjust as needed.
By default this sits on the main chart however if you want to see the lines behind the result make a copy and put the copy on it's own chart and then just check the "Show ATR" and "Show PLI" (Percentile Linear Interpolation) flags.
There is no reason for using a Hull MA over any other except that it's a preference of mine, that is, it's not for some magical reason I figured out. That said, the Hull is perhaps my favorite because of what I learned about it after quite a bit of research so take that as you will.
Credit to: "Hull Suite by InSilico" from which I used the HMAs.
The code is structured to easily drop into bigger system so use as a lone indicator or add to some bigger project you are creating. If you do add this to a bigger system please drop me a note as it's nice to know your system is being used in something greater.
Finally, if you find value please do make a comment, give thumbs up etc.
Enjoy and good luck!
ATR Drift %This script plots an histogram calculated this way:
Get the previous ATR sample, calculated in the specified timeframe
Get the actual open price of the bar in the specified timeframe minus the actual price in the current timeframe
and plots the percent change between the the 2 values
For example, if you select DAY as timeframe for the ATR:
Plots the percent change between:
- ATR(daily) from yesterday
and
- open from today - actual price
Due to Tradingview limitations, only shows the plot if the actual timeframe of the graphic is equal or lower that the ATR selected timeframe
The background changes shows a new ATR sample taking place
I'm testing this for scalping in 5M timeframe with the ATR in 4H
All my published scripts at: es.tradingview.com
ATR Daily Drift %This script is an especial request from a user
Plots the percent change between:
- ATR(daily) from yesterday
and
- open from today - actual price
Due to Tradingview limitations, only shows the plot if the actual timeframe of the graphic is daily or lower.
All my published scripts at: es.tradingview.com