Depending on whether you want to go the short cut, algorithmic signals based on heuristics approach using a parametric model or use a machine learning model, I'll either build your signal process using Kalman Filters for time-weighted signals or a Classification model trained on data that have been tagged with 'buy', 'sell' based on whatever rules you have already considered.
Kalman Filter wise this should be easy to implement, if you want to go the ML route I'll admit despite my skills I only have good access to computer power through my employer so training takes a bit longer on my personal desktop.
I can write the model up in C if you really really really want but you're going to end up having to pay more to extend the model into a messaging application, python would be much easier to integrate with an API for an application service so it would bring my dev time down a lot.