sorry, cant help for coding — im not a coder, but i do really like your idea! i think it could be a great indicator for scalper