// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF TA-isolate probe — ta.pivot_point_levels("Traditional") R1/S1 break.
// Isolates the free-function pivot_point_levels intrinsic and its array return
// shape: index 0 = P, index 1 = R1, index 2 = S1 (Traditional method). With a
// per-bar anchor (anchor=true) every bar is its own period, so each bar's pivot
// set is computed from the PREVIOUS bar's HLC — exactly how the codegen lowers
// the call (_s_high[1]/_s_low[1]/_s_close[1]). Trigger is a pure price-vs-level
// crossover/crossunder, so any divergence isolates the pivot math + array
// indexing rather than entry/sizing logic.
//@version=6
strategy("PF TA isolate - pivot_point_levels R1/S1 break", shorttitle="TAI_PPL",
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)
pivots = ta.pivot_point_levels("Traditional", true)
P = array.get(pivots, 0)
R1 = array.get(pivots, 1)
S1 = array.get(pivots, 2)
if ta.crossover(close, R1)
strategy.entry("L", strategy.long, comment="close x> R1")
if ta.crossunder(close, S1)
strategy.entry("S", strategy.short, comment="close x< S1")