President-elect Donald Trump’s pick to run the Health and Human Services Department traded more than $300,000 in shares of health-related companies over the past four years while sponsoring and advocating legislation that potentially could affect those companies’ stocks.

Rep. Tom Price, a Georgia Republican, bought and sold stock in about 40 health-care, pharmaceutical and biomedical companies since 2012, including a dozen in the current congressional session, according to a Wall Street Journal review of hundreds of pages of stock trades he filed with Congress.

In the same two-year period, he has sponsored nine and co-sponsored 35 health-related bills in the House.

His stock trades included Amgen Inc., Bristol Myers Squibb Co. , Eli Lilly & Co., Pfizer Inc. and Aetna Inc.

His largest single stock buy was an August 2016 purchase of between $50,000 and $100,000 of an Australian biomedical firm, Innate Immunotherapeutics Inc., whose largest shareholder is a GOP congressman on the Trump transition team, according to the filings, which list price ranges. . The stock has since doubled in price.

Phil Blando, a spokesman for Mr. Price and the Trump transition, said in a statement that “Dr. Price takes his obligation to uphold the public trust very seriously,” that he has “complied fully with all applicable laws and ethics rules governing his personal finances,” and that, if confirmed, he would comply with the law.

Mr. Price declined to answer detailed questions, such as whether he made trades through a broker.

Mr. Price, an orthopedic surgeon who chairs the House Budget Committee, has played an influential role in shaping health legislation. He sits on the Ways and Means Committee’s health panel, which oversees Medicare. He also is a member of the Republicans’ Congressional Health Care Caucus that has called for repeal of the Obama administration’s landmark health overhaul.

Mr. Price’s trading is likely to be a significant issue during his Senate confirmation hearings. Allegations of abusive trading by members of Congress in recent years led to a 2012 law—the Stop Trading on Congressional Knowledge (STOCK) Act—that bars members and employees of Congress from using “any nonpublic information derived from the individual’s position…or gained from performance of the individual’s duties, for personal benefit.” The law also requires members to report their trades within 45 days.

Before the 2012 law, trading by a number of lawmakers had come under scrutiny. Among the most prominent was Spencer Bachus, an Alabama Republican. The former chair of the House Financial Services Committee made more than 200 trades in stocks and options in 2008 amid the financial crisis, often carrying out several trades a day.

The trading led to profits of about $28,000, according to his financial disclosure forms at the time. He stopped trading in 2010, he told The Wall Street Journal, because he disliked the media attention it brought.

In 2012, House ethics investigators cleared Mr. Bachus of allegations he had traded stock based on inside information he received during his duties as the top Republican on the House panel.

Some lawmakers have since gone out of their way to avoid even the appearance of conflict that they are placing profit over policy. Ethics lawyers in both parties have advised against trading even if it is legal.

“It is a real risk, and that’s why many members choose to give up investing in individual stocks and instead focus their portfolios on mutual funds or other similar investment vehicles,” said Rob Walker, former chief counsel to House and Senate ethics committees.

Mr. Price also has traded in shares of railroad companies (Kansas City Southern Railway Co.), technology ( Alphabet Inc., Facebook Inc. ) and tobacco stocks, including Altria Group Inc., whose products are regulated under the Food and Drug Administration, a part of HHS.

If approved for the HHS post, Mr. Price would be required by federal law to sell stock in companies regulated by HHS, or recuse himself from matters regarding them.

Senate committees that will hold hearings on his nomination are expected to examine whether Mr. Price had access to nonpublic information about health-care legislation and policy that could directly affect the stock prices of companies in which he invested, according to people familiar with the matter.

The health-care industry is Mr. Price’s biggest patron. In 2015 and 2016, he received about $730,000 in campaign donations from health professionals, insurers and drug companies, more than from any other industry, according to the Center for Responsive Politics.

Over his six terms, he has raised about $15 million, and about $4.8 million came from the health sector. Insurer Aetna donated a total of $10,000 to Mr. Price in 2015 and 2016 through its PAC. Pfizer, the drug giant, donated $3,500 through its PAC. Eli Lilly gave $5,000.

Eli Lilly and Pfizer declined to comment. Aetna didn’t respond to requests for comment.

Mr. Price has made dozens of trades since 2012. On March 17, 2016, he made 70 trades, adding, among other things, to his holdings of Aetna by as much as $15,000, disclosure reports say.

As he has bought Aetna stock, Mr. Price has championed his own legislation to replace the Obama administration’s Affordable Care Act.

The Empowering Patients First Act would provide refundable credits for people to buy insurance if they don’t have access to employer or government plans. Such credits could be used to purchase Aetna and others’ insurance. On the other hand, Aetna and others are set to benefit from certain provisions of the 2010 health law that Mr. Price’s bill would replace.

On Election Day, Aetna was selling at $112.77. It has gone up since then, closing at $124.69 in New York Stock Exchange composite trading on Thursday.

The largest shareholder of Mr. Price’s biggest stock buy, Australia’s Innate Immuno, is Rep. Chris Collins (R., N.Y.), with a 17% stake, according to the company’s website. Mr. Collins, a member of the Trump transition team, also sits on the company’s board.

Mr. Price’s purchase of between $50,000 and $100,000 of Innate Immuno stock on Aug. 31, 2016, came two days after Mr. Collins made a purchase of four million shares worth between $500,000 and $1 million, according to disclosure statements.

Innate Immuno’s chief executive, Simon Wilkerson, said at investor presentations this year that its future depends on an experimental drug to treat an advanced form of multiple sclerosis, which is currently in clinical trials.

One law enacted this month that could benefit Innate Immuno is the 21st Century Cures Act, which authorizes spending $6.3 billion for medical research, including $500 million for the FDA to speed up drug approvals.

A key provision that would permit clinical trials of new medical treatments to proceed more quickly was written by Mr. Collins as a member of the health panel of the Energy and Commerce Committee.

In a statement, Mr. Wilkerson said his company’s drug is governed by regulations in Australia and New Zealand, so it won’t be deeply affected by the 21st Century Cures Act.

“As to any specific benefit to our Company and our clinical programme,” he added, “there is most likely none at all as the programme will be sold well before any approvals are sought from international regulators.”

Mr. Collins said in his hometown newspaper, the Buffalo News, that his authorship of legislation wasn’t a conflict of interest, but rather an instance of bringing his business knowledge to the Congress.

A spokesman for Mr. Collins said he used his business experience and meetings with patients and regulators to write legislation that “will put patients first and get cures more quickly to those who need them most.” The statement added that Mr. Collins “has followed all ethical guidelines related to his personal finances.”

Both Mr. Price and Mr. Collins voted yes for the bill’s final House vote in November, just three months after they bought more stock in the company.

The closing price on the Australian Exchange on the day Mr. Price made his purchase was A$0.41, and it closed on Thursday at A$0.85. That means that Mr. Price’s holdings have paper gains of between $50,000 and $100,000.

—Louise Radnofsky

and Tom McGinty contributed to this article.