Errors, bugs, questions - page 2636

 
Koldun Zloy:

I'm not a developer, but I'll comment.

For a static array, the compiler has to allocate a certain number of bytes in memory at compile time.

How much memory should the compiler allocate if row and col are unknown at compile time?

Initial values are only used if parameters are omitted when calling. The actual parameters are only known at runtime.

So, no gimmicks, learn the language.

This is a bit tongue-in-cheek, but it's more of an appeal to the developer.
So Zloy, don't take it personally.

It turns out that dynamic matrices can only be handled through objects or structures. Another crutch is created in general.
There are no pointers to variable in mql, so we have to use the object approach where pointers are available.
So, to use dynamic matrices, a user must know OOP and working with pointers, and moreover, in MQL execution.
How many of them have this knowledge? You know the answer yourself. I don't have any difficulties in understanding the object approach, but for those who don't know OOP
. They create an artificial threshold for using the language, in particular when dealing with dynamic matrices.
As I see it, a developer, on the contrary, should be interested in making the language easier to use, rather than complicating it.
In other words, they should develop such functions which are necessary to the user for comfortable work with the language.
And all the more so with matrices, which are almost the basis of numerical methods.

For this reason, I would like to ask you to create functions similar to ArrayResize, but for matrices ArrayResizeMx(A, n, m),
and perhaps for multidimensional ones as well. In other words, give the possibility to work with matrices not as with objects, but as with customary arrays in the C style.
Especially for visual representation of matrices, the ArrayPrint(A, 0) function prints matrices from arrays, not from objects.

 
Roman:

Back in 2012, the problem with dynamic multidimensional arrays was successfully solved...
Here is a related thread:https://www.mql5.com/ru/forum/6729

The code can now be improved by adding support for templates.

 
Sergey Dzyublik:

Back in 2012, the problem with dynamic multidimensional arrays was successfully solved...
Here is a related thread:https://www.mql5.com/ru/forum/6729

The code can now be improved by adding support for templates.

Read the whole thread, thankfully it's short.
So the topic starter, and did not reveal his feat!
Some kind of mockery, bait the topic and disappeared.
And once again it is a dive into the PLO, no one is allowed to enter.
Yuri cited his own solution, no one knows how true it is.
Which we will have to modify and modify. Who will do it? No one, since they have not completed it yet.

This is why we need functions that work with dynamic matrices out of the box from the developer.
The developer knows the subject better and memory allocation without wrappers looks much better and faster.
At least one functionArrayResizeMx(A, n, m, k) would open the possibility to work not with objects but with arrays in C style.

 
Roman:


And this is again an immersion in OOP, no one is allowed to enter.

Roman:


So, in order to use dynamic matrices the user must know OOP and work with pointers and in the MQL execution as well.
How many of them have such knowledge? You know the answer yourself. I don't have any difficulties in understanding the object approach, but for those who don't know OOP
. They create an artificial threshold for using the language, in particular when dealing with dynamic matrices.
It seems to me that the developer, on the contrary, should be interested in making the language easier to use rather than complicating it.

I may surprise you, but today's young programmers consider OOP to be easier programming than procedural programming.

You are thinking in terms of 25 years ago. Today's youth absorb OOP with the milk of their mother. Learn OOP if you want to be in the trend; otherwise you will do nothing but grumble.

 
Nikolai Semko:

I may surprise you, but today's young programmers consider OOP to be easier programming than procedural programming.

maybe compared to functional programming?

 
Nikolai Semko:

I may surprise you, but today's young programmers consider OOP to be easier programming than procedural programming.

You are thinking in terms of 25 years ago. Today's youth absorb OOP with the milk of their mother. Learn OOP if you want to be in the trend, otherwise you will do nothing but grumble.

Yes, I understand OOP, not to the extent I would like to.
This is not a grumble but a constructive proposal.
So that the developer does not have to write one function to allocate two mallocs, they force users to study OOP.
This is certainly that progress, development and popularization of the language. You can see how much they love and understand OOP here.
You see, Nikolay, everything that's wrapped is unnecessary code to be executed - I don't think we need to explain why.
I don't need to tell you about modern optimizing compilers - we don't know what instructions they will apply.
Perhaps I will also surprise you that even American programmers prefer to write in the procedural style not because OOP is bad, but because code is simpler and faster.
And if there are no object tasks in the project, why use wrappers, which must somehow be understood, for young people ))
So I don't agree with you that young people eagerly absorb OOP.

I'm thinking in C, which is where the logic of the mql language is built on.
C was born in 1972, so it's 48 years old ))
But anyway C is one of the fastest languages. Do you know why? Because it doesn't have class wrappers.

 
Andrei Trukhanovich:

maybe compared to a functional one?

Procedurally functional :)

 
Petros Shatakhtsyan:

I don't think that's it. There is a special topic here :https://www.mql5.com/ru/forum/40295

Haven't looked at it all the way through, especially since it's for MQL4.

I don't think the server should send symbol quotes if the market is closed.

My robot is not really affected by this because after the market "opens" when the ticks come in it analyses the trend, their reversals, and that takes some time. During this time the market opens.

But it gets in the way if we want to manually execute some trades during this time. If execution is market-based, the request is pending until the market opens and is naturally executed at the current price.

The direct function that receives the name of the symbol and returns true/false (market open/closed) is clearly missing.

There is a quote and a trade session. Search, it's been explained 20 times.

 
Andrey Dik:

Please add another badge of some kind:

4. Money

Where the sum of all funds received for the day (market, freelance, etc.) would be displayed, it would be very convenient, and now for this you have to go to the profile, that would see the available balance.

If so much and regularly comes in, you can order a plugin for chrome ;)

 
Andrey Khatimlianskii:

There is a quotation session and a trading session. Look it up, it's all chewed up 20 times over.

It only took me a few days to switch from VC++ to MQL5. I've never searched for anything so long.

If you get the message "Market closed" during trading, you must have a simple way to determine this state, instead of writing "kilometer-long" and complicated code.

Don't give me advice like that.