federalTacos5392b

Multi Timeframe Trend Strength

This code is an advancement of my previous percentile-based trend strength. It follows the same concept, except this code display the trend and trend strength in multiple timeframe (1 min, 5 min, 15 min, 1hr and 4hr).

This gives an indication of the trend is evolving and allows to see how short-term trend matches with the long-term trend.

How it works:
The script assesses trend strength through percentile values derived from high and low prices across various time periods. It categorizes the current trend as either Bullish, Bearish, or N/A (No Trend) with the following steps:

Percentile Calculations: The code calculates the 75th percentile of high prices (e.g., percentile_13H) and the 25th percentile of low prices (e.g., percentile_13L) for specified Fibonacci-based periods (13, 21, 34, 55, 89, and 144). These percentiles serve as thresholds for identifying strong trends.

Calculate Highest High and Lowest Low: It computes the highest high (75th percentile high price of the longest period) and lowest low (25th percentile low price of the longest period), referred to as highest_high and lowest_low. These values establish critical price levels.

Trend Strength Conditions: For each percentile and period, the code checks if the percentile exceeds the highest high (trendBull) or falls below the lowest low (trendBear). These conditions gauge the strength of bullish and bearish trends.

Count Bull and Count Bear: Variables countBull and countBear tally the number of bullish and bearish conditions met, helping assess trend strength.

Weak Bull and Weak Bear Count: The code calculates weak bullish and bearish conditions, occurring when percentiles fall within the range defined by highest_high and lowest_low but don't meet strong trend criteria.

Bull Strength and Bear Strength: bullStrength and bearStrength are calculated based on counts of bullish, bearish, weak bullish, and weak bearish conditions, representing overall trend strength.

Strong Bull and Bear Conditions: These conditions arise when the 75th percentile of high prices (bull conditions) or the 25th percentile of low prices (bear conditions) surpass or dip below the highest high or lowest low, respectively, for the specified period. Strong conditions indicate robust trends with significant price movements.

Weak Bull and Bear Conditions: Weak conditions occur when percentiles fall within the range between highest_high and lowest_low, suggesting some bullish or bearish tendencies without reaching extreme levels. These imply less decisive trends.

Current Trend Identification: The current trend is determined by comparing bullStrength and bearStrength. A greater bullStrength indicates a Bull trend, greater bearStrength implies a Bear trend, and equal values denote No Trend (N/A).
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?