// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF probe — input.source RUNTIME OVERRIDE (#23 / codegen #9)
// Purpose: parity test for changing the price series fed to an indicator at
// RUN TIME via the input panel (not the script default). The script defaults
// the source to `close`; the probe overrides the "Source" input to `high`.
// Pre-fix the engine routed input.source to get_input_double, where the
// override string ("high") failed std::stod and silently fell back to close —
// so the override was ignored. Post-fix get_input_source resolves "high" to
// the native high series, matching TV when the input is set to High.
//
//@version=6
strategy("input.source runtime override", overlay=true, initial_capital=1000000, process_orders_on_close=false, pyramiding=1, commission_type=strategy.commission.percent, commission_value=0, slippage=0, default_qty_type=strategy.fixed, default_qty_value=1)
// === Inputs ===
src = input.source(close, "Source")
fastLen = input.int(10, "Fast Length", minval=2)
slowLen = input.int(30, "Slow Length", minval=5)
// === MAs computed on the (overridable) source ===
fast = ta.sma(src, fastLen)
slow = ta.sma(src, slowLen)
// === Signals ===
if ta.crossover(fast, slow)
strategy.entry("Long", strategy.long)
if ta.crossunder(fast, slow)
strategy.entry("Short", strategy.short)