Buy = Cross( Close, EMA(Close, 10) ) AND C < Ref(C,4);
Sell = Cross( EMA(Close, 10), Close) AND C > Ref(C,4);
What's wrong with the code?
First you need to tell what results you want to achieve. We cant divine it for you.
@BARASARA While I agree with @travick and @GustavTrader suggestions, I would also suggest reading about the
Ref(ARRAY, period) function, https://www.amibroker.com/guide/afl/ref.html
Your current formula is looking into the future, is that what you intended?