Normalized_ATR.efs
EFSLibrary - Discussion Board
File Name: Normalized_ATR.efs
Description:
This study is based on the May 2006 article, Cross-Market Evaluations With Normalized Average True Range, by John Forman.
Formula Parameters:
- Periods: 14
Notes:
This formula requires eSignal version 7.9.1 or later. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.
Download File:
Normalized_ATR.efs
EFS Code:
/*************************************** Provided By : eSignal (c) Copyright 2006 Description: Cross-Market Evaluations With Normalized Average True Range - by John Forman Version 1.0 03/03/2006 Notes: * May 2006 Issue of Stocks and Commodities Magazine * Study requires version 7.9.1 or higher. Formula Parameters: Defaults: Periods 14 ***************************************/ function preMain() { setStudyTitle("Normalized ATR"); setCursorLabelName("N-ATR", 0); setDefaultBarThickness(2, 0); var fp1 = new FunctionParameter("nPeriods", FunctionParameter.NUMBER); fp1.setName("N-ATR Periods"); fp1.setLowerLimit(1); fp1.setDefault(14); } var bVersion = null; function main(nPeriods) { if (bVersion == null) bVersion = verify(); if (bVersion == false) return; if (getCurrentBarCount() <= nPeriods) return null; return (atr(nPeriods, 0)/close(0))*100; } function verify() { var b = false; if (getBuildNumber() < 730) { drawTextAbsolute(5, 35, "This study requires version 7.9.1 or later.", Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT, null, 13, "error"); drawTextAbsolute(5, 20, "Click HERE to upgrade.@URL=http://www.esignal.com/download/default.asp", Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT, null, 13, "upgrade"); return b; } else { b = true; } return b; }