Repeated Median Regression ChannelThis script uses the Repeated Median (RM) estimator to construct a linear regression channel and thus offers an alternative to the available codes based on ordinary least squares.
The RM estimator is a robust linear regression algorithm. It was proposed by Siegel in 1982 (1) and has since found many applications in science and engineering for linear trend estimation and data filtering.
The key difference between RM and ordinary least squares methods is that the slope of the RM line is significantly less affected by data points that deviate strongly from the established trend. In statistics, these points are usually called outliers, while in the context of price data, they are associated with gaps, reversals, breaks from the trading range. Thus, robustness to outlier means that the nascent deviation from a predetermined trend will be more clearly seen in the RM regression compared to the least-squares estimate. For the same reason, the RM model is expected to better depict gaps and trend changes (2).
Input Description
Length : Determines the length of the regression line.
Channel Multiplier : Determines the channel width in units of root-mean-square deviation.
Show Channel : If switched off , only the (central) regression line is displayed.
Show Historical Broken Channel : If switched on , the channels that were broken in the past are displayed. Note that a certain historical broken channel is shown only when at least Length / 2 bars have passed since the last historical broken channel.
Print Slope : Displays the value of the current RM slope on the graph.
Method
Calculation of the RM regression line is done as follows (1,3):
For each sample point ( t (i), y (i)) with i = 1.. Length , the algorithm calculates the median of all the slopes of the lines connecting this point to the other Length -1 points.
The regression slope is defined as the median of the set of these median slopes.
The regression intercept is defined as the median of the set { y (i) – m * t (i)}.
Computational Time
The present implementation utilizes a brute-force algorithm for computing the RM-slope that takes O ( Length ^2) time. Therefore, the calculation of the historical broken channels might take a relatively long time (depending on the Length parameter). However, when the Show Historical Broken Channel option is off, only the real-time RM channel is calculated, and this is done quite fast.
References
1. A. F. Siegel (1982), Robust regression using repeated medians, Biometrika, 69 , 242–244.
2. P. L. Davies, R. Fried, and U. Gather (2004), Robust signal extraction for on-line monitoring data, Journal of Statistical Planning and Inference 122 , 65-78.
3. en.wikipedia.org
"algo"に関するスクリプトを検索
Tic Tac Toe (For Fun)Hello All,
I think all of you know the game "Tic Tac Toe" :) This time I tried to make this game, and also I tried to share an example to develop a game script in Pine. Just for fun ;)
Tic Tac Toe Game Rules:
1. The game is played on a grid that's 3 squares by 3 squares.
2. You are "O", the computer is X. Players take turns putting their marks in empty squares.
3. if a player makes 3 of her marks in a row (up, down, across, or diagonally) the he is the winner.
4. When all 9 squares are full, the game is over (draw)
So, how to play the game?
- The player/you can play "O", meaning your mark is "O", so Xs for the script. please note that: The script plays with ONLY X
- There is naming for all squears, A1, A2, A3, B1, B2, B3, C1, C2, C3. you will see all these squares in the options.
- also You can set who will play first => "Human" or "Computer"
if it's your turn to move then you will see "You Move" text, as seen in the following screenshot. for example you want to put "O" to "A1" then using options set A1 as O
How the script play?
it uses MinMax algorithm with constant depth = 4. And yes we don't have option to make recursive functions in Pine at the moment so I made four functions for each depth. this idea can be used in your scripts if you need such an algorithm. if you have no idea about MinMax algorithm you can find a lot of articles on the net :)
The script plays its move automatically if its turn to play. you will just need to set the option that computer played (A1, C3, etc)
if it's computer turn to play then it calculates and show the move it wants to play like "My Move : B3 <= X" then using options you need to set B3 as X
Also it checks if the board is valid or not:
I have tested it but if you see any bug let me know please
Enjoy!
Max Drawdown Calculating Functions (Optimized)Maximum Drawdown and Maximum Relative Drawdown% calculating functions.
I needed a way to calculate the maxDD% of a serie of datas from an array (the different values of my balance account). I didn't find any builtin pinescript way to do it, so here it is.
There are 2 algorithms to calculate maxDD and relative maxDD%, one non optimized needs n*(n - 1)/2 comparisons for a collection of n datas, the other one only needs n-1 comparisons.
In the example we calculate the maxDDs of the last 10 close values.
There a 2 functions : "maximum_relative_drawdown" and "maximum_dradown" (and "optimized_maximum_relative_drawdown" and "optimized_maximum_drawdown") with names speaking for themselves.
Input : an array of floats of arbitrary size (the values we want the DD of)
Output : an array of 4 values
I added the iteration number just for fun.
Basically my script is the implementation of these 2 algos I found on the net :
var peak = 0;
var n = prices.length
for (var i = 1; i < n; i++){
dif = prices - prices ;
peak = dif < 0 ? i : peak;
maxDrawdown = maxDrawdown > dif ? maxDrawdown : dif;
}
var n = prices.length
for (var i = 0; i < n; i++){
for (var j = i + 1; j < n; j++){
dif = prices - prices ;
maxDrawdown = maxDrawdown > dif ? maxDrawdown : dif;
}
}
Feel free to use it.
@version=4
[blackcat] L2 Ehlers Autocorrelation PeriodogramLevel: 2
Background
John F. Ehlers introduced Autocorrelation Periodogram in his "Cycle Analytics for Traders" chapter 8 on 2013.
Function
Construction of the autocorrelation periodogram starts with the autocorrelation function using the minimum three bars of averaging. The cyclic information is extracted using a discrete Fourier transform (DFT) of the autocorrelation results. This approach has at least four distinct advantages over other spectral estimation techniques. These are:
1. Rapid response. The spectral estimates start to form within a half-cycle period of their initiation.
2. Relative cyclic power as a function of time is estimated. The autocorrelation at all cycle periods can be low if there are no cycles present, for example, during a trend. Previous works treated the maximum cycle amplitude at each time bar equally.
3. The autocorrelation is constrained to be between minus one and plus one regardless of the period of the measured cycle period. This obviates the need to compensate for Spectral Dilation of the cycle amplitude as a function of the cycle period.
4. The resolution of the cyclic measurement is inherently high and is independent of any windowing function of the price data.
The dominant cycle is extracted from the spectral estimate in the next block of code using a center-of-gravity (CG) algorithm. The CG algorithm measures the average center of two-dimensional objects. The algorithm computes the average period at which the powers are centered. That is the dominant cycle. The dominant cycle is a value that varies with time. The spectrum values vary between 0 and 1 after being normalized. These values are converted to colors. When the spectrum is greater than 0.5, the colors combine red and yellow, with yellow being the result when spectrum = 1 and red being the result when the spectrum = 0.5. When the spectrum is less than 0.5, the red saturation is decreased, with the result the color is black when spectrum = 0.
Key Signal
DominantCycle --> Dominant Cycle
Period --> Autocorrelation Periodogram Array
Pros and Cons
100% John F. Ehlers definition translation of original work, even variable names are the same. This help readers who would like to use pine to read his book. If you had read his works, then you will be quite familiar with my code style.
Remarks
The 49th script for Blackcat1402 John F. Ehlers Week publication.
Courtesy of @RicardoSantos for RGB functions.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
BuyTheDipWell, I often had arguments in online forum with a guy who claimed to time the market perfectly without any technical analysis or prior experience. He often claimed that technical analysis does not work and it only works when you trade on other's emotions. He also argued that algorithmic trading isn't profitable - if so, everyone would do that. Hence, I thought I will convert his idea to algorithm.
In his own words, the strategy is as below:
Chose an instrument which is in full uptrend.
Wait for the panic sell and buy the dip
Once market recovers back exit immediately
It seems to do just fine with indexes. But, not so good when it comes to stocks.
Trend-Range IdentifierTrend trading algorithms fail in ranging market and Swing trading algorithm fail in trending market. Purpose of this indicator is to identify if the instrument is trending or ranging so that you can apply appropriate trading algorithm for the market.
Process:
ATR is calculated based on the input parameter atrLength
Range/Channel containing upLine and downLine is calculated by adding/subtracting atrMultiplier * atr to close price.
This range/channel will remain same until the price breaks either upLine or downLine.
Once price crosses one among upLine and downLine, then new upLine/downLine is calculated based on latest close price.
If price breaks upLine, the trend is considered to be up until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in lime and upLine/downLine are colored in green.
If price breaks downLine, the trend is considered to be down until the next line break or no lines are broken for rangeLength bars. During this state, candles are colored in orange and upLine/downLine are colored in red.
If close price does not break either upLine or downLine for rangeLength bars, then the instrument is considered to be in range. During this state, candles are colored in silver and upLine/downLine are colored in purple.
In ranging duration, we display one among Keltner Channel, Bollinger Band or Donchian Band as per input parameter : rangeChannel . Other parameters used for calculation are rangeLength and stdDev
I have not fully optimized parameters. Suggestions and feedback welcome.
Dynamic Dots Dashboard (a Cloud/ZLEMA Composite)The purpose of this indicator is to provide an easy-to-read binary dashboard of where the current price is relative to key dynamic supports and resistances. The concept is simple, if a dynamic s/r is currently acting as a resistance, the indicator plots a dot above the histogram in the red box. If a dynamic s/r is acting as support, a dot is plotted in the green box below.
There are some additional features, but the dot graphs are king.
_______________________________________________________________________________________________________________
KEY:
_______________________________________________________________________________________________________________
Currently the dynamic s/r's being used in the dot plots are:
Ichimoku Cloud:
Tenkan (blue)
Kijun (pink)
Senkou A (red)
Senkou B (green)
ZLEMA (Zero Lag Exponential Moving Average)
99 ZLEMA (lavender)
200 ZLEMA (salmon)
You'll see a dashed line through the middle of the resistances section (red) and supports section (green). Cloud indicators are plotted above the dashed line, and ZLEMA's are below.
_______________________________________________________________________________________________________________
How it Works - Visual
_______________________________________________________________________________________________________________
As stated in the intro - if a dynamic s/r is currently above the current price and acting as a resistance, the indicator plots a dot above the histogram in the red box. If a dynamic s/r is acting as support, a dot is plotted in the green box below. Additionally, there is an optional histogram (default is on) that will further visualize this relationship. The histogram is a simple summation of the resistances above and the supports below.
Here's a visual to assist with what that means. This chart includes all of those dynamic s/r's in the dynamic dot dashboard (the on-chart parts are individually added, not part of this tool).
You can see that as a dynamic support is lost, the corresponding dot is moved from the supports section at the bottom (green), to the resistances section at the top (red). The opposite being true as resistances are being overtaken (broken resistances are moved to the support section (red)). You can see that the raw chart is just... a mess. Which kinda of accentuates one of the key goals of this indicator: to get all that dynamic support info without a mess of a chart like that.
_______________________________________________________________________________________________________________
How To Use It
_______________________________________________________________________________________________________________
There are a lot of ways to use this information, but the most notable of which is to detect shifts in the market cycle.
For this example, take a look at the dynamic s/r dots in the resistances category (red background). You can see clearly that there are distinctive blocks of high density dots that have clear beginnings and ends. When we transition from a high density of dots to none in resistances, that means we are flipping them as support and entering a bull cycle. On the other hand, when we go from low density of dots as resistances to high density, we're pivoting to a bear cycle. Easy as that, you can quickly detect when market cycles are beginning or ending.
Alternatively, you can add your preferred linear SR's, fibs, etc. to the chart and quickly glance at the dashboard to gauge how dynamic SR's may be contributing to the risk of your trade.
_______________________________________________________________________________________________________________
Who It's For
_______________________________________________________________________________________________________________
New traders: by looking at dot density alone, you can use Dot Dynamics to spot transitionary phases in market cycles.
Experienced traders: keep your charts clean and the information easy to digest.
Developers: I created this originally as a starting point for more complex algos I'm working on. One algo is reading this dot dashboard and taking a position size relative to the s/r's above and below. Another cloud algo is using the results as inputs to spot good setups.
Colored Bars
There is an option (off by default, shown in the headline image above) to fill the bar colors based on how many dynamic s/r's are above or below the current price. This can make things easier for some users, confusing for others. I defaulted them to off as I don't want colors to confuse the primary value proposition of the indicators, which is the dot heat map. You can turn on colored bars in the settings.
One thing to note with the colored bars: they plot the color purely by the dot densities. Random spikes in the gradient colors (i.e. red to lime or green) can be a useful thing to notice, as they commonly occur at places where the price is bouncing between dynamic s/r's and can indicate a paradigm shift in the market cycle.
_______________________________________________________________________________________________________________
Timeframes and Assets
_______________________________________________________________________________________________________________
This can be used effectively on all assets (stocks, crypto, forex, etc) and all time frames. As always with any indicator, the higher TF's are generally respected more than lower TF's.
Thanks for checking it out! I've been trading crypto for years and am just now beginning to publish my ideas, secret-sauce scripts and handy tools (like this one). If you enjoyed this indicator and would like to see more, a like and a follow is greatly appreciated 😁.
McGinley Dynamic (Improved) - John R. McGinley, Jr.For all the McGinley enthusiasts out there, this is my improved version of the "McGinley Dynamic", originally formulated and publicized in 1990 by John R. McGinley, Jr. Prior to this release, I recently had an encounter with a member request regarding the reliability and stability of the general algorithm. Years ago, I attempted to discover the root of it's inconsistency, but success was not possible until now. Being no stranger to a good old fashioned computational crisis, I revisited it with considerable contemplation.
I discovered a lack of constraints in the formulation that either caused the algorithm to implode to near zero and zero OR it could explosively enlarge to near infinite values during unusual price action volatility conditions, occurring on different time frames. A numeric E-notation in a moving average doesn't mean a stock just shot up in excess of a few quintillion in value from just "10ish" moments ago. Anyone experienced with the usual McGinley Dynamic, has probably encountered this with dynamically dramatic surprises in their chart, destroying it's usability.
Well, I believe I have found an answer to this dilemma of 'susceptibility to miscalculation', to provide what is most likely McGinley's whole hearted intention. It required upgrading the formulation with two constraints applied to it using min/max() functions. Let me explain why below.
When using base numbers with an exponent to the power of four, some miniature numbers smaller than one can numerically collapse to near 0 values, or even 0.0 itself. A denominator of zero will always give any computational device a horribly bad day, not to mention the developer. Let this be an EASY lesson in computational division, I often entertainingly express to others. You have heard the terminology "$#|T happens!🙂" right? In the programming realm, "AnyNumber/0.0 CAN happen!🤪" too, and it happens "A LOT" unexpectedly, even when it's highly improbable. On the other hand, numbers a bit larger than 2 with the power of four can tremendously expand rapidly to the numeric limits of 64-bit processing, generating ginormous spikes on a chart.
The ephemeral presence of one OR both of those potentials now has a combined satisfactory remedy, AND you as TV members now have it, endowed with the ever evolving "Power of Pine". Oh yeah, this one plots from bar_index==0 too. It also has experimental settings tweaks to play with, that may reveal untapped potential of this formulation. This function now has gain of function capabilities, NOT to be confused with viral gain of function enhancements from reckless BSL-4 leaking laboratories that need to be eternally abolished from this planet. Although, I do have hopes this imd() function has the potential to go viral. I believe this improved function may have utility in the future by developers of the TradingView community. You have the source, and use it wisely...
I included an generic ema() plot for a basic comparison, ultimately unveiling some of this algorithm's unique characteristics differing on a variety of time frames. Also another unconstrained function is included to display some the disparities of having no limitations on a divisor in the calculation. I strongly advise against the use of umd() in any published script. There is simply just no reason to even ponder using it. I also included notes in the script to warn against this. It's funny now, but some folks don't always read/understand my advisories... You have been warned!
NOTICE: You have absolute freedom to use this source code any way you see fit within your new Pine projects, and that includes TV themselves. You don't have to ask for my permission to reuse this improved function in your published scripts, simply because I have better things to do than answer requests for the reuse of this simplistic imd() function. Sufficient accreditation regarding this script and compliance with "TV's House Rules" regarding code reuse, is as easy as copying the entire function as is. Fair enough? Good! I have a backlog of "computational crises" to contend with, including another one during the writing of this elaborate description.
When available time provides itself, I will consider your inquiries, thoughts, and concepts presented below in the comments section, should you have any questions or comments regarding this indicator. When my indicators achieve more prevalent use by TV members, I may implement more ideas when they present themselves as worthy additions. Have a profitable future everyone!
Many Moving AveragesThis script allows you to add two moving averages to a chart, where the type of moving average can be chosen from a collection of 15 different moving average algorithms. Each moving average can also have different lengths and crossovers/unders can be displayed and alerted on.
The supported moving average types are:
Simple Moving Average ( SMA )
Exponential Moving Average ( EMA )
Double Exponential Moving Average ( DEMA )
Triple Exponential Moving Average ( TEMA )
Weighted Moving Average ( WMA )
Volume Weighted Moving Average ( VWMA )
Smoothed Moving Average ( SMMA )
Hull Moving Average ( HMA )
Least Square Moving Average/Linear Regression ( LSMA )
Arnaud Legoux Moving Average ( ALMA )
Jurik Moving Average ( JMA )
Volatility Adjusted Moving Average ( VAMA )
Fractal Adaptive Moving Average ( FRAMA )
Zero-Lag Exponential Moving Average ( ZLEMA )
Kauman Adaptive Moving Average ( KAMA )
Many of the moving average algorithms were taken from other peoples' scripts. I'd like to thank the authors for making their code available.
JayRogers
Alex Orekhov (everget)
Alex Orekhov (everget)
Joris Duyck (JD)
nemozny
Shizaru
KobySK
Jurik Research and Consulting for inventing the JMA.
BitradertrackerEste Indicador ya no consiste en líneas móviles que se cruzan para dar señales de entrada o salida, si no que va más allá e interpreta gráficamente lo que está sucediendo con el valor.
Es un algoritmo potente, que incluye 4 indicadores de tendencia y 2 indicadores de volumen.
Con este indicador podemos movernos con las "manos fuertes" del mercado, rastrear sus intenciones y tomar decisiones de compra y venta.
Diseñado para operar en criptomonedas.
En cuanto a qué temporalidad usar, cuanto más grande mejor, ya que al final lo que estamos haciendo es el análisis de datos y, por lo tanto, cuanto más datos, mejor. Personalmente recomiendo usarlo en velas de 30 minutos, 1 hora y 4 horas.
Recuerde, ningún indicador es 100% efectivo.
Este indicador nos muestra en las áreas de color púrpura (manos fuertes) y en las áreas de color verde (manos débiles) y al mostrármelo gráficamente ya el indicador vale la pena.
El mercado está impulsado por dos tipos de inversores, que se denominan manos fuertes o ballenas (agencias, fondos, empresas, bancos, etc.) y manos débiles o peces pequeños (es decir, nosotros).
No tenemos la capacidad de manipular un valor, ya que nuestra cartera es limitada, pero podemos ingresar y salir de los valores fácilmente ya que no tenemos mucho dinero.
Las ballenas pueden manipular un valor ya que tienen muchos bitcoins y / o dinero, sin embargo, no pueden moverse fácilmente.
Entonces, ¿como pueden comprar o vender sus monedas las ballenas? Bueno, ellos hacen su juego: Tratan de hacernos creer que la moneda esta barata cuando nos quieren vender sus monedas o hacernos creer que la moneda es cara cuando quieren comprar nuestras monedas. Esta manipulación se realiza de muchas maneras, la mayoría por noticias.
Nosotros, los pequeños peces, no podemos competir contra las ballenas, pero podemos descubrir qué están haciendo (recuerde, son lentas, mueven sus monstruosas cantidades de dinero) debemos movernos con ellas e imitarlas. Mejor estar bajo la ballena que delante de ella.
Con este indicador puedes ver cuando las ballenas están operando y reaccionar ; porque el enfoque matemático que los sustenta ha demostrado ser bastante exitoso.
Cuando las manos fuertes están por debajo de cero, se dice que están comprando. Lo mismo ocurre con las manos débiles. Generalmente, si las manos fuertes están comprando o vendiendo, el precio está lateralizado. El movimiento del precio está asociado con las compras y ventas realizadas por la mano débil.
Espero que les sea de mucha utilidad.
Bitrader4.0
This indicator no longer consists of mobile lines that intersect to give input or output signals, but it goes further and graphically interprets what is happening with the value.
It is a powerful algorithm, which includes 4 trend indicators and 2 volume indicators.
With this indicator we can move with the "strong hands" of the market, track their intentions and make buying and selling decisions.
Designed to operate in cryptocurrencies.
As for what temporality to use, the bigger the better, since in the end what we are doing is the analysis of data and, therefore, the more data, the better. Personally I recommend using it in candles of 30 minutes, 1 hour and 4 hours.
Remember, no indicator is 100% effective.
This indicator shows us in the areas of color purple (strong hands) and in the areas of color green (weak hands) and by showing it graphically and the indicator is worth it.
The market is driven by two types of investors, which are called strong hands or whales (agencies, funds, companies, banks, etc.) and weak hands or small fish (that is, us).
We do not have the ability to manipulate a value, since our portfolio is limited, but we can enter and exit the securities easily since we do not have much money.
Whales can manipulate a value since they have many bitcoins and / or money, however, they can not move easily.
So, how can whales buy or sell their coins? Well, they make their game: They try to make us believe that the currency is cheap when they want to sell their coins or make us believe that the currency is expensive when they want to buy our coins. This manipulation is done in many ways, most by news.
We, small fish, can not compete against whales, but we can find out what they are doing (remember, they are slow, move their monstrous amounts of money) we must move with them and imitate them. Better to be under the whale than in front of her.
With this indicator you can see when the whales are operating and reacting; because the mathematical approach that sustains them has proven to be quite successful.
When strong hands are below zero, they say they are buying. The same goes for weak hands. Generally, if strong hands are buying or selling, the price is lateralized. The movement of the price is associated with the purchases and sales made by the weak hand.
I hope you find it very useful.
Bitrader4.0
META: STDEV Study (Scripting Exercise)While trying to figure out how to make the STDEV function use an exponential moving average instead of simple moving average , I discovered the builtin function doesn't really use either.
Check it out, it's amazing how different the two-pass algorithm is from the builtin!
Eventually I reverse-engineered and discovered that STDEV uses the Naiive algorithm and doesn't apply "Bessel's Correction". K can be 0, it doesn't seem to change the data although having it included should make it a little more precise.
en.wikipedia.org
Acc/DistAMA with FRACTAL DEVIATION BANDS by @XeL_ArjonaACCUMULATION/DISTRIBUTION ADAPTIVE MOVING AVERAGE with FRACTAL DEVIATION BANDS
Ver. 2.5 @ 16.09.2015
By Ricardo M Arjona @XeL_Arjona
DISCLAIMER:
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 embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
Pine Script code MOD's and adaptations by @XeL_Arjona with special mention in regard of:
Buy (Bull) and Sell (Bear) "Power Balance Algorithm" by:
Stocks & Commodities V. 21:10 (68-72): "Bull And Bear Balance Indicator by Vadim Gimelfarb"
Fractal Deviation Bands by @XeL_Arjona.
Color Cloud Fill by @ChrisMoody
CHANGE LOG:
Following a "Fractal Approach" now the lookback window is hardcode correlated with a given timeframe. (Default @ 126 days as Half a Year / 252 bars)
Clean and speed up of Adaptive Moving Average Algo.
Fractal Deviation Band Cloud coloring smoothed.
>
ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter or TradingVew accounts at: @XeL_Arjona
Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView. Copyright 2015
Volume Pressure Composite Average with Bands by @XeL_ArjonaVOLUME PRESSURE COMPOSITE AVERAGE WITH BANDS
Ver. 1.0.beta.10.08.2015
By Ricardo M Arjona @XeL_Arjona
DISCLAIMER:
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 embedded code and ideas within this work are FREELY AND PUBLICLY available on the Web for NON LUCRATIVE ACTIVITIES and must remain as is.
Pine Script code MOD's and adaptations by @XeL_Arjona with special mention in regard of:
Buy (Bull) and Sell (Bear) "Power Balance Algorithm" by :
Stocks & Commodities V. 21:10 (68-72):
"Bull And Bear Balance Indicator by Vadim Gimelfarb"
Adjusted Exponential Adaptation from original Volume Weighted Moving Average (VEMA) by @XeL_Arjona with help given at the @pinescript chat room with special mention to @RicardoSantos
Color Cloud Fill Condition algorithm by @ChrisMoody
WHAT IS THIS?
The following indicators try to acknowledge in a K-I-S-S approach to the eye (Keep-It-Simple-Stupid), the two most important aspects of nearly every trading vehicle: -- PRICE ACTION IN RELATION BY IT'S VOLUME --
A) My approach is to make this indicator both as a "Trend Follower" as well as a Volatility expressed in the Bands which are the weighting basis of the trend given their "Cross Signal" given by the Buy & Sell Volume Pressures algorithm. >
B) Please experiment with lookback periods against different timeframes. Given the nature of the Volume Mathematical Monster this kind of study is and in concordance with Price Action; at first glance I've noted that both in short as in long term periods, the indicator tends to adapt quite well to general price action conditions. BE ADVICED THIS IS EXPERIMENTAL!
C) ALL NEW IDEAS OR MODIFICATIONS to these indicator(s) are Welcome in favor to deploy a better and more accurate readings. I will be very glad to be notified at Twitter or TradingVew accounts at: @XeL_Arjona
Any important addition to this work MUST REMAIN PUBLIC by means of CreativeCommons CC & TradingView. --- All Authorship Rights RESERVED 2015 ---
Support & Resistance AI LevelScopeSupport & Resistance AI LevelScope
Support & Resistance AI LevelScope is an advanced, AI-driven tool that automatically detects and highlights key support and resistance levels on your chart. This indicator leverages smart algorithms to pinpoint the most impactful levels, providing traders with a precise, real-time view of critical price boundaries. Save time and enhance your trading edge with effortless, intelligent support and resistance identification.
Key Features:
AI-Powered Level Detection: The LevelScope algorithm continuously analyzes price action, dynamically plotting support and resistance levels based on recent highs and lows across your chosen timeframe.
Sensitivity Control: Customize the sensitivity to display either major levels for a macro view or more frequent levels for detailed intraday analysis. Easily adjust to suit any trading style or market condition.
Level Strength Differentiation: Instantly recognize the strength of each level with visual cues based on how often price has touched each one. Stronger levels are emphasized, highlighting areas with higher significance, while weaker levels are marked subtly.
Customizable Visuals: Tailor the look of your chart with customizable color schemes and line thickness options for strong and weak levels, ensuring clear visibility without clutter.
Proximity Alerts: Receive alerts when price approaches key support or resistance, giving you a heads-up for potential market reactions and trading opportunities.
Who It’s For:
Whether you're a day trader, swing trader, or just want a quick, AI-driven way to identify high-probability levels on your chart, Support & Resistance AI LevelScope is designed to keep you focused and informed. This indicator is the perfect addition to any trader’s toolkit, empowering you to make more confident, data-backed trading decisions with ease.
Upgrade your analysis with AI-powered support and resistance—no more manual lines, only smart levels!
Advanced VWAP [CryptoSea]The Advanced VWAP is a comprehensive volume-weighted average price (VWAP) tool designed to provide traders with a deeper understanding of market trends through multi-layered VWAP analysis. This indicator is ideal for those who want to track price movements in relation to VWAP bands and detect key market levels with greater precision.
Key Features
Multi-Timeframe VWAP Bands: Includes multiple VWAP bands with different lookback periods (5, 10, 25, and 50), allowing traders to observe short-term and long-term price behavior.
Smoothed Band Options: Offers optional smoothing of VWAP bands to reduce noise and highlight significant trends more clearly.
Dynamic Median Line Display: Plots the median line of the VWAP bands, providing a reference for price movements and potential reversal zones.
VWAP Trend Strength Calculation: Measures the strength of the trend based on the price's position relative to the VWAP bands, normalized between -1 and 1 for easier interpretation.
In the example below we can see the VWAP Forecastd Cloud, which consists of multiple layers of VWAP bands with varying lookback periods, creating a dynamic forecast visualization. The cloud structure represents potential future price ranges by projecting VWAP-based bands outward, with darker areas indicating higher density and overlap of the bands, suggesting stronger support or resistance zones. This approach helps traders anticipate price movement and identify areas of potential consolidation or breakout as the price interacts with different layers of the forecast cloud.
How it Works
VWAP Calculation: Utilizes multiple VWAP calculations based on various lookback periods to capture a broad range of price behaviors. The indicator adapts to different market conditions by switching between short-term and long-term VWAP references.
Smoothing Algorithms: Provides the ability to smooth the VWAP bands using different moving average types (SMA, EMA, SMMA, WMA, VWMA) to suit various trading strategies and reduce market noise.
Trend Strength Analysis: Computes the trend strength based on the price's distance from the VWAP bands, with a value range of -1 to 1. This feature helps traders identify the intensity of uptrends and downtrends.
Alert Conditions: Includes alert options for crossing above or below the smoothed median line, as well as touching the smoothed upper or lower bands, providing timely notifications for potential trading opportunities.
This image below illustrates the use of smoothed VWAP bands, which provide a cleaner representation of the price's relationship to the VWAP by reducing market noise. The smoothed bands create a flowing cloud-like structure, making it easier to observe significant trends and potential reversal points. The circles highlight areas where the price interacts with the smoothed bands, indicating potential key levels for trend continuation or reversal. This setup helps traders focus on meaningful movements and filter out minor fluctuations, improving the identification of strategic entry and exit points based on smoother trend signals.
Application
Strategic Entry and Exit Points: Helps traders identify optimal entry and exit points based on the interaction with VWAP bands and trend strength readings.
Trend Confirmation: Assists in confirming trend strength by analyzing price movements relative to the VWAP bands and detecting significant breaks or touches.
Customized Analysis: Supports a wide range of trading styles by offering adjustable smoothing, band settings, and alert conditions to meet specific trading needs.
The Advanced VWAP by is a valuable addition to any trader's toolkit, offering versatile features to navigate different market scenarios with confidence. Whether used for day trading or longer-term analysis, this tool enhances decision-making by providing a robust view of price behavior relative to VWAP levels.
MTF Regression with Forecast### **MTF Regression with Forecast, Treasury Yield, Additional Variable & VWAP Filter - Enhanced with Long Regression**
Unlock advanced market insights with our **MTF Regression** indicator, meticulously designed for traders seeking comprehensive multi-timeframe analysis combined with powerful forecasting tools. Whether you're a seasoned trader or just starting out, this indicator offers a suite of features to enhance your trading strategy.
#### **🔍 Key Features:**
- **Multi-Timeframe (MTF) Regression:**
- **Fast, Slow, & Long Regressions:** Analyze price trends across multiple timeframes to capture both short-term movements and long-term trends.
- **Customizable Price Inputs:**
- **Flexible Price Selection:** Choose between Close, Open, High, or Low prices to suit your trading style.
- **Price Transformation:** Option to apply Exponential Moving Averages (EMA) for smoother trend analysis.
- **Diverse Regression Methods:**
- **Multiple Algorithms:** Select from Linear, Exponential, Hull Moving Average (HMA), Weighted Moving Average (WMA), or Spline regressions to best fit your analysis needs.
- **Integrated External Data:**
- **10-Year Treasury Yield:** Incorporate macroeconomic indicators to refine regression accuracy.
- **Additional Variables:** Enhance your analysis by integrating data from other tickers (e.g., NASDAQ:AAPL).
- **Advanced Filtering Options:**
- **VWAP Filter:** Align signals with the Volume Weighted Average Price for improved trade entries.
- **Price Action Filter:** Ensure price behavior supports the generated signals for higher reliability.
- **Enhanced Signal Generation:**
- **Bullish & Bearish Signals:** Identify potential trend reversals and continuations with clear visual cues.
- **Predictive Signals:** Forecast future price movements with forward-looking arrows based on regression slopes.
- **Slope & Acceleration Thresholds:** Customize minimum slope and acceleration levels to fine-tune signal sensitivity.
- **Forecasting Capabilities:**
- **Projection Lines:** Visualize future price trends by extending regression lines based on current slope data.
- **User-Friendly Interface:**
- **Organized Settings Groups:** Easily navigate through price inputs, regression settings, integration options, and more.
- **Customizable Alerts:** Stay informed with configurable alerts for bullish, bearish, and predictive signals.
#### **📈 Why Choose MTF Regression Indicator?**
- **Comprehensive Analysis:** Combines multiple regression techniques and external data sources for a well-rounded market view.
- **Flexibility:** Highly customizable to fit various trading strategies and preferences.
- **Enhanced Decision-Making:** Provides clear signals and forecasts to support informed trading decisions.
- **Efficiency:** Optimized to deliver reliable performance without overloading your trading platform.
Elevate your trading game with the **MTF Regression with Forecast, Treasury Yield, Additional Variable & VWAP Filter** indicator. Harness the power of multi-timeframe analysis and predictive forecasting to stay ahead in the dynamic markets.
---
*Feel free to reach out for more information or support. Happy Trading!*
Iceberg Trade Revealer [CHE]Unveiling Iceberg Trades: A Deep Dive into Low Volatility Market Phases
Introduction
In the dynamic world of trading, hidden forces often influence market movements in ways that aren't immediately apparent. One such force is the phenomenon of iceberg trades—large orders that are concealed to prevent significant market impact. This presentation explores the concept of iceberg trades, explains why they are typically hidden during periods of low volatility, and introduces an indicator designed to reveal these elusive trades.
Agenda
1. Understanding Iceberg Trades
- Definition and Purpose
- Impact on Market Dynamics
2. The Low Volatility Concealment
- Why Low Volatility Phases?
- Strategies Behind Hiding Large Orders
3. Introducing the Iceberg Trade Revealer Indicator
- How the Indicator Works
- Key Components and Calculations
4. Demonstration and Use Cases
- Interpreting the Indicator Signals
- Practical Trading Applications
5. Conclusion
- Summarizing the Insights
- Q&A Session
1. Understanding Iceberg Trades
Definition and Purpose
- Iceberg Trades are large single orders divided into smaller lots to disguise the total order quantity.
- Traders use iceberg orders to minimize market impact and avoid unfavorable price movements.
Impact on Market Dynamics
- Concealed Volume: Iceberg orders hide true supply and demand levels.
- Price Stability: They prevent sudden spikes or drops by releasing orders gradually.
- Market Sentiment: Their presence can influence perceptions of market strength or weakness.
2. The Low Volatility Concealment
Why Low Volatility Phases?
- Less Market Attention: Low volatility periods attract fewer traders, making it easier to conceal large orders.
- Reduced Slippage: Prices are more stable, reducing the risk of executing orders at unfavorable prices.
- Strategic Advantage: Large players can accumulate or distribute positions without tipping off the market.
Strategies Behind Hiding Large Orders
- Order Splitting: Breaking down large orders into smaller pieces.
- Time Slicing: Executing orders over an extended period.
- Algorithmic Trading: Using sophisticated algorithms to optimize order execution.
3. Introducing the Iceberg Trade Revealer Indicator
How the Indicator Works
- Core Thesis: Iceberg trades can be detected by analyzing periods of unusually low volatility.
- Volatility Analysis: Uses the Average True Range (ATR) and Bollinger Bands to identify low volatility phases.
- Signal Generation: Marks periods where iceberg trades are likely occurring.
Key Components and Calculations
1. Average True Range (ATR)
- Measures market volatility over a specified period.
- Lower ATR values indicate less price movement.
2. Bollinger Bands
- Creates a volatility envelope around the ATR.
- Bands tighten during low volatility and widen during high volatility.
3. Timeframe Adjustments
- Utilizes multiple timeframes to enhance signal accuracy.
- Options for auto, multiplier, or manual timeframe selection.
4. Signal Conditions
- Iceberg Trade Detection: ATR falls below the lower Bollinger Band.
- Revealed Volatility: ATR rises above the upper Bollinger Band, indicating potential market moves after iceberg trades.
4. Demonstration and Use Cases
Interpreting the Indicator Signals
- Iceberg Trade Zones: Highlighted areas where large hidden orders are likely.
- Revealed Volatility Zones: Areas indicating the market's response to the execution of iceberg trades.
Practical Trading Applications
- Entry and Exit Points: Use signals to time trades alongside institutional activity.
- Risk Management: Adjust strategies during detected low volatility phases.
- Market Analysis: Gain insights into underlying market mechanics.
5. Conclusion
Summarizing the Insights
- Iceberg Trades play a significant role in market movements, especially when concealed during low volatility phases.
- The Iceberg Trade Revealer Indicator provides a tool to uncover these hidden activities, offering traders a strategic edge.
- Understanding and utilizing this indicator can enhance trading decisions by aligning them with the actions of major market players.
Best regards Chervolino ( Volker )
Q&A Session
- Questions and Discussions: Open the floor for any queries or further explanations.
Thank You!
By delving into the hidden aspects of market activity, traders can better navigate the complexities of financial markets. The Iceberg Trade Revealer Indicator serves as a bridge between observable market data and the concealed strategies of large institutions.
References
- Average True Range (ATR): A technical analysis indicator that measures market volatility.
- Bollinger Bands: A volatility indicator that creates a band of three lines which are plotted in relation to a security's price.
- Iceberg Orders: Large orders divided into smaller lots to hide the actual order quantity.
Note: Always consider multiple factors when making trading decisions. Indicators provide tools, but they do not guarantee results.
Educational Content Disclaimer:
Disclaimer:
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
[ALGOA+] Markov Chains Library by @metacamaleoLibrary "MarkovChains"
Markov Chains library by @metacamaleo. Created in 09/08/2024.
This library provides tools to calculate and visualize Markov Chain-based transition matrices and probabilities. This library supports two primary algorithms: a rolling window Markov Chain and a conditional Markov Chain (which operates based on specified conditions). The key concepts used include Markov Chain states, transition matrices, and future state probabilities based on past market conditions or indicators.
Key functions:
- `mc_rw()`: Builds a transition matrix using a rolling window Markov Chain, calculating probabilities based on a fixed length of historical data.
- `mc_cond()`: Builds a conditional Markov Chain transition matrix, calculating probabilities based on the current market condition or indicator state.
Basically, you will just need to use the above functions on your script to default outputs and displays.
Exported UDTs include:
- s_map: An UDT variable used to store a map with dummy states, i.e., if possible states are bullish, bearish, and neutral, and current is bullish, it will be stored
in a map with following keys and values: "bullish", 1; "bearish", 0; and "neutral", 0. You will only use it to customize your own script, otherwise, it´s only for internal use.
- mc_states: This UDT variable stores user inputs, calculations and MC outputs. As the above, you don´t need to use it, but you may get features to customize your own script.
For example, you may use mc.tm to get the transition matrix, or the prob map to customize the display. As you see, functions are all based on mc_states UDT. The s_map UDT is used within mc_states´s s array.
Optional exported functions include:
- `mc_table()`: Displays the transition matrix in a table format on the chart for easy visualization of the probabilities.
- `display_list()`: Displays a map (or array) of string and float/int values in a table format, used for showing transition counts or probabilities.
- `mc_prob()`: Calculates and displays probabilities for a given number of future bars based on the current state in the Markov Chain.
- `mc_all_states_prob()`: Calculates probabilities for all states for future bars, considering all possible transitions.
The above functions may be used to customize your outputs. Use the returned variable mc_states from mc_rw() and mc_cond() to display each of its matrix, maps or arrays using mc_table() (for matrices) and display_list() (for maps and arrays) if you desire to debug or track the calculation process.
See the examples in the end of this script.
Have good trading days!
Best regards,
@metacamaleo
-----------------------------
KEY FUNCTIONS
mc_rw(state, length, states, pred_length, show_table, show_prob, table_position, prob_position, font_size)
Builds the transition matrix for a rolling window Markov Chain.
Parameters:
state (string) : The current state of the market or system.
length (int) : The rolling window size.
states (array) : Array of strings representing the possible states in the Markov Chain.
pred_length (int) : The number of bars to predict into the future.
show_table (bool) : Boolean to show or hide the transition matrix table.
show_prob (bool) : Boolean to show or hide the probability table.
table_position (string) : Position of the transition matrix table on the chart.
prob_position (string) : Position of the probability list on the chart.
font_size (string) : Size of the table font.
Returns: The transition matrix and probabilities for future states.
mc_cond(state, condition, states, pred_length, show_table, show_prob, table_position, prob_position, font_size)
Builds the transition matrix for conditional Markov Chains.
Parameters:
state (string) : The current state of the market or system.
condition (string) : A string representing the condition.
states (array) : Array of strings representing the possible states in the Markov Chain.
pred_length (int) : The number of bars to predict into the future.
show_table (bool) : Boolean to show or hide the transition matrix table.
show_prob (bool) : Boolean to show or hide the probability table.
table_position (string) : Position of the transition matrix table on the chart.
prob_position (string) : Position of the probability list on the chart.
font_size (string) : Size of the table font.
Returns: The transition matrix and probabilities for future states based on the HMM.
Gann + Laplace Smoothed Hybrid Volume Spread AnalysisThe Gann + Laplace Smoothed Hybrid Volume Spread Analysis ( GannLSHVSA ) Strategy/Indicator is an trading tool designed to fuse volume analysis with trend detection, offering traders a view of market dynamics.
This Strategy/Indicator stands apart by integrating the principles of the upgraded Discrete Fourier Transform (DFT), the Laplace Stieltjes Transform and volume spread analysis, enhanced with a layer of Fourier smoothing to distill market noise and highlight trend directions with unprecedented clarity.
The length of EMA and Strategy Entries are modified with the Gann swings .
This smoothing process allows traders to discern the true underlying patterns in volume and price action, stripped of the distractions of short-term fluctuations and noise.
The core functionality of the GannLSHVSA revolves around the innovative combination of volume change analysis, spread determination (calculated from the open and close price difference), and the strategic use of the EMA (default 10) to fine-tune the analysis of spread by incorporating volume changes.
Trend direction is validated through a moving average (MA) of the histogram, which acts analogously to the Volume MA found in traditional volume indicators. This MA serves as a pivotal reference point, enabling traders to confidently engage with the market when the histogram's movement concurs with the trend direction, particularly when it crosses the Trend MA line, signalling optimal entry points.
It returns 0 when MA of the histogram and EMA of the Price Spread are not align.
WHAT IS GannLSHVSA INDICATOR:
The GannLSHVSA plots a positive trend when a positive Volume smoothed Spread and EMA of Volume smoothed price is above 0, and a negative when negative Volume smoothed Spread and EMA of Volume smoothed price is below 0. When this conditions are not met it plots 0.
HOW TO USE THE STRATEGY:
Here you fine-tune the inputs until you find a combination that works well on all Timeframes you will use when creating your Automated Trade Algorithmic Strategy. I suggest 4h, 12h, 1D, 2D, 3D, 4D, 5D, 6D, W and M.
ORIGINALITY & USEFULNESS:
The GannLSHVSA Strategy is unique because it applies upgraded DFT, the Laplace Stieltjes Transform for data smoothing, effectively filtering out the minor fluctuations and leaving traders with a clear picture of the market's true movements. The DFT's ability to break down market signals into constituent frequencies offers a granular view of market dynamics, highlighting the amplitude and phase of each frequency component. This, combined with the strategic application of Ehler's Universal Oscillator principles via a histogram, furnishes traders with a nuanced understanding of market volatility and noise levels, thereby facilitating more informed trading decisions. The Gann swing strategy is developed by meomeo105, this Gann high and low algorithm forms the basis of the EMA modification.
DETAILED DESCRIPTION:
My detailed description of the indicator and use cases which I find very valuable.
What is the meaning of price spread?
In finance, a spread refers to the difference between two prices, rates, or yields. One of the most common types is the bid-ask spread, which refers to the gap between the bid (from buyers) and the ask (from sellers) prices of a security or asset.
We are going to use Open-Close spread.
What is Volume spread analysis?
Volume spread analysis (VSA) is a method of technical analysis that compares the volume per candle, range spread, and closing price to determine price direction.
What does this mean?
We need to have a positive Volume Price Spread and a positive Moving average of Volume price spread for a positive trend. OR via versa a negative Volume Price Spread and a negative Moving average of Volume price spread for a negative trend.
What if we have a positive Volume Price Spread and a negative Moving average of Volume Price Spread?
It results in a neutral, not trending price action.
Thus the Indicator/Strategy returns 0 and Closes all long and short positions.
I suggest using "Close all" input False when fine-tuning Inputs for 1 TimeFrame. When you export data to Excel/Numbers/GSheets I suggest using "Close all" input as True, except for the lowest TimeFrame. I suggest using 100% equity as your default quantity for fine-tune purposes. I have to mention that 100% equity may lead to unrealistic backtesting results. Be avare. When backtesting for trading purposes use Contracts or USDT.
Fine-tune Inputs: Gann + Laplace Smooth Volume Zone OscillatorUse this Strategy to Fine-tune inputs for the GannLSVZ0 Indicator.
Strategy allows you to fine-tune the indicator for 1 TimeFrame at a time; cross Timeframe Input fine-tuning is done manually after exporting the chart data.
I suggest using "Close all" input False when fine-tuning Inputs for 1 TimeFrame. When you export data to Excel/Numbers/GSheets I suggest using "Close all" input as True, except for the lowest TimeFrame.
MEANINGFUL DESCRIPTION:
The Volume Zone oscillator breaks up volume activity into positive and negative categories. It is positive when the current closing price is greater than the prior closing price and negative when it's lower than the prior closing price. The resulting curve plots through relative percentage levels that yield a series of buy and sell signals, depending on level and indicator direction.
The Gann Laplace Smoothed Volume Zone Oscillator GannLSVZO is a refined version of the Volume Zone Oscillator, enhanced by the implementation of the upgraded Discrete Fourier Transform, the Laplace Stieltjes Transform. Its primary function is to streamline price data and diminish market noise, thus offering a clearer and more precise reflection of price trends.
By combining the Laplace with Gann Swing Entries and with Ehler's white noise histogram, users gain a comprehensive perspective on volume-related market conditions.
HOW TO USE THE INDICATOR:
The default period is 2 but can be adjusted after backtesting. (I suggest 5 VZO length and NoiceR max length 8 as-well)
The VZO points to a positive trend when it is rising above the 0% level, and a negative trend when it is falling below the 0% level. 0% level can be adjusted in setting by adjusting VzoDifference. Oscillations rising below 0% level or falling above 0% level result in a natural trend.
HOW TO USE THE STRATEGY:
Here you fine-tune the inputs until you find a combination that works well on all Timeframes you will use when creating your Automated Trade Algorithmic Strategy. I suggest 4h, 12h, 1D, 2D, 3D, 4D, 5D, 6D, W and M.
When Indicator/Strategy returns 0 or natural trend, Strategy Closes All it's positions.
ORIGINALITY & USFULLNESS:
Personal combination of Gann swings and Laplace Stieltjes Transform of a price which results in less noise Volume Zone Oscillator.
The Laplace Stieltjes Transform is a mathematical technique that transforms discrete data from the time domain into its corresponding representation in the frequency domain. This process involves breaking down a signal into its individual frequency components, thereby exposing the amplitude and phase characteristics inherent in each frequency element.
This indicator utilizes the concept of Ehler's Universal Oscillator and displays a histogram, offering critical insights into the prevailing levels of market noise. The Ehler's Universal Oscillator is grounded in a statistical model that captures the erratic and unpredictable nature of market movements. Through the application of this principle, the histogram aids traders in pinpointing times when market volatility is either rising or subsiding.
The Gann swing strategy is developed by meomeo105, this Gann high and low algorithm forms the basis of the EMA modification.
DETAILED DESCRIPTION:
My detailed description of the indicator and use cases which I find very valuable.
What is oscillator?
Oscillators are chart indicators that can assist a trader in determining overbought or oversold conditions in ranging (non-trending) markets.
What is volume zone oscillator?
Price Zone Oscillator measures if the most recent closing price is above or below the preceding closing price.
Volume Zone Oscillator is Volume multiplied by the 1 or -1 depending on the difference of the preceding 2 close prices and smoothed with Exponential moving Average.
What does this mean?
If the VZO is above 0 and VZO is rising. We have a bullish trend. Most likely.
If the VZO is below 0 and VZO is falling. We have a bearish trend. Most likely.
Rising means that VZO on close is higher than the previous day.
Falling means that VZO on close is lower than the previous day.
What if VZO is falling above 0 line?
It means we have a high probability of a bearish trend.
Thus the indicator returns 0 and Strategy closes all it's positions when falling above 0 (or rising bellow 0) and we combine higher and lower timeframes to gauge the trend.
What is approximation and smoothing?
They are mathematical concepts for making a discrete set of numbers a
continuous curved line.
Laplace Stieltjes Transform approximation of a close price are taken from aprox library.
Key Features:
You can tailor the Indicator/Strategy to your preferences with adjustable parameters such as VZO length, noise reduction settings, and smoothing length.
Volume Zone Oscillator (VZO) shows market sentiment with the VZO, enhanced with Exponential Moving Average (EMA) smoothing for clearer trend identification.
Noise Reduction leverages Euler's White noise capabilities for effective noise reduction in the VZO, providing a cleaner and more accurate representation of market dynamics.
Choose between the traditional Fast Laplace Stieltjes Transform (FLT) and the innovative Double Discrete Fourier Transform (DTF32) soothed price series to suit your analytical needs.
Use dynamic calculation of Laplace coefficient or the static one. You may modify those inputs and Strategy entries with Gann swings.
I suggest using "Close all" input False when fine-tuning Inputs for 1 TimeFrame. When you export data to Excel/Numbers/GSheets I suggest using "Close all" input as True, except for the lowest TimeFrame. I suggest using 100% equity as your default quantity for fine-tune purposes. I have to mention that 100% equity may lead to unrealistic backtesting results. Be avare. When backtesting for trading purposes use Contracts or USDT.
ICT IPDA Liquidity Matrix By AlgoCadosThe ICT IPDA Liquidity Matrix by AlgoCados is a sophisticated trading tool that integrates the principles of the Interbank Price Delivery Algorithm (IPDA), as taught by The Inner Circle Trader (ICT). This indicator is meticulously designed to support traders in identifying key institutional levels and liquidity zones, enhancing their trading strategies with data-driven insights. Suitable for both day traders and swing traders, the tool is optimized for high-frequency and positional trading, providing a robust framework for analyzing market dynamics across multiple time horizons.
# Key Features
Multi-Time Frame Analysis
High Time Frame (HTF) Levels : The indicator tracks critical trading levels over multiple days, specifically at 20, 40, and 60-day intervals. This functionality is essential for identifying long-term trends and significant support and resistance levels that aid in strategic decision-making for swing traders and positional traders.
Low Time Frame (LTF) Levels : It monitors price movements within 20, 40, and 60-hour intervals on lower time frames. This granularity provides a detailed view of intraday price actions, which is crucial for scalping and short-term trading strategies favored by day traders.
Daily Open Integration : The indicator includes the daily opening price, providing a crucial reference point that reflects the market's initial sentiment. This feature helps traders assess the market's direction and volatility, enabling them to make informed decisions based on the day's early movements, which is particularly useful for day trading strategies.
IPDA Reference Points : By leveraging IPDA's 20, 40, and 60-period lookbacks, the tool identifies Key Highs and Lows, which are used by IPDA as Draw On Liquidity. IPDA is an electronic and algorithmic system engineered for achieving price delivery efficiency, as taught by ICT. These reference points serve as benchmarks for understanding institutional trading behavior, allowing traders to align their strategies with the dominant market forces and recognize institutional key levels.
Dynamic Updates and Overlap Management : The indicator is updated daily at the beginning of a new daily candle with the latest market data, ensuring that traders operate with the most current information. It also features intelligent overlap management that prioritizes the most relevant levels based on the timeframe hierarchy, reducing visual clutter and enhancing chart readability.
Comprehensive Customization Options : Traders can tailor the indicator to their specific needs through an extensive input menu. This includes toggles for visibility, line styles, color selections, and label display preferences. These customization options ensure that the tool can adapt to various trading styles and preferences, enhancing user experience and analytical capabilities.
User-Friendly Interface : The tool is designed with a user-friendly interface that includes clear, concise labels for all significant levels. It supports various font families and sizes, making it easier to interpret and act upon the displayed data, ensuring that traders can focus on making informed trading decisions without being overwhelmed by unnecessary information.
# Usage Note
The indicator is segmented into two key functionalities:
LTF Displays : The Low Time Frame (LTF) settings are exclusive to timeframes up to 1 hour, providing detailed analysis for intraday traders. This is crucial for traders who need precise and timely data to make quick decisions within the trading day.
HTF Displays : The High Time Frame (HTF) settings apply to the daily timeframe and any shorter intervals, allowing for comprehensive analysis over extended periods. This is beneficial for swing traders looking to identify broader trends and market directions.
# Inputs and Configurations
BINANCE:BTCUSDT
Offset: Adjustable setting to shift displayed data horizontally for better visibility, allowing traders to view past levels and make informed decisions based on historical data.
Label Styles: Choose between compact or verbose label formats for different levels, offering flexibility in how much detail is displayed on the chart.
Daily Open Line: Customizable line style and color for the daily opening price, providing a clear visual reference for the start of the trading day.
HTF Levels: Configurable high and low lines for HTF with options for style and color customization, allowing traders to highlight significant levels in a way that suits their trading style.
LTF Levels: Similar customization options for LTF levels, ensuring flexibility in how data is presented, making it easier for traders to focus on the most relevant intraday levels.
Text Utils: Settings for font family, size, and text color, allowing for personalized display preferences and ensuring that the chart is both informative and aesthetically pleasing.
# Advanced Features
Overlap Management : The script intelligently handles overlapping levels, particularly where multiple timeframes intersect, by prioritizing the more significant levels and removing redundant ones. This ensures that the charts remain clear and focused on the most critical data points, allowing traders to concentrate on the most relevant market information.
Real-Time Updates : The indicator updates its calculations at the start of each new daily bar, incorporating the latest market data to provide timely and accurate trading signals. This real-time updating is crucial for traders who rely on up-to-date information to execute their strategies effectively and make informed trading decisions.
# Example Use Cases
Scalpers/Day traders: Can utilize the LTF features to make rapid decisions based on hourly market movements, identifying short-term trading opportunities with precision.
Swing Traders: Will benefit from the HTF analysis to identify broader trends and key levels that influence longer-term market movements, enabling them to capture significant market swings.
By providing a clear, detailed view of key market dynamics, the ICT IPDA Liquidity Matrix by AlgoCados empowers traders to make more informed and effective trading decisions, aligning with institutional trading methodologies and enhancing their market understanding.
# Usage Disclaimer
This tool is designed to assist in trading decisions, but it should be used in conjunction with other analysis methods and risk management strategies. Trading involves significant risk, and it is essential to understand the market conditions thoroughly before making trading decisions.
Gaussian Price Filter [BackQuant]Gaussian Price Filter
Overview and History of the Gaussian Transformation
The Gaussian transformation, often associated with the Gaussian (normal) distribution, is a mathematical function characteristically prominent in statistics and probability theory. The bell-shaped curve of the Gaussian function, expressing the normal distribution, is ubiquitously employed in various scientific and engineering disciplines, including financial market analysis. This transformation's core utility in trading and economic forecasting is derived from its efficacy in smoothing data series and highlighting underlying trends, which are pivotal for making strategic trading decisions.
The Gaussian filter, specifically, is a type of data-smoothing algorithm that mitigates the random "noise" of market price data, thus enhancing the visibility of crucial trend changes and patterns. Historically, this concept was adapted from fields such as signal processing and image editing, where precise extraction of useful information from noisy environments is critical.
1. What is a Gaussian Transformation?
A Gaussian transformation involves the application of a Gaussian function to a set of data points. The function is applied as a filter in the context of trading algorithms to smooth time series data, which helps in identifying the intrinsic trends obscured by market volatility. The transformation is characterized by its parameter, sigma (σ), representing the standard deviation, which determines the width of the Gaussian bell curve. The breadth of this curve impacts the degree of smoothing: a wider curve (higher sigma value) results in more smoothing, beneficial for longer-term trend analysis.
2. Filtering Price with Gaussian Transformation and its Benefits
In the provided Script, the Gaussian transformation is utilized to filter price data. The filtering process involves convolving the price data with Gaussian weights, which are calculated based on the chosen length (the number of data points considered) and sigma. This convolution process smooths out short-term fluctuations and highlights longer-term movements, facilitating a clearer analysis of market trends.
Benefits:
Reduces noise: It filters out minor price movements and random fluctuations, which are often misleading.
Enhances trend recognition: By smoothing the data, it becomes easier to identify significant trends and reversals.
Improves decision-making: Traders can make more informed decisions by focusing on substantive, smoothed data rather than reacting to random noise.
3. Potential Limitations and Issues
While Gaussian filters are highly effective in smoothing data, they are not without limitations:
Lag introduction: Like all moving averages, the Gaussian filter introduces a lag between the actual price movements and the output signal, which can delay decision-making.
Feature blurring: Over-smoothing might obscure significant price movements, especially if a large sigma is used.
Parameter sensitivity: The choice of length and sigma significantly affects the output, requiring optimization and backtesting to determine the best settings for specific market conditions.
4. Extending Gaussian Filters to Other Indicators
The methodology used to filter price data with a Gaussian filter can similarly be applied to other technical indicators, such as RSI (Relative Strength Index) or MACD (Moving Average Convergence Divergence). By smoothing these indicators, traders can reduce false signals and enhance the reliability of the indicators' outputs, leading to potentially more accurate signals and better timing for entering or exiting trades.
5. Application in Trading
In trading, the Gaussian Price Filter can be strategically used to:
Spot trend reversals: Smoothed price data can more clearly indicate when a trend is starting to change, which is crucial for catching reversals early.
Define entry and exit points: The filtered data points can help in setting more precise entry and exit thresholds, minimizing the risk and maximizing the potential return.
Filter other data streams: Apply the Gaussian filter on volume or open interest data to identify significant changes in market dynamics.
6. Functionality of the Script
The script is designed to:
Calculate Gaussian weights (f_gaussianWeights function): Generates the weights used for the Gaussian kernel based on the provided length and sigma.
Apply the Gaussian filter (f_applyGaussianFilter function): Uses the weights to compute the smoothed price data.
Conditional Trend Detection and Coloring: Determines the trend direction based on the filtered price and colors the price bars on the chart to visually represent the trend.
7. Specific Actions of This Code
The Pine Script provided by BackQuant executes several specific actions:
Input Handling: It allows users to specify the source data (src), kernel length, and sigma directly in the chart settings.
Weight Calculation and Normalization: Computes the Gaussian weights and normalizes them to ensure their sum equals one, which maintains the original data scale.
Filter Application: Applies the normalized Gaussian kernel to the price data to produce a smoothed output.
Trend Identification and Visualization: Identifies whether the market is trending upwards or downwards based on the smoothed data and colors the bars green (up) or red (down) to indicate the trend direction.
Momentum Ghost Machine [ChartPrime]Momentum Ghost Machine (ChartPrime) is designed to be the next generation in momentum/rate of change analysis. This indicator utilizes the properties of one of our favorite filters to create a more accurate and stable momentum oscillator by using a high quality filtered delayed signal to do the momentum comparison.
Traditional momentum/roc uses the raw price data to compare current price to previous price to generate a directional oscillator. This leaves the oscillator prone to false readings and noisy outputs that leave traders unsure of the real likelihood of a future movement. One way to mitigate this issue would be to use some sort of moving average. Unfortunately, this can only go so far because simple moving average algorithms result in a poor reconstruction of the actual shape of the underlying signal.
The windowed sinc low pass filter is a linear phase filter, meaning that it doesn't change the shape or size of the original signal when applied. This results in a faithful reconstruction of the original signal, but without the "high frequency noise". Just like any filter, the process of applying it requires that we have "future" samples resulting in a time delay for real time applications. Fortunately this is a great thing in the context of a momentum oscillator because we need some representation of past price data to compare the current price data to. By using an ideal low pass filter to generate this delayed signal we can super charge the momentum oscillator and fix the majority of issues its predecessors had.
This indicator has a few extra features that other momentum/roc indicators dont have. One major yet simple improvement is the inclusion of a moving average to help gauge the rate of change of this indicator. Since we included a moving average, we thought it would only be appropriate to add a histogram to help visualize the relationship between the signal and its average. To go further with this we have also included linear extrapolation to further help you predict the momentum and direction of this oscillator. Included with this extrapolation we have also added the histogram in the extrapolation to further enhance its visual interpretation. Finally, the inclusion of a candle coloring feature really drives how the utility of the Momentum Machine .
There are three distinct options when using the candle coloring feature: Direct, MA, and Both. With direct the candles will be colored based on the indicators direction and polarity. When it is above zero and moving up, it displays a green color. When it is above zero and moving down it will display a light green color. Conversely, when the indicator is below zero and moving down it displays a red color, and when it it moving up and below zero it will display a light red color. MA coloring will color the candles just like a MACD. If the signal is above its MA and moving up it will display a green color, and when it is above its MA and moving down it will display a light green color.
When the signal is below its MA and moving down it will display a red color, and when its below its ma and moving up it will display a light red color. Both combines the two into a single color scheme providing you with the best of both worlds. If the indicator is above zero it will display the MA colors with a slight twist. When the indicator is moving down and is below its MA it will display a lighter color than before, and when it is below zero and is above its MA it will display a darker color color.
Length of 50 with a smoothing of 100
Length of 50 with a smoothing of 25
By default, the indicator is set to a momentum length of 50, with a post smoothing of 2. We have chosen the longer period for the momentum length to highlight the performance of this indicator compared to its ancestors. A major point to consider with this indicator is that you can only achieve so much smoothing for a chosen delay. This is because more data is required to produce a smoother signal at a specified length. Once you have selected your desired momentum length you can then select your desired momentum smoothing . This is made possible by the use of the windowed sinc low pass algorithm because it includes a frequency cutoff argument. This means that you can have as little or as much smoothing as you please without impacting the period of the indicator. In the provided examples above this paragraph is a visual representation of what is going on under the hood of this indicator. The blue line is the filtered signal being compared to the current closing price. As you can see, the filtered signal is very smooth and accurately represents the underlying price action without noise.
We hope that users can find the same utility as we did in this indicator and that it levels up your analysis utilizing the momentum oscillator or rate of change.
Enjoy