When I was approached to write the screenplay for a film that would tell a story about women on Wall Street, I did my research. I started with the data that many of us have seen, showing, for example, how women in financial services fill a small fraction of executive positions despite comprising over half of the industry's workforce. A 2016 Wall Street Journal exploration of the wage gap found that of the 10 major occupation groups where women's earnings lagged most, five were in finance.

But I am a storyteller, not a banker or sociologist. I don't study numbers; I study characters and why they do what they do. When you structure a story, you have to have a sense of your ending. Will your characters succeed or fail to get what they want, and what choices will they make under pressure? With our film, "Equity," this meant making fundamental decisions about the protagonist. Where would Naomi Bishop, an ambitious and accomplished managing director in investment banking, end up at the end of the film? Would she get the promotion she wanted? Would she still be working at the bank? And if not, would she be fired or leave of her own accord?

In researching "Equity," we interviewed hundreds of women (and men) who work on Wall Street, and others who had either retired or changed careers. The women who had stayed, including some who have made it to the executive level, said they loved the work and they considered themselves survivors and warriors. Some of them described beginning their careers in the eighties in an environment that was openly hostile to women. One woman, for instance, was told she could not take on a job involving travel because she was too delicate. There were also frequent stories of men simulating sexual acts around women as they worked. The women who started their careers on Wall Street more recently had less shocking stories. But they still shared the experience that it was a daily struggle to thrive in a relentlessly male-driven environment.

Margo Epprecht's 2013 article in The Atlantic explores these issues in all their complexity: unconscious bias that creates a pay gap or limits advancement; outright discrimination; sexual harassment and an environment characterized by demeaning "bro talk;" and the difficulties of juggling career and family. I heard about all of these concerns from the women I interviewed too.

While writing "Equity," I was focused on the journey of my character, the question of what Naomi would gain and what she ultimately loses. But when I had the chance to see the movie, to watch Naomi — played by the remarkable actress Anna Gunn — walk out of the bank at the end, head held high, something else struck me: what the bank loses at the end. How much potential is wasted when a valuable member of the organization walks out that door?

In the movie, Naomi is excellent at her job. She should be an asset to the company. This reflects the real-life value to a company of more equal gender treatment. Recently, data has begun to teach us that diverse leadership is essential — not just for its social value, but because it creates stronger and more successful institutions. And so I ask again: How much potential walks out the doors of companies? And what would these companies be capable of if they did the deep and constructive work it takes to make these people want to stay?

The last movie about female executives on Wall Street was "Working Girl" in 1983. I remember feeling euphoric in the theater watching the end of the movie. Carly Simon's "Let the River Run" plays as the camera pulls back to show the new office of the character played by Melanie Griffith — until it is lost in a sea of Manhattan office windows. The music is joyous and the feeling is one of optimism. Anything is possible if a secretary from Staten Island can become an executive using her own smarts.

The feeling at the end of "Equity" is very different. Naomi faces her boss as he tells her once again: "This doesn't look like your year." Naomi turns and walks out of the bank because she finally understands that here, in this place, in this culture, she is not going to get her due. We talked to many women who spoke about getting out, whether that meant leaving financial services altogether or finding an environment that was more supportive of their goals. In the original draft of the film's script, Naomi starts her own fund. This is the happy ending we would want for her — that she can be her own boss and do the work she loves on her own terms. But ultimately, the film felt stronger with a more ambiguous ending, one that leaves the audience wondering where Naomi will go next. We've established her as a fighter and as a resilient woman, so I trust that the audience believes that she will find her way forward.

At screenings of the film, audience members sometimes ask: do you think this film will inspire women to go to work on Wall Street? They seem concerned that our movie might have the opposite effect — young women in the audience will feel discouraged by our cautionary tale of glass ceilings and bias. But my collaborators and I never set out to make a recruitment tool for the financial services industry. We set out to tell a gripping story, to explore — as authentically as possible — the experience of women in this field, and to reflect certain truths. And the truths that we encountered in our interviews were not pretty. They did not contain a lot of happy endings. So we made this movie, with this ending.

Albert Camus said, "Fiction is the lie through which we tell the truth." And my hope is that if "Equity" does not inspire women to commit to banking, it may do something even more important — it may inspire banking to commit to women.

Amy Fox is the screenwriter for the movie "Equity." (The movie is expected to become the basis for a television series on ABC.)

Editor's note: This post is part of an ongoing series looking at diversity issues in banking and finance. Please see previous posts in this series from RBC Capital's Mike Meyer, BMO Harris Bank's David Casper and the SEC's Mary Jo White, and visit American Banker's Women in Banking page.