pub struct DeltaNeutralVolConfig {Show 14 fields
pub base: StrategyConfig,
pub option_family: String,
pub hedge_instrument_id: InstrumentId,
pub client_id: ClientId,
pub target_call_delta: f64,
pub target_put_delta: f64,
pub contracts: u64,
pub rehedge_delta_threshold: f64,
pub rehedge_interval_secs: u64,
pub expiry_filter: Option<String>,
pub enter_strangle: bool,
pub entry_iv_offset: f64,
pub entry_time_in_force: TimeInForce,
pub iv_param_key: String,
}Expand description
Configuration for the delta-neutral short volatility hedger.
Tracks a short OTM call and put (strangle) and delta-hedges with the underlying perpetual swap. Rehedges when portfolio delta exceeds a configurable threshold or on a periodic timer.
Fields§
§base: StrategyConfigBase strategy configuration.
option_family: StringOption instrument family (e.g. “BTC-USD”).
hedge_instrument_id: InstrumentIdHedge instrument ID (e.g. BTC-USD-SWAP.OKX).
client_id: ClientIdData and execution client ID (e.g. “OKX”).
target_call_delta: f64Target call delta used by the startup strike heuristic.
target_put_delta: f64Target put delta used by the startup strike heuristic.
contracts: u64Number of option contracts per leg.
rehedge_delta_threshold: f64Portfolio delta threshold that triggers a rehedge.
rehedge_interval_secs: u64Periodic rehedge check interval in seconds.
expiry_filter: Option<String>Optional expiry date filter (e.g. “260327”).
enter_strangle: boolPlace strangle entry orders when Greeks are first initialized. When false the strategy only hedges externally-entered positions.
entry_iv_offset: f64Implied volatility offset subtracted from mark IV for entry limit price. A value of 0.02 sells 2 vol points below mark (more aggressive).
entry_time_in_force: TimeInForceTime-in-force for strangle entry orders.
iv_param_key: StringParam key for implied volatility passed to submit_order_with_params.
Adapter-specific: Bybit uses "order_iv", OKX uses "px_vol".
Implementations§
Source§impl DeltaNeutralVolConfig
impl DeltaNeutralVolConfig
Sourcepub fn new(
option_family: String,
hedge_instrument_id: InstrumentId,
client_id: ClientId,
) -> Self
pub fn new( option_family: String, hedge_instrument_id: InstrumentId, client_id: ClientId, ) -> Self
Creates a new DeltaNeutralVolConfig with required fields and defaults.
pub fn with_target_call_delta(self, delta: f64) -> Self
pub fn with_target_put_delta(self, delta: f64) -> Self
pub fn with_contracts(self, contracts: u64) -> Self
pub fn with_rehedge_delta_threshold(self, threshold: f64) -> Self
pub fn with_rehedge_interval_secs(self, secs: u64) -> Self
pub fn with_expiry_filter(self, expiry: String) -> Self
pub fn with_enter_strangle(self, enter: bool) -> Self
pub fn with_entry_iv_offset(self, offset: f64) -> Self
pub fn with_entry_time_in_force(self, tif: TimeInForce) -> Self
pub fn with_strategy_id(self, strategy_id: StrategyId) -> Self
pub fn with_order_id_tag(self, tag: String) -> Self
pub fn with_iv_param_key(self, key: String) -> Self
Trait Implementations§
Source§impl Clone for DeltaNeutralVolConfig
impl Clone for DeltaNeutralVolConfig
Source§fn clone(&self) -> DeltaNeutralVolConfig
fn clone(&self) -> DeltaNeutralVolConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeltaNeutralVolConfig
impl Debug for DeltaNeutralVolConfig
Source§impl<'a, 'py> FromPyObject<'a, 'py> for DeltaNeutralVolConfigwhere
Self: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for DeltaNeutralVolConfigwhere
Self: Clone,
Source§impl<'py> IntoPyObject<'py> for DeltaNeutralVolConfig
impl<'py> IntoPyObject<'py> for DeltaNeutralVolConfig
Source§type Target = DeltaNeutralVolConfig
type Target = DeltaNeutralVolConfig
Source§type Output = Bound<'py, <DeltaNeutralVolConfig as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <DeltaNeutralVolConfig as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClass for DeltaNeutralVolConfig
impl PyClass for DeltaNeutralVolConfig
Source§impl PyClassImpl for DeltaNeutralVolConfig
impl PyClassImpl for DeltaNeutralVolConfig
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Configuration for the delta-neutral short volatility hedger.
///
/// Tracks a short OTM call and put (strangle) and delta-hedges with the
/// underlying perpetual swap. Rehedges when portfolio delta exceeds a
/// configurable threshold or on a periodic timer.
const RAW_DOC: &'static CStr = /// Configuration for the delta-neutral short volatility hedger. /// /// Tracks a short OTM call and put (strangle) and delta-hedges with the /// underlying perpetual swap. Rehedges when portfolio delta exceeds a /// configurable threshold or on a periodic timer.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type Layout = <<DeltaNeutralVolConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<DeltaNeutralVolConfig>
type Layout = <<DeltaNeutralVolConfig as PyClassImpl>::BaseNativeType as PyClassBaseType>::Layout<DeltaNeutralVolConfig>
Source§type ThreadChecker = NoopThreadChecker
type ThreadChecker = NoopThreadChecker
type Inventory = Pyo3MethodsInventoryForDeltaNeutralVolConfig
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
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<PyObjectOffset>
fn dict_offset() -> Option<PyObjectOffset>
§fn weaklist_offset() -> Option<PyObjectOffset>
fn weaklist_offset() -> Option<PyObjectOffset>
Source§impl PyClassNewTextSignature for DeltaNeutralVolConfig
impl PyClassNewTextSignature for DeltaNeutralVolConfig
const TEXT_SIGNATURE: &'static str = "(option_family, hedge_instrument_id, client_id, strategy_id=None, order_id_tag=None, target_call_delta=0.20, target_put_delta=..., contracts=1, rehedge_delta_threshold=0.5, rehedge_interval_secs=30, expiry_filter=None, enter_strangle=True, entry_iv_offset=0.0, entry_time_in_force=..., iv_param_key=\"px_vol\")"
Source§impl PyTypeInfo for DeltaNeutralVolConfig
impl PyTypeInfo for DeltaNeutralVolConfig
Source§const NAME: &str = <Self as ::pyo3::PyClass>::NAME
const NAME: &str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
Source§const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl DerefToPyAny for DeltaNeutralVolConfig
Auto Trait Implementations§
impl Freeze for DeltaNeutralVolConfig
impl RefUnwindSafe for DeltaNeutralVolConfig
impl Send for DeltaNeutralVolConfig
impl Sync for DeltaNeutralVolConfig
impl Unpin for DeltaNeutralVolConfig
impl UnsafeUnpin for DeltaNeutralVolConfig
impl UnwindSafe for DeltaNeutralVolConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
impl<'py, T> IntoPyObjectNautilusExt<'py> for Twhere
T: IntoPyObjectExt<'py>,
§fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
fn into_py_any_unwrap(self, py: Python<'py>) -> Py<PyAny>
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more