Skip to content

[Indicator] Trend Flow Profile #17

@MDUYN

Description

@MDUYN

Indicator Name

Trend Flow Profile

Category

Trend

Description

Description:
The "Trend Flow Profile" indicator is a powerful tool designed to analyze and interpret the underlying trends and reversals in a financial market. It combines the concepts of Order Flow and Rate of Change (ROC) to provide valuable insights into market dynamics, momentum, and potential trade opportunities. By integrating these two components, the indicator offers a comprehensive view of market sentiment and price movements, facilitating informed trading decisions.

Rationale:
The combination of Order Flow and ROC in the "Trend Flow Profile" indicator stems from the recognition that both factors play critical roles in understanding market behavior. Order Flow represents the net buying or selling pressure in the market, while ROC measures the rate at which prices change. By merging these elements, the indicator captures the interplay between market participants' actions and the momentum of price movements, enabling traders to identify trends, spot reversals, and gauge the strength of price acceleration or deceleration.

Calculation:
The Order Flow component is computed by summing the volume when prices move up and subtracting the volume when prices move down. This cumulative measure reflects the overall order imbalance in the market, providing insights into the dominant buying or selling pressure.

The ROC component calculates the percentage change in price over a given period. It compares the current price to a previous price and expresses the change as a percentage. This measurement indicates the velocity and direction of price movement, allowing traders to assess the market's momentum.

How to Use It?
The "Trend Flow Profile" indicator offers valuable information to traders for making informed trading decisions. It enables the identification of underlying trends and potential reversals, providing a comprehensive view of market sentiment and momentum. Here are some key ways to utilize the indicator:

Spotting Trends: The indicator helps identify the prevailing market trend, whether bullish or bearish. A consistent positive (green) histogram indicates a strong uptrend, while a consistent negative (red) histogram suggests a robust downtrend.

Reversal Signals: Reversal patterns can be identified when the histogram changes color, transitioning from positive to negative (or vice versa). These reversals can signify potential turning points in the market, highlighting opportunities for counter-trend trades.

Momentum Assessment: By observing the width and intensity of the histogram, traders can assess the acceleration or deceleration of price momentum. A wider histogram suggests strong momentum, while a narrower histogram indicates a potential slowdown.

Utility:
The "Trend Flow Profile" indicator serves as a valuable tool for traders, providing several benefits. Traders can easily identify the prevailing market trend, enabling them to align their trading strategies with the dominant direction of the market. The indicator also helps spot potential reversals, allowing traders to anticipate market turning points and capture counter-trend opportunities. Additionally, the green and red histogram colors provide visual cues to determine the optimal duration of a long or short position. Following the green histogram signals when in a long position and the red histogram signals when in a short position can assist traders in managing their trades effectively. Moreover, the width and intensity of the histogram offer insights into the acceleration or deceleration of momentum. Traders can gauge the strength of price movements and adjust their trading strategies accordingly. By leveraging the "Trend Flow Profile" indicator, traders gain a comprehensive understanding of market dynamics, which enhances their decision-making and improves their overall trading outcomes.

Reference Chart(s)

Image

Chart Description

See image

Parameters

  • period (int, default=14):
  • source_column (str, default='Close'):

Source / Reference

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AlgoAlpha X © Sushiboi77

//@Version=5
indicator('Trend Flow Profile [AlgoAlpha]', 'AlgoAlpha - 📈 Trend Flow Profile ', false, timeframe = "", timeframe_gaps = false)

// Inputs
flowPeriod = input.int(12, 'Trend Flow Period', minval=1)
showEMA = input.bool(true, "Show EMA band?")
emaLength = input(8, "EMA Length")
upColor = input.color(#00ffbb, "Up Color")
downColor = input.color(#ff1100, "Down Color")
rocLength = input(14, "ROC Length")

// Calculations
volFlow = math.sum(close > close[1] ? volume : close < close[1] ? -volume : 0, flowPeriod) / 1000
priceROC = ta.roc(close, rocLength)
tfIndicator = (priceROC + volFlow) / 2
emaTrend = ta.ema(tfIndicator, emaLength)

// Color Logic
indicatorColor = tfIndicator > 0 ? tfIndicator > tfIndicator[1] ? color.new(upColor, 20) : color.new(upColor, 50) : tfIndicator < tfIndicator[1] ? color.new(downColor, 20) : color.new(downColor, 50)

// Plots
plot(tfIndicator, 'Trend Flow', indicatorColor, 2, plot.style_columns)
plot(volFlow, 'Volume Flow', volFlow > 0 ? color.new(upColor, 80) : color.new(downColor, 80), 1, plot.style_columns)
plot(showEMA ? emaTrend : na, 'EMA Trend Line', color.rgb(126, 126, 126))

Expected Output Columns

No response

Deliverables Checklist

  • Implementation in pyindicators/indicators/ (pandas + polars support)
  • Exports in __init__.py and __all__
  • Unit tests in tests/indicators/ (pandas, polars, edge cases)
  • Documentation page in docs/content/indicators/ with chart image
  • Sidebar registration in docs/sidebars.js
  • Entry in README.md features list
  • Analysis notebook in analysis/indicators/ with plotly chart

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    squadSquad triage inbox — Lead will assign to a member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions