Bar Bodies [vnhilton]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vnhilton
//@version=5

//This script uses the low wick to represent the candlestick body (high wick isn't used)
indicator('Bar Bodies [vnhilton]', overlay=true)


//The low wick's created from the low to the open/close for green/red candle respectively
l = close >= open ? open : close

//Candle body will start from high always, so needs to be closed at the close/open for green/red candle respectively
c = close >= open ? close : open

//Low wick color based on green/red candle
barColor = close >= open ? color.lime : color.red

//Plot low wick
plotcandle(high, high, l, c, color=na, wickcolor=barColor, bordercolor=na)