Skip to main content

SentimentService

Trait SentimentService 

Source
pub trait SentimentService: Send + Sync {
    // Required methods
    fn get_client_sentiment<'life0, 'life1, 'async_trait>(
        &'life0 self,
        market_ids: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = Result<ClientSentimentResponse, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_client_sentiment_by_market<'life0, 'life1, 'async_trait>(
        &'life0 self,
        market_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<MarketSentiment, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_related_sentiment<'life0, 'life1, 'async_trait>(
        &'life0 self,
        market_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ClientSentimentResponse, AppError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Service for retrieving client sentiment data from the IG Markets API

Client sentiment shows the percentage of IG clients holding long versus short positions on a given instrument, providing insight into market positioning.

Required Methods§

Source

fn get_client_sentiment<'life0, 'life1, 'async_trait>( &'life0 self, market_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<ClientSentimentResponse, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns client sentiment for multiple markets

§Arguments
  • market_ids - List of market IDs to get sentiment for
§Returns
  • Ok(ClientSentimentResponse) - Sentiment data for the requested markets
  • Err(AppError) - If the request fails
Source

fn get_client_sentiment_by_market<'life0, 'life1, 'async_trait>( &'life0 self, market_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<MarketSentiment, AppError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns client sentiment for a single market

§Arguments
  • market_id - The market ID to get sentiment for
§Returns
  • Ok(MarketSentiment) - Sentiment data for the market
  • Err(AppError) - If the request fails

Returns client sentiment for related markets

Returns a list of related (also traded) client sentiment for the given instrument’s market.

§Arguments
  • market_id - The market ID to get related sentiments for
§Returns
  • Ok(ClientSentimentResponse) - Sentiment data for related markets
  • Err(AppError) - If the request fails

Implementors§