Caterpillar  (CAT - Get Report) reports second-quarter earnings before the open on Wed., July 24. The stock has been extremely volatile since setting its all-time intraday high in January 2018. Given earnings volatility, investors and traders need to know the key levels at which to counter-trade these ups and downs. My call is to buy weakness to the 200-day and 50-day simple moving averages at $131.66 and $129.68, respectively, and to sell strength to its semiannual risky level at $145.60.

The stock has been in recovery mode since trading as low as $112.06 on Oct. 29, 2018. From its all-time intraday high of $173.24 set in January 2018, the stock plunged by a bear market 35% to this low. This range continues to be consolidated so counter-trade the levels.

Caterpillar closed the first half of 2019 at $136.29 on June 28, which became a key input to my proprietary analytics. Left over from the first half of the year is the annual value level well below the market at $114.11. The risky level for the second half of 2019 is $145.60, which is just above the risky level for July at $145.47. The third-quarter risky level is well above the market at $170.98.

The daily chart shows the trading range and the weekly chart has been positive since the week of June 21 when the stock closed at $133.89.

Fundamentally, Caterpillar is relatively cheap, with a P/E ratio of 12.03 and a favorable dividend yield of 3.02%, according to Macrotrends.

Analysts expect Caterpillar to report earnings of $3.12 when it reports earnings before the opening bell on Tuesday, July 24. Analysts from Morgan Stanley say the stock is a buy. They conducted a U.S. Construction Dealer Survey,  which showed that demand in North America may be strengthening. Others on Wall Street think that the stock should continue to struggle due to the trade war with China, slowing global economic growth and negative currency volatility.

Caterpillar is a holding in Jim Cramer's Action Alerts PLUS member club . Want to be alerted before Jim Cramer buys or sells CAT? Learn more now.

The Daily Chart for Caterpillar

Courtesy of Refinitiv XENITH

The daily for Caterpillar shows that the stock has had its 50-day and 200-day simple moving averages flip-flopping during 2019, which is why I am ignoring both "golden cross" and "death cross" formations and instead focusing on investor reactions to earnings reports. There was a price gap lower on earnings released on Oct. 23. There was a price gap lower on earnings released on Jan. 28. And, on April 24, there was another price gap lower on earnings. The key to Wednesday's earnings looking for the stock to hold the 200-day and 50-day SMAs are $131.66 and $129.67, respectively, on weakness. The upside is to the monthly and semiannual risky levels converged at $145.47 and $145.60.

The Weekly Chart for Caterpillar

Courtesy of Refinitiv XENITH

The chart shows Caterpillar is positive with the stock above its five-week modified moving average of $134.14. The stock is well above its 200-week simple moving average or "reversion to the mean" at $112.29, last tested during the week of Nov. 11, 2016 when the average was $86.07. The 12x3x3 weekly slow stochastic reading is projected to rise to 67.05 this week up from 60.56 on July 19.

Trading Strategy: Buy weakness to the 200-day and 50-day SMAs at $131.66 and $129.68, respectively. Sell strength to the monthly and semiannual risky levels at $145.47 and $145.60, respectively.

How to use my value levels and risky levels:

Value levels and risky levels are based upon the last nine weekly, monthly, quarterly, semiannual and annual closes. The first set of levels was based upon the closes on Dec. 31. The original annual level remains in play. The weekly level changes each week. The monthly level was changed at the end of each month, the latest on June 28. The quarterly level was changed at the end of June. My theory is that nine years of volatility between closes are enough to assume that all possible bullish or bearish events for the stock are factored in. To capture share price volatility investors should buy on weakness to a value level and reduce holdings on strength to a risky level. A pivot is a value level or risky level that was violated within its time horizon. Pivots act as magnets that have a high probability of being tested again before its time horizon expires.

Disclosure: The author has no positions in any stocks mentioned and no plans to initiate any positions within the next 72 hours.