The 2 amibroker code blocks look similar to me.
Code 1;
long_code = ( ( Ref(test_bar, -1) AND High > Ref(High, -1) AND Ref(hi