Capeya Bar Color
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sekiyo

//@version=5
indicator("Capeya Bar Color", overlay=true)

//INPUTs
isC2C = input.bool(false, "Close to Close")
isDol = input.bool(false, "Dollar Volume")
thsld = input.float(1.0, "Threasold")
Color_Up = input.color(color.blue, "Bullish Color")
Color_Do = input.color(color.fuchsia, "Bearish Color")

Volume = isDol ? volume * close : volume

isbullish = isC2C ? close[1] <= close and Volume > thsld * Volume[1] : open <= close and Volume > thsld * Volume[1]
isbearish = isC2C ? close[1] > close and Volume > thsld * Volume[1] : open > close and Volume > thsld * Volume[1]

//PALETTEs
Palette_Vol = isbullish ? Color_Up : isbearish ? Color_Do : na

barcolor(Palette_Vol)