Oscillator PAIN (Price Action Indicator) displays the OHL3C candlestick price ratio over a specified period of time.
It has two parameters:
Calculation:
where:

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/21108