其他使用技巧
如何收集系统延迟和下单延迟
本系统的运行日志中包含延迟信息,在运行策略时,可以在日志中看到延迟信息,也可以在config.toml中开启写入文件(log->file设置为true),方便之后的查看和分析。
运行系统输出的Latency日志如下图所示:

日志示例
{
"start -> strategy": 0.3,
"strategy": 28.0,
"strategy -> execution begin": 2.4,
"start -> execution begin": 30.7,
"execution_place_order": 233756.5
}
以下字段延迟单位均为微秒(μs)
| 字段 | 说明 |
|---|---|
| start->strategy | 从开始到策略启动 |
| strategy | 策略启动 |
| strategy->execution begin | 策略初始化 |
| start -> execution begin | 从开始到策略初始化 |
| execution_place_order | 执行下单 |
| execution_amend_order | 执行修改订单 |
| execution_cancel_order | 执行撤单 |