How many AP exams should I take junior and senior year?
I would recommend taking at least 6 APs over the course of junior and senior year. Which APs those are, of course, is entirely up to you - as Allen says in his article on how to get into Harvard and the Ivy League, there's no point in putting in the hours and hours needed to excel at AP Bio if you have no interest in biology. However, schools are going to want to see that you challenged yourself, and for top-tier schools in particular you'll be pitted against many, many other high-achieving students.
Keep in mind as well that the graph for APs vs value to application is an approximation - there's no data that specifically shows a point of inflection at 4 vs 5 APs. But it is definitely true that there are diminishing returns the more APs you take, especially since each additional AP takes up a lot of time outside of school. And trying to cram in anything more than 7 AP classes into two years seems foolish at best, and soul-killing at most.
Here's a quick breakdown of my AP schedule for high school (that got me into my undergraduate institution, Wellesley College). We had about 17 AP classes as well, but were not offered any AP classes freshman or sophomore year:
Junior year - AP Physics B - AP US History - AP Calculus BC
Senior year - AP Macroeconomics - AP European History - AP English Literature
Now, granted, I didn't have the most traditional AP curriculum (or high school curriculum) trajectory, since I ended up not taking a math or science senior year. In my case, stats conflicted with my foreign language and I decided I'd rather take a second AP history than an AP science I had no interest in taking (especially since I was doing an independent science research project related to my spike on the side). On the other hand, I took as many humanities APs as my school offered/allowed (we didn't have AP English Language, and I could only take 2 out of 3 for Euro, Macro, or Gov senior year), because that's where my interests lay.
The classes you'd want to take for a liberal arts school are definitely different, to some degree, from those you'd take to get into an Ivy League school, so don't take my schedule as a perfect template. But I would definitely recommend taking at least 6 APs unless you already have a firm plan in place to implement your spike and the time you'd need to budget for it means you can't spend that time on AP courses.