Order-Closing Scripts and Their Matching Rules
Summary
The document describes a collection of scripts for closing orders by comment, profit or loss threshold, magic number, order type, or symbol. A combined script supports the criteria offered by the individual tools. This is operational guidance for managing open and pending orders, rather than a trading strategy or market analysis.
It explains how omitted parameters are treated: empty comment or symbol strings, and a value of negative one for numeric fields, cause the corresponding condition to be ignored. With exact matching enabled, active criteria are applied while ignored parameters are respected. With exact matching disabled, an order can close when any one criterion is met; the document cautions that leaving criteria ignored in this mode can cause every order to match. It provides no evidence about execution reliability, platform behavior, or safeguards against unintended closures, so the matching rules should be understood before use.
Key ideas
- Scripts can close orders according to comments, thresholds, identifiers, order types, or symbols.
- Empty strings and a numeric sentinel value make the associated criterion inactive.
- Exact matching applies the active criteria while respecting inactive parameters.
- Without exact matching, any satisfied criterion can trigger a close.
- Inactive criteria in non-exact mode can cause all orders to match.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.