Frog (range volatility)
Frog is the population standard deviation of the daily High−Low range over the prior ~30 trading days, a measure of how erratic a symbol's daily bar size has been.
Frog measures the population volatility (standard deviation) of the daily High−Low range over roughly the last 30 trading days, excluding the current day. A large Frog means the bar size itself has been swinging widely; a small Frog means consistent daily ranges. Frog underpins position sizing on the Edge platform — it quantifies how much a single day's range can vary, which feeds risk-per-trade and stop placement decisions.
2.22e-16 on a 60-bar reference high/low series (canonical Python (edge-scan compute_frog_for_date) vs JavaScript (calcFrog30d), comparable positions).Pythonpermalink →
import numpy as np
def frog(high, low, n=30):
"""Frog — population standard deviation of the daily (High - Low) range
over the n trading days STRICTLY BEFORE the last bar.
Canonical math from edge-scan eod_indicators._frog_from_window /
compute_frog_for_date. The window is the n ranges preceding the final
bar (the current/target day is excluded — no look-ahead), and the
standard deviation is population (ddof=0).
Args:
high: sequence of daily highs, ascending by date.
low: sequence of daily lows, ascending by date (same length).
n: lookback window in trading days (default 30).
Returns:
float Frog value, or None if fewer than 2 observations in the window.
"""
high = np.asarray(high, dtype=float)
low = np.asarray(low, dtype=float)
ranges = high - low
# Window: up to n bars ending one position before the last bar.
# Excluding the final bar matches the chart-display / for_date convention.
idx = len(ranges) - 1
window = ranges[max(0, idx - n):idx]
if len(window) < 2:
return None
# Population standard deviation (ddof=0).
return float(np.std(window, ddof=0))
JavaScriptpermalink →
/**
* Frog — population standard deviation of the daily (High - Low) range over
* the last n trading days preceding the current day (the final bar excluded).
*
* Verbatim math from edge-canvas calcFrog30d. Bit-parity with the canonical
* Python (edge-scan compute_frog_for_date): population stddev (divide by N),
* window = the n bars strictly before the last/current bar.
*
* @param {Array<{high:number, low:number}>} eodCandles - Daily OHLC bars, ascending by date.
* @param {number} n - Lookback window in trading days (default 30).
* @returns {number|null} Frog value, or null if fewer than 2 observations.
*/
export function frog(eodCandles, n = 30) {
// Use up to n days PRECEDING the last bar (exclude the current day).
const win = Math.min(eodCandles.length - 1, n);
if (win < 2) return null;
// Window: the win bars ending one position before the final bar.
const window = eodCandles.slice(-(win + 1), -1);
const ranges = window.map((c) => c.high - c.low);
// Population variance (divide by N), then standard deviation.
const mean = ranges.reduce((s, v) => s + v, 0) / ranges.length;
const variance = ranges.reduce((s, v) => s + (v - mean) ** 2, 0) / ranges.length;
return Math.sqrt(variance);
}
Improve Your Craft Every Morning
A short note from Dr. Ken Long on the craft of trading. One idea to think about and work on that day, drawn from decades of teaching and live trading. Free.
Your email:
Tue–Fri mornings. Unsubscribe anytime. No spam, no hype.