TQTradingQuery

Session behavior · MYM

How often does MYM revert to VWAP after moving 1 standard deviation away from it

529

reversion count

n=6272026-03-05 to 2026-09-07

reversion count

529

reversion rate

82.6%

num trading days

130

Methodology

Computed by independently generating and running analysis code against real MYM 1-minute bars from 2026-03-05 to 2026-09-07, 25 separate times in parallel, then taking the answer the largest group of independent attempts agreed on. The exact code is shown below.

Show the code

bars_et = to_et(bars)
rth = rth_session(bars_et)
rth = rth.copy()
rth['date'] = trading_date(rth)

events = 0
reverts = 0

for date, day in rth.groupby('date'):
    if len(day) < 10:
        continue
    typical = (day['high'] + day['low'] + day['close']) / 3
    vol = day['volume'].values
    cum_vol = vol.cumsum()
    if cum_vol[-1] == 0:
        continue
    cum_pv = (typical.values * vol).cumsum()
    vwap = cum_pv / np.where(cum_vol == 0, np.nan, cum_vol)
    diff = day['close'].values - vwap
    # rolling std of diff up to that point, use expanding std as "sigma" of deviation
    diff_series = pd.Series(diff)
    exp_std = diff_series.expanding(min_periods=10).std().values

    in_event = False
    direction = 0
    for i in range(len(day)):
        if np.isnan(vwap[i]) or np.isnan(exp_std[i]) or exp_std[i] == 0:
            continue
        dev = diff[i]
        sigma = exp_std[i]
        if not in_event:
            if abs(dev) >= sigma:
                in_event = True
                direction = np.sign(dev)
                events += 1
        else:
            # check for reversion: price crosses back to vwap (diff changes sign or hits zero)
            if np.sign(dev) != direction or dev == 0:
                reverts += 1
                in_event = False
            elif abs(dev) < sigma * 0.1:
                reverts += 1
                in_event = False

revert_rate = reverts / events if events > 0 else None

result = {
    "sample_size": int(events),
    "reversion_count": int(reverts),
    "reversion_rate": float(revert_rate) if revert_rate is not None else None,
    "num_trading_days": int(rth['date'].nunique())
}
  • Generated and independently re-derived 25 times, then checked for logical consistency, before being shown to you -- the figures above are the answer the largest number of those independent attempts agreed on. Still a generated, one-off calculation, treat it as a rough, one-off analysis rather than a permanent fixture.

This is historical statistical information only. It is not investment advice, and past performance does not indicate future results. Trading involves risk of loss.