I made one of these things once ... - page 3

 
Andrei01:

What exactly are you interested in, could you specify? How do you minimise code into a function so that the main function doesn't have calculation code scattered here and there?


Just redo the code, nothing more.
 

By the way, in principle for this code in the process of writing there was a possibility to minimize it to more "correct", how true the necessary things have been provided in advance it is impossible to say of course.

But in general if an approximation is found with which it will be reasonable to seriously interact with, the best way to do it will be to write a completely different code, optimal for this particular approximation. By the way, various compact and short-lived projects are more typical for MQL, while tasks requiring long-term development and maintenance are extremely rare, imho.

 
TheXpert:

There are no grounds.
 
Vinin:

Just redo the code, nothing more.

I don't see any special difficulty to tidy up this code, but unfortunately I'm very busy right now, maybe later.

In any case all loops will be put into separate functions and of course creating objects inside the start is a pain in the ass, they should be created once at initialization and then only move.

 
Andrei01:

I don't see any particular difficulty in cleaning up this code, but unfortunately I'm very busy at the moment, maybe later.

In any case all loops will be put into separate functions and of course creating objects inside the start is a pain in the ass, they should be created once at initialization and then only move.


In that case, it was all just flooding and nothing more.

 
Vinin:
Just redo the code, nothing more.

That's the topic, otherwise you're a flooder, mate.

Andrei01:

Do you do without the main callable function start()?

Easy. Especially in MT5. I suspect you do without writing any code at all :) yyyy.
 

Andrei01:

of course creating objects inside the start is crooked, they have to be created once at initialisation and then only move around.


Ah, that's what I was interested to see, how to create an unknown number of objects beforehand
 
Vinin:


In that case, it was all just flooding and nothing more.

Why is it all flubbery? I explained the rule, but you didn't say anything of substance, you just accused me and asked for the code. If you want the code well then wait - not everyone is as fast as you are.

Although I am surprised that you do not know how to minimize the code into a function - it must have been just a provocative question.

 
Candid:

Ah, and this was something I was interested to look at, how to create an unknown number of objects in advance
Why unknown? Is it a finite number or an infinite number?
 
Andrei01:

Programming crankiness is simply not knowing a few simple rules for writing programs carefully. As soon as one understands them, the sloppiness disappears at once. By the way, this code suffers from sloppiness too - the body of the main called function must not contain computational code, for example, loops and everything must be collapsed into functions.


I agree that yes you can, but understand me too, I used to program in assembly language too. It's just that once you get used to a good thing, it's very hard to get away from it. Going back to a low level programming language again is very hard. MQL is a low level programming language compared to matcad. Example please, it took me 1 minute to write it

And I'm sure it's calculated correctly. Try to do the same in MQL, calculate a double definite integral of the Rayleigh-Rice function, which contains the calculation of the Bessel first order function of zero order (only please do not say that I do not need it for market analysis, I personally do).

S.I. I just have an idea and for example I would like to check it, checked it, went further. If this function was vital for building ATS (can't do without it), I assure you I would put it to work, and put up a very tasty price ...

Reason: