For correctly printing float values you must do this:

printf("nrecent_max_H:%f", (var) recent_max_H);

If you set LookBack = 3 and you have BarPeriod = 60, then you are storing in Highs the last three hours of data, so if you try to call test with Period_Bar = 50 you may have problems.

Correct the printf, put LookBack = 50 and try again.