Removed risk
This commit is contained in:
@@ -61,7 +61,7 @@ impl Formatted for EventLog {
|
||||
impl Formatted for SignalStatus {
|
||||
fn get_formatted(&self) -> Vec<String> {
|
||||
match self {
|
||||
Ok(RiskSignal::Approve(signal)) => {
|
||||
Ok(signal) => {
|
||||
vec![
|
||||
format!("\x1b[33mOK\x1b[0m"),
|
||||
if matches!(signal.kind, Direction::Buy) {
|
||||
@@ -74,25 +74,8 @@ impl Formatted for SignalStatus {
|
||||
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
||||
]
|
||||
}
|
||||
Ok(RiskSignal::Reject {
|
||||
signal,
|
||||
rejection_confidence,
|
||||
reason,
|
||||
}) => {
|
||||
vec![
|
||||
format!("\x1b[33mOK\x1b[0m"),
|
||||
if matches!(signal.side, Direction::Buy) {
|
||||
format!("\x1b[32mBUY\x1b[0m")
|
||||
} else {
|
||||
format!("\x1b[31mSELL\x1b[0m")
|
||||
},
|
||||
format!("\x1b[35m{}\x1b[0m", signal.symbol),
|
||||
format!("\x1b[31mREJ {}\x1b[0m", rejection_confidence),
|
||||
reason.to_owned(),
|
||||
]
|
||||
}
|
||||
|
||||
Err(RiskSignal::Approve(signal)) => {
|
||||
Err(signal) => {
|
||||
vec![
|
||||
format!("\x1b[31mERR\x1b[0m"),
|
||||
if matches!(signal.kind, Direction::Buy) {
|
||||
@@ -105,23 +88,6 @@ impl Formatted for SignalStatus {
|
||||
format!("\x1b[33mAPR {}\x1b[0m", signal.confidence),
|
||||
]
|
||||
}
|
||||
Err(RiskSignal::Reject {
|
||||
signal,
|
||||
rejection_confidence,
|
||||
reason,
|
||||
}) => {
|
||||
vec![
|
||||
format!("\x1b[31mERR\x1b[0m"),
|
||||
if matches!(signal.side, Direction::Buy) {
|
||||
format!("\x1b[32mBUY\x1b[0m")
|
||||
} else {
|
||||
format!("\x1b[31mSELL\x1b[0m")
|
||||
},
|
||||
format!("\x1b[35m{}\x1b[0m", signal.symbol),
|
||||
format!("\x1b[31mREJ {}\x1b[0m", rejection_confidence),
|
||||
reason.to_owned(),
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,7 +257,7 @@ impl Formatted for Strategy {
|
||||
),
|
||||
Triple(
|
||||
&format!("\x1b[97m{}\x1b[0m", self.strategy.name),
|
||||
&format!("\x1b[93m{}\x1b[0m", self.risk.name),
|
||||
&format!("\x1b[93m{}\x1b[0m", ""),
|
||||
&format!("\x1b[90m{}\x1b[0m", self.strategy.version),
|
||||
),
|
||||
Triple("", "", ""),
|
||||
@@ -303,7 +269,7 @@ impl Formatted for Strategy {
|
||||
Triple(
|
||||
&self.mode.to_string(),
|
||||
&self.state.to_string(),
|
||||
&format!("\x1b[90m{}\x1b[0m", self.risk.version),
|
||||
&format!("\x1b[90m{}\x1b[0m", ""),
|
||||
),
|
||||
Triple("", "", ""),
|
||||
Triple(
|
||||
@@ -314,10 +280,10 @@ impl Formatted for Strategy {
|
||||
Triple(
|
||||
&format!(
|
||||
"\x1b[96m{}\x1b[0m (\x1b[90m{} rec\x1b[0m)",
|
||||
self.cooldown, self.risk.cooldown
|
||||
self.cooldown, ""
|
||||
),
|
||||
&format!("\x1b[96m{:?}\x1b[0m", self.strategy.author),
|
||||
&format!("\x1b[93m{}%\x1b[0m", self.risk.max_loss),
|
||||
&format!("\x1b[93m{}%\x1b[0m", ""),
|
||||
),
|
||||
]
|
||||
.get_formatted()
|
||||
|
||||
Reference in New Issue
Block a user