How to screen for durable refining margins
A wider refining margin can lift a refiner's earnings fast. It can also make one strong quarter look like a durable business improvement. The useful screen asks whether the margin surge reached free cash flow, whether the improvement lasted beyond one filing, and whether the balance sheet can handle the next contraction.
That distinction matters this week. The US Energy Information Administration reported on October 5 that refinery utilization averaged 95% in the third quarter. Gasoline crack spreads were more than twice their year-earlier level, while distillate and jet-fuel spreads were nearly three times their prior-year averages. Those are strong conditions for refiners. They aren't proof that today's trailing earnings belong in tomorrow's valuation.
What does a wider crack spread tell you?
A crack spread is the wholesale price of a refined product minus the cost of crude oil used to make it. EIA's October analysis calculates the spread from New York Harbor spot prices for gasoline, diesel, or jet fuel less Dated Brent crude. It's a rough gauge of what a refinery earns before labor, energy, maintenance, transport, depreciation, interest, and tax.
The word rough is doing work. Refineries don't all buy Brent at the same price or produce the same mix. A complex Gulf Coast plant and a smaller coastal plant can face different crude discounts, freight bills, product yields, and regional demand. Planned maintenance changes how much capacity is available. Unplanned outages can make product prices rise while the broken refinery misses the benefit.
Still, the quarter was plainly favorable. EIA says US refiners processed more crude than in any third quarter since 2019, even though 2019 refining capacity was 4% higher. For the week ending September 25, distillate inventories stood 13% below their prior five-year average and gasoline inventories were 7% below. Scarce products supported the spread between crude and fuel.
The pressure hadn't vanished by today's forecast. EIA's October Short-Term Energy Outlook says September retail gasoline averaged $4.35 a gallon and diesel averaged $6.29. East Coast distillate inventories were 32% below their seasonal five-year average, and the agency expects them to remain 20% to 30% below average through winter. Those inventory figures explain why product margins can stay wide even when crude itself is expensive.
They also show why a refiner screen mustn't become an oil forecast in disguise. EIA observed Brent averaging $114 a barrel in September, then forecast $105 for the fourth quarter and $84 for 2027. The agency also warned that near-term price moves may be more volatile than its forecast indicates. Crude can fall while product spreads stay wide, or rise faster than fuels and squeeze them. One commodity price doesn't settle refinery economics.
Why can a strong quarter fool a stock screen?
Most valuation screens use a trailing window. Trailing twelve months, or TTM, means the most recent filed quarters combined into one year. It smooths maintenance schedules and seasonal demand better than a single quarter. It also carries an exceptional quarter until that quarter rolls out of the window.
Marathon Petroleum shows the size of the current step-up. Its August 4 filing reported Refining & Marketing segment adjusted EBITDA of $6.655 billion in the second quarter, against $1.890 billion a year earlier. Adjusted EBITDA is management's segment measure. It excludes depreciation, financing costs, planned turnaround costs, and selected adjustments, so it isn't free cash flow and it isn't a clean substitute for operating income. The comparison does establish that the operating backdrop changed sharply.
A trailing earnings yield will absorb that change. The numerator rises, the market value may not rise by as much, and the refiner appears cheaper. That may be a real repricing opportunity. It may also be a peak-margin numerator wearing the label “value.” Earnings yield only works when you inspect what the numerator represents.
Cash can flatter the same way. Strong margins generate cash when they reach the refinery's own accounts, so a cash-conversion check may confirm the boom without distinguishing a durable operator. Inventory movements complicate the quarter further. Rising crude and product prices increase the cash tied up in tanks. Selling older inventory can release cash or create accounting gains. The cash flow is real, but its timing doesn't tell you what the next margin cycle looks like.
This is the same capital-cycle problem from another direction. Refiners need maintenance, catalyst work, environmental projects, and periodic turnarounds. EBITDA adds back depreciation, while capex and depreciation arrive on different clocks. A refiner can report a wide crack spread and strong EBITDA while a heavy maintenance bill sits just outside the quarter. Free cash flow after capex is the harder test, provided you inspect the working-capital movements behind it.
What does durable margin strength look like?
Don't ask one ratio to certify the cycle. Split the idea into claims that can disagree.
Current operating margin is trailing operating income divided by trailing revenue. It keeps depreciation and normal operating costs in the numerator, unlike EBITDA. Revenue can be noisy for refiners because crude prices pass through sales and purchase costs together. Compare a company with its own history. One universal margin ranking across unrelated industries won't answer this question.
Margin direction compares the newest reported quarter with the same fiscal quarter a year earlier. This asks whether the filed improvement survived the seasonal match. It doesn't prove that margins will remain high. It stops one trailing total from hiding which quarter changed.
Free-cash-flow margin divides trailing free cash flow by trailing revenue. It asks whether cash remained after capital spending. The ratio can still be distorted by inventory and payables, which is why operating cash flow needs to be read against earnings. It isn't a verdict by itself.
Balance-sheet room compares debt net of cash with trailing EBITDA. A cyclical margin thesis needs this because the trough eventually arrives. Negative EBITDA makes the ratio meaningless, and cash may be committed to inventory, maintenance, or collateral. Use the number as a first pass, then read the debt footnote and capital plan.
There is one more boundary: segment purity. Integrated oil companies earn money upstream, in pipelines, chemicals, and retail as well as refining. Consolidated operating margin can improve because crude production did well while refining weakened. A market-wide screen can't infer pure refining exposure from the statements alone. Restrict the research universe to businesses you have classified as refinery-led, or treat segment revenue and income as a filing check after the quantitative pass.
How would you write the screen?
The shape below is illustrative. The bundled templates and Quantery's thesis documentation are the reference for exact fields. The expressions themselves were validated against the current thesis compiler. The thresholds are proposed research parameters.
# Refinery margin durability, illustrative
params:
margin_strong: 0.10
margin_ok: 0.05
fcf_margin_floor: 0.03
leverage_max: 2.0
features:
revenue_ttm: ttm(revenue)
operating_income_ttm: ttm(operating_income)
operating_margin: if(revenue_ttm > 0,
operating_income_ttm / revenue_ttm, null)
fcf_ttm: ttm(free_cash_flow)
fcf_margin: if(revenue_ttm > 0, fcf_ttm / revenue_ttm, null)
revenue_q: newest(revenue)
revenue_q_prior: lag(revenue, 4)
operating_income_q: newest(operating_income)
operating_income_q_prior: lag(operating_income, 4)
operating_margin_q: if(revenue_q > 0,
operating_income_q / revenue_q, null)
operating_margin_q_prior: if(revenue_q_prior > 0,
operating_income_q_prior / revenue_q_prior, null)
margin_change_yoy: operating_margin_q - operating_margin_q_prior
cash: newest(cash)
debt: newest(total_debt)
ebitda_ttm: ttm(ebitda)
net_debt: debt - cash
leverage: if(ebitda_ttm > 0, net_debt / ebitda_ttm, null)
criteria:
current_margin:
rules:
- { when: "is_null(operating_margin)", score: 0 }
- { when: "operating_margin >= $margin_strong", score: 2 }
- { when: "operating_margin >= $margin_ok", score: 1 }
- { else: 0 }
cash_backing:
rules:
- { when: "is_null(fcf_margin) or fcf_ttm <= 0", score: 0 }
- { when: "fcf_margin >= $fcf_margin_floor", score: 2 }
- { else: 1 }
balance_sheet:
rules:
- { when: "is_null(net_debt)", score: 0, flag: no_net_debt }
- { when: "net_debt <= 0", score: 2 }
- { when: "is_null(leverage)", score: 0 }
- { when: "leverage <= $leverage_max", score: 1 }
- { else: 0 }
margin_direction:
rules:
- { when: "is_null(margin_change_yoy)", score: 0 }
- { when: "margin_change_yoy >= 0", score: 2 }
- { when: "margin_change_yoy >= -0.02", score: 1 }
- { else: 0 }
gate:
mode: strict
newest() keeps each quarter's revenue and operating income in the same filing position. Debt and cash get the same treatment, and a missing debt fact stays missing: the no_net_debt guard scores it zero instead of letting an unknown balance read as net cash. lag(field, 4) is positional, so missing filings can break the intended year-over-year match. Inspect the fiscal periods behind every result. A trailing function can also sum fewer than four populated values. Require complete history during review; the “TTM” label doesn't guarantee it.
A strict gate makes every leg matter. That's useful for studying financially resilient operators, but it can exclude a genuine recovery whose prior-year comparison remains weak. Run a score-gated version beside it. If the conclusion depends entirely on forcing all four criteria through one doorway, you've learned about the gate before you've learned about refiners.
What would a backtest establish?
Backtest the screen within the same refinery-led universe, then remove one criterion at a time. The core hypothesis is that cash-backed, lower-leverage margin improvement behaves differently from high-margin results without those supports. Use point-in-time filings and enter only after each filing became public. Every result is hypothetical and excludes trading costs.
Test more than one starting environment. A study beginning in a product shortage can reward the companies with the strongest current numerator and mistake that exposure for durability. Split qualification events by whether industry crack spreads were high or ordinary, using the historical value known on each date. Keep the macro condition outside the company score unless you've built a properly vintage-aligned series.
Then shorten and lengthen the holding period. Refinery economics can turn before a full trailing year notices. If a result appears only at one holding window, it may be measuring the chosen calendar. Check turnover as margins cross the gate, because excluded spreads and slippage matter when a cyclical rule repeatedly admits and ejects the same names. A sound backtest records what the rules would've done; it doesn't turn this quarter's shortage into a forecast.
The current spread surge gives you a clean reason to run the experiment. Start with the filed footprint, keep segment exposure as a manual check, and make every assumption movable. When product inventories rebuild or crude takes another path, change the condition and run the same rules again.
Research tooling, not investment advice. Nothing here is a recommendation to buy, sell, or hold any security. Screens, scores, and backtests are informational only; backtested results are hypothetical, exclude costs such as commissions and slippage, and do not guarantee future results. Verify against primary filings and make your own decisions.
Want to try this on your own rules? Quantery is free for 14 days: the full app, no card required.
← All articles