play min profit and good profit sounds when coming from break even as well
This commit is contained in:
parent
093269b173
commit
8bd9eb048d
@ -9,7 +9,7 @@ use crate::BoxError;
|
|||||||
use crate::events::{ActionMessage, Event, EventKind, EventMetadata};
|
use crate::events::{ActionMessage, Event, EventKind, EventMetadata};
|
||||||
use crate::managers::OptionUpdate;
|
use crate::managers::OptionUpdate;
|
||||||
use crate::models::{ActiveOrder, OrderBook, OrderForm, OrderKind, OrderMetadata, Position, PositionProfitState, TradingFees};
|
use crate::models::{ActiveOrder, OrderBook, OrderForm, OrderKind, OrderMetadata, Position, PositionProfitState, TradingFees};
|
||||||
use crate::models::PositionProfitState::{Critical, Loss};
|
use crate::models::PositionProfitState::{BreakEven, Critical, Loss};
|
||||||
use crate::sounds::{GOOD_PROFIT_SOUND_PATH, LOSS_TO_BREAK_EVEN_PATH, MIN_PROFIT_SOUND_PATH, play_sound};
|
use crate::sounds::{GOOD_PROFIT_SOUND_PATH, LOSS_TO_BREAK_EVEN_PATH, MIN_PROFIT_SOUND_PATH, play_sound};
|
||||||
|
|
||||||
/***************
|
/***************
|
||||||
@ -115,6 +115,14 @@ impl TrailingStop {
|
|||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let BreakEven = prev_state {
|
||||||
|
match current_state {
|
||||||
|
PositionProfitState::MinimumProfit => { play_sound(MIN_PROFIT_SOUND_PATH); }
|
||||||
|
PositionProfitState::Profit => { play_sound(GOOD_PROFIT_SOUND_PATH); }
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_status(&self, position: &Position) {
|
fn print_status(&self, position: &Position) {
|
||||||
|
Loading…
Reference in New Issue
Block a user