You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Optimizer is not involved - there are half as many comparisons...
Just a mini refactoring ("Because you can't be so beautiful in the world..."):
Result:
Just a mini refactoring ("Because you can't be so beautiful in the world..."):
Just above I asked - try to put the original array as a series. ArraySetAsSeries(...,true);
This is quite a relevant question - to see which methods do not work with series at all, and which ones are unexpectedly slow
Never mind with array filtering, the question about series is more practical
Just a mini refactoring ("Because you can't be so beautiful in the world..."):
Thank you, Sergei, for a useful quality lesson. :)
Moved @Maxim Kuznetsov to a separate category, different functions after all
Recommended tests with mistakes (Semko and Pavlov).
Added your variant
P.S. And templates need to be removed, it's also a potential error when comparing doubles
Moved @Maxim Kuznetsov to a separate category, different functions after all
Recommended tests with mistakes (Semko and Pavlov).
Added your variant
P.S. Templates have to be removed too, it's potential error in comparing doubles
Made last two array elements equal to Value. Semko does not have errors. Please show us the error in what case. It is not very sensible to throw out a leader.
What are those errors with double that are caused by their normalization? So, if you work with an array of doubles, you need to worry about putting normalized data into the array yourself.
Made the last two elements of the array equal to Value. Semko does not have any errors. Show me in which case he has errors. It is not fair to throw out the leader.
What are those errors with double that are caused by their normalization? If we're working with an array of doubles, we'll have to add the normalized data into the array ourselves.
I just commented in the code, you probably didn't notice it. An error if the last array element falls under the deletion condition, i.e. is equal to Value.
I haven't removed it from the code :), just to prevent someone from copying the error. I think Nikolay will correct his code and he will return himself :)
As for the templates: there will be an error when passing the double, as the function is incorrect comparison of real numbers, or rather, it is simply not intended for this, so before you put a template, we should make sure that the function will work correctly with any types.
I commented in the code, you probably didn't notice it. The error is if the last element of the array falls under the deletion condition, i.e. equals Value
I did not remove it from the code :), just to prevent someone from copying it with an error. I think Nikolay will correct his code and he will return himself :)
And about the templates: there will be an error when passing the double, as the function is incorrect comparison of real numbers, or rather it simply is not intended for this, so before you put a template, you should make sure that the function will work correctly with any types.
And what was there to notice? This: "array corrupted if one or more of its last elements fall under a condition"? That's what I wrote above - it didn't work. I can see from your screenshot that it's not the point. The error seems to occur when the number of items is small.
What kind of error would occur with double? Why? Whatever data is in the array will work that way. If you want it to work properly, you should perform normalization before putting it into an array. But you should not insert normalization into the function itself. The function goes perfectly well with the template and will work fine with double, if you use it correctly.
The fact that everyone has suddenly become concerned about the problem of double is very good.
What was there to notice? This one: "The array is corrupted if one or more of the last elements fall under the condition"? That's what I wrote above, that it didn't work. As you can see from your screenshot, that's not the point. The error seems to occur when the number of items is small.
What kind of error would occur with double? Why? Whatever data is in the array will work that way. If you want it to work properly, you should perform normalization before putting it into an array. But you should not insert normalization into the function itself. The function goes perfectly well with the template and will work fine if you use it correctly.
The fact that everyone is suddenly concerned about the problem of double is very good, but one has to be wise about it.
You and I have different views on how the function should work. A function is a function in Africa and it should work without any data preparation, everything must work internally.
P.S. Actually no one is concerned, I'm not really bothered. I just wrote that the templates here as a dog's fifth leg and a possible error
A function is a function and should work without any data preparation, everything should work internally.
This is kindergarten.