Pin bar detection

Category: Indicators By: Doctrading Created: April 27, 2016, 10:11 AM
April 27, 2016, 10:11 AM
Indicators
7 Comments

Hello,

This is just an easy but effective code, to detect pin bars.
“Shooting stars” = bearish pin bars

“Hammer” = bullish pin bars

I don’t consider the color of the candle, but the size of the wick.

Have a good trading !

I wrote this code in order to test a strategy.

This strategy fails, but not the indicator code.

shootingstar = 0
hammer = 0

IF (high - low) > 2* abs(close - open) THEN   // définition d’une pin bar (étoile filante ou marteau)

 IF (open - low) < 0.3*(high - low) OR (close - low) < 0.3*(high-low) THEN
  shootingstar = -1
 ENDIF
 IF (high - open) < 0.3*(high - low) OR (high - close) < 0.3*(high-low) THEN
  hammer = 1
 ENDIF
ENDIF


return shootingstar as "Shooting Star", hammer as "Hammer"

 

Download
Filename: PIN-BARS.itf
Downloads: 404
Doctrading Master
Hello, I'm Marc. Nice to meet you.
Author’s Profile

Comments

Logo Logo
Loading...