Questions from Beginners MQL5 MT5 MetaTrader 5 - page 562

 
savinkins:
No. It didn't. Build old 1241
Click on the server icon in the bottom right corner and select another server. It should start.
 
Karputov Vladimir:

Use a minimum of code - use the standard library:

Agent Log:

Thank you!

I'll usethe standard library.

 

After activation of Win 7 when launching the terminal MT5 swears at Test invalid license (538). And strategy tester does not work.

What can I do? Please help me.


 
savinkins:

After activation of Win 7 when launching the terminal MT5 swears at Test invalid license (538). And strategy tester does not work.

What can I do? Please help me.


Have you tried to reinstall the terminal?
 
Василий:
Good afternoon everyone. Can you please advise me, I have started loading an EA from MQL4 to MQL5 and faced the following problem. I used to set "Extern Double ..." data type in MQL4 and I was able to change it directly from Metatrader without entering MetaEditior. I did not find such properties of an EA in MQL5, namely in the Metatrader 5 itself. Do you know where they are? Or they are not there, i.e. if I want to optimize TP from 10 to 50 pips for example, I have to do it manually?
Vasily:
Previously, in Metatrader 4 there were EA properties where I set the optimization parameter. But in MEtatraeder 5 I can't find such properties, could you please tell me where they are?
 

Vasily:
Good afternoon to all. Could you please advise me, today I've started porting an EA from MQL4 to MQL5 and encountered the following problem. I used to set"Extern Double ..."data typein MQL4 and I was able to change it directly from Metatrader without entering MetaEditior. I did not find such properties of an EA in MQL5, namely in the Metatrader 5 itself. Do you know where they are? Or they are not there, i.e. if I want to optimize TP from 10 to 50 pips, I have to do it manually?

Sergey Gritsay:

In MT5 the format for writing input variables is as follows

input int Series_N=100;//Series
input bool New_bar=false;//New bar (Off/On)
input double Risk=0.1;
input double Lot=0.01;//Volume
input double Loading_deposit=5.0;//Loading deposit

In MT5, Extern variables have another property

Extern variables

The keywordextern is used to declare variable identifiers as identifiers of a static memory class with global lifetime. Such variables exist at the start of program execution and memory is allocated and initialized immediately after the start of program execution.

It is possible to create programs consisting of several source files - for this purpose the #include preprocessor directive is used. Variables declared as extern with the same type and identifier can exist in different source files of the same project.

When the entire project is compiled, all extern variables with the same type and identifier are associated with the same area of memory pool of global variables. Extern variables are useful for separate compilation of source files. Extern variables can be initialized, but only once - the existence of multiple initialized extern variables of the same type and with the same identifier is unacceptable.

 
Karputov Vladimir:

Sergey Gritsay:

In MT5 the format for writing input variables is as follows

In MT5, Extern variables have another property

Extern variables

The keywordextern is used to declare variable identifiers as identifiers of a static memory class with global lifetime. Such variables exist at the beginning of program execution and memory is allocated and initialized immediately after the program starts.

It is possible to create programs consisting of several source files - for this purpose the #include preprocessor directive is used. Variables declared as extern with the same type and identifier can exist in different source files of the same project.

When the entire project is compiled, all extern variables with the same type and identifier are associated with the same area of memory pool of global variables. Extern variables are useful for separate compilation of source files. Extern variables can be initialized, but only once - it's unacceptable to have multiple initialized extern variables of the same type and with the same identifier.

Thank you very much, everything worked out:)
 

Good afternoon again!

Please tell me more, earlier I used iClose, Ihigh parameters to find required parameters.

Now I understand that instead of them there is CopyClose, CopyHigh. If this is the case, I cannot understand what I have to specify in the parameters .

For example before I specified iClose (Symbol(),PERIOD_D1,1), now I need to specify CopyClose (Symbol(),PERIOD_D1,1, ?,?) but what to specify in the last two parameters?

 
Василий:

Good afternoon again!

Can you please tell me more, before I used iClose, Ihigh parameters to find the required parameters.

Now I understand that instead of them there is CopyClose, CopyHigh. If this is the case, I cannot understand what I have to specify in the parameters .

For example, previously I specified iClose (Symbol(),PERIOD_D1,1), now I have to specify CopyClose (Symbol(),PERIOD_D1,1, ?,?), but what should I specify in the last two parameters?

You are asking about MQL5? Are you asking to access the data of the current symbol or another? Do you receive this data in the code of an indicator, Expert Advisor or script?

 
Karputov Vladimir:

Are you asking about MQL5? Are you asking about accessing data from the current symbol or another? Are you getting this data in the code of an indicator, EA or script?

Yes, I am asking about MQL5? Yes, you need to access the data of the current symbol. The data is required in the Expert Advisor code. So, for example, I need to know the close price of the bar preceding the current one
Reason: