// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF TA-isolate probe 05 — close crosses SMA(152)
//
// Purpose: isolate ta.sma(close, 152) at a long-window length (152 ≈ ~38h on
// 15m TF). Validates engine sliding-window sum precision: at length 152, naive
// running-sum drift is meaningful (~1.5e-13 per bar, accumulating over thousands
// of bars). Pine's TV runtime maintains a deque + recompute periodicity that
// engine must match to stay bit-exact.
//
// Targets gap probe in a community-style market-structure-shift strategy
// which uses SMA(close, 152).
//@version=6
strategy("PF TA isolate 05 - close x SMA(152)", shorttitle="TAI_05_SMA152",
overlay=true, initial_capital=1000000,
commission_type=strategy.commission.percent, commission_value=0, slippage=0,
default_qty_type=strategy.fixed, default_qty_value=1, pyramiding=1,
process_orders_on_close=false)
s = ta.sma(close, 152)
if ta.crossover(close, s)
strategy.entry("L", strategy.long, comment="close cross up SMA152")
if ta.crossunder(close, s)
strategy.entry("S", strategy.short, comment="close cross dn SMA152")