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,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=F1B48650-EBD2-11E5-B5C1-CB8B612C16A2; path=/; Expires=Sat, 14-Mar-2026
43
+ 23:58:13 GMT
44
+ - opc_id=F1B48AF6-EBD2-11E5-B01D-F03A88BF6A1A; 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
@@ -0,0 +1,277 @@
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:10:15 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:10:15.000000Z\",\n\t\"price\"
36
+ : 113.806,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173954090,\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:10:16 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/trades?instrument=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:10:16 GMT
66
+ Content-Type:
67
+ - application/json
68
+ Content-Length:
69
+ - '1285'
70
+ Connection:
71
+ - keep-alive
72
+ Access-Control-Expose-Headers:
73
+ - X-Result-Count
74
+ Etag:
75
+ - '"3d86377ba15422df44b4b4ae0cef9e68a3255c23"'
76
+ X-Result-Count:
77
+ - '5'
78
+ body:
79
+ encoding: UTF-8
80
+ string: "{\n\t\"trades\" : [\n\t\t{\n\t\t\t\"id\" : 10173954090,\n\t\t\t\"units\"
81
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\"
82
+ : \"2016-03-14T23:10:15.000000Z\",\n\t\t\t\"price\" : 113.806,\n\t\t\t\"takeProfit\"
83
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
84
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953742,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
85
+ : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\" : \"2016-03-14T23:09:59.000000Z\",\n\t\t\t\"price\"
86
+ : 113.806,\n\t\t\t\"takeProfit\" : 115.806,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
87
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953735,\n\t\t\t\"units\"
88
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\"
89
+ : \"2016-03-14T23:09:58.000000Z\",\n\t\t\t\"price\" : 113.806,\n\t\t\t\"takeProfit\"
90
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
91
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953431,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
92
+ : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\" : \"2016-03-14T23:09:40.000000Z\",\n\t\t\t\"price\"
93
+ : 113.806,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
94
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953425,\n\t\t\t\"units\"
95
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\"
96
+ : \"2016-03-14T23:09:40.000000Z\",\n\t\t\t\"price\" : 113.806,\n\t\t\t\"takeProfit\"
97
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
98
+ : 0\n\t\t}\n\t]\n}"
99
+ http_version:
100
+ recorded_at: Mon, 14 Mar 2016 23:10:16 GMT
101
+ - request:
102
+ method: delete
103
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/trades/10173953425
104
+ body:
105
+ encoding: US-ASCII
106
+ string: ''
107
+ headers:
108
+ X-Accept-Datetime-Format:
109
+ - RFC3339
110
+ Authorization:
111
+ - Bearer <OANDA_TESTING_API_TOKEN>
112
+ Connection:
113
+ - keep-alive
114
+ Keep-Alive:
115
+ - 30
116
+ response:
117
+ status:
118
+ code: 200
119
+ message: OK
120
+ headers:
121
+ Server:
122
+ - openresty/1.7.0.1
123
+ Date:
124
+ - Mon, 14 Mar 2016 23:10:16 GMT
125
+ Content-Type:
126
+ - application/json
127
+ Content-Length:
128
+ - '148'
129
+ Connection:
130
+ - keep-alive
131
+ body:
132
+ encoding: UTF-8
133
+ string: "{\n\t\"id\" : 10173954099,\n\t\"price\" : 113.789,\n\t\"profit\" :
134
+ -1.494,\n\t\"instrument\" : \"USD_JPY\",\n\t\"side\" : \"buy\",\n\t\"time\"
135
+ : \"2016-03-14T23:10:16.000000Z\"\n}"
136
+ http_version:
137
+ recorded_at: Mon, 14 Mar 2016 23:10:17 GMT
138
+ - request:
139
+ method: get
140
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/trades
141
+ body:
142
+ encoding: US-ASCII
143
+ string: ''
144
+ headers:
145
+ X-Accept-Datetime-Format:
146
+ - RFC3339
147
+ Authorization:
148
+ - Bearer <OANDA_TESTING_API_TOKEN>
149
+ Connection:
150
+ - keep-alive
151
+ Keep-Alive:
152
+ - 30
153
+ response:
154
+ status:
155
+ code: 200
156
+ message: OK
157
+ headers:
158
+ Server:
159
+ - openresty/1.7.0.1
160
+ Date:
161
+ - Mon, 14 Mar 2016 23:10:16 GMT
162
+ Content-Type:
163
+ - application/json
164
+ Content-Length:
165
+ - '7076'
166
+ Connection:
167
+ - keep-alive
168
+ Access-Control-Expose-Headers:
169
+ - X-Result-Count
170
+ Etag:
171
+ - '"448e391846373a6182328e0f482a59a79b4267d2"'
172
+ X-Result-Count:
173
+ - '28'
174
+ body:
175
+ encoding: UTF-8
176
+ string: "{\n\t\"trades\" : [\n\t\t{\n\t\t\t\"id\" : 10173954090,\n\t\t\t\"units\"
177
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\"
178
+ : \"2016-03-14T23:10:15.000000Z\",\n\t\t\t\"price\" : 113.806,\n\t\t\t\"takeProfit\"
179
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
180
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953742,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
181
+ : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\" : \"2016-03-14T23:09:59.000000Z\",\n\t\t\t\"price\"
182
+ : 113.806,\n\t\t\t\"takeProfit\" : 115.806,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
183
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953735,\n\t\t\t\"units\"
184
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\"
185
+ : \"2016-03-14T23:09:58.000000Z\",\n\t\t\t\"price\" : 113.806,\n\t\t\t\"takeProfit\"
186
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
187
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173953431,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
188
+ : \"buy\",\n\t\t\t\"instrument\" : \"USD_JPY\",\n\t\t\t\"time\" : \"2016-03-14T23:09:40.000000Z\",\n\t\t\t\"price\"
189
+ : 113.806,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
190
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173828244,\n\t\t\t\"units\"
191
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
192
+ : \"2016-03-14T21:30:16.000000Z\",\n\t\t\t\"price\" : 1.11036,\n\t\t\t\"takeProfit\"
193
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
194
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173825128,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
195
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T21:27:00.000000Z\",\n\t\t\t\"price\"
196
+ : 1.11036,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
197
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173824136,\n\t\t\t\"units\"
198
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
199
+ : \"2016-03-14T21:26:09.000000Z\",\n\t\t\t\"price\" : 1.11035,\n\t\t\t\"takeProfit\"
200
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
201
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173822567,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
202
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T21:24:47.000000Z\",\n\t\t\t\"price\"
203
+ : 1.1104,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
204
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173768275,\n\t\t\t\"units\"
205
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
206
+ : \"2016-03-14T20:57:57.000000Z\",\n\t\t\t\"price\" : 1.1103,\n\t\t\t\"takeProfit\"
207
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
208
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173764645,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
209
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T20:56:56.000000Z\",\n\t\t\t\"price\"
210
+ : 1.11032,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
211
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173700751,\n\t\t\t\"units\"
212
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
213
+ : \"2016-03-14T20:38:58.000000Z\",\n\t\t\t\"price\" : 1.11053,\n\t\t\t\"takeProfit\"
214
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
215
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173616265,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
216
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T20:13:57.000000Z\",\n\t\t\t\"price\"
217
+ : 1.11003,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
218
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173604531,\n\t\t\t\"units\"
219
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
220
+ : \"2016-03-14T20:10:56.000000Z\",\n\t\t\t\"price\" : 1.11001,\n\t\t\t\"takeProfit\"
221
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
222
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173601254,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
223
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T20:10:12.000000Z\",\n\t\t\t\"price\"
224
+ : 1.11001,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
225
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173587446,\n\t\t\t\"units\"
226
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
227
+ : \"2016-03-14T20:02:10.000000Z\",\n\t\t\t\"price\" : 1.10994,\n\t\t\t\"takeProfit\"
228
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
229
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173575480,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
230
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T19:56:28.000000Z\",\n\t\t\t\"price\"
231
+ : 1.1097,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
232
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173562986,\n\t\t\t\"units\"
233
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
234
+ : \"2016-03-14T19:47:57.000000Z\",\n\t\t\t\"price\" : 1.10961,\n\t\t\t\"takeProfit\"
235
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
236
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173517991,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
237
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T19:17:25.000000Z\",\n\t\t\t\"price\"
238
+ : 1.10995,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
239
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173515980,\n\t\t\t\"units\"
240
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
241
+ : \"2016-03-14T19:16:17.000000Z\",\n\t\t\t\"price\" : 1.10989,\n\t\t\t\"takeProfit\"
242
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
243
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173506383,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
244
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T19:09:36.000000Z\",\n\t\t\t\"price\"
245
+ : 1.1098,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
246
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173462314,\n\t\t\t\"units\"
247
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
248
+ : \"2016-03-14T18:45:23.000000Z\",\n\t\t\t\"price\" : 1.1087,\n\t\t\t\"takeProfit\"
249
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
250
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173461655,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
251
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T18:45:04.000000Z\",\n\t\t\t\"price\"
252
+ : 1.10867,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
253
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173457985,\n\t\t\t\"units\"
254
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
255
+ : \"2016-03-14T18:42:32.000000Z\",\n\t\t\t\"price\" : 1.10849,\n\t\t\t\"takeProfit\"
256
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
257
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173448196,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
258
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T18:36:44.000000Z\",\n\t\t\t\"price\"
259
+ : 1.10852,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
260
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173432940,\n\t\t\t\"units\"
261
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
262
+ : \"2016-03-14T18:29:36.000000Z\",\n\t\t\t\"price\" : 1.10842,\n\t\t\t\"takeProfit\"
263
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
264
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173140830,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
265
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T16:28:11.000000Z\",\n\t\t\t\"price\"
266
+ : 1.11119,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
267
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173126524,\n\t\t\t\"units\"
268
+ : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\"
269
+ : \"2016-03-14T16:23:33.000000Z\",\n\t\t\t\"price\" : 1.11173,\n\t\t\t\"takeProfit\"
270
+ : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\" : 0,\n\t\t\t\"trailingAmount\"
271
+ : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 10173100628,\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\"
272
+ : \"buy\",\n\t\t\t\"instrument\" : \"EUR_USD\",\n\t\t\t\"time\" : \"2016-03-14T16:14:43.000000Z\",\n\t\t\t\"price\"
273
+ : 1.11223,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"trailingStop\"
274
+ : 0,\n\t\t\t\"trailingAmount\" : 0\n\t\t}\n\t]\n}"
275
+ http_version:
276
+ recorded_at: Mon, 14 Mar 2016 23:10:17 GMT
277
+ recorded_with: VCR 2.9.3
@@ -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:09:58 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:09:58.000000Z\",\n\t\"price\"
36
+ : 113.806,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173953735,\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:09:59 GMT
42
+ - request:
43
+ method: get
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/trades/10173953735
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:09:59 GMT
66
+ Content-Type:
67
+ - application/json
68
+ Content-Length:
69
+ - '226'
70
+ Connection:
71
+ - keep-alive
72
+ Etag:
73
+ - '"b5139f370613a2e06c3a3e846c69361024e2df20"'
74
+ body:
75
+ encoding: UTF-8
76
+ string: "{\n\t\"id\" : 10173953735,\n\t\"units\" : 10000,\n\t\"side\" : \"buy\",\n\t\"instrument\"
77
+ : \"USD_JPY\",\n\t\"time\" : \"2016-03-14T23:09:58.000000Z\",\n\t\"price\"
78
+ : 113.806,\n\t\"takeProfit\" : 0,\n\t\"stopLoss\" : 0,\n\t\"trailingStop\"
79
+ : 0,\n\t\"trailingAmount\" : 0\n}"
80
+ http_version:
81
+ recorded_at: Mon, 14 Mar 2016 23:09:59 GMT
82
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,80 @@
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:09:59 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:09:59.000000Z\",\n\t\"price\"
36
+ : 113.806,\n\t\"tradeOpened\" : {\n\t\t\"id\" : 10173953742,\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:10:00 GMT
42
+ - request:
43
+ method: patch
44
+ uri: https://api-fxpractice.oanda.com/v1/accounts/1871900/trades/10173953742
45
+ body:
46
+ encoding: UTF-8
47
+ string: takeProfit=115.806
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:09:59 GMT
66
+ Content-Type:
67
+ - application/json
68
+ Content-Length:
69
+ - '232'
70
+ Connection:
71
+ - keep-alive
72
+ body:
73
+ encoding: UTF-8
74
+ string: "{\n\t\"id\" : 10173953742,\n\t\"units\" : 10000,\n\t\"side\" : \"buy\",\n\t\"instrument\"
75
+ : \"USD_JPY\",\n\t\"time\" : \"2016-03-14T23:09:59.000000Z\",\n\t\"price\"
76
+ : 113.806,\n\t\"takeProfit\" : 115.806,\n\t\"stopLoss\" : 0,\n\t\"trailingStop\"
77
+ : 0,\n\t\"trailingAmount\" : 0\n}"
78
+ http_version:
79
+ recorded_at: Mon, 14 Mar 2016 23:10:00 GMT
80
+ recorded_with: VCR 2.9.3