#### CapitaineFlam88

##### Member
Here is my code, but it's not working.
Invalid statement: if at 80:1

Code:
``if LowHighLHCP >= 5 then AddChartBubble( LowHighLHCP, high, "5");``

Solution
I think this work.
But I would like to have green bubble when the candle is green and red bubble when the candle is red.

def agg = AggregationPeriod.DAY; #mets l'aggregation temporairement à 1 min.
def LowHighLHCP = Round ((high - low) / low * 100);
#AddLabel (yes, "LHC %: " + LowHighLHCP + " ", if LowHighLHCP >= 5 then Color.RED else Color.GRAY);

AddChartBubble( (LowHighLHCP >= 5), low, "5", Color.RED, yes );

this study will change the color of the bubble.
it checks if the candle is up or down, then uses an if-then in the bubble code to determine the color.

Code:
``````def agg = AggregationPeriod.DAY; #mets l'aggregation temporairement à 1 min.
def LowHighLHCP = Round ((high - low) / low * 100);
#AddLabel (yes, "LHC %: " +...``````
Here is my code, but it's not working.
Invalid statement: if at 80:1

Code:
``if LowHighLHCP >= 5 then AddChartBubble( LowHighLHCP, high, "5");``
Thanks, is there a reason the bubbles won't show in 1 min aggregation period?

Thanks, is there a reason the bubbles won't show in 1 min aggregation period?

There's nothing to prevent chart bubbles from showing on any timeframe. You should check whether the condition you specified was met.

I think this work.
But I would like to have green bubble when the candle is green and red bubble when the candle is red.

def agg = AggregationPeriod.DAY; #mets l'aggregation temporairement à 1 min.
def LowHighLHCP = Round ((high - low) / low * 100);
#AddLabel (yes, "LHC %: " + LowHighLHCP + " ", if LowHighLHCP >= 5 then Color.RED else Color.GRAY);

AddChartBubble( (LowHighLHCP >= 5), low, "5", Color.RED, yes );

I think this work.
But I would like to have green bubble when the candle is green and red bubble when the candle is red.

def agg = AggregationPeriod.DAY; #mets l'aggregation temporairement à 1 min.
def LowHighLHCP = Round ((high - low) / low * 100);
#AddLabel (yes, "LHC %: " + LowHighLHCP + " ", if LowHighLHCP >= 5 then Color.RED else Color.GRAY);

AddChartBubble( (LowHighLHCP >= 5), low, "5", Color.RED, yes );

this study will change the color of the bubble.
it checks if the candle is up or down, then uses an if-then in the bubble code to determine the color.

Code:
``````def agg = AggregationPeriod.DAY; #mets l'aggregation temporairement à 1 min.
def LowHighLHCP = Round ((high - low) / low * 100);
#AddLabel (yes, "LHC %: " + LowHighLHCP + " ", if LowHighLHCP >= 5 then Color.RED else Color.GRAY);

def isup = (close > open);
AddChartBubble( (LowHighLHCP >= 5), low, "5", if isup then color.green else Color.RED, no );
#``````

87k+ Posts
179 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?