pub struct StrategyRunner { /* private fields */ }Expand description
Strategy runner that manages multiple strategies
Implementations§
Source§impl StrategyRunner
impl StrategyRunner
pub fn into_reference( val: StrategyRunner, env: Env, ) -> Result<Reference<StrategyRunner>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<StrategyRunner>>
Source§impl StrategyRunner
impl StrategyRunner
Sourcepub async fn add_momentum_strategy(
&self,
config: StrategyConfig,
) -> Result<String>
pub async fn add_momentum_strategy( &self, config: StrategyConfig, ) -> Result<String>
Add a momentum strategy
Sourcepub async fn add_mean_reversion_strategy(
&self,
_config: StrategyConfig,
) -> Result<String>
pub async fn add_mean_reversion_strategy( &self, _config: StrategyConfig, ) -> Result<String>
Add a mean reversion strategy
Sourcepub async fn add_arbitrage_strategy(
&self,
_config: StrategyConfig,
) -> Result<String>
pub async fn add_arbitrage_strategy( &self, _config: StrategyConfig, ) -> Result<String>
Add an arbitrage strategy
Sourcepub async fn generate_signals(&self) -> Result<Vec<Signal>>
pub async fn generate_signals(&self) -> Result<Vec<Signal>>
Generate signals from all strategies
Sourcepub fn subscribe_signals(
&self,
callback: JsFunction,
) -> Result<SubscriptionHandle>
pub fn subscribe_signals( &self, callback: JsFunction, ) -> Result<SubscriptionHandle>
Subscribe to signals with a callback
Sourcepub async fn list_strategies(&self) -> Result<Vec<String>>
pub async fn list_strategies(&self) -> Result<Vec<String>>
Get list of active strategies
Sourcepub async fn remove_strategy(&self, strategy_id: String) -> Result<bool>
pub async fn remove_strategy(&self, strategy_id: String) -> Result<bool>
Remove a strategy by ID
Trait Implementations§
Source§impl FromNapiMutRef for StrategyRunner
impl FromNapiMutRef for StrategyRunner
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for StrategyRunner
impl FromNapiRef for StrategyRunner
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &StrategyRunner
impl FromNapiValue for &StrategyRunner
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut StrategyRunner
impl FromNapiValue for &mut StrategyRunner
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for StrategyRunner
impl ObjectFinalize for StrategyRunner
Source§impl ToNapiValue for StrategyRunner
impl ToNapiValue for StrategyRunner
Source§unsafe fn to_napi_value(
env: napi_env,
val: StrategyRunner,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: StrategyRunner, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &StrategyRunner
impl TypeName for &StrategyRunner
Source§impl TypeName for &mut StrategyRunner
impl TypeName for &mut StrategyRunner
Source§impl TypeName for StrategyRunner
impl TypeName for StrategyRunner
Source§impl ValidateNapiValue for &StrategyRunner
impl ValidateNapiValue for &StrategyRunner
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut StrategyRunner
impl ValidateNapiValue for &mut StrategyRunner
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for StrategyRunner
impl !RefUnwindSafe for StrategyRunner
impl Send for StrategyRunner
impl Sync for StrategyRunner
impl Unpin for StrategyRunner
impl !UnwindSafe for StrategyRunner
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