RedK_Supply/Demand Volume Viewer v3.0
"RedK_Supply/Demand Volume Viewer v1" by RedKTrader, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: RedK_Supply/Demand Volume Viewer v1 (v6.0), read 2026-10-12T16:19:38.481Z; source language v5.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
RedK_Supply/Demand Volume Viewer v1 by RedKTrader, ported from Pine v5. Pane indicator with 4 plots, 1 level and 2 inputs.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © RedKTrader - May 14 2021 // ------------------------------------------------------------------------------------------------ // Original author: RedKTrader // Original title: RedK_Supply/Demand Volume Viewer v1 // Licence: MPL-2.0 (the header above is the original notice, kept verbatim) // Pine version: 5 // Fetched: 2026-10-12 // Ported to FloScript by FloSignals; modifications under MPL-2.0. // Converter: @flosignals/floscript 0.1.0, strict mode, score 100/100 // ------------------------------------------------------------------------------------------------ //@floscript=1 //@version=5 indicator(title='RedK_Supply/Demand Volume Viewer v3.0', shorttitle='V.Viewer_v3.0', format=format.volume, timeframe='', timeframe_gaps=false) // Supply & Demand Volume Viewer calculates and plots a "price-bar-weighted" view of volume - it basically uses the shape of a price bar to estimate // the supply vs demand shares of the traded volume, plots a moving average of both, and an estimated "net volume" // This provides an insightful way to look at the traded volume compared to the classic volume histogram view // ============================================================================================================================================ // inputs // ============================================================================================================================================ l = input.int(title='Volume Length', defval=10, minval=1) s = input.int(title='Smoothing', defval=3, minval=1) // ============================================================================================================================================ // variables // ============================================================================================================================================ col_red = color.new(#ff0000, 50) col_green = color.new(#00ff00, 50) col_gold = color.new(#ffeb3b, 50) upday = close > open v = volume // ============================================================================================================================================ // Calc supply & Demand per Bar .. beware of the odd case of 0 price movement during bar.. assigne equal weights to bulls & bears // ============================================================================================================================================ Body = math.abs(close - open) BarRange = high - low Wick = BarRange - Body RealRange = BarRange + Wick BScore = BarRange > 0 ? (close >= open ? BarRange / RealRange : Wick / RealRange) : 0.5 BullScore = BScore * v demand = ta.wma(ta.wma(BullScore, l), s) BearScore = v - BullScore supply = ta.wma(ta.wma(BearScore, l), s) NetVol = demand - supply // ============================================================================================================================================ // Plots -- classic volume bars are hidden by default // ============================================================================================================================================ hline(0, title='zero line', linestyle=hline.style_dotted, color=col_gold) //, editable = false) plot(v, title='Volume', style=plot.style_columns, color=upday ? col_green : col_red, display=display.none) // Net Volume Plot plot(NetVol, title='Volume Viewer', style=plot.style_area, color=NetVol >= 0 ? col_green : col_red, linewidth=4) plot(supply, title='Supply', style=plot.style_circles, color=color.new(color.orange, 0), linewidth=2, join=true) plot(demand, title='Demand', style=plot.style_cross, color=color.new(color.aqua, 0), linewidth=2, join=true)
This file is under the Mozilla Public License 2.0; it is a port of the original by RedKTrader, with the original licence header kept and the changes made for FloScript noted in the file.
- v2
Library refresh 2026-10-14
- v1
Library refresh 2026-10-12
Disclaimer. Scripts are written and published by members, or ported by FloSignals from open-source originals, and are their authors' own work and opinion. FloSignals does not review them for correctness and nothing in a script is financial advice or a recommendation to buy or sell anything — read the Risk Disclaimer. Posting here is under the Community Rules; a script that is not the poster's to post can be reported as the Copyright & Takedowns page says.

Comments (0)
No comments yet. Members can leave one.