Christopher Nolan's suspenseful World War II drama, Dunkirk, has been a box office hit this summer. Set about two years before America entered the war, the movie tells the true-life tale of British and French armies awaiting a miraculous evacuation as Nazi German forces close in. The story is told through the eyes of two seemingly divergent groups; a band of British soldiers desperately trying to survive on the beaches of Dunkirk and everyday British civilians as their unlikely saviors. In scene after gripping scene, British civilians are shown crossing the English Channel in their private yachts and fishing boats to help evacuate besieged Allied soldiers as outnumbered British pilots hunt down German dive bombers unleashing hell on the soldiers and boats below.

As only good movies can, Dunkirk transports viewers into the heart of the action and helps them feel the desperation of the brave soldiers and sailors that lived through those harrowing times. As is often the case with these types of movies, watching it made me extremely grateful for the brave servicemen and women who have died fighting to keep evil at bay. It is because of their heroic actions that we can enjoy the freedom that we do.

Being an investment writer, I also couldn't help but see some parallels between two of the lessons at Dunkirk and investing. (Warning: Mild spoiler alerts follow.)

A British Spitfire, a World War II fighter plane, sits on a runway against blue sky with clouds.

Like the British use of its war planes and ships, investors must prioritize investment opportunities. Image source: Getty Images.

1. Live to fight another day. 

Near the end of the movie, weary British soldiers step off the rescue boats onto their homeland thinking they have let their country down. After all, Dunkirk was merely a miraculous escape after being defeated across the European continent at the hands of the German Panzer divisions. When an old man hands out food and drinks to the soldiers as they straggle by, he greets them with a "Well done". A soldier incredulously replies, "All we did was survive ." "That's enough," the old man replies back.

In a similar way, sometimes it's enough for the remainder of our money to survive after making a losing investment. Making the tough, but sometimes necessary, decision to sell after seeing a stock's price fall can be hard. Often we will engage in behavior called "price anchoring."

Most investors are probably very familiar with this phenomenon. To pick a totally random example that has no bearing on my past or present portfolio, let's say I know a friend who bought Infinera in early 2015 at about $22 per share. Well, one thing led to another and by the end of the year the stock was trading for around $16 per share. Now, if my, uh, friend had honestly evaluated the situation he probably would have discovered that his original investing thesis was broken and taken the opportunity to sell the stock. It is never fun to admit a wrong decision and take a double-digit percentage loss on an investment. But it is far better for the majority of your investment money to survive a bad decision and live to fight another day than for it to languish in a stock that might never recover its former heights.

But did I do ... I mean ... did my friend do this? No! Instead, he looked at the price and thought to himself that, after the stock price ticked up again, he would sell it once it broke even. After all, he didn't want to sell for a loss! Of course, the stock price has yet to recover and, even if it had, the opportunity cost would have been enormous. My "friend" finally sold it at around $10. Ouch!

It's important to have a clear, well-thought-out thesis when investing in individual companies. Every investor makes bad investments so learn to recognize these mistakes and to discern the difference between a broken thesis and one that just needs more time to play out. If a thesis is broken, rescue the remainder of your investment so that it survives to "fight" another day. There is no need to follow a bad investment down to oblivion.

2. Choose your battles carefully.

In one scene in the movie, a British naval officer was conversing with a British army officer on the pier while waiting for more military ships to arrive to evacuate troops. Just one day earlier, German dive bombers had sunk a British destroyer as it was leaving full of evacuating troops. When the army officer only sees one destroyer on the horizon, he asks where the other destroyers are. The British naval officer explains that, from this point forward, the British Navy was only going to commit one destroyer at a time to the Dunkirk evacuation. When the army officer demands to know why, the naval officer tells him the navy is saving them for the next battle.

"What next battle?!?", the army officer demands.

"The one for Britain," the naval officer replies somberly.

The horrible reality at that point in the war was that Britain had to prioritize its military's commitments. It had precious few ships and troops, and made the decision to reserve the majority of its warships for a possible Nazi invasion.

All investors, from the youngest among us just beginning to make deposits into new IRA accounts to Warren Buffett, only have a finite amount of resources to pour into investments. It is, therefore, of the utmost importance to prioritize your investment opportunities. Remember that you don't have to invest in every single stock you come across. Instead, to borrow a baseball analogy, wait for the fat pitch.

For different people this might mean different things, but that's OK. There are several ways to invest successfully. What's important to know is that you don't have to invest in a company just because you got a "hot tip" from a friend or because you heard a talking head on TV speak favorably of an idea. Instead, wait for a company that you understand and that is within your circle of competence, a valuation that you're more comfortable with for a company you like, or a company that you've studied and hold a particularly high conviction for its success.

Whatever the case, remember that it's your money and, unlike baseball, there's no striking out in investing. Wait for the pitch you like. Choose your investments carefully.