Jerry had some action figures on a shelf in his room. Later he added 7 more action figures to the shelf. If there are a total of 10 action figures on his shelf now how many action figures did he have initially on the shelf?

Let's use $a$ to denote the number of action figures he had initially on the shelf. 

Now, we know that after he bought $6$ action figures, he had $2a+6$ action figures on the shelf. 

We also know that after he sold $5$ action figures, he had $2a-5$ action figures on the shelf. 

So, we can set up the following equation: 

$2a+6=2a-5$

$a=11$

Therefore, he had $11$ action figures initially on the shelf.