//@Name:Tax Rate //@Description:Calculated as total tax paid over 5 years as percentage of total reported pre-tax profits over 5 years //@Returns:Number //@Width:60 // 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. //over 1 year /*function getVal(share) { var tax = share.getResult(0,Result.Tax); var prof = share.getResult(0,Result.ReportedPreTax) return (tax/prof)*100 }*/ //over 5 years function getVal(share) { var totTax = 0 var totProf = 0 for (var i=-4;i<=0;i++) { var tax = share.getResult(i,Result.Tax); var prof = share.getResult(i,Result.ReportedPreTax); if (tax == null || prof == null) return; totTax+=tax; totProf+=prof; } if (totTax<0 || totProf<0) return else return (totTax/totProf)*100 }