malkhut(docs): README updated for three-dimensional order type model
Updated README to reflect Fable's corrections: - OrderType/TimeInForce/Instructions as three orthogonal dimensions - POST_ONLY/IOC/FOK correctly described as non-types - BingX trailing_stop -> TRAILING_STOP_MARKET - Three mapping tables (order type, TIF, instructions) - Integration status updated
This commit is contained in:
@@ -469,7 +469,7 @@ Re-measurement at correct fees is required for production deployment.
|
|||||||
| **Policy Registry** | `training/registry.py` | 14 | CANDIDATE → ACTIVE lifecycle |
|
| **Policy Registry** | `training/registry.py` | 14 | CANDIDATE → ACTIVE lifecycle |
|
||||||
| **Training Pipeline** | `training/pipeline.py` | 21 | Bounded continuous learning loop |
|
| **Training Pipeline** | `training/pipeline.py` | 21 | Bounded continuous learning loop |
|
||||||
| **Strategy DSL v2** | `training/dsl.py` | 69 | 40+ primitives, 40+ sensors, 16 builtins |
|
| **Strategy DSL v2** | `training/dsl.py` | 69 | 40+ primitives, 40+ sensors, 16 builtins |
|
||||||
| **Order Types** | `training/order_types.py` | (new) | FIX/CCXT-aligned, 5-layer taxonomy, cross-exchange mapping |
|
| **Order Types** | `training/order_types.py` | (new) | Three-dimensional: OrderType × TimeInForce × Instructions (FIX-aligned) |
|
||||||
| **Strategy Generator** | `training/generator.py` | 20 | Genetic programming: crossover, mutation, tournament |
|
| **Strategy Generator** | `training/generator.py` | 20 | Genetic programming: crossover, mutation, tournament |
|
||||||
| **Strategy Selector** | `training/selector.py` | 24 | Regime → strategy mapping, performance matrix |
|
| **Strategy Selector** | `training/selector.py` | 24 | Regime → strategy mapping, performance matrix |
|
||||||
| **Asset Classification** | `training/asset_classification.py` | 190 | Multi-label taxonomy + exchange registry, 13 assets, system-wide store |
|
| **Asset Classification** | `training/asset_classification.py` | 190 | Multi-label taxonomy + exchange registry, 13 assets, system-wide store |
|
||||||
@@ -1195,34 +1195,41 @@ numba already accelerates the CWM hot path (`_HAS_NUMBA = True`).
|
|||||||
|
|
||||||
### Order Type Standardization (Multi-Exchange, FIX/CCXT-Aligned)
|
### Order Type Standardization (Multi-Exchange, FIX/CCXT-Aligned)
|
||||||
|
|
||||||
Normalized order type taxonomy based on **FIX Protocol Tag 40 (OrdType)** as the
|
Three **orthogonal dimensions** (not one flat enum), each mapped independently:
|
||||||
universal reference, with **CCXT** de facto crypto standard for practical interop.
|
|
||||||
Neither MiFID II nor MiCA defines a standalone order type taxonomy — both defer to FIX.
|
|
||||||
|
|
||||||
**Five-layer hybrid model:**
|
**Dimension 1 — Order Types (FIX Tag 40 OrdType):** what the order IS
|
||||||
|
`MARKET`, `LIMIT`, `STOP_MARKET`, `STOP_LIMIT`, `TRIGGER_MARKET`, `TRIGGER_LIMIT`,
|
||||||
|
`TRAILING_STOP`, `OCO`, `TP_SL`
|
||||||
|
|
||||||
| Layer | Standard Source | Types |
|
**Dimension 2 — Time-in-Force (FIX Tag 59):** how long the order LIVES
|
||||||
|-------|----------------|-------|
|
`GTC`, `IOC`, `FOK`, `GTD`
|
||||||
| 1. Base | FIX Tag 40 | `MARKET`, `LIMIT` |
|
|
||||||
| 2. Time-in-force | FIX Tag 59 | `GTC`, `IOC`, `FOK`, `GTD` |
|
|
||||||
| 3. Conditional/Trigger | FIX Tag 3/4 + MIT | `STOP_MARKET`, `STOP_LIMIT`, `TRIGGER_MARKET`, `TRIGGER_LIMIT`, `TRAILING_STOP` |
|
|
||||||
| 4. Instructions | FIX Tag 18 | `POST_ONLY`, `REDUCE_ONLY`, `HIDDEN`, `ICEBERG` |
|
|
||||||
| 5. Compound | Exchange-specific | `OCO`, `TP_SL` |
|
|
||||||
|
|
||||||
#### Cross-Exchange Mapping (BingX ↔ Binance ↔ Bybit)
|
**Dimension 3 — Instructions (FIX Tag 18 ExecInst):** behavioral modifiers
|
||||||
|
`POST_ONLY`, `REDUCE_ONLY`, `HIDDEN`, `ICEBERG`
|
||||||
|
|
||||||
|
> CRITICAL: `POST_ONLY` is an instruction on a `LIMIT` order, not a standalone type.
|
||||||
|
> `IOC`/`FOK` are TimeInForce values applied to a `LIMIT` order, not order types.
|
||||||
|
> This aligns with FIX Protocol: Tag 40 (OrdType), Tag 59 (TimeInForce), Tag 18 (ExecInst).
|
||||||
|
|
||||||
|
#### Cross-Exchange Order Type Mapping
|
||||||
|
|
||||||
| Normalized | BingX | Binance Spot | Binance Futures | Bybit |
|
| Normalized | BingX | Binance Spot | Binance Futures | Bybit |
|
||||||
|-----------|-------|-------------|-----------------|-------|
|
|-----------|-------|-------------|-----------------|-------|
|
||||||
| `LIMIT` | LIMIT | LIMIT | LIMIT | LIMIT |
|
| `LIMIT` | LIMIT | LIMIT | LIMIT | LIMIT |
|
||||||
| `MARKET` | MARKET | MARKET | MARKET | MARKET |
|
| `MARKET` | MARKET | MARKET | MARKET | MARKET |
|
||||||
| `POST_ONLY` | POST_ONLY | LIMIT_MAKER | LIMIT_MAKER | Post-Only |
|
| `STOP_MARKET` | TRIGGER_MARKET | STOP_MARKET | STOP_MARKET | STOP_MARKET |
|
||||||
| `IOC` | IOC | IOC | IOC | IOC |
|
| `STOP_LIMIT` | TRIGGER_LIMIT | STOP_LOSS_LIMIT | STOP | STOP_LIMIT |
|
||||||
| `FOK` | FOK | FOK | FOK | FOK |
|
| `TRIGGER_MARKET` | TRIGGER_MARKET | TAKE_PROFIT | TAKE_PROFIT | TAKE_PROFIT_MARKET |
|
||||||
| `STOP_MARKET` | TRIGGER_MARKET | STOP_MARKET | STOP_MARKET | Stop-Market |
|
| `TRIGGER_LIMIT` | TRIGGER_LIMIT | TAKE_PROFIT_LIMIT | TAKE_PROFIT | TAKE_PROFIT_LIMIT |
|
||||||
| `STOP_LIMIT` | TRIGGER_LIMIT | STOP_LOSS_LIMIT | STOP | Stop-Limit |
|
| `TRAILING_STOP` | TRAILING_STOP_MARKET | TRAILING_STOP_MARKET | TRAILING_STOP_MARKET | TRAILING_STOP |
|
||||||
| `TP_MARKET` | TRIGGER_MARKET | TAKE_PROFIT | TAKE_PROFIT_MARKET | TP-Market |
|
|
||||||
| `TP_LIMIT` | TRIGGER_LIMIT | TAKE_PROFIT_LIMIT | TAKE_PROFIT | TP-Limit |
|
#### TimeInForce Mapping
|
||||||
| `TRAILING_STOP` | TRIGGER_MARKET(trail) | (spot only) | TRAILING_STOP_MARKET | Trailing |
|
|
||||||
|
| Normalized | BingX | Binance | Bybit |
|
||||||
|
|-----------|-------|---------|-------|
|
||||||
|
| `GTC` | GTC | GTC | GTC |
|
||||||
|
| `IOC` | IOC | IOC | IOC |
|
||||||
|
| `FOK` | FOK | FOK | FOK |
|
||||||
|
|
||||||
#### Transferability Principle
|
#### Transferability Principle
|
||||||
|
|
||||||
@@ -1231,15 +1238,6 @@ but semantics are identical. A `LIMIT` on BingX = `LIMIT` on Binance = `LIMIT` o
|
|||||||
(same fill behavior). Only the API string differs. The venue adapter translates
|
(same fill behavior). Only the API string differs. The venue adapter translates
|
||||||
normalized → exchange-native at submission time.
|
normalized → exchange-native at submission time.
|
||||||
|
|
||||||
#### Integration Status
|
|
||||||
|
|
||||||
- `state.py` OrderType: **17 values** (5-layer taxonomy, backward compatible)
|
|
||||||
- `order_types.py`: **Standalone standardized taxonomy** with exchange mapping tables
|
|
||||||
- `ExchangeProfile.available_order_types`: per-venue list of supported normalized types
|
|
||||||
- `action_menu.py`: uses `OrderType.MARKET`, `OrderType.LIMIT`, `OrderType.POST_ONLY`
|
|
||||||
- CWM transition: passes `action.order_type` to venue adapter
|
|
||||||
- Agent/adversary code: check `is_type_available(type, exchange)` before placing
|
|
||||||
|
|
||||||
#### Standards Referenced
|
#### Standards Referenced
|
||||||
|
|
||||||
- FIX 4.4: Tag 40 (OrdType), Tag 59 (TimeInForce), Tag 18 (ExecInst)
|
- FIX 4.4: Tag 40 (OrdType), Tag 59 (TimeInForce), Tag 18 (ExecInst)
|
||||||
|
|||||||
Reference in New Issue
Block a user