Qust
Qust is a Rust libraries for building live-trading and back-test systems. It has the following features:
- Fast: It's way to handle or to save the kline data, tick data and strategy makes the backtest and live trading fast.
- Extensible: It provide many ways to build a strategy, and new ways can be implemented by needs, so that you can focus what you care. You can build a simple strategy or complicated one, then backtest it on kline data(for quick scruch) or tick data, on put it on live trading directly. For example, you can build a strategy by following ways:
- Accept kline flow, and return a target position.
- Accept tick data flow, and return a target position.
- Accept tick data flow, and return an order action.
- Accept kline and tick flow, return a target positon or an order action.
- Accept kline flow, and return a bool.(a least two of it make a strategy, one for open position, another for close)
- Add filter conditions to an existed strategy.
- Add algorithm method to an existed strategy.
- Add order matching methods when backtest a strategy.
- Add valitality manager to strategies.
- Add portoflio manager to a pool of strategies. and so on.
See this notebook Example for more detail.
Examples
Add this to Cargo.toml:
qust-derive =
qust-ds =
qust =
qust-api =
qust-io =
serde = "*"
serde_json = "*"
itertools = "*"
typetag = "*"
tokio = "*"
ta =
You can build a strategy basing on kline data and backtest in on kline:
use *;
use *;
use *;
use *;
use *;
use ;
async
更新 version: 0.1.5
- 支持tick级别的横截面,目前不支持k线级别,可以在tick里面手动更新k线。需要指定各个ticker的到达时间,详见例子;
- 每个策略(
ApiBridgeBox)都有自身的订单管理,api程序停止运行后,到下次重开程序,中间过程中如果没有手动开平仓,历史的订单会被读取