WAP Maverick - (Dual EMA Smoothed VWAP) - [mutantdog]Short Version:
This here is my take on the popular VWAP indicator with several novel features including:
Dual EMA smoothing.
Arithmetic and Harmonic Mean plots.
Custom Anchor feat. Intraday Session Sizes.
2 Pairs of Bands.
Side Input for Connection to other Indicator.
This can be used 'out of the box' as a replacement VWAP, benefitting from smoother transitions and easy-to-use custom alerts.
By design however, this is intended to be a highly customisable alternative with many adjustable parameters and a pseudo-modular input system to connect with another indicator. Well suited for the tweakers around here and those who like to get a little more creative.
I made this primarily for crypto although it should work for other markets. Default settings are best suited to 15m timeframe - the anchor of 1 week is ideal for crypto which often follows a cyclical nature from Monday through Sunday. In 15m, the default ema length of 21 means that the wap comes to match a standard vwap towards the end of Monday. If using higher chart timeframes, i recommend decreasing the ema length to closely match this principle (suggested: for 1h chart, try length = 8; for 4h chart, length = 2 or 3 should suffice).
Note: the use of harmonic mean calculations will cause problems on any data source incorporating both positive and negative values, it may also return unusable results on extremely low-value charts (eg: low-sat coins in /btc pairs).
Long version:
The development of this project was one driven more by experimentation than a specific end-goal, however i have tried to fine-tune everything into a coherent usable end-product. With that in mind then, this walkthrough will follow something of a development chronology as i dissect the various functions.
DUAL-EMA SMOOTHING
At its core this is based upon / adapted from the standard vwap indicator provided by TradingView although I have modified and changed most of it. The first mod is the dual ema smoothing. Rather than simply applying an ema to the output of the standard vwap function, instead i have incorporated the ema in a manner analogous to the way smas are used within a standard vwma. Sticking for now with the arithmetic mean, the basic vwap calculation is simply sum(source * volume) / sum(volume) across the anchored period. In this case i have simply applied an ema to each of the numerator and denominator values resulting in ema(sum(source * volume)) / ema(sum(volume)) with the ema length independent of the anchor. This results in smoother (albeit slower) transitions than the aforementioned post-vwap method. Furthermore in the case when anchor period is equal to current timeframe, the result is a basic volume-weighted ema.
The example below shows a standard vwap (1week anchor) in blue, a 21-ema applied to the vwap in purple and a dual-21-ema smoothed wap in gold. Notably both ema types come to effectively resemble the standard vwap after around 24 hours into the new anchor session but how they behave in the meantime is very different. The dual-ema transitions quite gradually while the post-vwap ema immediately sets about trying to catch up. Incidentally. a similar and slower variation of the dual-ema can be achieved with dual-rma although i have not included it in this indicator, attempted analogues using sma or wma were far less useful however.
STANDARD DEVIATION AND BANDS
With this updated calculation, a corresponding update to the standard deviation is also required. The vwap has its own anchored volume-weighted st.dev but this cannot be used in combination with the ema smoothing so instead it has been recalculated appropriately. There are two pairs of bands with separate multipliers (stepped to 0.1x) and in both cases high and low bands can be activated or deactivated individually. An example usage for this would be to create different upper and lower bands for profit and stoploss targets. Alerts can be set easily for different crossing conditions, more on this later.
Alongside the bands, i have also added the option to shift ('Deviate') the entire indicator up or down according to a multiple of the corrected st.dev value. This has many potential uses, for example if we want to bias our analysis in one direction it may be useful to move the wap in the opposite. Or if the asset is trading within a narrow range and we are waiting on a breakout, we could shift to the desired level and set alerts accordingly. The 'Deviate' parameter applies to the entire indicator including the bands which will remain centred on the main WAP.
CUSTOM (W)ANCHOR
Ever thought about using a vwap with anchor periods smaller than a day? Here you can do just that. I've removed the Earnings/Dividends/Splits options from the basic vwap and added an 'Intraday' option instead. When selected, a custom anchor length can be created as a multiple of minutes (default steps of 60 mins but can input any value from 0 - 1440). While this may not seem at first like a useful feature for anyone except hi-speed scalpers, this actually offers more interesting potential than it appears.
When set to 0 minutes the current timeframe is always used, turning this into the basic volume-weighted ema mentioned earlier. When using other low time frames the anchor can act as a pre-ema filter creating a stepped effect akin to an adaptive MA. Used in combination with the bands, the result is a kind of volume-weighted adaptive exponential bollinger band; if such a thing does not already exist then this is where you create it. Alternatively, by combining two instances you may find potential interesting crosses between an intraday wap and a standard timeframe wap. Below is an example set to intraday with 480 mins, 2x st.dev bands and ema length 21. Included for comparison in purple is a standard 21 ema.
I'm sure there are many potential uses to be found here, so be creative and please share anything you come up with in the comments.
ARITHMETIC AND HARMONIC MEAN CALCULATIONS
The standard vwap uses the arithmetic mean in its calculation. Indeed, most mean calculations tend to be arithmetic: sma being the most widely used example. When volume weighting is involved though this can lead to a slight bias in favour of upward moves over downward. While the effect of this is minor, over longer anchor periods it can become increasingly significant. The harmonic mean, on the other hand, has the opposite effect which results in a value that is always lower than the arithmetic mean. By viewing both arithmetic and harmonic waps together, the extent to which they diverge from each other can be used as a visual reference of how much price has changed during the anchored period.
Furthermore, the harmonic mean may actually be the more appropriate one to use during downtrends or bearish periods, in principle at least. Consider that a short trade is functionally the same as a long trade on the inverse of the pair (eg: selling BTC/USD is the same as buying USD/BTC). With the harmonic mean being an inverse of the arithmetic then, it makes sense to use it instead. To illustrate this below is a snapshot of LUNA/USDT on the left with its inverse 1/(LUNA/USDT) = USDT/LUNA on the right. On both charts is a wap with identical settings, note the resistance on the left and its corresponding support on the right. It should be easy from this to see that the lower harmonic wap on the left corresponds to the upper arithmetic wap on the right. Thus, it would appear that the harmonic mean should be used in a downtrend. In principle, at least...
In reality though, it is not quite so black and white. Rarely are these values exact in their predictions and the sort of range one should allow for inaccuracies will likely be greater than the difference between these two means. Furthermore, the ema smoothing has already introduced some lag and thus additional inaccuracies. Nevertheless, the symmetry warrants its inclusion.
SIDE INPUT & ALERTS
Finally we move on to the pseudo-modular component here. While TradingView allows some interoperability between indicators, it is limited to just one connection. Any attempt to use multiple source inputs will remove this functionality completely. The workaround here is to instead use custom 'string' input menus for additional sources, preserving this function in the sole 'source' input. In this case, since the wap itself is dependant only price and volume, i have repurposed the full 'source' into the second 'side' input. This allows for a separate indicator to interact with this one that can be used for triggering alerts. You could even use another instance of this one (there is a hidden wap:mid plot intended for this use which is the midpoint between both means). Note that deleting a connected indicator may result in the deletion of those connected to it.
Preset alertconditions are available for crossings of the side input above and below the main wap, alongside several customisable alerts with corresponding visual markers based upon selectable conditions. Alerts for band crossings apply only to those that are active and only crossings of the type specified within the 'crosses' subsection of the indicator settings. The included options make it easy to create buy alerts specific to certain bands with sell alerts specific to other bands. The chart below shows two instances with differing anchor periods, both are connected with buy and sell alerts enabled for visible bands.
Okay... So that just about covers it here, i think. As mentioned earlier this is the product of various experiments while i have been learning my way around PineScript. Some of those experiments have been branched off from this in order to not over-clutter it with functions. The pseudo-modular design and the 'side' input are the result of an attempt to create a connective framework across various projects. Even on its own though, this should offer plenty of tweaking potential for anyone who likes to venture away from the usual standards, all the while still retaining its core purpose as a traders tool.
Thanks for checking this out. I look forward to any feedback below.
Evwma
[THETA] Tema Hema Evwma Trade ActionTHETA
Is an Intraday Strategy Indicator, To be used over 1 minute chart and in conjunction with built in pine indicator Pivot Point Standard, {Fibonacci One}
I came across this Strategy Indicator while reading through the Forex Trading Journals, and thought of sharing you guys
The Indicator Comprises of amalgamation of
TEMA : Triple Exponential Moving Average
HMA : Hulls Moving Average
EVWMA and EMA: Elastic Volume weighted Moving Average and Exponential Moving Average
Filter Action by Rajandran R Supertrend
So
Theta = ( tema(src, length) + hma(src, length) + ema(src, length) + evwma(src, length) )/4
The lengths in use are: 8,21,34,55,89,144,233,610
How to Use
Use on 1 min chart for best results
UsE in Conjuction with Fibonacci Pivot Points, (.which is present in option of built in pine indicator : Pivot Point Standard )
Provision For Alert
Long theta Signal
Short theta Signal
FRAMA Awesome Oscillator (FAO)FRAMA Awesome Oscillator (FAO) is an indicator that is non-limiting oscillator, providing insight into the weakness or the strength of a security. The Oscillator is used to measure market momentum and to affirm trends or to anticipate possible reversals. It does this by effectively comparing the recent market momentum, with the general momentum over a wider frame of reference.
FRAMA stands for
The Oscillator in the script is calculated using FRAMA of length 55
which is segmented by EVWMA of FRAMA
Calculations:
AO = (Difference of FRAMA and eVWMA basis of FRAMA) or diff
Represented by green and red columns
The black segmenting line is an eVWMA line of diff and is of length 21
This indicator may be useful in finding divergences and can be traded as we trade awesome oscillator in general
BTC SWING ZONESHigh Time Frame EVWMA Envelopes for BTC spot. Should only be used on Weekly time frame and higher.
BTFD and Chill!
Realized Volatility IIR Filters with BandsDISCLAIMER:
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The following indicator was made for NON LUCRATIVE ACTIVITIES and must remain as is following TradingView's regulations. Use of indicator and their code are published by Invitation Only for work and knowledge sharing. All access granted over it, their use, copy or re-use should mention authorship(s) and origin(s).
WARNING NOTICE!
THE INCLUDED FUNCTION MUST BE CONSIDERED AS TESTING. The models included in the indicator have been taken from open sources on the web and some of them has been modified by the author, problems could occur at diverse data sceneries.
WHAT'S THIS...?
Work derived by previous own research for study:
This is mainly an INFINITE IMPULSE RESPONSE FILTERING INDICATOR , it's purpose is to catch trend given by the nature of lag given by a VOLATILITY ESTIMATION ALGORITHM as it's coefficient. It provides as well an INFINITE IMPULSE RESPONSE DEVIATION FILTER that uses the same coefficients of the main filter to plot deviation bands as an auxiliary tool.
The given Filter based indicator provides my own Multi Volatility-Estimators Function with only 3 models:
ELASTIC VOLUME WEIGHTED VOLATILITY : This is a Modified Daigler & Padungsaksawasdi "Volume Weighted Volatility" as on DOI: 10.1504/IJBAAF.2018.089423 but with Elastic Volume Weighted Moving Average instead of VWAP (intraday) for faster (but inaccurate) calculation. A future version is planned on the way using intra-bar inspection for intraday timeframe as described in original paper.
GARMAN & KLASS / YANG-ZANG EXTENSION : As one of the best range based (OHLC) with open gaps inclusion in a single bar.
PETER MARTIN'S ULCER INDEX : This is a better approach to measure realized volatility than standard deviation of log returns given it's proven convex risk metric for DrawDowns as shown in Chekhlov et al. (2005) . Regarding this particular model, I take a different approach to use it as coefficient feed: Given that the UI only takes in consideration DrawDawns, I code myself the inverse of this to compute Draw-Ups as well and use both of them to filter minimums volatility levels in order to create a SLOW version of the IIR filter, and maximums of both to calculate as FAST variation. This approach can be used as a better proxy instead of any other common moving average given that with NO COMPOUND IN TIME AT ALL (N=1) or only using as long as N=3 bars of compund, the filter can catch a trend easily, making the indicator nearly a NON PARAMETRIC FILTER.
NOTES:
This version DO NOT INCLUDE ALERTS.
This version DO NOT INCLUDE STRATEGY: ALL Feedback welcome.
DERIVED WORK:
Incremental calculation of weighted mean and variance by Tony Finch (fanf2@cam. ac .uk) (dot@dotat.at), 2009.
Volume weighted volatility: empirical evidence for a new realised volatility measure by Chaiyuth Padungsaksawasdi & Robert T. Daigler, 2018.
Basic DSP Tips & Trics by TradingView user @alexgrover
CHEERS!
@XeL_Arjona 2020.
FALSE BREAKOUT NO PROBLEM !! CHK TWIN MOV AVG SEGREGATED RIBBON PROBLEM DEFINITION 1 : To Avoid False Breakouts
PROBLEM DEFINITION 2 : To Ascertain if the trend has changed when a Stock opens with a Gap up or Gap Down
## PROBABLE SOLUTION : Use a Moving Average with lot of latency
## PROBLEM WITH ABOVE SOLUTION : Misses on lot of trades, Late exits leads to drain on winning trades
S O L U T I O N
An Indicator which plots two different types of Moving Averages at the same time
For the MA length 5-100 a fast plot of choice
For the MA Length 110-200 a plot with a lag to ascertain the trend
And then ONE LAST MAN STANDING with even bigger MA length for a lagging indicator to save the day
This indicator gives one 9X9 = 81 Permutation Combinations to look at the markets
One can devise strategies basis if one particular MA Type has crossed another MA Type
Feel free to post the strategies you have come out with!
//// CREDITS AND ACKNOWLEDGEMENTS //////////////////////////////////////////////////////////////////
Following contributors helped the author ::
Credits to Neobutane for his Multiple Type Mov. Avg. Guppy at ......
hxxps://www.tradingview.c0m/script/UQAv1U0c-MA-Study-Different-Types-and-More-NeoButane/
Credits to Jose5770 for sharing Jurik MA code at .....
hxxps://www.tradingview.c0m/script/uqYvkHna-Trend-Direction-Force-Index/
Appreciate and Thank You for sharing your work.
//////////////////////////////////////////////////////////////////////////////////////////////////////
P.S You might notice in the code that the few plots are skipped. It is done to fasten the indicator without compromising
on the functionality
EVWBB Strategy [QuantNomad]It's my new strategy using EVWMA (Elastic Volume Weighted Moving Average).
Now I created a Bollinger Bands strategy where basis level is EVWMA.
It looks pretty interesting but you have to be careful with the entries/exits on the same bar, I'm using stop orders, so on big moves it happens pretty often.
In the next version, I will try to eliminate these issues.
Entry for this strategy happens when price crossover upper for long and lower for short. I exit both short and long on basis level.
EVWMA VWAP Cross Strategy [QuantNomad]Continue to experiement with VWAP and EVWMA.
It seems that just simple crosses between VWAP and EVWMA can be pretty good signals. VWAP is a bit choppy so you can use VWAP smoothing input to smoth it a bit.
Here are few other strategies based on EVWMA:
EVWMA VWAP MACD Strategy
QuantNomad - EVWMA MACD Strategy
EVWMA VWAP MACD Strategy [QuantNomad]Based on comment of @coondawg71 I tried to compare VWAP and EVWMA.
Both are sort of moving averages so I decided to create a MACD based on these 2 indicators.
In parameters you can set EVWMA Length and 2 smoothing lengths for "macd" and "signal".
Strategy seems to work pretty good at 2h-8h timeframes for crypto.
What do you thing about it?
QuantNomad - EVWMA MACD StrategyPretty simple EVWMA (Elastic Volume Weighted Moving Average ) MACD Strategy.
EVWMA is a quite interesting moving average where the period of the MA is defined from the volume itself.
It incorporates volume information in a natural and logical way. The EVWMA can be looked at as an approximation to the average price paid per share.
As a volume period, you can use sum of the last x bars volumes.
Here are other EVWMA indicators/strategies:
EVWMA indicator:
EVWMA Cross strategy:
QuantNomad - EVWMA Cross StrategyPretty simple EVWMA (Elastic Volume Weighted Moving Average) Cross Strategy. Long on bullish cross, Short on Bearish Crosss.
EVWMA is a quite interesting moving average where period of the MA is defined from volume itself.
It incorporates volume information in a natural and logical way. The eVWMA can be looked at as an approximation to the average price paid per share.
As a volume period you can use sum of the last x bars volumes.
Here is EVWMA as an indicator:
QuantNomad - Elastic Volume Weighted Moving AverageEVWMA is a quite interesting moving average where period of the MA is defined from volume itself.
It incorporates volume information in a natural and logical way. The eVWMA can be looked at as an approximation to the average price paid per share.
As a volume period you can use:
- Absolute volume value, for example floating number of shares. 134M for Tesla for example.
- Sum of the last x bars volumes.
Indicator was developer by Christian P. Fries, Ph.D.
Elastic Volume Weighted MACD ( EVWMACD )The Elastic Volume Weighted MACD is a variation of standard MACD.
The Difference is that this script apply the formula of standard MACD with the Elastic Volume Weighted Moving Average.
I took the formula of EVWMA from public library coded by LazyBear.
I use EVWMACD as a trend confirmation indicator.
Just tune all lengths and parameters according to your instruments
Elastic Volume Weighted Moving AverageElastic Volume Weighted Moving Average indicator script. This indicator was originally developed by Christian P. Fries (Technical Analysis of Stocks & Commodities, June 2001).
Elastic Volume Weighted Moving Average with Trend and EnvelopesElastic Volume Weighted Moving Average (EVWMA) with Trend and Envelopes.
Original version by LazyBear, trend function by Shizaru, combination by Spreadburn.
EVWMA Acc/Dist. Pressure & FRACTAL BANDS by @XeL_ArjonaEVWMA ACCUMULATION/DISTRIBUTION PRESSURE & FRACTAL BANDS
Version: 3.0 @ 4.11.2015
By Ricardo M Arjona @XeL_Arjona
DISCLAIMER:
The following indicator IS NOT INTENDED TO BE A FORMAL INVESTMENT ADVICE OR TRADING RECOMMENDATION BY THE AUTHOR, nor should be construed as such. Users will be fully responsible by their use regarding any kind of trading vehicles or assets.
The following script and ideas within this work are FREELY AND PUBLICLY availables on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
-== IMPORTANT: THIS IS AN EXPERIMENTAL INDICATOR ==-
What is this?
This work is a derivation of my previous Accumulation/Distribution scripts publicly available in TradingView in an effort to clean, speedup and make the indicator cleaner as possible.
The current indicator is based on already tested and Mathematically proof concepts as described below:
The MAIN Rolling back median line or "Vortex" is constructed by a simple and equal weighting of distributed volume along the candle range (This approach is just an "estimator" of Buyers Vs. Sellers given the lack of tick resolution in TradingView, a real "DELTA" can only be 100% reliable with Market Depth (Ask/Bid ticks)), Given this, with each "volume weights", the price is post-processed against a true statistical Average calculation formerly: ELASTIC VOLUME WEIGHTED MOVING AVERAGE.
The FRACTAL BANDS are just Standard Deviation's with GOLDEN RATIO as multiplier (1.618) derived one from each other within it's origin on the former "Vortex Median".
The Standard Error Bands comply as the original indicator described by Jon Andersen but given the true statistical nature of EVWMA, the original LinReg line has been substituted by the former.
ALL NEW IDEAS OR MODIFICATIONS to this indicator are welcome in favor to deploy a better technical tool. Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView user rules. (C) 2015 @XeL_Arjona