# CFD Trading Guide

## Overview

Bitget CFD (Contract for Difference) supports trading on a variety of mainstream assets, covering gold, crude oil, forex indices, and more. Trading pair names follow formats such as `XAUUSD`, `XAUUSD.s`, and `XAUUSD.pro`.

To meet the programmatic trading needs of quantitative teams and algorithmic traders, Bitget Open API supports CFD trading. Traders can use the API to automate order execution, fund transfers, and data queries directly from their CFD accounts.

**Note:** The API does not support opening CFD accounts. Before trading CFD via the API, users must first complete the CFD account opening process on the Bitget website or App. Once your CFD account has been opened, you can start trading through the API.

## Supported API Features

The CFD Open API currently supports the following core features:

1. Trading operations
   - Fund transfers: Transfer assets into or out of CFD accounts.
   - Order execution: Open and close positions at market price, place limit orders, and cancel orders.
   - Risk management: Set take-profit and stop-loss conditions when placing orders, or modify TP/SL settings for existing positions.
2. Data queries
   - Account and historical data: Query CFD account information, historical fund records, and order history.
   - Market data: Access real-time CFD market data and instrument configuration parameters.

## Trading Modes and Instrument Code Rules (⚠️ Important for API Calls)

Each account is assigned to a single trading mode, and instrument code suffixes vary by mode. When calling the order placement API, users must provide an instrument code that matches their account's current trading mode. Otherwise, the system will return an error and reject the order. Details are as follows:

| Trading mode | API instrument code format | Example |
|---|---|---|
| Zero-fee mode | Instrument name with the `.s` suffix | `XAUUSD.s`, `EURUSD.s` |
| ECN mode | Instrument name without a suffix | `XAUUSD`, `EURUSD` |
| Pro mode | Instrument name with the `.pro` suffix | `XAUUSD.pro`, `XAGUSD.pro` |

**Note:** Confirm your account's trading mode before calling the order placement API.

For more details about CFD, please refer to:

- [CFD Beginner's Guide](https://www.bitget.com/support/articles/12560603840554)
- [CFD Trading Mode Explained](https://www.bitget.com/support/articles/12560603894277)
- [Bitget Open API now supports CFD trading](https://www.bitget.com/support/articles/12560603894278)
