Candlestick analysis. Pattern coding - page 4

 
IgorM:
Yes it does, but I'm sorry - the problem is solved head-on, it's not the best option to correct the ifs every time
Here if is divided into 3 groups each group is divided into 4 variants as a result there are 12 types of candlesticks that can be formed on the chart at all. As for the "brute force", try to think of your own variant but I think it will be difficult for you
 
Alexey:
Here if divided into 3 groups each group is divided into 4 variants in the end 12 types of candles that can form on the chart at all. As for the head-on, try to come up with your own variant but I think it will be a bit complicated for you
He already did that about five years ago.
 
Vinin:
He already did that about five years ago.
And in five years he hasn't made any progress?
 
IgorM:

cool!

Let me try to formalise the task: develop a method for determining the mutual positioning of bars for the 5 given examples

1. red bar Open > Close

2. in example 1, the red bar's High and the green bar's Low are insignificant or may be absent (the rest of the examples by analogy) set by a constant in pp

1. 2. 3. 4. 5.

how to effectively code this "shit" for these 5 examples?

Have you even noticed that your 4th and 5th patterns, in terms of movement pattern, are different from the 1-3rd.

The first 3 (if you don't take the shallow pullback in the 3rd) has two movements (attack-back), whereas the 4th-5th (if you take away the noise in the 5th) has 4-re movements (attack-correction-attack after correction-back).

 
Alexey:
And that in 5 years, still no progress?

I didn't have much time for programming - I worked and earned a lot, I had a mortgage to close http://www.mreporter.ru/reports/44471

Now I need some thoughts on how to describe candlestick analysis in human language, all I can do is like this:

enum Alphabet{A,B,C,D,E,NONE};
enum BarType{
   бычья_безхай_безлоу,
   бычья_схай_безлоу,
   бычья_безхай_слоу,
   бычья_схай_слоу,
   медвежья_безхай_безлоу,
   медвежья_схай_безлоу,
   медвежья_безхай_слоу,
   медвежья_схай_слоу,
};
struct OHLC{
   double open;
   double high;
   double low;
   double close;
};


Alphabet decodeBar(const OHLC &bar1,const OHLC &bar2){
   BarType res_bar1,res_bar2;
   res_bar1 = scanbar(bar1);
   res_bar2 = scanbar(bar2);
 if (res_bar1 == медвежья_безхай_слоу && бычья_схай_безлоу) return(A);
return(NONE);
}
Alphabet decodeBar(const OHLC &bar1,const OHLC &bar2,const OHLC &bar3){
return(B);
} 
BarType scanbar(const OHLC &bar){
// заглушка
return(бычья_безхай_безлоу);

like this code can change the alphabet to look for new patterns

Urain:

In the first 3 (if we exclude the shallow pullback in 3) there are two movements (attack-correction-retreat), while in 4-5 (if we remove the noise in 5) there are 4 movements (attack-correction-attack after correction-back).

You are trying to pick up a trading strategy, we are trying to describe the bars and their relative positioning, and the market context is the next step.
Креативно-шокирущий ответ кризису и морозу от девушки из Иркутска!
Креативно-шокирущий ответ кризису и морозу от девушки из Иркутска!
  • www.mreporter.ru
Время события: 26.12.2014 22:42 Место события: Иркутск, улица Нижняя Набережная Конкурс: Мы просто решили в такой шуточной форме ответить мировому кризису!!! Россия великая страна и ей не страшны ни санкции ни попытки обвалить рубль. Героиней ролика стала молодая...
 
IgorM:

I had no time for programming - I worked and earned a lot, I needed to close the mortgage

Now I need some thoughts on how to describe candlestick analysis in human language, all I can do is like this:

I think it is possible to change the alphabet to search for new patterns

Here's a thought: slicing bars can distort patterns.

The solution may be found through recalculation of bars with an offset of their onset at lower timeframes, we create several charts and at some one the necessary figure will appear (if it is there at all) and then we will be able to identify the pattern in the current one.

 
Urain:

The way out can be found through recalculation of bars with a shift of the beginning on smaller TFs, then we create several charts and the necessary pattern (if it is there at all) will appear on some of them, then we will be able to identify the pattern on the current one.

I try to find new ideas how to add new patterns (sets) or remove them from the analysis, while in this thread there were ideas how to solve this problem in one direction and with another:

Kos CandleCode

Integer to draw a horizontal grid and code by bar price position in the grid. Encode by three levels, by four, by five, etc., thus adjusting the total number of variants and accuracy.

 

If you need candlestick patterns, check out my profile.

It's all been stolen before you)

 

More thoughts.

Position 0 - second bar completely below the first.

Position 1 - all prices of the second bar are below the first bar, and the high is above the low and below the body (within the lower shadow).

Position 2 - all prices of the second bar are below the first bar and the high enters the body of the first bar.

Position 3 - all prices of the second bar are below the first bar and the high enters the upper shadow of the first bar.

Position 4 - all prices of the second bar are below the first bar and the high is above the high of the first bar.

Now the low and the bottom of the body are below the first bar, so move the top of the body, and the high. And so on and so on and so on.

We should consider how to deal with cases where the opening equals the closing of the first bar and when there are no shadows.

But this is a trifle, it will only take some effort.

1. <Low

2. >=Low and <Min(O,C).

3. >=Min(O,C) and <=Max(O,C)

4. >=Max(O,C) and <=High

5. >High

 
IgorM:

I understand it all, I'm trying to find fresh ideas on how to quickly add patterns or remove them from analysis, while in this thread there were ideas on how to solve the problem head-on, and with help:

Kos CandleCode

Integer to draw a horizontal grid and code by bar price position in the grid. Encode by three levels, by four, by five, etc., thus adjusting the total number of variants and accuracy.

To do this you need to break down the concept of a pattern into basic bricks, what does it consist of?

I suggested above the terminology of an attack a correction a pullback,

For example: an attack is a primary movement in a pattern (may be complex or simple, composed of one or more bars),

A correction differs from a pullback by the length of counter-movement relative to an attack, up to half of it is a correction, more than half is a pullback.

This is all for example :)

If you have basic patterns, you can both code them and quickly change them (for example, you change the distinction between a correction and a pullback, you get other patterns).