a trading strategy based on Elliott Wave Theory - page 287
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Good evening all.
Could you please tell the children of this algorithm?
Thank you in advance
I am telling you.
We apply a multiple median filter to the price curve. What is it? We take an odd-sized (>=3) window and run it through all values of the original curve. At every current point, sort by value the points included in the window. The current point is assigned an average value (in the sense that it is situated in the middle of the array) from the sorted array. Once again we apply the same filter to the result obtained. We repeat it many times (usually 20-30 times is enough).
To get the resistance levels we invert the price curve upside down and do the same. Then we flip the obtained result backwards.
That is all!
...
A quick question.
Suppose we have a history of 1000 reports (bars)
window 3
we don't calculate results for 1000,999 windows and perform the first calculation when we get to the 998th report (we have data from 998,999 and 1000 reports)
our first pass gives us 998 results
for the second pass, we get to 996 report using the array formed during the previous run
in the third run, we get 994 ...
and so on ...
That is, if we ran 30 times, we got an array of 960 values
Maybe i didn't understand you correctly ?
Suppose we took a history of 1000 reports (bars)
window 3
it turns out that for 1000,999 we don't count because it's smaller than the window and the first calculation we do only when we get to 998 report (we have data from 998,999 and 1000 reports)
we get the first pass with 998 results
the second pass we get to 996 report already formed by the previous run of the array
the third run we get to 994 ...
and so on ...
i.e. if you ran 30 times, you got an array of 960 values
Maybe I misunderstood you?
Not exactly. Technically it's done a little differently. Before you apply a filter, you expand the original array by half the width of the filter window in both directions. You fill in empty spaces in the new array with either a constant, i.e. the last value from the edge of the original array, or symmetrically with the extreme values of the original array. In this case you will get 1000 points again after applying the filter to the original array of 1000 points. The next time you filter, everything repeats.
Of course, in this case distortions may occur at the edges. But this cannot be avoided because any window filter (and any filter at all) has a phase delay, including median one. In general - that's the way nature works.
We can do it the way you describe, but then we won't get to the edge of the original array; or we can use an extension, but then we won't get to the edge of the result.
This is the bad news.
The good news is that the median filter is not as sensitive to edge effects as linear filters. The few examples that I have had time to look at show that edge distortions are either small or, in some cases, absent altogether.
PS. Yes... Another idea came to my mind just now. The filter could be applied recursively. I don't know what it would do, I haven't tried it, but it would count faster.
As far as applications in trading are concerned, it is correct to use "left window" when the current point is assigned a value from the centre of the window located FULL to the left of the current value. Of course, this introduces a phase delay (lag), but that's the way of the world:-)
Yes... That doesn't add up. Started checking. Finally looked into my code, which I use for median filtering. I wrote it N years ago (N>5) for one small graph output program. Now I've started to use this program as a polygon for all sorts of research. It's handy, and I haven't even looked into the old parts of the code. It's all working and well... Now I'm looking at it... and suddenly discovered that the function I thought was median filtering - it doesn't do exactly that! Wildly sorry for the involuntary misinformation! I bow my guilty head.
Why and why I did so at the time - God forbid I don't remember.
The classic median is when the central value of a sorted array is taken. In this particular case I took the average between the central value and the one before it. Perhaps I needed it a long time ago for some reason. I also got a non-linear filter, though, of course, it was not the median in the strict sense. When I went back to the classic version, it turned out the way you described. In my variant the curve changes every time the filter is applied and eventually tends to be straight (after several hundred filterings). The larger the filter window, the faster it happens.
To avoid further ambiguity, I am providing a piece of code in C.
It's simple, I hope anyone can figure it out.
About the "left window" - all true, I agree. But for now, I think it's details.
Once again, my apologies.
Maybe there is some news about this work?
Has there been any news on this work?
I did not take any further steps after the publication of their response.
I just showed you a way to try to find the thesis material.
I warn you that the material may have to be paid for.
Doing some heavy positional battles with MatLab.
For a start I decided to just look at the wavelet decomposition of a series of price and a series of indicator values. For DWT I didn't find any surprises, everything is more or less understandable.
For CWT the indicator decomposition was also quite clear. However, the price series has produced the following picture:
The structure of this picture generally speaking differs significantly from, for example, the picture in Andre69's post on 28.06.07 20:43 on page. 141. I would like to understand why.
On the other hand it has too regular structure. Why?
This analysis was performed for a series of 1024 samples.
Scale settings: Min=1, Step=1, Max=512. DMeyer wavelet
PS By the way, the above post was the last in an endless series about wavelets. :-)
I would like to know about continuation. Should ?
On the other hand it has too regular structure. Why ?
Yura, such a regular structure is inherent in the nature of edge effects that inevitably occur at the ends of the BP being studied. It is impossible to avoid such effects. But if allowed by the condition of the problem to be solved, you can leave a few terms of the series from each end of the VR (the number of terms equal to the sample window width) that will take part in the calculations, but will not be used in the visualization. After this procedure the picture will be adequate and isotropic.
Thanks, Sergey, for the clarification. All that remains is to figure out how to do what you write about.
Parsing Wavelet Toolbox I didn't find such features there. Maybe I have overlooked something or it can only be done manually?
In this case the presented results will look correct.