mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-07 21:12:00 +08:00
feat: add AI grid trading and market regime classification
- Add GridTrader interface with PlaceLimitOrder, CancelOrder, GetOrderBook - Implement GridTrader for all exchanges (Binance, Bybit, OKX, Bitget, Hyperliquid, Aster, Lighter) - Add grid engine with ATR-based boundary calculation and fund distribution - Add market regime classification documents (Chinese/English) - Add GridConfigEditor component for frontend configuration
This commit is contained in:
@@ -130,7 +130,8 @@ type Context struct {
|
||||
// Decision AI trading decision
|
||||
type Decision struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Action string `json:"action"` // "open_long", "open_short", "close_long", "close_short", "hold", "wait"
|
||||
Action string `json:"action"` // Standard: "open_long", "open_short", "close_long", "close_short", "hold", "wait"
|
||||
// Grid actions: "place_buy_limit", "place_sell_limit", "cancel_order", "cancel_all_orders", "pause_grid", "resume_grid", "adjust_grid"
|
||||
|
||||
// Opening position parameters
|
||||
Leverage int `json:"leverage,omitempty"`
|
||||
@@ -138,6 +139,12 @@ type Decision struct {
|
||||
StopLoss float64 `json:"stop_loss,omitempty"`
|
||||
TakeProfit float64 `json:"take_profit,omitempty"`
|
||||
|
||||
// Grid trading parameters
|
||||
Price float64 `json:"price,omitempty"` // Limit order price (for grid)
|
||||
Quantity float64 `json:"quantity,omitempty"` // Order quantity (for grid)
|
||||
LevelIndex int `json:"level_index,omitempty"` // Grid level index
|
||||
OrderID string `json:"order_id,omitempty"` // Order ID (for cancel)
|
||||
|
||||
// Common parameters
|
||||
Confidence int `json:"confidence,omitempty"` // Confidence level (0-100)
|
||||
RiskUSD float64 `json:"risk_usd,omitempty"` // Maximum USD risk
|
||||
|
||||
Reference in New Issue
Block a user