What is valuewhen in Pine Script?
valuewhen
is a built-in Pine Script function that returns the value of a specified series at the time when a given condition was true, for the nth most recent occurrence. This means you can retrieve historical values tied to specific events or conditions, such as a crossover or a fractal high, which is essential for backtesting and signal analysis.