What is the relationship between S&P500 and the US dollar In the recent past, both the S&amp;P 500 and the USD (against other currencies) have appreciated a lot.

From what I understand, if USD goes up against other companies, the major companies of the S&amp;P 500 suffer because many of them earn foreign revenue in foreign currencies.

So, the S&amp;P500 and the USD should have an inverse relationship with each other.
So how come both S&amp;P 500 and the USD have risen so sharply this year?
You're doing the traditional mistake of people not familiar with Econometrics: You mistake correlation and causality.

You look at a change in the USD, assume it to be exogenous, and then predict an impact onto the S&amp;P. 

However, changes in the USD are not exogenous. For example, an increase in US productivity (compared to the productivity of firms in other countries) will both increase the S&amp;P and valuate the USD.

For what you're trying to do, you need to separate different effects, which is virtually impossible - or look for random variation in the USD, of which I'm also unfamiliar with.