I'm looking to code an indicator -
"Avg. analyst rating today - Avg analyst rating 5 days ago", filter stocks that have at least 4 analyst ratings.
I used the code below, but it seems to calculate something different - it determines -
"Average(of last 4 upgrades/downgrades that were made)[today] - Avg(last 4 upgrades/downgrades that were made)[1 week ago]" -> This has 2 problems
1) Note that analyst ratings that were not changed are not considered in this formula.
2) Also, 2 of the 4 recent upgrades/downgrades may have happened 3 months ago, but this formula still picks it up.
How do i code the indicator that i need (first one described above)?
CODE:
Please log in to see this code.