The perfect filter - page 6

 
Useful indicator.
Author, please make a version of VAMA for MT4.
Thank you.
 
G001:
Useful indicator.
Author, please make a version of VAMA for MT4.
Thank you.

Thanks for the feedback. Unfortunately I don't know mql4, I started from mql5, but I'm sure if you look at the code of the indicator you will be able to implement it in 4, it's very simple.

P.S In version 1.01 I have added an attribute to disable the tickwise re-drawing of the indicator, so that only when the bar is finished it is drawn.

input bool bar_exist=1;

Files:
vaMA.mq5  4 kb
vaMACl.mq5  5 kb
vaZZ.mq5  4 kb
 

Well, I think I'm satisfied with it, at least I don't feel any gaps. I'm happy with it so far, now I'm going to tighten volatility and trend/flat filter in order to mix it competently at transitions from trend to flat and vice versa and make nice adaptation, not ugliness like classic AMA.

1.12 attached if you want to know. ZZ and colour did not do with it, because this is only the initial stage, when I think about how to make a quality adaptation already, I will lay out ready.

Files:
vaMA.mq5  4 kb
 
J.B:

That's it, I think we've got it...

The first option is better (the one in codobase). In this one you've already over-mixed... IMHO

 

Just read it, the thread is a delight! Thanks very much to all involved, especially to the topicstarter. I've never done filters myself, but thinking out loud a bit on the subject would be nice, I think.

The question of finding a quantitative characteristic of the filter quality has been raised many times here. Really, which is better, JJMA or EMA and by how much? There is a certain amount of filter lag, how to measure it and what is its usefulness? So, all in all, these are normal logical questions.


Of course, a simple method via the sum of ZigZags built on filter kinks was also voiced. It's almost all good, but not quite.

Dear authors, since you have filter comparison methods, could you give graphical, tabular or other technical data of these comparisons. Further, if you are summing up the ZigZags, then let's subtract the spread value from each knee. Plot the quantitative characteristic as a function of the filter period. Overlay the resulting graphs of different filters on each other and evaluate the pros and cons of both.

And again, why do you generalize everything so strongly: a filter for all times? Imagine that your filter behaves graciously in the evenings, and is terribly wrong at other times. After all, such a filter is great! However, because of the average hospital temperature approach, you would reject it.

OK, thoughts pouring in, not enough letters. I also suggest a more generalised approach - One Way of Research:

Берется понравившийся кусок истории цВР. На нем выбираются понравившиеся интервалы, для которых суммарно будет проделываться нижеследующее. Например, берем крайний месяц, и рассматриваем далее только ночные интервалы.

Задача разложить данные по косточкам и написать ТС именно под этот кусок истории (точнее под выбранные интервалы в нем), чтобы на нем ТС показывала как можно больший профит.

Т.е. задача сводится к тому, чтобы обнаружить уже на известном куске истории закономерности для максимального профита.

Очевидно, что вычислить максимально-возможный профит на куске истории очень просто. Но надо создать такую ТС, у которой показатель Profit / Func(AmountIN) был бы максимален, где AmountIN - количество явных и неявных входных параметров ТС, а Func - некая функция (для простоты начала исследования - простейшая линейная: Func(X) = X).

Например, нескольким людям нравится какой-то замечательный флэтовый кусок, который эти люди считают чуть ли не классическим рыночным флэтовым (типовым) состоянием. Люди выкладывают этот кусок публично и устраивают свого рода соревнование по созданию оптимальной ТС для этого куска. Далее сравниваются характеристики полученных ТС, идеи в них заложенные. И уже исходя из этого анализа происходит некоторое понимание формализации флэтовости и более обобщенных понятий.
P.S. Написано очень примитивно, но основа подобных манипуляций позволяет уловить суть подходов и к исследованиям посложнее.

And also a strong plea, consider the differences in the TZVR. For example, your filter may show complete nonsense on EURUSD and be excellent on GBPJPY. If such differences are observed, then it is logical to dig into EURUSDvsGBPJPY. Anyway, there are plenty of places to dig.

 

hrenfx:

Of course, a simple method through the sum of the ZigZag knees built on filter breaks was also voiced. Everything is almost good, but not quite.

Dear authors, since you have methods of filter comparison, could you give graphical, tabular or other technical data of these comparisons. Further, if you are summing up the ZigZags, then let's subtract the spread value from each knee. Plot the quantitative characteristic as a function of the filter period. Overlay the obtained graphs of different filters on each other and evaluate pros and cons of both.

And again, why do you generalize everything so strongly: a filter for all times? Imagine that your filter behaves graciously in the evenings, and is terribly wrong at other times. After all, such a filter is great! However, the average hospital temperature approach will cause you to reject it.

And also a strong request, take into account the differences in the TzVR. For example, your filter may show a total rubbish on EURUSD and be excellent on GBPJPY. If you see such differences, then it is logical to dig into EURUSDvsGBPJPY. All in all, there are plenty of places to dig.

Thank you! It is the criterion of efficiency of different filters for different markets and clustering using this criterion will allow us to calculate the requisite conversion point between different order systems tuned for different market conditions. This is the plan.

I already thought about spread calculation in the totalizer, it is an additional invention, taking into account brokerage companies and their quotes, I am trying to solve problems consistently, so that each element of the system was reasonably autonomous, to be able to understand the "net contribution" of each element, and then analyze the net effect.

However, I'm not a very good programmer yet and my coding speed is horrible, I constantly struggle with array overruns and with the fact that I haven't created a new calculation buffer for the indicator and so on. That's why i'm spending 99.9% of my time on technical bugs instead of thinking about TC architecture, which is sad, but inevitable.

Please tell me, if you don't mind, what methods or heuristics are used to avoid array overruns? Because constantly think what loop from which and on which element to do, I think it is not kosher. Is it possible for example for invalid values and out-of-loop accesses not to break logic? For example, could division by 0 not cause an error, but a large value of 1000, for example, and addressing outside the array gave an item from the array edge closest to the address?

(So... beginner's thoughts, I understand that it may not be manly, perhaps even shameful to think in this way))) But forgive me, I'm not very attentive, unfortunately. I have an easier time coming up with structures than implementing them, but if I have to order coding for every little thing, I'm ruined. Small tests are still better to do by yourself.

 

J.B:

what methods or heuristics do you use to avoid out-of-bounds arrays?

A class for creating a ring buffer
 
J.B:

I have already thought about the spread accounting in the totalizer, it is an additional trick, taking into account a particular brokerage company and their quotes, I am trying to consistently solve problems so that each element of the system would be sufficiently autonomous, to be able to understand the "net contribution" of each element, and then analyze the cumulative effect.

I mentioned the spread, not to break stereotypes. In fact, there is no spread. There is just the Bid and Ask of BP. You also build ZigZags, but set tops on Bid BP, and lows on Ask BP. Then the sum of the knees will account for the"floating spread". It's really not nerdy as it may seem. Nor is it a desire to calculate super accurately where one might not. There's a point of principle here: too frequent fractures, albeit quite accurate, are evil, as it's not profitable.

I'm not a very good programmer yet and my coding speed is really disappointing, I constantly struggle with array overruns and with the fact that I haven't implemented a new calculation buffer for the indicator. Therefore 99.9% of my time is spent on technical glitches and not thinking about TC architecture, which is sad, but unavoidable.

I'm a shitty programmer too. Therefore, there's a recommendation not to conduct such studies in MQL. Use MQL only as a source of data and as a simple visualization. For analysis use the same matrix package. This will save you a lot of time and effort.

The Bid and Ask data should be available through FXOPEN ECN, FXCM, Dukascopy, or any other tick source. You should use only M1, as a compromise between speed and precision. I know that hardly anyone will bother with it, and it will still remain in MQL-frames. But you just have to answer yourself whether you want to investigate or play around.

 

Thank you! I'll give it a try)))

hrenfx:

I said about the spread, not to break stereotypes. In fact, there is no spread. There is just Bid and Ask BP. You build ZigZags in the same way, but you put tops on Bid BP, and lows on Ask BP. Then the sum of the knees will account for the"floating spread". It's really not nerdy as it may seem. Nor is it a desire to calculate super accurately where one might not. There's a point of principle here: too frequent fractures, albeit quite accurate, are evil, as it's not profitable.

I'm a shitty programmer too. Therefore, there's a recommendation not to conduct such studies in MQL. Use MQL only as a source of data and as a simple visualization. For analysis use the same matrix package. This will save you a lot of time and effort.

The Bid and Ask data should be available through FXOPEN ECN, FXCM, Dukascopy, or any other tick source. You should use only M1, as a compromise between speed and precision. I know that hardly anyone will bother with it, and it will still remain in MQL-frames. But here you just have to answer yourself, do you want to research or play around.

Thank you for the recommendation! Actually I'm following it retroactively)). I use STATICTICA and Matlab for numerical studies, sideFX Houdini for visualizations and some unusual calculations. But all the same, I have to code something quite custom at vector (array) level and operations with their components in loops. That's why I'll have to study mql5 for mt5 and most likely C# as well.

The 5-th has been chosen due to the following reasons, in order of importance to me:

1)mql5 is an analogue of C++.

And C++ is the most advanced programming language nowadays, and even in a pinch, if mt5 doesn't help me because of inadequate marketing, I can easily switch to pure C++ coding. And this experience will not be lost.

Of course, OOP in contrast to the C-like 4th, which is like power under the bonnet of a cool car, pleases as the potential to implement structurally complex projects. A procedural language would be a mind blowing, given my attentiveness and planned structural nesting of projects.

2)Mt5 is the latest version of mt.

A high probability that the next versions of mql will be also based on pluses and mt5th is being promoted to exchanges, which is a huge absolute plus and the fact that brokerage companies are not switching en masse to 5 in my opinion is a temporary phenomenon.

I also started to use mql5 and c# to implement my ideas. I have already had experience in ordering some ideas to coders, but i decided it makes sense to order only shell. And forecast blocks and MM should be done by myself. So I will have to learn languages at least to correctly give the task and correctly verify/investigate projects. This is of course only IMHO at the moment.

 

Frankly, this is a strange vision. What does the research on TzWD have to do with any platform or language? It is just research. You can do it on paper, you can do it in a C-like language and, as you rightly pointed out, in some math packages. That said, having the ability to program and import third party data and DLLs. Research and trading are completely different activities.

To play around is to spend your precious time building research infrastructure from scratch: through a programming language.

I won't argue or persuade, of course. Still assumed the thread was on the topic of research.