PulseHub
OPEN-SOURCE SCRIPT

[Kpt-Ahab] Rotation & Relative Flow Heatmap

242
Rotation & Relative Flow Heatmap

Rotation & Relative Flow Heatmap compares up to 11 user-selected symbols and displays their relative market behavior as a continuously colored heatmap.

The script can visualize:

* Price
* Volume
* Relative dollar volume
* Price return weighted by relative dollar volume
* Price return weighted by positive dollar-volume Z-score


The signed-flow modes combine short-term price direction with relative trading activity. Each symbol’s result is compared with the average of all valid symbols to estimate relative leadership and weakness within the selected group.

This is a relative market-activity model. It does not use true order-flow, bid/ask, or capital-flow data.

Row Sorting

In the signed-flow modes, the rows can be sorted from the strongest to the weakest relative flow.

When sorting is enabled, each heatmap row represents a dynamic rank position rather than one fixed symbol. The symbol occupying a row can therefore change on every bar.

The label on the right shows the symbol currently assigned to that rank. Historical colors within the same row may belong to different symbols that previously held that rank.

`Sort Smooth Length` controls how many bars are averaged for the ranking:

* Lower values react faster but produce more frequent row changes.
* Higher values create a more stable but slower ranking.


Colors

Negative, neutral, and positive values are represented by a configurable three-color gradient. Additional vertically interpolated rows create a smoother transition between the 11 underlying symbol rows without changing the calculations or number of symbols.

The available color schemes can be modified in the following source-code section:

```pine
// ---------------------------------------------------
// Color Scheme
// ---------------------------------------------------
```

The three primary colors are defined by:

```pine
color_negative
color_neutral
color_positive
```

Changing these values adjusts the negative, neutral, and positive ends of the heatmap gradient.

The color-scale inputs control how quickly the heatmap reaches stronger colors. Lower scale values generally produce more intense colors, while the Color Response Curve controls the visual emphasis of low and medium readings.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.