BigBenChannel
New member
New to Thinkscript. Trying to plot bubble for gaps only on day chart, made "declare hide_on_intraday;" as first statement, but still have many bubbles on intraday charts. Thanks for your help.
declare hide_on_intraday;
input gap = 10.0;
def dailyOpen = open(period = AggregationPeriod.DAY);
def gapUp = (dailyOpen/close(period = AggregationPeriod.DAY)[1] - 1)*100;
def gapDw = (close(period = AggregationPeriod.DAY)[1]/dailyOpen - 1)*100;
def gapUpv = round(gapUp,1);
def gapDwv = round(gapDw,1);
def newDay = GetYYYYMMDD() != GetYYYYMMDD()[1];
AddChartBubble(gapUp > gap, dailyOpen, "Up" + gapUpv,color.LIGHT_GREEN,no);
AddChartBubble(gapDw > gap, dailyOpen, "Dw" + gapDwv,color.LIGHT_RED,no);
declare hide_on_intraday;
input gap = 10.0;
def dailyOpen = open(period = AggregationPeriod.DAY);
def gapUp = (dailyOpen/close(period = AggregationPeriod.DAY)[1] - 1)*100;
def gapDw = (close(period = AggregationPeriod.DAY)[1]/dailyOpen - 1)*100;
def gapUpv = round(gapUp,1);
def gapDwv = round(gapDw,1);
def newDay = GetYYYYMMDD() != GetYYYYMMDD()[1];
AddChartBubble(gapUp > gap, dailyOpen, "Up" + gapUpv,color.LIGHT_GREEN,no);
AddChartBubble(gapDw > gap, dailyOpen, "Dw" + gapDwv,color.LIGHT_RED,no);