i will code you AFL script which will generate appropiate signals based on provided criteria.
I have expertise in strategy development and research with amibroker formula language which includes AFL codes for Visualization( customized amibroker charts ) , Scanner and explorer, Back test and optimization along with walk forward test and monte carlo simulations.
Regards.