Skip to content

Commit

Permalink
docs: trading math (No-Trade-No-Life#417)
Browse files Browse the repository at this point in the history
* fix(gui): Command i18n namespace

* docs: trading math
  • Loading branch information
zccz14 authored Jan 7, 2024
1 parent 26afe32 commit 0dd0700
Show file tree
Hide file tree
Showing 6 changed files with 340 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ui/docs/docs/basics/how-to-calculate-margin.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 3
sidebar_position: 5
---

# How to calculate margin
Expand Down
2 changes: 1 addition & 1 deletion ui/docs/docs/basics/what-is-account.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 3
---

# What is Account
Expand Down
35 changes: 17 additions & 18 deletions ui/docs/docs/basics/what-is-product.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 1
sidebar_position: 2
---

# What is Product
Expand All @@ -13,23 +13,22 @@ In the world of trading, terms that express the same concept may be seen elsewhe
When we talk about product, we must first talk about its specifications.
The specifications for evaluating products have the following dimensions:

| Field name | Meaning and remarks | Example value |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `product_id` | Which product does this specification information belong to? How to distinguish it from other products? | `"XAUUSD"` |
| `datasource_id` | Who provided this specification information? | `"Y"` |
| `name` | How do humans generally refer to this species? | `"Gold Spot vs US Dollar"` |
| `base_currency` | What currency is used for trading this product? | `"USD"` |
| `quoted_currency` | What currency is used for pricing this product? Usually only applicable to foreign exchange. | Leave blank |
| `price_step` | What is the minimum price per hop for this product? The quoted price in the market must be an integer multiple of this unit. However, the actual transaction price does not need to comply with this constraint. Default to 1 | `0.01` |
| `volume_step` | How many lots should this product be sold at least? The order volume and transaction volume of this product must be an integer multiple of this unit. Default to 1 | `0.01` |
| `value_speed` | How many units of the subject matter is equivalent to 1 lot? How much profit and loss will be generated by changes in unit prices? Some places are also called "contract multipliers". Default to 1 | `100` |
| `is_underlying_base_currency` | Is the unit of this value rate based on the base currency? (Currently, only the values of foreign exchange and bond spot have been found to be "yes"). Default to false | `false` (No) If the answer is yes, it means that you are trading 100 USD worth of gold for one lot, not 100 ounces of gold. |
| `margin_rate` | How many times the market value needs to be paid as margin when trading this product? \* This mechanism is independent of the account's own system leverage ratio. Default to 1 | `1` (100%) |
| `max_position` | What is the maximum position size for holding this product? Default to Infinity. |
| `max_volume` | What is the maximum number of orders that can be placed at one time? \* Does not affect multiple orders. Default to Infinity | |
| `allow_long` | Default to true | `true` (yes) |
| `allow_short` | Default to true | `true` (yes) |
| `spread` | What is the spread for Ask - Bid? | `0` |
| Field name | Meaning and remarks | Example value |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| `product_id` | (**Required**) Which product does this specification information belong to? How to distinguish it from other products? | `"XAUUSD"` |
| `datasource_id` | (**Required**) Who provided this specification information? | `"Y"` |
| `currency` | (**Required**) What currency is used for trading this product? | `"USD"` |
| `name` | How do humans generally refer to this species? | `"Gold Spot vs US Dollar"` |
| `value_scale` | How many units of the subject matter is equivalent to 1 lot? How much profit and loss will be generated by changes in unit prices? Some places are also called "contract multipliers". Default to 1 | `100` |
| `value_scale_unit` | What is the unit of this value scale? Leave it undefined if unit is product itself. Or set to currency if needed. | |
| `price_step` | What is the minimum price per hop for this product? The quoted price in the market must be an integer multiple of this unit. However, the actual transaction price does not need to comply with this constraint. Default to 1 | `0.01` |
| `volume_step` | How many lots should this product be sold at least? The order volume and transaction volume of this product must be an integer multiple of this unit. Default to 1 | `0.01` |
| `margin_rate` | How many times the market value needs to be paid as margin when trading this product? \* This mechanism is independent of the account's own system leverage ratio. Default to 1 | `1` (100%) |
| `max_position` | What is the maximum position size for holding this product? Default to Infinity. |
| `max_volume` | What is the maximum number of orders that can be placed at one time? \* Does not affect multiple orders. Default to Infinity | |
| `allow_long` | Default to true | `true` (yes) |
| `allow_short` | Default to true | `true` (yes) |
| `spread` | What is the spread for Ask - Bid? Default to 0 | `0` |

## Association of products

Expand Down
Loading

0 comments on commit 0dd0700

Please sign in to comment.