Simple Decesion Matrix Classification Algorithm [SS]Hello everyone,
It has been a while since I posted an indicator, so thought I would share this project I did for fun.
This indicator is an attempt to develop a pseudo Random Forest classification decision matrix model for Pinescript.
This is not a full, robust Random Forest model by any stretch of the imagination, but it is a good way to showcase how decision matrices can be applied to trading and within Pinescript.
As to not market this as something it is not, I am simply calling it the "Simple Decision Matrix Classification Algorithm". However, I have stolen most of the aspects of this machine learning algo from concepts of Random Forest modelling.
How it works:
With models like Support Vector Machines (SVM), Random Forest (RF) and Gradient Boosted Machine Learning (GBM), which are commonly used in Machine Learning Classification Tasks (MLCTs), this model operates similarity to the basic concepts shared amongst those modelling types. While it is not very similar to SVM, it is very similar to RF and GBM, in that it uses a "voting" system.
What do I mean by voting system?
How most classification MLAs work is by feeding an input dataset to an algorithm. The algorithm sorts this data, categorizes it, then introduces something called a confusion matrix (essentially sorting the data in no apparently order as to prevent over-fitting and introduce "confusion" to the algorithm to ensure that it is not just following a trend).
From there, the data is called upon based on current data inputs (so say we are using RSI and Z-Score, the current RSI and Z-Score is compared against other RSI's and Z-Scores that the model has saved). The model will process this information and each "tree" or "node" will vote. Then a cumulative overall vote is casted.
How does this MLA work?
This model accepts 2 independent variables. In order to keep things simple, this model was kept as a three node model. This means that there are 3 separate votes that go in to get the result. A vote is casted for each of the two independent variables and then a cumulative vote is casted for the overall verdict (the result of the model's prediction).
The model actually displays this system diagrammatically and it will likely be easier to understand if we look at the diagram to ground the example:
In the diagram, at the very top we have the classification variable that we are trying to predict. In this case, we are trying to predict whether there will be a breakout/breakdown outside of the normal ATR range (this is either yes or no question, hence a classification task).
So the question forms the basis of the input. The model will track at which points the ATR range is exceeded to the upside or downside, as well as the other variables that we wish to use to predict these exceedences. The ATR range forms the basis of all the data flowing into the model.
Then, at the second level, you will see we are using Z-Score and RSI to predict these breaks. The circle will change colour according to "feature importance". Feature importance basically just means that the indicator has a strong impact on the outcome. The stronger the importance, the more green it will be, the weaker, the more red it will be.
We can see both RSI and Z-Score are green and thus we can say they are strong options for predicting a breakout/breakdown.
So then we move down to the actual voting mechanisms. You will see the 2 pink boxes. These are the first lines of voting. What is happening here is the model is identifying the instances that are most similar and whether the classification task we have assigned (remember out ATR exceedance classifier) was either true or false based on RSI and Z-Score.
These are our 2 nodes. They both cast an individual vote. You will see in this case, both cast a vote of 1. The options are either 1 or 0. A vote of 1 means "Yes" or "Breakout likely".
However, this is not the only voting the model does. The model does one final vote based on the 2 votes. This is shown in the purple box. We can see the final vote and result at the end with the orange circle. It is 1 which means a range exceedance is anticipated and the most likely outcome.
The Data Table Component
The model has many moving parts. I have tried to represent the pivotal functions diagrammatically, but some other important aspects and background information must be obtained from the companion data table.
If we bring back our diagram from above:
We can see the data table to the left.
The data table contains 2 sections, one for each independent variable. In this case, our independent variables are RSI and Z-Score.
The data table will provide you with specifics about the independent variables, as well as about the model accuracy and outcome.
If we take a look at the first row, it simply indicates which independent variable it is looking at. If we go down to the next row where it reads "Weighted Impact", we can see a corresponding percent. The "weighted impact" is the amount of representation each independent variable has within the voting scheme. So in this case, we can see its pretty equal, 45% and 55%, This tells us that there is a slight higher representation of z-score than RSI but nothing to worry about.
If there was a major over-respresentation of greater than 30 or 40%, then the model would risk being skewed and voting too heavily in favour of 1 variable over the other.
If we move down from there we will see the next row reads "independent accuracy". The voting of each independent variable's accuracy is considered separately. This is one way we can determine feature importance, by seeing how well one feature augments the accuracy. In this case, we can see that RSI has the greatest importance, with an accuracy of around 87% at predicting breakouts. That makes sense as RSI is a momentum based oscillator.
Then if we move down one more, we will see what each independent feature (node) has voted for. In this case, both RSI and Z-Score voted for 1 (Breakout in our case).
You can weigh these in collaboration, but its always important to look at the final verdict of the model, which if we move down, we can see the "Model prediction" which is "Bullish".
If you are using the ATR breakout, the model cannot distinguish between "Bullish" or "Bearish", must that a "Breakout" is likely, either bearish or bullish. However, for the other classification tasks this model can do, the results are either Bullish or Bearish.
Using the Function:
Okay so now that all that technical stuff is out of the way, let's get into using the function. First of all this function innately provides you with 3 possible classification tasks. These include:
1. Predicting Red or Green Candle
2. Predicting Bullish / Bearish ATR
3. Predicting a Breakout from the ATR range
The possible independent variables include:
1. Stochastics,
2. MFI,
3. RSI,
4. Z-Score,
5. EMAs,
6. SMAs,
7. Volume
The model can only accept 2 independent variables, to operate within the computation time limits for pine execution.
Let's quickly go over what the numbers in the diagram mean:
The numbers being pointed at with the yellow arrows represent the cases the model is sorting and voting on. These are the most identical cases and are serving as the voting foundation for the model.
The numbers being pointed at with the pink candle is the voting results.
Extrapolating the functions (For Pine Developers:
So this is more of a feature application, so feel free to customize it to your liking and add additional inputs. But here are some key important considerations if you wish to apply this within your own code:
1. This is a BINARY classification task. The prediction must either be 0 or 1.
2. The function consists of 3 separate functions, the 2 first functions serve to build the confusion matrix and then the final "random_forest" function serves to perform the computations. You will need all 3 functions for implementation.
3. The model can only accept 2 independent variables.
I believe that is the function. Hopefully this wasn't too confusing, it is very statsy, but its a fun function for me! I use Random Forest excessively in R and always like to try to convert R things to Pinescript.
Hope you enjoy!
Safe trades everyone!
Indicators and strategies
ADX and DI Trend meter and status table IndicatorThis ADX (Average Directional Index) and DI (Directional Indicator) indicator helps identify:
Trend Direction & Strength:
LONG: +DI above -DI with ADX > 20
SHORT: -DI above +DI with ADX > 20
RANGE: ADX < 20 indicates choppy/sideways market
Trading Signals:
Bullish: +DI crosses above -DI (green triangle)
Bearish: -DI crosses below +DI (red triangle)
ADX Strength Levels:
Strong: ADX ≥ 50
Moderate: ADX 30-49
Weak: ADX 20-29
No Trend: ADX < 20
Best Uses:
Trend confirmation before entering trades
Identifying ranging vs trending markets
Exit signal when trend weakens
Works well on multiple timeframes
Most effective in combination with other indicators
The table displays current trend direction and ADX strength in real-time
Moment-Based Adaptive DetectionMBAD (Moment-Based Adaptive Detection) : a method applicable to a wide range of purposes, like outlier or novelty detection, that requires building a sensible interval/set of thresholds. Unlike other methods that are static and rely on optimizations that inevitably lead to underfitting/overfitting, it dynamically adapts to your data distribution without any optimizations, MLE, or stuff, and provides a set of data-driven adaptive thresholds, based on closed-form solution with O(n) algo complexity.
1.5 years ago, when I was still living in Versailles at my friend's house not knowing what was gonna happen in my life tomorrow, I made a damn right decision not to give up on one idea and to actually R&D it and see what’s up. It allowed me to create this one.
The Method Explained
I’ve been wandering about z-values, why exactly 6 sigmas, why 95%? Who decided that? Why would you supersede your opinion on data? Based on what? Your ego?
Then I consciously noticed a couple of things:
1) In control theory & anomaly detection, the popular threshold is 3 sigmas (yet nobody can firmly say why xD). If your data is Laplace, 3 sigmas is not enough; you’re gonna catch too many values, so it needs a higher sigma.
2) Yet strangely, the normal distribution has kurtosis of 3, and 6 for Laplace.
3) Kurtosis is a standardized moment, a moment scaled by stdev, so it means "X amount of something measured in stdevs."
4) You generate synthetic data, you check on real data (market data in my case, I am a quant after all), and you see on both that:
lower extension = mean - standard deviation * kurtosis ≈ data minimum
upper extension = mean + standard deviation * kurtosis ≈ data maximum
Why not simply use max/min?
- Lower info gain: We're not using all info available in all data points to estimate max/min; we just pick the current higher and lower values. Lol, it’s the same as dropping exponential smoothing with alpha = 0 on stationary data & calling it a day.
You can’t update the estimates of min and max when new data arrives containing info about the matter. All you can do is just extend min and max horizontally, so you're not using new info arriving inside new data.
- Mixing order and non-order statistics is a bad idea; we're losing integrity and coherence. That's why I don't like the Hurst exponent btw (and yes, I came up with better metrics of my own).
- Max & min are not even true order statistics, unlike a percentile (finding which requires sorting, which requires multiple passes over your data). To find min or max, you just need to do one traversal over your data. Then with or without any weighting, 100th percentile will equal max. So unlike a weighted percentile, you can’t do weighted max. Then while you can always check max and min of a geometric shape, now try to calculate the 56th percentile of a pentagram hehe.
TL;DR max & min are rather topological characteristics of data, just as the difference between starting and ending points. Not much to do with statistics.
Now the second part of the ballet is to work with data asymmetry:
1) Skewness is also scaled by stdev -> so it must represent a shift from the data midrange measured in stdevs -> given asymmetric data, we can include this info in our models. Unlike kurtosis, skewness has a sign, so we add it to both thresholds:
lower extension = mean - standard deviation * kurtosis + standard deviation * skewness
upper extension = mean + standard deviation * kurtosis + standard deviation * skewness
2) Now our method will work with skewed data as well, omg, ain’t it cool?
3) Hold up, but what about 5th and 6th moments (hyperskewness & hyperkurtosis)? They should represent something meaningful as well.
4) Perhaps if extensions represent current estimated extremums, what goes beyond? Limits, beyond which we expect data not to be able to pass given the current underlying process generating the data?
When you extend this logic to higher-order moments, i.e., hyperskewness & hyperkurtosis (5th and 6th moments), they measure asymmetry and shape of distribution tails, not its core as previous moments -> makes no sense to mix 4th and 3rd moments (skewness and kurtosis) with 5th & 6th, so we get:
lower limit = mean - standard deviation * hyperkurtosis + standard deviation * hyperskewness
upper limit = mean + standard deviation * hyperkurtosis + standard deviation * hyperskewness
While extensions model your data’s natural extremums based on current info residing in the data without relying on order statistics, limits model your data's maximum possible and minimum possible values based on current info residing in your data. If a new data point trespasses limits, it means that a significant change in the data-generating process has happened, for sure, not probably—a confirmed structural break.
And finally we use time and volume weighting to include order & process intensity information in our model.
I can't stress it enough: despite the popularity of these non-weighted methods applied in mainstream open-access time series modeling, it doesn’t make ANY sense to use non-weighted calculations on time series data . Time = sequence, it matters. If you reverse your time series horizontally, your means, percentiles, whatever, will stay the same. Basically, your calculations will give the same results on different data. When you do it, you disregard the order of data that does have order naturally. Does it make any sense to you? It also concerns regressions applied on time series as well, because even despite the slope being opposite on your reversed data, the centroid (through which your regression line always comes through) will be the same. It also might concern Fourier (yes, you can do weighted Fourier) and even MA and AR models—might, because I ain’t researched it extensively yet.
I still can’t believe it’s nowhere online in open access. No chance I’m the first one who got it. It’s literally in front of everyone’s eyes for centuries—why no one tells about it?
How to use
That’s easy: can be applied to any, even non-stationary and/or heteroscedastic time series to automatically detect novelties, outliers, anomalies, structural breaks, etc. In terms of quant trading, you can try using extensions for mean reversion trades and limits for emergency exits, for example. The market-making application is kinda obvious as well.
The only parameter the model has is length, and it should NOT be optimized but picked consciously based on the process/system you’re applying it to and based on the task. However, this part is not about sharing info & an open-access instrument with the world. This is about using dem instruments to do actual business, and we can’t talk about it.
∞
NextBarColorNextBarColor
This is two-bars pattern search/matching indicator.
This indicator compares multiple values:
current bar high with previous bar open
current bar high with previous bar close
current bar high with previous bar high
current bar high with previous bar low
current bar low with previous bar open
current bar low with previous bar close
current bar low with previous bar high
current bar low with previous bar low
current bar close/current_price with previous bar high
current bar close/current_price with previous bar low
current bar close/current_price with previous bar open
current bar close/current_price with previous bar close
and searches for the same combination of 2 bars (current and previous) in the past.
Then shows as % value how many times the next bar went up or down.
Grey bar compares ups and downs with all results, including cases when price did not move.
My testing is showing better results when current and previous bars colors are also used in the search.
Weekly Bullish Pattern DetectorThis script is a TradingView Pine Script designed to detect a specific bullish candlestick pattern on the weekly chart. Below is a detailed breakdown of its components:
1. Purpose
The script identifies a four-candle bullish pattern where:
The first candle is a long green (bullish) candlestick.
The second and third candles are small-bodied candles, signifying consolidation or indecision.
The fourth candle is another long green (bullish) candlestick.
When this pattern is detected, the script:
Marks the chart with a visual label.
Optionally triggers an alert to notify the trader.
2. Key Features
Overlay on Chart:
indicator("Weekly Bullish Pattern Detector", overlay=true) ensures the indicator draws directly on the price chart.
Customizable Inputs:
length (Body Size Threshold):
Defines the minimum percentage of the total range that qualifies as a "long" candle body (default: 14%).
smallCandleThreshold (Small Candle Body Threshold):
Defines the maximum percentage of the total range that qualifies as a "small" candle body (default: 10%).
Candlestick Property Calculations:
bodySize: Measures the absolute size of the candle body (close - open).
totalRange: Measures the total high-to-low range of the candle.
bodyPercentage: Calculates the proportion of the body size relative to the total range ((bodySize / totalRange) * 100).
isGreen and isRed: Identify bullish (green) or bearish (red) candles based on their open and close prices.
Pattern Conditions:
longGreenCandle:
Checks if the candle is bullish (isGreen) and its body percentage exceeds the defined length threshold.
smallCandle:
Identifies small-bodied candles where the body percentage is below the smallCandleThreshold.
consolidation:
Confirms the second and third candles are both small-bodied (smallCandle and smallCandle ).
Bullish Pattern Detection:
bullishPattern:
Detects the full four-candle sequence:
The first candle (longGreenCandle ) is a long green candle.
The second and third candles (consolidation) are small-bodied.
The fourth candle (longGreenCandle) is another long green candle.
Visualization:
plotshape(bullishPattern):
Draws a green label ("Pattern") below the price chart whenever the pattern is detected.
Alert Notification:
alertcondition(bullishPattern):
Sends an alert with the message "Bullish Pattern Detected on Weekly Chart" whenever the pattern is found.
3. How It Works
Evaluates Candle Properties:
For each weekly candle, the script calculates its size, range, and body percentage.
Identifies Each Component of the Pattern:
Checks for a long green candle (first and fourth).
Verifies the presence of two small-bodied candles (second and third).
Detects and Marks the Pattern:
Confirms the sequence and marks the chart with a label if the pattern is complete.
Sends Alerts:
Notifies the trader when the pattern is detected.
4. Use Cases
This script is ideal for:
Swing Traders:
Spotting weekly patterns that indicate potential bullish continuations.
Breakout Traders:
Identifying consolidation zones followed by upward momentum.
Pattern Recognition:
Automatically detecting a commonly used bullish formation.
5. Key Considerations
Timeframe: Works best on weekly charts.
Customization: The thresholds for "long" and "small" candles can be adjusted to suit different markets or volatility levels.
Limitations:
It doesn't confirm the pattern's success; further analysis (e.g., volume, support/resistance levels) may be required for validation
ICT FVG [TheFundedRoad]This indicator shows you all ICT Fair value gaps on chart with midpoint line
Fair value gap is a gap in a set of 3 candles, in a bullish FVG you have 1st candle high being lower than third candle low, and in a bearish FVG you have first candle low higher than third candle high, thats how this indicator finds these fair value gaps
It draws the fair value gap from the 2nd candle forward
You can customize the color and if you want to see the midpoint or not, midpoint is 50% of the gap
Confluence ChecklistHOW DOES IT WORK?
The "Confluence Checklist" indicator helps you to stick to your trading plan with your set rules. You have a total of 8 rules that can be set up manually. Using the checkbox, you can check during trading whether your rules are followed or not. You can change the colors of the table on the one hand, and the size and width of the table columns on the other.
█ WHAT MAKES IT UNIQUE?
It is the only checklist indicator on Tradingview that has an integrated checkbox. Thus, you can always check your trading plan.
█ HOW TO USE IT?
The best way to start is to create your personal trading plan based on your trading strategy. Then you can display the trading plan digitally in Tradingview. This way you don't have to write and check your rules on paper anymore. This is very important for scalping, because sometimes you only have a few seconds left for the execution. After creating the trading plan, you can integrate it into the checklist. Before placing an order, you can check the checklist to see if the trade is really valid.
IU Price Density(Market Noise)This Price density Indicator will help you understand what and how market noise is calculated and treated.
Market noise = when the market is moving up and down without any clear direction
The Price Density Indicator is a technical analysis tool used to measure the concentration or "density" of price movements within a specific range. It helps traders differentiate between noisy, choppy markets and trending ones.
I’ve developed a custom Pine Script indicator, "IU Price Density," designed to help traders distinguish between noisy, indecisive markets and clear trading opportunities. It can be applied across multiple markets.
How this work:
Formula = (Σ (High𝑖 - Low𝑖)) / (Max(High) - Min(Low))
Where,
High𝑖 = the high price at the 𝑖 data point.
Low𝑖 = the low price at the 𝑖 data point.
Max(High) = highest price over the data set.
Max(Low) = Lowest price over the data set.
How to use it :
This indicator ranges from 0 to 10
Green(0-3) = Trending Market
Orange(3-6) = Market is normal
Red(6-10) = Noise market
💡 Key Features:
Dynamic Visuals: The indicator uses color-coded signals—green for trending markets and red for noisy, volatile conditions—making it easy to identify optimal trading periods at a glance.
Background Shading: With background colors highlighting significant market conditions, traders can quickly assess when to engage or avoid certain trades.
Customizable Parameters: The length and smoothing factors allow for flexibility in adapting the indicator to various assets and timeframes.
Whether you're a swing trader or an intraday strategist, this tool provides valuable insights to improve your market analysis. I’m excited to bring this indicator to the community!
Pairs trading[Maxxxz7]Pairs Trading
This script is designed to analyze and visualize the divergence or convergence of two selected financial instruments, making it an excellent tool for implementing a pairs trading strategy. Developed for the TradingView platform, it offers extensive customization options for analysis.
Key Features:
Asset Selection:
The first asset can be taken directly from the chart or specified manually.
The second asset is always selected manually.
Data Normalization:
Calculates the percentage change of both assets relative to their initial prices.
Includes an offset for better visual interpretation.
Visualization:
Plots normalized price charts for both assets.
Highlights crossovers between the assets.
Displays the spread (difference between normalized prices) graphically.
Alerts (Works only on the 30-minute timeframe):
Configurable thresholds to trigger alerts (e.g., when the difference is smaller or larger than a set value).
Alerts for crossovers of prices and exponential moving averages (EMA).
Dynamic Labels:
Automatically adds labels to mark key events: crossovers, critical spread values, and current price information.
EMA and Deviation Analysis:
Calculates EMA for each asset.
Alerts for EMA crossovers.
CandelaCharts - Opening Gap (OG) 📝 Overview
The ICT (Inner Circle Trader) Opening Gap represents the price difference between the previous trading session's closing price and the current session's opening price. This gap serves as a key indicator of market sentiment and can offer valuable clues about the market's potential direction throughout the trading day.
A bullish Opening Gap forms when the market opens higher than the previous session's close, signaling strong buying interest or positive sentiment heading into the new session
A bearish Opening Gap occurs when the market opens lower than the previous session's close, reflecting heightened selling pressure or negative sentiment among market participants
The Opening Gap is significant as it often establishes the market's tone for the trading session. Accurately interpreting this gap enables traders to make informed decisions about when to enter or exit positions. Serving as a gauge of market strength or weakness, the gap provides a clear signal of whether the market is likely to trend upward or downward during the day.
📦 Features
MTF
Mitigation
Consequent Encroachment
Threshold
Hide Overlap
Advanced Styling
⚙️ Settings
Show: Controls whether FVGs are displayed on the chart.
Show Last: Sets the number of FVGs you want to display.
Length: Determines the length of each FVG.
Mitigation: Highlights when an FVG has been touched, using a different color without marking it as invalid.
Timeframe: Specifies the timeframe used to detect FVGs.
Threshold: Sets the minimum gap size required for FVG detection on the chart.
Show Mid-Line: Configures the midpoint line's width and style within the FVG. (Consequent Encroachment - CE)
Show Border: Defines the border width and line style of the FVG.
Hide Overlap: Removes overlapping FVGs from view.
Extend: Extends the FVG length to the current candle.
Elongate: Fully extends the FVG length to the right side of the chart.
⚡️ Showcase
Simple
Mitigated
Bordered
Consequent Encroachment
Extended
🚨 Alerts
This script provides alert options for all signals.
Bearish Signal
A bearish signal is triggered when the price opens lower than the previous session's close.
Bullish Signal
A bullish signal is triggered when the price opens higher than the previous session's close.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
Kalman Synergy Oscillator (KSO)The Kalman Synergy Oscillator (KSO) is an innovative technical indicator that combines the Kalman filter with two well-established momentum oscillators: the Relative Strength Index (RSI) and Williams %R. This combination aims to provide traders with a more refined tool for market analysis.
The use of the Kalman filter is a key feature of the KSO. This sophisticated algorithm is known for its ability to extract meaningful signals from noisy data. In financial markets, this translates to smoothing out price action while maintaining responsiveness to genuine market movements. By applying the Kalman filter to price data before calculating the RSI and Williams %R, the KSO potentially offers more stable and reliable signals.
The synergy between the Kalman-filtered price data and the two momentum indicators creates an oscillator that attempts to capture market dynamics more effectively. The RSI contributes its strength in measuring the magnitude and speed of price movements, while Williams %R adds sensitivity to overbought and oversold conditions. Basing these calculations on Kalman-filtered data may help reduce false signals and provide a clearer picture of underlying market trends.
A notable aspect of the KSO is its dynamic weighting system. This approach adjusts the relative importance of the RSI and Williams %R based on their current strengths, allowing the indicator to emphasize the most relevant information as market conditions change. This flexibility, combined with the noise-reduction properties of the Kalman filter, positions the KSO as a potentially useful tool for different market conditions.
In practice, traders might find that the KSO offers several potential benefits:
Smoother oscillator movements, which could aid in trend identification and reversal detection.
Possibly reduced whipsaws, particularly in choppy or volatile markets.
Potential for improved divergence detection, which might lead to more timely reversal signals.
Consistent performance across different timeframes, due to the adaptive nature of the Kalman filter.
While the KSO builds upon existing concepts in technical analysis, its integration of the Kalman filter with traditional momentum indicators offers traders an interesting tool for market analysis. It represents an attempt to address common challenges in technical analysis, such as noise reduction and false signal minimization.
As with any technical indicator, the KSO should be used as part of a broader trading strategy rather than in isolation. Its effectiveness will depend on how well it aligns with a trader's individual approach and market conditions. For traders looking to explore a more refined momentum oscillator, the Kalman Synergy Oscillator could be a worthwhile addition to their analytical toolkit.
Triple Smoothed Signals [AlgoAlpha]Introducing the Triple Smoothed Signals indicator by AlgoAlpha, a powerful tool designed to help traders identify trend direction and market momentum with greater accuracy. By applying triple smoothing techniques to your chosen data source, this indicator filters out market noise, allowing you to focus on significant price movements. Perfect for traders looking to enhance their technical analysis and gain an edge in the markets.
Key Features
🎨 Customizable Moving Averages : Choose between EMA, SMA, RMA, or WMA for both the triple smoothing and the signal line to tailor the indicator to your trading style.
🛠 Adjustable Smoothing Lengths : Configure the main smoothing length and signal length to fit different timeframes and market conditions.
🌈 Dynamic Color Fills : Visual gradients and fills highlight trend strength and direction, making chart analysis more intuitive.
🔔 Alerts : Set alerts for bullish and bearish crossover signals to stay ahead of market moves without constant chart monitoring.
📈 Clear Signal Visualization : Bullish and bearish signals are plotted directly on your chart for easy interpretation and timely decision-making.
Quick Guide to Using the Triple Smoothed Signals Indicator
🛠 Add the Indicator : Add the indicator to your TradingView chart by clicking on the star icon to add it to your favorites. Customize the settings such as the main smoothing length, signal length, data source, and moving average types to match your trading strategy.
📊 Market Analysis : Monitor the crossovers between the triple smoothed moving average and the signal line. A bullish signal is generated when the signal line crosses under the triple smoothed MA, indicating a potential upward trend. Conversely, a bearish signal occurs when the signal line crosses over the triple smoothed MA, suggesting a possible downward trend.
🔔 Alerts : Enable notifications for reversal signals and trend shifts to stay informed about market movements without constantly monitoring the chart.
How It Works
The Triple Smoothed Signals indicator enhances trend detection by applying a triple smoothing process to your selected data source using the moving average type of your choice (EMA, SMA, RMA, or WMA). This triple smoothed moving average (v1) effectively reduces short-term fluctuations and noise, revealing the underlying market trend. A signal line (v2) is then calculated by smoothing the triple smoothed MA with a separate moving average, further refining the signal. The indicator calculates the normalized distance between the triple smoothed MA and the signal line over a specified period, which is used to create dynamic color gradients and fills on the chart. These visual elements provide immediate insight into trend strength and direction. Bullish and bearish signals are generated based on the crossovers between the signal line and the triple smoothed MA, and are plotted directly on the chart along with customizable alerts to assist traders in making timely decisions.
ATR% Multiple from Key Moving AverageThis script gives signal when the ATR% multiple from any chosen moving average is beyond the configurable threshold value. This indicator quantifies how extended the stock is from a given key moving average.
A lot of traders use ATR% multiple from 10DMA, 21EMA, 50SMA or 200SMA to determine how extended a stock is and accordingly sell partials or exit. By default the indicator takes 50SMA and when the ATR% multiple is greater than 7 then it gives the signal to take partials. You can back test this indicator with previous trades and determine the ideal threshold for the signal. For small and midcaps a threshold of 7 to 10 ATR% multiples from 50SMA is where partials can be taken while large caps can revert to mean even earlier at 3 to 5 ATR% multiples from 50SMA.
You can modify this script and use it anyway you please as long as you make it opensource on TradingView.
Position Size Using Manual Stop Loss [odnac]
This indicator calculates the risk per position based on user-defined settings.
Two Calculation Methods
1. Manual Stop Loss (%) & Manual Leverage
2. Manual Stop Loss (%) & Optimized Leverage
Settings
1. init_capital
Enter your current total capital.
2. Maximum Risk (%) per Position of Total Capital
Specify the percentage of your total funds to be risked for a single position.
3. manual_SL(%)
Enter the stop-loss percentage.
Range: 0.01 ~ 100
4. manual_leverage
Enter the leverage you wish to use.
Range: 1 ~ 100
Used in the first method (Manual Stop Loss (%) & Manual Leverage).
5. Safety Margin
Specify the safety margin for optimized leverage.
Range: 0.01 ~ 1
Used in the second method (Manual Stop Loss (%) & Optimized Leverage). Details are explained below.
Indicator Colors
Black: Indicates which method is being used.
White: Leverage.
First Green: Funds to be invested.
Second Green: Funds to be invested * Leverage.
First Red: Stop-loss (%).
Second Red: Stop-loss (%) * Leverage.
Details for Each Method:
1. Manual Stop Loss (%) & Manual Leverage
This method calculates the size of the funds based on user-defined stop-loss (%) and leverage settings.
White: manual_leverage.
First Green: Investment = Maximum Risk / (manual_SL / 100) / manual_leverage
Second Green: Maximum Risk * (manual_SL / 100)
First Red: manual_SL.
Second Red: manual_SL * manual_leverage
Ensure that the product of manual_SL and manual_leverage does not exceed 100.
If it does, there is a risk of liquidation.
2. Manual Stop Loss (%) & Optimized Leverage
This method calculates optimized leverage based on the user-defined stop-loss (%) and determines the size of the funds.
Optimization_LEVER = auto_leverage * safety_margin
auto_leverage = 100 / stop-loss (%), rounded down to the nearest whole number.
(Exception: If the stop-loss (%) is in the range of 0 ~ 1%, auto_leverage is always 100.)
Example:
If the stop-loss is 4%, auto_leverage = 25 (100 / 4 = 25).
However, 4% × 25 leverage equals 100%, meaning liquidation occurs even with a stop-loss.
To reduce this risk, the safety_margin value is applied.
White: auto_leverage * safety_margin
First Green: Investment = Maximum Risk / (manual_SL / 100) / optimization_LEVER
Second Green: Maximum Risk * (manual_SL / 100)
First Red: manual_SL.
Second Red: manual_SL * optimization_LEVER
Hybrid Triple Exponential Smoothing🙏🏻 TV, I present you HTES aka Hybrid Triple Exponential Smoothing, designed by Holt & Winters in the US, assembled by me in Saint P. I apply exponential smoothing individually to the data itself, then to residuals from the fitted values, and lastly to one-point forecast (OPF) errors, hence 'hybrid'. At the same time, the method is a closed-form solution and purely online, no need to make any recalculations & optimize anything, so the method is O(1).
^^ historical OPFs and one-point forecasting interval plotted instead of fitted values and prediction interval
Before the How-to, first let me tell you some non-obvious things about Triple Exponential smoothing (and about Exponential Smoothing in general) that not many catch. Expo smoothing seems very straightforward and obvious, but if you look deeper...
1) The whole point of exponential smoothing is its incremental/online nature, and its O(1) algorithm complexity, making it dope for high-frequency streaming data that is also univariate and has no weights. Consequently:
- Any hybrid models that involve expo smoothing and any type of ML models like gradient boosting applied to residuals rarely make much sense business-wise: if you have resources to boost the residuals, you prolly have resources to use something instead of expo smoothing;
- It also concerns the fashion of using optimizers to pick smoothing parameters; honestly, if you use this approach, you have to retrain on each datapoint, which is crazy in a streaming context. If you're not in a streaming context, why expo smoothing? What makes more sense is either picking smoothing parameters once, guided by exogenous info, or using dynamic ones calculated in a minimalistic and elegant way (more on that in further drops).
2) No matter how 'right' you choose the smoothing parameters, all the resulting components (level, trend, seasonal) are not pure; each of them contains a bit of info from the other components, this is just how non-sequential expo smoothing works. You gotta know this if you wanna use expo smoothing to decompose your time series into separate components. The only pure component there, lol, is the residuals;
3) Given what I've just said, treating the level (that does contain trend and seasonal components partially) as the resulting fit is a mistake. The resulting fit is level (l) + trend (b) + seasonal (s). And from this fit, you calculate residuals;
4) The residuals component is not some kind of bad thing; it is simply the component that contains info you consciously decide not to include in your model for whatever reason;
5) Forecasting Errors and Residuals from fitted values are 2 different things. The former are deltas between the forecasts you've made and actual values you've observed, the latter are simply differences between actual datapoints and in-sample fitted values;
6) Residuals are used for in-sample prediction intervals, errors for out-of-sample forecasting intervals;
7) Choosing between single, double, or triple expo smoothing should not be based exclusively on the nature of your data, but on what you need to do as well. For example:
- If you have trending seasonal data and you wanna do forecasting exclusively within the expo smoothing framework, then yes, you need Triple Exponential Smoothing;
- If you wanna use prediction intervals for generating trend-trading signals and you disregard seasonality, then you need single (simple) expo smoothing, even on trending data. Otherwise, the trend component will be included in your model's fitted values → prediction intervals.
8) Kind of not non-obvious, but when you put one smoothing parameter to zero, you basically disregard this component. E.g., in triple expo smoothing, when you put gamma and beta to zero, you basically end up with single exponential smoothing.
^^ data smoothing, beta and gamma zeroed out, forecasting steps = 0
About the implementation
* I use a simple power transform that results in a log transform with lambda = 0 instead of the mainstream-used transformers (if you put lambda on 2 in Box-Cox, you won't get a power of 2 transform)
* Separate set of smoothing parameters for data, residuals, and errors smoothing
* Separate band multipliers for residuals and errors
* Both typical error and typical residuals get multiplied by math.sqrt(math.pi / 2) in order to approach standard deviation so you can ~use Z values and get more or less corresponding probabilities
* In script settings → style, you can switch on/off plotting of many things that get calculated internally:
- You can visualize separate components (just remember they are not pure);
- You can switch off fit and switch on OPF plotting;
- You can plot residuals and their exponentially smoothed typical value to pick the smoothing parameters for both data and residuals;
- Or you might plot errors and play with data smoothing parameters to minimize them (consult SAE aka Sum of Absolute Errors plot);
^^ nuff said
More ideas on how to use the thing
1) Use Double Exponential Smoothing (data gamma = 0) to detrend your time series for further processing (Fourier likes at least weakly stationary data);
2) Put single expo smoothing on your strategy/subaccount equity chart (data alpha = data beta = 0), set prediction interval deviation multiplier to 1, run your strat live on simulator, start executing on real market when equity on simulator hits upper deviation (prediction interval), stop trading if equity hits lower deviation on simulator. Basically, let the strat always run on simulator, but send real orders to a real market when the strat is successful on your simulator;
3) Set up the model to minimize one-point forecasting errors, put error forecasting steps to 1, now you're doing nowcasting;
4) Forecast noisy trending sine waves for fun.
^^ nuff said 2
All Good TV ∞
Wick Length Display + Alert conditionsDescription of the Wick Length Display (Advanced) script
Originality and purpose of the script
The Wick Length Display (Advanced) script is an innovative tool for traders who want to gain detailed insights into the length of candle wicks. It stands out for its versatility and user-friendly customization options. It combines precise technical calculations with visual representation to provide important information about market movements and dynamics right on the chart.
Functionality
The script calculates and displays the length of the upper and lower wicks of each candle on the chart. It also provides additional visual cues such as:
• “Bull pressure”: When green candles do not have upper wicks, this indicates strong buying pressure.
• “Bear pressure”: When red candles do not have lower wicks, this indicates strong selling pressure.
• Threshold conditions: Only displays wicks that exceed a certain threshold (optional).
• Display in pips: Allows you to display wick lengths in pips, which is useful for forex traders.
How it works
The script analyzes each candle using the following calculations:
1. Wick length calculation:
◦ Upper wick length = High - (top of the body)
◦ Lower wick length = (bottom of the body) - Low
2. Display conditions:
◦ It distinguishes between bullish and bearish candles.
◦ It checks if the calculated wicks exceed the defined thresholds before displaying them.
3. Dynamic labels:
◦ Labels are placed above or below the respective candles.
◦ Size, color and type of labels are fully customizable.
4. Limitation of labels:
◦ To ensure clarity, a maximum number of labels is defined.
Usage
1. Customization:
◦ Open the script in the Pine Script Editor in TradingView.
◦ Use the input options to customize parameters such as color selection, label size, thresholds and other details according to your requirements.
2. Enable thresholds:
◦ Enable thresholds to show labels only for relevant wicks (default is 6).
◦ Define the minimum wick lengths for bullish (green) and bearish (red) candles.
3. Show in pips:
◦ Enable the “Show wick length in pips” option to show the results in pips (especially suitable for Forex).
4. Edit pressure labels:
◦ Turn the “Bull Pressure” and “Bear Pressure” features on or off depending on your analysis settings.
Concepts behind the calculations
• Technical market analysis: Wick lengths can indicate buying or selling pressure and provide important information on market psychology.
• Thresholds and filtering: The script uses thresholds to avoid visual overload and highlight only essential data.
• Label display: Dynamic labels improve chart readability and give the user instant feedback on market developments.
Usage
This script is great for:
• Intraday trading: Analyzing short-term movements using wick lengths.
• Forex trading: Tracking market momentum using the pip indicator.
• Swing trading: Identifying buying or selling pressure in key markets.
• Visual support: Ideal for traders who prefer a graphical display.
Description of the Wick Length Display (Advanced) script
Originality and purpose of the script
The Wick Length Display (Advanced) script is an innovative tool for traders who want to gain detailed insights into the length of candle wicks. It stands out for its versatility and user-friendly customization options. It combines precise technical calculations with visual representation to provide important information about market movements and dynamics right on the chart.
Functionality
The script calculates and displays the length of the upper and lower wicks of each candle on the chart. It also provides additional visual cues such as:
• “Bull pressure”: When green candles do not have upper wicks, this indicates strong buying pressure.
• “Bear pressure”: When red candles do not have lower wicks, this indicates strong selling pressure.
• Threshold conditions: Only displays wicks that exceed a certain threshold (optional).
• Display in pips: Allows you to display wick lengths in pips, which is useful for forex traders.
How it works
The script analyzes each candle using the following calculations:
1. Wick length calculation:
◦ Upper wick length = High - (top of the body)
◦ Lower wick length = (bottom of the body) - Low
2. Display conditions:
◦ It distinguishes between bullish and bearish candles.
◦ It checks if the calculated wicks exceed the defined thresholds before displaying them.
3. Dynamic labels:
◦ Labels are placed above or below the respective candles.
◦ Size, color and type of labels are fully customizable.
4. Limitation of labels
Alert conditions:
Alerts are triggered when the wick length of a bullish or bearish candle exceeds the defined thresholds.
Alert function:
alert() is used to issue messages with a frequency of once per candle when the conditions are met.
How to set up alerts
Save the script and add it to your chart.
Open the alert settings in TradingView.
Select the script's custom message as a trigger.
Adjust the frequency and notification type (popup, email, etc.).
Now you have a powerful tool with visual analysis and alert function!
Daily Moving Averages on Intraday ChartsThis moving average script displays the chosen 5 daily moving averages on intraday (minute) charts. It automatically adjusts the intervals to show the proper moving averages.
In a day there are 375 trading minutes from 9:15 AM to 3:30PM in Indian market. In 5 days there are 1875 minutes. For other markets adjust this data accordingly.
If 5DMA is chosen on a five minute chart the moving average will use 375 interval values (1875/5 = 375) of 5minute chart to calculate moving average. Same 5DMA on 25minute chart will use 75 interval values (1875/25 = 75).
On a 1minute chart the 5DMA plot will use 1875 interval values to arrive at the moving average.
Since tradingview only allows 5000 intervals to lookback, if a particular daily moving average on intraday chart needs more than 5000 candle data it won't be shown. E.g 200DMA on 5minute chart needs 15000 candles data to plot a correct 200DMA line. Anything less than that would give incorrect moving average and hence it won't be shown on the chart.
MA crossover for the first two MAs is provided. If you want to use that option, make sure you give the moving averages in the correct order.
You can enhance this script and use it in any way you please as long as you make it opensource on TradingView. Feedback and improvement suggestions are welcome.
Special thanks to @JohnMuchow for his moving averages script for all timeframes.
Candle ThermalsThis indicator color candles based on their percentage price change, relative to the average, maximum, and minimum changes over the last 100 candles.
-It calculates the percentage change of all candles
-Calculates the minimum, maximum and average in the last 100 bars in percentage change
-Changes color of the candle based on the range between the current percent and min/max value
-The brightest candle provides the highest compound effect to you account if you act on it at the open.
-Candles that have a percentage close to the average then they are barely visible = lowest compound effect to your account
This indicator functions like a "heatmap" for candles, highlighting the relative volatility of price movements in both directions. Strong bullish candles are brighter green, and strong bearish candles are brighter red. It's particularly useful for traders wanting quick visual feedback on price volatility and strength trends within the last 100 bars.
Z The Good Stuff +I created this script to have a couple datapoints that I want to look at when going through charts to find trade ideas. Qullamaggie is one of my biggest inspirations and I built in a couple of his concepts with a touch to help me with sizing properly, all explained below:
Box 1: ADR %, Average Daily Range, gives and indication of how volatile the stock is. It uses the 20 day average % move of the current stock on the chart.
Box 2: LOD Distance, low of day distance is a quality of life element I created. It calculates the low for the current candle and color codes it red or green depending on if it's higher or lower than the daily ADR. The logic is that if a stock has an average speed, buying on a setup it is preferred if the stop distance (assuming a low of day stop) should be less than the ADR to improve the odds of more upside.
Box 3: Todays DV, this shows a rough estimate of how much money was traded on the particular day.
Box 4: ADV 20 days, similar to above this shows the 20 day $ traded average. The point to look at it is to have a better idea what position size is possible to not get stuck in something too illiquid.
Box 5: Market cap, just shows the market cap of the stock to know what size the company is.
Box 6: Number of shares, this is an additional quality of life aspect. If using low of day stops, this part calculates based on the users' inputted portfolio size and portfolio risk preference and then calculates how many stocks to buy to stay within the risk parameters. It is obviously not a sole decision making parameter nor does it guarantee any execution, but if a stock is showing an entry you want to take you can use the number of shares to help you know how many to buy. The preset is a portfolio of 10000 and a risk of 0.25%. This means that the number of shares to buy will be at the current price with lod stop that would result in a 0.25% portfolio loss. OF COURSE the actual loss depends on the execution and if the user places a stop loss order.
Hope you find it useful and feel free to give feedback! Cheers!
100s Level LinesPurpose of the Script
- Visualize Key Levels: The script highlights round-number levels (e.g., 100, 200, 300) automatically, making it easy to identify areas where price action might react.
- Improve Decision-Making: These levels can serve as benchmarks for entry, exit, stop-loss, or take-profit placement.
- Simplicity: Instead of manually drawing levels, the script dynamically updates to match the chart's price range.
Features of the Script
- Dynamic Level Calculation: The script calculates 100s levels based on the asset's current price range and plots lines above and below the visible chart area.
- Customizable Settings: Adjust line color, style (solid, dashed, or dotted), and width to suit your charting preferences.
- Auto-Scaling: Automatically adjusts to the chart's visible price range, ensuring plotted levels are always relevant.
- Labeling: Each line can optionally display its exact value (e.g., "1400," "1500") for easy reference.
- Performance Optimization: Efficient calculations ensure the script doesn’t slow down TradingView, even on volatile instruments like the US100.
How the Script Works
- The script detects the highest and lowest visible prices on the chart to define the range.
- Starting from the lowest 100-point increment within the visible range, the script calculates all 100-point levels up to the highest visible price.
- It plots horizontal lines across the chart for each calculated level.
- Optionally, labels can be added to display the value of each level.
How to Use the Script
- Copy the script code into the Pine Script editor in TradingView and apply it to your chart.
- Open the script settings to adjust line color, style, width, and label visibility.
- Use the plotted 100s levels as psychological support and resistance zones for trade entries, exits, and stop-loss or take-profit placement.
Example Use Cases
- Identify potential reversal points as the price approaches a 100s level in intraday trading.
- Confirm support or resistance zones on higher timeframes for swing trading setups.
- Use the levels to trail stop-losses during trending markets and lock in profits incrementally.
Customizable Options
- Line Color: Change the color of the horizontal lines.
- Line Style: Choose solid, dashed, or dotted lines.
- Line Width: Adjust the thickness of the lines for better visibility.
- Show Labels: Toggle price values on or off for each level.
Advantages
- Saves Time: Automatically plots levels, eliminating manual effort.
- Adaptable: Works on all timeframes and assets.
- Psychological Relevance: Highlights levels that align with trader psychology and market behavior.
Volatility-Adjusted Trend Deviation Statistics (C-Ratios)The Pine Script logic provided generates and displays a table with key information derived from VWMA, EMA, and ATR-based "C Ratios," alongside stochastic oscillators, correlation coefficients, Z-scores, and bias indicators. Here’s an explanation of the logic and what the output in the table informs:
Key Calculations and Their Purpose
VWMA and EMA (Smoothing Lengths):
Multiple EMAs are calculated using VWMA as the source, with lengths spanning short-term (13) to long-term (233).
These EMAs provide a hierarchy of smoothed price levels to assess trends over various time horizons.
ATR-Based "C Ratios":
The C Ratios measure deviations of smoothed prices (a_1 to a_7) from the source price relative to ATR at corresponding lengths.
These values normalize deviations, giving insight into the price's relative movement strength and direction over various periods.
Stochastic Oscillator for C Ratios:
Calculates normalized stochastic values for each C Ratio to assess overbought/oversold conditions dynamically over a rolling window.
Helps identify short-term momentum trends within the broader context of C Ratios.
Displays the average stochastic value derived from all C Ratios.
Text: Shows overbought/oversold conditions (Overbought, Oversold, or ---).
Color: Green for strong upward momentum, red for downward, and white for neutral.
Weighted and Mean C Ratio:
The script computes both an arithmetic mean (c_mean) and a weighted mean (c_mean_w) for all C Ratios.
Weighted mean emphasizes short-term values using predefined weights.
Trend Bias and Reversal Detection:
The script calculates Z-scores for c_mean to identify statistically significant deviations.
It combines Z-scores and weighted C Ratio values to determine:
Bias (Bullish/Bearish based on Z-score thresholds and mean values).
Reversals (Based on relative positioning and how the weighted c_mean and un-weighted C_mean move. ).
Correlation Coefficient:
Correlation of mean C Ratios (c_mean) with bar indices over the short-term length (sl) assesses the strength and direction of trend consistency.
Table Output and Its Meaning
Stochastic Strength:
Long-term Correlation:
List of Lengths: Define the list of lengths for EMA and ATR explicitly (e.g., ).
Calculate Mean C Ratios: For each length in the list, calculate the mean C Ratio
Average these values over the entire dataset.
Store Lengths and Mean C Ratios: Maintain arrays for lengths and their corresponding mean C Ratios.
Correlation: compute the Pearson correlation between the list of lengths and the mean C Ratios.
Text: Indicates Uptrend, Downtrend, or neutral (---).
Color: Green for positive (uptrend), red for negative (downtrend), and white for neutral.
Z-Score Bias:
Assesses the statistical deviation of C Ratios from their historical mean.
Text: Bullish Bias, Bearish Bias, or --- (neutral).
Color: Green or red based on the direction and significance of the Z-score.
C-Ratio Mean:
Displays the weighted average C Ratio (c_mean_w) or a reversal condition.
Text: If no reversal is detected, shows c_mean_w; otherwise, a reversal condition (Bullish Reversal, Bearish Reversal).
Color: Indicates the strength and direction of the bias or reversal.
Practical Insights
Trend Identification: Correlation coefficients, Z-scores, and stochastic values collectively highlight whether the market is trending and the trend's direction.
Momentum and Volatility: Stochastic and ATR-normalized C Ratios provide insights into the momentum and price movement consistency across different timeframes.
Bias and Reversal Detection: The script highlights potential shifts in market sentiment or direction (bias or reversal) using statistical measures.
Customization: Users can toggle plots and analyze specific EMA lengths or focus on combined metrics like the weighted C Ratio.
Position Sizing Calculator (Real-Time)█ SUMMARY
The following indicator is a Position Sizing Calculator based on Average True Range (ATR), originally developed by market technician J. Welles Wilder Jr., intended for real-time trading.
This script utilizes the user's account size, acceptable risk percentage, and a stop-loss distance based on ATR to dynamically calculate the appropriate position size for each trade in real time.
█ BACKGROUND
Developed for use on the 5-minute timeframe, this script provides traders with continuously updated, dynamic position sizes. It enables traders to instantly determine the exact number of shares and dollar amount to use for entering a trade within their acceptable risk tolerance whenever a trade opportunity arises.
This real-time position sizing tool helps traders make well-informed decisions when planning trade entries and calculating maximum stop-loss levels, ultimately enhancing risk management.
█ USER INPUTS
Trading Account Size: Total dollar value of the user's trading account.
Acceptable Risk (%): Maximum percentage of the trading account that the user is willing to risk per trade.
ATR Multiplier for Stop-Loss: Multiplier used to determine the distance of the stop-loss from the current price, based on the ATR value.
ATR Length: The length of the lookback period used to calculate the ATR value.
Fractal Trail [UAlgo]The Fractal Trail is designed to identify and utilize Williams fractals as dynamic trailing stops. This tool serves traders by marking key fractal points on the chart and leveraging them to create adaptive stop-loss trails, enhancing risk management and trade decision-making.
Williams fractals are pivotal in identifying potential reversals and critical support/resistance levels. By plotting fractals dynamically and providing configurable options, this indicator allows for personalized adjustments based on the trader's strategy.
This script integrates both visual fractal markers and adjustable trailing stops, offering insights into market trends while catering to a wide variety of trading styles and timeframes.
🔶 Key Features
Williams Fractals Identification: The indicator marks Williams Fractals on the chart, which are significant highs and lows within a specified range. These fractals are crucial for identifying potential reversal points in the market.
Dynamic Trailing Stops: The indicator generates dynamic trailing stops based on the identified fractals. These stops adjust automatically as new fractals are formed, providing a responsive and adaptive approach to risk management.
Fractal Range: Users can specify the number of bars to the left and right for analyzing fractals, allowing for flexibility in identifying significant price points.
Trail Buffer Percentage: A percentage-based safety margin can be added between the fractal price and the trailing stop, providing additional control over risk management.
Trail Invalidation Source: Users can choose whether the trailing stop flips based on candle closing prices or the extreme points (high/low) of the candles.
Alerts and Notifications: The indicator provides alerts for when the price crosses the trailing stops, as well as when new Williams Fractals are confirmed. These alerts can be customized to fit the trader's notification preferences.
🔶 Interpreting the Indicator
Fractal Markers: The triangles above and below the bars indicate Williams Fractals. These markers help traders identify potential reversal points in the market.
Trailing Stops: The dynamic trailing stops are plotted as lines on the chart. These lines adjust based on the latest identified fractals, providing a visual representation of potential support and resistance levels.
Fill Colors: The optional fill colors between the trailing stops and the price action help traders quickly identify the current trend and potential pullback zones.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.