RelativeVolume.efs
File Name: RelativeVolume.efs
Description:
This formula is based on Relative Volume Analysis by Thom Hartle, which appeared in the July 2003 issue of Active Trader Magazine.
Formula Parameters:
- Symbol: NYSE [NASDAQ, NYSE]
Notes:
The related article is copyrighted material. If you are not a subscriber of Active Trader Magazine, please visit www. activetradermag.com.
Updated Version 1.1 7/13/2004
vRelVol was corrected to be the maximum of vUpVol/vTotVol or vDnVol/vTotVol per instructions from Thom Hartle.
Download File:
RelativeVolume.efs
EFS Code:
/***************************************************************** Provided By : eSignal. (c) Copyright 2004 Study: Relative Volume Analysis Version: 1.1 1/20/2004 Notes: Formula based on "Relative Volume Analysis" by Thom Hartle, which appeared in the July 2003 issue of Active Trader Magazine. 1.1 Correction: vRelVol was corrected to be the maximum of vUpVol/vTotVol or vDnVol/vTotVol. *****************************************************************/ function preMain() { setStudyTitle("Relative Volume "); setCursorLabelName("Relative Volume"); setPlotType(PLOTTYPE_HISTOGRAM); setDefaultBarFgColor(Color.green); setDefaultBarThickness(4); setStudyMin(0); setStudyMax(100); var fp1 = new FunctionParameter("Symbol", FunctionParameter.STRING); fp1.setName("Index"); fp1.addOption("NASDAQ"); fp1.addOption("NYSE"); fp1.setDefault("NYSE"); } function main(Symbol) { var vRelVol = null; var vUpVol = null; var vDnVol = null; var vUnVol = null; var vTotVol = null; var vSuffix = null; var o = open(); var c = close(); if (Symbol == "NASDAQ") { vSuffix = "Q"; } else if (Symbol == "NYSE") { vSuffix = ""; } else { return; } vUpVol = close("$UVOL"+vSuffix); vDnVol = close("$DVOL"+vSuffix); if (vUpVol == null || vDnVol == null) return; vTotVol = vUpVol + vDnVol; if ( (vDnVol/vTotVol) > (vUpVol/vTotVol) ) { setBarFgColor(Color.red); } else if ( (vDnVol/vTotVol) < (vUpVol/vTotVol)) { setBarFgColor(Color.green); } else { setBarFgColor(Color.grey); } vRelVol = Math.max((vDnVol/vTotVol)*100, (vUpVol/vTotVol)*100); return vRelVol; }