Skip to main content

Risk Warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 84% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. Please click here to read our full Risk Warning.

79% of retail investor accounts lose money when trading CFDs with this provider.

Risk Warning: CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 84% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. Please click here to read our full Risk Warning.

79% of retail investor accounts lose money when trading CFDs with this provider.

Notebook, calculator and pen on a desk
Notebook, calculator and pen on a desk

CFD trading example: worked trade with profit and loss

Prepared by the Libertex team
Content reviewed internally in accordance with regulatory standards.

A CFD trading example shows how a position opens, how much margin the position needs and which costs apply. The example ends with the net result at closing. Working through the numbers is a direct route from theory to practice.

This article calculates five examples: a stock index, a stock, a currency pair, gold and Bitcoin. Each example shows a winning and a losing exit. Libertex is a Stock and CFD Broker, and all five markets are worked through here.

Key takeaways

Example calculations, one per market:

  • Index: a 4,000 USD long index CFD needs 200 USD of margin at 20:1.
  • Stock: round-trip commission moves a 250.00 USD short break-even to about 249.50 USD.
  • Forex: one EUR/USD CFD lot at 1.1000 carries 110,000 USD of exposure.
  • Gold: two nights of financing take 20.00 USD from a 600 USD gross gain.
  • Crypto: a 50% margin means 5,000 USD backs a 10,000 USD Bitcoin CFD.
  • Sequence: every example follows the order exposure → margin → costs → exit.

What a CFD trade involves

Contracts for difference (CFDs) are derivative contracts that track the price of an underlying asset without ownership of that asset. A CFD settles in cash: the trader receives or pays the price difference between entry and exit. Buying a share gives ownership of the asset, while a CFD only reflects its price change.

A long position gains when the price rises and loses when it falls. A short position gains when the price falls and loses when it rises. Confusing the two directions is a common source of calculation errors. Leverage makes CFDs complex instruments, and losses can reach part or all of the capital invested.

Platforms such as MetaTrader 4 and MetaTrader 5 show the position value, margin and open result of each position.

The four building blocks of every CFD trading example

Four inputs drive every calculation in this article.

Position size, margin and leverage

Position value = contract size × price × quantity. Example calculation: a CFD on 100 shares at 50 USD is 5,000 USD of exposure, not the cash deposit. Margin = position value × margin percentage, where the percentage is 1 divided by the leverage ratio (leverage and margin).

The European Securities and Markets Authority (ESMA) set a close-out rule on 27.03.2018. Retail CFD positions close when the account falls to 50% of the minimum required margin. Actual leverage, margin and margin call levels depend on the jurisdiction, account type and broker.

Spread, commission and slippage

The spread is the gap between the bid and ask price, paid at entry. Index and forex CFDs commonly use spread-only pricing, while single-stock CFDs often add a commission, depending on the provider.

Slippage is the gap between the order price and the fill price in fast or illiquid markets. Example calculation: a stop-loss at 100.00 fills at 99.85.

Overnight financing

Overnight financing applies to the full position value: position value × annual rate ÷ 360 (365 for some instruments). The rate is a benchmark, such as SOFR for USD, plus or minus the provider's markup. Example calculation: 4,000 USD × 9% ÷ 360 = 1.00 USD per night, or 3.00 USD over three nights. The 9% is not a Libertex rate.

Stop-loss and take-profit orders

A stop-loss is an automatic exit order that aims to limit the downside at a predefined price. A take-profit closes the trade at a target price. Every example below applies both.

Diagram of the four steps of a CFD trade calculation: exposure, margin, costs and exit

CFD trading example 1: going long on a stock index

A trader expects a major US index to rise and opens a long CFD position.

Opening the position and calculating the margin

Example calculation. The trader opens 1 index CFD contract at 4,000 points (ask price), at 1 USD per point. The position value is 1 × 1 USD × 4,000 = 4,000 USD. At 20:1, the ESMA limit for major indices, the margin is 4,000 × 5% = 200 USD, or 181.82 EUR at EUR/USD 1.1000.

Winning example: closing with a gain

Example calculation. The index CFD closes at a bid price of 4,100 points after three nights. The gross result is (4,100 − 4,000) × 1 = 100 USD. Financing for three nights is 3 × 1.00 = 3.00 USD, so the net result is +97.00 USD. The 1-point spread is already inside the quoted prices.

Losing example: stop-loss triggered

Example calculation. The index CFD stop-loss at 3,950 points triggers after one night. The gross result is (3,950 − 4,000) × 1 = −50 USD. One night of financing costs 1.00 USD, so the net result is −51.00 USD. Here the stop-loss filled at its set level.

CFD trading example 2: short selling a stock CFD

A short CFD on Tesla (TSLA) gains when the price falls, for example before weak earnings, with no borrowing of shares.

Opening the short position: margin and commission

Example calculation. The trader opens a short CFD on 20 TSLA shares at 250.00 USD (bid price), a 5,000 USD position. At 5:1, the ESMA limit for individual equities, the margin is 5,000 × 20% = 1,000 USD.

The opening commission is 5,000 × 0.1% = 5.00 USD. On 1 share, 0.25 USD rises to a 1.00 USD minimum; both values are examples. Round-trip commission of about 10 USD moves the break-even price to about 249.50 USD.

Winning example: price falls

Example calculation. TSLA falls to 230.00 USD after two nights: gross (250 − 230) × 20 = 400 USD. Commission totals 9.60 USD, and a credit of 5,000 × 3.6% ÷ 360 = 0.50 USD per night adds 1.00 USD. The net result is +391.40 USD. The credit applies while the benchmark rate exceeds the provider's markup.

Losing example: price rallies against the position

Example calculation. TSLA hits the stop-loss at 262.50 USD after one night: gross (250 − 262.50) × 20 = −250 USD. Commission totals 10.25 USD, and the 0.50 USD credit brings the net result to −259.75 USD. Commission applies to losing trades too.

CFD trading example 3: trading a forex CFD pair (EUR/USD)

A trader expects the euro to strengthen against the US dollar.

Opening a long EUR/USD position and calculating the margin

A pip on EUR/USD is 0.0001. One standard lot equals 100,000 EUR, and mini and micro lots exist for smaller positions.

Example calculation. The trader opens 1 EUR/USD CFD lot at 1.1000 (ask price), a notional value of 110,000 USD. The pip value is 100,000 × 0.0001 = 10 USD. At 30:1, the ESMA limit for major pairs, the margin is 110,000 ÷ 30 = 3,666.67 USD in the counter currency. In an EUR account, that equals 3,333.33 EUR. A small margin can make a 110,000 USD position look small.

Gain and loss in pips

Example calculation. A EUR/USD rise of 50 pips to 1.1050 gives +500.00 USD, and a fall of 30 pips to 1.0970 gives −300.00 USD. Both trades close the same day, so no financing applies. The 1-pip spread (10 USD) is inside the quoted prices. Thin margins can lead to over-leveraging, because the position grows faster than the account.

CFD trading example 4: going long on a commodity CFD (gold)

Gold CFDs are quoted as XAU/USD, in US dollars per troy ounce. Contract size and point value differ from stock and forex CFDs. A common standard lot is 100 troy ounces, and contract specifications differ by provider.

Example calculation. A gold CFD long on 10 troy ounces at 4,000.00 USD is worth 40,000 USD. At 20:1, the ESMA retail limit for gold, the margin is 2,000 USD. Financing is 40,000 × 9% ÷ 360 = 10.00 USD per night. A take-profit at 4,060.00 USD after two nights gives 600 USD gross, or +580.00 USD net. A stop-loss at 3,970.00 USD after one night gives −300 USD gross, or −310.00 USD net.

CFD trading example 5: going long on a cryptocurrency CFD (Bitcoin)

A Bitcoin CFD long of 0.1 BTC needs 5,000 USD of margin at 2:1.

Crypto margin rules and opening the position

Bitcoin CFDs carry higher volatility, wider spreads and a higher margin than the other four asset classes here. ESMA set crypto CFD leverage for retail clients at 2:1, a 50% margin (27.03.2018). Since 31.07.2019, most EEA national regulators apply these limits through permanent national measures.

Example calculation. A CFD on 0.1 BTC at 100,000 USD (ask price) is a 10,000 USD position with 5,000 USD of margin. The required margin moves with the Bitcoin price.

Winning and losing results

Example calculation. A Bitcoin take-profit at 106,000 USD the same day gives +600.00 USD. The 250 USD spread per BTC is 0.25% of the price. The Bitcoin spread is 10 times the 0.025% index spread, so the break-even move is larger.

A volatility spike triggers the Bitcoin stop-loss at 97,000 USD, but the order fills at 96,400 USD. The planned loss is 300 USD. Slippage adds 60 USD, so the net result is −360.00 USD.

Side-by-side comparison: margin, costs and result across all five examples

Table 1 lists the margin, commission and net results of all five example calculations. Every figure matches the worked examples in this article.

Asset (example)Entry priceMargin required (USD)Commission (USD)Win P&L (USD)Loss P&L (USD)
Index, long4,000 points200Not applied in the example+97.00−51.00
Stock (TSLA), short250.00 USD1,0000.1% per side: 9.60 (win), 10.25 (loss)+391.40−259.75
Forex (EUR/USD), long1.10003,666.67Not applied in the example+500.00−300.00
Gold (XAU/USD), long4,000.00 USD2,000Not applied in the example+580.00−310.00
Bitcoin, long100,000 USD5,000Not applied in the example+600.00−360.00

Example calculation. All figures are hypothetical and include spread, overnight financing, commission and slippage as described in each example. Past results do not indicate future results.

Source: ESMA

Person checking calculations in a notebook

Common mistakes when running CFD trade calculations

  1. Overlooking overnight financing on multi-day holds. The correct calculation adds the nightly charge on the full position value, such as 3.00 USD over three nights in the index example.
  2. Confusing margin with the maximum possible loss. The loss at the stop-loss is measured against the account balance, not only the margin.
  3. Underestimating slippage on volatile assets. A common practice is to allow for a fill away from the order price when setting stop-loss orders, as the Bitcoin example shows.
  4. Leaving round-trip costs out of the break-even price. The break-even calculation includes the spread and both legs of the commission.

Conclusion: applying these CFD examples to a trading plan

Every CFD trade in the five markets follows one sequence: establish exposure, calculate margin, account for spread, commission, financing and slippage, then set exit orders. ESMA retail leverage limits from 30:1 to 2:1 set the margin side of each example. The same calculations can be practised on a demo account before any real capital is used. A demo account does not fully reproduce real market conditions or the psychology of trading with real money.

Frequently asked questions

What is an example of a CFD trade?

A CFD trade is, for example, a long index contract at 4,000 points with 200 USD of margin. A close at 4,100 points after three nights nets +97 USD, and a stop-loss at 3,950 nets −51 USD (Example 1). The figures are hypothetical and informational, not personalised investment advice.

How do you calculate profit and loss on a long CFD trade?

The gross result of a long CFD is (exit price − entry price) × quantity. The net result subtracts commission and overnight financing. The spread is already inside the quoted prices (Example 1).

How is leverage and margin calculated in a CFD trade?

Margin equals position value multiplied by the margin percentage, which is 1 divided by the leverage ratio. ESMA set retail leverage limits from 30:1 to 2:1 by asset class. A 30:1 ratio for major currency pairs means a 3.33% margin (Example 3).

How do overnight financing charges affect the outcome of a CFD trade?

Overnight financing is charged on the full position value for every night a position stays open. On a 4,000 USD index position at an example 9% rate, the charge is 1.00 USD per night (Example 1). A short position can receive a credit instead (Example 2).

Why is CFD trading restricted for retail investors in the USA?

CFDs are generally not available to US retail clients because of how US rules classify them. A CFD on a single security can count as a security-based swap. The Securities and Exchange Commission requires such swaps sold to retail clients to trade on a national securities exchange. The Commodity Futures Trading Commission limits retail off-exchange forex to regulated counterparties.

Disclaimer: This article is provided for educational and informational purposes only. It does not constitute financial or investment advice, independent investment research or a recommendation by Libertex. Any examples, scenarios or forecasts are for illustrative purposes only and should not be relied upon as indicators of future performance. Past performance is not a reliable indicator of future results.

Why trade with Libertex?

  • Get access to a free demo account free of charge.
  • Enjoy technical support from an operator 5 days a week, from 9 a.m. to 9 p.m. (Central European Standard Time).
  • Use a multiplier of up to 1:30 (for retail clients).
  • Operate on a platform for any device: Libertex and MetaTrader.
Back