EMA CrossoversUseful for identifying and receiving alerts about uptrends and downtrends.
This script uses two Exponential Moving Averages (EMAs) to find price uptrends and downtrends. An Exponential Moving Average (EMA) is a type of moving average that places a greater weight and significance on the most recent data points. The script produces uptrend and downtrend signals based on crossovers and divergences between the two EMAs, the user will be able to spot a trend change (when the EMAs crossover) and to determine the strength of the current trend (when the EMAs diverge). It is also posible to get alerts for uptrends and downtrends on the web and mobile app with sound and pop-ups as well as via email. The optimal time to enter and exit the market can be concluded from this trend changes.
The user can set their own EMAs, by default they are set to 21 and 55 periods for medium and long term respectively. When the medium term EMA crosses below the long term EMA the asset is in a downtrend and the price will decline, and when the medium term EMA crosses above the long term EMA the asset is in an uptrend and price will increase.
This scripts plots the following indicators and signals on the chart to help the user to identify trends:
1.- Medium and long term EMAs as lines overlaid on the price chart.
2.- Up green triangles above bars when the price is on an uptrend and down red triangles below bars when the price is on a downtrend.
3.- Arrows with text to indicate the start of an uptrend or downtrend.
The user can enable and disable the indicators and signals as well as set colors and shapes to their liking.
This script also lets the user create alerts for uptrends and downtrends. To create a new alert using this script follow this instructions:
1.- Once you added this script to your chart, go to the alerts panel (right on web or bottom tool bar on the mobile app) and add a new alert (alarm clock icon with a plus sign).
2.- A modal window will open. On the “Condition” dropdown menu select “EMA Crossovers”.
3.- On the next dropdown menu (right below the “Condition” one) you can select from two types of alerts “Uptrend started” and “Downtrend started”.
4.- Lastly you can set all the normal alert options and create the alert.
Crossover
Krown Moving Averages & Crossover LevelsIntroducing Krown Moving Averages with Crossover levels.
This indicator
Plots 5 Ema's and 3 SMA's ( Default Krown Periods )
It calculates the price levels at which each pair of moving averages would be equal .
That means that if price closes the other side of that level the pair of moving will cross also.
These levels can therefore be considered as " crossover levels....( the price level where each pair of moving averages will cross)
It can give crossover levels for
SMA crossing SMA
EMA crossing EMA
EMA crossing SMA
Plots optional Labels for all crossover levels....(off by default needs to be turned on in the settings)
Plots optional crossover levels as lines and dots colored as the 2 colors of the pair of moving averages.....(off by default needs to be turned on in the settings)
This indicator is aimed at traders who use simple and exponential moving average crossovers as part of their trading plan or edge.
It takes the guesswork out of knowing at what price level a pair of moving averages will cross which helps to improve entries and risk management.
There is an optional "Cutoff" function and user adjustable "limit factor" which cuts the plots off once they are too far below or above the current price to prevent chart auto focus issues.
There is a decimal place truncation option to set the decimal places depending on the asset type and price accuracy required.
Inspired by a request from a community member after one of my recent reverse engineered indicator publications.
I am publishing this open source in the hopes that some newer coders will find the functions interesting and useful.
Equal-Length EMA/SMA Crossover Momentum Signal V1Overview:
This momentum and trend-following strategy captures the majority of any trending move, and works well on high timeframes.
It uses an equal-period EMA and SMA crossover to detect trend acceleration/deceleration, since an EMA places a greater weight and significance on the most recent data.
This version is optimized for longs, and designed to cut your losses quickly and let your winners run.
To reduce noise and optimize entries, we combined this with an overall trend bias for further confluence.
How it works:
Signals are determined by the crossover of an EMA and SMA of the same length, e.g. EMA-50 and SMA-50.
The overall trend bias is determined using a slower SMA golden/death cross, e.g. SMA-50 and SMA-100.
The signal is stronger when it occurs in confluence with the overall trend bias, e.g. when EMA-50 crosses over SMA-50, while above the SMA-100. This is analogous to only opening long positions in a bull market.
Signal description:
Trend Buy: EMA crosses above SMA, and overall trend bias is bullish. Buying is in confluence with the overall trend bias.
Risky Buy: EMA crosses above SMA, and overall trend bias is bearish. Buying is early, more risky, and not in confluence with the overall trend bias.
Late Buy: SMA crosses above BIAS_SLOW. This gives further confirmation of bullish trend, but signal comes later.
Sell: EMA crosses under SMA.
AM_ZLWMA Crossover_xDear All,
Please find updated version of Zero lag WMA crossover. In addition to this added 20/50 EMA to get better results.
Settings:
ZLWMA = 8 identified by Blue line
Fast WMA = 21 identified by Red line
EMA Period 20/50
How to Trade:
Buy: Wait for positive crossover (Blue cross above Red) to happen trade can be taken there but to get better results post crossover once price move above EMA 20 then buy can be initiated.
Sell: Wait for negative crossover (Blue cross below Red) to happen trade can be taken there but to get better results post crossover once price move below EMA 20 then sell can be initiated.
Reason to wait for confirmation of price action above / Below moving average is most of the time it happens that even after crossover happens sometimes it was just a pull back and from there it could be a possibility for reversal. Once price action confirms moving above / below EMA20 then trade will be initiated.
Please comment and ask for any doubt
On Chart Anticipated Moving Average Crossover IndicatorIntroducing the on chart moving average crossover indicator.
This is my On Chart Pinescript implementation of the Anticipated Simple Moving Average Crossover idea.
This indicator plots 6 user defined moving averages.
It also plots the 5 price levels required on the next close to cross a user selected moving average with the 5 other user defined moving averages
It also gives signals of anticipated moving average crosses as arrows on chart and also as tradingview alerts with a very high degree of accuracy
Much respect to the creator of the original idea Mr. Dimitris Tsokakis
Moving Averages
A moving average simplifies price data by smoothing it out by averaging closing prices and creating one flowing line which makes seeing the trend easier.
Moving averages can work well in strong trending conditions, but poorly in choppy or ranging conditions.
Adjusting the time frame can remedy this problem temporarily, although at some point, these issues are likely to occur regardless of the time frame chosen for the moving average(s).
While Exponential moving averages react quicker to price changes than simple moving averages. In some cases, this may be good, and in others, it may cause false signals.
Moving averages with a shorter look back period (20 days, for example) will also respond quicker to price changes than an average with a longer look back period (200 days).
Trading Strategies — Moving Average Crossovers
Moving average crossovers are a popular strategy for both entries and exits. MAs can also highlight areas of potential support or resistance.
The first type is a price crossover, which is when the price crosses above or below a moving average to signal a potential change in trend.
Another strategy is to apply two moving averages to a chart: one longer and one shorter.
When the shorter-term MA crosses above the longer-term MA, it's a buy signal, as it indicates that the trend is shifting up. This is known as a "golden cross."
Meanwhile, when the shorter-term MA crosses below the longer-term MA, it's a sell signal, as it indicates that the trend is shifting down. This is known as a "dead/death cross."
MA and MA Cross Strategy Disadvantages
Moving averages are calculated based on historical data, and while this may appear predictive nothing about the calculation is predictive in nature.
Moving averages are always based on historical data and simply show the average price over a certain time period.
Therefore, results using moving averages can be quite random.
At times, the market seems to respect MA support/resistance and trade signals, and at other times, it shows these indicators no respect.
One major problem is that, if the price action becomes choppy, the price may swing back and forth, generating multiple trend reversal or trade signals.
When this occurs, it's best to step aside or utilize another indicator to help clarify the trend.
The same thing can occur with MA crossovers when the MAs get "tangled up" for a period of time during periods of consolidation, triggering multiple losing trades.
Ensure you use a robust risk management system to avoid getting "Chopped Up" or "Whip Sawed" during these periods.
Momentum Strategy [MA Crossover + Squeeze Release + Alerts]This is a Strategy with associated visual indicators and Buy/Sell/Close Alerts for the Squeeze Momentum Indicator .
Development Notes
-------------------------
This is a fork of LazyBear's Squeeze Momentum Indicator histogram with an added moving average crossover for multiple trade signal confirmation. Functionality for Multi-Timeframe Resolution was also enabled and code was updated for PineScript v4 compatibility.
Strategy Description
-------------------------
Enter trade when the active crossover period (identified by background crossover indicator/zone) correlates with a squeeze release (black to gray cross along midline). BUY Long if momentum in uptrend or SELL Short if in downtrend. Close trade when momentum reverses.
Alerts configured for entering Long/Short position and to Close order.
Designed to have only one open long or short position at a time (no pyramiding) with an associated close order for each.
Indicator Visuals
--------------------
Crossover zone background (green or red) based on last crossover direction (only buy orders are triggered in a buy zone and sell orders in a sell zone)
Moving average crossover line matches trend (buy upwards on green and sell downwards on red)
Buy (green circle) and Sell (red circle) signals at the point of crossover
Buy (green cross) and Sell (red cross) signals at squeeze release on the midline
Long (green arrow) and Short (red arrow) order label when every indicator is triggered together
Close (purple arrow) and label when either trend or crossover zone changes
Recommend backtesting with the resolution set to current timeframe to avoid repainting; no other known repainting. There is a current bug or flaw in the script where all the Close and some of the Long and Short orders are not executed by the strategy (this doesn't affect the visual indicators, only the strategy).
Note that the provided backtest result is based on a position sizing of 10% equity with 100k initial capital. The 15-minute timeframe performed the best, with the 30-minute a close second, and 5/45-minute tied for third. Profit/loss went into the red when expanding out to 2-hours or beyond. I suspect this could be improved upon if you follow the Alerts on the oscillator versus rely solely on the strategy (due to the aforementioned issue with all entry and exit positions not being depicted).
Disclaimer
Past performance may not be indicative of future results. Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting. This post and the script are not intended to provide any financial advice.
Script is currently protected (due to the extensive development in the strategy) to prevent the source from being copied and sold.
MACD Hybrid BSHMACD = Moving Average Convergence and Divergence
Hybrid = Combining the two main MACD signals into one indicator
BSH = Buy Sell Hold
This indicator looks for a crossover of the MACD moving averages (12ema and 26ema) in order to generate a buy/sell signal and a crossover of the MACD line (12ema minus 26ema) and MACD signal line (9ema of MACD line) in order to generate a completely seperate buy/sell signal. The two buy/sell signals are combined into a hybrid buy/sell/hold indicator which looks for one, neither, or both signals to be "buys." If both signals are buys (fast crossed above slow), a "buy" signal is given (green bar color). If only one signal is a buy, a "hold" signal is given (yellow bar color). If neither signal is a buy, a "sell" signal is given (red bar color). Note: MACD moving averages crossing over is the same thing as the MACD line crossing the zero level in the MACD indicator.
It makes sense to have the MACD indicator loaded as a reference when using this but it isn't required. The lines plotted on the chart are the 12ema and a signal line which is the MACD signal line shown relative to the 12ema rather than the MACD line. The 26ema is not plotted on the chart because the chart becomes cluttered, plus the moving averages crossing over is indicated with the MACD indicator.
This indicator should be used with other indicators such as ATR (1), RSI (14), Bollinger bands (20, 2), etc. in order to determine the best course of action when a signal is given. One way to use this as a strict system is to take a neutral cash position when a yellow "hold" signal is given, to go long when a
green "buy" signal is given, and to go short when a red "sell" signal is given. It can be observed that for many tickers and timeframes that green-yellow-green and red-yellow-red sequences are stronger signals than green-yellow-red and red-yellow-green signals.
Note: Chart type must be "bars" in order for the bar colorization to work properly
Moving Average 4 & 8 daily, on all timeframesThis script takes 2 of the most popular moving averages ( 4 & 8 SMA ) in one indicator and will allow you the set the resolution to any time frame you want. If you are day trading, but want to keep an eye on the daily 4 SMA and 8 SMA on your 5 min chart; this script will do the trick. You can also change the period for both MA's.
TeoTrading 38 - Moving Average Crossover - Long-ShortWith this indicator you can obtain the percent of gain / loss of each trade based on Moving Average Crossover.
Prints different types of moving Average: SMA , EMA , WMA and VWMA.
It is usefull to view in only few minutes differents crossovers.
The crossver´s in LONG Trades are indicated with:
"P": Positive Crossover. Open a Long Trade.
Green: Negative Crossover with gain. Close the Long Trade.
Red: Negative Crossover with Loss. Close the Long Trade.
The crossver´s in SHORT Trades are indicated with:
"N": Negative Crossover. Open a Short Trade.
Green: Positive Crossover with gain. Close the Short Trade.
Red: Positive Crossover with Loss. Close the Short Trade.
The Percents of gain and loss are indicated in the Labels.
Input Parameters:
Type of Trade: Long/Short.
Type_: Type of Moving Average.
PrintPrice: Enable open value print.
Fast: Fast Moving Average.
Slow: Slow Moving Average.
This indicator does not generate recommendations to buy or to sell. It was designed ONLY for educational purposes.
Bollinger Band Crossover SignalI'm a little surprised I couldn't find a BB crossover script on here since I've always used it on other charting software. So of course I had to write one in for TradingView.
Essentially what this script signifies are price breakouts when price crosses over the upper BB band. So what it shows is that market conditions are entering overbought territory.
Length is set to 20 and Standard Deviation is set to 2. These are the default settings.
The way I use the script is to identify breakouts in price, as well as a signal to start scaling out of a position if I am already in one.
Moving Average Cross Strategy early Closing This is my example for the Moving Average Cross Strategy with early Closing. You can modify the strategy for your individual setup and market.
I tested the strategy in DAX30 and SP55
% Sensitivity MA Cross [racer8]This is my third published indicator on % Sensitivity MA, if you're not familiar with it, go check out my first one.
This time its a cross between 2 % Sensitivity MAs.
Cross impro test by Canundo Crossover Crossunder Tick valuesThis is a script where I tried to check the following things:
Even thought the tick of an asset is, for example 0.5, there are calculated prices, like SMA's that have even more decimals. Leading to crosses happening that for example happen at the same price. Consequently triggering totally useless in side markets. What happens if SMA values are restricted to the tick resolution? (Option works on it's own or with a combination of the others.)
What happens if I set my own tick value, like 0.8 instead of 0.5, what will be the effect for calculated values that are used for crossings? Will tick sizes improve the success rate? (This option will work only when the first option is active.)
Can success rate, especially for sideway markets be improved when adding a spread between MA's, so that it triggers less in sideway markets? (Option works on it's own or with a combination of the others.)
First of all, I had a hard time to round prices properly when it needs to be dynamic and working for different assets with different amounts of decimal values in the tick. The solution is that abs(floor(syminfo.mintick)) will give you the amount of decimals a tick has. It works for all ticks that are at least lower than 10. I'm not sure how huge ticks are out there. I did not implement this solution at the end since I found another way to test it.
Findings:
The first option, when activated, takes out half the trades and raises the percent profitability by 8% so there is some effect. However, all of the tested options have less advantage than I hoped for but are nevertheless something worthy for sideway markets. The first option just forces the MA's from the example to use the tick resolution.
See these two images. One when the first option is off, the second when it's active.
The lines are the MA's with adjusted values, the crosses are the places of the MA's when left as is.
Here a screenshot of the third option set to the value 2 on the 1 minute XBTUSD chart.
The advantage is that less trades trigger that have a low change in price and so less trading fees will happen.
The disadvantage is that all options can implement some delay for a crossing since the crossing will trigger once a slightly bigger move into the direction was taken.
This test environment was not meant to be profitable but to test the effects.
Maybe someone finds it interesting or wanted to test the same, so here you can save some work.
Every single moving average (ALMA, EMA, HMA, KAMA, RMA, SMA...)So you may be looking at the graph and thinking "this is a mess", and I agree.
The purpose of this script is to plot in the same graph every single type of moving average that I could think of, so you can find the ones that are better for your timeframe and for your asset. Once you add it, disable those types that doesn't seem to serve your purpose, until you can select one you like.
The average types are: ALMA, EMA, HMA, KAMA, RMA, SMA, SWMA, VIDYA, VWAP, VWMA, and WMA. Each one is ploted two times (except SWMA and VWAP), one with a short period, and another with a long, both of which you can configure.
Finnie's RSI + 3EMA crossover + MFI + Vix Fix-added a medium and long term rsiEMA, in addition to the previous short term, except this time there's a visual crossover :)
-added CM Williams vix fix
-and finally just a general visual overhaul!
Adaptive MA CrossThis is part 5 of 11 in the system named Ninetales/Volt V2 you can find on Tradingview.
Add three values to test for Fast MA, and three for Slow MA and it will backtest a crossover strategy and show you the most accurate one.
Riley's Movement IndexBrief Description:
Riley's Movement Index is a new indicator developed and named after me.
RMI is quite interesting in that uses two lines to cross each other.
One line represents the bullish side of the market, and the other line represents the bearish side of the market.
A signal occurs when the two lines cross each other.
-------------------------------------------
Calculation:
Up
1. high > prev high?
2. If yes, then Up = (high - prev high)
3. If no, then Up = 0
Dn
1. low < prev low?
2. If yes, then Dn = (prev low - low)
3. If no, then Dn = 0
SumUp (n) = Sum of Up over n periods
SumDn (n) = Sum of Dn over n periods
Plot SumUp & SumDn lines.
-------------------------------------------
How to interpret a signal:
When SumUp > SumDn, market is bullish.
When SumUp < SumDn, market is bearish.
-------------------------------------------
Recommended setting:
I would suggest a setting of 10, the default setting.
-------------------------------------------
Enjoy, and smash that follow button!
CryptoSignalScanner - Advanced Moving Averages - Cross & RainbowDESCRIPTION:
With this script you can plot 6 moving averages.
You can decide which Moving Average you want to show or hide.
For every plot you can decide to display the Simple Moving Average ( SMA ) or Exponential Moving Average ( EMA ).
It provides CrossOver and CrossUnder labels when loading the script. Those labels you can show or hide.
You have the possibility to show or hide the rainbow colors. This rainbow function gives you a clear view of the current trend.
HOW TO USE:
• When one Moving Average crosses above another Moving Average it signals an uptrend.
• When one Moving Average crosses below another Moving Average it signals a downtrend.
• The higher to length of the Moving Average the stronger the trend.
FEATURES:
• You can show/hide the preferred Moving Averages.
• You can set the length, type and source for every Moving Average.
• You can show/hide the rainbow colors.
• You can show/hide the CrossUp labels.
• You can show/hide the CrossDown labels.
• You can set alerts for every Moving Average.
• Etc...
DEFAULT SETTINGS:
• MA1 => EMA5
• MA2 => EMA10
• MA3 => EMA20
• MA4 => SMA50
• MA5 => SMA100
• MA6 => SMA200
Simple Moving Average vs. Exponential Moving Average:
SMA and EMA are calculated differently. The exponential moving average ( EMA ) focuses more on recent prices than on a long series of data points, as the simple moving average required.
The calculation makes the EMA quicker to react to price changes and the SMA react slower. That is the main difference between the two.
One is not necessarily better than another. It comes down to personal preference. Plot an EMA and SMA of the same length on a chart and see which one helps you make better trading decisions.
Moving Average Trading Strategies:
The first strategy is a price crossover, when the price crosses above or below a moving average, it signals a potential change in trend.
The second strategy applies when one moving averages crosses another moving average.
• When the short-term MA crosses above the long-term MA, it signals a buy signal.
• When the short-term MA crosses below the long-term MA, it signals a sell signal.
REMARKS:
• This advice is NOT financial advice.
• We do not provide personal investment advice and we are not a qualified licensed investment advisor.
• All information found here, including any ideas, opinions, views, predictions, forecasts, commentaries, suggestions, or stock picks, expressed or implied herein, are for informational, entertainment or educational purposes only and should not be construed as personal investment advice.
• We will not and cannot be held liable for any actions you take as a result of anything you read here.
• We only provide this information to help you make a better decision.
• While the information provided is believed to be accurate, it may include errors or inaccuracies.
If you like this script please donate some coins to share your appreciation.
Good Luck,
SEOCO
MACD VWAP IndicatorThis indicator uses a combination of the VWAP, EMA 9 and parts of the MACD in order to detect a bullish or bearish trend.
How to trade it:
Set SL either below or above the VWAP line (orange) and TP to 1:1.5 ratio (depending on last few candles, of course).
If EMA200 is close by then place SL either below or above EMA200 (blue) and TP to 1:1.5 ratio
Important:
Best traded in 15M, 30M => Intraday.
Have fun! :)
MACD Crossover Trend IndicatorThis is a very simple " the trend is your friend " indicator - if you are consistent!
How this indicator works:
This indicator detects MACD Crossovers based on the current trend. It checks wether the current close price is above or below the 200 EMA and therefore decides whether we are in an up- or down trend.
UP-TREND: If the price is above the EMA200, the MACD is below 0 and crosses up the signal line, then this is a BUY signal!
DOWN-TREND: If the price is below the EMA200, MACD is above 0 and crosses down the signal line, then this is a SELL signal!
You can also add an alert, that keeps you informed, once one of these scenario happens for a certain pair!
With this indicator you will never enter against the trend.
Have fun! :)
MACD Crossover Trend IndicatorHow this indicator works:
This indicator detects MACD Crossovers based on the current trend. It checks wether the current close price is above or below the 200 EMA and therefore decides whether we are in an up- or down trend.
UP-TREND: If the MACD is below 0 and crosses up the signal line, then this is a BUY signal!
DOWN-TREND: If the MACD is above 0 and crosses down the signal line, then this is a SELL signal!
How to trade this:
First rule: Be consistent!
Second rule: You will have lost trades and losing streaks - deal with it!
First set the SL slightly below the last significant low (eventually add/subtract the ATR value to/from it)
Then adjust the TP and ALWAYS use a RR ratio of 1.5.
NEVER get out of the trade earlier
Take every possible trade!
Important: Money management is key... so be consistent!
Have fun! :)
[PX] External LevelHello everyone,
today I'd like to share a script, which enables you to use external logic to plot levels on your chart.
How does it work?
The concept is based on two scripts. One script, which uses an external input as a trigger to print a new level and one script that calculates an output, which will be fetched.
Sounds complicated? It really is not! Let's take a closer look.
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © paaax
//@version=4
study("RSI OS/OB")
l = input(14, "RSI Length")
ob = input(70, "Overbought")
os = input(30, "Oversold")
r = rsi(close, l)
hline(ob)
hline(os)
plot(r, "RSI", color=color.orange)
// The following plot produces an output, which will be fetched the "External Level"-script.
// It evaluates to one of the following three values: 1.0, -1.0 or 0.0
plot(crossover(r, ob) ? 1.0 : crossunder(r, os) ? -1.0 : 0.0, "Output", transp=100)
The example script above uses an RSI and two threshold levels (70 and 30). The logic here is, that whenever the RSI is crossing down the lower threshold or crossing up the upper threshold we'd consider the current movement to be either oversold or overbought. Therefore, it's a point of interest, which we could visualize with a level.
The script creates an output when the crossover or crossunder of a threshold happens. A crossover would result in a value of 1.0, a crossunder in a value of -1.0. In all other cases the value would be 0.0.
The output of the RSI script would then be used as an input of the External Level script, which has a "Source"-parameter in its input-section. If the fetched input shows 1.0, then the script prints a resistance level. If it shows -1.0 a support level will be printed. And that's basically it. A very simple approach to print levels on your chart with an infinite number of use cases.
For example, you could use fetch outputs from a MACD script, MA script, outputs based on volume or price movement. Just remember the output has to evaluate to either 1.0 or -1.0 and has to be selected in the input-section.
Hope that might be useful to some of you :)
Please click the "Like"-button and follow me for future open-source script publications.
If you are looking for help with your custom PineScript development, don't hesitate to contact me directly here on Tradingview or through the link in my signature :)
MA Crossover IndexJust 3 Moving Averages with adjustable settings, plus signals crossover between price and MA Media.
Types of MAs supported:
SMA, EMA, WMA, VWMA, SMMA, DEMA, TEMA, Hull/MA, ZEMA, TMA, SSMA
The signal is given when the price crosses the MA Average.
The random line only works on indices, it indicates that if the price exceeds it, the continuation of that movement is possible.
Option to place TP and SL recommended only on Indices.