SuperTrend Machine - CZ INDICATORS🤖 SuperTrend Machine CZ INDICATORS - Take Your Trading to the Next Level! ✨
Introducing the SuperTrend Machine, an advanced trading indicator designed to adapt to market volatility dynamically using machine learning techniques. This indicator employs k-means clustering to categorize market volatility into high, medium, and low levels, enhancing the traditional SuperTrend strategy. Perfect for traders who want an edge in identifying trend shifts and market conditions.
What is K-Means Clustering and How It Works
K-means clustering is a machine learning algorithm that partitions data into distinct groups based on similarity. In this indicator, the algorithm analyzes ATR (Average True Range) values to classify volatility into three clusters: high, medium, and low. The algorithm iterates to optimize the centroids of these clusters, ensuring accurate volatility classification.
Key Features
🎨 Customizable Appearance: Adjust colors for bullish and bearish trends.
🔧 Flexible Settings: Configure ATR length, SuperTrend factor, and initial volatility guesses.
📊 Volatility Classification: Uses k-means clustering to adapt to market conditions.
📈 Dynamic SuperTrend Calculation: Applies the classified volatility level to the SuperTrend calculation.
🔔 Alerts: Set alerts for trend shifts and volatility changes.
📋 Data Table Display: View cluster details and current volatility on the chart.How It Works
How It Works
The indicator begins by calculating the ATR values over a specified training period to assess market volatility. Initial guesses for high, medium, and low volatility percentiles are inputted. The k-means clustering algorithm then iterates to classify the ATR values into three clusters. This classification helps in determining the appropriate volatility level to apply to the SuperTrend calculation. As the market evolves, the indicator dynamically adjusts, providing real-time trend and volatility insights. The indicator also incorporates a data table displaying cluster centroids, sizes, and the current volatility level, aiding traders in making informed decisions.
🤖 SuperTrend Machine CZ INDICATORS - выведите свою торговлю на новый уровень! ✨
Представляем SuperTrend Machine, продвинутый торговый индикатор, разработанный для динамической адаптации к волатильности рынка с помощью методов машинного обучения. Этот индикатор использует кластеризацию k-means для классификации волатильности рынка на высокий, средний и низкий уровни, усиливая традиционную стратегию SuperTrend. Идеально подходит для трейдеров, которые хотят получить преимущество в определении смены тренда и рыночных условий.
Что такое кластеризация K-Means и как она работает
Кластеризация K-Means - это алгоритм машинного обучения, который разделяет данные на отдельные группы на основе сходства. В данном индикаторе алгоритм анализирует значения ATR (Average True Range), чтобы разделить волатильность на три кластера: высокая, средняя и низкая. Алгоритм проводит итерации для оптимизации центроидов этих кластеров, обеспечивая точную классификацию волатильности.
Ключевые особенности
🎨 Настраиваемый внешний вид: Настройте цвета для бычьих и медвежьих трендов.
🔧 Гибкие настройки: Настройте длину ATR, фактор SuperTrend и начальные предположения о волатильности.
📊 Классификация волатильности: Использует кластеризацию k-means для адаптации к рыночным условиям.
📈 Расчет динамического супертренда: Применяет классифицированный уровень волатильности для расчета Супертренда.
🔔 Оповещения: Установка предупреждений о смене тренда и изменении волатильности.
📋 Отображение таблицы данных: Просмотр подробной информации о кластере и текущей волатильности на графике.Как это работает
Как это работает
Индикатор начинает работу с расчета значений ATR за определенный период обучения для оценки волатильности рынка. Вводятся начальные предположения о перцентилях высокой, средней и низкой волатильности. Затем алгоритм кластеризации k-means проводит итерации для классификации значений ATR по трем кластерам. Эта классификация помогает определить подходящий уровень волатильности для расчета SuperTrend. По мере развития рынка индикатор динамически подстраивается, предоставляя в реальном времени информацию о тренде и волатильности. Индикатор также включает в себя таблицу данных, в которой отображаются центроиды кластеров, их размеры и текущий уровень волатильности, что помогает трейдерам принимать обоснованные решения.
Structureanalysis
Premium structure - Higher High / Lower low - CZ INDICATORSThe best indicator on the Higher High - Lower low system.
This script identifies Orderblocks, Breakerblocks and Range using higher order pivots and priceaction logic.
I tried to reduce the number of blocks to make the chart cleaner, for this purpose I use only second order pivots for both MSB lines and supply/demand boxes, I also tried to filter out shifts in MS and false breakouts.
Green arrows show our lows, red arrows show our highs. This is done in order to clearly and clearly understand the current trend.
Also added order block, and breaker block.
Any box has GRAY color until it gets tested.
After successful test box gets colors:
RED for Supply
GREEN for Demand
BLUE for any Breakerblocks
For cleaner chart and script speed all broken boxes deletes from chart.
It gives comparatively clean chart on any TF, even on extra small (5m, 3m, 1m).
Лучший индикатор по системе Higher High - Lower Low.
Этот скрипт определяет ордерные блоки, брейкерные блоки и диапазоны, используя развороты высшего порядка и логику ценовых действий.
Я попытался уменьшить количество блоков, чтобы сделать график чище, для этого я использую только развороты второго порядка для линий MSB и блоков спроса/предложения, я также попытался отфильтровать сдвиги в MS и ложные прорывы.
Зеленые стрелки показывают наши минимумы, красные - максимумы. Это сделано для того, чтобы четко и ясно понимать текущий тренд.
Также добавлен блок ордеров и блок пробоев.
Любой блок имеет серый цвет до тех пор, пока он не будет протестирован.
После успешного тестирования блок приобретает цвет:
КРАСНЫЙ для предложения
ЗЕЛЕНЫЙ для спроса
СИНИЙ для любых блоков прерывателей.
Для более чистого графика и скорости работы скрипта все сломанные блоки удаляются с графика.
Это дает сравнительно чистый график на любом ТФ, даже на сверхмалых (5м, 3м, 1м).
SUPER EMA 10/25/75/200/300 - CZ INDICATORSSUPER EMA
5 ema on one chart, with possible customization.
5 ema на одном графике, с возможностью настройки.
Smart money conceptThe indicator tracks the smallest movements of price action. It can monitor and analyze market context, attempting to identify trends within each time frame.
If a candle has its entire body above the previous swing high, it indicates a strong upward momentum. The market is leaning towards an upward direction. If the candle remains within the range of the previous swing high, it signifies weak upward momentum. The market is reluctant to move higher.
If a candle has its entire body below the previous swing low, it reflects a strong downward momentum. The market is leaning towards a downward direction. If the candle remains within the range of the previous swing low, it indicates weak downward momentum. The market is reluctant to move lower.
Sniffer
╭━━━╮╱╱╱╱╭━╮╭━╮
┃╭━╮┃╱╱╱╱┃╭╯┃╭╯
┃╰━━┳━╮╭┳╯╰┳╯╰┳━━┳━╮
╰━━╮┃╭╮╋╋╮╭┻╮╭┫┃━┫╭╯
┃╰━╯┃┃┃┃┃┃┃╱┃┃┃┃━┫┃
╰━━━┻╯╰┻╯╰╯╱╰╯╰━━┻╯
Overview
A vast majority of modern data analysis & modelling techniques rely upon the idea of hidden patterns, wether it is some type of visualisation tool or some form of a complex machine learning algorithm, the one thing that they have in common is the belief, that patterns tell us what’s hidden behind plain numbers. The same philosophy has been adopted by many traders & investors worldwide, there’s an entire school of thought that operates purely based on chart patterns. This is where Sniffer comes in, it is a tool designed to simplify & quantify the job of pattern recognition on any given price chart, by combining various factors & techniques that generate high-quality results.
This tool analyses bars selected by the user, and highlights bar clusters on the chart that exhibit similar behaviour across multiple dimensions. It can detect a single candle pattern like hammers or dojis, or it can handle multiple candles like morning/evening stars or double tops/bottoms, and many more. In fact, the tool is completely independent of such specific candle formations, instead, it works on the idea of vector similarity and generates a degree of similarity for every single combination of candles. Only the top-n matches are highlighted, users get to choose which patterns they want to analyse and to what degree, by customising the feature-space.
Background
In the world of trading, a common use-case is to scan a price chart for some specific candlestick formations & price structures, and then the chart is further analysed in reference to these events. Traders are often trying to answer questions like, when was the last time price showed similar behaviour, what are the instances similar to what price is doing right now, what happens when price forms a pattern like this, what were some of other indicators doing when this happened last(RSI, CCI, ADX etc), and many other abstract ideas to have a stronger confluence or to confirm a bias.Having such a context can be vital in making better informed decisions, but doing this manually on a chart that has thousands of candles can have many disadvantages. It’s tedious, human errors are rather likely, and even if it’s done with pin-point accuracy, chances are that we’ll miss out on many pieces of information. This is the thought that gave birth to Sniffer .
Sniffer tries to provide a general solution for pattern-based analysis by deploying vector-similarity computation techniques, that cover the full-breadth of a price chart and generate a list of top-n matches based on the criteria selected by the user. Most of these techniques come from the data science space, where vector similarity is often implemented to solve classification & clustering problems. Sniffer uses same principles of vector comparison, and computes a degree of similarity for every single candle formation within the selected range, and as a result generates a similarity matrix that captures how similar or dissimilar a set of candles is to the input set selected by the user.
How It Works
A brief overview of how the tool is implemented:
- Every bar is processed, and a set of features are mapped to it.
- Bars selected by the user are captured, and saved for later use.
- Once the all the bars have been processed, candles are back-tracked and degree of similarity is computed for every single bar(max-limit is 5000 bars).
- Degree of similarity is computed by comparing attributes like price range, candle breadth & volume etc.
- Similarity matrix is sorted and top-n results are highlighted on the chart through boxes of different colors.
A brief overview of the features space for bars:
- Range: Difference between high & low
- Body: Difference between close & open
- Volume: Traded volume for that candle
- Head: Upper wick for green candles & lower wick for red candles
- Tail: Lower wick for green candles & upper wick for red candles
- BTR: Body to Range ratio
- HTR: Head to Range ratio
- TTR: Tail to Range ratio
- HTB: Head to Body ratio
- TTB: Tail to Body ratio
- ROC: Rate of change for HL2 for four different periods
- RSI: Relative Strength Index
- CCI: Commodity Channel Index
- Stochastic: Stochastic Index
- ADX: DMI+, DMI- & ADX
A brief overview of how degree of similarity is calculated:
- Each bar set is compared to the inout bar set within the selected feature space
- Features are represented as vectors, and distance between the vectors is calculated
- Shorter the distance, greater the similarity
- Different distance calculation methods are available to choose from, such as Cosine, Euclidean, Lorentzian, Manhattan, & Pearson
- Each method is likely to generate slightly different results, users are expected to select the method & the feature space that best fits their use-case
How To Use It
- Usage of this tool is relatively straightforward, users can add this indicator to their chart and similar clusters will be highlighted automatically
- Users need to select a time range that will be treated as input, and bars within that range become the input formation for similarity calculations
- Boxes will be draw around the clusters that fit the matching criteria
- Boxes are color-coded, green color boxes represent the top one-third of the top-n matches, yellow boxes represent the middle third, red boxes are for bottom third, and white box represents user-input
- Boxes colors will be adjusted as you adjust input parameters, such as number of matches or look-back period
User Settings
Users can configure the following options:
- Select the time-range to set input bars
- Select the look-back period, number of candles to backtrack for similarity search
- Select the number of top-n matches to show on the chart
- Select the method for similarity calculation
- Adjust the feature space, this enables addition of custom features, such as pattern recognition, technical indicators, rate of change etc
- Toggle verbosity, shows degree of similarity as a percentage value inside the box
Top Features
- Pattern Agnostic: Designed to work with variable number of candles & complex patterns
- Customisable Feature Space: Users get to add custom features to each bar
- Comprehensive Comparison: Generates a degree of similarity for all possible combinations
Final Note
- Similarity matches will be shown only within last 4500 bars.
- In theory, it is possible to compute similarity for any size candle formations, indicator has been tested with formations of 50+ candles, but it is recommended to select smaller range for faster & cleaner results.
- As you move to smaller time frames, selected time range will provide a larger number of candles as input, which can produce undesired results, it is advised to adjust your selection when you change time frames. Seeking suggestions on how to directly receive bars as user input, instead of time range.
- At times, users may see array index out of bound error when setting up this indicator, this generally happens when the input range is not properly configured. So, it should disappear after you select the input range, still trying to figure out where it is coming from, suggestions are welcome.
Credits
- @HeWhoMustNotBeNamed for publishing such a handy PineScript Logger, it certainly made the job a lot easier.
Price Swing Detection - Smart Money ConceptSince my own style is Smart Money Concept and these days I have seen a lot of my friends who are having trouble identifying structures for their indicators and strategies. I wrote this code so they could use it in their strategy . In fact, this type of structure, as one of the strongest technical structures, can increase the success of your strategy according to your personalization.
The script detects swings (i.e. significant highs and lows) in a financial instrument's price action over a specified period. The user can set the lookback period (number of candles to consider) and the colors of the lines representing bullish and bearish trends.
The script has two functions: detectSwing and pivot high. The detectSwing function calculates the swing highs and lows for the specified number of candles. The function uses the ta.highest and ta.lowest functions to find the highest and lowest prices, respectively, over the lookback period. The function also determines the swing state (high or low) of the current candle and returns the calculated swing values.
The pivot high function calculates the pivot high, which is an important step in detecting bullish structures in the market. If a new top (i.e. swing high) is found, the script updates the pivot high values and creates a line from the recent top to the last bar. The script also updates the trailing maximum values, which are used to extend the top extension line.
For Strategy :
The variable "trendDirection" in the code is used to keep track of the trend state, either bullish (up trend) or bearish (down trend), in the market. The variable is initialized to 0 which represents a downtrend. The value of this variable is updated later in the code based on the calculations of swing highs and lows, pivot crosses, and the trailing maximum. If a bullish structure is detected, the value of "trendDirection" is set to 1, indicating an uptrend.