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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +15 -0
- data/CHANGELOG.md +24 -9
- data/Gemfile +2 -3
- data/README.md +11 -9
- data/lib/oanda_api.rb +1 -0
- data/lib/oanda_api/client/client.rb +13 -7
- data/lib/oanda_api/configuration.rb +57 -24
- data/lib/oanda_api/resource/order.rb +5 -6
- data/lib/oanda_api/resource/transaction.rb +3 -4
- data/lib/oanda_api/resource_collection.rb +4 -2
- data/lib/oanda_api/streaming/request.rb +6 -1
- data/lib/oanda_api/throttling/throttling.rb +105 -0
- data/lib/oanda_api/version.rb +1 -1
- data/oanda_api.gemspec +4 -4
- data/spec/fixtures/vcr_cassettes/accounts_get.yml +7 -5
- data/spec/fixtures/vcr_cassettes/accounts_id_get.yml +18 -14
- data/spec/fixtures/vcr_cassettes/calendar_events_period_get.yml +20 -14
- data/spec/fixtures/vcr_cassettes/calendar_instrument_and_period_get.yml +24 -21
- data/spec/fixtures/vcr_cassettes/calendar_period_get.yml +20 -14
- data/spec/fixtures/vcr_cassettes/candles_options_get.yml +12 -10
- data/spec/fixtures/vcr_cassettes/client_helper_accounts.yml +48 -5
- data/spec/fixtures/vcr_cassettes/instrument_EUR_USD.yml +11 -9
- data/spec/fixtures/vcr_cassettes/instrument_USD_JPY.yml +10 -8
- data/spec/fixtures/vcr_cassettes/instruments_get.yml +25 -19
- data/spec/fixtures/vcr_cassettes/instruments_options_get.yml +8 -6
- data/spec/fixtures/vcr_cassettes/order_id_close.yml +159 -313
- data/spec/fixtures/vcr_cassettes/order_id_get.yml +103 -21
- data/spec/fixtures/vcr_cassettes/order_options_create.yml +9 -7
- data/spec/fixtures/vcr_cassettes/order_options_update.yml +62 -20
- data/spec/fixtures/vcr_cassettes/orders_get.yml +46 -137
- data/spec/fixtures/vcr_cassettes/orders_options_get.yml +29 -50
- data/spec/fixtures/vcr_cassettes/positions_get.yml +19 -15
- data/spec/fixtures/vcr_cassettes/positions_instrument_close.yml +35 -27
- data/spec/fixtures/vcr_cassettes/positions_instrument_get.yml +17 -13
- data/spec/fixtures/vcr_cassettes/prices_options_get.yml +12 -10
- data/spec/fixtures/vcr_cassettes/spread_history_get.yml +17 -13
- data/spec/fixtures/vcr_cassettes/spreads_get.yml +17 -13
- data/spec/fixtures/vcr_cassettes/trade_id_close.yml +115 -52
- data/spec/fixtures/vcr_cassettes/trade_id_get.yml +278 -16
- data/spec/fixtures/vcr_cassettes/trade_options_modify.yml +58 -16
- data/spec/fixtures/vcr_cassettes/trades_filter_get.yml +44 -19
- data/spec/fixtures/vcr_cassettes/trades_get.yml +55 -16
- data/spec/fixtures/vcr_cassettes/transaction_id_get.yml +271 -149
- data/spec/fixtures/vcr_cassettes/transactions_options_get.yml +258 -133
- data/spec/fixtures/vcr_cassettes/with_throttling_and_max_requests_per_second.yml +28 -22
- data/spec/fixtures/vcr_cassettes/with_throttling_new_connections.yml +443 -0
- data/spec/fixtures/vcr_cassettes/with_throttling_with_multiple_threads.yml +57 -45
- data/spec/fixtures/vcr_cassettes/without_throttling.yml +91 -71
- data/spec/oanda_api/configuration_spec.rb +31 -0
- data/spec/oanda_api/examples/request_throttling_spec.rb +39 -4
- data/spec/oanda_api/examples/spread_history_spec.rb +3 -3
- data/spec/oanda_api/resource_collection_spec.rb +9 -0
- data/spec/oanda_api/streaming/client_spec.rb +5 -5
- data/spec/oanda_api/streaming/request_spec.rb +23 -8
- data/spec/spec_helper.rb +0 -3
- data/spec/support/client_helper.rb +6 -2
- metadata +13 -12
- 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
|
data/lib/oanda_api/version.rb
CHANGED
data/oanda_api.gemspec
CHANGED
@@ -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", ">=
|
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", "~>
|
30
|
-
s.add_development_dependency "webmock", "~> 1
|
31
|
-
s.add_development_dependency "yard", "~> 0.
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
- Mon,
|
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,
|
45
|
-
recorded_with: VCR
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
- Mon,
|
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,
|
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.
|
68
|
+
- openresty/1.9.15.1
|
67
69
|
Date:
|
68
|
-
- Mon,
|
70
|
+
- Mon, 08 Jan 2018 18:26:30 GMT
|
69
71
|
Content-Type:
|
70
72
|
- application/json
|
71
73
|
Content-Length:
|
72
|
-
- '
|
74
|
+
- '281'
|
73
75
|
Connection:
|
74
76
|
- keep-alive
|
75
77
|
Etag:
|
76
|
-
- '"
|
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
|
-
:
|
81
|
-
:
|
82
|
-
:
|
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,
|
85
|
-
recorded_with: VCR
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 08 Jan 2018 18:26:30 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
30
|
-
- '
|
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=
|
43
|
-
|
44
|
-
- opc_id=
|
45
|
-
|
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: '[{"
|
51
|
-
|
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:
|
54
|
-
recorded_with: VCR
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 08 Jan 2018 18:26:30 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
30
|
-
- '
|
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=
|
43
|
-
|
44
|
-
- opc_id=
|
45
|
-
|
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":"
|
51
|
-
|
52
|
-
|
53
|
-
m/m","timestamp":
|
54
|
-
|
55
|
-
-
|
56
|
-
|
57
|
-
|
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:
|
61
|
-
recorded_with: VCR
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
-
|
26
|
+
- Mon, 08 Jan 2018 18:26:30 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
30
|
-
- '
|
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=
|
43
|
-
|
44
|
-
- opc_id=
|
45
|
-
|
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: '[{"
|
51
|
-
|
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:
|
54
|
-
recorded_with: VCR
|
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.
|
24
|
+
- openresty/1.9.15.1
|
25
25
|
Date:
|
26
|
-
- Mon,
|
26
|
+
- Mon, 08 Jan 2018 18:26:34 GMT
|
27
27
|
Content-Type:
|
28
28
|
- application/json
|
29
29
|
Content-Length:
|
30
|
-
- '
|
30
|
+
- '254'
|
31
31
|
Connection:
|
32
32
|
- keep-alive
|
33
33
|
Etag:
|
34
|
-
- '"
|
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\" : \"
|
39
|
-
: 1.
|
40
|
-
: 1.
|
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,
|
43
|
-
recorded_with: VCR
|
44
|
+
recorded_at: Mon, 08 Jan 2018 18:26:45 GMT
|
45
|
+
recorded_with: VCR 4.0.0
|