DIVERGENCE SCANNING SCRIPT

I would like to create a scanning script for Divergence using RSI 14 on AU stocks, Daily and Weekly charts, your assistance would be appreciated.
Thank you

Regards
Joe