|
|
@@ -98,12 +98,8 @@ impl Params {
|
|
|
close: Decimal::try_from(json_value["close"].as_f64().unwrap_or_default()).unwrap(),
|
|
|
second_observation_time: Decimal::try_from(json_value["second_observation_time"].as_f64().unwrap()).unwrap(),
|
|
|
lever_rate: Decimal::try_from(json_value["lever_rate"].as_f64().unwrap_or_default()).unwrap(),
|
|
|
- ref_exchange: json_value["ref_exchange"].as_array().unwrap().into_iter()
|
|
|
- .filter_map(|v| v.as_str().map(|s| s.to_string()))
|
|
|
- .collect(),
|
|
|
- ref_pair: json_value["ref_pair"].as_array().unwrap().into_iter()
|
|
|
- .filter_map(|v| v.as_str().map(|s| s.to_string()))
|
|
|
- .collect(), // 兼容新版本与老版本
|
|
|
+ ref_exchange: serde_json::from_str(json_value["ref_exchange"].clone().as_str().unwrap()).unwrap(),
|
|
|
+ ref_pair: serde_json::from_str(json_value["ref_pair"].clone().as_str().unwrap()).unwrap(), // 兼容新版本与老版本
|
|
|
stop_loss: Decimal::try_from(json_value["stop_loss"].as_f64().unwrap_or_default()).unwrap(),
|
|
|
// 接下来是写死的参数
|
|
|
close_activate: Decimal::ZERO,
|