It was a bizarre experience reading your comments about PipsMark. I was convinced that you were incorrect about the alert being for motion away from the MA. I confirmed that was true and looked at the code. Nevertheless, the whole time, it was just like I couldn't recall doing some of it and this was only one year ago. Rather than deja vu, it was jamais vu (which is a legitimate expression - look it up).
Anyway here is a new version with the functionality you desire. It had a new name to differentiate it from PipsMark, so I called it Pips2MA. Here's what the settings are.
AlertPips=10; // distance from near MA in pips.
AlertBarsSkip=3; // amount of pubs to skip before next awake.
MAperiods=10; // MAperiods - the amount of periods to be employed from the MA calculation.
MAmethod=E; // MAmethod - the technique to be employed from the MA calculation ('S','W','E','M').
MAapply=C// MAapply - the price type to be employed from the MA calculation ('M','T','O','C','H','L').
Mift=0; // Mift - the number of periods for the MA change calculation.
https://www.forexforum.co.za/attachm...8953060688.ex4