simwai

Local Model Kalman Market Mode

simwai 업데이트됨   
Introduction
Heyo guys, I made a new (repainting) indicator called Local Model Kalman Market Mode.
I created it, because I wanted a reliable market mode filter for a potential mean-reversion strategy (e. g. BB Scalping).

On the screenshot you can see an example of how to use it in a BB strategy.
E.g. you would enter long when you have bullish divergence, price is under lower BB, price is under PoC and this indicator here shows range-bound market phase.
You would exit long on cross of the middle band.

Description
The indicator attempts to model the underlying market using different local models (i.e., trending, range-bound, and choppy) and combines them using the T3 Six Pole Kalman Filter to generate an overall estimate of the market.
The Fisher Transform is applied on the price to reach a Gaussian distribution, which increases the accuracy of the indicator itself.
The script first defines state variables for each local model, which include trend direction, trend strength, upper and lower bounds of the range, volatility of the range, level of choppiness, and strength of noise.
Then, likelihood functions are defined for each local model based on the state variables.
Next, the script calculates weights for each local model based on their likelihoods and uses them to calculate state variables for the overall estimate.
Finally, the script combines the state variables using the T3 Six Pole Kalman Filter to generate the overall estimate of the market, which is plotted in blue.

Fundamental Knowledge
To understand the explanation of the indicator and the script, there are a few fundamental concepts that you need to know:

Market: A market is a place where buyers and sellers come together to exchange goods or services.
In the context of trading, the market refers to the exchange where financial instruments such as stocks, currencies, and commodities are bought and sold.

Local models: Local models are statistical models that attempt to capture the characteristics of a particular market regime.
For example, a trending market may have different characteristics than a range-bound market or a choppy market.
The indicator uses different local models to capture the different market regimes.

Trend direction and strength: The trend direction refers to the direction in which the market is moving, either up or down.
The trend strength refers to the magnitude of the trend and how likely it is to continue.

Range-bound market: A range-bound market is a market where prices are trading within a specific range, with a clear upper and lower bound.

Choppiness: Choppiness refers to the degree of irregularity in price movements, often seen in sideways or range-bound markets.

Volatility: Volatility refers to the degree of variation in the price of an asset over time. High volatility implies larger price swings, while low volatility implies smaller price swings.

Kalman filter: A Kalman filter is a mathematical algorithm used to estimate an unknown variable from a series of noisy measurements.
In the context of the indicator, the Kalman filter is used to generate an overall estimate of the market by combining the local models.

T3 Six Pole Kalman Filter: The T3 Six Pole Kalman Filter is a specific type of Kalman filter that is used to smooth and filter time-series data, such as the price data of a financial instrument.

Fisher Transform: The Fisher Transform is a mathematical formula used to transform any probability distribution into a Gaussian normal distribution. It is commonly used in technical analysis to transform non-Gaussian indicators into ones that are more suitable for statistical analysis.

By understanding these fundamental concepts, you should have a basic understanding of how the indicator works and how it generates an overall estimate of the market.

Usage
You can use this indicator on every timeframe.
Users can customize the parameters of the T3 Six Pole Kalman Filter (T3 length, alpha, beta, gamma, and delta) using input functions.
Try out different parameter combinations and use the one you like most.

Thank you for checking this out. Leave me a comment or boost the script, when you wanna support me! 👌

--

Credits to:
▪@HPotter - Fisher Transform
▪@loxx - T3
▪ChatGPT - Helped me to make the research for this indicator and helped to build the core algorithm.
릴리즈 노트:
Updated screenshot
릴리즈 노트:
Updated screenshot
Changed " to '
릴리즈 노트:
Updated inputs
Added background colors to visualize the market phases
릴리즈 노트:
Removed wrong max_bars_back
릴리즈 노트:
Reworked T3 inputs
릴리즈 노트:
FIxed bug where label was not shown

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?