ig_markets 0.30 → 0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f3dac7d0fc4292623c5cecde02665bf51d88964
4
- data.tar.gz: 1e02ad232416b6f07a32cb235008c29893bc0052
3
+ metadata.gz: d43d7d776df76a8ac237f866ea55d5006e1f87c5
4
+ data.tar.gz: d4ec2f9f14cb68aeb9b2942bc5e4c5a54f6d59f8
5
5
  SHA512:
6
- metadata.gz: a3e5fd9d9cfafa9c3c6b2aa2480d11b350a39e2b1bc0d62bfbf475801c2ffc379ef02316a5f3574fb01a483c6ab6768e0ff58f79199aa30b333b1faf19476302
7
- data.tar.gz: 78acd317c9389cd9e990b450afc78343d5b0d4948eaa9c2d726f2ab31b47141e535c649f0bda3e5b59705bb0cabf74a5ecf2e04f699ae0f711dc3fee5e5c545e
6
+ metadata.gz: 7ebcba64fce12c9f276811d0df4e6588d484de43c5673cfbf7afd8c448f9d6cd94bf396847890d188e5cd2d53326652783e5ef19f24f210e0e2ae08901377c8b
7
+ data.tar.gz: 5f3a03a7c45f0d973303fb37284b67ab5ba14e83a73917f540a4054b271b4812227a8afa826c11586fee6378d81c1be933bd8e450e8d74b5c874300e532d41bc
@@ -1,9 +1,17 @@
1
1
  # IG Markets Changelog
2
2
 
3
+ ### 0.31 — March 26, 2017
4
+
5
+ - Added `IGMarkets::Streaming::PositionUpdate#currency` attribute.
6
+ - Added proper detection of an invalid deal ID passed to `ig_markets orders update`.
7
+ - Limited the update rate of `ig_markets stream` to 2Hz to avoid flickering caused by large numbers of simultaneous
8
+ updates.
9
+ - Fixed errors caused by a missing millisecond component on certain timestamps.
10
+
3
11
  ### 0.30 — March 10, 2017
4
12
 
5
13
  - Fixed `ig_markets self-test` command
6
- - Support the `chart` transaction type
14
+ - Support the `trade` transaction type
7
15
 
8
16
  ### 0.29 — March 8, 2017
9
17
 
@@ -54,7 +54,11 @@ module IGMarkets
54
54
 
55
55
  def update(deal_id)
56
56
  Main.begin_session(options) do |dealing_platform|
57
- deal_reference = dealing_platform.working_orders[deal_id].update working_order_attributes
57
+ working_order = dealing_platform.working_orders[deal_id]
58
+
59
+ raise 'No working order with the specified deal ID' unless working_order
60
+
61
+ deal_reference = working_order.update working_order_attributes
58
62
 
59
63
  Main.report_deal_confirmation deal_reference
60
64
  end
@@ -109,13 +109,16 @@ module IGMarkets
109
109
  account_state.process_queued_data
110
110
 
111
111
  window.clear
112
- window.print_lines Tables::AccountsTable.new(account_state.accounts).lines,
113
- '',
114
- Tables::PositionsTable.new(account_state.positions, aggregate: options[:aggregate]).lines,
115
- '',
116
- Tables::WorkingOrdersTable.new(account_state.working_orders).lines,
117
- ''
112
+ window.print_lines window_content(account_state)
118
113
  window.refresh
114
+
115
+ sleep 0.5
116
+ end
117
+
118
+ def window_content(account_state)
119
+ [Tables::AccountsTable.new(account_state.accounts).lines, '',
120
+ Tables::PositionsTable.new(account_state.positions, aggregate: options[:aggregate]).lines, '',
121
+ Tables::WorkingOrdersTable.new(account_state.working_orders).lines, '']
119
122
  end
120
123
  end
121
124
  end
@@ -10,7 +10,7 @@ module IGMarkets
10
10
  attribute :account_id
11
11
  attribute :affected_deals, AffectedDeal
12
12
  attribute :channel
13
- attribute :date, Time, format: '%FT%T.%L'
13
+ attribute :date, Time, format: ['%FT%T.%L', '%FT%T']
14
14
  attribute :deal_id
15
15
  attribute :deal_reference
16
16
  attribute :deal_status, Symbol, allowed_values: [:accepted, :fund_account, :rejected]
@@ -4,6 +4,7 @@ module IGMarkets
4
4
  class PositionUpdate < Model
5
5
  attribute :account_id
6
6
  attribute :channel
7
+ attribute :currency
7
8
  attribute :deal_id
8
9
  attribute :deal_id_origin
9
10
  attribute :deal_reference
@@ -17,7 +18,7 @@ module IGMarkets
17
18
  attribute :size, Float
18
19
  attribute :status, Symbol, allowed_values: [:deleted, :open, :updated]
19
20
  attribute :stop_level, Float
20
- attribute :timestamp, Time, format: '%FT%T.%L'
21
+ attribute :timestamp, Time, format: ['%FT%T.%L', '%FT%T']
21
22
  end
22
23
  end
23
24
  end
@@ -21,7 +21,7 @@ module IGMarkets
21
21
  attribute :status, Symbol, allowed_values: [:deleted, :open, :updated]
22
22
  attribute :stop_distance, Integer
23
23
  attribute :time_in_force, Symbol, allowed_values: [:good_till_cancelled, :good_till_date]
24
- attribute :timestamp, Time, format: '%FT%T.%L'
24
+ attribute :timestamp, Time, format: ['%FT%T.%L', '%FT%T']
25
25
  end
26
26
  end
27
27
  end
@@ -1,4 +1,4 @@
1
1
  module IGMarkets
2
2
  # The version of this gem.
3
- VERSION = '0.30'.freeze
3
+ VERSION = '0.31'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ig_markets
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.30'
4
+ version: '0.31'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Viney
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize