AddChartBubble Assistance,

Nari2007

Member
Hello Fellow Traders, looking for some assistance adding chart bubbles to help identify these ATR lines ive plotted on my charts,,,,,

please see code below,

input length = 14;
input averageType = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.DAY;

def ATR = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length);
def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);
def DR = Today_High - Today_Low;

plot DailyClose = close(period=”DAY”)[1];
plot hatr = dailyclose + ATR;
plot latr = dailyclose - ATR;
plot hdtr = Today_Low + ATR;
plot ldtr = Today_High - ATR;
 
Hello Fellow Traders, looking for some assistance adding chart bubbles to help identify these ATR lines ive plotted on my charts,,,,,

please see code below,

input length = 14;
input averageType = AverageType.WILDERS;
input BasePeriod = AggregationPeriod.DAY;

def ATR = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length);
def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);
def DR = Today_High - Today_Low;

plot DailyClose = close(period=”DAY”)[1];
plot hatr = dailyclose + ATR;
plot latr = dailyclose - ATR;
plot hdtr = Today_Low + ATR;
plot ldtr = Today_High - ATR;

Here is addition of movable bubbles to your code. Also, the search option in the upper right corner is the place to find excellent examples of how to code addchartbubbles.
Rich (BB code):
input length = 14;

input averageType = AverageType.WILDERS;

input BasePeriod = AggregationPeriod.DAY;



def ATR = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length);

def Today_High = Highest(high(period = baseperiod)[0], 1);

def Today_Low = Lowest(low(period =baseperiod)[0], 1);

def DR = Today_High - Today_Low;



plot DailyClose = close(period=”DAY”)[1];

plot hatr = dailyclose + ATR;

plot latr = dailyclose - ATR;

plot hdtr = Today_Low + ATR;

plot ldtr = Today_High - ATR;


input bubblemover = 3;
def b = bubblemover;
def b1 = b + 1;


AddChartBubble(!IsNaN(close[b1]) and IsNaN(close), dailyclose, "PD_CL", Color.yellow, no);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close), hatr, "PD_HTR" , Color.yellow);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close), latr, "PD_LTR" , Color.yellow, no);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close), hdtr, "TD_HTR" , Color.yellow);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close), ldtr, "TD_LTR" , Color.yellow, no);

 

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

thank you,,, i did use the searcg just thought i was coding it wrong because it plots multiple bubbles on one line,,,, when i coded it it plotted bubbles across the whole line,,, for some reason you code is also plotting multiple chartbubbles on 1 line,,, a little better than mine tho,,

see image below

 
thank you,,, i did use the searcg just thought i was coding it wrong because it plots multiple bubbles on one line,,,, when i coded it it plotted bubbles across the whole line,,, for some reason you code is also plotting multiple chartbubbles on 1 line,,, a little better than mine tho,,

see image below


It looks like my code did not paste properly as the bracketed 'b' disappeared in isnan(close). It got treated as indication to bold text. Please see below for correction.

Ruby:
input length = 14;

input averageType = AverageType.WILDERS;

input BasePeriod = AggregationPeriod.DAY;



def ATR = MovingAverage(averageType, TrueRange(high(period = ”DAY”)[1], close(period = ”DAY”)[1], low(period = ”DAY”)[1]), length);

def Today_High = Highest(high(period = BasePeriod)[0], 1);

def Today_Low = Lowest(low(period = BasePeriod)[0], 1);

def DR = Today_High - Today_Low;



plot DailyClose = close(period = ”DAY”)[1];

plot hatr = DailyClose + ATR;

plot latr = DailyClose - ATR;

plot hdtr = Today_Low + ATR;

plot ldtr = Today_High - ATR;


input bubblemover = 3;
def b = bubblemover;
def b1 = b + 1;

AddChartBubble(!IsNaN(close[b1]) and IsNaN(close[b]), DailyClose, "PD_CL", Color.YELLOW, no);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close[b]), hatr, "PD_HTR" , Color.YELLOW);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close[b]), latr, "PD_LTR" , Color.YELLOW, no);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close[b]), hdtr, "TD_HTR" , Color.YELLOW);
AddChartBubble(!IsNaN(close[b1]) and IsNaN(close[b]), ldtr, "TD_LTR" , Color.YELLOW, no);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
503 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