Weighted Standard Deviation BandsLinearly weighted standard deviations over linearly weighted mean.
The rationale of the study can be deduced from my latest publications where I go deeper into explaining the benefits of linear weighting, but in short, I can remind that by using linear weighting we are able to increase the information gain by communicating the sequential nature of time series to the calculations via linear weighting.
Note, that multiplier parameters can take both negative and positive values resulting in ability to have, for example, 1st and 6th weighted standard deviations higher than the weighted mean.
Despite the modification of the classic standard deviation formula, I assume that mathematical qualities of standard deviation will hold due to the fact we can alternately weight the window itself, and then apply the classic standard deviation over the weighted window. In both cases, the results will be the same.
Aight that was too formal, but your short strangles should be happy
Here is it, for you
Weighted
StrengthA mathematically elegant, native & modern way how to measure velocity/ strength/ momentum. As you can see it looks like MACD, but !suddenly! has N times shorter code (disregard the functions), and only 1 parameter instead of 3. OMG HOW DID HE DO IT?!?
MACD: "Let's take one filter (1 parameter), than another filter (2 parameters), then let's take dem difference, then let's place another filter over the difference (3rd parameter + introduction of a nested calculation), and let's write a whole book about it, make thousands of multi-hours YouTube videos about it, and let's never mention about the amount of uncertainty being introduced by multiple parameters & introduction of the nested calculation."
Strength: "let's get real, let's drop a weighted linear regression & usual linear regression over the data of the same length, take dem slopes, then make the difference over these slopes, all good. And then share it with people w/o putting an ® sign".
Fyi, regressions were introduced centuries ago, maybe decades idk, the point is long time ago, and computational power enough to calculate what I'm saying is slightly more than required for macd.
Rationale.
Linearly weighted linear regression has steeper slope (W) than the usual linear regression slope (S) due to the fact that the recent datapoints got more weight. This alone is enough of a metric to measure velocity. But still I've recalled macd and decided to make smth like it cuz I knew it'll might make you happy. I realized that S can be used instead of smoothing the W, thus eliminating the nested calculation and keeping entropy & info loss in place. And see, what we get is natural, simple, makes sense and brings flex. I also wanna remind you that by applying regression we maximize the info gain by using all the data in the window, instead of taking difference between the first and the last datapoints.
This script is dedicated to my friend Fabien. Man, you were the light in the darkness in that company. You'll get your alien green Lambo if you'll really want it, no doubts on my side bout that.
Good hunting
Trapezoidal Weighted Moving Average and Bollinger BandsThis weighting method linearly weights a percentage of values from both the beginning and the end of the rolling window in order to minimize the effect of outliers entering and leaving the window.
Weighted Least Squares Moving AverageLinearly Weighted Ordinary Least Squares Moving Regression
aka Weighted Least Squares Moving Average -> WLSMA
^^ called it this way just to for... damn, forgot the word
Totally pwns LSMA for some purposes here's why (just look up):
- 'realistically' the same smoothness;
- less lag;
- less overshoot;
- more or less same computationally intensive.
"Pretty cool, huh?", Bucky Roberts©, thenewboston
Now, would you please (just look down) and see the comparison of impulse & step responses:
Impulse responses
Step responses
Ain't it beautiful?
"Motivation behind the concept & rationale", by gorx1
Many been trippin' applying stats methods that require normally distributed data to time series, hence all these B*ll**** Bands and stuff don't really work as it should, while people blame themselves and buy snake oil seminars bout trading psychology, instead of using proper tools. Price... Neither population nor the samples are neither normally nor log-normally distributed. So we can't use all the stuff if we wanna get better results. I'm not talking bout passing each rolling window to a stat test in order to get the proper descriptor, that's the whole different story.
Instead we can leverage the fact that our data is time-series hence we can apply linear weighting, basically we extract another info component from the data and use it to get better results. Volume, range weighting don't make much sense (saying that based on both common sense and test results). Tick count per bar, that would be nice tho... this is the way to measure "intensity". But we don't have it on TV unfortunately.
Anyways, I'm both unhappy that no1 dropped it before me during all these years so I gotta do it myself, and happy that I can give smth cool to every1
Here is it, for you.
P.S.: the script contains standalone functions to calculate linearly weighted variance, linearly weighted standard deviation, linearly weighted covariance and linearly weighted correlation.
Good hunting
Banknifty Weighted volume by AkramulBanknifty Weighted volume as per share ratio.
HDFC Bank – 27.56%
ICICI Bank – 22.91%
State Bank of India (SBI) – 12.42%
Kotak Mahindra Bank – 11.77%
Axis Bank – 11.49%
IndusInd Bank – 5.20%
AU Small Finance Bank Ltd. – 2.35%
Bandhan Bank – 1.73%
Federal Bank – 1.53%
IDFC First Bank Ltd. – 1.22%
Punjab National Bank (PNB)- 1.03%
RBL Bank – 0.79%
and moving average plotted on volume
Volume, Momentum and Volatility weighted moving averageMoving averages are filters on price data. This moving average creates a filter which factors in:
- the price RSI or it's Momentum
- the volume RSI
- the RVI or Volatility
Each factor is put through a least squares filter to smooth them first.
Then the factors are used to build a coefficient for an exponentially weighted average.
The chart above shows a comparison of standard average types with this script.
This is useful if you are looking for a moving average based trigger and do not wish to react to candle noise price action.
Crypto Top 25 Equal Weight IndexDraws an Equally Weighted Index of 25 securities. The inputs are pre-populated with the Top 25 cryptocurrencies by market cap at the time of publishing the script, but any 25 securities can be used.
Double click on this indicator's pane to view in full screen.
Note: Candle open is always equal to previous candle's close. I did this to avoid problems where sometimes candle open didn't make sense compared to close.
If you're into cryptocurrencies also have a look at these TradingView charts CRYPTOCAP:TOTAL, CRYPTOCAP:TOTAL2 and CRYPTOCAP:OTHERS.
Moving Average Weighted, Volume AdjustedVAWMA = VWMA and WMA combined.
Simply put, this attempts to determine the average price per share over time, weighted heavier for recent values.
Uses triangular algorithm to taper off values in the past (same as WMA does).
Why use this?
Let's say the earliest bar of the VWMA has a huge amount of volume. That means that when the next bar arrives, there will be an abrupt change in the moving average that doesn't represent the current value properly. VAWMA eliminates this problem by triangular weighting each bar.
wMRS | Weighted-Mansfield Relative Strength - 4CR CUPThis version of Mansfield Relative Strength ( MRS ) weights the MRSs with different lookback periods by adding the weight of 2:1:1:1 to MRS (1Q) : MRS (2Q) : MRS (3Q) : MRS (4Q).
Typically, the lookback period of a MRS is reference to a full year, i.e. 260 trading dates or 52 weeks; to better represents the relative strength of a stock to a recent performance, someone suggested to add heavier weight on the most recent quarter MRS , i.e. MR(1Q) and the same weight to other quarters, namely, MRS (2Q), MRS (3Q), MRS (4Q).
For some of the stocks you may be interested was IPO not long ago, the lookback period is relaxed for customizing. Once you set the total lookback period, representing the 4Q, in the indicator, the other shorter lookback periods will be auto-calculated, i.e. 1Q, 2Q, 3Q.
A simple moving average of the wMRS is also added for your easier analysis on the trend development of the strength.
Weighted derivatives premium BTCCan be extended with more derivative or spot pairs, see the comments in the code for instructions. Most importantly, the pairs need to be added to the respective arrays in the same order, so that the weights are applied to the correct pairs.
Delta Volume Weighted - IntradayResets at the start of the day's session (9:50 am on the ASX).
Takes the first candle and checks if its a green candle (close > open), and adds the volume to a total (which starts at 0 at the start of the day).
Subtracts it if the candles in red.
Continues to do this along with all the candles.
The volume is also multiplied by the difference between open and close so that large candles with large volume have more weight and move the indicator more.
Weighted Price OscillatorThis is the study version of the Weighted Price Oscillator (STRATEGY) indicator.
Weighted Price Oscillator is an unique indicator that shows the relationship between two custom variables that trigger signals upon specific conditions. When WPO (short for weighted price oscillator ) crosses over the signal or zero line, it creates a buy signal and conversely below the signal or zero line, it generates a take profit signal. All of which are provided that the specific conditions are met.
Inside the script's options, the following options are: signal sensitivity, enable signal background color, and take profit percentage. The signal sensitivity allows you to adjust the script's trigger sensitivity, so that the script can fire signals appropriate for a specific timeframe. Enabling signal background color will provide a visual on the oscillator when a buy or take profit signal is being created. And lastly, the take profit percentage option is for configuring the trade size percentage of which you want to take profit with.
PM me for access.
Volume Weighted DeviationsVolume !weighted!
deviations.
Important: I don't really know how people generally compute deviations from VWAP/VWMA, but smth tells me generally it's just a Av Dev/St Dev based on mean, not on appropriate basis, like volume weighted mean in our case. This version is mathematically correct, it first calculates weighted mean, than utilizes this weighted in mean in AvDev & StDef functions modified to take into account weights.
Volume-Weighted Indicators VWMA/VWAP/EMA_by WWAs traders and investors now urge to console volume factors into their price action analysis. This script is an attempt to combine volume-weighted moving average (VWMA), volume-weighted average price (VWAP), along with the exponential moving average (EMA). I have found that this indicator works quite well with the stock market.
How to use the indicator:
Buy when the VWAP and EMA lines crossing up VWMA.
Sell when the VWAP and EMA crossing down each other OR both VWAP and EMA crossing down VWAP
Any modificatio is welcomed, but please let me know.
Stochastic Weights - Basic [BigBitsIO]This script is a compilation of several different stochastic indicators (and RSI) where the K value of each indicator is equally weighted. The purpose of the indicator is to combine many indicators together in a fashion that weights them easier. By default, the Stochastic and Stochastic RSI are both enabled - the idea is to speed up the relatively slower Stochastic and to slow down the relatively fast Stochastic RSI. Other Stochastics are also available, including some of my own custom calculations that can also be added to the weighted calculation. Only the K value is weighted, as the D value is just a moving average of the weighted K.
Explained:
- Calculates enabled indicators
- Calculates the weighted value of K for enabled indicators
- Calculates a D value from the weighted K
FAQ:
- Why is this script useful?
- To weight multiple indicators together so that you can attempt to find optimal values shared amongst the indicators. Ex: If Stochastic RSI is 100 and Stochastic is 50, K would be 75 and not particularly high. If you add in a 50 RSI, the K would be 67 in this example. If we weight indicators together that all have a high value they could potentially help find elements that align together to produce a stronger signal.
DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB.
LWMA: Linear Weighted Moving AverageCouldn't find searching for Linearly Weighted Moving Average (LWMA) in tradingview. Found one with the LWMA title, but it uses plain WMA calculation without the linearity which more heavily weights recent price data, which I need, so I try to made one.
LWMAs are also quicker to react to price changes than SMA and EMA. If you want a moving average with less lag than an SMA, try a LWMA.
It kind of also have a more clarity in defining the price trend and reversals. Trade signals usually based on crossovers, they can also indicate areas of potential support or resistance. But beware though, multiple false signals may also occur before a significant trend develops. Use a filter, some decent volatility oscillator might do the job.
--
The formula for this Linearly Weighted Moving Average is:
LWMA = (( P n∗ W 1)+( P n−1∗ W 2)+( P n−2∗ W 3)...) / ∑W
P = Price for the period
n = The most recent period, n-1 is the prior period, and n-2 is two periods prior
W = The assigned weight to each period, with the highest weight going first and then descending linearly based on the number of periods being used.
I hope I'm doing right translating it to Pine Script 4. Let me know if I miss something.
Weighted Close [CC]The weighted close isn't an option for an input yet on TV so here is my contribution. It gives more weight to the close prices and I have included a signal line to look for buy and sell signals. Buy when the indicator goes over its signal line and sell when it falls below it.
This was a special request so let me know what other scripts you would like to see me publish or if you want something custom done!
End Point Moving Average [CC]The End Point Moving Average was created by Patrick E. Lafferty (Stocks & Commodities V13 (413-417)) and it is essentially a variation of the weighted moving average but the weight system is different. Feel free to change the offset and length amounts to adjust to your needs but I'm using the default amounts in my script. This hugs the price very closely and I think you will enjoy this script as much as I had making it. As always buy when the indicator line is green and sell when it is red!
Let me know if you would like me to publish other scripts or if you want something custom done!
Note: I'm republishing this because the original script couldn't be found in searches so this will fix that.
CBG Swing HighLow MAThis indicator will show the swing high and lows for the number of bars back. It's very easy to use and shows good support and resistance levels.
I then took it a step further and added a moving average with all the standard types in my indicators:
SMA
EMA
Weighted
Hull
Symmetrical
Volume Weighted
Wilder
Linear Regression
I then added Bollinger Bands to show the standard deviation from the midline.
Finally, I added a simple bar coloring scheme: green if above the upper BB, Red if below and orange if in the middle.
I am just testing this out so please use with caution. If anyone in the community wants to run some backtests, that would be great and we would all appreciate it.
Of course you can keep it all simple and turn off all the moving averages and bollinger bands.
Enjoy! :-)
Cubed Weighted Moving AverageThis is another indicator that I have created that is my favorite script yet for a weighted moving average. This indicator is very similiar to a classic weighted moving average but in this version I'm cubing the weights. It hugs the price very closely as you can see and of course buy when the indicator line is green and sell when it is red.
Let me know if you would like me to publish other scripts or if you want something custom done!