Class: IGMarkets::ClientSentiment

Inherits:
Model
  • Object
show all
Defined in:
lib/ig_markets/client_sentiment.rb

Overview

Contains details on client sentiment for a single market. Returned by DealingPlatform::ClientSentimentMethods#[] and #related_sentiments.

Instance Attribute Summary

Attributes inherited from Model

#attributes

Instance Method Summary collapse

Methods inherited from Model

#==, allowed_values, attribute, attribute_type, defined_attribute_names, #initialize, #initialize_copy, #inspect

Constructor Details

This class inherits a constructor from IGMarkets::Model

Instance Method Details

#long_position_percentageFloat

The long_position_percentage attribute.

Returns:

  • (Float)


5
# File 'lib/ig_markets/client_sentiment.rb', line 5

attribute :long_position_percentage, Float

#market_idObject

The market_id attribute.

Returns:



6
# File 'lib/ig_markets/client_sentiment.rb', line 6

attribute :market_id

Returns client sentiments for markets that are related to this one.

Returns:



12
13
14
15
16
# File 'lib/ig_markets/client_sentiment.rb', line 12

def related_sentiments
  result = @dealing_platform.session.get("clientsentiment/related/#{market_id}").fetch :client_sentiments

  @dealing_platform.instantiate_models ClientSentiment, result
end

#short_position_percentageFloat

The short_position_percentage attribute.

Returns:

  • (Float)


7
# File 'lib/ig_markets/client_sentiment.rb', line 7

attribute :short_position_percentage, Float