//@Name:H-L % of C //@Description:Returns the difference between the high and the low as a percentage of the close on any day. Lookback period is the date expressed in trading days ago //@Returns:Number //@Width:60 var var1 = 0; function init(status) { if (status == Loading || status == Editing) { var1 = storage.getAt(0); } if (status == Adding || status == Editing) { dlg = new Dialog("Settings...", 145, 55); dlg.addOkButton(); dlg.addCancelButton(); dlg.addIntEdit("INT1",8,-1,-1,-1,"","Lookback",var1,0,5000); if (dlg.show()==Dialog.Cancel) return false; var1 = dlg.getValue("INT1"); storage.setAt(0, var1); } } function getVal(share) { return (share.getHigh(var1)-share.getLow(var1))/share.getClose(var1)*100; }