lib/ig_markets/dealing_platform/client_sentiment_methods.rb
# Returns client sentiments for the specified markets.
#
# @param [Array<String>] market_ids The IDs of the markets to return client sentiments for.
#
# @return [Array<ClientSentiment>]
Returns client sentiments for the specified markets.
Returns client sentiments for the specified markets .
def find(*market_ids)
        result = @dealing_platform.session.get "clientsentiment?marketIds=#{market_ids.join ','}"
        models = @dealing_platform.instantiate_models ClientSentiment, result.fetch(:client_sentiments)
        models.each do |client_sentiment|
          if client_sentiment.long_position_percentage == 0.0 && client_sentiment.short_position_percentage == 0.0
            raise ArgumentError, "unknown market '#{client_sentiment.market_id}'"
          end
        end
        models
      end
def find ( * market_ids ) result = @dealing_platform . session . get "clientsentiment?marketIds=#{market_ids.join ','}" models = @dealing_platform . instantiate_models ClientSentiment , result . fetch ( :client_sentiments ) models . each do | client_sentiment | if client_sentiment . long_position_percentage == 0.0 && client_sentiment . short_position_percentage == 0.0 raise ArgumentError , "unknown market '#{client_sentiment.market_id}'" end end models end
Returns client sentiments for the specified markets.
Returns client sentiments for the specified markets .
# Invalid market IDs are returned with both percentages set to zero
None
Array<ClientSentiment>
market_ids
market_ids The IDs of the markets to return client sentiments for.
market_ids The IDs of the markets to return client sentiments for .