Struct PyFxVolSmile
pub struct PyFxVolSmile {
pub(crate) inner: FxVolSmile,
}Expand description
An FX volatility surface: one smile per expiry, quoted as market
strangles under a delta convention.
One expiry’s smile: (quote, vol) nodes, the quote spelled as the market
spells it — "25P", "ATM", "25C" — held from the lowest strike’s
quote to the highest’s. A value of its own, so a caller can build one from
the market’s three quotes or from nodes, read its nodes back, and hand it
to a surface.
Fields§
§inner: FxVolSmileImplementations§
§impl PyFxVolSmile
impl PyFxVolSmile
fn new(nodes: Vec<(String, f64)>) -> PyResult<Self>
fn new(nodes: Vec<(String, f64)>) -> PyResult<Self>
A smile from (quote, vol) nodes; a quote that is not ATM, a put
such as 25P or a call such as 25C, a non-positive vol or the same
quote twice is refused.
fn from_quotes(atm: f64, risk_reversal: f64, butterfly: f64) -> PyResult<Self>
fn from_quotes(atm: f64, risk_reversal: f64, butterfly: f64) -> PyResult<Self>
The market’s three-quote smile: the ATM vol and the 25-delta wings from a risk reversal and a butterfly.
fn __repr__(&self) -> String
Trait Implementations§
§impl Clone for PyFxVolSmile
impl Clone for PyFxVolSmile
§fn clone(&self) -> PyFxVolSmile
fn clone(&self) -> PyFxVolSmile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl DerefToPyAny for PyFxVolSmile
§impl IntoPy<Py<PyAny>> for PyFxVolSmile
impl IntoPy<Py<PyAny>> for PyFxVolSmile
§impl PyClass for PyFxVolSmile
impl PyClass for PyFxVolSmile
§impl PyClassImpl for PyFxVolSmile
impl PyClassImpl for PyFxVolSmile
§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type ThreadChecker = SendablePyClass<PyFxVolSmile>
type ThreadChecker = SendablePyClass<PyFxVolSmile>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
§impl PyClassNewTextSignature<PyFxVolSmile> for PyClassImplCollector<PyFxVolSmile>
impl PyClassNewTextSignature<PyFxVolSmile> for PyClassImplCollector<PyFxVolSmile>
fn new_text_signature(self) -> Option<&'static str>
§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyFxVolSmile
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyFxVolSmile
§impl PyMethods<PyFxVolSmile> for PyClassImplCollector<PyFxVolSmile>
impl PyMethods<PyFxVolSmile> for PyClassImplCollector<PyFxVolSmile>
fn py_methods(self) -> &'static PyClassItems
§impl PyTypeInfo for PyFxVolSmile
impl PyTypeInfo for PyFxVolSmile
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.Auto Trait Implementations§
impl Freeze for PyFxVolSmile
impl RefUnwindSafe for PyFxVolSmile
impl Send for PyFxVolSmile
impl Sync for PyFxVolSmile
impl Unpin for PyFxVolSmile
impl UnsafeUnpin for PyFxVolSmile
impl UnwindSafe for PyFxVolSmile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more