Skip to content

Commit

Permalink
doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wboayue committed Oct 18, 2024
1 parent 4a86a77 commit 24165c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,16 @@ impl Client {
/// # Examples
///
/// ```no_run
/// use ibapi::Client;
/// use ibapi::contracts::Contract;
///
/// let client = Client::connect("127.0.0.1:4002", 100).expect("connection failed");
///
/// let contract = Contract::stock("AAPL");
/// let subscription = client.calculate_option_price(&contract, 100.0, 235.0).expect("request failed");
/// for calculation in &subscription {
/// println!("calculation: {:?}", calculation);
/// }
/// ```
pub fn calculate_option_price<'a>(
&'a self,
Expand All @@ -405,6 +415,16 @@ impl Client {
/// # Examples
///
/// ```no_run
/// use ibapi::Client;
/// use ibapi::contracts::Contract;
///
/// let client = Client::connect("127.0.0.1:4002", 100).expect("connection failed");
///
/// let contract = Contract::stock("AAPL");
/// let subscription = client.calculate_implied_volatility(&contract, 300.0, 235.0).expect("request failed");
/// for calculation in &subscription {
/// println!("calculation: {:?}", calculation);
/// }
/// ```
pub fn calculate_implied_volatility<'a>(
&'a self,
Expand Down

0 comments on commit 24165c5

Please sign in to comment.