diff --git a/Cargo.lock b/Cargo.lock index fb083bf..b70e8b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -215,7 +215,7 @@ checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "double-trouble" -version = "0.3.1" +version = "0.3.2" dependencies = [ "anyhow", "bdays", diff --git a/Cargo.toml b/Cargo.toml index f559533..3966e20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "double-trouble" -version = "0.3.1" +version = "0.3.2" authors = ["Sebastian Rollen "] edition = "2018" diff --git a/src/trading/mod.rs b/src/trading/mod.rs index d92bf2b..51cef6b 100644 --- a/src/trading/mod.rs +++ b/src/trading/mod.rs @@ -33,8 +33,8 @@ pub async fn run>(cash: Decimal, data_file: T, kafka: KafkaSettin let opt1 = open_close.get(&pair.asset_1); let opt2 = open_close.get(&pair.asset_2); opt1.zip(opt2).map(|((op1, cl1), (op2, cl2))| { - let equilibrium = (((op1.ln() - op2.ln()) - pair.original_lt_spread) - + ((cl1.ln() - cl2.ln()) - pair.original_lt_spread)) + let equilibrium = (((op1.ln() - op2.ln()) - pair.original_st_spread) + + ((cl1.ln() - cl2.ln()) - pair.original_st_spread)) / Decimal::new(2, 0); TradeBands::new(pair, equilibrium) })