OPEN-SOURCE SCRIPT

Frahm Factor

95
Intended Usage of the Frahm Factor Indicator

The Frahm Factor is designed to give you a rapid, at-a-glance assessment of how volatile the market is right now—and how large the average candle has been—over the most recent 24-hour window. Here’s how to put it to work:

Gauge Volatility Regimes

Volatility Score (1–10)

A low score (1–3, green) signals calm seas—tight ranges, low risk of big moves.

A mid score (4–6, yellow) warns you that volatility is picking up.

A high score (7–10, red) tells you to prepare for disorderly swings or breakout opportunities.

How to trade off it

In low-volatility periods, you might favor mean-reversion or range-bound strategies.

As the score climbs into the red zone, consider widening stops, scaling back position size, or switching to breakout momentum plays.

Monitor Average Candle Size

Avg Candle (ticks) cell shows you the mean true-range of each bar over that 24h window in ticks.

When candles are small, you know the market is consolidating and liquidity may be thin.

When candles are large, momentum and volume are driving strong directional bias.

The optional dynamic color ramp (green→yellow→red) immediately flags when average bar size is unusually small or large versus its own 24h history.

Customize & Stay Flexible

Timeframes: Works on any intraday chart—from 1-minute scalping to 4-hour swing setups—because it always looks back exactly 24 hours.

Toggles:

Show or hide the Volatility and Avg-Candle cells to keep your screen uncluttered.

Turn on the dynamic color ramp only when you want that extra visual cue.

Alerts: Built-in alerts fire automatically at meaningful thresholds (Volatility ≥ 8 or ≤ 3), so you’ll never miss regime shifts, even if you step away.

Real-World Applications

Risk Management: Automatically adjust your stop-loss distances or position sizing based on the current volatility band.

Strategy Selection: Flip between range-trading and momentum strategies as the volatility regime changes.

Session Analysis: Pinpoint when during the day volatility typically ramps—perfect for doorway sessions like London opening or the US midday news spikes.

Bottom line: the Frahm Factor gives you one compact dashboard to see the pulse of the market—so you can make choices with conviction, dial your risk in real time, and never be caught off guard by sudden volatility shifts.

Logic Behind the Frahm Factor Indicator

24-Hour Rolling Window

On every intraday bar, we append that bar’s True Range (TR) and timestamp to two arrays.

We then prune any entries older than 24 hours, so the arrays always reflect exactly the last day of data.

Volatility Score (1–10)

We count how many of those 24 h TR values are less than or equal to the current bar’s TR.

Dividing by the total array size gives a percentile (0–1), which we scale and round into a 1–10 score.

Average Candle Size (ticks)

We sum all TR values in the same 24 h window, divide by array length to get the mean TR, then convert that price range into ticks.

Optionally, a green→yellow→red ramp highlights when average bar size is unusually small, medium or large versus its own 24 h history.

Color & Alerts

The Volatility cell flips green (1–3), yellow (4–6) or red (7–10) so you see regime shifts at a glance.

Built-in alertcondition calls fire when the score crosses your high (≥ 8) or low (≤ 3) thresholds.

Modularity

Everything—table location, which cells to show, dynamic coloring—is controlled by simple toggles, so you can strip it back or layer on extra visual cues as needed.

That’s the full recipe: a true 24 h look-back, a percentile-ranked volatility gauge, and a mean-bar-size meter, all wrapped into one compact dashboard.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.