Skip to content

pbeets/rithmic-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Rithmic R | Protocol API client

https://www.rithmic.com/apis

As is, use at your own risk.

Only order_plant, ticker_plant, and pnl_plant are provided. It uses the actor pattern so you'll want to start the plant, and communicate with it using the handle.

Example Usage:

pub async fn stream_live_ticks(&self, env: &RithmicConnectionSystem, account_info: &AccountInfo) {
    event!(Level::INFO, "market-data streaming ticks");

    let ticker_plant = RithmicTickerPlant::new(env, account_info).await;
    let ticker_plant_handle = ticker_plant.get_handle();

    let mut min_backoff_wait = 1;

    while let Err(err) = ticker_plant_handle.login().await {
        event!(Level::ERROR, "market-data: login failed: {}", err);

        sleep(Duration::from_secs(min_backoff_wait)).await;

        min_backoff_wait *= 2;

        if min_backoff_wait > 60 {
            event!(Level::ERROR, "market-data: login exceeded max backoff");

            panic!("market-data: login exceeded max backoff")
        }
    }

    for (base_symbol, symbol) in self.base_symbol_to_symbol_map.iter() {
        let _ = ticker_plant_handle
            .subscribe(symbol, base_symbol.get_exchange().as_str())
            .await;
    }
}

About

Connect to RithmicAPI using Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published