walkman

CM_Heikin-Ashi_Candlesticks_V1_Tops_Bottoms

272
Slightly modded hieken ashi script by chris moody, shows top and bottom pin bars.
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?
// Plots Color Of Heikin-Ashi Bars while Viewing Candlestics or Bars
//Works on Candlesticks and OHLC Bars - Does now work on Heikin-Ashi bars - But I have verified its accuracy
// Created By User ChrisMoody 1-30-2014 with help from Alex in Tech Support

study(title = "CM_Heikin-Ashi_Candlesticks_V1", shorttitle="CM_Heik-Candles",overlay=true)

haclose = ((open + high + low + close)/4)//[smoothing]
haopen = na(haopen[1]) ? (open + close)/2 : (haopen[1] + haclose[1]) / 2

heikUpColor() => haclose > haopen
heikDownColor() => haclose <= haopen

barcolor(heikUpColor() ? aqua: heikDownColor() ? red : na)

pctP = input(66, minval=1, maxval=99, title="Percentage Input For PinBars, What % The Wick Of Candle Has To Be")
pblb = input(6, minval=1, maxval=100, title="PinBars Look Back Period To Define The Trend of Highs and Lows")

spb = input(false, title="Show Pin Bars (Top/Bottom)?")


//PBar Percentages
pctCp = pctP * .01
pctCPO = 1 - pctCp


range = high - low

///PinBars
pBarUp() => spb and open > high - (range * pctCPO) and close > high - (range * pctCPO) and low <= lowest(pblb) ? 1 : 0
pBarDn() => spb and open < high - (range *  pctCp) and close < high-(range * pctCp) and high >= highest(pblb) ? 1 : 0

//PinBars
barcolor(pBarUp() ? lime : na)
barcolor(pBarDn() ? purple : na)



plotshape(pBarUp(), title= "bottom",location=location.belowbar, color=lime, style=shape.diamond, text="BOTTOM")


plotshape(pBarDn(),  title= "top", location=location.abovebar, color=red, style=shape.diamond, text="TOP")