Class: IGMarkets::Streaming::PositionUpdate

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

Overview

Contains details on a position update received via the streaming API. Used by Subscription#on_data.

Instance Attribute Summary

Attributes inherited from Model

#attributes

Instance Method Summary collapse

Methods inherited from Model

#==, allowed_values, attribute, attribute_type, attribute_value_allowed?, defined_attribute_names, deprecated_attribute, #initialize, #initialize_copy, #inspect, #to_h, valid_attribute?

Constructor Details

This class inherits a constructor from IGMarkets::Model

Instance Method Details

#account_idObject

The account_id attribute.

Returns:

  • []


5
# File 'lib/ig_markets/streaming/position_update.rb', line 5

attribute :account_id

#channelObject

The channel attribute.

Returns:

  • []


6
# File 'lib/ig_markets/streaming/position_update.rb', line 6

attribute :channel

#currencyObject

The currency attribute.

Returns:

  • []


7
# File 'lib/ig_markets/streaming/position_update.rb', line 7

attribute :currency

#deal_idObject

The deal_id attribute.

Returns:

  • []


8
# File 'lib/ig_markets/streaming/position_update.rb', line 8

attribute :deal_id

#deal_id_originObject

The deal_id_origin attribute.

Returns:

  • []


9
# File 'lib/ig_markets/streaming/position_update.rb', line 9

attribute :deal_id_origin

#deal_referenceObject

The deal_reference attribute.

Returns:

  • []


10
# File 'lib/ig_markets/streaming/position_update.rb', line 10

attribute :deal_reference

#deal_statusSymbol

The deal_status attribute.

Returns:

  • (Symbol)

11
# File 'lib/ig_markets/streaming/position_update.rb', line 11

attribute :deal_status, Symbol, allowed_values: %i[accepted rejected]

#directionSymbol

The direction attribute.

Returns:

  • (Symbol)

12
# File 'lib/ig_markets/streaming/position_update.rb', line 12

attribute :direction, Symbol, allowed_values: %i[buy sell]

#epicString

The epic attribute.

Returns:

  • (String)

13
# File 'lib/ig_markets/streaming/position_update.rb', line 13

attribute :epic, String, regex: Regex::EPIC

#expiryDate

The expiry attribute.

Returns:

  • (Date)

14
# File 'lib/ig_markets/streaming/position_update.rb', line 14

attribute :expiry, Date, nil_if: %w[- DFB], format: ['%d-%b-%y', '%b-%y']

#guaranteed_stopBoolean

The guaranteed_stop attribute.

Returns:


15
# File 'lib/ig_markets/streaming/position_update.rb', line 15

attribute :guaranteed_stop, Boolean

#levelFloat

The level attribute.

Returns:

  • (Float)

16
# File 'lib/ig_markets/streaming/position_update.rb', line 16

attribute :level, Float

#limit_levelFloat

The limit_level attribute.

Returns:

  • (Float)

17
# File 'lib/ig_markets/streaming/position_update.rb', line 17

attribute :limit_level, Float

#sizeFloat

The size attribute.

Returns:

  • (Float)

18
# File 'lib/ig_markets/streaming/position_update.rb', line 18

attribute :size, Float

#statusSymbol

The status attribute.

Returns:

  • (Symbol)

19
# File 'lib/ig_markets/streaming/position_update.rb', line 19

attribute :status, Symbol, allowed_values: %i[deleted open updated]

#stop_levelFloat

The stop_level attribute.

Returns:

  • (Float)

20
# File 'lib/ig_markets/streaming/position_update.rb', line 20

attribute :stop_level, Float

#timestampTime

The timestamp attribute.

Returns:

  • (Time)

21
# File 'lib/ig_markets/streaming/position_update.rb', line 21

attribute :timestamp, Time, format: ['%FT%T.%L', '%FT%T']