Skip to content

Commit

Permalink
Merge pull request #11 from Overmuse/SR/fix_latch_bug
Browse files Browse the repository at this point in the history
fix latch bug at end of trading day
  • Loading branch information
SebRollen authored Apr 15, 2021
2 parents 41642ab + 35f4127 commit daa1a5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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 = "volatility-harvesting"
version = "1.0.0"
version = "1.0.1"
authors = ["RollenRegistratorBot <[email protected]>"]
edition = "2018"

Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ impl Sink<Message> for Receiver {
self.unlatch()
}
}
(false, State::Open { .. }) => self.latch(),
(false, State::Open { next_close }) => {
if next_close > 600 {
self.latch()
}
}
(true, State::Closed { .. }) => {
warn!("Market closed before unlatching");
self.unlatch()
Expand Down

0 comments on commit daa1a5c

Please sign in to comment.