
To add volume on a TradingView chart in PineScript, you'll need to use the built-in volume indicator, specifically the volume() function. This function returns the current volume of the current bar.
The volume() function can be used in a script to add volume to the chart. For example, plot(volume(), title = "Volume", color = color.blue) will add a blue volume line to the chart.
You can also use the volume() function to calculate the volume of a specific time frame. For instance, if you want to calculate the daily volume, you can use the volume() function in a daily timeframe script.
By using the volume() function in your PineScript, you can add volume to your TradingView chart and gain a better understanding of market activity.
See what others are reading: Add Volume on Tradingview
Understanding Indicators
To create a custom volume indicator on TradingView using Pine Script, you need to understand the principles behind it. This involves accessing real-time volume data, creating intelligent comparisons, and adding visual intelligence to convey information quickly.
For another approach, see: When Is Ads B Required?
Intelligent comparisons involve comparing current volume to rolling averages, percentiles, or historical patterns, which is what separates profitable traders from the crowd. This approach helps you understand the context of trading activity.
To add visual intelligence, use color gradients, line thickness variations, or opacity changes to convey information quickly. Your eyes should instantly understand what's happening without mental calculations. This is where tools like Pine Script generators can help you prototype ideas quickly without getting bogged down in syntax details.
By following these principles, you can create a custom volume indicator that adapts to the asset class you're trading. Remember to define the analysis period, determine the price range, and divide it into bins to construct the Volume Profile.
Here's a simplified overview of the Volume Profile calculation:
What Makes Indicators Powerful?
Price tells you what happened, but volume tells you how much conviction was behind that move.
Think about it like someone whispering "fire" versus someone screaming it at the top of their lungs - it's a big difference in intensity.
A fresh viewpoint: Where Is Ads B Out Required?

Volume measures exactly how many shares, contracts, or units changed hands during each time period.
Basic volume bars can't match the power of custom indicators, which can create intelligent filters and combine volume with price action.
Spotting a price breakout accompanied by massive volume shows genuine market conviction, but prices moving on whisper-thin volume is often just noise that'll fade away.
The intensity of market participation is shown in those familiar bar charts beneath your price action.
Additional reading: Equity Market Volume
Components and Calculation
Understanding the components and calculation of indicators is crucial to making sense of the data they provide. In the context of volume indicators, this involves breaking down the process into several key steps.
Defining the analysis period is the first step in constructing a volume profile. This can be a specific session, such as a day or a week, or a fixed number of bars, like the last 100 bars. The analysis period determines the scope of the data we're working with.
On a similar theme: Dupont Chart Analysis

Distributing volume across price bins is a critical component of the calculation. This involves taking each bar within the analysis period and assigning its volume to the price bins that its high-low range covers. If a bar's high is in one bin and its low is in another, its volume is proportionally distributed.
The number of price bins is a crucial factor in the calculation. For example, if the price range is $10 and we want 10 bins, each bin would be $1 wide. This allows us to visualize the distribution of volume across different price levels.
The accumulation of volume per bin is a straightforward process. We simply sum up the volume for each price bin, creating a horizontal bar chart that represents the volume traded at each price level.
Identifying key levels, such as the Point of Control (POC), Value Area (VA), High Volume Node (HVN), and Low Volume Node (LVN), is the final step in the calculation. The POC is the bin with the highest volume, while the Value Area is found by accumulating volume from the POC outwards until the specified percentage of total volume is reached.
Here's a summary of the key components and calculation steps:
Building Custom Indicators

Building Custom Indicators is a crucial step in adding volume to your TradingView chart in PineScript. To get started, you need to access the volume data, which Pine Script makes surprisingly easy with the built-in volume variable.
This gives you real-time access to trading activity for each bar. By accessing this data, you can create intelligent comparisons that go beyond just plotting raw volume. Don't just plot raw volume—that's what beginners do—instead, compare current volume to rolling averages, percentiles, or historical patterns.
This context is what separates profitable traders from the crowd. By adding visual intelligence to your indicator, you can use color gradients, line thickness variations, or opacity changes to convey information quickly.
Building a Custom Indicator
Accessing the right data is key to creating a useful custom indicator. Pine Script makes it surprisingly easy with the built-in volume variable, giving you real-time access to trading activity for each bar.
Don't just plot raw volume, compare current volume to rolling averages, percentiles, or historical patterns to add context to your indicator. This is what separates profitable traders from the crowd.

Visual intelligence is crucial to quickly conveying information. Use color gradients, line thickness variations, or opacity changes to make your indicator easy to understand at a glance.
Different markets behave differently, so design your indicators to adapt to the asset class you're trading. Crypto volume patterns differ vastly from forex or stock volume, for example.
Open-Source Script
Building custom indicators is all about collaboration and transparency, and that's exactly what open-source scripts bring to the table.
By making their code open-source, creators allow traders to review and verify the functionality, which is a huge plus.
Trading Strategies
To start building a trading strategy that incorporates volume, you'll want to begin with a simple volume comparison indicator. This will show you the current volume versus its 20-period average.
Start with a basic setup and gradually add more complexity as you become more comfortable with the Pine Script language. Experiment with different moving average types to smooth out raw volume data.
The goal of your trading strategy should be to provide actionable insights that you can use in live trading. Remember, the focus is on building tools that work, not on creating the most complex indicator possible.
Beginner-friendly Pine Script tutorials can be a great resource to help you build your foundation in the language. This will make the learning process much more manageable and help you create effective trading tools.
Profile Implementation
Pine Script v5 greatly simplifies Volume Profile implementation with its dedicated volume module. It provides functions like `volume.profile_fixed()` and `volume.profile_session()` to draw these profiles directly on the chart.
With Pine Script v5, you can easily implement a Basic Volume Profile. The `volume.profile_fixed()` function allows you to draw a fixed volume profile, while the `volume.profile_session()` function enables you to draw a session-based volume profile.
These functions are incredibly useful for traders who want to visualize market activity and make informed decisions. By using these functions, you can gain a deeper understanding of market dynamics and improve your trading strategy.
For your interest: Market Value Added
What Is Profile?

Profile is a powerful tool that helps traders understand market dynamics and participant behavior. It's an advanced charting indicator that displays trading activity over a specified price range during a specified period.
The key components of Profile include Point of Control (POC), Value Area (VA), High Volume Nodes (HVN), and Low Volume Nodes (LVN). The POC is the price level with the highest traded volume for the specified period, representing the price where the most trading activity occurred.
The Value Area, on the other hand, is the price range where a significant percentage of the total volume (typically 70% or 68%) was traded. This signifies where the majority of participants found value.
High Volume Nodes are price levels where a large amount of volume was traded, indicating areas of agreement or consolidation. These often act as strong support or resistance.
Low Volume Nodes, however, are price levels where very little volume was traded, indicating areas of disagreement or rapid price movement. These often act as weak support/resistance and tend to be easily broken through.
Additional reading: High Volume Trading Stocks

Here's a quick summary of the key components of Profile:
Basic Profile Implementation
With Pine Script v5, implementing a basic Volume Profile is a breeze.
The `volume` module is a game-changer, providing functions like `volume.profile_fixed()` and `volume.profile_session()` to draw these profiles directly on the chart.
These functions make it easy to visualize the volume profile, giving you a clear picture of market activity.
Pine Script v5 simplifies the implementation process, saving you time and effort.
The `volume.profile_fixed()` function allows you to draw a fixed volume profile, while `volume.profile_session()` function draws a session-based volume profile.
For another approach, see: Thinkorswim Volume Profile
Optimizing Performance
To get the most out of Volume Profile in Pine Script, it's essential to understand the broader market context before trading individual VP levels. This is because Volume Profile is best used in conjunction with price action.
The chosen `profileType` ("Fixed Range" vs. "Session Profile") and the chart's timeframe greatly impact the profile's relevance. Daily session profiles are excellent for intraday decisions.

Experiment with the `numberOfRows`. Too few bins can make the profile too coarse, missing subtle nuances. Start with 20-30 and adjust.
The default 70% is common for Value Area Percentage, but some traders prefer 68% or other percentages depending on their focus.
Here's a summary of key considerations for optimizing performance:
- Profile Type: Choose between "Fixed Range" and "Session Profile" based on your trading strategy and timeframe.
- Timeframe: Select a timeframe that aligns with your trading goals, such as daily session profiles for intraday decisions.
- Number of Rows: Start with 20-30 and adjust to find the optimal balance between detail and noise.
- Value Area Percentage: Experiment with different percentages to find what works best for your trading style.
Always seek confirmation from volume. A breakout of a key level with strong, increasing volume is more reliable than a weak breakout.
Featured Images: pexels.com


