//@Name:Mkt Cap/FC Profit //@Description:Compares the Capitalisation vs Pre Tax Profits. If the capitalisation is less than the given multiple of the Pre Tax Profits (for example 15x) then the script returns a 1. //@Returns:Number //Coded by: Phil Tolhurst, ShareScript Support // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. var forecastYear=0; var fyList = ["1","2","3"]; function init(status) { if (status == Loading || status == Editing) { forecastYear = storage.getAt(0); } if (status == Adding || status == Editing) { dlg = new Dialog("Settings...", 220, 40); dlg.addOkButton(); dlg.addCancelButton(); dlg.addDropList("VAL1",-1,-1,20,-1,fyList,"Market Cap/","yr fc profit",forecastYear); if (dlg.show()==Dialog.Cancel) return false; forecastYear = dlg.getValue("VAL1") storage.setAt(0, forecastYear); } setTitle("Cap /"+fyList[forecastYear]+"yr fc profit (m)"); } function getVal(share) { if(share.getResult(forecastYear+1,Result.Profit) == undefined || share.getResult(forecastYear+1,Result.Profit) == 0) return; else return (share.getCap()/share.getResult(forecastYear+1,Result.Profit)).toFixed(2); }