How to know if stock is in uptrend or downtrend in C#? I have closing value of stock, I want to know if it is going in up direction or down direction?