If there's something seemingly hinky about the way the market's been acting of late - even through July - you're not crazy. This has been a very unusual environment. What's odd about it? Everything's going up. Stocks (including foreign stocks), bonds, commodities (especially gold), are all well up from their March lows.
The graphic below puts things in perspective. Since March's low, stocks (as proxied by the S&P 500) are up 45%. Gold's up 30% thanks to a rally that really heated up in July, although commodities technically did even better in June and July. They just started that advance from their big low hit in April. International stocks, as measured by the International Index of ADRs, are up right around 27%, following the S&P 500 most of the time since March's bottom. Even bonds have mustered a 7% gain from that March trough, not entirely assisted by a corresponding decrease in the Fed's target interest rates. The only loser in the bunch? The value of the U.S. dollar, which explains a great deal of this simultaneous winning from unlike groups.
It's odd in more ways than one, but the biggest oddity is that between stocks, bonds, and commodities - gold in particular - at least one of those groups is generally leading at the expense of at least another one. Gold is seen as a hedge when stocks are too risky. Bond is seen as a safe haven when stocks are too risky. Gold holds its value when bonds might not. Each of these relationships works in the other direction too. Of late though, there's been no asset not worth buying into. The broader commodities category and international stocks are also subject to rotation, albeit to a lesser degree. [That is to say, for example, international stocks aren't necessarily a huge beacon of safety if U.S. stocks like those in the S&P 500 are being seen as riskier.]
As for the way, a lot of it - but not all of it - has to do with the sinking value of the U.S. dollar.
Contrary to what some might suggest, there's no measurable corollary relationship between stocks and the greenback. That's not to suggest the two aren't ultimately linked together. But, it is to say one doesn't have a direct impact on the other. They're both pressured by external forces, and both exert pressure on other facets of the market.
All other things being equal though, a weakening dollar is good for U.S. stock prices simply because U.S. stocks are priced in U.S. dollars. That weaker dollar makes stocks (even if not they're underlying companies) more attractive.
There is a direct relationship between bond values and the U.S. dollar though, just as there's one between the U.S. dollar and commodities. A weaker dollar leads to stronger commodity prices, and vice versa, while a weaker dollar corresponds to lower yields... or rising bond prices. Conversely, falling bond prices (and therefore rising yields) is associated with a strengthening dollar. In this light, most everything about the chart above makes sense.
The only problem? Stocks have been rising with bond values, and gold prices. That can happen for a short while, but it's difficult to sustain just because of a falling U.S. dollar - a weakening greenback eventually creates other problems, like making overseas goods expensive to purchase. It's most definitely difficult to sustain this sort of simultaneous price appreciation for this long, which suggests "something has to give," and soon.
Which of these legs will be the one to snap out of its current trajectory and move in the opposite direction? That's anybody's guess. It's possible more than one component of the chart above could reverse course. The only thing that's for sure is, this is a rather unusual situation. Those scenarios tend not to last for too terribly long.