VWMACDV2 w/Intraday Intensity Index Histogram & VBCB Hello traders! In this script i tried to combine Kıvanç Özbilgiç's Volume Based Coloured Bars, Volume Weighted Macd V2 and Intraday Intensity Index developed by Dave Bostian and added to Tradingview by Kıvanç Özbilgiç. Let's see what we got here;
VBCB, Paints candlestick bars according to the volume of that bar. Period is 30 by default. If you're trading stocks, 21 should be better.
Volume Weighted Macd V2, "Here in this version; Exponential Moving Averages used and Weighted by Volume instead of using only vwma (Volume Weighted Moving Averages)." Says, Kıvanç Özbilgiç.
III, "A technical indicator that approximates the volume of trading for a specified security in a given day. It is designed to help track the activity of institutional block traders and is calculated by subtracting the day's high and low from double the closing price, divided by the volume and multiplied by the difference between the high and the low."
*Histogram of vwmacd changes color according to the value of III. (Green if positive, yellow if negative value)*
VWMACD also comes with the values of 21,13,3... Which are fibonacci numbers and that's how i use it. You can always go back to the good old 26,12,9.
Other options according to the fibonacci numbers might be= 21,13,5-13,8,3-13,8,5... (For shorter terms of trading)
Trading combined with the bollinger bands is strongly advised for both VWMACD and III. VBCB is just the candy on top :)
Enjoy!
Bands
Adjustable MA & Alternating Extremities [LuxAlgo]Returns a moving average allowing the user to control the amount of lag as well as the amplitude of its overshoots thanks to a parametric kernel. The indicator displays alternating extremities and aims to provide potential points where price might reverse.
Due to user requests, we added the option to display the moving average as candles instead of a solid line.
Settings
Length: MA period, refers to the number of most recent data points to use for its calculation.
Mult: Multiplicative factor for each extremity.
As Smoothed Candles: Allows the user to show the MA as a series of candles instead of a solid line.
Show Alternating Extremities : Determines whether to display the alternating extremities or not.
Lag: Controls the amount of lag of the MA, with higher values returning a MA with more lag.
Overshoot: Controls the amplitude of the overshoots returned by the MA, with higher values increasing the amplitude of the overshoots.
Usage
Moving averages using parametric kernels allows users to have more control over characteristics such as lag or smoothness; this can greatly benefit the analyst. A moving average with reduced lag can be used as a leading moving average in a MA crossover system, while lag will benefit moving averages used as slow MA in a crossover system.
Increasing 'Lag' will increase smoothness while increasing 'overshoot' will reduce lag.
The following indicator puts more emphasis on its alternating extremities, an upper extremity will be shown once the high price crosses the upper extremity, while a low extremity will be shown once the low price crosses the lower extremity. These can be interpreted like extremities of a band indicator.
The MA using a length value of 200 with a multiplicative factor of 1.
In general, extremities will effectively return points where price might potentially bounce in ranging markets while closing prices under trending markets will often be found above an upper extremity and under a lower extremity.
Reducing the lag of the moving average allows the user to obtain a more timely estimate of the underlying trend in the price, with a better fit overall. This allows the user to obtain potentially pertinent extremities where price might reverse upon a break, even under trending markets.
In the above chart, the price initially breaks the upper extremity, however, we can observe that the upper extremity eventually reaches back the price, goes above it, provides a resistance, and effectively indicates a reversal.
Users can plot candles from the moving average, these are fairly similar to heikin-ashi candles in the sense that CandleOpen(t) ≠ CandleClose(t-1) , each point of the candle is calculated as follows for our indicator:
Open = Average between MA(t-1) and MA(t-2)
High = MA using the high price as input
Low = MA using the low price as input
Close = MA using the closing price as input
Details
Lag is defined as the effect of moving averages to reflect past price variations instead of new ones, lag can be observed by the user and is the main cause of false signals. Lag is proportional to the degree of filtering returned by the moving average.
Overshooting is a common effect encountered in non-lagging moving averages, and is defined as the tendency of a moving average to exceed a maximum level (or minimum level, which can be defined as undershooting )
MA and rolling maximum/minimum, both using a length of 50 bars. While we can think of lag as a cost of smoothness, we can think of overshooting as a cost for reduced lag on some occasions.
Explaining the kernel design behind our moving average requires understanding of the logic behind lag reduction in moving averages. This can prove to be complex for non informed users, but let's just focus on the simpler part; moving averages can be defined as a weighted sum between past prices and a set of coefficients (kernel).
MA(t) = b(0)C(t) + b(1)C(t-1) + b(2)C(t-2) + ... + b(n-1)C(t-n-1)
Where n is the period of the moving average. Lag is (non optimally) reduced by "underweighting" past prices - that is multiplying them by negative numbers.
The kernel used in our moving average is based on a modified sinewave. A weighted sum making use of a sinewave as a kernel would return an oscillator centered at 0. We can divide this sinewave by an increasing linear function in order to obtain a kernel allowing us to obtain a low lag moving average instead of a centered oscillator. This is the main idea in the design of the kernel used by our moving average.
The kernel equation of our moving average is:
sin(2πx^α)(1 - x^β)
With 1>x>0 , and where α controls the lag, while β controls the overshoot amplitude.
Using this equation we can obtain the following kernels:
Here only α is changed, while β is equal to 1. Values to the left would represent the coefficients for the most recent prices. Notice how the most significant coefficients are given to the oldest prices in the case where α increases.
Higher overshoot would require more negative values, this is controlled by β
Here only β is changed, while α is equal to 1. Notice how higher values return lower negative coefficients. This effectively increases the overshoots amplitude in our moving average. We can decrease α in order for these negative coefficients to underweight more recent values.
Using α = 0 allows us to simplify the kernel equation to:
1 - x^β
Using this kernel we can obtain more classical moving averages, this can be seen from the following results:
Using β = 1 allows us to obtain a linearly decreasing kernel (the one of a WMA), while increasing allows the kernel to converge toward a rectangular kernel (the one of SMA).
Moving Average BandsUse this script to find buy and sell zones for BTC based on momentum of the move relative to the average asset price over a given period. The script plots a series of offset bands above and below the Simple Moving Average. When price crosses another band further from the SMA, the background is rendered brighter. The brighter the background, the stronger the buy and sell signal is, as the expectation is that price wants to return to the SMA. Settings are adjustable to fine tune to various time frames and assets. Good settings for BTC Daily are length 30, layers at 10, 20, 30, and 40.
On 1H BTC/USD I use length 200, layers at 5, 10, 15, 20 to find decent swing trading opportunities.
On BTC/USD 1D chart, combine with Bitcoin Logarithmic Growth Curve from @mabonyi (original by @quantadelic )for confluence of very reliable signals.
Combo Backtest 123 Reversal & Prime Number Bands This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Determining market trends has become a science even though a high number
or people still believe it’s a gambling game. Mathematicians, technicians,
brokers and investors have worked together in developing quite several
indicators to help them better understand and forecast market movements.
The Prime Number Bands indicator was developed by Modulus Financial Engineering
Inc. This indicator is charted by indentifying the highest and lowest prime number
in the neighborhood and plotting the two series as a band.
WARNING:
- For purpose educate only
- This script to change bars colors.
RSI with bands and multiple EMAs Combination of RSI and EMAs, useful in predicting momentum switches and defining overbought/oversold conditions on all time frames.
Overbought/Oversold BandsThe basis of this script is my "Hybrid Overbought/Oversold Detector" which uses many different oscillators to confirm overbought/oversold conditions. The main idea is to generate higher and lower bands around the desired moving average using an average of the volatility (ATR) and the standard deviation (StDev), of course by interfering detected overbought/oversold condition.
Simply put, the more the asset become overvalued/undervalued, the tighter the channel would be and every breakout of the bands announces a return back into the channel in near future.
By default, the multiplier of the standard deviation in the indicator settings is set to 2 which means only less than 5% of price actions would appear outside the bands. Also the default multiplier of the ATR is set to 3 which leads to some similar result, but to achieve more strict results setting StDev multiplier to 3 and ATR multiplier to 4 would be useful.
The type of the central moving average could be picked up from 6 different types which are:
- SMA (Simple Moving Average)
- EMA (Exponential Moving Average)
- HMA (Hull Moving Average)
- LSMA (Least Squares Moving Average)
- TMA (Triangular Moving Average)
- MAEMA (My Personalized Momentum Adjusted EMA)
The latter one leads to a useful combination of the channel with the momentum.
Also the script has multi-timeframe features and the user could apply calculations from other time frames to the current chart.
Hope the idea would be helpful!
Overlay Indicators (EMAs, SMAs, Ichimoku & Bollinger Bands)This is a combination of popular overlay indicators that are used for dynamic support and resistance, trade targets and trend strength.
Included are:
-> 6 Exponential Moving Averages
-> 6 Simple Moving Averages
-> Ichimoku Cloud
-> Bollinger Bands
-> There is also a weekend background marker ideal for cryptocurrency trading
Using all these indicators in conjunction with each other provide great confluence and confidence in trades and price targets.
An explanation of each indicator is listed below.
What Is an Exponential Moving Average (EMA)?
"An exponential moving average (EMA) is a type of moving average (MA) that places a greater weight and significance on the most recent data points. The exponential moving average is also referred to as the exponentially weighted moving average. An exponentially weighted moving average reacts more significantly to recent price changes than a simple moving average (SMA), which applies an equal weight to all observations in the period.
What Does the Exponential Moving Average Tell You?
The 12- and 26-day exponential moving averages (EMAs) are often the most quoted and analyzed short-term averages. The 12- and 26-day are used to create indicators like the moving average convergence divergence (MACD) and the percentage price oscillator (PPO). In general, the 50- and 200-day EMAs are used as indicators for long-term trends. When a stock price crosses its 200-day moving average, it is a technical signal that a reversal has occurred.
Traders who employ technical analysis find moving averages very useful and insightful when applied correctly. However, they also realize that these signals can create havoc when used improperly or misinterpreted. All the moving averages commonly used in technical analysis are, by their very nature, lagging indicators."
Source: www.investopedia.com
Popular EMA lookback periods include fibonacci numbers and round numbers such as the 100 or 200. The default values of the EMAs in this indicator are the most widely used, specifically for cryptocurrency but they also work very well with traditional.
EMAs are normally used in conjunction with Simple Moving Averages.
" What Is Simple Moving Average (SMA)?
A simple moving average (SMA) calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range.
Simple Moving Average vs. Exponential Moving Average
The major difference between an exponential moving average (EMA) and a simple moving average is the sensitivity each one shows to changes in the data used in its calculation. More specifically, the EMA gives a higher weighting to recent prices, while the SMA assigns an equal weighting to all values."
Source: www.investopedia.com
In this indicator, I've included 6 popular moving averages that are commonly used. Most traders will find specific settings for their own personal trading style.
Along with the EMA and SMA, another indicator that is good for finding confluence between these two is the Ichimoku Cloud.
" What is the Ichimoku Cloud?
The Ichimoku Cloud is a collection of technical indicators that show support and resistance levels, as well as momentum and trend direction. It does this by taking multiple averages and plotting them on the chart. It also uses these figures to compute a "cloud" which attempts to forecast where the price may find support or resistance in the future.
The Ichimoku cloud was developed by Goichi Hosoda, a Japanese journalist, and published in the late 1960s.1 It provides more data points than the standard candlestick chart. While it seems complicated at first glance, those familiar with how to read the charts often find it easy to understand with well-defined trading signals."
More info can be seen here: www.investopedia.com
I have changed the default settings on the Ichimoku to suit cryptocurrency trading (as cryptocurrency is usually fast and thus require slightly longer lookbacks) to 20 60 120 30.
Along with the Ichimoku, I like to use Bollinger Bands to not only find confluence for support and resistance but for price discovery targets and trend strength.
" What Is a Bollinger Band®?
A Bollinger Band® is a technical analysis tool defined by a set of trendlines plotted two standard deviations (positively and negatively) away from a simple moving average (SMA) of a security's price, but which can be adjusted to user preferences.
Bollinger Bands® were developed and copyrighted by famous technical trader John Bollinger, designed to discover opportunities that give investors a higher probability of properly identifying when an asset is oversold or overbought."
This article goes into great detail of the complexities of using the Bollinger band and how to use it.
=======
This indicator combines all these powerful indicators into one so that it is easier to input different settings, turn specific tools on or off and can be easily customised.
VWAP Alerts V3VWAP Alerts signal over bought/over sold conditions, relative to volume weighted average price, while deviation bands plot an extremely accurate point of mean reversion.
VWAP Alerts V3 includes multiple timeframe selection, along with multiplier input for deviation band setting
Alerts can be set for each individual band, for extreme oversold/overbought conditions, use "Vwap Low Deviation 4" and "Vwap High Deviation 4".
Alerts can also be set for VWAP bounces, by simply setting "VWAP Alert"
Robust Channel [tbiktag]Introducing the Robust Channel indicator.
This indicator is based on a remarkable property of robust statistics , namely, the resistance to the presence of data points that deviate significantly from the established trend (generally speaking, outliers ). Being outlier-resistant, the Robust Channel indicator “remembers” a pre-existing trend and thus exhibits a very peculiar "lag" in case of a sharp price change. This allows high-confidence identification of such price actions as a trend reversal, range break, pullback, etc.
In the case of trending and range-bound market conditions, the price remains within the channel most of the time, fluctuating around the central line.
Technical details
The central line is calculated using the repeated median slope algorithm. For each data point in a lookback window of a user-specified Length , this method calculates the median slope of the lines that connect that point to all other points inside the window. The overall median of these median slopes is then calculated and used as an estimate of the trend slope. The algorithm is very efficient as it uses an on-the-fly procedure to update the array containing the slopes (new data pushed - old data removed).
The outer line is then calculated as the central line plus the Length -period standard deviation of the price data multiplied by a user-defined Channel Width Factor . The inner line is defined analogously below the central line.
Usage
As a stand-alone indicator, the Robust Channel can be applied similarly to the Bollinger Bands and the Keltner Channel:
A close above the outer line can be interpreted as a bullish signal and a close below the inner line as a bearish signal.
Likewise, a return to the channel from below after a break may serve as a bullish signal, while a return from above may indicate bearish sentiment.
Robust Channel can be also used to confirm chart patterns such as double tops and double bottoms.
If you like this indicator, feel free to leave your feedback in the comments below!
Monte Carlo Range Forecast [DW]This is an experimental study designed to forecast the range of price movement from a specified starting point using a Monte Carlo simulation.
Monte Carlo experiments are a broad class of computational algorithms that utilize random sampling to derive real world numerical results.
These types of algorithms have a number of applications in numerous fields of study including physics, engineering, behavioral sciences, climate forecasting, computer graphics, gaming AI, mathematics, and finance.
Although the applications vary, there is a typical process behind the majority of Monte Carlo methods:
-> First, a distribution of possible inputs is defined.
-> Next, values are generated randomly from the distribution.
-> The values are then fed through some form of deterministic algorithm.
-> And lastly, the results are aggregated over some number of iterations.
In this study, the Monte Carlo process used generates a distribution of aggregate pseudorandom linear price returns summed over a user defined period, then plots standard deviations of the outcomes from the mean outcome generate forecast regions.
The pseudorandom process used in this script relies on a modified Wichmann-Hill pseudorandom number generator (PRNG) algorithm.
Wichmann-Hill is a hybrid generator that uses three linear congruential generators (LCGs) with different prime moduli.
Each LCG within the generator produces an independent, uniformly distributed number between 0 and 1.
The three generated values are then summed and modulo 1 is taken to deliver the final uniformly distributed output.
Because of its long cycle length, Wichmann-Hill is a fantastic generator to use on TV since it's extremely unlikely that you'll ever see a cycle repeat.
The resulting pseudorandom output from this generator has a minimum repetition cycle length of 6,953,607,871,644.
Fun fact: Wichmann-Hill is a widely used PRNG in various software applications. For example, Excel 2003 and later uses this algorithm in its RAND function, and it was the default generator in Python up to v2.2.
The generation algorithm in this script takes the Wichmann-Hill algorithm, and uses a multi-stage transformation process to generate the results.
First, a parent seed is selected. This can either be a fixed value, or a dynamic value.
The dynamic parent value is produced by taking advantage of Pine's timenow variable behavior. It produces a variable parent seed by using a frozen ratio of timenow/time.
Because timenow always reflects the current real time when frozen and the time variable reflects the chart's beginning time when frozen, the ratio of these values produces a new number every time the cache updates.
After a parent seed is selected, its value is then fed through a uniformly distributed seed array generator, which generates multiple arrays of pseudorandom "children" seeds.
The seeds produced in this step are then fed through the main generators to produce arrays of pseudorandom simulated outcomes, and a pseudorandom series to compare with the real series.
The main generators within this script are designed to (at least somewhat) model the stochastic nature of financial time series data.
The first step in this process is to transform the uniform outputs of the Wichmann-Hill into outputs that are normally distributed.
In this script, the transformation is done using an estimate of the normal distribution quantile function.
Quantile functions, otherwise known as percent-point or inverse cumulative distribution functions, specify the value of a random variable such that the probability of the variable being within the value's boundary equals the input probability.
The quantile equation for a normal probability distribution is μ + σ(√2)erf^-1(2(p - 0.5)) where μ is the mean of the distribution, σ is the standard deviation, erf^-1 is the inverse Gauss error function, and p is the probability.
Because erf^-1() does not have a simple, closed form interpretation, it must be approximated.
To keep things lightweight in this approximation, I used a truncated Maclaurin Series expansion for this function with precomputed coefficients and rolled out operations to avoid nested looping.
This method provides a decent approximation of the error function without completely breaking floating point limits or sucking up runtime memory.
Note that there are plenty of more robust techniques to approximate this function, but their memory needs very. I chose this method specifically because of runtime favorability.
To generate a pseudorandom approximately normally distributed variable, the uniformly distributed variable from the Wichmann-Hill algorithm is used as the input probability for the quantile estimator.
Now from here, we get a pretty decent output that could be used itself in the simulation process. Many Monte Carlo simulations and random price generators utilize a normal variable.
However, if you compare the outputs of this normal variable with the actual returns of the real time series, you'll find that the variability in shocks (random changes) doesn't quite behave like it does in real data.
This is because most real financial time series data is more complex. Its distribution may be approximately normal at times, but the variability of its distribution changes over time due to various underlying factors.
In light of this, I believe that returns behave more like a convoluted product distribution rather than just a raw normal.
So the next step to get our procedurally generated returns to more closely emulate the behavior of real returns is to introduce more complexity into our model.
Through experimentation, I've found that a return series more closely emulating real returns can be generated in a three step process:
-> First, generate multiple independent, normally distributed variables simultaneously.
-> Next, apply pseudorandom weighting to each variable ranging from -1 to 1, or some limits within those bounds. This modulates each series to provide more variability in the shocks by producing product distributions.
-> Lastly, add the results together to generate the final pseudorandom output with a convoluted distribution. This adds variable amounts of constructive and destructive interference to produce a more "natural" looking output.
In this script, I use three independent normally distributed variables multiplied by uniform product distributed variables.
The first variable is generated by multiplying a normal variable by one uniformly distributed variable. This produces a bit more tailedness (kurtosis) than a normal distribution, but nothing too extreme.
The second variable is generated by multiplying a normal variable by two uniformly distributed variables. This produces moderately greater tails in the distribution.
The third variable is generated by multiplying a normal variable by three uniformly distributed variables. This produces a distribution with heavier tails.
For additional control of the output distributions, the uniform product distributions are given optional limits.
These limits control the boundaries for the absolute value of the uniform product variables, which affects the tails. In other words, they limit the weighting applied to the normally distributed variables in this transformation.
All three sets are then multiplied by user defined amplitude factors to adjust presence, then added together to produce our final pseudorandom return series with a convoluted product distribution.
Once we have the final, more "natural" looking pseudorandom series, the values are recursively summed over the forecast period to generate a simulated result.
This process of generation, weighting, addition, and summation is repeated over the user defined number of simulations with different seeds generated from the parent to produce our array of initial simulated outcomes.
After the initial simulation array is generated, the max, min, mean and standard deviation of this array are calculated, and the values are stored in holding arrays on each iteration to be called upon later.
Reference difference series and price values are also stored in holding arrays to be used in our comparison plots.
In this script, I use a linear model with simple returns rather than compounding log returns to generate the output.
The reason for this is that in generating outputs this way, we're able to run our simulations recursively from the beginning of the chart, then apply scaling and anchoring post-process.
This allows a greater conservation of runtime memory than the alternative, making it more suitable for doing longer forecasts with heavier amounts of simulations in TV's runtime environment.
From our starting time, the previous bar's price, volatility, and optional drift (expected return) are factored into our holding arrays to generate the final forecast parameters.
After these parameters are computed, the range forecast is produced.
The basis value for the ranges is the mean outcome of the simulations that were run.
Then, quarter standard deviations of the simulated outcomes are added to and subtracted from the basis up to 3σ to generate the forecast ranges.
All of these values are plotted and colorized based on their theoretical probability density. The most likely areas are the warmest colors, and least likely areas are the coolest colors.
An information panel is also displayed at the starting time which shows the starting time and price, forecast type, parent seed value, simulations run, forecast bars, total drift, mean, standard deviation, max outcome, min outcome, and bars remaining.
The interesting thing about simulated outcomes is that although the probability distribution of each simulation is not normal, the distribution of different outcomes converges to a normal one with enough steps.
In light of this, the probability density of outcomes is highest near the initial value + total drift, and decreases the further away from this point you go.
This makes logical sense since the central path is the easiest one to travel.
Given the ever changing state of markets, I find this tool to be best suited for shorter term forecasts.
However, if the movements of price are expected to remain relatively stable, longer term forecasts may be equally as valid.
There are many possible ways for users to apply this tool to their analysis setups. For example, the forecast ranges may be used as a guide to help users set risk targets.
Or, the generated levels could be used in conjunction with other indicators for meaningful confluence signals.
More advanced users could even extrapolate the functions used within this script for various purposes, such as generating pseudorandom data to test systems on, perform integration and approximations, etc.
These are just a few examples of potential uses of this script. How you choose to use it to benefit your trading, analysis, and coding is entirely up to you.
If nothing else, I think this is a pretty neat script simply for the novelty of it.
----------
How To Use:
When you first add the script to your chart, you will be prompted to confirm the starting date and time, number of bars to forecast, number of simulations to run, and whether to include drift assumption.
You will also be prompted to confirm the forecast type. There are two types to choose from:
-> End Result - This uses the values from the end of the simulation throughout the forecast interval.
-> Developing - This uses the values that develop from bar to bar, providing a real-time outlook.
You can always update these settings after confirmation as well.
Once these inputs are confirmed, the script will boot up and automatically generate the forecast in a separate pane.
Note that if there is no bar of data at the time you wish to start the forecast, the script will automatically detect use the next available bar after the specified start time.
From here, you can now control the rest of the settings.
The "Seeding Settings" section controls the initial seed value used to generate the children that produce the simulations.
In this section, you can control whether the seed is a fixed value, or a dynamic one.
Since selecting the dynamic parent option will change the seed value every time you change the settings or refresh your chart, there is a "Regenerate" input built into the script.
This input is a dummy input that isn't connected to any of the calculations. The purpose of this input is to force an update of the dynamic parent without affecting the generator or forecast settings.
Note that because we're running a limited number of simulations, different parent seeds will typically yield slightly different forecast ranges.
When using a small number of simulations, you will likely see a higher amount of variance between differently seeded results because smaller numbers of sampled simulations yield a heavier bias.
The more simulations you run, the smaller this variance will become since the outcomes become more convergent toward the same distribution, so the differences between differently seeded forecasts will become more marginal.
When using a dynamic parent, pay attention to the dispersion of ranges.
When you find a set of ranges that is dispersed how you like with your configuration, set your fixed parent value to the parent seed that shows in the info panel.
This will allow you to replicate that dispersion behavior again in the future.
An important thing to note when settings alerts on the plotted levels, or using them as components for signals in other scripts, is to decide on a fixed value for your parent seed to avoid minor repainting due to seed changes.
When the parent seed is fixed, no repainting occurs.
The "Amplitude Settings" section controls the amplitude coefficients for the three differently tailed generators.
These amplitude factors will change the difference series output for each simulation by controlling how aggressively each series moves.
When "Adjust Amplitude Coefficients" is disabled, all three coefficients are set to 1.
Note that if you expect volatility to significantly diverge from its historical values over the forecast interval, try experimenting with these factors to match your anticipation.
The "Weighting Settings" section controls the weighting boundaries for the three generators.
These weighting limits affect how tailed the distributions in each generator are, which in turn affects the final series outputs.
The maximum absolute value range for the weights is . When "Limit Generator Weights" is disabled, this is the range that is automatically used.
The last set of inputs is the "Display Settings", where you can control the visual outputs.
From here, you can select to display either "Forecast" or "Difference Comparison" via the "Output Display Type" dropdown tab.
"Forecast" is the type displayed by default. This plots the end result or developing forecast ranges.
There is an option with this display type to show the developing extremes of the simulations. This option is enabled by default.
There's also an option with this display type to show one of the simulated price series from the set alongside actual prices.
This allows you to visually compare simulated prices alongside the real prices.
"Difference Comparison" allows you to visually compare a synthetic difference series from the set alongside the actual difference series.
This display method is primarily useful for visually tuning the amplitude and weighting settings of the generators.
There are also info panel settings on the bottom, which allow you to control size, colors, and date format for the panel.
It's all pretty simple to use once you get the hang of it. So play around with the settings and see what kinds of forecasts you can generate!
----------
ADDITIONAL NOTES & DISCLAIMERS
Although I've done a number of things within this script to keep runtime demands as low as possible, the fact remains that this script is fairly computationally heavy.
Because of this, you may get random timeouts when using this script.
This could be due to either random drops in available runtime on the server, using too many simulations, or running the simulations over too many bars.
If it's just a random drop in runtime on the server, hide and unhide the script, re-add it to the chart, or simply refresh the page.
If the timeout persists after trying this, then you'll need to adjust your settings to a less demanding configuration.
Please note that no specific claims are being made in regards to this script's predictive accuracy.
It must be understood that this model is based on randomized price generation with assumed constant drift and dispersion from historical data before the starting point.
Models like these not consider the real world factors that may influence price movement (economic changes, seasonality, macro-trends, instrument hype, etc.), nor the changes in sample distribution that may occur.
In light of this, it's perfectly possible for price data to exceed even the most extreme simulated outcomes.
The future is uncertain, and becomes increasingly uncertain with each passing point in time.
Predictive models of any type can vary significantly in performance at any point in time, and nobody can guarantee any specific type of future performance.
When using forecasts in making decisions, DO NOT treat them as any form of guarantee that values will fall within the predicted range.
When basing your trading decisions on any trading methodology or utility, predictive or not, you do so at your own risk.
No guarantee is being issued regarding the accuracy of this forecast model.
Forecasting is very far from an exact science, and the results from any forecast are designed to be interpreted as potential outcomes rather than anything concrete.
With that being said, when applied prudently and treated as "general case scenarios", forecast models like these may very well be potentially beneficial tools to have in the arsenal.
MACD BandsThis is MACD indicator on the price chart. You can read the same information as the original MACD but much more.
You can use it the same way as MACD but it won't use any space below your chart. Also you can use signal line and cloud as trend confirmation: e.g. if above them it can be a stronger uptrend.
The signal line (yellow by default) can be used as a support-resistance line.
If teal line is above maroon line, MACD is positive, otherwise it is negative
MACD value is the width of the cloud
Cloud color is green when MACD histogram is positive, red if negative
You can change MA types
MACD and histogram values can be seen in Data Window
Torben BandsExtending the Works of Torben Mogensen, on Torben Median
Median Filtering is an important technique !
The median filter is a non-linear digital filtering technique, often used to remove noise from an image or signal. Such noise reduction is a typical pre-processing step to improve the results of later processing (for example, edge detection on an image). Median filtering is very widely used in digital image processing because, under certain conditions, it preserves edges while removing noise (but see the discussion below), also having applications in signal processing.
How its made?
Torben Medians of high and low of period of 21 are combined with ATR adjustments and plotted over the price
Enjoy!
VIX Implied Move Bands for ES/Emini futuresThis script uses the close of the VIX on a daily resolution to provide the 'implied move' for the E-mini SP500 futures. While it can be applied to any equity index, it's crucial to know that the VIX is calculated using SPX options, and may not reflect the implied volatility of other indices. The user can adjust the length of the moving average used to calculate the bands, the window of days used to calculate the implied move, and the multiplier that effects the width of the bands.
Arnaud Legoux Moving Average With ATR BandsArnaud Legoux Moving Average With ATR Bands to get an idea of the volatility.
FibBand, Perfect Trendline Trader and Target SystemSo, Dear Friends, I am open-sourcing one of my scripts which I created as a thesis project,
The Auto Trader System is a Scalping Tool , to be used mostly in intraday Setups!!
and is designed using,
1. Fibonacci Bands
Fibo Bands are Calculated by defining dynamic Fibonacci Pivots Lines over a history of Lookup values (Default is 89 periods lookback),
The bands help in identifying the Target Points for the setup
2. Perfect TrendLine Setup
The script uses PTS, as a filter to define the optimum entry and exit points
Which timeframe it works for ?
Works for Any Time Frame, but Intraday setups are good!
Who is this System for ?
Beginner and Intermediate Traders
Provision For Alerts
The Script has provision for both long and short alerts!!
Enjoy!
Acceleration BandsAcceleration Bands
Description:
Acceleration Bands serve as a trading envelope that factor in an assets typical volatility over standard settings of 20 or 80 bars. They can be used across any time period, though traders prefer to use them most across weekly and monthly timeframes as breakout indicators outside these bands.
Using the shorter time frames can define likely support and resistance levels at the lower and upper Acceleration Bands.
Entry is usually made at the breakout point. Once the price closes back within the Acceleration Bands, this is taken as a signal that the acceleration period is over and it’s best to close out the trade.
ATR BandsIt has happened to everybody. You enter the market, the position gets a stop loss, then later the market goes in the direction you originally planned. Worse yet - you enter a position, the market goes in your favor, gets near the target, and then it reverses and you get stopped.
We brazilians call this a "violinado", or getting violinated. It happens either because:
1. You put the stop loss too close, or the target too far
2. You entered in the right direction, but at a wrong time
While the second point cannot be programmly adressed, the first can. One popular way of setting a stop loss is by using the average of the true range, it even has a built-in indicator in TV. The problem with it is that you can still get violinated, since as the trend develops, the stop loss only goes up, never down. So if you enter at the wrong time, one slip can still take you out of the market.
Since I got sick of losing money using a conventional stop loss, I made these ATR bands. When you add this indicator to your graph, 6 lines are going to show up, 3 above the price, 3 below it. These lines are calculated from the ATR of the last 20 periods (can be configurated). The upper lines are the high of the last candle + the ATR * the multiplicator factor, the lower lines are the low - ATR * multiplicator factor. There are three multiplicator factors: 1.0, 1.618 and 2.0, and you change them to be whatever you want.
The logic behind it is that theses bands represents the region in which the market is more likely to stay. So if you enter the market at 50.00, you can't expect it to reach 500.00 in the next hour if the ATR is 5.00. And if you set the stop loss at 49.99, it is very likely that the market is going to stop you. By using the ATR bands, you can get a more reasonable price range, so you would set the stop loss at 45.00 and the take profit level at 60.00.
There are two types os ATR you can use: the regular, calculated with RMA, and another using a custom WMA, which puts greater emphasis on large amplitudes. By default, the average uses the past 20 true ranges. You can also choose to use either the closing price or the extremes of the candle as a basis.
Another thing I've added is the violation statistics, which shows the percentages of the times that a band was violated in the next 5 candles (can be configurated). With this, you can get a broader view on the probability of the bands actually being reached.
You may have notice that the bands are lagged by 1 period. I did this so that there is no way you can use future data. You can disable it or increase it, but I recommend just letting it be 1. These bands are the range in which the price is most likely to stay in, if you change the lag you are essentially breaking it's whole purpose.
Exponential Deviation Bands Width [ChuckBanger]This indicator is a compliment to Exponential Deviation Bands . It is the difference between the upper and the lower bands divided by the middle band. It is an easy way to visualize consolidation before price movements or periods of higher volatility.
How it works
During a period of high volatility, the distance between the two bands will widen and Exponential Deviation Bands width will increase. And the opposite occurs during a period of low volatility, the distance between the two bands will contract and Exponential Deviation Bands width will decrease. Meaning there is a tendency for bands to alternate between expansion and contraction.
When the bands are relatively far apart, that is often is a sign that the current trend is ending. When the distance between the two bands is relatively narrow that often is a sign that the market is about to initiate a bigger move in either direction.
Combo Backtest 123 Reversal & High Low Bands This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
As the name suggests, High low bands are two bands surrounding the underlying’s
price. These bands are generated from the triangular moving averages calculated
from the underlying’s price. The triangular moving average is, in turn, shifted
up and down by a fixed percentage. The bands, thus formed, are termed as High
low bands. The main theme and concept of High low bands is based upon the triangular
moving average.
WARNING:
- For purpose educate only
- This script to change bars colors.
Square Root Moving AverageAbstract
This script computes moving averages which the weighting of the recent quarter takes up about a half weight.
This script also provides their upper bands and lower bands.
You can apply moving average or band strategies with this script.
Introduction
Moving average is a popular indicator which can eliminate market noise and observe trend.
There are several moving average related strategies used by many traders.
The first one is trade when the price is far from moving average.
To measure if the price is far from moving average, traders may need a lower band and an upper band.
Bollinger bands use standard derivation and Keltner channels use average true range.
In up trend, moving average and lower band can be support.
In ranging market, lower band can be support and upper band can be resistance.
In down trend, moving average and upper band can be resistance.
An another group of moving average strategy is comparing short term moving average and long term moving average.
Moving average cross, Awesome oscillators and MACD belong to this group.
The period and weightings of moving averages are also topics.
Period, as known as length, means how many days are computed by moving averages.
Weighting means how much weight the price of a day takes up in moving averages.
For simple moving averages, the weightings of each day are equal.
For most of non-simple moving averages, the weightings of more recent days are higher than the weightings of less recent days.
Many trading courses say the concept of trading strategies is more important than the settings of moving averages.
However, we can observe some characteristics of price movement to design the weightings of moving averages and make them more meaningful.
In this research, we use the observation that when there are no significant events, when the time frame becomes 4 times, the average true range becomes about 2 times.
For example, the average true range in 4-hour chart is about 2 times of the average true range in 1-hour chart; the average true range in 1-hour chart is about 2 times of the average true range in 15-minute chart.
Therefore, the goal of design is making the weighting of the most recent quarter is close to the weighting of the rest recent three quarters.
For example, for the 24-day moving average, the weighting of the most recent 6 days is close to the weighting of the rest 18 days.
Computing the weighting
The formula of moving average is
sum ( price of day n * weighting of day n ) / sum ( weighting of day n )
Day 1 is the most recent day and day k+1 is the day before day k.
For more convenient explanation, we don't expect sum ( weighting of day n ) is equal to 1.
To make the weighting of the most recent quarter is close to the weighting of the rest recent three quarters, we have
sum ( weighting of day 4n ) = 2 * sum ( weighting of day n )
If when weighting of day 1 is 1, we have
sum ( weighting of day n ) = sqrt ( n )
weighting of day n = sqrt ( n ) - sqrt ( n-1 )
weighting of day 2 ≒ 1.414 - 1.000 = 0.414
weighting of day 3 ≒ 1.732 - 1.414 = 0.318
weighting of day 4 ≒ 2.000 - 1.732 = 0.268
If we follow this formula, the weighting of day 1 is too strong and the moving average may be not stable.
To reduce the weighting of day 1 and keep the spirit of the formula, we can add a parameter (we call it as x_1w2b).
The formula becomes
weighting of day n = sqrt ( n+x_1w2b ) - sqrt ( n-1+x_1w2b )
if x_1w2b is 0.25, then we have
weighting of day 1 = sqrt(1.25) - sqrt(0.25) ≒ 1.1 - 0.5 = 0.6
weighting of day 2 = sqrt(2.25) - sqrt(1.25) ≒ 1.5 - 1.1 = 0.4
weighting of day 3 = sqrt(3.25) - sqrt(2.25) ≒ 1.8 - 1.5 = 0.3
weighting of day 4 = sqrt(4.25) - sqrt(3.25) ≒ 2.06 - 1.8 = 0.26
weighting of day 5 = sqrt(5.25) - sqrt(4.25) ≒ 2.3 - 2.06 = 0.24
weighting of day 6 = sqrt(6.25) - sqrt(5.25) ≒ 2.5 - 2.3 = 0.2
weighting of day 7 = sqrt(7.25) - sqrt(6.25) ≒ 2.7 - 2.5 = 0.2
What you see and can adjust in this script
This script plots three moving averages described above.
The short term one is default magenta, 6 days and 1 atr.
The middle term one is default yellow, 24 days and 2 atr.
The long term one is default green, 96 days and 4 atr.
I arrange the short term 6 days to make it close to sma(5).
The other twos are arranged according to 4x length and 2x atr.
There are 9 curves plotted by this script. I made the lower bands and the upper bands less clear than moving averages so it is less possible misrecognizing lower or upper bands as moving averages.
x_src : how to compute the reference price of a day, using 1 to 4 of open, high, low and close.
len : how many days are computed by moving averages
atr : how many days are computed by average true range
multi : the distance from the moving average to the lower band and the distance from the moving average to the lower band are equal to multi * average true range.
x_1w2b : adjust this number to avoid the weighting of day 1 from being too strong.
Conclusion
There are moving averages which the weighting of the most recent quarter is close to the weighting of the rest recent three quarters.
We can apply strategies based on moving averages. Like most of indicators, oversold does not always means it is an opportunity to buy.
If the short term lower band is close to the middle term moving average or the middle term lower band is close to the long term moving average, it may be potential support value.
References
Computing FIR Filters Using Arrays
How to trade with moving averages : the eight trading signals concluded by Granville
How to trade with Bollinger bands
How to trade with double Bollinger bands
Resampling Reverse Engineering Bands [DW]This is an experimental study designed to reverse engineer price levels from centered oscillators at user defined sample rates.
This study aims to educate users on the process of oscillator reverse engineering, and to give users an alternative perspective on some of the most commonly used oscillators in the trading game.
Reverse engineering price levels from an oscillator is actually a rather simple, straightforward process.
Rather than plugging price values into a function to solve for oscillator values, we rearrange the function using some basic algebraic operations and plug in a specified oscillator value to solve for price values instead.
This process tells us what price value is needed in order for the oscillator to equal a certain value.
For example, if you wanted to know what price value would be considered “overbought” or “oversold” according to your oscillator, you can do that using this process.
In this study, the reverse engineering functions are used to calculate the price values of user defined high and low oscillator thresholds, and the price values for the oscillator center.
This allows you to visualize what prices will trigger thresholds as a sort of confidence interval, which is information that isn't inherently available when simply analyzing the oscillator directly.
This script is equipped with three reverse engineering functions to choose from for calculating the band values:
-> Reverse Relative Strength Index (RRSI)
-> Reverse Stochastic Oscillator (RStoch)
-> Reverse Commodity Channel Index (RCCI)
You can easily select the function you want to utilize from the "Band Calculation Type" dropdown tab.
These functions are specially designed to calculate at any sample rate (up to 1 bar per sample) utilizing the process of downsampling that I introduced in my Resampling Filter Pack.
The sample rate can be determined with any of these three methods:
-> BPS - Resamples based on the number of bars.
-> Interval - Resamples based on time in multiples of current charting timeframe.
-> PA - Resamples based on changes in price action by a specified size. The PA algorithm in this script is derived from my Range Filter algorithm.
The range for PA method can be sized in points, pips, ticks, % of price, ATR, average change, and absolute quantity.
Utilizing downsampled rates allows you to visualize the reverse engineered values of an oscillator calculated at larger sample scales.
This can be rather beneficial for trend analysis since lower sample rates completely remove certain levels of noise.
By default, the sample rate is set to 1 BPS, which is the same as bar-to-bar calculation. Feel free to experiment with the sample rate parameters and configure them how you like.
Custom bar colors are included as well. The color scheme is based on disparity between sources and the reverse engineered center level.
In addition, background highlights are included to indicate when price is outside the bands, thus indicating "overbought" and "oversold" conditions according to the thresholds you set.
I also included four external output variables for easy integration of signals with other scripts:
-> Trend Signals (Current Resolution Prices) - Outputs 1 for bullish and -1 for bearish based on disparity between current resolution source and the central level output.
-> Trend Signals (Resampled Prices) - Outputs 1 for bullish and -1 for bearish based on disparity between resampled source and the central level output.
-> Outside Band Signal (Current Resolution Prices) - Outputs 1 for overbought and -1 for oversold based on current resolution source being outside the bands. Returns 0 otherwise.
-> Outside Band Signal (Resampled Prices) - Outputs 1 for overbought and -1 for oversold based on resampled source being outside the bands. Returns 0 otherwise.
To use these signals with another script, simply select the corresponding external output you want to use from your script's source input dropdown tab.
Reverse engineering oscillators is a simple, yet powerful approach to incorporate into your momentum or trend analysis setup.
By incorporating projected price levels from oscillators into our analysis setups, we are able to gain valuable insights, make (potentially) smarter trading decisions, and visualize the oscillators we know and love in a totally different way.
I hope you all find this script useful and enjoyable!
Volume Bars and Regions of InterestThe bars are colored according to the volume traded. The volume weights were distributed logically for a better analysis.
<0.666 low volume
0.666 to 1.333 median volume
1,333 to 2,666 high volume
> 2,666 'institutional' volume
The moving average bands are the average of the highs and lows. They show a region of interest and not just a 'line'.
Ultimate VWAP Bands- Ultimate VWAP Bands is a script that helps to decide and further clarify areas of oversold and overbought conditions.
- For example, when the price is in the lowest band it is extremely oversold relative to the VWAP . Hence it should be considered a good place to buy with a high risk to reward payoff.
- Each band is set at a fixed offset away from the VWAP . The "VWAP Band Multiplier" adjusts this and is a key part of the script. This allows the indicator to be adjusted based on the assets volatility . For example, with Crypto. A multiplier of 1 would be strongly advised. Whilst a multiplier of 0.1-0.25 would be useful for currency pairs.
- This indicator can be used for all manners of trading. However, it is most effective when used for scalping and swing trading.