How to find "High value of the twenty day low candle"

I am trying create an AFL in which we will go Long when current day close is greater than last 20days low candles's high value.
The stop loss going to be 20day low candles low.
I am able to find last 20 day low candles low using the following

twentyDayLowPrice = Ref(LLV(Low,period), -1) ;

Can somebody help me to find High value of the twenty day low candle.

This is the logic what i am trying to put

Buy = Cross(Close,20DayCandlesHighValue)
BuyStopLoss = twentyDayLowPrice

Check out HHV
https://www.amibroker.com/guide/afl/hhv.html

highestLow = HHV(L, period);

@rajuptb, you are probably looking for the "valuewhen" function.

something like valuewhen(llv( 20,c), H, 1);

I think this topic can be helpful to you.

While studying, i bookmark this one to use and is similar to your case for coding the stop loss.

another one also i can search

@snoopy.pa30

HighOfLowest = Ref(H, -LLVBars(L, period));
2 Likes

Thank you. This one worked