Skip to content

Commit

Permalink
Merge pull request #11 from Overmuse/SR/update_equilibrium
Browse files Browse the repository at this point in the history
use short_term spread for equilibrium calculation
  • Loading branch information
SebRollen authored Jun 24, 2021
2 parents 43d3d7a + 7560eda commit 34caa2c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "double-trouble"
version = "0.3.1"
version = "0.3.2"
authors = ["Sebastian Rollen <[email protected]>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions src/trading/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ pub async fn run<T: AsRef<Path>>(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)
})
Expand Down

0 comments on commit 34caa2c

Please sign in to comment.