Store/Read variable between OnTick function and a custom function

 

As dumb as the question is, I've spent nearly 3 hours looking for an answer.

My OnTick function reads and stores 2 consecutive tick values in 2 variable A and B, I then want to store B somewhere and then compare it with the new value of A and B when a new tick occurs, and again store B and so on...

Any help would be greatly appreciated.

 
Aymane Maizi: I then want to store B somewhere and then compare it with the new value of A and B when a new tick occurs,

Perhaps you should read the manual. Static Variables, Global Variables, Visibility Scope and Lifetime of Variables
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
         RTFM and STFW: How To Tell You've Seriously Screwed Up.