//@Name:Change since first open //@Description:Displays the % change between current mid and the open on the first day of trading. //@Returns:Number //@Width:60 function getVal(share) { var data = share.getPriceArray(); if (data.length<1) return; var idata = share.getIBarArray(0,86400); if (idata!=undefined && idata.length==1 && new Date().getDate()==idata[0].date.getDate() && new Date().getDate()!=data[data.length-1].date.getDate()) { var tclose = share.getIClose(); var topen = share.getIOpen(); data[data.length]={open:(topen==null?idata[0].open:topen),high:idata[0].high,low:idata[0].low,close:(tclose==null?share.getIMid():tclose),volume:idata[0].volume}; } var ch = (data[data.length-1].close / data[0].open - 1) * 100 return ch }