PAC - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources - MetaTrader 5 Resources


PAC (Period After Crossing MA) is an oscillator that shows the number of bars since the last time price crossed a moving average.
If the moving average crosses price upward, then positive histogram bars are drawn in green ; if the last crossover was downward, negative columns are drawn in red .
The indicator has three configurable parameters:
If Price > MA and PrevPrice > PrevMA:
PAC = previous PAC + 1
If price < MA and PrevPrice < PrevMA:
PAC = Previous PAC - 1
If price > MA:
PAC=1
If price < MA:
PAC = -1
Where:
Price - SMA (Apply Price, 1) MA - MA (applicable price, period, method)

Figure 1. By default, SMA (Close Price, 14)

Figure 1. On the price chart, SMA (Close Price, 14)
Attachment download
📎pac.mq5 (9.78 KB)
Source: MQL5 #21264
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •