5、API使用说明 Published on Aug 18, 2025 in 文档 with 0 comment 摩尔思 MOER.SI API >PS: >API是供会程序的用户二次开发、历史回测使用,普通用户忽略此部分,不影响程序正常使用。 ## 策略命令JSON提交格式 ```json { "type": "reqmeddle", "strategyid": "0", "command": "show" } ``` ------------ ## python代码示例 ```python def strategy_command(self, server, strategyid, command): url = 'http://{}:8080/moersi-trader'.format(server) payload = { "type": "reqmeddle", "strategyid": strategyid, # 替换为实际的 strategyid "command": command } # 发送 POST 请求 response = requests.post(url, json=payload) # 检查响应状态码 if response.status_code == 200: print("请求成功,状态码: {}, 内容: {}".format(response.status_code, response.text.strip())) return True else: print("请求失败,状态码: {}, 内容: {}".format(response.status_code, response.text.strip())) return False ``` ------------ ## 参数模板  - 下载`参数和仓位计算器Excel模板`,请先登录【免费】。 - 👉[点击下载`参数和仓位计算器Excel模板`](https://moer.si/down.php?file=template.xlsx "点击下载参数和仓位计算器模板") - 👉[Download `Parameters and Position Calculator Excel template`](https://moer.si/down.php?file=template-en.xlsx "点击下载参数和仓位计算器模板") 本文由 moersi 创作,转载请务必保留本文链接: 5、API使用说明 本文不构成任何投资建议,亦不对因使用该等信息而引发的损失承担任何责任。