Please help on how should I write the AFL:
Criteria to buy
First day: Close Cross Moving Average 20days(MA20)
Second day: Open Above MA20
If second day fulfill, buy at OPEN
If second day not fulfill, do nothing
Code:
MA20=MA(C,20);
Buy = Cross(C,MA20);
SecondDay = Open > MA20
Sell = Cross(MA20,C);