The perfect filter - page 8

 
hrenfx:
It is better to do without stupid spreads, because you will avoid a lot of stupid nuances at once. If we talk about the catch, it is unrealistic without the source code.

Ok, I'll try to do with floating, that is, separately with bid asc rows.

I can lay out the source code, but I should warn you, it may not be optimal and very dirty (( I originally had a quick idea in another package, and when it appeared to be potentially interesting, I tried to rewrite it in MT5, so don't try to fool me, please...

If you want to check how the indicator reaches the processing step, you should use VIZ_buf switch for visualization of arrays that will subsequently generate logic, to quickly see the picture and control glitches, if some array suddenly will not work due to some idiotic reason like array overrun.

Files:
va_sum.mq5  6 kb
vaMACl.mq5  4 kb
 

It would, of course, be desirable to explain the logic behind this calculation of the four EMA 'derivatives' which are then added together:

vel = array[bar]-array[bar-period_div];
acc = array[bar]-2*array[bar-period_div]+(array[bar-period_div*2]+array[bar-period_div/2])/2;
aaa = array[bar]-3*array[bar-period_div]+3*(array[bar-period_div*2]+array[bar-period_div/2])/2-(array[bar-period_div*3]+array[bar-period_div/3])/2;

outBuffer[bar]=array[bar]+vel+acc+aaa/3;

Logically, for example, for the second derivative it should be like this:

acc = array[bar]-2*array[bar-period_div]+array[bar-period_div*2];

And in general, of course, the periods in the EMA are totally confusing as there are no periods in the EMA in fact. Take three input parameters for the three price derivatives: exponential coefficients (0 - 1):

Price = (Bid + Ask) / 2; // в FXOPEN есть *_Avg -символы.

EMA1[n] = EMA1[n - 1] * Koef1 + Price * (1 - Koef1);
EMA2[n] = EMA2[n - 1] * Koef2 + EMA1[n] * (1 - Koef2);
EMA3[n] = EMA3[n - 1] * Koef3 + EMA2[n] * (1 - Koef3);  
 
hrenfx:

It would, of course, be desirable to explain the logic behind this calculation of the four EMA 'derivatives' which are then added together:

vel = array[bar]-array[bar-period_div];
acc = array[bar]-2*array[bar-period_div]+(array[bar-period_div*2]+array[bar-period_div/2])/2;
aaa = array[bar]-3*array[bar-period_div]+3*(array[bar-period_div*2]+array[bar-period_div/2])/2-(array[bar-period_div*3]+array[bar-period_div/3])/2;

outBuffer[bar]=array[bar]+vel+acc+aaa/3;

These were originally relatively "pure "derivatives" of sorts:

vel = array[bar]-array[bar-period_div];
acc = array[bar]-2*array[bar-period_div]+array[bar-period_div*2];
aaa = array[bar]-3*array[bar-period_div]+3*array[bar-period_div*2]-array[bar-period_div*3];

but through a happy inattention I made the mistake of dividing instead of multiplying like:

vel = array[bar]-array[bar-period_div];
acc = array[bar]-2*array[bar-period_div]+array[bar-period_div/2];
aaa = array[bar]-3*array[bar-period_div]+3*array[bar-period_div/2]-array[bar-period_div/3];

The funny thing is that these are not "derivatives" but the effect was better than the more real "derivatives", I didn't even notice the mistake, so then I averaged both variants)))))))))))) The result is true alchemy.

I can make a lot of such filters, just this one here as an example of rather simple logic. The essence of reflection is to find criterion of optimality of filtering and generation of signals from filtered BP.

Although the very fact that the offset due to increments increases the quality of filtering speaks volumes...

And in general, of course, the periods in EMA are very confusing, because there really are no periods in EMA. Take three input parameters for three price derivatives: exponential coefficients:

Price = (Bid + Ask) / 2; // в FXOPEN есть *_Avg -символы.

EMA1[n] = EMA1[n - 1] * Koef1 + Price * (1 - Koef1);
EMA2[n] = EMA2[n - 1] * Koef2 + EMA1[n] * (1 - Koef2);
EMA3[n] = EMA3[n - 1] * Koef3 + EMA2[n] * (1 - Koef3);  

Thanks, I'll give it a try.

I want to start with understanding what else besides bids and commissions should be taken into account and how exactly it should be quantified. There is no BP slippage))) what is the value to subtract or shift in time for statistically correct calculation of this effect. Because different people say different things about it, some say a minute on average, others a second, etc. I don't know who to believe. I understand that it may almost slip on demo or low-deposit real account, but not on training deposit, what kind of delays to expect?

 

The quality of execution depends on many factors. Your filter check is based on a "channel" strategy, i.e. it is implemented via limiters that slide exclusively to the plus side, but are also sometimes rejcted. Since the answer to this question directly and significantly affects trading results, I studied the subject a little, I even offered some ideas.

To sum it up: in case of FXOPEN ECN you can assume that BP slippage is a zero constant, and there are no rebates. I.e. consider only the only trading cost - commission.

 
hrenfx:

Your filter check is based on a "channel" strategy, i.e. it is implemented via limiters that slip exclusively in the plus side, but are sometimes also redirected.

Is the channel strategy losing on the flat and stripping the trend? And how can this type of strategy be implemented by limiters if the inflection point of ZZ is calculated on the fly when momentum turns and a market order should be sent immediately? Actually it is the opposite, it is a trend strategy on market orders. How do you know where the Momentum turn will be so you can place a Limit order there?

I DO NOT KNOW WHO I SHOULD TRUST:

First of all, I would like to understand what else besides bids and commissions should be considered and how to do it quantitatively. There is no BP slippage))) what is the value to subtract or shift in time to correctly take into account this effect statistically. Because different people say different things about it, some say a minute on average, others a second, etc. I don't know who to believe. I understand that it may almost slip on demo or low-deposit real account, but not on training deposit, what kind of delays to expect?

If you are a beginner, you may be more comfortable with indicators at the beginning, in principle, they are not bad at all, but it's a transitional stage till you learn to do without them. I mean all these filters like JJMA and the like to use as a base for strategy building is a perversion. They are just for show and tell for beginners. The main thing is not to get stuck. The subject of "perfect filter" hints at this kind of stuckness. It's dangerous, you can get stuck as a beginner for a long time.

Pivot points in trends of any order, calculated by a combination of pattern recognizers, in principle, one filter + a signal calculator, logically we can reduce it to one pattern, but firstly it makes no sense, and secondly these patterns should be constantly updated with new data, we will have to dozens of filters to get closer to the right logic, which will lead to confusion. So, filter but remember that this is just fun.

ZZY: About "zero" slippage and other you have to learn yourself in practice, you can not learn about it on the forum, it is learned only through an adequate drain. But if you emphasize the main factor, it's how long the capital will be enough to bear long spikes and all sorts of "spikes" that you are filtering out now in order not to close frequently with a loss or Kolyan, then the fact that in real trading the guys from DC just like you approximately know where people will place orders and expand the bid ask, for them it is the same creative work as you do when creating TS. I'm not saying it's an insurmountable obstacle, but you need to understand that the "grail" is very temporary and certainly can't be built on filter(s), or rather it's complicated and redundant.

 

J.B:

First of all, I would like to understand what else besides bid/ask slippage and commission to take into account and how exactly to do it quantitatively. There is no BP slippage))) what is the value to subtract or shift by how much time in order to take into account this effect in a statistically correct way. Because different people say different things about it, some say a minute on average, others a second, etc. I don't know who to believe. I understand that it may almost slip on demo or low-deposit real account, but not on training deposit, what kind of delays to expect?

Here is the slippage statistics for FXOpen - real account, 0.3 lot, number of trades for each instrument is about 20 on average, except EURAUD.


 
m.butya:

Is a channel one losing on the flat and bucking the trend?

No. A "channel" TS is one that can be implemented through limiters. As a rule, it is an overturned TS.

And how can this type of strategy be implemented by limiters if the inflection point of ZZ is calculated on the fly when the momentum unfolds and a market order has to be sent immediately?

In this case the inflection point is this condition:

// 0 - текущее состояние, 1 - предыдущее, 2 - предпредыдущее, ...
if ((Filter[0] < Filter[1]) && (Filter[1] > Filter[2]))
  Sell();
else if ((Filter[0] > Filter[1]) && (Filter[1] < Filter[2]))
  Buy();

Since at any moment of time the method of Filter function calculation as well as its previous values (at points 1, 2, etc.) are known, nothing prevents us from calculating the nearest price from the current one when one of the above mentioned conditions is met. The limiter is set at this calculated price. I.e., everything is done in advance, without waiting for the signal.

I am ready to answer further questions only here.

When I started the trading robot I was trying to guess what the price would be, but I failed to find out the difference. But if you emphasize the main factor, it's how long the capital will be enough to bear long spikes and all sorts of "spikes" that you are filtering out now in order not to close frequently with a loss or Kolyan, then the fact that in real trading the DC guys as well as you approximately know where people will place orders and expand the bid asc there, it is the same creative work for them as for you in creating TS. I'm not saying it's an insurmountable obstacle, but you have to understand that the "grail" is very temporary and certainly cannot be built on a filter(s), or rather it's complicated and redundant.

You can actually learn a lot on the forum if you ask a knowledgeable person. Use ECN/STP and you won't even dream of the "DC guys".
Арбитражеры - форум трейдеров • Вход
  • arbitrageurs.ru
Для входа на конференцию вы должны быть зарегистрированы. Регистрация занимает всего несколько минут, но предоставляет вам более широкие возможности. Администратором конференции могут быть установлены также дополнительные привилегии для...
 
hrenfx:

No. 'Channel' TC - which can be implemented through limiters. As a rule, it is a rollover TS.

I apologise for interjecting, but I would like to be more specific about the "channel" strategy and limit orders. Correct me if I am wrong:

"Channel" strategy is when an oscillation occurs relative to some conditional "point of attraction", an attractor, which can be calculated as MO BP or similar. The RMS (or something similar to the oscillation amplitude) is the channel boundary and limit orders are placed there in the opposite direction with TPs at the opposite boundary. Volatility is expected to persist and therefore "bounce" from the boundaries.

"Limit orders are less sensible in this case because we don't know the expected point of consolidation (correction) where we may take a hold and open a new position in the same direction before the trend reverses.

Am I right to think that it is better to use market orders on a trend and limit orders on a channel? Or, should we also use limit orders on the trend based on the assumption that the consolidation points are proportional to the previous spikes and/or the width of the volatility channel? And should the orders be placed ahead of time?

I am a bit confused... The strategy type cannot be changed depending on the order type, as I understand it. For example, if we work with Limits during a trend, it will not make the strategy similar to a "channel" one, will it? Or am I mistaken?

Thank you.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
lucky_teapot:

Please do not take offence, but be understanding:

hrenfx:

Further questions can only be answered here.

 
hrenfx:

No. A "channel" TS - which can be implemented through limiters.

This is your personal classification. In the classical sense, a channel strategy is a strategy based on the assumption that a reversal will happen on the channel boundaries, which has nothing to do with the type of orders. You can trade with limit orders during a trend and market orders during a flat, the only difference is that the limit ones are put in the book earlier and work out faster, all other things being equal relatively to the market ones.

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5