// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF TA-isolate probe 06 — RSI(14) > 50 continuous-state pattern
//
// Purpose: contrast vs probe 01 (which uses ta.crossover, an EVENT trigger).
// This probe uses VALUE-comparison (`rsi > 50`) every bar combined with the
// `if cond entry else close` continuous-state pattern from validation/37-regex.
// If probe 01 is excellent but this drifts, the engine bug is in the
// continuous-state strategy.entry/strategy.close call sequence, NOT in RSI math.
//
// Targets diagnosing gap probe `validation/37-regex-string-filter`.
//@version=6
strategy("PF TA isolate 06 - RSI(14) > 50 continuous", shorttitle="TAI_06_RSIGT50",
overlay=false, 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)
rsi = ta.rsi(close, 14)
bool cond = rsi > 50.0
if cond
strategy.entry("L", strategy.long, comment="rsi > 50")
else
strategy.close("L", comment="rsi <= 50")