When it comes to holiday travel, it is generally true that the earlier you book, the better though there are several factors at play.

“One of the problems is that everybody looks for a rule of thumb, and it is different depending on the market you are traveling,” said Patrick Surry, the chief data scientist at Hopper, a website and app that advises travelers when to book flights.

But timing really can be everything when it comes to locking up the best holiday airfares. Here are five guidelines to follow if you want more money to spend on presents this winter.

— You Can Wait, but Not Too Long

A survey by the travel search company Skyscanner found that 39 percent of holiday travelers say they prefer to book four to six weeks before departure, with the rest choosing to book months, if not one full year, in advance.

If you’re in that group that has procrastinating in its blood, you still have some time before things really get out of hand.

“The prices start off pretty high, because people tend to have limited flexibility when it comes to Thanksgiving,” Surry said. “But they stay flat up until probably three weeks out, when they start to ramp up, and in the last 10 days they really spike.”

Last year, the lowest ticket prices for Thanksgiving week were available about 60 to 70 days before departure, or late September, according to data analyzed by Hopper.

If you book between now and the end of October, you’ll likely spend around $325 for an average domestic flight, according to Hopper. Waiting until November will cost about $58 more a ticket, according to analysis by CheapAir.com. Hopper puts it at about $1.50 per day during the first weeks of November; $6 per day 10 days out from Thanksgiving.

Sticking with the holiday theme, Surry said Halloween is a good marker for when you should have your Thanksgiving travel plans sorted out.

Thanksgiving week is also a good guidepost for when to have your Christmas travel plans settled though Hopper said booking in early October will give you the best rates. Skyscanner predicts that, based on its 2015 data, booking Thanksgiving week could offer savings of 6.41 percent

compared with rates available after.

— The Day of the Week Matters

Most people would love not to travel on the Wednesday before Thanksgiving just to avoid the crowds, but it’s also one of the most expensive days to fly, along with the Saturday before and the Sunday after, Surry said.

According to CheapAir.com, the Friday after Thanksgiving is not just good for retailers. Along with the following Tuesday, it’s the cheapest return day. Hopper said flying on any day that week but Wednesday will be about 20 percent cheaper.

— More Flexibility, More Savings

If you’re just looking to get away, the more options you consider, the better rate you may find.

“I think people have a lot more flexibility when it comes to when they’re going to travel and where they’re going to travel,” Surry said of Christmastime travel. “You know you’re all not necessarily going home for that holiday.”

According to Hopper, Christmas Eve, Christmas Day and New Year’s Eve are the cheapest days to fly for the winter holidays. Departing on Tuesday, Dec. 20, and returning Thursday, Jan. 5, is the next best bet. Flexibility will also put Cyber Monday into play. Hopper said great deals were spotted last year in the week following Thanksgiving, “if you’re willing to travel at sort of strange times,” Surry added.

— Don’t Expect Last-Minute Deals

Unless you’re really spontaneous, and don’t really want to see your family, there’s no good reason to gamble on last-minute bargains.

“Particularly around the holidays, there’s such an increase in demand that you’re much less likely to find a bargain, unless you have complete flexibility on where you’re going to go,” Surry said.

Expedia.com analysis of 2015 data from September through November confirmed that airfare for Thanksgiving week was at its peak within six days of departure (an average of $390).

— Set Up Email and Mobile Alerts

Because the cost of your airfare also depends on where you’re going, you might want to safeguard yourself from a fluctuating marketplace. Google Flights, Hopper, Skyscanner and others can notify you via email or with smartphone notifications when a fare changes and may be at its lowest.