Definition of a pin bar (indecision candle)

 

Hi,
One tool is being developed for MT4 and it analyzes most recently closed two (2) candles. The tool, as one of several features, has to correctly decide whether the most recently closed single candle, so the latter one is the latest two closed once, is so called indecision candle (Pin Bar) or not. This is important for the tool to correctly automatically analyze in order to perform upcoming operations on defined (in the tool’s setting) time frame(s).

Any type of indecision candle.

My question: I don’t like the idea of having defined whether the candle is indecision or not based on the ratio ( % ) between candle body size (height) and total size (range) of the candle. There are multiple reasons why I’m trying to avoid having ratio defined, in order for tool to decide if its indecision candle or not, but major two reasons are:

  1. sometimes upper and/or lower shadow is missing or it’s extremely long or it’s extremely small which could put the accuracy of the ratio in doubt.

  2. there is no clear rule, not ever theoretical one, that equal or below particular % is an indecision or not. E.g. body size being equal or below one third (33.3333%) of total candle size is indecision otherwise its not indecision candle. This is NOT true! There is no such valid rule about % what is indecision and what not.

Particularly for this purpose I’m trying to avoid having ratio defined. So please kindly don’t tell me to just lower the % of ratio or test multiple % values and see which one will work the best because it won’t work that way.

My question: Could you please suggest me any other way how the tool ‘‘decide’’ whether the candle is indecision or not? Analyzing the length of shadows (if not missing) won’t work either.

Thank you in advance!

 
What about body and range ratio between current and former period?


Another approach could be a tick analysis inside the period in question.
 
Andrei0: ... as one of several features, has to correctly decide whether the most recently closed single candle, so the latter one is the latest two closed once, is so called indecision candle (Pin Bar) or not ... I don’t like the idea of having defined whether the candle is indecision or not based on the ratio ( % ) between candle body size (height) and total size (range) of the candle. ...
  1. sometimes upper and/or lower shadow is missing or it’s extremely long or it’s extremely small which could put the accuracy of the ratio in doubt.

  2. there is no clear rule, not ever theoretical one, that equal or below particular % is an indecision or not...

...

As you yourself has stated, there is "no clear rule" for it. The rule that exists is that of a "visual" definition for a "Pin Bar". It is a human definition, which probably can only be approached with "fuzzy logic", not with "binary logic".

That said, you might have to include more than one ratio and have them self-adapt based on statistics of past history, taking into account the average range of a candle, the average range of a body, location of bar in comparison to other bars, etc. and then building up those values to have it calculate the probability of it being a pin bar.

This is obviously just speculation of a different approache, because there is "no clear rule" for it!

 
Dominik Egert:
What about body and range ratio between current and former period?


Another approach could be a tick analysis inside the period in question.

Dominik: by ''period'' did you mean two different time frames (option1) or did you mean two different (most recently closed) candles on the same time frame (option2)? How would either of those work? E.g. if doing option2, how could you know that body size of previous candle (so the first one of of two most recently closed) would have anything to do with finding out whether the second one (the most recently closed) is indecision or not? I don't understand what previous candle's body would have anything to do with second one (indecision or not)? If you meant option1 then I would appreciate some suggestion what exactly you meant here? And how would such tick analysis, in your other approach, work? Do you know any third solution?

Fernando Carreiro:

As you yourself has stated, there is "no clear rule" for it. The rule that exists is that of a "visual" definition for a "Pin Bar". It is a human definition, which probably can only be approached with "fuzzy logic", not with "binary logic".

That said, you might have to include more than one ratio and have them self-adapt based on statistics of past history, taking into account the average range of a candle, the average range of a body, location of bar in comparison to other bars, etc. and then building up those values to have it calculate the probability of it being a pin bar.

This is obviously just speculation of a different approache, because there is "no clear rule" for it!

Fernando, location of the candle has zero relevance when it comes to finding out whether this candle is indecision or not. Not sure about average range of candle because I don't know what exactly you mean here when it comes to calculating average ranges, with or without shadows (if any). I'm trying to understand, in your suggestion of averange range, how would other candles have any impact on the one being analyzed to find our whether it's indecision or not but I can't come up with any idea.

I got one more idea: Having one parameter per each time frame and updating it (e.g. saved Settings file of the custom tool) whenever I want. I would visually analyze for past X time period on wanted time frame, whatever I consider as indecision candle. Then this visual observation of past candles would get me an idea about maximum allowed height of candle body (quantity of pips) in order to candle to be considered as indecision one. But such idea would not always work anyway. I'm afraid that I would end up with having the tool not defining the candle as indecision one but it should be. Secondary problem: A challenge could also occur when it comes to length of shadow(s). Secondary challenge could also occur when it comes to missing shadows. Some indecision candles may be still defined like that even if having extremely low upper/lower shadow or no shadow.

 
Periods is referring to the same timeframe. I use the term just like you did in the last post.

Markets are a reflection of 4 parties participating.
Want to be Bulls
Want to be Bears

Are Bulls
Are Bears

Two of them want price to go up, the other two want price to go down.

Want to be Bears and Bulls, both want the price to go up. And vice versa. Want to be = Pending orders.

Market always goes to the liquidity level. It is a natural flow, just like water going down a hill.

Depending on this, you get a "battle" and the question is who will have more power.

This is not bound to time periods, but to supply and demand.

When looking at ticks, the way the battle goes can be seen there.

So let's say you have 3 consecutive bear periods and now a "dojy" period.

This means either the bears have run out of strength or the bulls were able to hold the bears back for a moment.

Neither will tell you which direction the flow will go from here. Except of course you can determine where the liquidity levels are (stronger or bigger).

So as you take a look at the details of the current outcome of the battle, the overall structure/regime of the market is as important.

That's why a look at the overall market and the surrounding of a particular period has lots of influence on the current ongoing.

Also, this is depending on who participates the market currently, Asia, Europe, USA.

It is an overall reflection of smaller and larger participants, providing supply and demand to the market.

All this goes into your decision of making a period be an indecision period.

And by the way, maybe you notice this, markets have three states, contraction, expansion and range. Such an indecision period needs to be evaluated different depending on where it shows up.


 
Dominik Egert:
Periods is referring to the same timeframe. I use the term just like you did in the last post.

Markets are a reflection of 4 parties participating.
Want to be Bulls
Want to be Bears

Are Bulls
Are Bears

Two of them want price to go up, the other two want price to go down.

Want to be Bears and Bulls, both want the price to go up. And vice versa. Want to be = Pending orders.

Market always goes to the liquidity level. It is a natural flow, just like water going down a hill.

Depending on this, you get a "battle" and the question is who will have more power.

This is not bound to time periods, but to supply and demand.

When looking at ticks, the way the battle goes can be seen there.

So let's say you have 3 consecutive bear periods and now a "dojy" period.

This means either the bears have run out of strength or the bulls were able to hold the bears back for a moment.

Neither will tell you which direction the flow will go from here. Except of course you can determine where the liquidity levels are (stronger or bigger).

So as you take a look at the details of the current outcome of the battle, the overall structure/regime of the market is as important.

That's why a look at the overall market and the surrounding of a particular period has lots of influence on the current ongoing.

Also, this is depending on who participates the market currently, Asia, Europe, USA.

It is an overall reflection of smaller and larger participants, providing supply and demand to the market.

All this goes into your decision of making a period be an indecision period.

And by the way, maybe you notice this, markets have three states, contraction, expansion and range. Such an indecision period needs to be evaluated different depending on where it shows up.


I appreciate your response, thank you but you might have misunderstood the purpose of an initial message. I was asking how to decide, from development point of view, whether the candle is indecision or not ( * ) but to avoid having ratio between candle body vs. entire candle defined. Wrong defined ratio could result into huge inaccuracy of tool's functionality: having defined a candle as indecision but it's not or vice versa.

( * ) any type of indecision candle and not only particular type (e.g. doji)

 
Andrei0:

I appreciate your response, thank you but you might have misunderstood the purpose of an initial message. I was asking how to decide, from development point of view, whether the candle is indecision or not ( * ) but to avoid having ratio between candle body vs. entire candle defined. Wrong defined ratio could result into huge inaccuracy of tool's functionality: having defined a candle as indecision but it's not or vice versa.

( * ) any type of indecision candle and not only particular type (e.g. doji)

Both @Dominik Egert and I understand you perfectly and know full well that a simple body to shadow ratio is not enough to define a Pin Bar, and that it is necessary to complement that with extra information and metrics.

Both of us gave you two completely different ways as possible solutions to tackle the problem, but you have told us that we are wrong or that we don´t understand you!

What else would you like us to say then?

 
Maybe take a look at the HEX Hiking Ashi Indicator from code base and see how it displays indecision periods in the market.

Maybe this gives you a starting point.

Another approach could be to study candlestick patterns. As you will see, there are a lot of them and none does give certain signals. Only an estimate can be derived with a probability.

Interesting is the fact, the more periods a pattern is made of, the better it's probability to be a good estimation.

You could of course try to be more precise with the question you have asked, maybe it is not us misunderstanding and therefore our issue, but your challenge to ask the right questions for it to be solved?!

Could that possibly be?
 

Another way of asking my initial question, which is How to find out whether the candle is indecision one, of any type, but avoid having to define the ratio between size of candle's body and full size of candle (including shadows if any), Would be:

What kind of reliable and accurate guarantee can be developed that the candle is the one which is moving the market and NOT the one where bears and bulls cannot decide which way to go?

By this secondary question, I could get feedback on ''anything else other than your answer, can be considered as indecision candle''

But this secondary question is by far more confusing and it has by far more possibilities of answers. I personally prefer by far just clear definition, without a ratio, of when/how can be candle considered as indecision.

 
Andrei0: I personally prefer by far just clear definition, without a ratio, of when/how can be candle considered as indecision.

Unfortunately, you will not find a clear mechanical definition for a candle to be classified as indecision. It is a subjective, “fuzzy” quality. We can only truly say it for certain after the fact, because we cannot predict the future. All we can do is approximate its probability, based on things like the “tick” behaviour, volume weight, location and historical statistical metrics of other bars.

Just think about it! If there were a clear mechanical why to define when a bar signals indecision guaranteed, we would ALL be very rich!

So, take some time to think about all of what was said and try to implement as much of what you could understand and continue to study candle stick formations, naked price action trading.

However, I would like to leave you with some wisdom about my experiences with EAs.

In the beginning I tried to implement many strategies that I knew for a FACT were profitable in the hands on manual traders. But I never could do it well. I kept at it believing that I was just doing it incorrectly.

With time I became wiser about the reason. They were “manual” strategies that depended on “human” evaluations also know mathematically as “fuzzy logic”. But computers and coding require precise logic and binary decisions. It just is not very good at “human” strategies.

So, I abandoned all those, and came up with strategies that were good for computers but bad for humans. Strategies that were built on precise mathematical and statistical concepts. Things that humans just cannot do well, yet machines do very well. And I became profitable.

Now, I only use those types of strategies. I will not even consider any of the strategies floating about that were created for manual trading. For me, they are a waste of time and effort. I concentrate only on developing mathematical, statistical EAs combined with proper money management also based on mathematical principals.

Let humans trade with “human” strategies! Let machines trade with “machine” strategies!

 
Good statement Fernando.

In fact it could show profitable to do a coin flip on such a candle to make the decision in which direction the market would go from such a candle.