MACD histogram relative open/closePrelude
This script makes it easy to capture MACD Histogram open/close for automated trading.
There seems to be no "magic" value for MACD Histogram that always works as a cut-off for trade entry/exit, because of the variation in market price over time.
The idea behind this script is to replicate the view of the MACD graph we (humans) see on the screen, in mathematics, so the computer can approximately detect when the curve is opening/closing.
Math
The maths for this is composed of 2 sections -
1. Entry -
i. To trigger entry, we normalize the Histogram value by first determining the lowest and highest values on the MACD curves (MACD, Signal & Hist).
ii. The lowest and highest values are taken over the "Frame of reference" which is a hyperparameter.
iii. Once the frame of reference is determined, the entry cutoff param can be defined with respect to the values from (i) (10% by default)
2. Exit
To trigger an exit, a trader searches for the point where the Histogram starts to drop "steeply".
To convert the notion of "steep" into mathematics -
i. Take the max histogram value reached since last MACD curve flip
ii. Define the cutoff with reference to the value from (i) (30% by default)
Plots
Gray - Dead region
Blue - Histogram opening
Red - Histogram is closing
Notes
A good value for the frame of reference can be estimated by looking at the timescale of the graph you generally work with during manual trading.
For me, that turned out to be ~2.5 hours. (as shown in the above graph)
For a 3-minute ticker, frame of reference = 2.5 * 60 / 3 = 50
Which is the default given in this script.
Ultimately, it is up to you to do grid search and find these hyperparams for the stock and ticker size you're working with.
Also, this script only serves the purpose of detecting the Histogram curve opening/closing.
You may want to add further checks to perform proper trading using MACD.
Convergenza/Divergenza di medie mobili (MACD)
MACD exit % indicatorIntroduction
An exit indicator for MACD, good for triggering order exit via MACD.
It works by considering and the .
Then, it just exits when the % change in these values surpasses a threshold.
Indicators
blue line - MACD
orange line - Signal
green/red columns - Histogram
aqua background - Last Histogram Flip
fuchsia background - Max abs(Histogram) value after last flip
orange Background - Exit region
{INDYAN} RSI + MACDModded RSI and MACD for intraday use. If rsi above 60 and macd is above zero line then go for buy and if rsi is below 40 and macd below zero line then go for sell side. use it in small timeframe i.e. 3 minute or less.
better for scalp trading
Happy Trading
Love INDYAN
#It can be used best with INDYAN Go With Trend
Volume-Weighted Elder Impulse SystemThis is a volume-weighted version of the Elder Impulse System. The Elder Impulse System utilizes the MACD along with EMA13(in general) to find the optimal entry and exit points. In this version, the MACD and EMA have both been changed into a Volume-weighted version. With volume involved, the indicator is, in general, faster than the original Elder Impulse system, in showing entry and exit points.
DMA: Moving Average of OscillatorTechnical Indicator Moving Average of Oscillator (Moving Average of Oscillator OsMA) is the difference between the oscillator and oscillator smoothing. In this case, an oscillator is used the basic MACD line and the smoothing of the signal.
Calculate:
OSMA = MACD - SIGNAL
MACD = EMA(CLOSE, 12) - EMA(CLOSE, 26)
SIGNAL = EMA(MACD, 9)
Combing in MACD and MTFHi all, I'm trying to wedge in the MACD into a multiple timeframe. Scope is to create:
1) an alert when the MACD across all timeframes is positive,
2) an alert when the MACD across all timeframes is negative, and
3) one when neither of them is applicable.
Would anyone be so kind to give it some thoughts, please?
//@version=2
strategy(" Easy MTF Strategy", overlay=false)
TF_1_time = input("3", "Timeframe 1")
TF_2_time = input("5", "Timeframe 2")
TF_3_time = input("15", "Timeframe 3")
TF_4_time = input("30", "Timeframe 4")
fastLen = input(title="Fast Length", type=integer, defval=12)
slowLen = input(title="Slow Length", type=integer, defval=26)
sigLen = input(title="Signal Length", type=integer, defval=9)
= macd(close, fastLen, slowLen, sigLen)
width = 5
upcolor = green
downcolor = red
neutralcolor = blue
linestyle = line
TF_1 = security(tickerid, TF_1_time, open) < security(tickerid, TF_1_time, close) ? true:false
TF_1_color = TF_1 ? upcolor:downcolor
TF_2 = security(tickerid, TF_2_time, open) < security(tickerid, TF_2_time, close) ? true:false
TF_2_color = TF_2 ? upcolor:downcolor
TF_3 = security(tickerid, TF_3_time, open) < security(tickerid, TF_3_time, close) ? true:false
TF_3_color = TF_3 ? upcolor:downcolor
TF_4 = security(tickerid, TF_4_time, open) < security(tickerid, TF_4_time, close) ? true:false
TF_4_color = TF_4 ? upcolor:downcolor
TF_global = TF_1 and TF_2 and TF_3 and TF_4
TF_global_bear = TF_1 == false and TF_2 == false and TF_3 == false and TF_4 == false
TF_global_color = TF_global ? green : TF_global_bear ? red : white
TF_trigger_width = TF_global ? 6 : width
plot(1, style=linestyle, linewidth=width, color=TF_1_color)
plot(5, style=linestyle, linewidth=width, color=TF_2_color)
plot(10, style=linestyle, linewidth=width, color=TF_3_color)
plot(15, style=linestyle, linewidth=width, color=TF_4_color)
plot(25, style=linestyle, linewidth=4, color=TF_global_color)
exitCondition_Long = TF_global_bear
exitCondition_Short = TF_global
longCondition = TF_global
if (longCondition)
strategy.entry("MTF_Long", strategy.long)
shortCondition = TF_global_bear
if (shortCondition)
strategy.entry("MTF_Short", strategy.short)
strategy.close("MTF_Long", when=exitCondition_Long)
strategy.close("MTF_Short", when=exitCondition_Short)
Basic BIASBasic BIAS
Deviation rate (bias), also known as deviation rate, or y-value for short, is an indicator to reflect the deviation degree between the price and MA in a certain period of time by calculating the percentage difference between the market index or closing price and a moving average, so as to obtain the possibility that the price will reverse or rebound due to deviation from moving average trend in case of severe fluctuation, and that the price will move within the normal fluctuation range Form the credibility of continuing the original potential.
The deviation rate is a percentage of the deviation degree (gap rate) between the price and ma.
The departure rate curve (bias) is a curve that connects the values of each bias into a line and obtains a wave extension curve with the value of 0 as the horizontal axis.
MacD 200 Day Moving Average Signal Crossover StrategyThis works on most time frames, but I noticed the 4 hour for BTCUSD on coinbase seems to work well as an example. The strategy is pretty simple. I was inspired by a youtube video that said to backtest their strategy so I did. Most of the time it doesn't work but sometimes it's pretty good as in the case I showed.
Basically, you buy if the MacD crossers over the signal line and the histogram is below 0 and you are above the 200 day moving average. Do the opposite to sell!
Fear And Greed IndicatorThe Fear And Greed Indicator is a very popular indicator on the Bloomberg platform and since I didn't have actual source code to work with, this is a very close approximation of that indicator. Let me know if you spot any discrepancies with the original and I will do my best to fix them.
For buy and sell signals it is pretty straightforward. Just buy when the green (greed) is in control and sell when the fear (red) is in control
This was a special request so let me know if you want to see more scripts from me or if you want something custom!
MACD with divergence signalsIts an MACD indicator which highlights places where macd and signal line cross and hidden divergence ocures.
Logic behind it is to check if we have hidden divergence when crossing of that two lines and if above EMA200 (signal for BUY - green) or if below EMA200 (signal for SELL - red).
You can change lenght of EMA but i think 200 is a simpliest trend indicator.
CDC ActionZone V3 2020## CDC ActionZone V3 2020 ##
This is an update to my earlier script, CDC ActionZone V2
The two scripts works slightly differently with V3 reacting slightly faster.
The main update is focused around conforming the standard to Pine Script V4.
## How it works ##
ActionZone is a very simple system, utilizing just two exponential moving
averages. The 'Zones' in which different 'actions' should be taken is
highlighted with different colors on the chart. Calculations for the zones
are based on the relative position of price to the two EMA lines and the
relationship between the two EMAs
CDCActionZone is your barebones basic, tried and true, trend following system
that is very simple to follow and has also proven to be relatively safe.
## How to use ##
The basic method for using ActionZone is to follow the green/red color.
Buy when bar closes in green.
Sell when bar closes in red.
There is a small label to help with reading the buy and sell signal.
Using it this way is safe but slow and is expected to have around 35-40%
accuracy, while yielding around 2-3 profit factors. The system works best
on larger time frames.
The more advanced method uses the zones to switch between different
trading system and biases, or in conjunction with other indicators.
example 1:
Buy when blue and Bullish Divergence between price and RSI is visible,
if not Buy on Green and vise-versa
example 2:
Set up a long-biased grid and trade long only when actionzone is in
green, yellow or orange.
change the bias to short when actionzone turns to te bearish side
(red, blue, aqua)
(Look at colors on a larger time frame)
## Note ##
The price field is set to close by default. change to either HL2 or OHLC4
when using the system in intraday timeframes or on market that does not close
(ie. Cryptocurrencies)
## Note2 ##
The fixed timeframe mode is for looking at the current signal on a larger time frame
ie. When looking at charts on 1h you can turn on fixed time frame on 1D to see the
current 'zone' on the daily chart plotted on to the hourly chart.
This is useful if you wanted to use the system's 'Zones' in conjunction with other
types of signals like Stochastic RSI, for example.
MACD crossover while RSI Oversold/OverboughtThis indicator draws signals on the chart when a Bullish MACD Crossover occurs at the same time RSI is "oversold", and also when Bearish MACD Crossover occurs at the same time RSI is "overbought"
Indicators are drawn on the chart in the following scenarios:
1. Bullish signal
a. MACD bullish crossover occurs on a single bar
b. RSI was below the Oversold threshold (29 by default) within the prior 5 bars
2. Bearish signal
a. MACD bearish crossover occurs on a singnle bar
b. RSI was above the Overbought threshold (71 by default) within the prior 5 bars
AverageTrueRangeConvergenceDivergenceV1sloth288Simple indicator with the thought of merging MACD and ATR. The idea has come from trying to find a way to define sideways markets. Whipped this up quickly to explore the idea.
Feel free to throw in suggestions or even mention other open source indicators that define sideways markets well.
Simple instructions
If histogram green, breakouts/trade zone.
If histogram red, sideways/keep out.
Trend Checker by Hally - IndicatorIt is an indicator that overlaps MACD and Stochastics.
It has both characteristics.
The trend changes when two lines intersect.
I think the reaction is bad in the range market.
Also, when there are Stochastics and MACD lines above the indicator, it is possible to think whether it is overbought while riding the trend, and it may be helpful for making decisions such as "maybe it will reverse soon". Hmm.
Also, I think it is better to use it in combination with other indicators.
This is my first pine script, and I couldn't find it even if I searched for the script with overlapping indicators of different scales, so I tried making it by trial and error.
I hope it helps somebody trying to do the same.
MACDとStochasticsを重ね合わせたインジケーターです。
それぞれの特徴を併せ持っています。
2本のラインが交差する時トレンドが変化します。
レンジ相場では反応が悪いと思います。
また、インジケーターの上の位置にStochasticsとMACDラインがあるときはトレンドに乗りながらも買われすぎかどうか考えられることが出来ますし、「そろそろ反転するかも」などの判断の助けになるかもしれません。
また、他の指標との併用して使うほうが良いと思います。
pineスクリプトは初めてで、異なるスケールのインジケーターを重ね合わせていスクリプトは探しても見つからなかったので試行錯誤で作ってみました。
同じようなことをやろうとしてる誰かの参考になれば幸いです。
Simple Mobile Averages y MACDScript designed for users who need more than 3 indicators. It has 3 programmable "Simple Mobile Averages". MACD integrated in the main panel, also programmable.
MACRS {Lite}This is the open-source stripped down version of the full-featured RSI-MACD indicator (MACRS), with the ADO and the option to filter out weekend price action removed.
The main oscillator is the RSI modulated by the MACD (default). The RSI mode can be disabled to revert to a normal MACD oscillator for the main oscillator.
When the main oscillator (thicker line) is > 0, it is green; and if it is < 0, it is red.
The MACD can be re-scaled and whenever its value > 100, a background fill between the oscillator and the zeroline appear to indicates overbought condition; and < -100 indicates oversold condition. The user can tweak the scaling factor to optimize this for a given chart and timeframe.
A (thick transparent light blue) volume oscillator is also provided. An increase in volume trend provides confirmation of (or solidifies) the movements in the main oscillator over that period. A falling volume oscillator trend raises doubts on the main oscillator trend, and hints of the possibility of a counter-trend (also look at the secondary ADO oscillator for clues).
The novel aspects and principles of this indicator and this source code are the property of © cybernetwork.
This indicator and script is free for the TV community to use.
ANTS BEAST MODE TRIX+MACD TRIX CROSSThis indicator is both the TRIX + MACD all in one inidicator -- a + sign is displayed whenever the trix crosses
MACD/ATRThis indicator is a restricted MACD .
I reached this with a little trick: I devided it by ATR . This way it is most of the time inside the -1..1 range. It depends on the length of the ATR's period. If it is greater, the probability of outliers is greater.
With this indicator you can use cerain levels of MACD and its histogram as a trigger.
Share with me if you found it useful.
StarbuxI made this in starbucks .
Bullish hammer trading signal algorithm
using MACD for trend determination and holding period.
DEMA Strategy with MACDThe Double Exponential Moving Average (DEMA) indicator was introduced in January 1994 by Patrick G. Mulloy, in an article in the "Technical Analysis of Stocks & Commodities" magazine: "Smoothing Data with Faster Moving Averages"
It attempts to remove the inherent lag associated to Moving Averages by placing more weight on recent values. The name suggests this is achieved by applying a double exponential smoothing which is not the case. The name double comes from the fact that the value of an EMA (Exponential Moving Average) is doubled. To keep it in line with the actual data and to remove the lag the value "EMA of EMA" is subtracted from the previously doubled ema.
DEMA is a very responsive system. A lot of signals can be generated only when trading with DEMA. In this strategy, I combined Dema buy-sell signals with MACD indicator. When you activate MACD confirmation from settings; When DEMA comes to long situation, the MACD histogram is checked to be positive.
Trend Trader Strategy with MACDThis is plots the indicator developed by Andrew Abraham in the Trading the Trend article of TASC September 1998
The strategy I use has already been published explicitly by HPotter, you can review the core code from there.
I have converted the existing strategy codes that have been published into the strategy and the result looks great but I noticed that the indicator performed too much in short periods like 1 minute and I thought it would be healthier to get MACD approval. MACD approval will come selected by default. When the indicator reaches the buy status, if the macd histogram is positive, it enters the long process. By removing this confirmation from the settings window, you can see the normal signal frequency of the indicator.
This strategy is mainly based on trend signals. In fact, I am publishing this strategy to use in alternating trading for Bear-Bull crypto coins.
What does the bear-bull comparison mean?
You can open the same chart in the ETHBEAR / USDT symbol as opposed to the ETHBULL / USDT symbol that appears on the chart. When BUY signal comes in bull symbol, SELL will come in bear symbol. When BUY signal comes in bear symbol, SELL will come in bull symbol. In this way, very fast and very high profit can be obtained by alternating operation.