Skip to content

Commit

Permalink
Merge pull request #18 from Overmuse/SR/add_expiry_to_position_intent
Browse files Browse the repository at this point in the history
SR/add expiry to position intent
  • Loading branch information
SebRollen authored Oct 12, 2021
2 parents 6263bec + 3e5e308 commit 7d30637
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 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.4.5"
version = "0.4.6"
authors = ["Sebastian Rollen <[email protected]>"]
edition = "2018"

Expand Down
18 changes: 9 additions & 9 deletions src/trading/trade_generator.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::trading::domain::Position;
use crate::trading::relay::RelayMessage;
use crate::trading::TradeBands;
use chrono::{DateTime, Local};
use chrono::{Local, Utc};
use polygon::ws::Aggregate;
use rdkafka::producer::{FutureProducer, FutureRecord};
use rust_decimal::prelude::*;
Expand Down Expand Up @@ -69,7 +69,7 @@ impl TradeGenerator {
.update_policy(UpdatePolicy::RetainLong)
.limit_price(p1 * Decimal::new(1005, 3))
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -82,7 +82,7 @@ impl TradeGenerator {
.update_policy(UpdatePolicy::RetainShort)
.limit_price(p2 * Decimal::new(995, 3))
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -97,7 +97,7 @@ impl TradeGenerator {
.update_policy(UpdatePolicy::RetainShort)
.limit_price(p1 * Decimal::new(995, 3))
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -110,7 +110,7 @@ impl TradeGenerator {
.update_policy(UpdatePolicy::RetainLong)
.limit_price(p2 * Decimal::new(1005, 3))
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -124,7 +124,7 @@ impl TradeGenerator {
)
.sub_strategy(pair_string.clone())
.update_policy(UpdatePolicy::RetainLong)
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -136,7 +136,7 @@ impl TradeGenerator {
)
.update_policy(UpdatePolicy::RetainShort)
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -150,7 +150,7 @@ impl TradeGenerator {
)
.update_policy(UpdatePolicy::RetainShort)
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand All @@ -162,7 +162,7 @@ impl TradeGenerator {
)
.update_policy(UpdatePolicy::RetainLong)
.sub_strategy(pair_string.clone())
.before(DateTime::from(Local::today().and_hms(15, 50, 0)))
.before(Local::today().and_hms(19, 50, 0).with_timezone(&Utc))
.build()
.expect("Always works"),
);
Expand Down

0 comments on commit 7d30637

Please sign in to comment.