'First hammer candle of the day
I would like to be notified/mark on the first 15 min hammer candle of the day. Could someone help me with the pine script for this. I am only interested in the first hammer candle and not every hammer candle in the day.
Here is the code:
//@version=3
study("Hammer Scanner", overlay=true)
//input variables
//input variables
hammerBodyHeight = input(title="Hammer Body, Max Height (Pips)",type=integer,minval=1,maxval=100,step=1,defval=300,confirm=false)
shadow = input(title="Body, Max Proportion of Tail (Fraction)", type=float,minval=0.01,maxval=1.0, step=0.01, defval=0.33, confirm=false)
tail = input(title="Shadow, Max Proportion of Body (Fraction)", type=float,minval=0.01,maxval=1.0, step=0.01, defval=0.5, confirm=false)
//scanner algorithms
hammer = (abs(close - open) / syminfo.mintick <= hammerBodyHeight) and (close > open) and ((close - open) < (open - low) * shadow) and ((high - close) <= (close - open) * tail)
//chart plotters
plotshape(hammer, style=shape.flag, location=location.abovebar, color=green, text='Hammer')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
