This version triggers every batch within each candle. The previous version only triggered one batch per candle. This will not trigger batches in perfect order, but I left the "sequential" option because it still triggers the batches in order more often than not.
When using moving averages there is usually a trade-off between lag and smoothness. Multiple formulas have been devised to reduce lag while maintaining smoothness, and each one has its trade-offs. This script, tweaked from Chris Moody's extremely popular "Ultimate Moving Average-Multi-TimeFrame-7 MA types" is another attempt. Added least-squares moving...