Volume Zone for trading

CashMoney

Member
VIP
Hi,

I need help with following:
I want to create a zones ( made of high of candle- horizontal line, low of candle- horizontal line, and close of candle with horizontal line). These horizontal lines go across the chart. The Zone is created after the candle is closed.
The zone is based on the volume of the candle.
The zone is not created until the previous highest volume is broken.

For example,
At 930AM- volume of a candle is 2000
at 10 AM- volume of the candle is 1000
At 11 AM volume of candle is 5000
At 3pm volume of candle is 1000

There would be a zone for 930 AM candle, and 11 Am candle. Not for 10 am and 3pm candle because no new high volume was created.

can someone help with this? @samer800 @chewie76
Thank you
 
Hi,

I need help with following:
I want to create a zones ( made of high of candle- horizontal line, low of candle- horizontal line, and close of candle with horizontal line). These horizontal lines go across the chart. The Zone is created after the candle is closed.
The zone is based on the volume of the candle.
The zone is not created until the previous highest volume is broken.

For example,
At 930AM- volume of a candle is 2000
at 10 AM- volume of the candle is 1000
At 11 AM volume of candle is 5000
At 3pm volume of candle is 1000

There would be a zone for 930 AM candle, and 11 Am candle. Not for 10 am and 3pm candle because no new high volume was created.

can someone help with this? @samer800 @chewie76
Thank you

this section is for finished studies.
post your questions in the questions group
https://usethinkscript.com/forums/questions.6/

is this the same question as your other post?
https://usethinkscript.com/threads/volume-zone.20490/
 
Last edited:
Hi,

I need help with following:
I want to create a zones ( made of high of candle- horizontal line, low of candle- horizontal line, and close of candle with horizontal line). These horizontal lines go across the chart. The Zone is created after the candle is closed.
The zone is based on the volume of the candle.
The zone is not created until the previous highest volume is broken.

For example,
At 930AM- volume of a candle is 2000
at 10 AM- volume of the candle is 1000
At 11 AM volume of candle is 5000
At 3pm volume of candle is 1000

There would be a zone for 930 AM candle, and 11 Am candle. Not for 10 am and 3pm candle because no new high volume was created.

can someone help with this? @samer800 @chewie76
Thank you

you didn't say if the highest volume should reset each day.

this only looks at bars on the current day.
on the bar with the highest volume today, it reads the high, low, close.
plots 3 lines, at the most recent levels

Code:
#vol_big_bar_price_zone
#https://usethinkscript.com/threads/volume-zone-for-trading.20491/
#Indicator Forums Indicators Custom 
#Volume Zone for trading

def na = double.nan;
def bn = barnumber();
def d = getday();
def newday = d != d[1];
def istoday = d == getlastday();
def v = volume;
def lastbar = (!isnan(close) and isnan(close[-1]));

def vhi;
def hi;
def lo;
def cls;
if istoday and !istoday[1] then {
 vhi = v;
 hi = high;
 lo = low;
 cls = close;
} else if istoday and v > vhi[1] then {
 vhi = v;
 hi = high;
 lo = low;
 cls = close;
} else {
 vhi = vhi[1];
 hi = hi[1];
 lo = lo[1];
 cls = cls[1];
}

plot zhi = highestall(if lastbar then hi else 0);
plot zlo = highestall(if lastbar then lo else 0);
plot zcls = highestall(if lastbar then cls else 0);

zhi.SetDefaultColor(Color.magenta);
zlo.SetDefaultColor(Color.magenta);
zcls.SetDefaultColor(Color.magenta);
#
 
@halcyonguy this is what I came up so far. How can I get the bubble to move the end of the line for each zone?


VolumeZone CashMoney
def marketOpenTime = 1800; # Futures market open time (6:00 PM)
def marketCloseTime = 1700; # Futures market close time (5:00 PM)

# Define the start of a new day based on market open time
def newDay = if SecondsTillTime(marketOpenTime) == 0 then 1 else 0;

def highVol = volume;
rec highestVol = if newDay then highVol else if highVol > highestVol[1] then highVol else highestVol[1];
rec highLine = if newDay then high else if highVol == highestVol then high else highLine[1];
rec lowLine = if newDay then low else if highVol == highestVol then low else lowLine[1];
rec closeLine = if newDay then close else if highVol == highestVol then close else closeLine[1];

plot HighLinePlot = if !IsNaN(highLine) then highLine else Double.NaN;
plot LowLinePlot = if !IsNaN(lowLine) then lowLine else Double.NaN;
plot CloseLinePlot = if !IsNaN(closeLine) then closeLine else Double.NaN;

HighLinePlot.SetDefaultColor(Color.RED);
HighLinePlot.SetStyle(Curve.SHORT_DASH);
HighLinePlot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

LowLinePlot.SetDefaultColor(Color.GREEN);
LowLinePlot.SetStyle(Curve.SHORT_DASH);
LowLinePlot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

CloseLinePlot.SetDefaultColor(Color.BLUE);
CloseLinePlot.SetStyle(Curve.SHORT_DASH);
CloseLinePlot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

# Adding volume bubble next to CloseLine only once
AddChartBubble(highVol == highestVol, closeLine, highestVol, Color.YELLOW, yes);
 
Last edited:

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
418 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