Many technical analysts keep a close eye on the relative performance of consumer discretionary ETFs versus the consumer staples sector to gauge risk appetite in the market.

The rationale is fairly simple. Consumer staple companies provide the necessities that households need in any economy. Think toilet paper, razor blades and shampoo.

The consumer discretionary sector by definition includes companies that market and sell nonessential goods and services.

Therefore, Consumer Discretionary Select Sector SPDR Fund (NYSEArca: XLY) can be thought of as the “want” portion of the consumer sector. Consumer Staples Select Sector Fund (NYSEArca: XLP) is the “need” portion.

When “want” is outperforming “need,” some analysts see the trend as bullish for markets and the economy.

“One of the relationships I follow is between consumer staples and consumer discretionary ETFs,” writes technical analyst Andrew Thrasher at his blog. “Often during declines in equities we see a relative outperformance in consumer staple stocks in relation to discretionary names. This can show us if traders are positioned for a ‘risk on’ or ‘risk off’ market environment.”

Indeed, the discretionary ETF has been leading the staples sector since the beginning of August. [Consumer Discretionary ETF Rises to All-Time High]

Since Aug. 1 the discretionary fund XLY has risen 5.7% in price, while XLP is flat.

“During up trends and periods of an expanding economy we normally see discretionary stocks outperform staples as consumers have more flexibility in their spending,” Thrasher notes. “The opposite is often true when the economy begins to falter, investors shift back into consumer staples as shoppers spend more of their paychecks at the grocery store and less at Amazon.com or Starbucks.”

The XLY/XLP ratio is nearing the 2012 high. “We’ll see if it breaks past this level or if XLP can begin to gain ground and start outpacing XLY, giving us a potential sign that traders are starting to take risk off the table,” the analyst said.