CFD and spread bet trading workflows for IG Markets. Covers opening/closing CFD positions, understanding margin and leverage, DFB expiry, overnight funding, and CFD-specific instrument selection. Use when the user wants to trade CFDs, understand leverage, or manage spread bet positions.
Skill for executing and managing CFD (Contract for Difference) and spread bet trades on IG Markets. Use this when the user wants to open, close, or manage leveraged positions.
Trigger phrases: "buy CFD", "sell CFD", "open a trade", "go long", "go short", "spread bet", "leverage", "margin trade", "DFB", "daily funded bet", "open a position on", "trade [instrument]", "what's the margin on".
ig_market before placing a trade to verify min size, margin factor, currency, expiry options, and trading hours.A Contract for Difference is a leveraged derivative. You don't own the underlying asset -- you're trading the price movement. Profits and losses are amplified by leverage.
The deposit required to open a position. For example, a 5% margin factor means you need 5% of the full position value as margin. A £10,000 position requires £500 margin.
margin_required = position_value * margin_factor
position_value = price * size * (contract_size or 1)
The most common expiry type on IG. DFB positions:
-: No expiry (some instruments like FX)The difference between the bid (sell) price and offer (buy) price. This is IG's primary commission on CFDs.
Step-by-step workflow for entering a new trade.
Find the market:
ig_search_markets(searchTerm: "AAPL")
Note the epic from the results. Common epic patterns:
CS.D.AAPL.CFD.IP (CFD), SA.D.AAPL.CASH.IP (spread bet)IX.D.FTSE.DAILY.IP, IX.D.DAX.DAILY.IPCS.D.GBPUSD.TODAY.IPCS.D.USCGC.TODAY.IP (gold)Check instrument details:
ig_market(epic: "CS.D.AAPL.CFD.IP")
Extract and verify:
instrument.minDealSize -- minimum position sizeinstrument.marginFactor -- margin requirement percentageinstrument.currencies -- available currenciesinstrument.expiry -- expiry typesnapshot.bid / snapshot.offer -- current pricessnapshot.marketStatus -- must be TRADEABLEdealingRules -- min stop distance, min limit distanceCalculate margin and present trade summary:
Direction: BUY (long) / SELL (short)
Instrument: Apple Inc (CS.D.AAPL.CFD.IP)
Size: 10 contracts
Price: $185.50 (offer for BUY)
Expiry: DFB
Margin: ~$370 (at 20% margin factor)
Stop: $180.00 (distance: 550 points)
Limit: $195.00 (distance: 950 points)
Risk/Reward: 1:1.7
Wait for user confirmation
Execute the trade:
ig_create_position(
epic: "CS.D.AAPL.CFD.IP",
direction: "BUY",
size: 10,
expiry: "DFB",
currencyCode: "USD",
forceOpen: true,
guaranteedStop: false,
orderType: "MARKET",
stopDistance: 550,
limitDistance: 950
)
Verify the deal:
ig_deal_confirmation(dealReference: "<returned reference>")
Report: OPEN (accepted) or REJECTED (with reason).
ig_positionsdealId, direction, sizeClosing: Apple Inc BUY x10
Entry: $185.50
Current: $190.20
P&L: +$47.00
ig_close_position(
dealId: "<deal_id>",
direction: "SELL", // opposite of BUY
size: 10,
orderType: "MARKET"
)
ig_deal_confirmationYou can close part of a position by specifying a smaller size:
ig_close_position(
dealId: "<deal_id>",
direction: "SELL",
size: 5, // close half of a 10-size position
orderType: "MARKET"
)
After a position is open, modify protection levels:
ig_update_position(
dealId: "<deal_id>",
stopLevel: 7400.0,
limitLevel: 7600.0
)
For trailing stops:
ig_update_position(
dealId: "<deal_id>",
trailingStop: true,
trailingStopDistance: 50,
trailingStopIncrement: 10
)
For entering at a specific price rather than the current market price:
ig_market to get current price and dealing rulesig_create_working_order(
epic: "IX.D.FTSE.DAILY.IP",
direction: "BUY",
size: 2,
level: 7400,
type: "LIMIT", // buy below market / sell above market
currencyCode: "GBP",
expiry: "DFB",
guaranteedStop: false,
timeInForce: "GOOD_TILL_CANCELLED",
stopDistance: 50,
limitDistance: 100
)
Order types:
For EU-regulated accounts, check indicative costs:
ig_costs_open(
epic: "CS.D.AAPL.CFD.IP",
direction: "BUY",
size: 10,
orderType: "MARKET",
currencyCode: "USD"
)
Open a position in the opposite direction on the same or correlated instrument with forceOpen: true. This creates a second position rather than closing the first.
ig_market before presenting trade options.