自定义套利
自定义套利用于创建非交易所标准的多合约价差组合。你可以自定义价差计算公式,并生成独立的组合行情与组合 K 线。
该功能通常与以下下单工具配合使用:
交易所官方标准套利合约(大商所 / 郑商所 / 广期所)入口为:交易 → 实时行情 → 套利。这类合约可直接使用普通下单面板交易,没有不利滑点,无需使用自定义套利。
⚠️ 除服务器单之外,无限易的算法均为本地算法单,依赖行情与成交回报触发。若因网络延迟、断线、软件关闭等原因导致算法无法正常运行,无限易不承担责任。
相关视频与推文:
- 视频:自定义套利参数到底怎么设置 by 王鼎
- 视频:套利猎人-不再套不到 by 王鼎
- 视频:套利猎人入门-有手就行 by 橘子&草莓同学
- 视频:4 分钟学会如何新增套利组合 by 草莓同学
- 推文:鹅鹅鹅 套鹅大赛开始惹
功能入口
顶部菜单栏:交易 → 实时行情 → 自定义套利
列表基础操作
1. 组合管理
- 支持新增、修改、删除自定义组合,可通过右上角图标或右键菜单操作。
- 支持自定义分组、组合排序、分组筛选,便于批量管理多套套利策略。
2. 配置迁移
- 点击右上角
可导出 / 导入组合配置,用于在多台电脑或多个客户端之间同步组合。
- 软件全局配置备份(帮助 → 导出配置 / 无限易云 备份)已自动包含自定义套利组合,无需单独备份。
页面字段说明
| 字段 | 说明 |
|---|---|
| 合约状态 | ON:合约处于正常交易时段,可正常触发算法委托。 OFF:合约休市、集合竞价、熔断或行情中断,不会触发交易。 |
| 预计盈亏 | 包含持仓盈亏与浮动盈亏。此处不区分实际交易组合;只要组合内单合约有持仓,都会被带入盈亏计算。 |
| 持仓盈亏 | 按逐日盯市计算今日盈亏;昨仓以昨结算价计算持仓成本。 |
| 浮动盈亏 | 按逐笔对冲计算盈亏;以开仓价计算持仓成本。 |
新增自定义组合
1. 新建方式
- 空白新建:右键空白处选择“增加”,或点击
按钮,从零配置组合参数。
- 快捷复制:选中已有组合后再新增,系统会继承上一组的全部参数,只需按需调整。
2. 组合公式规则
组合公式用于计算组合价格,并绘制价差线图。
- 支持加、减、乘、除基础运算,运算符号不可省略。示例:
A-1.5*B-2*C、A-B、A/(2*B)-500。
| 错误公式 | 问题 | 正确写法 |
|---|---|---|
A*100-(B) |
不能用括号单独包住某一腿合约,公式无法正确解析。 | A*100-B |
400A/600B |
数字与合约字母之间不能省略运算符。 | 400*A/(600*B) |
A(B-C) |
合约或括号前不能省略乘号。 | A*(B-C) |
(B/(1080*A)*C |
左右括号数量不匹配,公式无法正确解析。 | (B/(1080*A))*C |
- 系统会根据公式中的正负符号自动判定下方合约配置中的买卖方向:
| 公式符号 | 系统判定方向 |
|---|---|
| 加号、乘号 | 买 |
| 减号、除号 | 卖 |
- 不建议手动强行修改合约买卖方向,否则可能造成价差计算错乱(如组合买价 > 组合卖价)或策略异常。
- 合约实际下单方向在下单时指定。
- 组合价差采用各合约的对手价实时计算。
- 可在执行风格中的价差精度设置价差结果的小数位数。示例:公式
A/B的结果为100.3333...,精度为 2 时显示为100.33。
3. 合约配置
- 合约:点击
最多添加 6 腿合约。支持普通期货、期权、证券合约;不支持交易所标准套利合约。
- 交易账号:支持单账号独立交易,也支持多账号组跟单交易。多账号组需提前在系统 → 多账号下单中配置;不支持分仓模式。
- 数量:基础下单数量,一般设置为最小比例,支持两位小数。系统以此为基准计算组合盘口数量。
- 盘口校验:若盘口数量不足 1 组或 1 手,策略不会触发委托。
- 只参与计算:当组合包含 3 腿及以上时,可单独勾选某一合约。该合约只参与价差计算,不参与实际下单。
- 开平规则:在执行风格中的开平规则选择全局开平方式。若选择“自定义”,可在合约配置中为单腿合约单独设置开平规则。
执行风格
自定义套利提供全部同时与某合约优先两类执行顺序,用于控制多合约委托的下发顺序与追单逻辑。该设置需要结合不同品种的流动性使用,是控制 ⚠️ 缺腿风险 与 ⚠️ 滑点 的关键参数。
1. 追单设置
追单是指委托未成交时,先撤单,再以新的价格重新发单。追单可以降低缺腿风险,但也可能产生不利滑点。
在支持追单的执行模式中,可设置:
| 参数 | 说明 |
|---|---|
| 追单超价(Tick) | 每次追单基于前一笔委托超价 N 个 Tick,并与对手价比较后择优委托。参数越大,成交概率越高,但滑点风险也越高。 |
| 追单次数 | 每轮追单最多执行的次数。 |
2. 执行顺序:全部同时
🔵 当价差满足条件后,组合内所有合约同步发送对手价委托。若未成交,所有合约会根据非优先合约追单方式选择积极-立即追单或保守-从不追单。
| 特点 | 说明 |
|---|---|
| 优点 | 参数配置简单;适合超高流动性合约快速抢单。 |
| 缺点 | 多合约无法保证同步成交;追单可能产生较大滑点,不追单则可能缺腿。 |
3. 执行顺序:某合约优先(推荐)
🔵 核心逻辑:先完成指定核心合约成交,再按比例委托剩余合约,以降低缺腿与滑点风险。
- 若优先合约未成交,且追单后仍未成交:
- 当前价差仍满足触发条件时,系统继续挂单。
- 当前价差偏离触发条件时,系统自动撤单,并在下次价差满足时重新发单。
- 剩余合约按比例委托:优先合约成交数量 × 剩余各合约数量占比,计算后四舍五入委托。
- 建议将流动性差、手续费高、交割限制多或成交难度大的合约设为优先合约。
3.1 优先合约委托方式
优先合约可使用主动或被动模式执行。
主动模式(价格优先)
主动模式以优先合约的排队价(本方最优价)为基础,主动试探盘口,挂单等待成交。
| 方式 | 说明 |
|---|---|
| 主动-排队价等 | 直接使用排队价委托。 |
| 主动-排队价等(更优 N 档) | 在排队价基础上按 N 个 Tick 改善价格。买入时加 N Tick,卖出时减 N Tick,用于排在他人前方,提高成交概率。N 通过 更优 N 档(Tick) 设置,默认 1 Tick。 |
| 撤单容忍价差 | 报单后未成交时,若价差偏离超过设定容忍阈值,系统自动撤单。参数越大,容忍度越高,撤单频率越低;默认 0,即价差一偏离就撤单。 |
示例:
触发条件为组合卖方价差 ≤ 10 时买入组合。价差满足后,优先合约发单但未成交,随后卖方价差变为 13,与触发条件相差 3。
- 若撤单容忍价差 ≤ 3,系统立即撤单。
- 若撤单容忍价差 > 3,系统不撤单,继续等待撮合。
使用主动模式时,触发价差按 优先合约的排队价 / 更优 N 档价格 + 非优先合约的对手价 计算。该计算结果不会直接展示在软件上,因此可能出现界面显示对手价差尚未满足,但系统已经报单的情况。
被动模式(成交优先)
被动模式使用优先合约的对手价(对方最优价)报单。该方式成交概率更高,撤单频率通常更低。
| 方式 | 说明 |
|---|---|
| 被动-对手价敲-部分成交不追单 | 偏保守。优先合约单笔出现部分成交时,剩余部分等待下一次价差满足后继续报单。 |
| 被动-对手价敲-部分成交立即追单 | 偏积极。优先合约单笔出现部分成交时,剩余部分立即追单。 |
| 被动-对手价敲-不考虑盘口数量 | 强制模式。每份组合的优先合约按加倍后的下单量委托,不自动拆单,也不考虑当前盘口数量。 |
| 被动-对手价敲-未成交立即追单 | 即使优先合约单笔委托完全未成交,也立即追单。 |
3.2 非优先合约追单方式
非优先合约使用对手价报单。此时系统不再检查价差,目标是尽快成交。
| 方式 | 说明 |
|---|---|
| 积极-立即追单 | 未成交立即追单,最大程度避免缺腿。 |
| 中性 | 当非优先合约对手价偏离超过指定 Tick 阈值后再追单。阈值填写在 价格偏离(Tick) 中,默认 3 Tick。 示例:目标买入价 100,发单未成交后,卖价超过 103 才追单。 |
| 保守-从不追单 | 单次委托未成交后不追单。 |
拆单
拆单仅在执行顺序选择某合约优先时可用。
下单时,系统会以合约配置中的下单比例为基础,再结合下单板中的份数、倍数计算最终下单数量。当数量较大时,可对优先合约自动拆单;剩余合约以优先合约成交数量为基础,按比例拆单。
拆单开启(推荐)
- 被动模式:每份按优先合约实时对手量智能拆单;被动-对手价敲-不考虑盘口数量除外。
- 主动模式:每份按预设最小下单比例拆分委托。
- ⚠️ 若优先合约最小数量为 1 手,剩余合约不再拆单。
拆单关闭
- 每份按最大数量(下单比例 × 下单板倍数)委托。
- 若合约有最小下单量限制,可关闭拆单,并将下单比例设置为最小下单量。
相关推文:针对最小开仓量限制,套利如何设置
有效执行时间
有效执行时间用于限制策略只在指定本机时间段内运行,避免市场开收盘等波动较大的时段。点击 ⚙️ 可将当前时段保存为自定义模板,例如图中的“Custom 2min Pd”。
- 默认时段1:中国期货市场大部分商品品种的交易时间。
- 默认时段2:中国期货市场股指期货的交易时间。
- 若只是想避开非连续交易时间,组合前的合约状态为 OFF 时会自动规避,无需在此处单独设置。
不同交易所、不同合约的交易时段可能不同,请仔细检查并按需设置。
外盘合约通常无法获取非连续交易状态。若组合包含外盘合约,建议在此处设置可交易时间段并开启限制。
高级参数
| 参数 | 说明 |
|---|---|
| 优先合约倍数 | 选择某合约优先时可用,用于设置优先合约的最小委托倍数。下单比例也需同步调整为最小倍数,适配交割月等对下单整倍数有要求的合约。 |
| GFD / FAK / FOK | 含义详见 交易术语解释。优先合约支持 GFD、FAK、FOK(郑商所不支持 FOK);非优先合约支持 GFD 与 FAK。 |
| 等待最新行情 | 仅在合约推送最新行情切片时计算价差并判断触发条件,适用于高速、低延迟交易通道。 |
根据中国期货交易所规则,统计异常报撤单次数时,FAK、FOK 指令不豁免;GFD 指令豁免。系统默认使用 GFD。若自行改为 FAK 或 FOK,请注意不要超过交易所规定次数。
案例(仅供参考)
案例 1:广期所套利(有开仓数量限制)
本组合为广期所碳酸锂 LC2607 与 LC2609 跨期套利策略。策略采用近月 - 远月价差信号,以 5 手为基础交易单元,设置 5:5 配比并关闭拆单,以适配交易所最小开仓限制。
| 项目 | 设置 |
|---|---|
| 合约 A | GFEX lc2607 碳酸锂 |
| 合约 B | GFEX lc2609 碳酸锂主力合约 |
| 下单比例 | A : B = 5 : 5 |
| 拆单 | 取消勾选 |
| 执行顺序 | A 优先,先做非主力 lc2607,再做主力 lc2609 |
| 优先腿 A | 被动-对手价敲-部分成交不追单;指令 从 GFD 改为 FOK |
| 非优先腿 | 积极-立即追单;追单超价设为 5 Tick |
说明:
- 根据交易所规定,碳酸锂合约最小开仓量为 5 手,因此最小比例设置为 5,以尽量避免开仓失败。
- 拆单开启后可能拆成 1:1,不符合最小开仓数量 5 手的限制,因此此案例中应关闭拆单。
- 先做流动性较差的腿,再做流动性较好的腿,可降低缺腿风险。
- FOK 的成交结果只有两种:5 手全部成交,或 5 手全部不成交,不会出现部分成交。
- FOK 只能用于优先腿,且郑商所合约不支持 FOK。
- 非优先腿加大追单超价,是为了尽量一次性全部成交。
⚠️ 以上设置不能完全避免部分成交。例如发送 5 手后,交易所撮合成交 4 手,剩余 1 手立即追单,但 1 手不满足最小开仓量 5 手。若因此产生错单,算法会自动暂停,需要在算法列表窗口手动点击开始。
案例 2:内外盘套利
本组合为内外盘铜套利组合,以 CU、CUA、CNH 构建价差信号。汇率合约只参与计算、不参与交易;组合采用 5:1 配比,弱腿伦铜优先被动委托,以控制单边缺腿风险,适配跨市价差回归交易。
| 项目 | 设置 |
|---|---|
| 合约 A(内盘期货) | SHFE cu2608 沪铜,5 吨 / 手 |
| 合约 B(外盘期货) | LME CUA260508 伦铜,25 吨 / 手 |
| 合约 C(汇率合约) | CME CNH2608 离岸人民币兑美元,勾选 只参与计算 |
| 组合名称 | Cu-LME-FX 08 |
| 公式 | A-0.72*B+1.85*C |
| 下单比例 | A : B : C = 5 : 1 : 任意 |
| 执行顺序 | B 优先,先伦铜再沪铜 |
| 优先腿 | 被动-对手价敲 |
| 非优先腿 | 积极-立即追单 |
| 有效执行时间 | 因包含外盘合约,建议按内盘合约交易时间设置 |
说明:
0.72为沪铜与伦铜在进口成本、关税、运费、升贴水等方面的折算系数。1.85为汇率与铜价之间的波动敏感度匹配系数。- 5 手沪铜 + 1 手伦铜,吨位与市值基本对冲。
- C 腿已勾选 只参与计算,因此比例可任意填写;它仅作为计价校准因子,不产生实际持仓。
- 伦铜 CUA 为弱腿,流动性较差、深度较薄,可能瞬间跳价或短暂无盘口。
- 沪铜 CU 为强腿,流动性较好,后做时不容易缺腿。
案例 3:期权箱体套利(成交优先)
本组合为 HO 股指期权四腿 Box 箱体套利。同到期、双行权价构建结构,采用 A-B+C-D 价差公式,四腿 1:1:1:1 配比,用于捕捉箱体价差均值回归收益。
| 项目 | 设置 |
|---|---|
| 合约 A | HO2606-C-3000,买低行权价认购 |
| 合约 B | HO2606-C-3050,卖高行权价认购 |
| 合约 C | HO2606-P-3050,买高行权价认沽 |
| 合约 D | HO2606-P-3000,卖低行权价认沽 |
| 价差精度 | 1 |
| 执行顺序 | 全部同时 |
| 追单方式 | 立即追单 |
说明:
- HO 股指期权最小变动价位为 0.2,报价通常为 1 位小数,因此价差精度设置为 1。
- 该案例以成交速度为优先。价差满足后,4 腿合约同时以对手价发出,不重点考虑追单滑点。
常见问题
1. 为什么看到价格到了却不触发?
组合触发需同时满足以下条件:
| 条件 | 说明 |
|---|---|
| 对手价差满足 | 触发依据是对手价差,不是最新价,也不是 K 线上看到的价格。点击下单后,需等下一次价格推送才会触发;价格没有更新不会触发。 |
| 盘口数量满足 | 组合买卖盘口数量至少能满足 1 份组合,策略才会触发委托。 |
| 在有效时间内 | 实时行情窗口中,组合前的状态需为 ON。若设置组合时开启了有效时间段内执行,则只会在该时间段内触发。 |
算法列表窗口中状态为 已暂停 的单子不会触发。
2. 为什么组合 K 线没有分时图、没有影线?
- 组合 K 线不支持分时图。可将周期切换为 1 分钟,主图类型切换为收盘线,效果与分时图一致。
- 历史数据不支持影线。历史数据只是切片数据,多个合约在同一周期内合成的最高价、最低价不一定出现在同一时间,因此参考意义有限。详见 视频:组合 k 线线图原理。
3. 滑点如何产生?
只要使用自定义套利,就无法完全避免滑点。滑点可能有利,也可能不利。合理设置参数可以降低不利滑点概率,但不能完全消除。
常见原因包括:
追单
追单会对未成交单加价,以提高成交概率并防止缺腿。因此,一旦发生追单,就可能产生不利滑点。
合约行情瞬变或自身网络不佳
价差满足后,委托以对手价发出,但对手价可能瞬间变化。行情瞬变属于不可控市场因素。
相关视频:自定义套利参数到底怎么设置
4. 缺腿如何处理?
如果组合执行过程中,当前份数内某一腿合约未能按比例足额成交,并且持续超过 3 秒,系统会触发缺腿预警:
- 算法列表 的 成交预警 栏位会显示三个 ❗️❗️❗️。
- 右下角会弹出策略成交预警弹窗。
处理方式:
- 打开 算法列表,查看 成交数量 栏位。
- 如果查看时各腿已经按比例成交,无需处理。
- 如果仍处于缺腿状态,可以双击该算法暂停,再双击启动。
- 算法会先撤单,再重新补单。
⚠️ 注意:如果在其他窗口手动对单腿合约撤单或追单,会导致策略终止。
5. 为什么一直撤单,难以成交?
常见原因是自身网络没有优势。遇到活跃合约时,界面上能看到行情满足触发条件,但实际抢单时可能已经排不到或成交不到。
相关推文:为什么我的委托没有成交?!
6. 证券合约零股如何处理?
证券合约发生零股成交并触发追单时,组合最终成交数量可能相应增加。
组合数量为 1 份
若部分成交后,剩余追单数量不足最小委托单位,系统会自动向上取整,使追单数量达到最小委托单位的整数倍。
示例:沪深主板最小委托单位为 100 股。腿 A 一份报单量为 500 股,部分成交 388 股,剩余未成交数量为 112 股。由于其中 12 股不足 100 股,追单数量会向上取整为 200 股,最终成交 588 股,成交差为 +88 股。
组合数量超过 1 份
以委托 5 份组合为例:前 4 份按上述向上取整原则处理,最后 1 份按当时成交情况处理。
- 若剩余数量 ≤ 0,表示成交数量已超过总报单数量,后续份数自动取消,并终止报单。
- 若剩余数量 < 100 股,表示不足最小委托单位,最后 1 份向上取整,按 100 股委托。
- 若剩余数量 > 100 股但不是 100 的整数倍,最后 1 份按剩余数量向上取整后委托。
Customized Spread
Customized Spread is used to create non-exchange-standard multi-contract spreads. You can define the spread formula and generate independent spread quotes and spread K-line charts.
Important: Custom Spread is a synthetic spread created by InfiniTrader. It is not an exchange-listed spread instrument and is not matched by the exchange as one single spread order. Orders are ultimately sent as individual leg orders, so fills are not atomic. Missing legs, partial fills, and slippage may still occur.
This feature is usually used with the following order tools:
For official exchange standard spread contracts on DCE, CZCE, and GFEX, go to Trade → Markets → Spread. These contracts can be traded directly from the regular order panel, with no unfavorable slippage. You do not need to use Custom Spread.
⚠️ Except for Server Trader, InfiniTrader algorithms run locally and rely on market data and fill reports to trigger. InfiniTrader is not liable for algorithm failure caused by network latency, disconnection, software shutdown, or similar issues.
Videos:
Youtube |Mastering Arbitrage on InfiniTrader
BiliBili | InfiniTrader Basic tutorial
Feature Entry
Top menu bar: Trade → Markets → Custom Spread
Basic List Operations
1. Spread Management
- Add, modify, or delete custom spreads from the top-right icon or the right-click menu.
- Use custom groups, sorting, and group filters to manage multiple spread strategies in batches.
2. Configuration Migration
- Click
in the upper right to export or import custom spread settings. This helps sync spreads across multiple computers or clients.
- Global configuration backup, including Help → Export Config and InfiniCloud, already includes custom spreads. No separate backup is required.
Field Descriptions
| Field | Description |
|---|---|
| Status | ON: The contract is in a normal trading session and algorithm orders can trigger. OFF: The contract is closed, in call auction, under circuit breaker, or has quote interruption. No trade will trigger. |
| P/L | Estimated P/L based on positions in the legs of this spread. This is not a strict strategy-level P/L. The calculation does not identify which positions were opened by this specific spread strategy. If any leg contract has a position, that position may be included in the P/L calculation. |
| MTM P/L | Mark-to-market P/L for today. Yesterday's positions use yesterday's settlement price as the cost basis. |
| Accum. P/L | Trade-by-trade P/L. The opening price is used as the cost basis. |
Add a Custom Spread
1. Add Method
- Blank New: Right-click a blank area and select Add, or click
to configure spread parameters from scratch.
- Quick Copy: Select an existing spread and then add a new one. The system copies all parameters from the selected spread, so you only need to make small changes.
2. Formula Rules
The formula calculates the spread price and draws the spread line chart.
- Basic arithmetic is supported: addition, subtraction, multiplication, and division. Operators cannot be omitted. Examples:
A-1.5*B-2*C,A-B,A/(2*B)-500.
| Invalid formula | Issue | Correct format |
|---|---|---|
A*100-(B) |
A single leg symbol cannot be wrapped in parentheses by itself. The formula cannot be parsed correctly. | A*100-B |
400A/600B |
Operators between numbers and leg letters cannot be omitted. | 400*A/(600*B) |
A(B-C) |
The multiplication operator before parentheses cannot be omitted. | A*(B-C) |
(B/(1080*A)*C |
Opening and closing parentheses do not match, so the formula cannot be parsed correctly. | (B/(1080*A))*C |
- The system determines the buy/sell direction in Leg Configuration from the signs in the formula:
| Formula sign | System direction |
|---|---|
| Plus, multiply | Buy |
| Minus, divide | Sell |
- Do not manually force a different buy/sell direction. This may break spread calculation, such as making spread bid higher than spread ask, or cause strategy errors.
- The actual order direction is specified when you place the order.
- The spread is calculated in real time using each leg's opposite price.
- In Style, set Decimal to control the number of decimal places in the spread result. Example: if
A/Breturns100.3333..., Decimal = 2 displays100.33.
3. Leg Configuration
- Symbol: Click
to add up to 6 legs. Futures, options, and securities are supported. Exchange standard spread contracts are not supported.
- Investor: Supports single-account trading and multi-account Order Follow trading. Configure multi-account groups in Systems → Order Ratio first. Order Split mode is not supported.
- Vol: Base order quantity. Usually set it to the minimum ratio. Two decimal places are supported. The system uses this as the basis for calculating spread depth quantity.
- Depth check: If market depth is less than 1 spread copy or 1 lot, the strategy will not trigger an order.
- Cal. Only: For spreads with 3 or more legs, you can select a leg as Cal. Only. That leg is included in spread calculation only and will not be traded.
- Rule: Select the global open/close rule in Style. If Custom is selected, you can configure an independent open/close rule for each leg in Leg Configuration.
Execution Style
Custom Spread supports two execution sequences: All In and contract priority. These control order sending sequence and chasing logic across multiple contracts. Use them according to liquidity conditions. They are key parameters for managing ⚠️ missing-leg risk and ⚠️ slippage.
1. Chase Settings
Chasing cancels an unfilled order and resubmits it at a new price. It can reduce missing-leg risk, but it may also cause unfavorable slippage.
For execution modes that support chasing, configure:
| Parameter | Description |
|---|---|
| Pay up(Tick) | Each chase pays up N ticks from the previous order and compares against the opposite price to choose the better order price. A larger value increases fill probability but also increases slippage risk. |
| Chase Count | Maximum number of chase attempts per round. |
2. Sequence: All In
🔵 When the spread condition is met, all legs send opposite-price orders at the same time. If orders are unfilled, all legs follow the Style setting for non-priority legs: Aggressive or Passive.
All In means all legs are sent at the same time. It does not mean the legs are filled as one atomic spread order. Some legs may fill while others remain unfilled or require chasing.
| Item | Description |
|---|---|
| Advantage | Simple configuration. Suitable for ultra-liquid contracts where orders need to be sent quickly. |
| Disadvantage | Synchronized fills are not guaranteed. Chasing may cause large slippage, while no chasing may leave missing legs. |
3. Sequence: Contract Priority (Recommended)
🔵 Core logic: complete the priority leg first, then place the remaining legs proportionally. This helps reduce missing-leg and slippage risk.
Contract Priority reduces missing-leg and slippage risk, but it does not eliminate them. After the priority leg is filled, the remaining legs are sent according to the filled quantity and their ratios. At that stage, the system focuses on execution and may no longer have the same spread protection as before the priority leg was filled.
- If the priority leg is unfilled and remains unfilled after chasing:
- If the current spread still meets the trigger condition, the system keeps the order resting.
- If the spread deviates from the trigger condition, the system cancels the order automatically and sends a new order the next time the condition is met.
- Remaining legs are ordered proportionally: filled quantity of the priority leg × quantity ratio of each remaining leg, rounded to the nearest valid quantity.
- Set the least liquid, highest-fee, most restricted, or hardest-to-fill contract as the priority leg.
3.1 Priority Leg Mode
The priority leg can be executed in Positive or Negative mode.
Positive and Negative are UI mode names. They do not indicate bullish/bearish direction, long/short direction, or whether the spread value is positive or negative. Positive means price priority, while Negative means fill priority.
Positive Mode (Price Priority)
Positive mode uses the priority leg's passive price, or own-side best price, to probe market depth and wait for a fill.
| Mode | Description |
|---|---|
| Positive | Place the order directly at the passive price. |
| Positive(BetterPrice) | Improve the price by N ticks from the passive price. Add N ticks for Buy orders and subtract N ticks for Sell orders. This places the order ahead of others and increases fill probability. N is set by Tick Level, with a default of 1 tick. |
| Spread Bias | If the spread deviates beyond the configured tolerance after the order is placed and remains unfilled, the system cancels the order automatically. A larger value means higher tolerance and fewer cancellations. The default is 0, which cancels as soon as the spread deviates. |
Example:
The trigger condition is to buy the spread when the spread ask is ≤ 10. The condition is met, the priority-leg order is placed, but it remains unfilled. The spread ask then moves to 13, which is 3 away from the trigger condition.
- If Spread Bias ≤ 3, the system cancels immediately.
- If Spread Bias > 3, the system keeps the order and waits for matching.
In Positive mode, the trigger spread is calculated using the priority leg's passive price or Better N Tick price, plus the non-priority legs' opposite prices. This calculated result is not displayed directly in the software. Therefore, the screen may show that the opposite-price spread has not met the condition, while the system has already sent an order because the passive-price spread has met it.
Negative Mode (Fill Priority)
Negative mode places the priority-leg order at the opposite price, or the counterparty's best price. It has a higher fill probability and usually a lower cancellation frequency.
| Mode | Description |
|---|---|
| Negative | Conservative. If the priority leg is partially filled, the remaining quantity waits for the next time the spread condition is met. |
| Negative Aggressive | More aggressive. If the priority leg is partially filled, the remaining quantity is chased immediately. |
| Negative(Ignore) | Force mode. The priority leg of each spread copy is ordered using the multiplied order quantity. The system does not auto-split and ignores current depth quantity. |
| Negative Chase | Chase immediately even if the priority-leg order is fully unfilled. |
3.2 Non-Priority Leg Style
Non-priority legs are ordered at the opposite price. At this stage, the system no longer checks the spread. The goal is fast execution.
| Style | Description |
|---|---|
| Aggressive | Chase immediately if unfilled. This minimizes missing-leg risk. |
| Neutral | Chase only when the non-priority leg's opposite price deviates beyond the specified tick threshold. Set the threshold in Check(Tick). The default is 3 ticks. Example: target buy price is 100. If the order is unfilled, chase only when the ask price moves above 103. |
| Passive | Do not chase after a single unfilled order. |
Split
Split is available only when the execution sequence is set to contract priority.
When placing an order, the system calculates the final order quantity from the leg ratio, copies, and multiplier on the order panel. When the quantity is large, the priority leg can be split automatically. Remaining legs are split proportionally based on the filled quantity of the priority leg.
Split On (Recommended)
- Negative mode: Each copy is split by the priority leg's real-time opposite size, except in Negative(Ignore) mode.
- Positive mode: Each copy is split by the preset minimum order ratio.
- ⚠️ If the priority leg's minimum quantity is 1 lot, remaining legs are not split further.
Split Off
- Each copy is ordered at the maximum quantity: leg ratio × order panel multiplier.
- If a contract has a minimum order quantity requirement, turn off Split and set the leg ratio to the minimum order quantity.
Related article: How to configure spreads for minimum opening quantity restrictions
Working Time
Working Time restricts the strategy to run only during specified local PC time periods. Use it to avoid volatile periods near market open or close. Click ⚙️ to save the current periods as a custom template, such as "Custom 2min Pd" in the screenshot.
- Default Period 1: Trading hours for most commodity futures in China.
- Default Period 2: Trading hours for stock index futures in China.
- If you only want to avoid non-continuous trading periods, no separate setup is required here. The spread's Status automatically turns OFF during those periods.
Trading sessions differ by exchange and contract. Check carefully and configure as needed.
For overseas contracts, non-continuous trading status is usually unavailable. If the spread includes overseas contracts, it is recommended to configure tradable periods here and enable the restriction.
Advanced Parameters
| Parameter | Description |
|---|---|
| Priority Leg Multiple | Available when using contract priority. Sets the minimum order multiple for the priority leg. The leg ratio must also be adjusted to the minimum multiple. Use this for delivery-month contracts or other contracts that require order quantities in fixed multiples. |
| GFD / FAK / FOK | See Terminology. Priority legs support GFD, FAK, and FOK. CZCE does not support FOK. Non-priority legs support GFD and FAK. |
| Wait for latest market data | Calculate the spread and check trigger conditions only when a contract receives a latest quote tick. This is suitable for high-speed, low-latency market data channels. |
Under Chinese futures exchange rules, FAK and FOK orders are not exempt from abnormal order placement and cancellation counts. GFD orders are exempt. The system uses GFD by default. If you switch to FAK or FOK, make sure you do not exceed exchange limits.
Case Studies (For Reference Only)
Case 1: GFEX Arbitrage (With Minimum Opening Quantity Restriction)
This is a GFEX lithium carbonate calendar spread between LC2607 and LC2609. It uses a near-month minus far-month spread signal. The base trading unit is 5 lots, with a 5:5 ratio and Split off, to meet the exchange minimum opening quantity requirement.
| Item | Setting |
|---|---|
| Symbol A | GFEX lc2607 lithium carbonate |
| Symbol B | GFEX lc2609 lithium carbonate main contract |
| Vol ratio | A : B = 5 : 5 |
| Split | Off |
| Sequence | A First. Trade the non-main lc2607 first, then lc2609. |
| Priority leg A | Negative. Change TIF from GFD to FOK. |
| Non-priority leg | Aggressive. Set Pay up(Tick) to 5. |
Notes:
- According to the exchange notice, the minimum opening quantity for lithium carbonate contracts is 5 lots. Set the minimum ratio to 5 to reduce opening-order failures.
- If Split is on, the order may be split into 1:1, which violates the 5-lot minimum opening quantity requirement. Therefore, Split should be off in this case.
- Trade the less liquid leg first and the more liquid leg later to reduce missing-leg risk.
- FOK has only two outcomes: all 5 lots are filled, or none are filled. It does not produce a partial fill.
- FOK can only be used for the priority leg, and CZCE contracts do not support FOK.
- A larger Pay up(Tick) on the non-priority leg helps aim for a full fill in one attempt.
⚠️ These settings cannot fully prevent partial fills. For example, if 5 lots are sent and the exchange matches only 4 lots, the remaining 1 lot is chased immediately, but 1 lot does not meet the 5-lot minimum opening quantity. If this causes an erroneous order, the algorithm pauses automatically. Go to Algos and click Start manually to resume.
Case 2: Domestic/Overseas Arbitrage
This domestic/overseas copper spread uses CU, CUA, and CNH to build the spread signal. The FX contract is used for calculation only and is not traded. The spread uses a 5:1 ratio, with the weaker LME copper leg traded first in Negative mode, to control one-sided missing-leg risk in cross-market mean-reversion trading.
| Item | Setting |
|---|---|
| Symbol A (domestic futures) | SHFE cu2608 copper, 5 tons per lot |
| Symbol B (overseas futures) | LME CUA260508 copper, 25 tons per lot |
| Symbol C (FX contract) | CME CNH2608 offshore RMB/USD, select Cal. Only |
| Spread name | Cu-LME-FX 08 |
| Formula | A-0.72*B+1.85*C |
| Vol ratio | A : B : C = 5 : 1 : any |
| Sequence | B First. Trade LME copper first, then SHFE copper. |
| Priority leg | Negative |
| Non-priority leg | Aggressive |
| Working Time | Because the spread includes an overseas contract, configure the time according to the domestic contract trading hours. |
Notes:
0.72is the conversion factor between SHFE copper and LME copper, covering import cost, tariff, freight, and premium/discount.1.85is the sensitivity coefficient between the exchange rate and copper price.- 5 lots of SHFE copper plus 1 lot of LME copper roughly hedges tonnage and market value.
- Leg C is selected as Cal. Only, so its ratio can be any value. It is only a pricing adjustment factor and does not create an actual position.
- LME CUA is the weaker leg: liquidity is poorer, depth is thinner, and short price jumps or temporary no-depth situations may occur.
- SHFE CU is the stronger leg: liquidity is better, so trading it later is less likely to create missing legs.
Case 3: Options Box Arbitrage (Fill Priority)
This is a four-leg HO equity index options box arbitrage. It uses the same expiry and two strikes, with the formula A-B+C-D and a 1:1:1:1 ratio, to capture mean reversion in the box spread.
| Item | Setting |
|---|---|
| Symbol A | HO2606-C-3000, buy lower-strike call |
| Symbol B | HO2606-C-3050, sell higher-strike call |
| Symbol C | HO2606-P-3050, buy higher-strike put |
| Symbol D | HO2606-P-3000, sell lower-strike put |
| Decimal | 1 |
| Sequence | All In |
| Chasing style | Aggressive |
Notes:
- HO equity index options have a tick size of 0.2 and are usually quoted with 1 decimal place, so Decimal is set to 1.
- This case prioritizes execution speed. When the spread condition is met, all four legs are sent at opposite prices at the same time, without focusing on chasing-related slippage.
Q&A
1. Why does the price reach the condition but fail to trigger?
All of the following conditions must be met:
| Condition | Description |
|---|---|
| Opposite-price spread is met | Triggering is based on the opposite-price spread, not the last price or the price shown on the K-line chart. After you click to place the order, the next price update is required before the trigger can occur. If there is no price update, there is no trigger. |
| Depth quantity is sufficient | The bid/ask depth of the spread must be enough for at least 1 spread copy before the strategy can trigger an order. |
| Within valid time | In the Markets window, the spread status must be ON. If Working Time is enabled, the strategy only triggers during that time period. |
Orders with Paused status in Algos will not trigger.
2. Why is there no intraday chart or wick on spread K-lines?
- Spread K-lines do not support intraday charts. To get a similar effect, switch the period to 1 minute and set the main chart type to Close Line.
- Historical data does not support wicks. Historical spread data is slice-based. For multiple contracts in the same period, the combined high and low may not occur at the same time, so the wick has limited reference value.
3. How does slippage occur?
Slippage cannot be fully eliminated in Custom Spread trading. It may be favorable or unfavorable. Proper parameter settings can reduce unfavorable slippage, but cannot remove it completely.
Common causes:
Chasing
Chasing improves the price of unfilled orders to increase fill probability and prevent missing legs. Once chasing occurs, unfavorable slippage may occur.
Sudden contract price moves or poor network conditions
The spread condition may already be met and the order may be sent at the opposite price, but the opposite price can change instantly. Such market movement is outside system control.
4. How should missing legs be handled?
If, during spread execution, one leg in the current copy cannot be fully filled according to the required ratio for more than 3 seconds, the system triggers a missing-leg alert:
- The Alert field in Algos displays three ❗️❗️❗️ warning marks.
- A strategy trade alert pop-up appears in the lower-right corner.
To handle it:
- Open Algos and check the Filled field.
- If all legs have already been filled according to the ratio, no action is needed.
- If the spread is still missing a leg, double-click the algorithm to pause it, then double-click again to start it.
- The algorithm will cancel the order first, then place catch-up orders again.
⚠️ Note: Manually canceling or chasing a single-leg order from another window will terminate the strategy.
5. Why are orders repeatedly canceled and hard to fill?
A common reason is lack of network advantage. For active contracts, the screen may show that the trigger condition is met, but the order may still lose queue priority or fail to fill.
6. How are odd lots handled for securities contracts?
For securities, if an odd-lot fill occurs and chasing is triggered, the final filled quantity of the spread may increase accordingly.
Spread quantity = 1 copy
If a partial fill leaves a remaining chase quantity below the minimum order unit, the system rounds up automatically so the chase quantity becomes an integer multiple of the minimum order unit.
Example: The minimum order unit on the SSE and SZSE main boards is 100 shares. Leg A has an order quantity of 500 shares. If 388 shares are filled, the remaining quantity is 112 shares. Since the extra 12 shares are below 100 shares, the chase quantity is rounded up to 200 shares. The final fill is 588 shares, with an excess of +88 shares.
Spread quantity > 1 copy
For example, if 5 spread copies are ordered, the first 4 copies follow the rounding rule above. The last copy is handled according to the real-time fill status.
- If remaining quantity ≤ 0, the filled quantity has already exceeded the total ordered quantity. Subsequent copies are canceled and ordering stops.
- If remaining quantity < 100 shares, the remaining quantity is below the minimum order unit. The last copy is rounded up and ordered as 100 shares.
- If remaining quantity > 100 shares but is not a multiple of 100, the last copy is rounded up based on the remaining quantity.