REM HULL CANDLES
//@version=4
// Pine Script v4
// @author BigBitsIO
// Script Library: https://www.tradingview.com/u/BigBitsIO/#published-script
//study("Hull Candles [BigBitsIO]", overlay=true
//adapted for Prorealtime v11.1 platform by bolsatrilera
len = 10//input(10, minval=1, title="Length")
lenBodyColor =10// input(10, minval=1, title="Body Color HMA Length")
lenClose = 1 // input(1, minval=1, title="Close length")
// I have consolidated some of this code from a prior example
o = HullAverage[len](open)
c = HullAverage[len](close)
hi =HullAverage[len](high)
l =HullAverage[len](low)
ohlcFour =HullAverage[lenBodyColor]((open+high+low+close)/4)
if ohlcFour > ohlcFour[1] then
drawcandle(o, hi, l, c) coloured (0,255,0) bordercolor (0,0,0)
else
drawcandle (o,hi,l,c) coloured (255,0,0) bordercolor (0,0,0)
endif
SMA =average[lenClose](close)
return SMA coloured(0,0,250)as "Close SMA"