High> Ref(c,-1) versus Cross(high,Ref(c,-1))

Hy everybody,
I would appreciate your help with the following matter.

I would think that always that the High of a candle is bigger than Ref(c,-1) then the Cross (High,Ref(c,-1) )would be True, but it is not like that.

I can understand that when the full body and wicks (Open, Close and High and low ) of the candle are above the Ref(c,-1) it did not give a true for the cross function. As in the Case 1 in the image.

But other than that, I do not understand what criteria Amibroker Cross function uses. For instance, following there are some examples where the explorer says that there are no crossings.

As you can see in the images the candle with the vertical line comply with High>Ref(c,-1) however the explorer and the the indicator both say that there is no crossing. However in the case 5 the cross function is true but i do not understand why.

Does anybody know the logic behind the cross function in this particular case. I provide also a bigger picture of the chart in which it is possible to see two panes below the chart. In the first pane the black bars in the histogram means that such cadle high is above Ref(c,-1). In the second Pane the red bar in the histogram means that the Function Cross(high,Ref(c,-1)) is true.

Why Am I asking this??

Apart from understanding the cross function the main reason, is that to implement long stop orders I have noticed that is not the same to use the code in option 1 than the option 2 in the code below.


Buy=Ref(buysetup,-1) AND  Cross( High, BuyStop );
BuyPrice = max( BuyStop,Open ); 


Buy=Ref(buysetup,-1) AND High>Buystop; 

BuyPrice = max( BuyStop,Open ); 

AS a matter of fact , the code in the option 2 provides me the correct entries that simulate a long stop order while the code in option 1 not.

Thanks a lot