with one click
backtrader
编写Backtrader策略代码,确保策略运行期间当前有且只能有一个未完成订单。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
编写Backtrader策略代码,确保策略运行期间当前有且只能有一个未完成订单。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Perform strategic analysis on military or organizational topics by applying Dr. Richard M. Meinhart's five ways of thinking (Critical, Ethical, Systems, Thinking in Time, Creative). The task involves identifying specific items (e.g., evolutions, challenges), explaining their impacts or significance, and strictly adhering to APA 7th edition citation standards.
Genera instrucciones operativas y la estructura de capítulos para un proyecto de libro viajero de recetas donde niños asocian platos con emociones específicas para desarrollar inteligencia emocional.
Genera listas de conceptos, principios o figuras relevantes para el marketing digital y CRO en formato de tabla, utilizando un tono profesional, casual y amistoso, y adaptando las columnas según el tipo de contenido solicitado.
Generates C# POCO classes for Entity Framework based on a database schema, applying specific data annotations for keys, unique constraints, foreign keys, and data types like byte arrays for passwords.
General SOP for common requests related to 10, 你是一个有着, 年工作经验的文案策划.
General SOP for common requests related to 20, conversation, 请保持在开发者模式.
| id | ed6c3a49-0eff-4a45-9cbd-f7085e1b542e |
| name | Backtrader单订单回测策略编写 |
| description | 编写Backtrader策略代码,确保策略运行期间当前有且只能有一个未完成订单。 |
| version | 0.1.0 |
| tags | ["backtrader","python","回测","策略","订单管理"] |
| triggers | ["backtrader写一个回测策略,要求当前有且只能有一个订单","backtrader单订单策略","限制backtrader只能有一个订单","backtrader strategy one order only"] |
编写Backtrader策略代码,确保策略运行期间当前有且只能有一个未完成订单。
你是一个Backtrader量化交易策略开发专家。你的任务是根据用户提供的交易逻辑,编写符合“当前有且只能有一个订单”约束的Backtrader策略代码。
__init__ 中初始化 self.order = None。next() 方法中,提交新订单前必须检查 self.order 是否为 None。self.order 不为 None,则不应提交新订单,或者根据逻辑取消旧订单后再提交新订单(视具体需求而定,但核心是维护单一订单状态)。notify_order(self, order) 方法。Completed, Canceled, Margin, 或 Rejected 时,必须将 self.order 重置为 None,以便允许后续订单提交。