# Fix hhv as strong support

Dear Sirs,
Can you help me to write this formula. I want to fix support to use for the next evaluation.

high5days = ref(hhv(h,5),-1);
breakout = C > high5days;

I want to use high5days as strong support for the next days, how to write this formula, thanks alot.

The `Hold()` function might give you exactly what you want: https://www.amibroker.com/guide/afl/hold.html. However, you should also consider what happens when the price closes above the 5-day high multiple times within your N-day window.

sure, that is why I am not meet the formula yet.
with hold() function should not make a new HHV at the breakout day.
then how to release the hold() function, because after several days (let's say 5 days after breakout) should have a new HHV.

@gani, if you need more help then you need to show us your code and tell us what's not working correctly.

this is my code, the Resistances (R1,R2,R3) change in the next day.
I want to fix Resistances until new breakouts then offcourse new Resistances will be rise out.

FS=Param("Font Size",11,11,100,1);
GfxSelectFont("Tahoma", FS, 700, False );
GfxSetBkMode( colorWhite );
GfxSetTextColor( colorYellow );
Hor=Param("Horizontal Position",880,1,1200,1);
Ver=Param("Vertical Position",50,1,830,1);
high5days = ref(hhv(h,5),-1);
breakout = C > high5days;
boh = ValueWhen(bobst,H,1);
bol = ValueWhen(bobst,L,1);

for( i = 0; i < BarCount; i++ )
{
if (bobst[i])
{
R1[i] =bobsth[i]+((bobsth[i]-bobstl[i])*1);
R2[i] =bobsth[i]+((bobsth[i]-bobstl[i])*2);
R3[i] =bobsth[i]+((bobsth[i]-bobstl[i])*3);
}
}
GfxTextOut("R 3 = "+WriteVal(R3,format=5.0), Hor+200 , Ver );
GfxTextOut("R 2 = "+WriteVal(R2,format=5.0), Hor+200 , Ver+17 );
GfxTextOut("R 1 = "+WriteVal(R1,format=5.0), Hor+200 , Ver+34 );

sorry, small correction.

this is my code, the Resistances (R1,R2,R3) change in the next day.
I want to fix Resistances until new breakouts then offcourse new Resistances will be rise out.

FS=Param("Font Size",11,11,100,1);
GfxSelectFont("Tahoma", FS, 700, False );
GfxSetBkMode( colorWhite );
GfxSetTextColor( colorYellow );
Hor=Param("Horizontal Position",880,1,1200,1);
Ver=Param("Vertical Position",50,1,830,1);
high5days = ref(hhv(h,5),-1);
bobst = C > high5days;

bobsth = ValueWhen(bobst,H,1);
bobstl = ValueWhen(bobst,L,1);

for( i = 0; i < BarCount; i++ )
{
if (bobst[i])
{
R1[i] =bobsth[i]+((bobsth[i]-bobstl[i])*1);
R2[i] =bobsth[i]+((bobsth[i]-bobstl[i])*2);
R3[i] =bobsth[i]+((bobsth[i]-bobstl[i])*3);
}
}
GfxTextOut("R 3 = "+WriteVal(R3,format=5.0), Hor+200 , Ver );
GfxTextOut("R 2 = "+WriteVal(R2,format=5.0), Hor+200 , Ver+17 );
GfxTextOut("R 1 = "+WriteVal(R1,format=5.0), Hor+200 , Ver+34 );