# Difference between current day high and low as watchlist column

#### BenTen

Staff member
Staff
VIP
What's the duration of the period? Previous day's high and low?

Here is an example for your watchlist column:

Ruby:
``````def prev_high = high[1];
def prev_low = low[1];

plot value = prev_high - prev_low;``````

Set the timeframe of the column to D (daily).

Code:
``````def today_high = high;
def today_low = low;

plot value = today_high - today_low;``````

or simpler

Code:
``plot scan = high-low;``

Very much appreciated!!!!!

Thank you both

Hi. I'm looking for an indicator that shows me the high and the low of the price of the day on the watchlist. In the graph you can see the bubble with the price, I would like to have in the following list the notice of those ups and downs in the price. I will be very grateful if you can help me.

Hi. I'm looking for an indicator that shows me the high and the low of the price of the day on the watchlist. In the graph you can see the bubble with the price, I would like to have in the following list the notice of those ups and downs in the price. I will be very grateful if you can help me.
you said...

I would like to have in the following list the notice of those ups and downs in the price

1)what list? and what do you mean by notice?

2) define ups and downs? ups and downs from what? close to open? open to high? low to high? high to low open to low? you will have to explain more?

you said...

I would like to have in the following list the notice of those ups and downs in the price

1)what list? and what do you mean by notice?

2) define ups and downs? ups and downs from what? close to open? open to high? low to high? high to low open to low? you will have to explain more?
Hi: I need help with a custom column to show the difference between current high and current Last? Thanks

@MKToronto You left SO much out of your query. Thinkscript works based on definitions "def" statements. The statements are written as mathematical expressions. You will need to mathematically define the meaning of "high" (52 week High, Day High, the High of the Current Candle) and the meaning of "difference" (dollar difference, percentage difference, etc.)

In the below example, High is the 52-week High and Difference is the Percentage Diff. As this is an example, I am doing this as a label on a chart to more clearly illustrate the math. When you have it customized to your definitions, comment out the AddLabel statement (put a # in front of it, and then you can create your watchlist.
PS: this example only works on a watchlist or chart set to daily as in 252 DAYS in a year. Using a different aggregation, use different math.

Ruby:
``````# Percentage Off 52 Week High
# Nick Name NAG®
# 11.02.2015

# This assumes a daily aggregation.  You will need to use
# daily or higher, adjust the 252 length as needed.

def The52WkHigh = Highest(high, 252) ;
plot percentage = Round((close / The52WkHigh  - 1) * 100);
AddLabel(yes, "Last: " +close +" | High: " +The52WkHigh +" | %: " +percentage, color.blue);``````
HTH

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