(price_div: f64, m_bet_size: f64, func: &str)
| 231 | "sigmoid" => Ok(limit_price_sigmoid(t_pos, pos, f, w, max_pos)), |
| 232 | "power" => Ok(limit_price_power(t_pos, pos, f, w, max_pos)), |
| 233 | _ => { |
| 234 | Err(BetSizingError::InvalidFunction { context: "limit_price", func: func.to_string() }) |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | pub fn get_w_sigmoid(price_div: f64, m_bet_size: f64) -> f64 { |
| 240 | (price_div * price_div) * ((1.0 / (m_bet_size * m_bet_size)) - 1.0) |
| 241 | } |
| 242 |
no test coverage detected