drew2323 / v2trading

V2Trading platform - live trading engine, backtesting and research tool.
https://trading.mujdenik.eu
7 stars 3 forks source link

Volume Dynamic Scale Bar - from TradingView to my indicators #110

Open drew2323 opened 7 months ago

drew2323 commented 7 months ago

Incorporate ideas from Volume Dynamic Scale Bar indicator from TV.

It just displays buying/selling pressure based on 1s bars (bullish bearish according to open/close) and number of trades. Also contains alert when unusual volume recorded (based on MA of volume).

Output of this indicator could be used as ML feature or in strategy conditions.

image
drew2323 commented 7 months ago

The provided Pine Script code is for a custom TradingView indicator named "Volume Dynamic Scale Bar." This indicator seems to be designed to provide a visual representation of trading volume dynamics in a customizable and interactive way. Let's break down its key components and functionalities:

Key Components and Functionalities:

  1. Input Settings (Table Settings and Technical Settings):

    • Users can input various settings such as timezone, table location and size, cell colors, flash settings (for volume spikes), and technical settings like timeframe and the length of the data series.
  2. Volume Calculation and Representation:

    • The script imports volume data from a specified timeframe (tFrm) and calculates volume metrics. It differentiates between "up volume" (bullish) and "down volume" (bearish) based on the price change direction.
    • The determination of bullish or bearish volume is based on the closing price of the current bar compared to the previous one. If the closing price is higher, it's considered bullish (up volume); if it's lower, it's considered bearish (down volume).
  3. Dynamic Scale Bar:

    • The script creates a dynamic scale bar that visually represents the proportion of up volume and down volume within a specified period. This is done using a gradient color scheme for easy interpretation.
  4. Flash Feature for Significant Volume:

    • The indicator has a feature where the table background flashes if the volume exceeds a certain multiple (vFlsh) of the average volume. This is intended to alert the user to significant volume spikes which might indicate important market events or movements.
  5. Table Display:

    • The script generates a table that displays various volume-related metrics, such as total up and down volumes, average speed of volume, and information about volume spikes. The table's appearance and location are customizable.
  6. Volume Format and Timeframe Display:

    • The script includes functions to format the volume data for display and to properly format the timeframe string for user readability.

Recognition of Bullish or Bearish Change:

The script identifies whether a change in price was bullish or bearish by comparing the closing price of the current bar to the closing price of the previous bar within the chosen lower timeframe (tFrm). If the current close is higher than the previous, the volume for that bar is classified as bullish (up volume); if lower, it’s classified as bearish (down volume). This is a common approach in volume analysis, where the direction of price movement relative to the previous period indicates buying or selling pressure.

Conclusion:

This indicator appears to be a sophisticated tool for traders who want to analyze volume dynamics in real time with an emphasis on visual representation and interactive features. It's particularly useful for intraday and short-term traders who need to quickly assess market sentiment and react to changes in volume. However, like all indicators, it should be used in conjunction with other analysis methods for a comprehensive trading strategy.