Trend Counter [BigBeluga]The Trend Counter indicator is designed to help traders identify trend conditions and potential reversals by counting the number of bars within a specified period that are above or below an average price level. By smoothing and averaging these counts, the indicator provides a clear visual representation of market trends and highlights key trend changes.
Key Features:
⦾ Trend Counting:
Counts bars above and below average price levels over a specified period.
Smooths and rounds the count for better visualization.
// Count bars over length period above highest and lowest avg with offset loop
float mid = math.avg(ta.highest(length), ta.lowest(length))
for offset = 0 to length -1
switch
hl2 > mid => counter += 1.0
=> counter := 0.0
// Smooth Count and Round
counter := math.round(ta.ema(counter > 400 ? 400 : counter, smooth))
// Count Avg
count.push(counter)
avg = math.round(count.avg())
⦿ Color Indication:
Uses gradient colors to indicate the strength of the trend.
Colors the background based on trend strength for easier interpretation.
⦿ Trend Signals:
Provides visual cues for trend changes based on the counter crossing predefined levels.
⦿ Potential Tops:
Identifies potential market tops using a specified length and highlights these levels.
⦿ Additional Features:
Displays Trend Counter value with arrows to indicate the direction of the trend movement.
Displays average trend count and level for reference.
⦿ User Inputs Description
Length: Defines the period over which the trend counting is performed.
Trend Counter Smooth: Specifies the smoothing period for the trend counter.
Level: Sets the threshold level for trend signals.
Main Color: Determines the primary color for trend indication.
The Trend Counter indicator is a powerful tool for traders seeking to identify and visualize market trends.
By counting and smoothing price bars above and below average levels, it provides clear and intuitive signals for trend strength and potential reversals.
With customizable parameters and visual cues, the Trend Counter enhances trend analysis and decision-making for traders of all levels.
Topsignal
Price Outpaces Moving AverageWith inputs for the moving average, Bullish overshoot percentage, and bearish overshoot percentage, this indicator is attempting to show market tops based on the difference between the current price of an asset and how far away it is from its moving average.
If you have the bullish overshoot percentage set to 1.5:
let's say price is currently at 20,000 and the moving average is around 6500.
The script calculates 20,000/6500 = 3.07
Then, there is a boolean comparison asking if 3.07 > 1.5.
Since it is, the script will create a "SHORT" flag above that candlestick.
A similar process happens for the "LONG" flags.