|
@@ -23,7 +23,7 @@ pub struct Strategy {
|
|
|
pub post_open_interval: i64, // 提交订单时延
|
|
pub post_open_interval: i64, // 提交订单时延
|
|
|
pub _check_local_orders_time: i64, // 上次查单时间
|
|
pub _check_local_orders_time: i64, // 上次查单时间
|
|
|
pub _check_local_orders_interval: i64, // 查单间距,原文是秒级,这里改成毫秒级
|
|
pub _check_local_orders_interval: i64, // 查单间距,原文是秒级,这里改成毫秒级
|
|
|
- pub in_cancel: HashMap<String, i64>, //撤单队列
|
|
|
|
|
|
|
+ pub in_cancel: HashMap<String, i64>, // 撤单队列
|
|
|
pub cancel_wait_interval: i64, // 取消等待时延
|
|
pub cancel_wait_interval: i64, // 取消等待时延
|
|
|
pub in_check: HashMap<String, i64>, // 查单队列
|
|
pub in_check: HashMap<String, i64>, // 查单队列
|
|
|
pub check_wait_interval: i64, // 检测时延
|
|
pub check_wait_interval: i64, // 检测时延
|
|
@@ -45,7 +45,7 @@ pub struct Strategy {
|
|
|
pub ref_name: Vec<String>, //
|
|
pub ref_name: Vec<String>, //
|
|
|
pub maker_mode: String, //
|
|
pub maker_mode: String, //
|
|
|
pub local_orders: HashMap<String, OrderInfo>, // 本地订单
|
|
pub local_orders: HashMap<String, OrderInfo>, // 本地订单
|
|
|
- pub pos: LocalPosition, //
|
|
|
|
|
|
|
+ pub pos: LocalPosition, //
|
|
|
pub long_hold_value: Decimal, //
|
|
pub long_hold_value: Decimal, //
|
|
|
pub short_hold_value: Decimal, //
|
|
pub short_hold_value: Decimal, //
|
|
|
pub equity: Decimal, //
|
|
pub equity: Decimal, //
|
|
@@ -1258,7 +1258,7 @@ mod tests {
|
|
|
fn on_time_test() {
|
|
fn on_time_test() {
|
|
|
global::log_utils::init_log_with_debug();
|
|
global::log_utils::init_log_with_debug();
|
|
|
|
|
|
|
|
- let params = Params::new("config.toml").unwrap();
|
|
|
|
|
|
|
+ let params = Params::new("config.toml.gate").unwrap();
|
|
|
let mut strategy = Strategy::new(¶ms, true);
|
|
let mut strategy = Strategy::new(¶ms, true);
|
|
|
let mut trader_msg = TraderMsg::new();
|
|
let mut trader_msg = TraderMsg::new();
|
|
|
trader_msg.market.append(&mut vec![dec!(0.92), dec!(1.0), dec!(0.89), dec!(0.79), dec!(0.99), dec!(1.0), dec!(0.89), dec!(0.79), dec!(0.89), dec!(0.79), dec!(0.99), dec!(1.0), dec!(0.89), dec!(0.79)]);
|
|
trader_msg.market.append(&mut vec![dec!(0.92), dec!(1.0), dec!(0.89), dec!(0.79), dec!(0.99), dec!(1.0), dec!(0.89), dec!(0.79), dec!(0.89), dec!(0.79), dec!(0.99), dec!(1.0), dec!(0.89), dec!(0.79)]);
|