Please address the problem. I am an amateur I am attempting to draw a box for the bar gaping. my code in embedded in this screen shot (box effort not included because, the code drew a line, rather than a box, under each candle). The arrow indicates the last bar of a gap. The indicator looks left two bars from arrow. I would like to draw a box, rather than an arrow. TOS code link included, may need to squeeze chart to view. Examples are included in the image. Thank you http://tos.mx/ZE2KNyn
Ruby:
#Gap fill
#Roger 2/8/2022
#BearGap
def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
plot BEARS =
IsDown[2] and
IsDown[1] and
IsDown[0] and
low[2] > high[0];
BEARS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_arrow_UP);
BEARS.SetDefaultColor(GetColor(253));
# Bull Gap
def BuIsUp = close > open;
def BuIsDown = close < open;
def BuIsDoji = IsDoji();
def BuavgRange = 0.05 * Average(high - low, 20);
plot BULLS =
BUIsUp[2] and
BUIsUp[1] and
BUIsUp[0] and
high[2] < low[0];
BULLS.SetPaintingStrategy(PaintingStrategy.BOOLEAN_arrow_DOWN);
BULLS.SetDefaultColor(GetColor(253));
# End of code
Last edited: