Cumulative_Volume
Download scriptThe Cumulative Volume indicator is designed to provide traders with a visual representation of market momentum by analyzing the relationship between price movement and trading activity (volume). Rather than just showing total volume, this script breaks down where the "buying pressure" and "selling pressure" are going within specific timeframes.
Here is a detailed breakdown of how the logic works:
Core Functionality
The indicator monitors the price action to determine whether a candle closed higher or lower than the previous one. It then categorizes the trading volume based on that movement:
- Positive Volume: Volume associated with upward price moves.
- Negative Volume: Volume associated with downward price moves.
By separating these two forces, the indicator helps traders see if the current trend is being supported by strong volume or if it is weakening.
Data Processing and Smoothing
To make the data easier to read and less "noisy," the script employs several mathematical layers:
- Movement Analysis: It looks at the
tick_volume(the number of price changes) for every candle. - Moving Averages: Instead of showing raw, jumpy volume numbers, it applies a Moving Average (MA). This smooths out the data so you can see the general trend of buying vs. selling pressure over time. The script supports various types of averages (Simple, Exponential, Smoothed, and Linear Weighted), allowing for different levels of sensitivity.
- Combined Logic: You can choose to view the data in two ways:
- Absolute/Separate: Viewing the positive and negative volumes as independent streams.
- Relative: This calculates the percentage of buying pressure relative to the total volume for that period, providing a clearer picture of market dominance.
Visual Presentation
The script is designed to be visually intuitive for the user:
- Color Coding: It uses a dynamic color system (Lime Green and Red) to distinguish between upward and downward momentum instantly.
- Histogram Style: The data is plotted as a histogram, making it easy to identify "peaks" where heavy volume occurred and "valleys" where trading activity dried up.
- Separate Window: It operates in its own dedicated window on your chart, ensuring that the volume analysis does not clutter your price candles.
Summary of User Options
The logic allows for high customization through three main inputs:
- Period: Determines how many candles are included in the moving average calculation (shorter periods react faster; longer periods are smoother).
- Combined: Decides whether to show the difference between buying and selling forces or treat them as independent totals.
- Relative: Toggles between viewing the data as a percentage of the total volume versus an absolute value.
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | C u m u l a t i v e _ V o l u m e . m q 5 |
/ / | C o p y r i g h t 2 0 1 8 , M e t a Q u o t e s S o f t w a r e C o r p . |
/ / | h t t p s : / / m q l 5 . c o m |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "