candles by sam
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ashsam9396

//@version=5
indicator("candles by sam" , overlay= true )

A = (close < open and close [1] < open [1] and close [2] < open [2] and high < open [1] and high [1] < open [2]  and low < low[1] and low[1] < low[2])

barcolor (A ? color.yellow : na, offset = -2)
barcolor ( A ? color.yellow  : na, offset=-1)
barcolor (A ? color.yellow : na)

B = (close > open and close [1] > open [1] and close [2] > open [2] and low > open [1] and low [1] > open [2] and high > high [1] and high [1] > high [2])

barcolor (B ? color.purple : na, offset = -2)
barcolor ( B ? color.purple  : na, offset=-1)
barcolor (B ? color.purple : na)