federalTacos5392b

Pattern Probability with EMA Filter

federalTacos5392b 업데이트됨   
The provided code is a custom indicator that identifies specific price patterns on a chart and uses a 14-period Exponential Moving Average (EMA) as a filter to display only certain patterns based on the EMA trend direction. These code identifies patterns display them as upward and downward arrows indicates potential price corrections and short term trend reversals in the direction of the arrow. Use with indicators such as RSI that inform overbought and oversold condition to add reliability and confluence.
Code Explanation:
The code first calculates three values 'a', 'b', and 'c' based on the difference between the current high, low, and close prices, respectively, and their respective previous moving average values.

Binary values are then assigned to 'a', 'b', and 'c', where each value is set to 1 if it's greater than 0, and 0 otherwise.

The 'pattern_type' is determined based on the binary values of 'a', 'b', and 'c', combining them into a single number (ranging from 0 to 7) to represent different price patterns.

The code calculates a 14-period Exponential Moving Average (EMA) of the closing price.

It determines the EMA trend direction by comparing the current EMA value with the previous EMA value, setting 'ema_going_up' to true if the EMA is going up and 'ema_going_down' to true if the EMA is going down.

The indicator then plots arrows on the chart for specific pattern_type values while considering the EMA trend direction as a filter. It displays different colored arrows for each pattern_type.

The 14-period EMA is also plotted on the chart, with the color changing to green when the EMA is going up and red when the EMA is going down.

Concept:
pattern_type = 0: H- L- C- (Downward trend continuation) - Indicates a continuation of the downward trend, suggesting further losses ahead.

pattern_type = 1: H- L- C+ (Likely trend change: Downwards to upwards) - Implies the upward trend or price movement change.

pattern_type = 2: H- L+ C- (Likely trend change: Upwards to downwards) - Suggests a potential reversal from an uptrend to a downtrend, but further confirmation is needed.

pattern_type = 3: H- L+ C+ (Trend uncertainty: Potential reversal) - Indicates uncertainty in the trend, potential for a reversal, but further price action confirmation is required.

pattern_type = 4: H+ L- C- (Downward trend continuation with lower volatility) - Suggests the downward trend may continue, but with reduced price swings or lower volatility.

pattern_type = 5: H+ L- C+ (Likely trend change: Downwards to upwards) - Implies a potential reversal from a downtrend to an uptrend, with buying interest increasing.

(pattern_type = 6: H+ L+ C- (Likely trend change: Upwards to downwards) - Suggests a potential reversal from an uptrend to a downtrend, with selling pressure increasing.

pattern_type = 7: H+ L+ C+ (Upward trend continuation) - Indicates a continuation of the upward trend, suggesting further gains ahead.

In the US market, when analyzing a 15-minute chart, we observe the following proportions of the different pattern_type occurrences: The code will plot the low frequency patterns (P1 - P6)
P0 (H- L- C-): 37.60%
P1 (H- L- C+): 3.60%
P2 (H- L+ C-): 3.10%
P3 (H- L+ C+): 3.40%
P4 (H+ L- C-): 2.90%
P5 (H+ L- C+): 2.70%
P6 (H+ L+ C-): 3.50%
P7 (H+ L+ C+): 43.50%
When analyzing higher time frames, such as daily or weekly charts, the occurrence of these patterns is expected to be even lower, but they may carry more significant implications due to their rarity and potential impact on longer-term trends.
릴리즈 노트:
The revision adds options to choose between VWMA, EMA, SMA, and HMA moving averages and select the price (close or HLC3) for the trend line. The code calculates the selected moving average and its trend direction. The rest of the code remains the same. When input length of and MA lengths are increased it provided less false signals.
릴리즈 노트:
The revision introduces a dynamic threshold filter, based on the HLC3 200 SMA multiplied by 0.001, for pattern identification. one can choose between dynamic thresholds, adapting to market conditions, or a default zero value, ensuring stability. The threshold serves as a filter, determining if price movements are significant for classifying patterns. When the difference between current and previous prices (high, low, or close) exceeds the threshold, the pattern is marked with a value of 1; otherwise, it's assigned 0. This customizable feature empowers traders to fine-tune the indicator's responsiveness, improving pattern identification accuracy and providing insights into potential market trends.
릴리즈 노트:
The code revision incorporates a volume filter (VF) into an existing indicator. VF compares the current candle's volume to a defined average volume, filtering out patterns if VF is below a set threshold. This enhances pattern confirmation by considering market participation. Patterns meeting VF criteria are assigned binary values based on price movements. The indicator plots colored arrows on the chart for filtered pattern types, aiding traders in identifying potential trend changes. VF integration offers a dynamic way to validate patterns, contributing to more informed trading decisions.
릴리즈 노트:
corrected VF syntax to apply correctly and display.
릴리즈 노트:
Updated to have the option to apply or not apply volume filter.
오픈 소스 스크립트

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

면책사항

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

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