English

## Pin Bar

 63 omissamf 2016.05.07 17:48   Hi guys, I have a problem with the code.I want to find the Pinbar (1) as in the picture excluding the Pinbar (2).I would say that the length of the shadow must be> = 3 times the length of the Candlestick Body.I wrote this code but it does not work.```   ....... myPoint *= 10;        if(MathAbs(Open[i] - Close[i]) <= 0.3 * myPoint        && Open[i] < Close[i]        && High[i] >=  MathAbs(Open[i] - Close[i]) * 3       )        ..................            ```I need your help, thank you all, Massimo.
 13009 WHRoeder 2016.05.07 19:01 #   omissamf: I would say that the length of the shadow must be> = 3 times the length of the Candlestick Body.``` if(MathAbs(Open[i] - Close[i]) <= 0.3 * myPoint            |1.23450 - 1.23490 | <= 0.3 * 0.0001              0.00040            <= 0.00003```o-c <= 3 points? That's not your definition.`&& Open[i] < Close[i]`What does the color of the candle have to do with it? That's not your definition.Code it exactly what you said:```double upperBody   = MathMax(Open[i], Close[i]); double bodySize    = MathAbs(Open[i] -Close[i]); double upperShadow = High[i] - upperBody; if(upperShadow >= 3 * bodySize)```Write self-documenting code. The == operand. - MQL4 forum
 63 omissamf 2016.05.08 00:41 #   Hello WHRoeder, I tried your code and it works well. But I would also define the length of the lower shadow. I thought to use your modified code, but do not understand where I'm wrong.  ```      double upperBody   = MathMax(Open[i], Close[i]);       double downBody   = MathMin(Open[i], Close[i]);       double bodySize    = MathAbs(Open[i] -Close[i]);       double upperShadow = High[i] - upperBody;       double downShadow  = Low[i] - downBody;      if(upperShadow >= 3 * bodySize      && downShadow <= 1 * bodySize      && bodySize > 0      )``` Thanks for everything, Massimo.
 8 awran5 2016.05.08 07:53 #   omissamf: Hello WHRoeder, I tried your code and it works well. But I would also define the length of the lower shadow. I thought to use your modified code, but do not understand where I'm wrong.Thanks for everything, Massimo.just put downBody before Low[i]`double downShadow  = downBody -Low[i];`