Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 48

 
Artyom Trishkin:
This enum: enum

How do you set the timing?

int TF=PERIOD_D1;
iLowest(_Symbol, TF, 50);

And the compiler scolded me:

'TF' - cannot convert enum eMinMax_2.mq4 425 52


 
Vitaly Muzichenko:

How do you set the timing?

int TF=PERIOD_D1;
iLowest(_Symbol, TF, 50);

And the compiler scolded me:

'TF' - cannot convert enum eMinMax_2.mq4 425 52


So try

ENUM_TIMEFRAMES TF=PERIOD_D1;
iLowest(_Symbol, TF, 50);


...

 
Vitaly Muzichenko:

How do you set the timing?

int TF=PERIOD_D1;
iLowest(_Symbol, TF, 50);

Well, the compiler scolded me:

'TF' - cannot convert enum eMinMax_2.mq4 425 52


You haven't specified in which timeseries to look for the minimum. You should

int TF=PERIOD_D1;
iLowest(_Symbol,TF,MODE_CLOSE,50);

...

 
Sergey Gritsay:

So try it.

ENUM_TIMEFRAMES TF=PERIOD_D1;
iLowest(_Symbol, TF, 50);


...

Yes, that's how it works.
 

Help me out here. I can't figure out the functions for working with files. I have several global variables, for example: double G; datetime M; int T; How do I write their values to a file and then extract the information back, so that the variables get their values?

 
iv1986:

Help me out here. I can't figure out the functions for working with files. I have several global variables, say: double G; datetime M; int T; How do I write their values to a file and then extract the information back, so that the variables get their values?

Here's all about files. With examples.
 
Artyom Trishkin:
It's all about the files here. With examples.
Thank you!
 
Artyom Trishkin:
Then get it as usual.

Thank you.

Please help me to find out what colour Label is at the current time.

That is, if it is green, then BUY_= true;

label
 
mila.com:

Thank you.

Please help me to find out what colour Label is at the current time.

That is, if it is green, then BUY_= true;

Receive the same way as set, only Get

ObjectSetInteger(0,nm,OBJPROP_COLOR, clrGreen); // устанавливаем
ObjectGetInteger(0,nm,OBJPROP_COLOR,0); // получаем
 
Vitaly Muzichenko:

Retrieve in the same way as to install, only Get

Thank you, is this correct?

label =ObjectGetInteger(0,"MP140269",OBJPROP_COLOR,0);

if(label==Lime) BUY_ = true;

if(label==Red) BUY_ = false
Reason: