Amazon shares have surged 20 percent this year, but one technician warns the stock could see a pullback in the near future.

Craig Johnson, senior technical strategist at Piper Jaffray, is concerned that Amazon shares are trading in overextended territory and said it could be following a pattern from years past.

"It's very similar to what you'd seen back in early 2013, also in early 2016. When you got this far extended usually there was some sort of setback and a healthy correction that took place," Johnson said on CNBC's "Trading Nation" on Thursday.

Amazon slumped 5 percent in April 2013 and another 7 percent in August after trading at 160 times forward earnings at the beginning of that year. In the previous 12 months before the April pullback, Amazon shares had rallied 32 percent.

Despite a retreat in April and August of 2013, the stock ended the year 59 percent higher. Losses picked up in 2014, and its shares ended the year 22 percent lower.

Then, in 2016, Amazon slumped 13 percent in January and another 6 percent in February after peaking at an all-time high of 881 times forward earnings a year earlier. Over the previous 12 months to the January retreat, shares had risen 118 percent. Amazon ended 2016 around 11 percent higher.

Amazon's current fundamentals suggest its share price is expensive at the moment, says Michael Binger, senior portfolio manager at Gradient Investments. Free cash flow, a metric Amazon CEO Jeff Bezos uses to measure company health, relative to earnings price puts the company at an extreme premium to its peers.

Binger expects free cash flow to grow 30 percent through to 2019. At its current price, that represents a 33 times free cash flow multiple. Its high-growth peers — such as Facebook, PayPal and Adobe — trade around 25 times estimates free cash flow for 2019.

By a more traditional metric, the price-to-earnings ratio, Amazon is still well above its peers. The e-commerce company trades at 165 times forward earnings. That's at least 6 times the PE ratio of Facebook, Apple, PayPal and eBay. Walmart trades at 22 times forward earnings, Costco at 28 times and Target at 15 times.

Amazon's 20 percent runup in the year to date is roughly triple the 's gains. The Consumer Discretionary SPDR ETF, which weights Amazon at 17 percent, is up 10 percent in January.

Amazon spiked this week and reached all-time highs after D.A. Davidson set a $1,800 price target on Amazon, the highest on the Street by a wide margin. That target outpaces the second-highest by $200 and implies 29 percent upside to current levels. Analysts adjusted their target based on optimism over Amazon's growth in cloud computing and increased third-party sales on its platform. Brokerage firms have an average buy rating and $1,371.88 price target on Amazon, according to those surveyed by FactSet.

Trading in Amazon shares could become more active when the company reports earnings next week. Analysts expect quarterly earnings of $1.88 a share, up from $1.54 a year earlier, and for sales to surge nearly 37 percent year over year. Amazon reports alongside Apple and Alphabet on Thursday, Feb. 1.