Errors, bugs, questions - page 40

 
Interesting:

> I'm not interested in a way around the bug, but in fixing the bug itself. I would like it to be eliminated altogether.

I don't think it's rude or insulting, but it really killed me...

To the point of the question (suggestion):

This is not MQL4, and Period() does not represent explicitly the number of seconds/minutes in TF.

To get the number of seconds in a period, use function PeriodSeconds.


And if you try to express Period as a number, then as a result you will get the numeric value corresponding to the identifier of the period in the enumeration ENUM_TIMEFRAMES.

Well, open the help for the Period() function. B what do we see?

It returns the value of the current chart timeframe.

ENUM_TIMEFRAMESPeriod();

Returned value

Contents of the _Period variable, where the timeframe value of the current chart is stored. The value can be one of the values of ENUM_TIMEFRAMESenumeration.

Click theENUM_TIMEFRAMES link- opens the table that lists the periods.

PERIOD_H1 1 Hour

Everything is as in MQL4. What does the number 16386 have to do with it?

Methaquotes is as usual - they don't write Help for users, but use it as a notebook for themselves. They know what's what, and they don't care what occurs in user's brain when reading their text. Apparently they do not have a professional editor who would own a basic style of Russian (at least at the level of an ABC book). :(

I'm just tired of ignorance of material presented by metaquotes when mastering MQL4. I feel I will have to go through this again in MQL5.

 
drknn:

Well, we open the Period() help. B What do we see?

We click onENUM_TIMEFRAMES - it opens a table that lists the periods.

PERIOD_H1 1 Hour

What does the number 16386 have to do with it?

Metacvoters in their repertoire, they do not write help for users, but use it as a notebook for themselves. They know what's what, and they don't care what will appear in user's brain when reading their text. Apparently they do not have a professional editor who would own a basic style of Russian (at least at the level of an ABC book). :(

But PERIOD_H1 inENUM_TIMEFRAMES has code value 16385, while earlier it was 60 (by number of minutes).

Calibrations of this sort are due to the fact that MQ has not yet published codes for individual values of numerators (identifiers), as it was done in the MQL4 help.

I personally (and maybe others too) asked to specify these CODES (values) in help, which hasn't been done yet.

PS

If you open the help for Period() in MQL4 and MQL5, here's what immediately strikes your eye (at least it should):

MQL4 - Returns the number of minutes of a period for the current chart.

MQL5 - It returns the value of timeframe of the current chart.

This is enough for ordinary developers, but for those who want to work at a lower level (for example, to pass information to DLL or create a library for migration) it is necessary to know the numeric code.

In MQL4 this code corresponds to a number of seconds (because it returns the number of seconds), but in MQL5 the rules are different...

Периоды графиков - Документация на MQL4
  • docs.mql4.com
Периоды графиков - Документация на MQL4
 

A summary table of code values for Period() in MQL4 and MQL5 will look like this


Identity
MQL 5 code
MQL 4 code
Description
PERIOD_CURRENT / NULL
0
0
Current period
PERIOD_M11
1
1 minute
PERIOD_M22
Х
2 minutes
PERIOD_M33
Х3 minutes
PERIOD_M44
Х 4 minutes
PERIOD_M55
5
5 minutes
PERIOD_M66
Х 6 minutes
PERIOD_M1010
Х 10 minutes
PERIOD_M1212
Х 12 minutes
PERIOD_M1515
15
15 minutes
PERIOD_M2020
Х 20 minutes
PERIOD_M3030
30
30 minutes
PERIOD_H116385
60
1 hour
PERIOD_H216386Х2 hours
PERIOD_H316387Х2 hours
PERIOD_H416388240 4 hours
PERIOD_H616390Х 6 hours
PERIOD_H816392Х 8 hours
PERIOD_H1216396Х 12 hours
PERIOD_D1164081440 1 day
PERIOD_W132769
10080 1 week
PERIOD_MN1
49153
43200 1 month


PS

I hope it's all very clear now... :)

Периоды графиков - Документация на MQL4
  • docs.mql4.com
Периоды графиков - Документация на MQL4
 
Interesting:

A summary table of code values for Period() in MQL4 and MQL5 would look like this:

>

PS

I hope everything is clear now... :)

Look at the value bits in MQL5...
 
mql5:
Look at the value bits in MQL5...
Everything seems to be accurately specified. Or maybe I didn't understand the point of your post...
 
Interesting:
Everything seems to be stated accurately. Or am I missing the point of your post...
The numbers seem to be correct, but why they are, you can find out by looking at the binary value.
 
mql5:
The numbers look right, but you can find out why by looking at the binary value.

Oh, you mean this... :)
 
Interesting:

The summary table of code values for Period() in MQL4 and MQL5 will look as follows:

PS

I hope everything will be clear now... :)

I know the formal logic and the differences in the terms caught my eye immediately. The thing is, reading the MQL5 help doesn't make many things clear. It is clear that the methaquotes have made the terminal available for public access in order to attract the group of beta-testers - this step will save time and money. But giving users a reference that lacks clarity is a big mistake on their part. For example, we open the most important section"MQL4 Conversion":

Predefined Variables

In MQL5 there are no predefined variables such as Ask, Bid, Bars. The Digits and Point variables have slightly changed in their spelling as shown in the table below.

The table gives no information on Ask, Bid and Bars. An attempt to use a search for the same word Ask results in one being confronted with a completely incomprehensible construction of a query for the latest prices. Couldn't the developer have foreseen this back then, at the stage of typing this part of the help? Nonsense, why could it happen? The only reason is the lack of systematicness - that is the absence of a clear plan of the future essay. Most likely, the certificate was written in a piecemeal fashion, then the separate pieces were glued together and there you have a "certificate". This is not good for anything. No one likes reading someone else's drafts!

All right, even if it's a draft, is it really so hard to write it differently, for example like this:

Predefined variables

In MQL5 there are no predefined variables such as Ask, Bid, Bars. These values in MQL5 are obtained by other rules. To have a clear idea of how it is done, you should read sections "111", "2222" и "3333".

The Digits and Point variables have changed slightly in spelling, as shown in the table.

That's it!!! Such a simple move and such a time and effort saver.

Reading MQL5 helps is more like wandering in a dark forest without a map, without a compass and without the possibility to climb a tree and orientate yourself. What would be the desire? Right - not to enter such a forest at all. The developer knows the forest inside out. His unwillingness to give the user a guide causes at least bewilderment and at most - disgust.

When I read the responses from developers like: "We currently have more important tasks than this", I want to ask - why the hell did you post such a dirty work? It is a minus to your reputation. Wouldn't it have been better to check everything first, debug it, code it properly and not torture users with your drafts?

No words. Metatrader 4 has been used for how many years? Correct, many. And there is no proper MQL4 language textbook until now. There was one activist who tried to make such a textbook and failed. He's a hardworking guy, that's all. His book cannot be considered a good textbook. For want of a better one this creation is lying on the site as a textbook. Why is it not a textbook? Yes it is simple - read the beginners this book, then go out on a forum and ask such crap that can amaze me. If there were a proper textbook, this would not happen - the reader would get clarity and see the validity of using a particular resource in future code.

For a long time I was tempted to give up everything and do two things - a proper code editor for MQL4 and a proper tutorial on this language. But since the amount of work is huge, and except for a feeling of satisfaction I wouldn't get anything for this kind of work, I decided not to implement these ideas.

In short, I think I will wait a couple of years and let the methaqvotes sharpen their MQ5-creations. I don't even want to touch such a terribly made work. I already have "all hands in their splinters". They'd better debug the MQ4 family from and through rather than rudely riveting MQ5 in a hurry.

I'm disappointed.

 
drknn:

I know the formal logic and the differences in the terms caught my eye immediately. The point is that reading the MQL5 help does not make many things clear. It is clear that the methaquotes have made the terminal available for public access in order to attract the group of beta-testers - this step will save time and money. But giving users a reference that lacks clarity is a big mistake on their part. For example, open the main section"MQL4 Conversion" .....

I'm disappointed.

It's quite acceptable, taking into account certain features (mostly due to the fact that MQL5 is constantly being updated).

Of course, there are some inaccuracies, or as many people prefer to think "lapses and errors", but it can be explained and gradually improved.

The subject of migration from MQL4 to MQL5 is a separate layer in itself, I would forget about serious changes in this section until Autumn (at least), because developers should probably deal with MQL5 and only then think about making changes in this part.

PS

I mean a lot of stuff could be added there. For example, we can move some functions from MQL4 to the DEAD section (as it was done in MQL4).

Even if a certain part of the work to facilitate migration is not done, it won't be a big problem, let alone a GREAT STONEBOOK...

 
Interesting:

A perfectly acceptable reference...

Thanks for the insight :)
Reason: