This is a script to detect a pullback on a all standard types of moving averages You'll have the option to define two parameters a bit specific :
Pullback percentage : if you want the pullback to be defined in percentage. Example: I want to capture pullbacks 3% away from my EMA 20
Buffer : Secruty margin for the pullback. You might not want an exact physical touch on the pullback but to let for instance a few pips/USD margin between the price and moving average
If you'd like the pullback to be "price has to touch the moving average", please set the buffer parameter to 0