Clarifications for Pre-defined Variables

 

Hello, can someone enlighten me about the difference with the following:

1.

Period() vs _Period 
Digits() vs _Digits

etc

2.

If I used this code: Correct me with this one please

ExampleBB = iBands(Symbol(),PERIOD_M15,25,1.618,0,PRICE_TYPICAL,MODE_MAIN,1);

//Do I  get the values of the indicator in M15 time frame despite the fact that I am running the EA in H1 time frame?
 

It is explained in the documentation:

Period()Return Value: The contents of the _Period variable that contains the value of the current chart timeframe.

Digits() — Return value: The value of the _Digits variable which stores the number of decimal digits determining the accuracy of price of the current chart symbol.

 
Fernando Carreiro #:

It is explained in the documentation:

Period()Return Value: The contents of the _Period variable that contains the value of the current chart timeframe.

Digits() — Return value: The value of the _Digits variable which stores the number of decimal digits determining the accuracy of price of the current chart symbol.

Okay thanks!

How about my second question?

 
Victor Ian TorresIf I used this code: Correct me with this one please
ExampleBB = iBands(Symbol(),PERIOD_M15,25,1.618,0,PRICE_TYPICAL,MODE_MAIN,1);

Do I get the values of the indicator in M15 time frame despite the fact that I am running the EA in H1 time frame?

Yes, you will get the value of M15, but you should also handle 4066/4073 errors because the data may not be synchronised.
 
Fernando Carreiro #:
Yes, you will get the value of M15, but you should also check for 4066/4073 errors when the data is not synchronised.

Thanks very much!! 

 

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4