You just need to use the function that I wrote previously and check at which bar the NthLow was hit. Below is the formula:

```
// NthLowest(Bars) AFL code copyright (C)2020 Tomasz Janeczko
// The formula can be used only if copyright notice is retained
// Nth starts from 1, so second lowest is 2
function NthLowest( array, Nth, period )
{
return Percentile( array, period, 100 * ( Nth - 1 ) / ( period - 1 ) );
}
function NthLowestBars( array, Nth, period )
{
nlv = Percentile( array, period, 100 * ( Nth - 1 )/ ( period - 1 ) );
bars = Null;
for( i = 0; i < period; i++ )
{
bars = IIf( Ref( array, -i ) == nlv, i, bars );
}
return bars;
}
Filter = 1;
AddColumn( Close, "Close");
AddColumn( LLV( Close, 10 ), "1st Lowest");
AddColumn( LLVBars( Close, 10 ), "1st Lowest bars");
AddColumn( NthLowest( Close, 2, 10 ), "2nd Lowest" );
AddColumn( NthLowestBars( Close, 2, 10 ), "2nd Lowest bars" );
```