Question about declare hide_on_intraday

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);
 
Solution
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);

you might have to add a condition to...
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);

you might have to add a condition to check the agg time of the chart

Code:
def chartagg = getAggregationPeriod();
input agg_limit = AggregationPeriod.DAY;
def enable = if ( chartagg < agg_limit ) then 0 else 1;

addchartbubble(enable, low,"test", color.cyan, no);
 
Solution
Thanks for your help @halcyonguy. You meant to add below three lines of code before addchartbubble statement in in my script?
def chartagg = getAggregationPeriod();
input agg_limit = AggregationPeriod.DAY;
def enable = if ( chartagg < agg_limit ) then 0 else 1;

I tried, still seeing the bubbles on intraday chart. Why "declare hide_on_intraday;" didnt work?
 
Thanks for your help @halcyonguy. You meant to add below three lines of code before addchartbubble statement in in my script?
def chartagg = getAggregationPeriod();
input agg_limit = AggregationPeriod.DAY;
def enable = if ( chartagg < agg_limit ) then 0 else 1;

I tried, still seeing the bubbles on intraday chart. Why "declare hide_on_intraday;" didnt work?
yes add my code at the top of your study.
but it won't do anything until you edit all the bubble codes, by adding ( enable and ) to the first parameter of each

AddChartBubble( enable and gapUp > gap , dailyOpen, "Up" + gapUpv , color.LIGHT_GREEN , no);
AddChartBubble( enable and gapDw > gap , dailyOpen, "Dw" + gapDwv , color.LIGHT_RED , no);


the programming behind the scenes in tos that controls bubbles and labels is sloppy.
they don't behave as they should.
if you disable a loaded study with bubbles and labels, they will still appear on the chart.
edit studies > click gear icon of a loaded study > and uncheck show study
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
282 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top