Help write a linear regression - page 3

 
lna01:
kvn:
And I'd also be very grateful for any material on how to make an inductor faster, how to increase MT's speed.
And if anyone knows if there is any information about execution speed of different MT statements (e.g. how many clock cycles different statements are executed).
As for MT, it is useful for the user to try to minimise the number of indicator buffers. Operator execution speeds are usually learned independently using Print and GetTickCount operators. Although it would be welcome if someone would digest this and publish an article.
I already wrote - for optimization, do not want multiple single increases of arrays sizes through ArrayResize() [as a last resort, allocate memory with large margin, for example, expanding array by thousand elements at once], and use of global variables. Besides, in my experience I have written that calls of custom indicators via iCustom() are not inferior (and even faster) than functions embedded directly in the code. You can check all these three assertions by yourself.
 
Rosh:
calls of custom indicators via iCustom() are as fast as (and even faster than) functions embedded directly in the code. You can check all these three statements yourself.
I find it difficult to agree with it. Calls through iCustom() must be accompanied by additional service operations, i.e. correctly built code must always be faster. Although in practice it is not always easy and working through iCustom() may save the total time due to the reduction of the development and debugging time. Another example: when calling iCustom() with variable parameters, the indicator buffers will be cloned, memory consumption will greatly increase, swaps will begin and goodbye to the speed. So, iCustom() cannot be a universal recommendation.
 
How much of a difference is there between For and While.
It seems to me that For is much slower.
A loop based on If is even slower.
Maybe somebody with a large programming experience could at least approximate the breakdown of operators by speed.
After all, even a harmless comment requires some time to be processed.

I am adding a working LR.
Files:
 
Then compare what this indicator is drawing with what at_LR0.mq4 is drawing and try to figure out why it is not a derivative of the MA and how to correctly get rid of the tail using the at_LR0.mq4 code.


It is a very interesting indicator. Something to think about.
But what about the tail, I do not understand your code, if you do not mind, please elaborate.

P.S. Not to bother with parameters, put indicators on hourly chart and set the period in yours to one more.

I do not understand.
 
kvn:
And how much of a difference there is in the operation of the For and While statements.

You were told about Print and GetTickCount:)
 
kvn:
I don't understand your code, if you don't mind telling me more.

It is not my code. Although I have a very close one. More detail without "thinking" usually helps badly, but it eats up time very effectively.
 
lna01:
Rosh:
calls to custom indicators via iCustom() are just as fast (and even faster) than functions directly embedded in the code. You can check all these three statements yourself.
I find it difficult to agree with it. Calls through iCustom() must be accompanied by additional service operations, i.e. correctly built code must always be faster. But it is not always easy in practice and working through iCustom() may save the total time due to the reduction of the development and debugging time. Another example: when calling iCustom( ) with variable parameters, the indicator buffers will clone, memory consumption will greatly increase, swaps will start and goodbye to the speed. So, iCustom() cannot be a universal recommendation.
This is a theory, check it yourself.
 
Usually after the first use of the word "theory" as a swear word, the discussion becomes unproductive :). But since the example was just recently, I'll give it anyway. You should compare 1-quadrat with M_qRMA, M_qWMA should be present in indicators folder.
Files:
m_qrma_1.mq4  3 kb
 
Second
P.S. Clever forum engine added _1 to the indicator name, additive to be removed when writing.
Files:
m_qwma_1.mq4  3 kb
 
Third
Files:
Reason: