Volume in x min on y min chart

Looking for how to plot per min volume in 5 min chart. Each min will show different color.

As stated you cannot plot a lower timeframe on a higher timeframe chart. However, you can display a grid with the higher timeframe on the upper pane and the lower on the lower pane. This may work or you can at least test if your idea is of value to you.

The lower pane chart's indicator is displayed in the volume portion with the price subgraph unchecked in chart settings/general/layout

Capture.jpg
Ruby:
#Volume 5m and 1m displayed on 1m chart with vertical time separations @5m
plot v1 = volume(period=aggregationPeriod.min);
v1.setpaintingStrategy(paintingStrategy.HISTOGRAM);
v1.setdefaultColor(color.white);

plot v5=volume(period=aggregationPeriod.FIVE_MIN);
v5.setpaintingStrategy(paintingStrategy.HISTOGRAM);
v5.assignvalueColor(if close(period=aggregationPeriod.five_min) > open(period=aggregationPeriod.FIVE_MIN) then color.green else color.red);

# Vertical Lines @Start Time and then Interval of Minutes
input begin   = 0930;
input minutes = 5;
def chartAgg  = GetAggregationPeriod();
def barSeq    = if SecondsTillTime(begin) == 0 and
                   SecondsFromTime(begin) == 0
                then 0
                else barSeq[1] + 1;
def BarsPerHour = 60 / (chartAgg / 1000 / 60);
def bar         = barSeq;
def barCount    = CompoundValue(1, if bar % BarsPerHour == 0
                                    then (bar / BarsPerHour) - 1
                                    else Double.NaN, 1);
#        barCount.SetPaintingStrategy(PaintingStrategy.Values_Below);
input showlabels = no;
AddLabel(showlabels, "Bars Per Hour: " + BarsPerHour +
                     "   Current Bar In Sequence: " + bar,
                      if !IsNaN(barCount)
                      then Color.GREEN
                      else Color.WHITE);
AddLabel(showlabels, bar + " " + minutes / (GetAggregationPeriod() / 60000));
input vertical_plot_limiter = 10000;
def lastbar = if !IsNaN(close) and IsNaN(close[-1]) then BarNumber() else Double.NaN;

################
###########
input timezone = {default "ET", "CT", "MT", "PT"};

def starthour  = (if timezone == timezone."ET"
                        then 9
                        else if timezone == timezone."CT"
                        then 8
                        else if timezone == timezone."MT"
                        then 7
                        else 6) ;
def hour = Floor(((starthour * 60 + 30) + (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000) / 60);
def mins = (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000 - ((hour - starthour) * 60 + 30) + 60;

AddVerticalLine(BarNumber() >= HighestAll(lastbar) - vertical_plot_limiter and (bar) % (minutes / (GetAggregationPeriod() / 60000)) == 0,    hour + ":" +
    if mins < 10
    then "0" + mins 
    else "" + mins, color = Color.white, stroke = Curve.FIRM);
 

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