//@Name:True Range % //@Description:Displays the True Range as a % of the current price //@Width:90 //@Update:Periodic,15 function init() { setTitle("TR%"); } function getVal(share) { var idata = share.getIBarArray(0,86400); var close = share.getClose(); if (idata==undefined || idata.length<1) return; var tr = Math.max(idata[0].high-close,idata[0].high-idata[0].low,close-idata[0].low); return (tr/idata[0].close*100).toFixed(2); }