It is my first own script based on my own thoughts.
This works without repainting because it uses only price action: open & close.
Play with offset/offset_to close to find out better weights for your playing style.
Try GER30 in 5min with 6.36/2.54 or 1 Min 3.46/0.14.
Works very well with JPN225, US30, S&P. For USOIL-> 0.0201/0.001 try:)
Enjoy the script!