# AverageCandleValue

#### mashume

##### Expert
VIP
For anyone out there who wants another way to look at volatility, here's a little something I was curious about and so coded up. Offered here with minimal explanation:

Average Candle Value
Using tickValue() and tickSize() functions:
Code:
``````declare lower;

def ts = TickSize();
def tv = TickValue();

def r = average(data = HIGH - LOW, length = 20);

plot AverageCandleValue = tv * (r / ts);

addlabel(yes, "tick size = " + ts);
addLabel(yes, "tick value = " + tv);``````

plots a simple line representing the value of a candle for whatever future contract you happen to be trading.

mashume

Edit:
Here's another interesting twist: Run two lines, one with the full range (high - low) and another with the absolute value of the close - open. Compare the two lines and see how sometimes a lot of volatility goes into movement and other times it doesn't.

Code:
``````declare lower;

def ts = TickSize();
def tv = TickValue();

def r = average(data = HIGH - LOW, length = 20);
def er = average(data = AbsValue(CLOSE - OPEN), length = 20);

plot AverageCandleTotalValue = tv * (r / ts);
plot AverageCandleValue = tv * (er / ts);

addlabel(yes, "tick size = " + ts);
addLabel(yes, "tick value = " + tv);``````

I post most of this stuff because I find it interesting, whether or not you find it interesting or useful is up to you.
mashume

Last edited:
I don't have much experience in the futures section but will this indicator work on normal stocks?

I don't have much experience in the futures section but will this indicator work on normal stocks?
Yes, it will work. The biggest difference is that in stocks (as far as I know and not counting otc issues where movements might be 0.001) the minimum movement is 0.01 and the value of that movement is \$0.01 -- at least movement and price are in a 1:1 relationship, regardless the minimum increment size. This is different from futures, where, for /ES, the tick (minimum movement) is 0.25 and the value of that move is \$12.50. For other futures contracts, the tick and value are different -- thus this indicator. But yes, it will run on stocks.

Yes, it will work. The biggest difference is that in stocks (as far as I know and not counting otc issues where movements might be 0.001) the minimum movement is 0.01 and the value of that movement is \$0.01 -- at least movement and price are in a 1:1 relationship, regardless the minimum increment size. This is different from futures, where, for /ES, the tick (minimum movement) is 0.25 and the value of that move is \$12.50. For other futures contracts, the tick and value are different -- thus this indicator. But yes, it will run on stocks.
Hi Mashume,
which cloud study in upper chart?

I believe that's the buy the dip upper.

-mashume

For anyone out there who wants another way to look at volatility, here's a little something I was curious about and so coded up. Offered here with minimal explanation:

Average Candle Value
Using tickValue() and tickSize() functions:
Code:
``````declare lower;

def ts = TickSize();
def tv = TickValue();

def r = average(data = HIGH - LOW, length = 20);

plot AverageCandleValue = tv * (r / ts);

addlabel(yes, "tick size = " + ts);
addLabel(yes, "tick value = " + tv);``````

plots a simple line representing the value of a candle for whatever future contract you happen to be trading.

mashume

Edit:
Here's another interesting twist: Run two lines, one with the full range (high - low) and another with the absolute value of the close - open. Compare the two lines and see how sometimes a lot of volatility goes into movement and other times it doesn't.

Code:
``````declare lower;

def ts = TickSize();
def tv = TickValue();

def r = average(data = HIGH - LOW, length = 20);
def er = average(data = AbsValue(CLOSE - OPEN), length = 20);

plot AverageCandleTotalValue = tv * (r / ts);
plot AverageCandleValue = tv * (er / ts);

addlabel(yes, "tick size = " + ts);
addLabel(yes, "tick value = " + tv);``````

I post most of this stuff because I find it interesting, whether or not you find it interesting or useful is up to you.
mashume
hi @mashume very nice job, question do you mine share your charts with me, it is look pretty nice setup. thank you in advance

hi @mashume very nice job, question do you mine share your charts with me, it is look pretty nice setup. thank you in advance
I can't share the chart, as the BTD indicator is a premium indicator from this site and I am not licensed to redistribute it. Thanks for your understanding.
-mashume

I can't share the chart, as the BTD indicator is a premium indicator from this site and I am not licensed to redistribute it. Thanks for your understanding.
-mashume
oh okay @mashume i understand.

Maybe this is a dumb question but does this only work on tick charts or do the tick size and tick value functions work on candle charts? I trade using candle charts and I imagine one use of this indicator could be for helping to determine how much to adjust the width of stops as well as quick scalp targets, if attempting to scalp intra-candle volatility or heavy chop.

If you guys like this idea as a way of measuring volatility, you should read some of Tom Bulkowski's material on the NR7 pattern. Tom has written several books, and uses the NR7 pattern as part of his CPI (chart pattern indicator) process. Really neat stuff. It's basically saying "where are we consolidating, and how will we likely breakout?" It's similar to how I trade, though I don't use the NR7 or CPI - but they're similar concepts.

Here's his website.
https://thepatternsite.com/CPIUpdate.html

Maybe this is a dumb question but does this only work on tick charts or do the tick size and tick value functions work on candle charts? I trade using candle charts and I imagine one use of this indicator could be for helping to determine how much to adjust the width of stops as well as quick scalp targets, if attempting to scalp intra-candle volatility or heavy chop.
TickSize() will return \$0.01 for stocks (where the minimum price change is 1 cent -- anyone else remember ticks of 1/8). TickValue() will also return \$0.01 for stocks, assuming that a change of 1 cent in the price is valued at 1 cent (which I can't think of a time it isn't for stocks).

-mashume

TickSize() will return \$0.01 for stocks (where the minimum price change is 1 cent -- anyone else remember ticks of 1/8). TickValue() will also return \$0.01 for stocks, assuming that a change of 1 cent in the price is valued at 1 cent (which I can't think of a time it isn't for stocks).

-mashume

I wasn’t very clear, sorry: I meant to ask if the indicator can be used in time-based candle charts such with as 1min candles, 5min candles, etc. instead of using it with a tick chart.

I wasn’t very clear, sorry: I meant to ask if the indicator can be used in time-based candle charts such with as 1min candles, 5min candles, etc. instead of using it with a tick chart.
I can't see why it wouldn't

-mashume

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