Questions from Beginners MQL5 MT5 MetaTrader 5 - page 140
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. If you omit the checks, you can go like this:
2. Yes
3. The question is not clear.
1. What are the checks for? If without them less resources would be wasted?
2. For example, in mql4 there are variable names:
In which section of mql5 to list these variables that are above in the code that are in mql4 in int start?
Global variables are set before int start. All EA code is taken from the tutorial herehttps://с.mql4.com/book
1. What are the checks for? If without them fewer resources would be wasted?
2. In mql4 there are variable names for example:
In which section of mql5 to list these variables that are above in the code that are in mql4 in int start?
Global variables are set before int start. The whole code of the Expert Advisor is taken from the tutorial herehttps://с.mql4.com/book.
1. For reliable real trading of the Expert Advisor.
These are local variables and you can copy them to the OnTick function, which replaces the start() of the 4.
However, I would like to warn you: trading functions should NOT be transposed one to one!
1. For reliable EA operation on real.
2. these are local variables and you can copy them into the OnTick function, which replaces start() from the four.
However, I would like to warn you, the trading functions should NOT be copied from one to another!
Do you mean that some variables are counted differently in five? Sorry, I don't know anything about mql5 yet, so I cannot completely understand you. Could you give me an example of why you cannot transfer functions from mql4 to one another? Is there a forum branch for dummies?)
I am trying to insert the code:
I see errors in void OnTick():
TFMigrate' - function not defined
implicit enum conversion
I tried the same errors in int OnInit(). What am I doing wrong?
In mql5 we put flags, tickets, stop and profit lots, etc. into global variables that need to be stored outside the main code, i.e. the principle is the same as in mql4.
Do you mean that some variables are counted differently in 5? I'm sorry, but I don't know anything about mql5 and I can't quite understand you. Could you give me an example of why mql4 functions cannot be transferred to one another? Is there a branch on this forum for completely dummies?)
You should give up on mql4 and don't translate "stupidly" line by line, but start "dancing from the stove"! There are a lot of examples and ready-made Expert Advisors in kodobase and in the standard MQ delivery for the five. If this is "higher maths" for you, then order an EA in the "Work" section.
Now the answers to your questions:
You can't just start "dancing from the stovepipe" instead of "dumbly" translating line by line! There are a lot of examples and ready-to-use EAs in kodobase and in the standard MQ package for five. If this is "higher maths" for you, then order an EA in the "Work" section.
Now the answers to your questions:
I have thought of it this way:
I'm not sure about the first line if the code is correct.I try to put your function into void OnTick(), it asks to put it into global 'HourMQL4' - function can be declared only in the global scope. Is it really necessary to put it there? If I do, there will be no error. Is a semicolon after a curly bracket necessary?
The function cannot be included into a function.
How to determine the current time in minutes from the beginning of the day?
I thought of it this way:
I'm not sure about the first line if the code is correct.
This is correct:
That's how it's done:
Thank you so much! It works.
Explain the logic of mql5. In mql4, int Hour() is used to determine the time in hours. In mql5, there is no such constant, as far as I understood.
1.How does the program recognize that we are asking for the time in hours? I assume fromMqlDateTime?
2.To add the current time in minutes to the current time in hours, i.e. to find out the current time in minutes, the construction would be like this