Candlestick analysis. Pattern coding - page 6

 
Integer:
Did you read my post at all, did you understand at all what it said? I don't think I did. I'm sorry.
About the combination of the candles, if you don't want to.
 
Urain: For that, we need to break down the concept of a pattern into its basic building blocks, what does it consist of?

Well, the pattern is not important yet, the important thing is the methodology of how you can analyze 2 or 3 candles next to each other

Urain:

Having basic patterns, you can both code them and quickly change (e.g. change the condition between correction and pullback, get other patterns).

Yes, it's the coding of the basic models that is interesting

i haven't dealt with mql for several years, now mql5 seems to be a very strong programming language, so i want to discuss some constructions, for example to compare two patterns by operator reloading? - i want to get some code where semi-human semi-formalized language to communicate with MetaEditor to search for candlestick combinations - and where to use this search - in Japanese candlesticks or in patterns or in settaps - this is another level

hopefully Integer will give us a code so we may understand his thinking :)

 
IgorM:

Well, the pattern is not important yet, the important thing is the methodology of how you can analyze 2 or 3 candles next to each other

Yes it is the coding of basic patterns that is interesting

i haven't dealt with mql for some years, now mql5 seems to be a very strong programming language, so i want to discuss some constructions, for example maybe to compare two patterns using operator reloading? - i want to get some code where semi-human semi-formalized language to communicate with MetaEditor to search for candlestick combinations - and where to use this search - in Japanese candlesticks or in patterns or in settaps - this is another level

so far the hope lies with Integer : let's hope he will give us the code so we may understand his thinking :)

There is a NS SOM (Roch posted), code the patterns (code the recognition of the basic bricks, their interaction will encode the pattern) and on the recognition in SOM.
 
Urain: There is a NS SOM in the catbase (Roch posted)
give me the link, I was not able to find it
 
IgorM:
give me the link, I couldn't find it with my search
Sorry not in the catbase, it was an article with the code https://www.mql5.com/ru/articles/283
Использование самоорганизующихся карт Кохонена в трейдинге
Использование самоорганизующихся карт Кохонена в трейдинге
  • 2011.05.25
  • MetaQuotes Software Corp.
  • www.mql5.com
Важной особенностью самоорганизующихся карт Кохонена (Kohonen Self-Organizing Maps) является их способность отображать многомерные пространства признаков на плоскость. Представление данных в виде двумерной карты значительно упрощает кластеризацию и корреляционный анализ данных. В этой статье мы разберем несколько простых примеров практического использования карт Кохонена.
 

Good evening everyone. I'll try to explain how I did it:

1. I didn't represent the candlestick as OHLC, but used "abstractions", i.e. upper shadow, lower shadow, body. I determined the following parameters of the candlestick:

struct DATA_CDL                                 // Структура хранения данных о свече 
        {                                       // ups - в.тень, dns - н.тень, bd - тело
         double cdl_max;                        // Максимум свечи/верхней тени
         int ups_diap;                          // Размер верхней тени, п
         double bd_max;                         // Максимум тела/минимум верхней тени
         int bd_diap;                           // Размер тела, п
         double bd_min;                         // Минимум тела/максимум нижней тени
         int dns_diap;                          // Размер нижней тени, п
         double cdl_min;                        // Минимум свечи/нижней тени
         int cdl_size;                          // Размер свечи, п
         int type;                              // Тип тела свечи (0-восходящая, 1-нисход, 2-доджи)
         datetime time;                         // Время формирования свечи
        };

after the formation of the candle we run it through the function which determines its parameters;

2. Take into account the average size of candlesticks for the period (to filter out too big/small patterns);

3. Then we take the pattern and describe its bullish/bearish/flattish variants (depending on the pattern) - as we see: the first candle is ascending, the second one is descending, the body of the first candle is bigger than that of the second one, both candles are at least average value (or N points) of the day, etc;

4. describe for each pattern several variations in accuracy (accuracy 1 - the most accurate, 2 - less accurate, etc.);

5. And, of course, put it all into an indicator for easy access and display;

As a result, we have a figure (as mentioned above - the number is taken from the enumeration), direction (bullish, bearish, flat) and accuracy (1, 2, 3...). Something like this.

 
Tapochun:

Good evening, everyone. I'll try to explain how I did it.

1. I didn't represent the candlestick as OHLC, but used "abstractions", i.e. upper shadow, lower shadow, body. I defined the following parameters of the candlestick:

Waiting for continuation
 
Vinin:
Waiting for the sequel.
Yes, a little early on pressed to add...)
 

Here's

Coding of the relative positions of the two bars. Code from 0 to 69, total of 70 options. Gap down - code 0, gap up - code 69.

Files:
 
Integer:

Here

Coding of the relative positions of the two bars. Code from 0 to 69, total of 70 options. Gap down - code 0, gap up - code 69.

Phenomenal! Yes it is, but I think it's better drawn like this:

thanks, I'll look into it, if you do the same code for a 3 bar sequence, then you can "code" all the historical data in any bar sequence:

2, 3, (2+2) = 4, (2+3) = 5, (3+3 || 2+2+2) = 6, ......