update config

This commit is contained in:
zhiyong 2025-05-22 23:02:59 +08:00
parent 64c88dcc24
commit e3934bcdf9
2 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,8 @@
import requests
# 服务器地址
# URL = "http://trader.biggerfish.tech:9527/yu"
URL = "http://localhost:9527/yu"
URL = "http://trader.biggerfish.tech:9527/yu"
# URL = "http://localhost:9527/yu"
# 策略名称常量
STRATEGY = "香港证券ETF网格"
@ -105,7 +105,7 @@ def check_health() -> str:
健康状态
"""
response = requests.get(f"{URL}/healthcheck")
return response.text
return response.json()
if __name__ == "__main__":
@ -124,13 +124,13 @@ if __name__ == "__main__":
print("账户余额:", balance)
# 示例买入中国银行1000股价格3.45
result = buy("601988.SH", 3.45, 3000)
result = buy("513090.SH", 3.45, 3000)
print("买入结果:", result)
# 模拟输出:
#{'data': {'message': '模拟买入 - 代码: 601988.SH, 价格: 3.45, 数量: 3000', 'order_id': 'simulation'}, 'success': True}
# 示例卖出中国银行1000股价格3.48
result = sell("601988.SH", 3.48, 1000)
result = sell("513090.SH", 3.48, 1000)
print("卖出结果:", result)
# 模拟输出:
# {'data': {'message': '模拟卖出 - 代码: 601988.SH, 价格: 3.48, 数量: 1000', 'order_id': 'simulation'}, 'success': True}
@ -150,7 +150,7 @@ if __name__ == "__main__":
# {'data': [{'601988.SH': {'closeable_amount': 2000, 'total_amount': 2000}}], 'success': True}
# 示例:清除策略持仓数据
result = clear_strategy("测试策略名")
result = clear_strategy(STRATEGY)
print("清除策略持仓结果:", result)
# 模拟输出:
# {'message': "成功清除策略 '追梦投资港股ETF' 的持仓数据", 'success': True}

View File

@ -9,7 +9,7 @@ class Config:
# Trading settings
TRADE_TIMEOUT = 5 # 交易超时时间(秒)
SIMULATION_MODE = True
SIMULATION_MODE = False
# Trading hours
MARKET_OPEN_TIME = "09:10"