@fdfx Unfortunately I'm not of use to assist with this. I'm not savvy when it comes to actual coding also this is an indicator which can't be created using this platform. It does remind me of projects I've done and solved but they were EA's. I'm not sure why it works on live market but not in backtester. You may have to try duplicating a new terminal and try it on the fresh one. Sometimes the tester be weird on one but works on another. Normally when something works live but is funky on the testers, usually the code is good. I could be wrong but hopefully someone with more knowledge can help.