input time1 = 1000;
input time2 = 1100;
def c = close;
def o = open;
def x1w = SecondsFromTime(time1) == 0 and c;
def h1w = if x1w == 1 then high + 1000 else Double.NaN;
def l1w = if x1w == 1 then low - 1000 else Double.NaN;
AddChart(h1w, l1w, 0, 0, ChartType.BAR, Color.WHITE);
def x1 = SecondsFromTime(time1) == 0 and c[-1];
def h1g = if c > o and x1 then high + 1000 else Double.NaN;
def l1g = if c > o and x1 then low - 0000 else Double.NaN;
AddChart(h1g, l1g, 0, 0, ChartType.CANDLE, Color.GREEN);
def h1r = if c < o and x1 then high + 1000 else Double.NaN;
def l1r = if c < o and x1 then low - 1000 else Double.NaN;
AddChart(h1r, l1r, 0, 0, ChartType.CANDLE, Color.RED);
def x2w = SecondsFromTime(time2) == 0 and c;
def h2w = if x2w then high + 1000 else Double.NaN;
def l2w = if x2w then low - 1000 else Double.NaN;
AddChart(h2w, l2w, 0, 0, ChartType.CANDLE, Color.WHITE);
def x2 = SecondsFromTime(time2) == 0 and c[-1];
def h2g = if c > o and x2 then high + 1000 else Double.NaN;
def l2g = if c > o and x2 then low - 1000 else Double.NaN;
AddChart(h2g, l2g, 0, 0, ChartType.CANDLE, Color.GREEN);
def h2r = if c < o and x2 then high + 1000 else Double.NaN;
def l2r = if c < o and x2 then low - 1000 else Double.NaN;
AddChart(h2r, l2r, 0, 0, ChartType.CANDLE, Color.RED);
#