Predefined variables
Hi folks,
Today we are going to talk about a very important topic, the Predefined variables.
I still considering them functions (I'm going to tell you why later) but I'll use Predefined variables as MetaQuotes has mentioned them.
What are the Predefined variables?
The Predefined variables are set of the most important variables which MetaTrader set continuously for every loaded chart. They are price related variables that reflect the current price data the chart had got.
These is the list of the predefined variables:
Ask, Bid, Bars, Close, Open, High, Low, Time, Digits, Point and Volume
I'm calling them functions because:
Ask, Bid, Bars, Close, Open, High, Low, Time, Digits, Point and Volume are functions Although MetaQuotes called them predefined variables.
Variable means "a space in memory and data type you specify", while function means "do something and return some value". For example Bars collects and returns the number of the bars in chart. So, is it a variable?
Another example will proof for you that they are not variables:
If you type and compile this line of code:
Bars=1;
You will get this error:
'Bars' - unexpected token
That’s because they are not variables hence you can’t assign a value to them.
Anyway, it doesn't matter what should you call them, the really matter is how to use them!
Let's study the Predefined variables set:
StringConcatenate:
Syntax:
| double Ask |
Description:
The Ask function return the last known Ask price (the sell price) for the current symbol. To be sure it reflects the actual market price you have to use the RefreshRates() function.
Note: To get the Ask price for a
Parameters:
Example:
|
|
