oanda_api 0.9.5 → 0.9.6

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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +15 -0
  4. data/CHANGELOG.md +24 -9
  5. data/Gemfile +2 -3
  6. data/README.md +11 -9
  7. data/lib/oanda_api.rb +1 -0
  8. data/lib/oanda_api/client/client.rb +13 -7
  9. data/lib/oanda_api/configuration.rb +57 -24
  10. data/lib/oanda_api/resource/order.rb +5 -6
  11. data/lib/oanda_api/resource/transaction.rb +3 -4
  12. data/lib/oanda_api/resource_collection.rb +4 -2
  13. data/lib/oanda_api/streaming/request.rb +6 -1
  14. data/lib/oanda_api/throttling/throttling.rb +105 -0
  15. data/lib/oanda_api/version.rb +1 -1
  16. data/oanda_api.gemspec +4 -4
  17. data/spec/fixtures/vcr_cassettes/accounts_get.yml +7 -5
  18. data/spec/fixtures/vcr_cassettes/accounts_id_get.yml +18 -14
  19. data/spec/fixtures/vcr_cassettes/calendar_events_period_get.yml +20 -14
  20. data/spec/fixtures/vcr_cassettes/calendar_instrument_and_period_get.yml +24 -21
  21. data/spec/fixtures/vcr_cassettes/calendar_period_get.yml +20 -14
  22. data/spec/fixtures/vcr_cassettes/candles_options_get.yml +12 -10
  23. data/spec/fixtures/vcr_cassettes/client_helper_accounts.yml +48 -5
  24. data/spec/fixtures/vcr_cassettes/instrument_EUR_USD.yml +11 -9
  25. data/spec/fixtures/vcr_cassettes/instrument_USD_JPY.yml +10 -8
  26. data/spec/fixtures/vcr_cassettes/instruments_get.yml +25 -19
  27. data/spec/fixtures/vcr_cassettes/instruments_options_get.yml +8 -6
  28. data/spec/fixtures/vcr_cassettes/order_id_close.yml +159 -313
  29. data/spec/fixtures/vcr_cassettes/order_id_get.yml +103 -21
  30. data/spec/fixtures/vcr_cassettes/order_options_create.yml +9 -7
  31. data/spec/fixtures/vcr_cassettes/order_options_update.yml +62 -20
  32. data/spec/fixtures/vcr_cassettes/orders_get.yml +46 -137
  33. data/spec/fixtures/vcr_cassettes/orders_options_get.yml +29 -50
  34. data/spec/fixtures/vcr_cassettes/positions_get.yml +19 -15
  35. data/spec/fixtures/vcr_cassettes/positions_instrument_close.yml +35 -27
  36. data/spec/fixtures/vcr_cassettes/positions_instrument_get.yml +17 -13
  37. data/spec/fixtures/vcr_cassettes/prices_options_get.yml +12 -10
  38. data/spec/fixtures/vcr_cassettes/spread_history_get.yml +17 -13
  39. data/spec/fixtures/vcr_cassettes/spreads_get.yml +17 -13
  40. data/spec/fixtures/vcr_cassettes/trade_id_close.yml +115 -52
  41. data/spec/fixtures/vcr_cassettes/trade_id_get.yml +278 -16
  42. data/spec/fixtures/vcr_cassettes/trade_options_modify.yml +58 -16
  43. data/spec/fixtures/vcr_cassettes/trades_filter_get.yml +44 -19
  44. data/spec/fixtures/vcr_cassettes/trades_get.yml +55 -16
  45. data/spec/fixtures/vcr_cassettes/transaction_id_get.yml +271 -149
  46. data/spec/fixtures/vcr_cassettes/transactions_options_get.yml +258 -133
  47. data/spec/fixtures/vcr_cassettes/with_throttling_and_max_requests_per_second.yml +28 -22
  48. data/spec/fixtures/vcr_cassettes/with_throttling_new_connections.yml +443 -0
  49. data/spec/fixtures/vcr_cassettes/with_throttling_with_multiple_threads.yml +57 -45
  50. data/spec/fixtures/vcr_cassettes/without_throttling.yml +91 -71
  51. data/spec/oanda_api/configuration_spec.rb +31 -0
  52. data/spec/oanda_api/examples/request_throttling_spec.rb +39 -4
  53. data/spec/oanda_api/examples/spread_history_spec.rb +3 -3
  54. data/spec/oanda_api/resource_collection_spec.rb +9 -0
  55. data/spec/oanda_api/streaming/client_spec.rb +5 -5
  56. data/spec/oanda_api/streaming/request_spec.rb +23 -8
  57. data/spec/spec_helper.rb +0 -3
  58. data/spec/support/client_helper.rb +6 -2
  59. metadata +13 -12
  60. data/spec/fixtures/vcr_cassettes/client_helper_account.yml +0 -45
@@ -0,0 +1,105 @@
1
+ module OandaAPI
2
+ #
3
+ # Everything related to throttling the rate of new connections.
4
+ module Throttling
5
+
6
+ # Makes all methods in this module singleton methods.
7
+ extend self
8
+
9
+ # Used to synchronize throttling metrics.
10
+ @throttle_mutex = Mutex.new
11
+
12
+ def included(base)
13
+ base.send(:extend, ClassMethods)
14
+ end
15
+
16
+ # Time that the last connection was created.
17
+ # @return [Time]
18
+ def last_new_connection_at
19
+ @throttle_mutex.synchronize { @last_new_connection_at }
20
+ end
21
+
22
+ # Set the time the last new connection was created
23
+ # @param value [Time]
24
+ # @return [Time]
25
+ def last_new_connection_at=(value)
26
+ @throttle_mutex.synchronize { @last_new_connection_at = value }
27
+ end
28
+
29
+ # Original (unmonkey-patched) '.new' method of the including class
30
+ # @param klass [Class] the class that has included this module
31
+ # @return [UnboundMethod]
32
+ def original_new_method(klass)
33
+ @original_new_method ||= klass.method(:new).unbind
34
+ end
35
+
36
+ # Alias to `Throttling.original_new_method`
37
+ def save_original_new_method(klass)
38
+ original_new_method klass
39
+ end
40
+
41
+ # Restores the original '.new' method of the including class
42
+ # @param klass [Class] the class that has included this module
43
+ # @return [void]
44
+ def restore_original_new_method(klass)
45
+ klass.define_singleton_method :new do |*args, &block|
46
+ Throttling.original_new_method(klass).bind(klass).call *args, &block
47
+ end
48
+ end
49
+
50
+ # Throttles the connection rate by sleeping for a duration
51
+ # if the interval bewteen consecutive connections is less
52
+ # than the allowed minimum. Only throttles when the API
53
+ # is configured to use_request_throttling.
54
+ # @return [void]
55
+ def throttle_connection_rate
56
+ now = Time.now
57
+ delta = now - (last_new_connection_at || now)
58
+ _throttle(delta, now) if delta < OandaAPI.configuration.min_new_connection_interval &&
59
+ OandaAPI.configuration.use_request_throttling?
60
+ self.last_new_connection_at = Time.now
61
+ end
62
+
63
+ # Methods in this module are mixed into the including class as singletons.
64
+ module ClassMethods
65
+ #
66
+ # Enables or Disables connection rate limits
67
+ # @param use_throttling [Boolean] if `false` connection rates
68
+ # are NOT limited
69
+ # @return [void]
70
+ def limit_connection_rate(use_throttling=true)
71
+ klass = self
72
+ Throttling.save_original_new_method klass
73
+
74
+ unless use_throttling
75
+ Throttling.restore_original_new_method klass
76
+ return
77
+ end
78
+
79
+ # Use an anonymous module, so that it can be prepended into
80
+ # the including class. Prepending is important because we're
81
+ # monkey-patching the including class's `.new` method, and want
82
+ # to be able to call `super` to invoke that original `.new`.
83
+ connection_rate_limiter = Module.new do
84
+ klass.define_singleton_method :new do |*args, &block|
85
+ Throttling.throttle_connection_rate
86
+ #
87
+ # `super` works here because we use prepend to mix this module
88
+ # into the including class.
89
+ super *args, &block
90
+ end
91
+ end
92
+ prepend connection_rate_limiter
93
+ end
94
+ end
95
+
96
+ private
97
+ # @private
98
+ def _throttle(delta, time)
99
+ sleep OandaAPI.configuration.min_new_connection_interval - delta
100
+ end
101
+ end
102
+ end
103
+
104
+ # Mix into Net::HTTP to add rate limiting behavior
105
+ Net::HTTP.send :include, OandaAPI::Throttling
@@ -1,3 +1,3 @@
1
1
  module OandaAPI
2
- VERSION = "0.9.5"
2
+ VERSION = "0.9.6"
3
3
  end
@@ -21,12 +21,12 @@ Gem::Specification.new do |s|
21
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
22
  s.require_paths = ["lib"]
23
23
 
24
- s.add_dependency "httparty", "~> 0.13", ">= 0.13.5"
24
+ s.add_dependency "httparty", "~> 0.13", ">=0.13.5"
25
25
  s.add_dependency "persistent_httparty", "~> 0.1"
26
26
  s.add_dependency "http-exceptions", "~> 0.0"
27
27
 
28
28
  s.add_development_dependency "rspec", "~> 3.2"
29
- s.add_development_dependency "vcr", "~> 3.0"
30
- s.add_development_dependency "webmock", "~> 1.24"
31
- s.add_development_dependency "yard", "~> 0.8"
29
+ s.add_development_dependency "vcr", "~> 4.0"
30
+ s.add_development_dependency "webmock", "~> 3.2.1"
31
+ s.add_development_dependency "yard", "~> 0.9"
32
32
  end
@@ -14,16 +14,16 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Mon, 14 Mar 2016 16:28:06 GMT
26
+ - Mon, 08 Jan 2018 18:26:29 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
@@ -32,6 +32,8 @@ http_interactions:
32
32
  - keep-alive
33
33
  Etag:
34
34
  - '"efb224b14d5e6c03ab1a19a9983274e09d124b20"'
35
+ Access-Control-Allow-Origin:
36
+ - "*"
35
37
  body:
36
38
  encoding: UTF-8
37
39
  string: "{\n\t\"accounts\" : [\n\t\t{\n\t\t\t\"accountId\" : 1871900,\n\t\t\t\"accountName\"
@@ -41,5 +43,5 @@ http_interactions:
41
43
  : 5094848,\n\t\t\t\"accountName\" : \"WTI\",\n\t\t\t\"accountCurrency\" :
42
44
  \"CAD\",\n\t\t\t\"marginRate\" : 0.05\n\t\t}\n\t]\n}"
43
45
  http_version:
44
- recorded_at: Mon, 14 Mar 2016 16:28:06 GMT
45
- recorded_with: VCR 3.0.1
46
+ recorded_at: Mon, 08 Jan 2018 18:26:40 GMT
47
+ recorded_with: VCR 4.0.0
@@ -14,16 +14,16 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Mon, 14 Mar 2016 16:28:07 GMT
26
+ - Mon, 08 Jan 2018 18:26:30 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
@@ -32,6 +32,8 @@ http_interactions:
32
32
  - keep-alive
33
33
  Etag:
34
34
  - '"efb224b14d5e6c03ab1a19a9983274e09d124b20"'
35
+ Access-Control-Allow-Origin:
36
+ - "*"
35
37
  body:
36
38
  encoding: UTF-8
37
39
  string: "{\n\t\"accounts\" : [\n\t\t{\n\t\t\t\"accountId\" : 1871900,\n\t\t\t\"accountName\"
@@ -41,7 +43,7 @@ http_interactions:
41
43
  : 5094848,\n\t\t\t\"accountName\" : \"WTI\",\n\t\t\t\"accountCurrency\" :
42
44
  \"CAD\",\n\t\t\t\"marginRate\" : 0.05\n\t\t}\n\t]\n}"
43
45
  http_version:
44
- recorded_at: Mon, 14 Mar 2016 16:28:07 GMT
46
+ recorded_at: Mon, 08 Jan 2018 18:26:40 GMT
45
47
  - request:
46
48
  method: get
47
49
  uri: https://api-fxpractice.oanda.com/v1/accounts/1871900
@@ -56,30 +58,32 @@ http_interactions:
56
58
  Connection:
57
59
  - keep-alive
58
60
  Keep-Alive:
59
- - 30
61
+ - '30'
60
62
  response:
61
63
  status:
62
64
  code: 200
63
65
  message: OK
64
66
  headers:
65
67
  Server:
66
- - openresty/1.7.0.1
68
+ - openresty/1.9.15.1
67
69
  Date:
68
- - Mon, 14 Mar 2016 16:28:08 GMT
70
+ - Mon, 08 Jan 2018 18:26:30 GMT
69
71
  Content-Type:
70
72
  - application/json
71
73
  Content-Length:
72
- - '276'
74
+ - '281'
73
75
  Connection:
74
76
  - keep-alive
75
77
  Etag:
76
- - '"158b907f059d85274d407e88979dc2a616a3e0c9"'
78
+ - '"2b9c9470fe6b14a3b70f84f38c304849658437fd"'
79
+ Access-Control-Allow-Origin:
80
+ - "*"
77
81
  body:
78
82
  encoding: UTF-8
79
83
  string: "{\n\t\"accountId\" : 1871900,\n\t\"accountName\" : \"Primary\",\n\t\"balance\"
80
- : 100375.6663,\n\t\"unrealizedPl\" : -18.712,\n\t\"realizedPl\" : 332.7989,\n\t\"marginUsed\"
81
- : 8111.17,\n\t\"marginAvail\" : 92245.7843,\n\t\"openTrades\" : 16,\n\t\"openOrders\"
82
- : 0,\n\t\"marginRate\" : 0.05,\n\t\"accountCurrency\" : \"USD\"\n}"
84
+ : 95861.8318,\n\t\"unrealizedPl\" : 20787.7185,\n\t\"realizedPl\" : 802.0217,\n\t\"marginUsed\"
85
+ : 19156.3275,\n\t\"marginAvail\" : 97493.2228,\n\t\"openTrades\" : 33,\n\t\"openOrders\"
86
+ : 4,\n\t\"marginRate\" : 0.05,\n\t\"accountCurrency\" : \"USD\"\n}"
83
87
  http_version:
84
- recorded_at: Mon, 14 Mar 2016 16:28:08 GMT
85
- recorded_with: VCR 3.0.1
88
+ recorded_at: Mon, 08 Jan 2018 18:26:40 GMT
89
+ recorded_with: VCR 4.0.0
@@ -14,41 +14,47 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Tue, 15 Mar 2016 02:04:37 GMT
26
+ - Mon, 08 Jan 2018 18:26:30 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
30
- - '141'
30
+ - '503'
31
31
  Connection:
32
32
  - keep-alive
33
33
  Vary:
34
34
  - Accept-Encoding
35
35
  - Accept-Encoding
36
36
  - Content-Type
37
+ Access-Control-Allow-Headers:
38
+ - Accept, Authorization, Content-Type, Origin, X-Accept-DateTime-Format, X-HTTP-Method-Override
39
+ Access-Control-Allow-Methods:
40
+ - GET, OPTIONS
41
+ Access-Control-Allow-Origin:
42
+ - "*"
37
43
  Version:
38
44
  - '0.2'
39
45
  X-Catalyst:
40
46
  - '5.90042'
41
47
  Set-Cookie:
42
- - opc_id=457AC54C-EA52-11E5-A7B3-D5EF00E185C7; path=/; Expires=Fri, 13-Mar-2026
43
- 02:04:37 GMT
44
- - opc_id=457ACA42-EA52-11E5-8CFC-C9DDAC69487D; path=/; Expires=Fri, 13-Mar-2026
45
- 02:04:37 GMT
46
- Access-Control-Allow-Origin:
47
- - "*"
48
+ - opc_id=7296EF1E-F4A1-11E7-8B1F-FF0B5ADA5B26; path=/; Expires=Thu, 06-Jan-2028
49
+ 18:26:30 GMT
50
+ - opc_id=7296F6B2-F4A1-11E7-8C83-952E8752AE89; path=/; Expires=Thu, 06-Jan-2028
51
+ 18:26:30 GMT
48
52
  body:
49
53
  encoding: UTF-8
50
- string: '[{"actual":"-0.1","previous":"0.5","currency":"AUD","unit":"% m/m","timestamp":1458001800,"region":"asia","title":"New
51
- motor vehicle sales"}]'
54
+ string: '[{"market":"-0.2","actual":"-0.4","region":"europe","currency":"EUR","forecast":"-0.8","previous":"0.7","unit":"%
55
+ m/m","timestamp":1515394800,"title":"Factory orders (sa)","impact":2},{"market":"-0.1","actual":"0.0","region":"europe","currency":"CHF","previous":"-0.1","unit":"%
56
+ m/m","timestamp":1515399300,"title":"CPI","impact":3},{"market":"0.2","actual":"-0.6","region":"europe","currency":"GBP","previous":"0.3","unit":"%
57
+ m/m","timestamp":1515400200,"title":"Halifax House Price Index","impact":1}]'
52
58
  http_version:
53
- recorded_at: Tue, 15 Mar 2016 02:04:37 GMT
54
- recorded_with: VCR 3.0.1
59
+ recorded_at: Mon, 08 Jan 2018 18:26:41 GMT
60
+ recorded_with: VCR 4.0.0
@@ -14,48 +14,51 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Tue, 15 Mar 2016 03:18:02 GMT
26
+ - Mon, 08 Jan 2018 18:26:30 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
30
- - '1521'
30
+ - '1292'
31
31
  Connection:
32
32
  - keep-alive
33
33
  Vary:
34
34
  - Accept-Encoding
35
35
  - Accept-Encoding
36
36
  - Content-Type
37
+ Access-Control-Allow-Headers:
38
+ - Accept, Authorization, Content-Type, Origin, X-Accept-DateTime-Format, X-HTTP-Method-Override
39
+ Access-Control-Allow-Methods:
40
+ - GET, OPTIONS
41
+ Access-Control-Allow-Origin:
42
+ - "*"
37
43
  Version:
38
44
  - '0.2'
39
45
  X-Catalyst:
40
46
  - '5.90042'
41
47
  Set-Cookie:
42
- - opc_id=86B5FFB8-EA5C-11E5-881F-D1E6F4BDB1E4; path=/; Expires=Fri, 13-Mar-2026
43
- 03:18:02 GMT
44
- - opc_id=86B6044A-EA5C-11E5-B985-AD0F236BD5E3; path=/; Expires=Fri, 13-Mar-2026
45
- 03:18:02 GMT
46
- Access-Control-Allow-Origin:
47
- - "*"
48
+ - opc_id=7250BBAC-F4A1-11E7-BE04-88F12FF57115; path=/; Expires=Thu, 06-Jan-2028
49
+ 18:26:30 GMT
50
+ - opc_id=7250C322-F4A1-11E7-A624-8A0207DAA140; path=/; Expires=Thu, 06-Jan-2028
51
+ 18:26:30 GMT
48
52
  body:
49
53
  encoding: UTF-8
50
- string: '[{"market":"0.5","actual":"3.3","region":"europe","currency":"EUR","forecast":"-0.3","previous":"-0.3","unit":"%
51
- m/m","timestamp":1457420400,"title":"Industrial Production","impact":2},{"market":"180","actual":"212.6","region":"americas","currency":"CAD","previous":"165.1","unit":"k","timestamp":1457442900,"title":"Housing
52
- starts","impact":2},{"market":"-2.3","actual":"-9.8","region":"americas","currency":"CAD","previous":"7.7","unit":"%
53
- m/m","timestamp":1457443800,"title":"Building permits","impact":2},{"currency":"CAD","unit":"","timestamp":1457535600,"region":"americas","title":"BoC
54
- interest rate announcement","impact":3},{"market":"0.05","actual":"0.00","region":"europe","currency":"EUR","forecast":"0.05","previous":"0.05","unit":"%","timestamp":1457613900,"title":"ECB
55
- - Refinancing Rate","impact":3},{"market":"-0.4","actual":"-0.40","region":"europe","currency":"EUR","forecast":"-0.4","previous":"-0.3","unit":"%","timestamp":1457613900,"title":"ECB
56
- - Deposit Rate","impact":3},{"currency":"EUR","unit":"","timestamp":1457616600,"region":"europe","title":"ECB
57
- President Draghi gives press conference following interest rate announcement","impact":3},{"market":"10","actual":"-2.3","region":"americas","currency":"CAD","forecast":"0","previous":"-5.7","unit":"k","timestamp":1457703000,"title":"Net
58
- Change in Employment","impact":2},{"market":"7.2","actual":"7.3","region":"americas","currency":"CAD","forecast":"7.2","previous":"7.2","unit":"%","timestamp":1457703000,"title":"Unemployment","impact":2}]'
54
+ string: '[{"market":"-13","actual":"-29","region":"europe","currency":"EUR","previous":"-20","unit":"k","timestamp":1514969700,"title":"Unemployment
55
+ Change","impact":2},{"market":"5.5","actual":"5.5","region":"europe","currency":"EUR","previous":"5.5","unit":"%","timestamp":1514969700,"title":"Unemployment
56
+ Rate (sa)","impact":2},{"market":"1","actual":"2.3","region":"europe","currency":"EUR","previous":"-1.0","unit":"%
57
+ m/m","timestamp":1515135600,"title":"Retail Sales","impact":2},{"market":"1.4","actual":"1.4","region":"europe","currency":"EUR","forecast":"1.4","previous":"1.5","unit":"%
58
+ y/y","timestamp":1515146400,"title":"HICP","impact":3},{"market":"1.0","actual":"0.9","region":"europe","currency":"EUR","forecast":"0.9","previous":"0.9","unit":"%
59
+ y/y","timestamp":1515146400,"title":"HICP - Core","impact":3},{"market":"6.0","actual":"5.7","region":"americas","currency":"CAD","previous":"5.9","unit":"%","timestamp":1515159000,"title":"Unemployment","impact":3},{"actual":"60.4","previous":"63.0","currency":"CAD","unit":"index","timestamp":1515164400,"region":"americas","title":"Ivey
60
+ PMI","impact":2},{"market":"-0.2","actual":"-0.4","region":"europe","currency":"EUR","forecast":"-0.8","previous":"0.7","unit":"%
61
+ m/m","timestamp":1515394800,"title":"Factory orders (sa)","impact":2}]'
59
62
  http_version:
60
- recorded_at: Tue, 15 Mar 2016 03:18:02 GMT
61
- recorded_with: VCR 3.0.1
63
+ recorded_at: Mon, 08 Jan 2018 18:26:41 GMT
64
+ recorded_with: VCR 4.0.0
@@ -14,41 +14,47 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Tue, 15 Mar 2016 03:18:02 GMT
26
+ - Mon, 08 Jan 2018 18:26:30 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
30
- - '141'
30
+ - '503'
31
31
  Connection:
32
32
  - keep-alive
33
33
  Vary:
34
34
  - Accept-Encoding
35
35
  - Accept-Encoding
36
36
  - Content-Type
37
+ Access-Control-Allow-Headers:
38
+ - Accept, Authorization, Content-Type, Origin, X-Accept-DateTime-Format, X-HTTP-Method-Override
39
+ Access-Control-Allow-Methods:
40
+ - GET, OPTIONS
41
+ Access-Control-Allow-Origin:
42
+ - "*"
37
43
  Version:
38
44
  - '0.2'
39
45
  X-Catalyst:
40
46
  - '5.90042'
41
47
  Set-Cookie:
42
- - opc_id=86D286D8-EA5C-11E5-BFAA-A35DFB29ED21; path=/; Expires=Fri, 13-Mar-2026
43
- 03:18:02 GMT
44
- - opc_id=86D28C82-EA5C-11E5-B66E-E64900000000; path=/; Expires=Fri, 13-Mar-2026
45
- 03:18:02 GMT
46
- Access-Control-Allow-Origin:
47
- - "*"
48
+ - opc_id=72769714-F4A1-11E7-B1C7-C41200000000; path=/; Expires=Thu, 06-Jan-2028
49
+ 18:26:30 GMT
50
+ - opc_id=7276A57E-F4A1-11E7-A835-D187E969E271; path=/; Expires=Thu, 06-Jan-2028
51
+ 18:26:30 GMT
48
52
  body:
49
53
  encoding: UTF-8
50
- string: '[{"actual":"-0.1","previous":"0.5","currency":"AUD","unit":"% m/m","timestamp":1458001800,"region":"asia","title":"New
51
- motor vehicle sales"}]'
54
+ string: '[{"market":"-0.2","actual":"-0.4","region":"europe","currency":"EUR","forecast":"-0.8","previous":"0.7","unit":"%
55
+ m/m","timestamp":1515394800,"title":"Factory orders (sa)","impact":2},{"market":"-0.1","actual":"0.0","region":"europe","currency":"CHF","previous":"-0.1","unit":"%
56
+ m/m","timestamp":1515399300,"title":"CPI","impact":3},{"market":"0.2","actual":"-0.6","region":"europe","currency":"GBP","previous":"0.3","unit":"%
57
+ m/m","timestamp":1515400200,"title":"Halifax House Price Index","impact":1}]'
52
58
  http_version:
53
- recorded_at: Tue, 15 Mar 2016 03:18:02 GMT
54
- recorded_with: VCR 3.0.1
59
+ recorded_at: Mon, 08 Jan 2018 18:26:41 GMT
60
+ recorded_with: VCR 4.0.0
@@ -14,30 +14,32 @@ http_interactions:
14
14
  Connection:
15
15
  - keep-alive
16
16
  Keep-Alive:
17
- - 30
17
+ - '30'
18
18
  response:
19
19
  status:
20
20
  code: 200
21
21
  message: OK
22
22
  headers:
23
23
  Server:
24
- - openresty/1.7.0.1
24
+ - openresty/1.9.15.1
25
25
  Date:
26
- - Mon, 14 Mar 2016 23:03:28 GMT
26
+ - Mon, 08 Jan 2018 18:26:34 GMT
27
27
  Content-Type:
28
28
  - application/json
29
29
  Content-Length:
30
- - '259'
30
+ - '254'
31
31
  Connection:
32
32
  - keep-alive
33
33
  Etag:
34
- - '"c7552c220406ff187c34d0c25964c2f79aed1d9f"'
34
+ - '"6d5bf87c951bbd04839c13ab691326007159991a"'
35
+ Access-Control-Allow-Origin:
36
+ - "*"
35
37
  body:
36
38
  encoding: UTF-8
37
39
  string: "{\n\t\"instrument\" : \"EUR_USD\",\n\t\"granularity\" : \"M1\",\n\t\"candles\"
38
- : [\n\t\t{\n\t\t\t\"time\" : \"2016-03-14T23:03:00.000000Z\",\n\t\t\t\"openMid\"
39
- : 1.110365,\n\t\t\t\"highMid\" : 1.110365,\n\t\t\t\"lowMid\" : 1.11036,\n\t\t\t\"closeMid\"
40
- : 1.11036,\n\t\t\t\"volume\" : 2,\n\t\t\t\"complete\" : false\n\t\t}\n\t]\n}"
40
+ : [\n\t\t{\n\t\t\t\"time\" : \"2018-01-08T18:26:00.000000Z\",\n\t\t\t\"openMid\"
41
+ : 1.1968,\n\t\t\t\"highMid\" : 1.1968,\n\t\t\t\"lowMid\" : 1.19676,\n\t\t\t\"closeMid\"
42
+ : 1.1968,\n\t\t\t\"volume\" : 5,\n\t\t\t\"complete\" : false\n\t\t}\n\t]\n}"
41
43
  http_version:
42
- recorded_at: Mon, 14 Mar 2016 23:03:29 GMT
43
- recorded_with: VCR 2.9.3
44
+ recorded_at: Mon, 08 Jan 2018 18:26:45 GMT
45
+ recorded_with: VCR 4.0.0