Job-hopping is one of those time-honored traditions on Wall Street and often provides a way for a banker, trader or executive to get a better title and higher pay.

Inevitably, there is a discussion about how much you were getting paid before and how much you expect to get paid. Such questions are sensitive, of course, and given human nature there is always a bit of the art of the deal when it comes to answering them. Do you bluff, and hope that the new employer doesn’t know, or can’t figure out, what your old firm was paying you in hopes of getting a bigger raise? Or do you play it straight down the middle of the fairway?

That’s all about to change. Thanks to a new law in New York City, signed last month by Mayor Bill de Blasio and set to go into effect in early November, Wall Street — and most other private employers in the city — will no longer be able to ask prospective employees about their salary history and other compensation. Nor will employers be able to search public records to discover a candidate’s payment history. (How that is enforced remains to be seen.) Any candidate who thinks a prospective employer has violated the new law can file a complaint with the city’s Commission on Human Rights, which can impose fines of up to $250,000 per violation.

The idea behind the new law, which was sponsored by the New York City public advocate, Letitia James, is to try to prevent pay inequality between men and women. According to an August 2016 study commissioned by Ms. James, women in New York State get paid, on average, only around 87 percent of what men get paid. Women in New York State earn collectively some $20 billion less annually than do men. In New York City, women get paid nearly $6 billion less than men annually.