There is not much change. Be sure that you understand the code and then it should get you going. Then you can modify it as needed to suit your needs.
ph = Ref(H,-5) < Ref(H,-3) AND Ref(H,-4) < Ref(H,-3) AND Ref(H,-2) < Ref(H,-3) AND Ref(H,-1) < Ref(H,-3);
bar = SelectedValue( BarIndex() ) - 1;
ext = Param( "Extend", 10, 3, 50, 1 );
Plot( C, "", IIf( ph, colorWhite, colorPaleGreen ), styleBar );
Plot( IIf( BarIndex() > bar - 3 AND BarIndex() < bar + ext, SelectedValue( Ref( H, -3 ) ), Null ), "", colorRed );