Skip to main content

synthetic_instrument_new

Function synthetic_instrument_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn synthetic_instrument_new( symbol: Symbol, price_precision: u8, components_ptr: *const c_char, formula_ptr: *const c_char, ts_event: u64, ts_init: u64, ) -> *mut SyntheticInstrument
Expand description

Creates a new SyntheticInstrument from the given components and formula.

§Panics

Panics if the formula is invalid for the given components.

§Safety

This function assumes:

  • components_ptr is a valid C string pointer of a JSON format list of strings.
  • formula_ptr is a valid C string pointer.

Returns an owning pointer to the heap-allocated SyntheticInstrument which the caller must eventually pass to synthetic_instrument_drop.