Scanning parameters on monthly chart on hourly basis:AFL help required

Hi forum members

I want to develop afl code which can do the following function of scanning

  1. On the monthly chart if there is 5 EMA and 20 EMA crossover, on the both sides( i.e. 5 ema crossing 20 ema from below and vice versa) and
  2. if it sustains till the end of that hourly candle , buy or sell signal should be generated
    3)I want to backtest this idea,so i need help with the afl code

Awaiting reply

WIth best regards

RMV
India