feat(mapping): move mapping table to json
This commit is contained in:
9
main.py
9
main.py
@@ -110,12 +110,6 @@ class MexcSpotTrade:
|
||||
- _tool_record_transaction(): 记录交易到CSV
|
||||
"""
|
||||
|
||||
# 证券代码映射 (API代码: CSV记录代码)
|
||||
SYMBOL_MAPPING = {
|
||||
"BTCUSDC": "BTCUSDT",
|
||||
# 可以在此添加更多映射
|
||||
}
|
||||
|
||||
# 订单类型与必需参数
|
||||
ORDER_TYPE_REQUIREMENTS = {
|
||||
"LIMIT": [
|
||||
@@ -134,6 +128,7 @@ class MexcSpotTrade:
|
||||
self.trader = mexc_spot_v3.mexc_trade()
|
||||
self.market = MexcSpotMarket()
|
||||
self.csv_file = "output/mexc_spot_trade.csv"
|
||||
self.symbol_mapping = TradingConfig().config_data.get("symbol_mapping", {})
|
||||
|
||||
def _api_get_order(self, symbol: str, order_id: str) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
@@ -163,7 +158,7 @@ class MexcSpotTrade:
|
||||
|
||||
def _tool_map_symbol(self, symbol: str) -> str:
|
||||
"""映射证券代码用于记录"""
|
||||
return self.SYMBOL_MAPPING.get(symbol, symbol)
|
||||
return self.symbol_mapping.get(symbol, symbol)
|
||||
|
||||
def _tool_validate_order_params(
|
||||
self, order_type: str, params: Dict[str, Any]
|
||||
|
Reference in New Issue
Block a user