I have an mt4 indicator that I would like to convert to trading view pine script to work on the same manner (i.e. in MT4 it shows an oscillator with values) . Some additional requirements
* calculations should be done on current bar interval so it does not repaint
* send alerts when values are above or below 6 and -6 and also -10 or 10.
Please find attached source code of mt4 indicator and let me know if more info is needed.