The difference between two functions HHV and REF

what is the difference between following two functions, are both represents 10 bars high or 10 days high?

1 REF(HIGH,10) 

 2 HHV(10)

HHV will return the highest high value for the period you want. For example, for HHV(5), if the previous 5 candles high values are (8, 20, 9 , 15,19) then it will return 20.

REF(HIGH,5) will return the high of the 5th candle from current time. So in the above example the answer is 8.

Thanks, Which function should be used to get previous day OHLC values