From a6d88b4a09cf5e65ebc9807d601be43b9b727a85 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 23 Jan 2025 19:46:45 +0800 Subject: [PATCH] add margin trading topic doc --- README.md | 4 ++-- doc/topics/margin.md | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 doc/topics/margin.md diff --git a/README.md b/README.md index 6a79e77a29..1549fb91c8 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ the implementation. ## Supported Exchanges - Binance Spot Exchange (and binance.us) -- OKEx Spot Exchange +- OKX Spot Exchange (previous OKEX) - Kucoin Spot Exchange - MAX Spot Exchange (located in Taiwan) - Bitget Exchange @@ -142,7 +142,7 @@ the implementation. ## Requirements -* Go SDK 1.20 +* Go SDK 1.22 * Linux / MacOS / Windows (WSL) diff --git a/doc/topics/margin.md b/doc/topics/margin.md new file mode 100644 index 0000000000..434452c926 --- /dev/null +++ b/doc/topics/margin.md @@ -0,0 +1,20 @@ +# Margin Trading + +Margin trading is a method of trading assets using funds provided by a third party. When compared to regular trading accounts, margin accounts allow traders to access greater sums of capital, allowing them to leverage their positions. Essentially, margin trading amplifies trading results so that traders are able to realize larger profits on successful trades. This ability to expand trading results makes margin trading especially popular in low-volatility markets, particularly the international Forex market. Nonetheless, it is important to note that margin trading involves a significant amount of risk. While you can use leverage to make a greater profit, you can also incur significant losses if a trade moves against you. + +Currently, bbgo supports cross margin trading and isolated margin trading. Enable margin trading by setting the `margin` field under the session settings in the bbgo.yaml configuration file, for example: + +```yaml +sessions: + binance: + exchange: binance + envVarPrefix: BINANCE + margin: true +``` + +## Margin Trading on OKX + +To enable margin trading on OKX, you need to set the trading mode to "Spot Mode", +and turn on Auto-Borrow from the OKX UI. + +