Fix CI workflow: use correct rust-toolchain action (#1)
* Fix CI workflow: use correct rust-toolchain action * Fix CI: resolve Rust compilation and formatting issues - Fix rust-toolchain action name in CI workflow - Add missing Direction import in test modules - Add missing entry_fees argument to open_position test calls - Comment out nightly-only rustfmt options - Auto-format code with cargo fmt
This commit is contained in:
@@ -206,11 +206,7 @@ impl StreamingMetrics {
|
||||
/// Get profit factor (sum of profits / sum of losses).
|
||||
pub fn profit_factor(&self) -> f64 {
|
||||
if self.sum_negative == 0.0 {
|
||||
return if self.sum_positive > 0.0 {
|
||||
f64::INFINITY
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
return if self.sum_positive > 0.0 { f64::INFINITY } else { 0.0 };
|
||||
}
|
||||
self.sum_positive / self.sum_negative.abs()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user