(
pos: &[f64],
max_pos: &[f64],
m_p: &[f64],
f: &[f64],
)
| 363 | } |
| 364 | |
| 365 | pub fn bet_size_dynamic_checked( |
| 366 | pos: &[f64], |
| 367 | max_pos: &[f64], |
| 368 | m_p: &[f64], |
| 369 | f: &[f64], |
| 370 | ) -> Result<Vec<(f64, f64, f64)>, BetSizingError> { |
| 371 | let w_param = get_w(10.0, 0.95, "sigmoid"); |
| 372 | let rows = confirm_and_cast_to_df_checked(pos, max_pos, m_p, f)?; |
| 373 | Ok(rows |
| 374 | .into_iter() |
| 375 | .map(|(p, m, mp, forecast)| { |
| 376 | let t_pos = get_target_pos(w_param, forecast, mp, m, "sigmoid"); |
| 377 | let l_p = limit_price(t_pos, p, forecast, w_param, m, "sigmoid"); |
| 378 | let b = bet_size(w_param, forecast - mp, "sigmoid"); |
| 379 | (b, t_pos, l_p) |
| 380 | }) |
| 381 | .collect()) |
| 382 | } |
| 383 | |
| 384 | pub fn get_concurrent_sides( |
| 385 | t1: &[(NaiveDateTime, NaiveDateTime)], |
no test coverage detected