oanda_api 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +67 -6
  3. data/README.md +31 -3
  4. data/lib/oanda_api.rb +3 -1
  5. data/lib/oanda_api/client/client.rb +17 -12
  6. data/lib/oanda_api/client/namespace_proxy.rb +2 -2
  7. data/lib/oanda_api/client/resource_descriptor.rb +25 -9
  8. data/lib/oanda_api/client/username_client.rb +7 -0
  9. data/lib/oanda_api/configuration.rb +14 -0
  10. data/lib/oanda_api/resource/account.rb +22 -3
  11. data/lib/oanda_api/resource/candle.rb +1 -1
  12. data/lib/oanda_api/resource/labs/calendar_event.rb +25 -0
  13. data/lib/oanda_api/resource/labs/spread_history.rb +61 -0
  14. data/lib/oanda_api/resource/order.rb +4 -4
  15. data/lib/oanda_api/resource/transaction_history.rb +0 -1
  16. data/lib/oanda_api/resource_base.rb +64 -2
  17. data/lib/oanda_api/resource_collection.rb +6 -0
  18. data/lib/oanda_api/streaming/client.rb +1 -0
  19. data/lib/oanda_api/version.rb +1 -1
  20. data/oanda_api.gemspec +2 -2
  21. data/spec/fixtures/vcr_cassettes/accounts_get.yml +13 -79
  22. data/spec/fixtures/vcr_cassettes/accounts_id_get.yml +23 -125
  23. data/spec/fixtures/vcr_cassettes/calendar_events_period_get.yml +54 -0
  24. data/spec/fixtures/vcr_cassettes/calendar_instrument_and_period_get.yml +61 -0
  25. data/spec/fixtures/vcr_cassettes/calendar_period_get.yml +54 -0
  26. data/spec/fixtures/vcr_cassettes/candles_options_get.yml +9 -45
  27. data/spec/fixtures/vcr_cassettes/client_helper_account.yml +45 -0
  28. data/spec/fixtures/vcr_cassettes/client_helper_accounts.yml +45 -0
  29. data/spec/fixtures/vcr_cassettes/instrument_EUR_USD.yml +42 -0
  30. data/spec/fixtures/vcr_cassettes/instrument_USD_JPY.yml +42 -0
  31. data/spec/fixtures/vcr_cassettes/instruments_get.yml +37 -303
  32. data/spec/fixtures/vcr_cassettes/instruments_options_get.yml +6 -43
  33. data/spec/fixtures/vcr_cassettes/order_id_close.yml +448 -0
  34. data/spec/fixtures/vcr_cassettes/order_id_get.yml +84 -0
  35. data/spec/fixtures/vcr_cassettes/order_options_create.yml +42 -0
  36. data/spec/fixtures/vcr_cassettes/order_options_update.yml +82 -0
  37. data/spec/fixtures/vcr_cassettes/orders_get.yml +205 -0
  38. data/spec/fixtures/vcr_cassettes/orders_options_get.yml +120 -0
  39. data/spec/fixtures/vcr_cassettes/positions_get.yml +82 -0
  40. data/spec/fixtures/vcr_cassettes/positions_instrument_close.yml +154 -0
  41. data/spec/fixtures/vcr_cassettes/{account_id_order_options_create.yml → positions_instrument_get.yml} +24 -18
  42. data/spec/fixtures/vcr_cassettes/prices_options_get.yml +11 -48
  43. data/spec/fixtures/vcr_cassettes/spread_history_get.yml +53 -0
  44. data/spec/fixtures/vcr_cassettes/spreads_get.yml +53 -0
  45. data/spec/fixtures/vcr_cassettes/trade_id_close.yml +277 -0
  46. data/spec/fixtures/vcr_cassettes/trade_id_get.yml +82 -0
  47. data/spec/fixtures/vcr_cassettes/trade_options_modify.yml +80 -0
  48. data/spec/fixtures/vcr_cassettes/trades_filter_get.yml +90 -0
  49. data/spec/fixtures/vcr_cassettes/trades_get.yml +171 -0
  50. data/spec/fixtures/vcr_cassettes/transaction_id_get.yml +248 -0
  51. data/spec/fixtures/vcr_cassettes/transactions_options_get.yml +202 -0
  52. data/spec/fixtures/vcr_cassettes/with_throttling_and_max_requests_per_second.yml +25 -19
  53. data/spec/fixtures/vcr_cassettes/with_throttling_with_multiple_threads.yml +51 -39
  54. data/spec/fixtures/vcr_cassettes/without_throttling.yml +81 -61
  55. data/spec/oanda_api/client/client_spec.rb +23 -10
  56. data/spec/oanda_api/client/namespace_proxy_spec.rb +1 -1
  57. data/spec/oanda_api/client/resource_descriptor_spec.rb +45 -14
  58. data/spec/oanda_api/configuration_spec.rb +13 -0
  59. data/spec/oanda_api/examples/accounts_spec.rb +0 -7
  60. data/spec/oanda_api/examples/calendar_spec.rb +27 -0
  61. data/spec/oanda_api/examples/orders_spec.rb +12 -12
  62. data/spec/oanda_api/examples/positions_spec.rb +3 -3
  63. data/spec/oanda_api/examples/rates_spec.rb +4 -2
  64. data/spec/oanda_api/examples/spread_history_spec.rb +32 -0
  65. data/spec/oanda_api/examples/trades_spec.rb +5 -5
  66. data/spec/oanda_api/examples/transactions_spec.rb +2 -2
  67. data/spec/oanda_api/resource_base_spec.rb +48 -8
  68. data/spec/oanda_api/streaming/client_spec.rb +30 -2
  69. data/spec/spec_helper.rb +1 -1
  70. data/spec/support/client_helper.rb +45 -11
  71. data/spec/support/vcr.rb +1 -0
  72. metadata +63 -49
  73. data/spec/fixtures/vcr_cassettes/account_id_order_id_close.yml +0 -264
  74. data/spec/fixtures/vcr_cassettes/account_id_order_id_get.yml +0 -114
  75. data/spec/fixtures/vcr_cassettes/account_id_order_options_update.yml +0 -112
  76. data/spec/fixtures/vcr_cassettes/account_id_orders_get.yml +0 -118
  77. data/spec/fixtures/vcr_cassettes/account_id_orders_options_get.yml +0 -123
  78. data/spec/fixtures/vcr_cassettes/account_id_positions_get.yml +0 -112
  79. data/spec/fixtures/vcr_cassettes/account_id_positions_instrument_close.yml +0 -214
  80. data/spec/fixtures/vcr_cassettes/account_id_positions_instrument_get.yml +0 -110
  81. data/spec/fixtures/vcr_cassettes/account_id_trade_id_close.yml +0 -252
  82. data/spec/fixtures/vcr_cassettes/account_id_trade_id_get.yml +0 -112
  83. data/spec/fixtures/vcr_cassettes/account_id_trade_options_modify.yml +0 -110
  84. data/spec/fixtures/vcr_cassettes/account_id_trades_filter_get.yml +0 -118
  85. data/spec/fixtures/vcr_cassettes/account_id_trades_get.yml +0 -118
  86. data/spec/fixtures/vcr_cassettes/account_id_transaction_id_get.yml +0 -283
  87. data/spec/fixtures/vcr_cassettes/account_id_transactions_options_get.yml +0 -205
  88. data/spec/fixtures/vcr_cassettes/accounts_create.yml +0 -75
  89. data/spec/fixtures/vcr_cassettes/sandbox_client.yml +0 -116
  90. data/spec/fixtures/vcr_cassettes/sandbox_client_account.yml +0 -111
  91. data/spec/fixtures/vcr_cassettes/sandbox_instrument_EUR_USD.yml +0 -77
  92. data/spec/oanda_api/client/username_client_spec.rb +0 -31
@@ -0,0 +1,82 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: instrument=USD_JPY&side=buy&type=market&units=10000
9
+ headers:
10
+ X-Accept-Datetime-Format:
11
+ - RFC3339
12
+ Authorization:
13
+ - Bearer <OANDA_TESTING_API_TOKEN>
14
+ Connection:
15
+ - keep-alive
16
+ Keep-Alive:
17
+ - 30
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - openresty/1.7.0.1
25
+ Date:
26
+ - Mon, 14 Mar 2016 23:06:51 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '275'
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2016-03-14T23:06:51.000000Z\",\n\t\"price\"
36
+ : 113.808,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173950011,\n\t\t\"units\"
37
+ : 10000,\n\t\t\"side\" : \"buy\",\n\t\t\"takeProfit\" : 0,\n\t\t\"stopLoss\"
38
+ : 0,\n\t\t\"trailingStop\" : 0\n\t},\n\t\"tradesClosed\" : [],\n\t\"tradeReduced\"
39
+ : {}\n}"
40
+ http_version:
41
+ recorded_at: Mon, 14 Mar 2016 23:06:52 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/positions
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ X-Accept-Datetime-Format:
50
+ - RFC3339
51
+ Authorization:
52
+ - Bearer <OANDA_TESTING_API_TOKEN>
53
+ Connection:
54
+ - keep-alive
55
+ Keep-Alive:
56
+ - 30
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Server:
63
+ - openresty/1.7.0.1
64
+ Date:
65
+ - Mon, 14 Mar 2016 23:06:51 GMT
66
+ Content-Type:
67
+ - application/json
68
+ Content-Length:
69
+ - '225'
70
+ Connection:
71
+ - keep-alive
72
+ Etag:
73
+ - '"49ac24a6a1860af627db2171ba7e6e8e9157d1a6"'
74
+ body:
75
+ encoding: UTF-8
76
+ string: "{\n\t\"positions\" : [\n\t\t{\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"units\"
77
+ : 240000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"avgPrice\" : 1.10998\n\t\t},\n\t\t{\n\t\t\t\"instrument\"
78
+ : \"USD_JPY\",\n\t\t\t\"units\" : 70000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"avgPrice\"
79
+ : 113.626\n\t\t}\n\t]\n}"
80
+ http_version:
81
+ recorded_at: Mon, 14 Mar 2016 23:06:52 GMT
82
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,154 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/orders
6
+ body:
7
+ encoding: UTF-8
8
+ string: instrument=USD_JPY&side=buy&type=market&units=10000
9
+ headers:
10
+ X-Accept-Datetime-Format:
11
+ - RFC3339
12
+ Authorization:
13
+ - Bearer <OANDA_TESTING_API_TOKEN>
14
+ Connection:
15
+ - keep-alive
16
+ Keep-Alive:
17
+ - 30
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - openresty/1.7.0.1
25
+ Date:
26
+ - Mon, 14 Mar 2016 23:07:12 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '275'
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2016-03-14T23:07:12.000000Z\",\n\t\"price\"
36
+ : 113.808,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173950329,\n\t\t\"units\"
37
+ : 10000,\n\t\t\"side\" : \"buy\",\n\t\t\"takeProfit\" : 0,\n\t\t\"stopLoss\"
38
+ : 0,\n\t\t\"trailingStop\" : 0\n\t},\n\t\"tradesClosed\" : [],\n\t\"tradeReduced\"
39
+ : {}\n}"
40
+ http_version:
41
+ recorded_at: Mon, 14 Mar 2016 23:07:13 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/positions/USD_JPY
45
+ body:
46
+ encoding: US-ASCII
47
+ string: ''
48
+ headers:
49
+ X-Accept-Datetime-Format:
50
+ - RFC3339
51
+ Authorization:
52
+ - Bearer <OANDA_TESTING_API_TOKEN>
53
+ Connection:
54
+ - keep-alive
55
+ Keep-Alive:
56
+ - 30
57
+ response:
58
+ status:
59
+ code: 200
60
+ message: OK
61
+ headers:
62
+ Server:
63
+ - openresty/1.7.0.1
64
+ Date:
65
+ - Mon, 14 Mar 2016 23:07:13 GMT
66
+ Content-Type:
67
+ - application/json
68
+ Content-Length:
69
+ - '87'
70
+ Connection:
71
+ - keep-alive
72
+ Etag:
73
+ - '"15aab39b117c6e00dd1b0e27623c3f4f83433ae3"'
74
+ body:
75
+ encoding: UTF-8
76
+ string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"units\" : 90000,\n\t\"side\"
77
+ : \"buy\",\n\t\"avgPrice\" : 113.666\n}"
78
+ http_version:
79
+ recorded_at: Mon, 14 Mar 2016 23:07:14 GMT
80
+ - request:
81
+ method: delete
82
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/positions/USD_JPY
83
+ body:
84
+ encoding: US-ASCII
85
+ string: ''
86
+ headers:
87
+ X-Accept-Datetime-Format:
88
+ - RFC3339
89
+ Authorization:
90
+ - Bearer <OANDA_TESTING_API_TOKEN>
91
+ Connection:
92
+ - keep-alive
93
+ Keep-Alive:
94
+ - 30
95
+ response:
96
+ status:
97
+ code: 200
98
+ message: OK
99
+ headers:
100
+ Server:
101
+ - openresty/1.7.0.1
102
+ Date:
103
+ - Mon, 14 Mar 2016 23:07:13 GMT
104
+ Content-Type:
105
+ - application/json
106
+ Content-Length:
107
+ - '355'
108
+ Connection:
109
+ - keep-alive
110
+ body:
111
+ encoding: UTF-8
112
+ string: "{\n\t\"ids\" : [\n\t\t10173144073,\n\t\t10173950335,\n\t\t10173144214,\n\t\t10173950336,\n\t\t10173144402,\n\t\t10173950337,\n\t\t10173144640,\n\t\t10173950338,\n\t\t10173144902,\n\t\t10173950339,\n\t\t10173145109,\n\t\t10173950340,\n\t\t10173950011,\n\t\t10173950341,\n\t\t10173950020,\n\t\t10173950342,\n\t\t10173950329,\n\t\t10173950343\n\t],\n\t\"instrument\"
113
+ : \"USD_JPY\",\n\t\"totalUnits\" : 90000,\n\t\"price\" : 113.79\n}"
114
+ http_version:
115
+ recorded_at: Mon, 14 Mar 2016 23:07:14 GMT
116
+ - request:
117
+ method: get
118
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/positions
119
+ body:
120
+ encoding: US-ASCII
121
+ string: ''
122
+ headers:
123
+ X-Accept-Datetime-Format:
124
+ - RFC3339
125
+ Authorization:
126
+ - Bearer <OANDA_TESTING_API_TOKEN>
127
+ Connection:
128
+ - keep-alive
129
+ Keep-Alive:
130
+ - 30
131
+ response:
132
+ status:
133
+ code: 200
134
+ message: OK
135
+ headers:
136
+ Server:
137
+ - openresty/1.7.0.1
138
+ Date:
139
+ - Mon, 14 Mar 2016 23:07:13 GMT
140
+ Content-Type:
141
+ - application/json
142
+ Content-Length:
143
+ - '124'
144
+ Connection:
145
+ - keep-alive
146
+ Etag:
147
+ - '"649a0c7f2e066fd94ae3b834ae2557b91aed7dbf"'
148
+ body:
149
+ encoding: UTF-8
150
+ string: "{\n\t\"positions\" : [\n\t\t{\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"units\"
151
+ : 240000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"avgPrice\" : 1.10998\n\t\t}\n\t]\n}"
152
+ http_version:
153
+ recorded_at: Mon, 14 Mar 2016 23:07:14 GMT
154
+ recorded_with: VCR 2.9.3
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders
5
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/orders
6
6
  body:
7
7
  encoding: UTF-8
8
- string: instrument=EUR_USD&side=buy&type=market&units=10000&username=dwaymotim
8
+ string: instrument=USD_JPY&side=buy&type=market&units=10000
9
9
  headers:
10
10
  X-Accept-Datetime-Format:
11
11
  - RFC3339
12
+ Authorization:
13
+ - Bearer <OANDA_TESTING_API_TOKEN>
12
14
  Connection:
13
15
  - keep-alive
14
16
  Keep-Alive:
@@ -21,54 +23,58 @@ http_interactions:
21
23
  Server:
22
24
  - openresty/1.7.0.1
23
25
  Date:
24
- - Tue, 20 Jan 2015 17:22:27 GMT
26
+ - Mon, 14 Mar 2016 23:06:51 GMT
25
27
  Content-Type:
26
28
  - application/json
27
29
  Content-Length:
28
- - '273'
30
+ - '275'
29
31
  Connection:
30
32
  - keep-alive
31
33
  body:
32
34
  encoding: UTF-8
33
- string: "{\n\t\"instrument\" : \"EUR_USD\",\n\t\"time\" : \"2015-01-20T17:22:27.000000Z\",\n\t\"price\"
34
- : 1.24101,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 175503907,\n\t\t\"units\"
35
+ string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2016-03-14T23:06:51.000000Z\",\n\t\"price\"
36
+ : 113.808,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173950020,\n\t\t\"units\"
35
37
  : 10000,\n\t\t\"side\" : \"buy\",\n\t\t\"takeProfit\" : 0,\n\t\t\"stopLoss\"
36
38
  : 0,\n\t\t\"trailingStop\" : 0\n\t},\n\t\"tradesClosed\" : [],\n\t\"tradeReduced\"
37
39
  : {}\n}"
38
40
  http_version:
39
- recorded_at: Tue, 20 Jan 2015 17:22:29 GMT
41
+ recorded_at: Mon, 14 Mar 2016 23:06:52 GMT
40
42
  - request:
41
- method: post
42
- uri: http://api-sandbox.oanda.com/v1//accounts/5342358/orders
43
+ method: get
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/positions/USD_JPY
43
45
  body:
44
- encoding: UTF-8
45
- string: username=dwaymotim
46
+ encoding: US-ASCII
47
+ string: ''
46
48
  headers:
47
49
  X-Accept-Datetime-Format:
48
50
  - RFC3339
51
+ Authorization:
52
+ - Bearer <OANDA_TESTING_API_TOKEN>
49
53
  Connection:
50
54
  - keep-alive
51
55
  Keep-Alive:
52
56
  - 30
53
57
  response:
54
58
  status:
55
- code: 400
56
- message: BAD_REQUEST
59
+ code: 200
60
+ message: OK
57
61
  headers:
58
62
  Server:
59
63
  - openresty/1.7.0.1
60
64
  Date:
61
- - Tue, 20 Jan 2015 21:03:06 GMT
65
+ - Mon, 14 Mar 2016 23:06:51 GMT
62
66
  Content-Type:
63
67
  - application/json
64
68
  Content-Length:
65
- - '145'
69
+ - '87'
66
70
  Connection:
67
71
  - keep-alive
72
+ Etag:
73
+ - '"c4db4750bb723e7c523d935a49d104b6ce3ca9c3"'
68
74
  body:
69
75
  encoding: UTF-8
70
- string: "{\n\t\"code\" : 2,\n\t\"message\" : \"Missing required argument: type\",\n\t\"moreInfo\"
71
- : \"http:\\/\\/developer.oanda.com\\/docs\\/v1\\/troubleshooting\\/#errors\"\n}"
76
+ string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"units\" : 80000,\n\t\"side\"
77
+ : \"buy\",\n\t\"avgPrice\" : 113.648\n}"
72
78
  http_version:
73
- recorded_at: Tue, 20 Jan 2015 21:03:06 GMT
79
+ recorded_at: Mon, 14 Mar 2016 23:06:52 GMT
74
80
  recorded_with: VCR 2.9.3
@@ -2,13 +2,15 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://api-sandbox.oanda.com/v1/prices?instruments=EUR_USD,EUR_CAD&username=dwaymotim
5
+ uri: https://api-fxpractice.oanda.com/v1/prices?instruments=EUR_USD,EUR_CAD
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
9
9
  headers:
10
10
  X-Accept-Datetime-Format:
11
11
  - RFC3339
12
+ Authorization:
13
+ - Bearer <OANDA_TESTING_API_TOKEN>
12
14
  Connection:
13
15
  - keep-alive
14
16
  Keep-Alive:
@@ -21,61 +23,22 @@ http_interactions:
21
23
  Server:
22
24
  - openresty/1.7.0.1
23
25
  Date:
24
- - Tue, 20 Jan 2015 17:22:31 GMT
26
+ - Mon, 14 Mar 2016 23:03:28 GMT
25
27
  Content-Type:
26
28
  - application/json
27
29
  Content-Length:
28
- - '258'
30
+ - '259'
29
31
  Connection:
30
32
  - keep-alive
31
33
  Etag:
32
- - '"bb3bee85840ca7561196c2e00d0341e667a40188"'
34
+ - '"177bb030c2194c2df4c4f7f8d4f99811bdf01a6f"'
33
35
  body:
34
36
  encoding: UTF-8
35
37
  string: "{\n\t\"prices\" : [\n\t\t{\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
36
- : \"2015-01-20T17:21:05.832175Z\",\n\t\t\t\"bid\" : 1.24089,\n\t\t\t\"ask\"
37
- : 1.24101\n\t\t},\n\t\t{\n\t\t\t\"instrument\" : \"EUR_CAD\",\n\t\t\t\"time\"
38
- : \"2015-01-20T17:20:59.875130Z\",\n\t\t\t\"bid\" : 1.4188,\n\t\t\t\"ask\"
39
- : 1.41906\n\t\t}\n\t]\n}"
38
+ : \"2016-03-14T23:03:07.128564Z\",\n\t\t\t\"bid\" : 1.11027,\n\t\t\t\"ask\"
39
+ : 1.11045\n\t\t},\n\t\t{\n\t\t\t\"instrument\" : \"EUR_CAD\",\n\t\t\t\"time\"
40
+ : \"2016-03-14T23:03:25.938983Z\",\n\t\t\t\"bid\" : 1.47282,\n\t\t\t\"ask\"
41
+ : 1.47319\n\t\t}\n\t]\n}"
40
42
  http_version:
41
- recorded_at: Tue, 20 Jan 2015 17:22:34 GMT
42
- - request:
43
- method: get
44
- uri: http://api-sandbox.oanda.com/v1/prices?instruments=EUR_USD,EUR_CAD&username
45
- body:
46
- encoding: US-ASCII
47
- string: ''
48
- headers:
49
- X-Accept-Datetime-Format:
50
- - RFC3339
51
- Connection:
52
- - keep-alive
53
- Keep-Alive:
54
- - 30
55
- response:
56
- status:
57
- code: 200
58
- message: OK
59
- headers:
60
- Server:
61
- - openresty/1.7.0.1
62
- Date:
63
- - Fri, 23 Jan 2015 17:37:54 GMT
64
- Content-Type:
65
- - application/json
66
- Content-Length:
67
- - '258'
68
- Connection:
69
- - keep-alive
70
- Etag:
71
- - '"61b0cfa4b3f60f7fcf1bce3089bbf5a7b706d340"'
72
- body:
73
- encoding: UTF-8
74
- string: "{\n\t\"prices\" : [\n\t\t{\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
75
- : \"2015-01-23T17:37:49.093636Z\",\n\t\t\t\"bid\" : 1.2403,\n\t\t\t\"ask\"
76
- : 1.24048\n\t\t},\n\t\t{\n\t\t\t\"instrument\" : \"EUR_CAD\",\n\t\t\t\"time\"
77
- : \"2015-01-23T17:37:48.869787Z\",\n\t\t\t\"bid\" : 1.41832,\n\t\t\t\"ask\"
78
- : 1.41855\n\t\t}\n\t]\n}"
79
- http_version:
80
- recorded_at: Fri, 23 Jan 2015 17:37:54 GMT
43
+ recorded_at: Mon, 14 Mar 2016 23:03:29 GMT
81
44
  recorded_with: VCR 2.9.3
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api-fxpractice.oanda.com/labs/v1/spreads?instrument=EUR_CAD&period=3600
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ X-Accept-Datetime-Format:
11
+ - RFC3339
12
+ Authorization:
13
+ - Bearer <OANDA_TESTING_API_TOKEN>
14
+ Connection:
15
+ - keep-alive
16
+ Keep-Alive:
17
+ - 30
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - openresty/1.7.0.1
25
+ Date:
26
+ - Wed, 16 Mar 2016 23:58:13 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Content-Length:
30
+ - '135'
31
+ Connection:
32
+ - keep-alive
33
+ Vary:
34
+ - Accept-Encoding
35
+ - Accept-Encoding
36
+ - Content-Type
37
+ Version:
38
+ - '0.2'
39
+ X-Catalyst:
40
+ - '5.90042'
41
+ Set-Cookie:
42
+ - opc_id=F1D059CA-EBD2-11E5-A2A0-91DFF4FD6E4D; path=/; Expires=Sat, 14-Mar-2026
43
+ 23:58:13 GMT
44
+ - opc_id=F1D05EF2-EBD2-11E5-9AB7-E33F39B60049; path=/; Expires=Sat, 14-Mar-2026
45
+ 23:58:13 GMT
46
+ Access-Control-Allow-Origin:
47
+ - "*"
48
+ body:
49
+ encoding: UTF-8
50
+ string: '{"avg":[[1458169200,5.12678],[1458170100,4.07667]],"min":[[1458169200,2.9],[1458170100,2.9]],"max":[[1458169200,8.1],[1458170100,6.3]]}'
51
+ http_version:
52
+ recorded_at: Wed, 16 Mar 2016 23:58:13 GMT
53
+ recorded_with: VCR 3.0.1