Bollinger Bands Trending Reverse StrategyWelcome to yet another script. This script was a lot easier since I was stuck for so long on the Donchian Channels one and learned so much from that one that I could use in this one.
This code should be a lot cleaner compared to the Donchian Channels, but we'll leave that up to the pro's.
This strategy has two entry signals, long = when price hits lower band, while above EMA, previous candle was bearish and current candle is bullish.
Short = when price hits upper band, while below EMA, previous candle was bullish and current candle is bearish.
Take profits are the opposite side's band(lower band for long signals, upper band for short signals). This means our take profit price will change per bar.
Our stop loss doesn't change, it's the difference between entry price and the take profit target divided by the input risk reward.
Média Móvel Exponencial (MME)
Stacked Moving AveragesThe Stacked Moving Averages indicator lets you see if a ticker is in an uptrend, downtrend, or no trend based on the condition of the moving averages. If the moving averages are stacked such that MA1>MA2>MA3>MA4>MA5, then that is described as an uptrend. If the moving averages are stacked such that MA5>MA4>MA3>MA2>MA1, then that is defined as a downtrend.
The moving averages can be SMA, EMA, or DEMA, and it’s possible to view all the moving average series in the chart or hide all series and only see if there is an uptrend or downtrend according to the condition.
Note: If length 4 OR length 5 is zero the MA4 OR MA5 will be ignored.
Background Color Based on EMAHello Traders,
this is a very simple script. It paints the background color based on the close price in reference to an exponential moving average.
If the close is above the EMA the background color will be green.
If the close is under the EMA the background color will be red.
You can adjust colors and the EMA period by yourself.
This little indicator script is just to get a better overview, for example in combination with other indicators.
Hope you guys like this script. Wish you a great trading week.
MACD + PSAR SetupThis indicator combines 3 elements:-
1. MACD which will act as a source of potential Buy Signal
2. PSAR which provides the confirmation for buy signal and for potential Buy on Dip Strategy
3. Breakout candles which provides the confirmation signal for Buy on Breakout strategy
4. The direction of the trend is provided by the Exponential Moving Average
The strategy is to have any counters which has triggered the MACD Golden Cross signal. These counters are to be out under watchlist for further confirmation.
The Buy Signal is confirmed when:-
1. Price is above EMA Direction(standard is set at 200)
2. PSAR has given the Buy Signal OR a Breakout Candle occurs.
Buy Signal is shown with a Green Diamond symbol whilst the Sell Signal is shown in Red Diamond Symbol.
The bullish and bearish condition is set via a green and red background
The MACD and PSAR codes are derived from the standard codes which is available in tradingview.
Reivaj MA - PreSession This script contains 9 moving averages which can be changed each between "sma", "ema", "wma", "vwma.
The values of the moving averages are:
MMA20 = SMA20
MMA50 = SMA50
MMA100 = SMA100
MMA200 = SMA200
MMA300 = SMA300.
MMAextra1 = ema 8
MMAextra2 = ema21
MMAextra3 = sma400
MMAextra4 = sma500.
It has an Asian range that goes from 21: 00-07: 00 UTC which turns the color of the candle in green.
And pre-sessions that is one hour before the opening, the time of the opening and the hour after the opening of London and New York.
Donchian Channels Trending Breakout StrategyThis script looks for two entry signals. Long is when the previous breakout of the donchian channels was a low, price is above the input EMA, current price is equal or higher than the upper band and we're not in a position yet. Short is the other way around, so previous breakout of the donchian channels was a high, price is below the input EMA, current price is equal or lower than the lower band.
I haven't found a script that does take the previous highs and lows into consideration. Works for any markets in any conditions because the stop loss and profit targets are based on the upper and lower band of the donchian channels, which means the stop loss and profit targets move with the trend.
For more details see the script itself, I wrote a ton of comments.
Color Changing Moving Average
Hello everybody!
I'm not much of a coder but I do make indicators for myself for fun sometimes and found this one super cool. Hope it helps!
Basically it's a moving average that changes colors based on the trend. How does it do it, you may ask? Simply put, it checks and makes sure that the open and close price is above the moving average, then it checks and sees if the 50-period RSI (length adjustable) is above 50. If both conditions are met, the moving average turns green. Simple as that.
If the price is below the moving average and the RSI is below 50, the moving average turns red.
If the price is above the moving average but the RSI is below 50, the line is grey and I advise to simply waiting for the trend direction to be decided. Likewise, if the price is below the moving average, but the RSI is above 50, the line is also grey.
This is NOT a comprehensive system, and the changing color of the moving average does not indicate a buy or sell signal. It simply indicates that the price is trending. You should use your own entry and exit strategy, such as the MACD, Wave Trend, Schaff Trend Cycle, etc.
As well, I would recommend waiting for confirmation of a trend change when the color changes, since in a range price can cross multiple times before deciding on the right direction.
The slope of the moving average can help too, since in a range the moving average is typically flat.
I would recommend using a fixed risk to reward ratio, to limit emotions. But, this would also help with a trend-following strategy due to the trend filter functionality.
The length of the moving average is adjustable, as well as the RSI period- though I wouldn't recommend selecting an RSI lower than 30 because it will whipsaw more. Disabling the EMA option will give you an SMA that does the same thing as the EMA. You can also disable the RSI filter and simply have a moving average that changes color when the price is above/below- but that's pretty boring, huh?
Anyways, hope this helps, happy trading everybody :)
Performante's Average Bitcoin Volume EMA Indicator This is the average Bitcoin volume with the data collected from the major retail exchanges + the exponential moving average (EMA) for the volume added on to better understand relative volume.
Thank you Julio!
EMA Ribbon - low clutter, configurable [aspiers]This script improves on many of the existing EMA ribbon scripts out there:
Reduces visual clutter with shorter labels / titles, and thinner, transparent lines which don't obscure the actual price chart
Two beautiful color gradients for up and down trends
All colors and EMA periods are fully configurable, using the new input grouping / inline features
Uses Pine Script v4, which makes it more future-proof and allows new functionality, e.g.
It allow configurable period resolution, e.g. so user can fix at day resolution even when chart is being viewed at hour or minute resolution (this is the default)
Code clean-up: remove redundant ternary conditionals, improve variable names
Allow smoothing threshold for changes in trend direction to be configurable
MACD Crossover trend strategy, Long and ShortHey everybody,
This is my first strategy and script I wrote mostly myself. There's tons of content out there to learn how to code in Pinescript and it's exactly what I wanted and needed in this time of my life.
In any case, I made a rather simple MACD crossover strategy that only takes trades in the direction of both EMA and SMA (there are inputs to change the length of the moving averages and lots of other stuff too).
If the MACD line crosses upwards on the signal line, while above the zero point of the histogram and the price is above EMA + SMA , it's a long signal.
If the MACD line cosses downards on the signal line, while below zero on the histogram and the price is below EMA + SMA , it's a short signal.
There are a lot of default variables that make no sense, for basically any symbol you're going to be looking at. You're going to have to adjust the EMA , SMA , backtest date, take profit, stop loss and all that good stuff yourself to find decently profitable parameters.
I made this myself because I couldn't really find a strategy out there that allowed for so much customizing and it's an easy way to get started in Pinescript.
If you have any suggestions, tips or you see a flatout mistake in my code, please let me know. I'm still learning, everyday and I'm enjoying every second of it.
EMA with RSI Backed Divergence BandsEMA200 with bands around it showing the effect of changes in RSI scaled by ATR . When the filling is green it indicates the bullish momentum and bearish when it is red.
exponential moving average + ATRThis script simplifies and gives more control to the user when using EMA with ATR in a bands form.
The default values has to be changed according to your plan.
Action Trend LineAction Trend Line is different of Moving Average between ema26 and ema260
My idea is, if ema26 drop to ema260 means downtrend
if ema26 increase or moving out of ema260 means uptrend
then writting a different line by 100 scale to be clear vision
at the bottom have plot sign up and down for each candle, it is status information
The chart show Action Trend Line, by 2 color and 2 sign at the bottom of chart.
If the line is growing up then color is green. you could know that is uptrend.
If the line is going down then color is red. you could know that is downtrend.
The triangle sign at the bottom of chart show trend folowing.
If previous and this line are uptrend, the triangle up and green color.
If previous and this line are downtrend, the triangle down and redcolor.
otherwise, the trend going to change it dosen't plot any sign, you cloud know warning the trend going to be change.
Must try and make you clearly understand.
Ripster EMA CloudsEMA Cloud By Ripster
EMA Cloud System is a Trading System Invented by Ripster where areas are shaded between two desired EMAs. The concept implies the EMA cloud area serves as support or resistance for Intraday & Swing Trading. This can be utilized effectively on 10 Min for day trading and 1Hr/Daily for Swings. Ripster himself utilizes various combinations of the 5-12, 34-50, 8-9, 20-21 EMA clouds but the possibilities are endless to find what works best for you.
“Ideally, 5-12 or 5-13 EMA cloud acts as a fluid trendline for day trades. 8-9 EMA Clouds can be used as pullback Levels –(optional). Additionally, a high level price over or under 34-50 EMA clouds confirms either bullish or bearish bias on the price action for any timeframe” – Ripster
Customizable MA RibbonAll credits to @Violent (www.tradingview.com) for making the original code! I just updated it by adding new features and themes!
---------------------------------------------
Lemon's Customizable MA Ribbon:
---------------------------------------------
A series of moving averages of different lengths that create a ribbon-like indicator. Traders can determine trend strength by lookin at the distance between the moving averages and the overall balance of the colored lines. Price movements through the ribbon can also be used to identify trend changes.
------------
FEATURES
------------
MA TYPES: SMA , EMA , WMA, RMA, ALMA, VWMA, HMA
Editable length
Editable start
User defined number of plots to show (between 1 to 32 total plots)
Multiple color theme choices
A color smoothing option.
Thank you and happy trading!
with love,
-Lemon
SPY Ninja
SPY Ninja correlates the true strength index exponential moving averages of SPY and VIX together. In doing so we can determine the start of trend shifts via SPY / VIX convergence in addition to crossover, with potential market entries and exits represented by the LONG and SELL signals.
SMMA 50,100, and 200 have been added to chart due to the historic SPY market reactivity to these moving averages. They often act as natural support and resistance levels with SPY, and when coinciding LONG and SHORT signals appear touching any of these levels, it adds an extra layer of confidence for traders' decisions. Also, by highlighting the areas on our SPY chart (red background areas) that represent a VIX threshold higher than 25, we can bring attention to areas with potentially higher volatility immediately so that traders know to proceed with caution.
SPY Ninja works harmoniously with the SPY Ninja Oscillator; Ninja provides the signals highlighting risky VIX areas of concern, while the Ninja Oscillator adds an additional 3 levels of potential confirmation for your trade decisions.
MA Trend MonitorMA Trend Monitor base on 3 Moving Average to define and display trend status on all time frame.
1. Calculate
* Fast Moving Average apply to High Price and Low Price
* Slow Moving Average apply to Close Price
* Trend defined by rule below:
- Up trend when Moving Average of Low Price moving above Moving Average of Close Price
- Down trend when Moving Average of High Price moving below Moving Average of Close Price
- Sideway when Moving Average of Close Price moving between 2 Moving Average of High and Low Price
2. Interface
* Color:
- Up trend: green
- Down trend: red
- Sideway: gray
* Fast Moving Average
- Default period: 20
- Moving Average Type: EMA/SMA
* Slow Moving Average
- Default period: 70
- Moving Average Type: EMA/SMA
* Line Resolution
- Number of Line: 13 (from 1 minute to 1 Month)
- Resolution of each line adjustable or disable.
LedgerStatusToolbox fork3: EMA/SMA that stays on a specific timeMy (akd) radically cut down fork#3 of the "Ledger Status Toolbox"
which had included many more options that I don't need
but was missing the 4hourly, and hourly = which I added here
and yes, I kicked out the weekly. Hardly ever looking at that anyways. Shall I reintroduce it for fork4 ?
The huge advantage of this approach, over other SMA/EMA indicators:
It stays on the chosen (e.g. daily) data, and calculates the moving averages for that data. Even if you switch the chart to different time candles (like hours or weeks).
So whatever time resolution candles you look at, these indicator lines stay in the same place.
Thanks to krogsgard. Check out his "Ledger Status Toolbox" it also has Bollinger bands (but those are always on "current" I think?). A very powerful tool, just too powerful for most times for me newb. So I cut it down to this mini version. Enjoy!
Adam Khoo Moving AveragesThis indicator will plot the simple and exponential moving averages Adam Khoo is also looking at for buying opportunities.
The best timeframe to use this indicator is the daily chart . The weekly moving averages are hard coded and don't change on any other timeframe. The other moving averages will show the values of your current timeframe.
In the settings you have the option to change the values of the moving averages and to show or not show the current timeframe moving averages or the weekly moving averages.
A label will also show the current value of all moving averages. To hide this label, go into the settings and click on 'Style' and at the bottom uncheck 'Labels'.
Happy trading ;-)
ema exhaustion (exa)The exa is an oscillator that combines fisher transform with distance from moving average and it is based on a theory that exhaustion can be derived from how far price is able to extend from a moving average, on average.
The fisher transform converts price into a gaussian normal distribution, also known as a bell curve {1}. A normal distribution is a type of probability distribution for a real-valued random variable {2}. Applying this method to the price of an asset can help to identify probabilities, but it will never identify certainties.
‘exa’ is an abbreviation for ema exhaustion. It can be used to identify when price is probable to revert to the mean but I prefer using it to confirm entries that are signaled following a reversion to the mean (aka buying the dip in bull markets). When price gets oversold into support, in a bull trend, then that can provide a good opportunity to enter long. However that isn’t necessarily the case when the same metrics indicate oversold conditions in a bear trend. In this situation the exa is best suited for identifying profit taking opportunities on shorts.
The default settings are a 9 lookback period and a 50 ema. By default signals will be derived from how far price is from the 50 ema relative to the probable distribution of the last 9 periods. If the exa is above 2, or below -2, then the price is in the 80th percentile of the prior 9 candles. Being outside of 3, or -3, represents the 90th percentile and 4, or -4, represents the 95th percentile.
Those ranges will never indicate a necessity of reverting to the mean, but they will indicate a higher and higher probability. I prefer to use this oscillator in combination with an indicator(s) that identifies the trend. When the oscillator reaches -2 in a bull trend then it can confirm long entry signals, whereas if it reaches +2 in a bull trend then it can be used to confirm signals to take profit.
Crossovers are especially significant because they indicate a shift in the tide. When the exa reaches 2 without crossing over then it is very much in a position to move to 3 or 4+. When it crosses above 2 then it is an indication that price is extended from the mean and exhausted.
This is certainly not a situation that implies price will revert to the mean, it simply provides confirmation.
The default settings are what I have been finding most effective personally, however that is mostly a function of the trend following tools that I use. The same principles should apply with all settings and I would encourage users to experiment with various lookback periods and emas.
{1} www.investopedia.com
{2} en.wikipedia.org
MA Crossover Alerts for Small Quick Profits on 3commas/DCA botDear fellow 3commas users,
This is a the most basic Moving Average crossover technique generating Buy Alerts.
This is especially written for those of you who want to link this basic crossover strategy with your 3commas DCA bot .
Buy Alerts
Moving averages available:
- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
- Weighted Moving Average (WMA)
- Hull Moving Average (HullMA)
- Volume Weighted Moving Average (VMWA)
- Running Moving Average (RMA)
- Triple Exponential Moving Average (TEMA)
Recommended settings for using with 3commas DCA bot:
Interval:
3m to 15m
3commas bot setup:
- TP/TTP: 0.3%/0.1%,
- Base Order: Your choice ,
- Safety Order: 1.2 * Base order
- Safety Order Volume Scale: 1.2,
- Safety Order Step Scale: 1.5,
- Max Active Deals: Your choice ,
- Price Deviation to Open Safety Order (% from initial order): 0.2%,
- Max Safety Trades Count: 7,
- Simulatenous Deals per Same Pair: 3
> Create Alert with Buy Alert and link it to your bot "Message for deal start signal"
34ema trend channelFirst of all, thanks to the first designer of this indicator, I just made some modifications to this favorite indicator.Please forgive me for my limited English!
First of all, I would like to say that the modification of King EMA index has given me a new trading experience. Four moving averages can be used for indicators, but I only used two because I think two are enough. These two moving averages are 34ema's high and low, which form a trend channel. When this channel runs downward, it is short trend; when the channel runs upward, it is long trend; when the channel runs horizontally, it is shock trend.
In fact, let's explain the presentation of AUD chart on the left。
1sell is the beginning of the downward trend. When we see the beginning of the trend, the shape of the K-line is a 4-hour downward trend, so we need to observe whether there is a short opportunity when the price rebounds to 2sell. The second is 3Sell and 4sell. They all have one thing in common, that is, they all have one or two k-lines falling and breaking a new low. At this point, when we go to observe the moving average channel, we find that it has become a short trend.
When the card short trend, we need to do is to follow the market to trade. Sell at high prices. When the price does not reach a new low after 6sell, we should be alert because the low point is rising. When 1buy breaks through 6sell, the high point needs to pay attention to whether the trend has changed,
So how to confirm whether the trend has changed from short to long? We can see that when 2buy stepped back on the moving average channel, there was a buying reaction, which is a good confirmation signal. And 2buy-5buy are all low points rising. When 6buy appears, the price rises rapidly and becomes a bigger bull market. That's the power of trends. Specific operation I can explain in Chinese, foreign friends hope to be able to translate and understand.
Now let's talk about how to set indicators.
After opening the indicators, we can see that the first line to the fourth line is the display and hiding of the moving average. I only choose to check direction and dragging direction, which are the channel moving average. They are also the more useful moving average channels for large-scale trend trading.
Then comes the volatility zone, which is the choice of colors in the moving average channel. You can choose the color you like. So what I see in the chart is that I only checked the three options of direction lagging direction vvolatility zone, and set their colors.
首先我想说的是感谢这个指标最初的设计者提供了源码,我只是针对指标的修改,使我获得了一种新的交易体验。指标是可以使用4条均线的,但我其实只用了两条,因为我觉得两条就够用了。这两条均线就是34EMA的HIGH和LOW,这两条均线组成了一条趋势渠道,当这条通道向下运行时为空头趋势,当通道向上运行时为多头趋势,当通道横向运行时为震荡趋势。
其实,我们对于左侧AUD图表的演示作一个解释:
1SELL为下跌趋势的开始,当我们看到趋势开始时K线的形态是4小时的大阴线向下跌,所以我们需要观察价格在反弹到2SELL的时候是否有做空机会。其次是3SELL和4SELL 它们都有一个共同点,就是全部都是1根或两根K线就向下跌,并且破了新的低点。此时我们再去观察均线通道时,发现它已经成为了空头趋势。
当牌空头趋势时,我们需要做的就是跟随市场去交易。逢高卖出。而当6SELL之后价格没有创新低时,我们就应该产生警觉,因为低点在抬高,而当1BUY突破6SELL时,高点在抬高时就需要注意趋势是否已经转变,
那么如何确认趋势是否已经由空头转为多头呢?我们可以看到2BUY时回踩到均线通道时出现了买盘反应,这种反应就是比较好的确认信号。并且2buy-5buy都是低点在抬升,当出现6BUY时,价格又快速拉升成为一个更大的牛市。这就是趋势的威力。具体操作我可以用中文解释,国外的朋友希望可以翻译理解。
下面我们先来说一下指标如何设置。
打开指标之后我们可以看到第一行至第四行是均线的显示与隐藏,而我只选择勾选Direction和lagging direction 这两条就是通道均线,也是大级别趋势交易较为好用的均线通道。
然后就是Volatility zone这是对于均线通道内颜色的选择。这个大家可以随意选择自己喜欢的颜色。所以图表中看到的就是我只勾选了DIRECTION LAGGING DIRECTION VVOLATILITY ZONE这三个选择,并对其颜色进行了设置。
下面我用中文好好来说一下我对这指标的一些使用心得:
1,当通道表现为空头趋势时,只能选择逢高卖出。利用价格回到通道边缘或内部的时候进行买出,止损在通道上方。
2、当价格向上突破通道时,选择空头止损离场,然后等待多头的入场机会。
3、当价格突破下跌的通道时,价格回踩到通道上沿时选择止跌买入。预期后面的多头趋势,但上破通道有一个硬性的要求就是必须突破最近的下跌趋势拐点,形成更高的高点。
4、随着时间的演变,趋势从下跌演变成上涨时,并且低点在抬高,高点也在抬高时,为明显多头趋势,此时只适合逢低买入。
5、什么算低点呢?就是当价格跌到通道上沿或通道里面时可以选择买进。
6、如果价格向下跌破趋势通道但快速收回通道时不算有效跌破,因为必须两根同色K线收盘在下方时才算跌破趋势通道,否则我都认为是主力机构在制作空头陷阱。
所以当你看到一根PINBAR或者是刺透双K线时都算是假破位诱空。
然后是右图上方的XAU 4H错误示例,因为趋势下破了低点,但同时也上破了高点,所以趋势是不明显的,即使从图中可以看到是震荡下跌行情,但均线最怕的就是震荡行情,不管是震荡上升还是横向又或者是下跌,都是不灵的。
所以当大级别左侧为下跌行情时,不要被小级别的反弹趋势通道短期向上就觉得应该考虑做多,其实我们更应该顺势而为。
尽管做为后知后觉者,我们也能吃到趋势的中间部分,不会在场外看着不敢入场。
那么趋势通道做XAU真的就不行吗?答案不是的,只是因为你选择的周期不对,用均线做交易有一个诀窍就是图表周期总有一个适合通道的,如果4小时是震荡下跌,那小时就会更加明显,所以只有选择通道适合的周期才能事半功倍,而不是用通道去选择合适的行情。
当然,用均线通道去做单边的行情是最好不过,但不要忘记,行情走势有70%的时间都是震荡的,只有30%的时间是单边的。
所以如果我们把XAU切换成为小时级别的走势时,你会发现,趋势当通道处于空头排列时,逢高卖出并不是不可以。同是也能看到多空转换时的回踩动作,就比如AUD 4H 和XAU 1H图表在多空转换的时候都有异曲同工之妙,市场绝大多数多空转换的时候就是这样子的。