refactor: 移除 gate_bot,统一为三所架构并更新文档
删除 crypto_monitor_gate_bot 目录,中控与子代理改为 binance/okx/gate 三账户; 文档与 UI 文案「四所」改为「三所」;新增清库前一次性配置备份脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
"""子代理持仓:四所开仓价字段统一解析。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "manual_trading_hub"))
|
||||
|
||||
from agent import _position_entry_price # noqa: E402
|
||||
|
||||
|
||||
class TestHubAgentEntryPrice(unittest.TestCase):
|
||||
def test_binance_entry_price(self):
|
||||
px = _position_entry_price({"entryPrice": 65851.6, "info": {}})
|
||||
self.assertAlmostEqual(px, 65851.6)
|
||||
|
||||
def test_okx_avg_px(self):
|
||||
px = _position_entry_price({"info": {"avgPx": "72.731"}})
|
||||
self.assertAlmostEqual(px, 72.731)
|
||||
|
||||
def test_gate_info_entry(self):
|
||||
px = _position_entry_price({"info": {"entry_price": "0.2232"}})
|
||||
self.assertAlmostEqual(px, 0.2232)
|
||||
|
||||
def test_missing_returns_none(self):
|
||||
self.assertIsNone(_position_entry_price({"info": {}}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
"""子代理持仓:三所开仓价字段统一解析。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "manual_trading_hub"))
|
||||
|
||||
from agent import _position_entry_price # noqa: E402
|
||||
|
||||
|
||||
class TestHubAgentEntryPrice(unittest.TestCase):
|
||||
def test_binance_entry_price(self):
|
||||
px = _position_entry_price({"entryPrice": 65851.6, "info": {}})
|
||||
self.assertAlmostEqual(px, 65851.6)
|
||||
|
||||
def test_okx_avg_px(self):
|
||||
px = _position_entry_price({"info": {"avgPx": "72.731"}})
|
||||
self.assertAlmostEqual(px, 72.731)
|
||||
|
||||
def test_gate_info_entry(self):
|
||||
px = _position_entry_price({"info": {"entry_price": "0.2232"}})
|
||||
self.assertAlmostEqual(px, 0.2232)
|
||||
|
||||
def test_missing_returns_none(self):
|
||||
self.assertIsNone(_position_entry_price({"info": {}}))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user