[i]price
P-MACD by DGTPrice and Moving Averages Convergence/Divergence, shortly named as P-MACD
P-MACD is a trend-following momentum indicator that shows the relationship between Price and Long-term Moving Average (PMACD), and the relationship between two Moving Averages (MAMACD). P-MACD is composed of two lines, and an histogram, showing price distance (convergence/divergence) to its Long-term MA (PMACD), showing short-term MA distance (convergence/divergence) to long-term MA (MAMACD), and a histogram showing the difference (momentum) between the PMACD and MAMACD
The PMACD is calculated by dividing the Price to Long-term Moving Average (200-period SMA/EMA) and finally smoothed with 9-period SMA/EMA
- PMACD Line Formula : (Price / SlowMovingAverage -1) * 100 and smoothed with 9-period SMA/EMA
The MAMACD is calculated by dividing the Short-term Moving Average (such as 20 SMA/EMA) to the Long-term Moving Average (such as 200-period SMA/EMA)
- MAMACD Line Formula : (FastMovingAverage / SlowMovingAverage -1) * 100
The Histogram is calculated by subscripting PMACD and MAMACD
- Formula : PMACD - MAMACD
Optional
Trend Cloud calculated based on fast and slow version of MAMACD
What to look for:
- Line Crosses : PMACD Line can function as a trigger(signal) for buy and sell signals. Buy when the PMACD crosses above the MAMACD line and sell - or short - when the PMACD crosses below the MAMACD line
- Base Crosses : PMACD and/or MAMACD crosses above or below Baseline is another way to indicate the trend and momentum. MAMACD crosses of Baseline, MAMACD positive or negative, reflects short-term moving average crosses the long-term moving average and similarly, PMACD crosses of BaseLine, PMACD positive or negative, reflects price crosses a long-term moving average
- Momentum : P-MACD helps investors understand whether the bullish or bearish movement in the price is strengthening or weakening displayed with a histogram which graphs the distance between the PMACD and MAMACD. Additionally, upward momentum is confirmed with a bullish crossover, which occurs when PMACD and/or MAMACD crosses above Baseline. Conversely, downward momentum is confirmed with a bearish crossover, which occurs when PMACD and/or MAMACD crosses below Baseline
- Distance : Prices high above the moving average (MA) or low below it are likely to be remedied in the future by a reverse price movement. The more distant the PMACD is above or below its baseline indicates that the distance between the Price and its SMA is growing (regarding PMACD, You may find a detailed article explained in “Price Distance to its MA” indicator by DGT) . Similarly the more distant the MAMACD is above or below its baseline indicates that the distance between the two SMAs is growing
- Trend : A rising P-MACD indicates an uptrend, while a declining P-MACD indicates a downtrend
MACD vs. P-MACD
MACD measures the relationship between two MAs, while the P-MACD measures both the relationship between price and its MA, and the relationship between two MAs. MAMACD Line of P-MACD If set to same moving average type and same lengths as in MACD will produce the same line as MACD line, only values are represented as percentage with MAMACD. Both measure momentum in a market, but, because they measure different factors, they differentiate from each other even if they have similarities in presentation. P-MACD provides additional insights, not only to MA relation but also to Price and MA relation
Warning : Moving Average are calculated based on past prices, so they are lagging. The longer the time period for the moving average, the greater the lag as well as less sensitive to price changes. This study implements usage of 200-period long-term moving average, which implies that the P-MACD will provide insight especially for long-term trades, more suited for long-term trades, usage of P-MACD for short-term trades is recommend with lower timeframes (1H or lower).
Indicators aim to generate a potential signal/indication of an upcoming opportunity, but, the Indicators themselves do not guarantee the future movement of a given financial instrument, and are most useful when used in combination with other techniques.
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
Disclaimer : The script is for informational and educational purposes only. Use of the script does not constitutes professional and/or financial advice. You alone the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd tradingview user liable for any possible claim for damages arising from any decision you make based on use of the script
Price Distance to its MA by DGTPrices high above the moving average (MA) or low below it are likely to be remedied in the future by a reverse price movement as stated in an Article by Denis Alajbeg, Zoran Bubas and Dina Vasic published in International Journal of Economics, Commerce and Management
Here comes a study to indicate the idea of this article, Price Distance to its Moving Averages (P/MA Ratio)
The analysis expressed in the paper indicates that there is a connection between the distance of the prices to moving averages and subsequent returns : portfolios of stocks with lower prices to moving averages generally outperformed portfolios of stocks with higher prices to moving averages. This “overextended” effect is more pronounced when using shorter moving averages of 20 and 50 days, and is especially strong in short-term holding periods like one and two weeks. The highest annual returns are recorded when buying in the range of 0-5% below shorter moving averages of 20/50 days, and 0-10% below longer moving averages of 100/200 days. However, buying very far below almost all moving averages on almost all holding periods produces the lowest returns.
The concept of this study recognizes three different modes of action.
In a clearly established upward trend traders should be buying when prices are near or below the MA line and selling when prices move too far above the MA.
Conversely, in downward trend stocks should be shorted when reaching or going above the moving average and covered when they drop too far below the MA line.
In a sideways movement traders are advised to buy if the price is too low below the moving average and sell when it goes too far above it
Short-term traders can expect to outperform in a one or two week time window if buying stocks with lower prices compared to their 20 and 50 SMA/EMA, one to two-week holding periods is quite high, ranging from 72,09% to 90,61% for the SMA(20, 50) and 85,03% to 87,5% for the EMA(20, 50). The best results for the SMA 20 and 50, on average, are concentrated in the region of 0-5% below the MA for the majority of holding periods. Buying very far below almost all MA in almost all holding periods turns out to be the worst possible option
Candle patterns, momentum could be used in conjunction with this indicator for better results. Try Colored DMI and Ichimoku colored SuperTrend by DGT
Key price levelsFunction: labelling recent highs and lows automatically. Easy and clean.
In this example, we can see the previous low of the ticker is around 105.5, the previous high is around 120.
We can set up our entries and exits by referring to the last lows and highs.
Users can adjust the searching bar range by themselves.
LotSizeCalc_v1 (EUR)Hey there,
here I like to publish my first TradingView Script for the Indicator "LotSizeCalc" which calculates the LotSize for the currency '€' for e.g. the MT4-App depending on the following parameters:
- Stop Loss in pips (example: 30 pips)
- Account Balance in EUR (example: 500€)
- Risk in % (example: 1%)
It is very similar to the MyFxBook Calculator on their website, where you can compare the results for the lotsize.
You receive the calculated value next to the indicator, and - for mobile device - it also shows a label with the calculated lotsize (which you can deacivate via settings if you like).
The indicator works for the included common foreign Forex pairs (AUD, CAD, CHF, JPY, JPY, GBP, NZD, USD) in order to calculate the risk to a EUR-Trading Account.
Actually, the Script allows in general some adaptations due to your trading system. This one is the most basic version.
Happy pips and I wish you safe and risk-calculated trading!
Marcel :)
Price Continuation (The Strat)Shows the historic bar type, whether it is up, down, up and inside, down and inside, up and outside, or down and outside. Will only display historic bar type based on the selected time timeframe. (Ex. if you are looking at the weekly time frame, you will only see the bar type for Year, Quarter, Month, and Week. It will not display the Day or Hour bar type.)
PEG RatioHello everyone,
Quick script to check the PEG Ratio.
What is PEG Ratio?
The price/earnings to growth ratio (PEG Ratio) is a stock's price-to-earnings (P/E) ratio divided by the growth rate of its earnings for a specified time period. The PEG ratio is used to determine a stock's value while also factoring in the company's expected earnings growth, and is thought to provide a more complete picture than the more standard P/E ratio.
A PEG Ratio greater than 1.0 means that the stock is overvalued, while below 1.0 means is is undervalued. When the PEG Ratio is exactly 1.0, then the stock is trading at fair valuation.
Formula:
PEG Ratio = (Price / EPS) / EPS Growth
Examples:
Company A:
Price per share = $46
EPS this year = $2.09
EPS last year = $1.74
Company B
Price per share = $80
EPS this year = $2.67
EPS last year = $1.78
Company A
P/E ratio = $46 / $2.09 = 22
Earnings growth rate = ($2.09 / $1.74) - 1 = 20%
PEG ratio = 22 / 20 = 1.1
Company B
P/E ratio = $80 / $2.67 = 30
Earnings growth rate = ($2.67 / $1.78) - 1 = 50%
PEG ratio = 30 / 50 = 0.6
The company A is overvalued whiled the B is undervalued.
In this script an overvalued stock is considered when the PEG Ratio is above 1.1, while it is 0.9 for an undervalued stock.
Only works with Stocks.
Happy trading,
Indicator: Price Weight Oscillator [xQT5]This is my revision of AO (Awesome Oscillator) that can give more correct and early signals as on my opinion.
I'm used a original formula of AO and modified it with high and low prices adding.
Enjoy it!
Example - How to create multiple level gridsExample on how to create custom grids with variable N lines/labels:
RPI (Relative Price Index)This is a free indicator created by Stormpike Group that displays the relative price of an underlying for the given period.
Volatility (Body and Weighted Shadow)- Volatility Indicator
- Replacement for ATR
- As each pair holds a different level of volatility, a stop loss can be set using this indicator rather than via a ratio 2:1, etc. e.g. 2 X Volatility Value = S/L...
- This indicator averages the bodies of candlesticks over a default length of 14 periods. It also considers the length of shadows via a weighted average. This is done as it is assumed that financial institutions tend to move price to levels that do not hold (shadows). Therefore, wick lengths are less significant than the candlestick bodies, so they are weighted to hold less value.
Shadow MAShadow/Wick Moving Average
- Moving Average comparing top and bottom Shadow / Wick length
- Shadows represent price levels that have been hit, but did not close
- Not an all-purpose, all-in-one indicator for entry and exit
- Used as a visual aid to better understand price movement. For example. if price is bearish, but the Shadow MA is showing high, positive values, it is a sign that price is not tending to close at its highest point; therefore, there is bearish resistance.
- Can be used in combination with momentum oscillators and trend analysis.
Bitcoin East vs WestPlots the volume weighted price difference between the top spot exchanges in the "East" (Asian markets) versus the "West" (US/UK/EU markets).
Optional: view the volume difference between the two.
Bitcoin Halving CountdownHello traders,
I offer you today the BTC halving countdown updated in real-time on your charts
I inspired myself greatly from the gentleman @everget's script LTC halving countdown below
(
The countdown date is coming from that source www.bitcoinblockhalf.com.
The halving date is estimated to be around May 13th, 2020 .
That date is hardcoded in the script and is used for the countdown calculation.
The Bitcoin block mining reward halves every 210,000 blocks, the coin reward will decrease from 12.5 to 6.25 coins.
Enjoy the weekend
Dave
PVT Osc - Price Volume Trend Oscillator [UTS]The oscillator version of the Price Volume Trend indicator (PVT) can be considered as a leading indicator of future price movements. The PVT Indicator is similar to the On Balance Volume indicator as it is also used to measure the strength of a trend.
The difference between the OBV and the PVT is that where the OBV adds all volumes when price achieves higher daily closes and subtracts them when price registers a lower daily close, the PVT adds or subtracts only a portion of the volume from the cumulative total in relation to a percentage change in price.
The general market consensus is that this difference enables the PVT to more accurately represent money flow volumes in and out of a stock or commodity.
The PVT has been designed so that it is capable of forecasting directional changes in price. For instance, if the price of a stock is rising and the PVT begins to fall, then this is indicative that a price reversal could occur very soon.
The general consensus is that the PVT is more accurate at detecting new trading opportunities than the OBV because of the differences in their construction. The OBV is designed so that it adds the same amount of volume whether the price closes upwards by just a small fraction or by multiples of its day opening value. On the other hand, the PVT adds volume proportional to the amount the price closed higher.
General Usage
Plain old PVT can be used to confirm trends, as well as spot possible trading signals due to divergences.
A benefit of the oscillator version is that it can produce LONG or SHORT signals on zero line cross.
Or controversy, disallow LONG trades in bearish territory and disallow SHORT trades in bullish territory.
Moving Averages
4 different Moving Averages are available:
EMA (Exponential Moving Average)
SMA (Simple Moving Average)
VWMA (Volume Weighted Moving Average)
WMA (Weighted Moving Average)
MFI - Money Flow Index [UTS]Money Flow Index (MFI) is the technical indicator, which indicates the rate at which money is invested into a security and then withdrawn from it.
Construction and interpretation of the indicator is similar to Relative Strength Index with the only difference that volume is important to MFI.
Usage:
When analyzing the money flow index one needs to take into consideration the following points:
divergences between the indicator and price movement. If prices grow while MFI falls (or vice versa), there is a great probability of a price turn;
Money Flow Index value, which is over 80 or under 20, signals correspondingly of a potential peak or bottom of the market.
Common known variants of this type of indicator are the On Balance Volume, Chaikin Oscillator or Chaikin Money Flow.
Based on www.metatrader5.com
(PCL) Previous CloseI have recently been reading How to Day Trade for a Living by Andrew Aziz and one of the important support and resistance levels he talks about is the Previous Day Close Price.
I did not find an indicator that would simply plot this so I wrote a short simple pine script to plot the indicator.
Please feel free to edit or suggest improvements.
[RS]Plot in 3DEXPERIMENTAL:
plotting price,time,volume + additional price shift from moving average.
PriceScalperThis is a simple script that will visually show where buy and sell points occur based upon configurable price action. I wrote this purposefully to evaluate stablecoins and other narrow or fixed ranged markets where algorythms don't generally do well.
Putple triangles, pointing up, are buy signals.
Purple triangles, pointing down are sell signals
Alert conditions of BUY ASSET and SELL ASSET are provided for convience.
R100 Volatility Combo Bands v1 (*v*)The Volatility Combo Bands are made from 4 separate volatility bands- two Bollinger Bands (10 and 20 period) and two Price Headley Acceleration Bands (10 and 20 period). The Volatility Combo Bands plot the innermost upper and lower points from these bands and then plots a mid-line. By default, only the standard 20 period Bollinger Bands and Combo Bands with mid-line are displayed, but can be configured however you want.
Try it out- see squeezes earlier, ride the bands earlier in trending markets, trade pullbacks to the Combo Bands and mid-line, trade the range of the band or use them to help identify potential support and resistance levels. Hopefully they can add another dimension to identifying volatility contraction patterns or whatever you currently use these things for!
I hope you get some value out of it. Only conditions of use are that if you improve it, let me know and if you publish something that uses it, don't hide the code! Enjoy!
Code for the Price Headley Acceleration Bands pinched and modified from LazyBear - thankyou.
Strategy based on the principles of Price ActionIt is considered the percentage of candles with low and high closure for a certain period. Then, a moving average is built from these values. When the moving average of the ratio of tall candles to low candles is greater than the ratio of low candles to high, then long (that is, when the green line crosses the red). And vice versa - a condition for short. It also works on crypto with other settings. Idea for improvement: you can make partial exit by taking, at certain profit levels, the chart will be more stable. Result with a commission of 0.004% You can create an optimizer, and use this strategy on any liquid asset. (Sorry for google translator)
Waves in Price (Volume Waves)Waves in Price (Volume Waves)
TheDowVolumeBigot>0 (Bullish) =Lime color
Very High=Dark Green color
High=Green color
TheDowVolumeBigot<0 (Bearish) =Orange color
Low=Red color
Very Low=Dark Red color
Barcolor