MCPcopy Create free account
hub / github.com/Open-Quant/openquant / get_w_checked

Function get_w_checked

crates/openquant/src/bet_sizing.rs:233–239  ·  view source on GitHub ↗
(price_div: f64, m_bet_size: f64, func: &str)

Source from the content-addressed store, hash-verified

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
239pub 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

Callers 2

get_wFunction · 0.85
bet_sizing_get_wFunction · 0.85

Calls 2

get_w_sigmoidFunction · 0.85
get_w_power_checkedFunction · 0.85

Tested by

no test coverage detected