"""
r12_setup.py -- [2026-10-25] The user's setup R12 "THE TURN AT VWAP / THE OPEN" (pattern group G10 + G8 #3 CXM: the user's marks on
reports/practice/groups/G10_practice.pdf, G10_marks.json -- FCEL, AIFC 8/22, RDW, APPS, SBET, NEXT, LWLG 4/13, LCID, SLDE, SERV, CAST B).
Same as R11 (r11_setup.py: fresh low, holds, the buyer turn, blocks breakdown / waterfall / staircase / selling climax / thin) but
the low is AT a level instead of >= 1% under VWAP: within near_vwap (1.5%) of the session VWAP, or within near_level (0.5%) of the
open or the previous close. Covers the opening dips that hold the open / VWAP (often trend days) and the bases at VWAP.
Pure function, no orders.
"""
import r11_setup

DEFAULTS = {**r11_setup.DEFAULTS, "mode": "near", "near_vwap": 1.5, "near_level": 0.5, "near_open_early": 2.5,
            "lookback": 30, "fresh_max": 25, "prev_low_undercut": 1.0}
# [10/25 marks check] lookback 30 / low up to 25 bars old (SBET, NEXT, LWLG bases), a low in the first 10 minutes within 2.5% of the
# open counts as "at the open" (RDW, APPS -- VWAP not settled), a reclaimed undercut of the previous day's low <= 1% (LCID)


def check(done, flow, ref, m, c=None):
    return r11_setup.check(done, flow, ref, m, {**DEFAULTS, **(c or {})})
