Price=Ask

 
Hello everyone, I have a small question, probably silly but I don't think I have understood this concept: if I do price=Ask, is my "Price" variable a variable that will vary as soon as the Ask varies? Or is it a variable that will take the current Ask price and store it without varying (at time t)? Otherwise how to store the value of the current Ask and not make it vary?

Thanks in advance for your help!

Translated with www.DeepL.com/Translator (free version)
 
  1. Ask is a predefined variable. It will not change unless you call RefreshRates or you return and get a new tick.
  2. Your price variable value will be lost when you return unless it is global or static. It doesn't change unless you assign to it.
  3. Doubles are rarely equal. Understand the links in:
              The == operand. - MQL4 programming forum #2 2013.06.07