Assistance with HighestSinceBars function

I have an application in which I am interested in the period since an event occurred on the Nth most recent occasions. I would appreciate advice to make the following more efficient.
Thanks.

SetBarsRequired(sbrall, sbrAll);
//I have an application in which I am interested in the period since an event occurred on the Nth most recent occassions.
Plot(Cross(C, EMA(C,34)), "", colorBlue, styleLine);

//As expected either of the following lines return the correct result for the most recent peak.
Plot(HighestSinceBars(AlmostEqual(Cross(C, EMA(C, 34)), 1), Cross(C, EMA(C,34)), 1), "", coloraqua, styleline);
Plot(HighestSinceBars(Cross(C, EMA(C, 34))>0.5, Cross(C, EMA(C,34)), 1), "", colorGreen, styleline);

//I would appreciate feedback as to why the following lines do not return the number of bars since the second and third peak.
Plot(HighestSinceBars(Cross(C, EMA(C, 34))>0.5, Cross(C, EMA(C,34)), 3), "", colorGreen, styleline);
Plot(HighestSinceBars(Cross(C, EMA(C, 34))>0.5, Cross(C, EMA(C,34)), 2), "", colorwhite, styleline);
Plot(HighestSinceBars(AlmostEqual(Cross(C, EMA(C, 34)), 1), Cross(C, EMA(C,34)), 3), "", colorred, styleline);
Plot(HighestSinceBars(AlmostEqual(Cross(C, EMA(C, 34)), 1), Cross(C, EMA(C,34)), 2), "", coloryellow, styleline);

//I am currently using the following as a work around to produce the result that I had intended.
Plot(HighestSinceBars(Cross(1.5,Ref(Reverse(Cum(Reverse(Cross(C,EMA(C,34))))),1)),Cross(1.5,Ref(Reverse(Cum(Reverse(Cross(C,EMA(C,34))))),1)) ,1), "", colorWhite, styleLine);
Plot(HighestSinceBars(Cross(2.5,Ref(Reverse(Cum(Reverse(Cross(C,EMA(C,34))))),1)),Cross(2.5,Ref(Reverse(Cum(Reverse(Cross(C,EMA(C,34))))),1)) ,1), "", colorWhite, styleLine);


Looks like you do not know what Cross function returns.