Filtered MACD with Backtest [UAlgo]The "Filtered MACD with Backtest " indicator is an advanced trading tool designed for the TradingView platform. It combines the Moving Average Convergence Divergence (MACD) with additional filters such as Moving Average (MA) and Average Directional Index (ADX) to enhance trading signals. This indicator aims to provide more reliable entry and exit points by filtering out noise and confirming trends. Additionally, it includes a comprehensive backtesting module to simulate trading strategies and assess their performance based on historical data. The visual backtest module allows traders to see potential trades directly on the chart, making it easier to evaluate the effectiveness of the strategy.
🔶 Customizable Parameters :
Price Source Selection: Users can choose their preferred price source for calculations, providing flexibility in analysis.
Filter Parameters:
MA Filter: Option to use a Moving Average filter with types such as EMA, SMA, WMA, RMA, and VWMA, and a customizable length.
ADX Filter: Option to use an ADX filter with adjustable length and threshold to determine trend strength.
MACD Parameters: Customizable fast length, slow length, and signal smoothing for the MACD indicator.
Backtest Module:
Entry Type: Supports "Buy and Sell", "Buy", and "Sell" strategies.
Stop Loss Types: Choose from ATR-based, fixed point, or X bar high/low stop loss methods.
Reward to Risk Ratio: Set the desired take profit level relative to the stop loss.
Backtest Visuals: Display entry, stop loss, and take profit levels directly on the chart with
colored backgrounds.
Alerts: Configurable alerts for buy and sell signals.
🔶 Filtered MACD : Understanding How Filters Work with ADX and MA
ADX Filter:
The Average Directional Index (ADX) measures the strength of a trend. The script calculates ADX using the user-defined length and applies a threshold value.
Trading Signals with ADX Filter:
Buy Signal: A regular MACD buy signal (crossover of MACD line above the signal line) is only considered valid if the ADX is above the set threshold. This suggests a stronger uptrend to potentially capitalize on.
Sell Signal: Conversely, a regular MACD sell signal (crossunder of MACD line below the signal line) is only considered valid if the ADX is above the threshold, indicating a stronger downtrend for potential shorting opportunities.
Benefits: The ADX filter helps avoid whipsaws or false signals that might occur during choppy market conditions with weak trends.
MA Filter:
You can choose from various Moving Average (MA) types (EMA, SMA, WMA, RMA, VWMA) for the filter. The script calculates the chosen MA based on the user-defined length.
Trading Signals with MA Filter:
Buy Signal: A regular MACD buy signal is only considered valid if the closing price is above the MA value. This suggests a potential uptrend confirmed by the price action staying above the moving average.
Sell Signal: Conversely, a regular MACD sell signal is only considered valid if the closing price is below the MA value. This suggests a potential downtrend confirmed by the price action staying below the moving average.
Benefits: The MA filter helps identify potential trend continuation opportunities by ensuring the price aligns with the chosen moving average direction.
Combining Filters:
You can choose to use either the ADX filter, the MA filter, or both depending on your strategy preference. Using both filters adds an extra layer of confirmation for your signals.
🔶 Backtesting Module
The backtesting module in this script allows you to visually assess how the filtered MACD strategy would have performed on historical data. Here's a deeper dive into its features:
Backtesting Type: You can choose to backtest for buy signals only, sell signals only, or both. This allows you to analyze the strategy's effectiveness in different market conditions.
Stop-Loss Types: You can define how stop-loss orders are placed:
ATR (Average True Range): This uses a volatility measure (ATR) multiplied by a user-defined factor to set the stop-loss level.
Fixed Point: This allows you to specify a fixed dollar amount or percentage value as the stop-loss.
X bar High/Low: This sets the stop-loss at a certain number of bars (defined by the user) above/below the bar's high (for long positions) or low (for short positions).
Reward-to-Risk Ratio: Define the desired ratio between your potential profit and potential loss on each trade. The backtesting module will calculate take-profit levels based on this ratio and the stop-loss placement.
🔶 Disclaimer:
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Exponentialmovingaverage
Daily TrendDescription:
The "Daily Trend" script is a powerful technical analysis tool designed for TradingView. This indicator helps traders identify key support and resistance levels based on daily price data. It offers a visual representation of these levels, along with other technical indicators like Exponential Moving Averages (EMA), Supertrend, and Parabolic SAR.
Features:
Past Candle Price Levels: This script calculates and displays past daily candle price levels, including R1, R2, R3, R4, S1, S2, S3, and S4. These levels are vital for identifying potential reversals and breakout points.
Exponential Moving Average (EMA): The script includes an EMA indicator with a customizable period to help traders spot the trend direction and potential crossovers.
Supertrend Indicator: The Supertrend indicator is used to identify trend changes. It plots the Supertrend line and highlights the trend direction with color-coded regions.
Parabolic SAR: The Parabolic SAR indicator is integrated into the script to assist traders in identifying potential entry and exit points in the market.
Customizable Alerts: Traders can customize the indicator by choosing which past candle price levels and other features to display on the chart.
How to Use:
Apply the "Daily Trend" script to your TradingView chart.
Customize the indicator by enabling or disabling specific features, such as past candle price levels and EMA.
Pay attention to the color-coded regions for Supertrend and Parabolic SAR to determine the current trend direction.
Look for potential reversal or bounce signals based on the indicator's signals and the price action.
Consider using this script in conjunction with your trading strategy for enhanced technical analysis.
Risk Warning: Trading involves significant risk, and past performance is not indicative of future results. Always practice proper risk management and consider the broader context of the market before making trading decisions.
TTP Green/Red Consecutive CandlesThis indicator counts consecutive green/red candles offering some basic statistics and signals/alerts.
Features
- Counts consecutive green/red candles in an oscillator chart
- Moving average of the counting helps spotting when the consecutive candles are away from the mean. MA length and multiplier to adjust the signal sensitivity.
- Thresholds can be set to backtest and send alerts on any number of arbitrary consecutive candles of the same color.
- All time highs: the indicator keeps track of when the maximum has been reached
- Distribution data: the number of times each number of consecutive color candles has been reached is offered
Signals
- Threshold signal triggers when the number of candles of the same color is above the specified threshold.
- MA cross signal triggers when the number of candles of the same color is above the MA.
MultiMovesCombines 3 different moving averages together with the linear regression. The moving averages are the HMA, EMA, and SMA. The script makes use of two different lengths to allow the end user to utilize common crossovers in order to determine entry into a trade. The edge of each "cloud" is where each of the moving averages actually are. The bar color is the average of the shorter length combined moving averages.
-The Hull Moving Average (HMA), developed by Alan Hull, is an extremely fast and smooth moving average. In fact, the HMA almost eliminates lag altogether and manages to improve smoothing at the same time. A longer period HMA may be used to identify trend.
-The exponential moving average (EMA) is a technical chart indicator that tracks the price of an investment (like a stock or commodity) over time. The EMA is a type of weighted moving average (WMA) that gives more weighting or importance to recent price data.
-A simple moving average (SMA) is an arithmetic moving average calculated by adding recent prices and then dividing that figure by the number of time periods in the calculation average.
-The Linear Regression Indicator plots the ending value of a Linear Regression Line for a specified number of bars; showing, statistically, where the price is expected to be. Instead of plotting an average of past price action, it is plotting where a Linear Regression Line would expect the price to be, making the Linear Regression Indicator more responsive than a moving average.
The lighter colors = default 50 MA
The darker colors = default 200 MA
Multi-Timeframe Trend IndicatorThe Multi-Timeframe Trend Indicator (MTFTI) is a trend analysis tool designed to help traders quickly and easily assess the market direction across multiple timeframes. With the help of a table to visualize the trends on different timeframes.
Key features:
Multi-timeframe trend indicator for the following timeframes: 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 6 hours, 12 hours, 1 day, and 1 week and average.
Displays trends for selected timeframes in a table.
Considers short and long-term exponential moving averages (EMAs) to determine trends.
Calculation of the average trend for all timeframes.
Display of trends with appropriate coloring for better readability (green for "Up", red for "Down", and intermediate shades for neutral or strong trends).
List of Parameters
Customization of the table's position on the screen (top-left, top-right, middle-left, middle-right, bottom-left, bottom-right).
Setting the lengths of the short and long-term exponential moving averages.
Option to activate or deactivate the display of EMAs for better customization (true by default).
Please note that the MTFTI is not a guarantee of future market performance and should be used in conjunction with proper risk management. Always ensure that you have a thorough understanding of the indicator’s methodology and its limitations before making any investment decisions. Additionally, past performance is not indicative of future results.
Adaptive Deviation [Loxx]Adaptive Deviation is an educational/conceptual indicator that is a new spin on the regular old standard deviation. By definition, the Standard Deviation (STD, also represented by the Greek letter sigma σ or the Latin letter s) is a measure that is used to quantify the amount of variation or dispersion of a set of data values. In technical analysis we usually use it to measure the level of current volatility.
Standard Deviation is based on Simple Moving Average calculation for mean value. This version of standard deviation uses the properties of EMA to calculate what can be called a new type of deviation, and since it is based on EMA, we can call it EMA deviation. And added to that, Perry Kaufman's efficiency ratio is used to make it adaptive (since all EMA type calculations are nearly perfect for adapting).
The difference when compared to standard is significant--not just because of EMA usage, but the efficiency ratio makes it a "bit more logical" in very volatile market conditions.
The green line is the Adaptive Deviation, the white line is regular Standard Deviation. This concept will be used in future indicators to further reduce noise and adapt to price volatility.
Included
Loxx's Expanded Source Types
Synthetic EMA Momentum w/ DSL [Loxx]Synthetic EMA Momentum w/ DSL is a momentum indicator that is calculated with 5 different EMAs of increasing period to derive a final momentum value. This helps reduce noise and improve signal quality. Discontinued signal lines are uses to calculate signal values.
What are DSL Discontinued Signal Line?
A lot of indicators are using signal lines in order to determine the trend (or some desired state of the indicator) easier. The idea of the signal line is easy : comparing the value to it's smoothed (slightly lagging) state, the idea of current momentum/state is made.
Discontinued signal line is inheriting that simple signal line idea and it is extending it : instead of having one signal line, more lines depending on the current value of the indicator.
"Signal" line is calculated the following way :
When a certain level is crossed into the desired direction, the EMA of that value is calculated for the desired signal line
When that level is crossed into the opposite direction, the previous "signal" line value is simply "inherited" and it becomes a kind of a level
This way it becomes a combination of signal lines and levels that are trying to combine both the good from both methods.
In simple terms, DSL uses the concept of a signal line and betters it by inheriting the previous signal line's value & makes it a level.
Included:
Loxx's Expanded Source Types
Alerts
Signals
Bar coloring
Related indicators
Smoother Momentum MACD w/ DSL
T3 Velocity
EMAs DistancesThis indicator shows 4 configurable EMAs and the distances (values and percentages) to the last price of the stock, etf or index.
Efficiency-Ratio-Adaptive EMA [Loxx]Efficiency ratio was invented by Perry Kaufman as a measure of volatility and as a way of making some calculations adaptive. In his adaptive moving average he uses 3 periods for calculation which makes it a bit "cryptic" and, by all means, not so simple to use. This version is simplifying the whole thing without an intention to clone the KAMA indicator--but with the intention to use the efficiency ratio for adapting the average calculations and to use only two parameters for that:
period
price
Included:
Bar coloring
Short Swing Bearish MACD Cross (By Coinrule)This strategy is oriented towards shorting during downside moves, whilst ensuring the asset is trading in a higher timeframe downtrend, and exiting after further downside.
This script can work well on coins you are planning to hodl for long-term and works especially well whilst using an automated bot that can execute your trades for you. It allows you to hedge your investment by allocating a % of your coins to trade with, whilst not risking your entire holding. This mitigates unrealised losses from hodling as it provides additional cash from the profits made. You can then choose to hodl this cash, or use it to reinvest when the market reaches attractive buying levels. Alternatively, you can use this when trading contracts on futures markets where there is no need to already own the underlying asset prior to shorting it.
ENTRY
This script utilises the MACD indicator accompanied by the Exponential Moving Average (EMA) 450 to enter trades. The MACD is a trend following momentum indicator and provides identification of short-term trend direction. In this variation it utilises the 11-period as the fast and 26-period as the slow length EMAs, with signal smoothing set at 9.
The EMA 450 is used as additional confirmation to prevent the script from shorting when price is above this long-term moving average. Once price is above the EMA 450 the script will not open any shorts - preventing the rule from attempting to short uptrends. Due to this, this strategy is ideal for setting and forgetting.
The script will enter trades based on two conditions:
1) When the MACD signals a bearish cross. This occurs when the EMA 11 crosses below the EMA 26 within the MACD signalling the start of a potential downtrend.
2) Price has closed below the EMA 450. Price closing below this long-term EMA signals that the asset is in a sustained downtrend. Price breaking above this could indicate a bullish strength in which shorting would not be profitable.
EXIT
This script utilises a set take-profit and stop-loss from the entry of the trade. The take profit is set at 8% and the stop loss of 4%, providing a risk reward ratio of 2. This indicates the script will be profitable if it has a win ratio greater than 33%.
Take-Profit Exit: -8% price decrease from entry price.
OR
Stop-Loss Exit: +4% price increase from entry price.
Based on backtesting results across a selection of assets, the 45-minute and 1-hour timeframes are the best for this strategy.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
The backtesting data was recorded from December 1st 2021, just as the market was beginning its downtrend. We therefore recommend analysing the market conditions prior to utilising this strategy as it operates best on weak coins during downtrends and bearish conditions, however the EMA 450 condition should mitigate entries during bullish market conditions.
Multi-timeframe EMAThe Multi-timeframe exponential moving average (EMA) indicator visualizes EMAs from 1 minute to 1 quarter on a single chart using the request.security function. Standard and Fibonacci timeframes are available as well as the ability to hide high-timeframe EMAs to keep the chart clean. Cross-overs and arrangement of the EMAs indicate sentiment.
Much love to DumpCap! The script is presented sans secret sauce.
Fibonacci RibbonThe Fibonacci Ribbon (FibRib) creates two Fibonacci moving averages: essentially a Fibonacci WMA and a Fibonacci EMA.
The ribbon colors based on which is higher and where PA is relative to the ribbon.
Optional colored candles shades candles the same color as the ribbon.
Relative Strength Volume Adjusted Exponential Moving Avg [CC]The Relative Strength Volume Adjusted Exponential Moving Average was created by Vitali Apirine (Stocks and Commodities Feb 2022 pgs 14-18) and this is very similar of course to the last Relative Strength Exponential Moving Average . It works under the same concept with using overbought and oversold methods to adjust the moving average and with this particular version you will notice that sudden drops or increases won't follow super closely so this can be useful along with the other as a good complementary indicator to use with each other to determine the short and medium term trend and to give good entry and exit points. I have strong buy and sell signals in addition to normal ones so darker colors are strong and lighter colors are normal. Buy when the indicator line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Relative Strength Exponential Moving Average [CC]The Relative Strength Exponential Moving Average was created by Vitali Apirine (Stocks and Commodities Jan 2022 pgs 22-25) and this is a handy moving average that combines a typical overbought/oversold mechanic with an overall trend indicator. Even though the typical length is so large it reacts extremely quickly when the stock becomes overbought or oversold. Because of this the indicator by itself doesn't work as well during choppy periods so Vitali recommends using a moving average crossover system during choppy so do one indicator with the default length of 50 and use a different length of 10 so when the shorter length crosses over the longer length then buy and vice versa you would sell. Generally speaking buy when the line turns green and sell when it turns red. I have used strong buy and sell signals in addition to normal signals so strong signals are darker in color and normal signals are lighter in color.
Let me know if there are any other scripts or indicators you would like me to publish!
5min Williams Fractals scalping (3commas)Another strategy I'm learning Pine Script on. It is inspired by a MoneyZG youtube strategy called "Easy 5 Minute Scalping Strategy (Simple to Follow Scalping Trading Strategy)".
Again this is a one order per trade strategy compatible with the 3commas bot (works also with the free 3commas subscription). This strategy is based on the signals from Williams Fractals, taking the signals in reverse - red triangle indicates a bottom and hence we go long. The green triangle indicates a top so we go short. By default these signals are only accepted if they occur between the two Emas. However, you can also turn this off and when a WF signal comes in, only the current price has to be between the Emas. Stop loss is set to the current Ema slow and the take profit is a multiple of the distance to the slow ema.
Like previously I have added different filters as well as the ability to view essential things like the WF signal and Emas. I hope the script will help you to be more successful and if so it would be great if you could share here your setups, or tips on what would be good to refine to make it an even a more profitable strategy. Kind of a community approach so that we help each other out :).
Instructions for the 3commas connector:
1. First, you need to prepare 3commas Long/Short bots that will only listen to custom TV signals.
2. Inputs for the 3commas bot can be found at the end of the user inputs.
3. Once you have entered the required details into the inputs, turn on 3commas comments. They should appear on the chart (looks messy).
4. Now you can add the alert where you should paste the 3commas Webhook URL: 3commas.io
5. For the alert message text insert the placeholder {{strategy.order.comment}} and delete the rest.
6. Once the alert is saved, you can turn off those 3commas comments to have a clearer chart.
7. With a new alert, the bot and trade should launch.
In the near future I would like to publish more scripts that will carry similar elements as the first two, incl. compatibility with 3commas (I don't have access to another bot system). I will choose some strategies myself, but I will also be glad for some tips on what strategy would be good to do and is still missing here on Tradingview (short youtube videos or brief strategy manuals would be great).
Thanks and keep it up
PS: My screen values starting at Long Target Profit and ending at Pullback NOT greater than: 1.5; 1.5; 0; ON; 1; 2; OFF; 17; 36; ON; 0.05; ON; Chart; 14; 46; 50; 48.5; 51; OFF; 1; ON; 4; 2.
EMA Index Cross by Hassonya
While the indicator is working on any stock chart, it shows the two ema average breakdown/breakup of the index or any other stock with an arrow. In this way, you will be able to follow the ema intersections of the index chart while working on a normal stock chart.
I will add other moving average options if you like it.
I hope you will be satisfied using it.
TURKISH
------------
Gösterge, herhangi bir hisse senedi grafiği üzerinde çalışırken, endeksin veya başka bir hisse senedinin iki ema ortalama dağılımını/dökülmesini bir okla gösterir.
Bu sayede normal bir hisse senedi grafiği üzerinde çalışırken endeks grafiğinin ema kesişimlerini takip edebileceksiniz.
Eğer beğenirseniz başka ortalama seçenekleri de ekleyeceğim.
Güle güle kullanın.
Simple Ema_ATR Strategy HulkTradingSimple EMA strategy, based on ema55+ema21 and ATR(Average True Range) and it enters a deal from ema55 when the other entry conditions are met
Basically long and short conditions
If long:
1) close must be less than open (because we are searching for a pullback)
2) emaFast(21) must be bigger than emaSlow(55) - for a trend detection
3) Difference between emaFast and emaSlow must be greater than ATR(14) - for excluding flat
For short conditions are opposite
Stop levels and take profits, based on ATR multiplier.
You can change it in input field.
I recommended values between 1 and 4, not more.
This strategy was tested on pairs BTCUSDT and ETHUSDT and have a nice results.
Price Movement Trend By Alireza Phoenix (Logarithmic)hi Traders
This logarithmic indicator shows the price movement trend, which is designed based on logarithmic functions and moving averages.
The Price Movement Trend Display Composed By :
A leading line consisting of the natural logarithm of Running Moving Average with length 60 and Offset 20 , and is displayed in red line.
A signal line consisting of a natural logarithm of an exponential moving average of length 90 , and is displayed in green line.
A price line consisting of the natural logarithm of a simple moving average along 1 whose source is price close , and is displayed in blue line.
A hidden price line consisting of the natural logarithm of a simple moving average along 1 and its source being the highest and lowest average prices , and is displayed in maroon line.
Learning how to get a signal from the price Movement trend indicator:
Moving the signal line and breaking the leading line upwards to form a green cloud is a buy signal.
Moving the signal line and breaking the leading line downwards that forms a red cloud is a sell signal.
Moving the price line and breaking the trend cloud upward , is a buy signal
Moving the price line and breaking the trend cloud downwards , is a sell signal
My instagram id : @pnxf6
ترجمه فارسی :
سلام تریدرها
این اندیکاتور لگاریتمی ، نمایش دهنده روند حرکتی قیمت است ، که بر اساس توابع لگاریتمی و میانگین های متحرک قیمت طراحی شده است
این اندیکاتور تشکیل شده از :
یک خط پیشرو متشکل از لگاریتم طبیعی متحرک وزنی نمایی مورد استفاده درآر اس آی به طول 60 و انحراف 20 است
یک خط سیگنال متشکل از لگاریتم طبیعی میانگین متحرک نمایی با طول 90
یک خط قیمت که متشکل از لگاریتم طبیعی میانگین متحرک ساده در طول 1 که منبع آن بسته شدن قیمت است.
یک خط قیمت مخفی که متشکل از لگاریتم طبیعی میانگین متحرک ساده در طول 1 و منبع آن میانگین بالاترین و پایین ترین قیمت است
یک فضای ابری مابین خط پیشرو و خط سیگنال که که با "نمایش روند حرکت قیمت" مشخص شده و در رنگ های سبز و قرمز قابل مشاهده میباشد.
آموزش گرفتن سیگنال ازاندیکاتور نمایش روند قیمت :
حرکت خط سیگنال و شکستن خط پیشرو رو به بالا که تشکیل ابر سبز رنگ میدهد یک سیگنال خرید میباشد .
حرکت خط سیگنال و شکستن خط پیشرو رو به پایین که تشکیل ابر قرمز رنگ میدهد یک سیگنال فروش میباشد .
حرکت خط قیمت و شکستن ابر روند حرکت قیمت رو به بالا سیگنال خرید میباشد
حرکت خط قیمت و شکستن ابر روند حرکت قیمت رو به پایین سیگنال فروش میباشد.
Indicator: SMA/EMA (Multi timeframes)This moving average indicator will plot the SMA or EMA sourced from a different timeframe on the current chart.
Applications:
Say you are viewing an hourly chart but you also want to know the ema20 sourced from a higher timeframe (i.e daily) of the same security. The problem with using most built-in indicators is that the MA values are usually calculated from the current chart, so to do that, you will have to toggle between 1h/1D. This script will eliminate this hassle by plotting out the desired alternative timeframe on the same chart.
Dynamic settings
By default the alternative timeframe is 1D, but this can be customized further:
- 1 week chart -> plots out 1 month MA
- 1 day chart -> plots out 1 week MA
- 1 hour chart -> plots out 1 day MA
EMA PredictionThis script predicts future EMA values assuming that the price remains as configured (-50% to +50%).
RSI Cross [xaurr]This is simple but profitable rsi cross strategy, to find optimal values you can change rsi and ema periods.
Good Luck!
3GBH - Multiple MA'sIncluded in this indicator:
- Fast/Slow EMA's
- Fast/Slow SMA's
- Fast/Slow WMA's
- Fast/Slow HMA's
- Fast/Slow RMA's
-----
Use of of the type of Moving Averages.
Or use them all.
-----
User-friendly.
You can change all the inputs, they are labelled for ease-of-use.
You can toggle On/Off any or all of the options.
Know Sure Thing and EMA Strategy by JLXThis is a simple strategy based in Know Sure Thing indicator and an Exponential moving average,
Rules are as follow:
- You can go long when the KST cross signal bellow 0 and price closes above the target EMA
- You can go short when the KST cross signal above 0 and price closes bellow the target EMA
I include a trailing stop loss, default its 0.5%
Hope you enjoy it