Moving average strategy

I am trying to code Moving Average strategy without conventional crossover with 2 filters:
Filter 1 : prices to stay above 10 day MA for straight 2 days.
In an uptrend, prices must move up through the moving average and post 2 lows above the average.
In a downtrend, prices must move down through the moving average and post 2 highs below the average.

Filter 2 : break of the highest bar of the two bars that have moved through the moving average.

So, in an uptrend we need prices to move up through the moving average and then post two lows above the average (filter 1). We then need the highest high of those two days to be breached by 10 cents (filter 2) before entering the trade.

Here is the code snippet:

MA10 = MA(C, 10);
// Filter 
priceBeAboveMA10 = C > Ref(MA10,-2); // Price above 10 MA 
priceIsUp = (C > Ref(Highest(C),-2));

LongEntry = priceBeAboveMA10 AND priceIsUp

I am not sure if I am heading to the right direction

@subsoft, this is an example where using plot statements, or an exploration can help you debug your own code.

As you are doing logical tests, you might have to "add" or "shift" your data if you want to plot it.
An Exploration showing the columns of data might be an easier way to see what is happening.

I think you are headed in the right direction, just "show" the results and you should be able to tell.