Is the linear deceleration a programming error or a feature of MT4? - page 3

 

Any other clever ideas?

 
-Aleks-:


And what are the conclusions?
 
Vinin:
What are the conclusions?

Alas, but so far I am once again coming to the conclusion that there is no programming community, but there are people who want to make money but do not enjoy their work.

So I am confused and depressed....

 
-Aleks-:

Alas, but so far I am once again coming to the conclusion that there is no programming community, but there are people who want to earn, but do not enjoy the work.

Overall, confused and depressed....

Bringing EAs in order and optimizing them will cost much more than the initial cost.

Will there be the desired result?

 
There's the "Schlemiel's painter's algorithm":

Schlemiel got a job as a painter and had to paint in the middle of the road. On the first day, he took a barrel of paint and marked 300 meters of the road.
-Nice! - said the boss - You work fast! - And paid him a dime.

The next day, Schlemiel only covered 150 meters.

- Well, not as great as yesterday, but you still work fast. 150 metres is not too little," said the boss and paid him a fee.

Another day later, Schlemiel marked out 30 metres of the road.
- Bcero 30 metres! - The boss got angry. "That's no good. On the first day you did ten times as much. What happened?

- I can't help it," says Schlemil. Every day I have to get farther and farther away from the paint barrel...
 
Vinin:

Bringing advisors up to speed and optimising them will cost considerably more than the initial costs.

Will there be the desired result?

At the stage of strategy improvement, and especially tactics, we have to order all sorts of additives to test the idea, and at this stage we can tolerate the slowness of the Expert Advisor.

But I was surprised by such 6 times slower speed compared to the main version of the EA. Optimization of EA tuning is necessary at least for analytical data gathering.

Am I right to understand that it is impossible to read other people's code and it is better to order another version of the EA after we will get a successful one, but it must be written from scratch, and only in this case, we can be sure of high speed and reliability? Personally I thought that compiler's part of the task is to cut out operations, which are duplicating each other, for example...

 
MetaQuotes:
There's the "Schlemiel's painter's algorithm":

Schlemiel got a job as a painter and had to paint in the middle of the road. On the first day, he took a barrel of paint and marked 300 meters of the road.
-Nice! - said the boss - You work fast! - And he paid him a pittance.

The next day, Schlemiel only covered 150 meters.

- Well, not as great as yesterday, but you still work fast. 150 metres is not insignificant," said the boss and paid him the money.

Another day later, Schlemiel drew 30 metres of road.
- Bcero 30 meters! - The boss got angry. That's no good. On the first day you did ten times more. What happened?

- I can't help it," says Schlemil. Every day I have to get farther and farther away from the paint barrel...

Not an unambiguous "fairy tale", in other words there is no way to write code so that it does not slow down and at the same time not to rewrite it from scratch?

And, the code I attached is quite adequate?

 
From the first posts, I guessed what the problem might be, but only when I looked at the source code did I finally understand... My God, was it even written by a programmer? Or a student at the water academy?
 
micle:
From the first posts, I guessed what the problem might be, but finally realized it only when I saw the source code... My God, was it even written by a programmer? Or a student at the water academy?

Intriguing!

So what's the problem and, more importantly, how to fix it?

I don't think it's a bad idea...

Files:
SL3000.png  81 kb
 
-Aleks-:

Intriguing!

So what is the problem, and more importantly, how to fix it?

The problem is duplication of code, too many conditional statements. In fact, the code consists of 99% of lines somehow including the conditional If operator. I'm sure if you look into it, the number of comparisons can be reduced 10 times. This not only slows down execution, but this code is also difficult to read. A person who makes additions to it has at least 2 main tasks:

1 - not to break it

2 - Add necessary functionality.

Unreadable code anyway causes additional duplication of all sorts of checks and comparisons - and this again is additional expense. Looking through the code, I personally remember myself about 25 years ago, when I just started programming, and I learned it from the manual to Atari 800XL PC without any teachers, just because it was interesting.

Reason: