OnTick()problem

 

hello

i am coding on OnTick() function.

my main problem is i cant save a number e.g. after  100 ticks!!

e.g. i want to save value of one candle an i want to use it after 100 ticks  , but the value will reset after each tick and i cant use it .

 
mohammadsk313:

hello

i am coding on OnTick() function.

my main problem is i cant save a number e.g. after  100 ticks!!

e.g. i want to save value of one candle an i want to use it after 100 ticks  , but the value will reset after each tick and i cant use it .

Why don't you post the code you are trying to use. This way it is like mind reading
 
You can use a Global variable or a static one. Regards.
Documentation on MQL5: Language Basics / Variables / Global Variables
Documentation on MQL5: Language Basics / Variables / Global Variables
  • www.mql5.com
Language Basics / Variables / Global Variables - Reference on algorithmic/automated trading language for MetaTrader 5
 
Jose Francisco Casado Fernandez:
You can use a Global variable or a static one. Regards.
Basically that is one part of the solution, but it does not guarantee that he shall not have the same issue he has now. All depends on the way how it is coded
 
Mladen Rakic:
Basically that is one part of the solution, but it does not guarantee that he shall not have the same issue he has now. All depends on the way how it is coded
Sure, I give him a guide to start, but he did not put any code to fix. Therefore, I will not make the whole code for him. He has to read the documentation and try it by himself first. Regards.
Reason: