# STUDY: Sales Growth (YoY) # DESCRIPTION: Calculates the % growth in Sales per Share vs 1 year ago. # 1. Get Current Sales per Share def salesTTM = SalesPerShare(fiscalPeriod = FiscalPeriod.YEAR); # 2. Get Sales from 1 Year Ago (approx 252 trading days) def salesLastYear = SalesPerShare(fiscalPeriod = FiscalPeriod.YEAR)[252]; # 3. Calculate Growth % def growth = ((salesTTM - salesLastYear) / salesLastYear) * 100; # 4. Display & Color AddLabel(yes, AsPercent(growth / 100), Color.WHITE); AssignBackgroundColor(if growth > 20 then Color.DARK_GREEN else if growth > 0 then Color.GRAY else Color.DARK_RED);
Not sure this copied correctly but I am getting an error message that says invalid symbol fundamental data - after running some other tests it looks like I might have access to some of the data. Can anyone tell if there is something else I am missing - it does the same thing in a price to sales ratio and gross margin.
Thank you for any assistance. I have learned a lot from looking at these posts on here and some of the indicators are awesome.
Jim
Not sure this copied correctly but I am getting an error message that says invalid symbol fundamental data - after running some other tests it looks like I might have access to some of the data. Can anyone tell if there is something else I am missing - it does the same thing in a price to sales ratio and gross margin.
Thank you for any assistance. I have learned a lot from looking at these posts on here and some of the indicators are awesome.
Jim