// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF probe 05 — HMA fast/slow crossover
// Purpose: parity test for ta.hma() (nested WMA composition) at fast/slow lengths.
//
//@version=6
strategy("HMA Crossover", 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 ===
fastLen = input.int(9, "Fast HMA", minval=2)
slowLen = input.int(21, "Slow HMA", minval=2)
// === HMA Calculations ===
hmaFast = ta.hma(close, fastLen)
hmaSlow = ta.hma(close, slowLen)
// === Crossover signals ===
longCond = ta.crossover(hmaFast, hmaSlow)
shortCond = ta.crossunder(hmaFast, hmaSlow)
// === Strategy ===
if longCond
strategy.entry("Long", strategy.long)
if shortCond
strategy.entry("Short", strategy.short)
plot(hmaFast, "Fast HMA", color=color.blue, linewidth=2)
plot(hmaSlow, "Slow HMA", color=color.red, linewidth=2)