Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sherwind/3033a67bf27d1a94ca144710a610e444 to your computer and use it in GitHub Desktop.
Save sherwind/3033a67bf27d1a94ca144710a610e444 to your computer and use it in GitHub Desktop.
Normalized Volume Oscillator
//@version=3
//
// This volume indicator works best on comparatively small timeframes (15 minutes, for example).
//
// Based on:
// - Normalized Volume Oscillator - indicator for MetaTrader 4 <https://www.mql5.com/en/code/8208>
// - Using Tick Volume in Forex: A Clear NVO Based Example <http://mechanicalforex.com/2010/08/using-tick-volume-in-forex-clear.html>
//
// See also:
// - Are price updates a good proxy for actual traded volume in FX? <https://www.fxstreet.com/education/are-price-updates-a-good-proxy-for-actual-traded-201104220000>
//
//
// -----------------------------------------------------------------------------
// Copyright 2018 sherwind
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// The GNU General Public License can be found here
// <http://www.gnu.org/licenses/>.
//
// -----------------------------------------------------------------------------
//
study("Normalized Volume Oscillator", shorttitle="NVO")
input_period = input(10, title="Volume Period", minval=1)
normalize_volume(len) => volume/sma(volume, len)
nvo = normalize_volume(input_period) * 100 - 100
the_color = nvo < 0 ? blue : nvo < 38.2 ? green : nvo < 61.8 ? lime : nvo < 100 ? orange : red
plot(nvo, linewidth=3, style=histogram, color=the_color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment