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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +67 -6
- data/README.md +31 -3
- data/lib/oanda_api.rb +3 -1
- data/lib/oanda_api/client/client.rb +17 -12
- data/lib/oanda_api/client/namespace_proxy.rb +2 -2
- data/lib/oanda_api/client/resource_descriptor.rb +25 -9
- data/lib/oanda_api/client/username_client.rb +7 -0
- data/lib/oanda_api/configuration.rb +14 -0
- data/lib/oanda_api/resource/account.rb +22 -3
- data/lib/oanda_api/resource/candle.rb +1 -1
- data/lib/oanda_api/resource/labs/calendar_event.rb +25 -0
- data/lib/oanda_api/resource/labs/spread_history.rb +61 -0
- data/lib/oanda_api/resource/order.rb +4 -4
- data/lib/oanda_api/resource/transaction_history.rb +0 -1
- data/lib/oanda_api/resource_base.rb +64 -2
- data/lib/oanda_api/resource_collection.rb +6 -0
- data/lib/oanda_api/streaming/client.rb +1 -0
- data/lib/oanda_api/version.rb +1 -1
- data/oanda_api.gemspec +2 -2
- data/spec/fixtures/vcr_cassettes/accounts_get.yml +13 -79
- data/spec/fixtures/vcr_cassettes/accounts_id_get.yml +23 -125
- data/spec/fixtures/vcr_cassettes/calendar_events_period_get.yml +54 -0
- data/spec/fixtures/vcr_cassettes/calendar_instrument_and_period_get.yml +61 -0
- data/spec/fixtures/vcr_cassettes/calendar_period_get.yml +54 -0
- data/spec/fixtures/vcr_cassettes/candles_options_get.yml +9 -45
- data/spec/fixtures/vcr_cassettes/client_helper_account.yml +45 -0
- data/spec/fixtures/vcr_cassettes/client_helper_accounts.yml +45 -0
- data/spec/fixtures/vcr_cassettes/instrument_EUR_USD.yml +42 -0
- data/spec/fixtures/vcr_cassettes/instrument_USD_JPY.yml +42 -0
- data/spec/fixtures/vcr_cassettes/instruments_get.yml +37 -303
- data/spec/fixtures/vcr_cassettes/instruments_options_get.yml +6 -43
- data/spec/fixtures/vcr_cassettes/order_id_close.yml +448 -0
- data/spec/fixtures/vcr_cassettes/order_id_get.yml +84 -0
- data/spec/fixtures/vcr_cassettes/order_options_create.yml +42 -0
- data/spec/fixtures/vcr_cassettes/order_options_update.yml +82 -0
- data/spec/fixtures/vcr_cassettes/orders_get.yml +205 -0
- data/spec/fixtures/vcr_cassettes/orders_options_get.yml +120 -0
- data/spec/fixtures/vcr_cassettes/positions_get.yml +82 -0
- data/spec/fixtures/vcr_cassettes/positions_instrument_close.yml +154 -0
- data/spec/fixtures/vcr_cassettes/{account_id_order_options_create.yml → positions_instrument_get.yml} +24 -18
- data/spec/fixtures/vcr_cassettes/prices_options_get.yml +11 -48
- data/spec/fixtures/vcr_cassettes/spread_history_get.yml +53 -0
- data/spec/fixtures/vcr_cassettes/spreads_get.yml +53 -0
- data/spec/fixtures/vcr_cassettes/trade_id_close.yml +277 -0
- data/spec/fixtures/vcr_cassettes/trade_id_get.yml +82 -0
- data/spec/fixtures/vcr_cassettes/trade_options_modify.yml +80 -0
- data/spec/fixtures/vcr_cassettes/trades_filter_get.yml +90 -0
- data/spec/fixtures/vcr_cassettes/trades_get.yml +171 -0
- data/spec/fixtures/vcr_cassettes/transaction_id_get.yml +248 -0
- data/spec/fixtures/vcr_cassettes/transactions_options_get.yml +202 -0
- data/spec/fixtures/vcr_cassettes/with_throttling_and_max_requests_per_second.yml +25 -19
- data/spec/fixtures/vcr_cassettes/with_throttling_with_multiple_threads.yml +51 -39
- data/spec/fixtures/vcr_cassettes/without_throttling.yml +81 -61
- data/spec/oanda_api/client/client_spec.rb +23 -10
- data/spec/oanda_api/client/namespace_proxy_spec.rb +1 -1
- data/spec/oanda_api/client/resource_descriptor_spec.rb +45 -14
- data/spec/oanda_api/configuration_spec.rb +13 -0
- data/spec/oanda_api/examples/accounts_spec.rb +0 -7
- data/spec/oanda_api/examples/calendar_spec.rb +27 -0
- data/spec/oanda_api/examples/orders_spec.rb +12 -12
- data/spec/oanda_api/examples/positions_spec.rb +3 -3
- data/spec/oanda_api/examples/rates_spec.rb +4 -2
- data/spec/oanda_api/examples/spread_history_spec.rb +32 -0
- data/spec/oanda_api/examples/trades_spec.rb +5 -5
- data/spec/oanda_api/examples/transactions_spec.rb +2 -2
- data/spec/oanda_api/resource_base_spec.rb +48 -8
- data/spec/oanda_api/streaming/client_spec.rb +30 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/support/client_helper.rb +45 -11
- data/spec/support/vcr.rb +1 -0
- metadata +63 -49
- data/spec/fixtures/vcr_cassettes/account_id_order_id_close.yml +0 -264
- data/spec/fixtures/vcr_cassettes/account_id_order_id_get.yml +0 -114
- data/spec/fixtures/vcr_cassettes/account_id_order_options_update.yml +0 -112
- data/spec/fixtures/vcr_cassettes/account_id_orders_get.yml +0 -118
- data/spec/fixtures/vcr_cassettes/account_id_orders_options_get.yml +0 -123
- data/spec/fixtures/vcr_cassettes/account_id_positions_get.yml +0 -112
- data/spec/fixtures/vcr_cassettes/account_id_positions_instrument_close.yml +0 -214
- data/spec/fixtures/vcr_cassettes/account_id_positions_instrument_get.yml +0 -110
- data/spec/fixtures/vcr_cassettes/account_id_trade_id_close.yml +0 -252
- data/spec/fixtures/vcr_cassettes/account_id_trade_id_get.yml +0 -112
- data/spec/fixtures/vcr_cassettes/account_id_trade_options_modify.yml +0 -110
- data/spec/fixtures/vcr_cassettes/account_id_trades_filter_get.yml +0 -118
- data/spec/fixtures/vcr_cassettes/account_id_trades_get.yml +0 -118
- data/spec/fixtures/vcr_cassettes/account_id_transaction_id_get.yml +0 -283
- data/spec/fixtures/vcr_cassettes/account_id_transactions_options_get.yml +0 -205
- data/spec/fixtures/vcr_cassettes/accounts_create.yml +0 -75
- data/spec/fixtures/vcr_cassettes/sandbox_client.yml +0 -116
- data/spec/fixtures/vcr_cassettes/sandbox_client_account.yml +0 -111
- data/spec/fixtures/vcr_cassettes/sandbox_instrument_EUR_USD.yml +0 -77
- data/spec/oanda_api/client/username_client_spec.rb +0 -31
@@ -1,114 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: expiry=2015-01-20T18%3A22%3A30%2B00%3A00&instrument=USD_JPY&price=1.14089&side=buy&type=limit&units=10000&username=dwaymotim
|
9
|
-
headers:
|
10
|
-
X-Accept-Datetime-Format:
|
11
|
-
- RFC3339
|
12
|
-
Connection:
|
13
|
-
- keep-alive
|
14
|
-
Keep-Alive:
|
15
|
-
- 30
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 201
|
19
|
-
message: CREATED
|
20
|
-
headers:
|
21
|
-
Server:
|
22
|
-
- openresty/1.7.0.1
|
23
|
-
Date:
|
24
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json
|
27
|
-
Content-Length:
|
28
|
-
- '313'
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Location:
|
32
|
-
- http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503910
|
33
|
-
body:
|
34
|
-
encoding: UTF-8
|
35
|
-
string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\"price\"
|
36
|
-
: 1.14089,\n\t\"orderOpened\" : {\n\t\t\"id\" : 175503910,\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\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\t\"upperBound\"
|
39
|
-
: 0,\n\t\t\"lowerBound\" : 0,\n\t\t\"trailingStop\" : 0\n\t}\n}"
|
40
|
-
http_version:
|
41
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
42
|
-
- request:
|
43
|
-
method: get
|
44
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503910?username=dwaymotim
|
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
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
64
|
-
Content-Type:
|
65
|
-
- application/json
|
66
|
-
Content-Length:
|
67
|
-
- '301'
|
68
|
-
Connection:
|
69
|
-
- keep-alive
|
70
|
-
Etag:
|
71
|
-
- '"f68d2f102464051138244c2c31a00353806398fc"'
|
72
|
-
body:
|
73
|
-
encoding: UTF-8
|
74
|
-
string: "{\n\t\"id\" : 175503910,\n\t\"instrument\" : \"USD_JPY\",\n\t\"units\"
|
75
|
-
: 10000,\n\t\"side\" : \"buy\",\n\t\"type\" : \"limit\",\n\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\"price\"
|
76
|
-
: 1.14089,\n\t\"takeProfit\" : 0,\n\t\"stopLoss\" : 0,\n\t\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\"upperBound\"
|
77
|
-
: 0,\n\t\"lowerBound\" : 0,\n\t\"trailingStop\" : 0\n}"
|
78
|
-
http_version:
|
79
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
80
|
-
- request:
|
81
|
-
method: post
|
82
|
-
uri: http://api-sandbox.oanda.com/v1//accounts/5342358/orders
|
83
|
-
body:
|
84
|
-
encoding: UTF-8
|
85
|
-
string: username=dwaymotim
|
86
|
-
headers:
|
87
|
-
X-Accept-Datetime-Format:
|
88
|
-
- RFC3339
|
89
|
-
Connection:
|
90
|
-
- keep-alive
|
91
|
-
Keep-Alive:
|
92
|
-
- 30
|
93
|
-
response:
|
94
|
-
status:
|
95
|
-
code: 400
|
96
|
-
message: BAD_REQUEST
|
97
|
-
headers:
|
98
|
-
Server:
|
99
|
-
- openresty/1.7.0.1
|
100
|
-
Date:
|
101
|
-
- Tue, 20 Jan 2015 21:03:06 GMT
|
102
|
-
Content-Type:
|
103
|
-
- application/json
|
104
|
-
Content-Length:
|
105
|
-
- '145'
|
106
|
-
Connection:
|
107
|
-
- keep-alive
|
108
|
-
body:
|
109
|
-
encoding: UTF-8
|
110
|
-
string: "{\n\t\"code\" : 2,\n\t\"message\" : \"Missing required argument: type\",\n\t\"moreInfo\"
|
111
|
-
: \"http:\\/\\/developer.oanda.com\\/docs\\/v1\\/troubleshooting\\/#errors\"\n}"
|
112
|
-
http_version:
|
113
|
-
recorded_at: Tue, 20 Jan 2015 21:03:06 GMT
|
114
|
-
recorded_with: VCR 2.9.3
|
@@ -1,112 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: expiry=2015-01-20T18%3A22%3A30%2B00%3A00&instrument=USD_JPY&price=1.14089&side=buy&type=limit&units=10000&username=dwaymotim
|
9
|
-
headers:
|
10
|
-
X-Accept-Datetime-Format:
|
11
|
-
- RFC3339
|
12
|
-
Connection:
|
13
|
-
- keep-alive
|
14
|
-
Keep-Alive:
|
15
|
-
- 30
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 201
|
19
|
-
message: CREATED
|
20
|
-
headers:
|
21
|
-
Server:
|
22
|
-
- openresty/1.7.0.1
|
23
|
-
Date:
|
24
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json
|
27
|
-
Content-Length:
|
28
|
-
- '313'
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Location:
|
32
|
-
- http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503911
|
33
|
-
body:
|
34
|
-
encoding: UTF-8
|
35
|
-
string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\"price\"
|
36
|
-
: 1.14089,\n\t\"orderOpened\" : {\n\t\t\"id\" : 175503911,\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\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\t\"upperBound\"
|
39
|
-
: 0,\n\t\t\"lowerBound\" : 0,\n\t\t\"trailingStop\" : 0\n\t}\n}"
|
40
|
-
http_version:
|
41
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
42
|
-
- request:
|
43
|
-
method: patch
|
44
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503911
|
45
|
-
body:
|
46
|
-
encoding: UTF-8
|
47
|
-
string: units=9000&username=dwaymotim
|
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
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
64
|
-
Content-Type:
|
65
|
-
- application/json
|
66
|
-
Content-Length:
|
67
|
-
- '300'
|
68
|
-
Connection:
|
69
|
-
- keep-alive
|
70
|
-
body:
|
71
|
-
encoding: UTF-8
|
72
|
-
string: "{\n\t\"id\" : 175503911,\n\t\"instrument\" : \"USD_JPY\",\n\t\"units\"
|
73
|
-
: 9000,\n\t\"side\" : \"buy\",\n\t\"type\" : \"limit\",\n\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\"price\"
|
74
|
-
: 1.14089,\n\t\"takeProfit\" : 0,\n\t\"stopLoss\" : 0,\n\t\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\"upperBound\"
|
75
|
-
: 0,\n\t\"lowerBound\" : 0,\n\t\"trailingStop\" : 0\n}"
|
76
|
-
http_version:
|
77
|
-
recorded_at: Tue, 20 Jan 2015 17:22:31 GMT
|
78
|
-
- request:
|
79
|
-
method: post
|
80
|
-
uri: http://api-sandbox.oanda.com/v1//accounts/5342358/orders
|
81
|
-
body:
|
82
|
-
encoding: UTF-8
|
83
|
-
string: username=dwaymotim
|
84
|
-
headers:
|
85
|
-
X-Accept-Datetime-Format:
|
86
|
-
- RFC3339
|
87
|
-
Connection:
|
88
|
-
- keep-alive
|
89
|
-
Keep-Alive:
|
90
|
-
- 30
|
91
|
-
response:
|
92
|
-
status:
|
93
|
-
code: 400
|
94
|
-
message: BAD_REQUEST
|
95
|
-
headers:
|
96
|
-
Server:
|
97
|
-
- openresty/1.7.0.1
|
98
|
-
Date:
|
99
|
-
- Tue, 20 Jan 2015 21:03:06 GMT
|
100
|
-
Content-Type:
|
101
|
-
- application/json
|
102
|
-
Content-Length:
|
103
|
-
- '145'
|
104
|
-
Connection:
|
105
|
-
- keep-alive
|
106
|
-
body:
|
107
|
-
encoding: UTF-8
|
108
|
-
string: "{\n\t\"code\" : 2,\n\t\"message\" : \"Missing required argument: type\",\n\t\"moreInfo\"
|
109
|
-
: \"http:\\/\\/developer.oanda.com\\/docs\\/v1\\/troubleshooting\\/#errors\"\n}"
|
110
|
-
http_version:
|
111
|
-
recorded_at: Tue, 20 Jan 2015 21:03:07 GMT
|
112
|
-
recorded_with: VCR 2.9.3
|
@@ -1,118 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: expiry=2015-01-20T18%3A22%3A30%2B00%3A00&instrument=USD_JPY&price=1.14089&side=buy&type=limit&units=10000&username=dwaymotim
|
9
|
-
headers:
|
10
|
-
X-Accept-Datetime-Format:
|
11
|
-
- RFC3339
|
12
|
-
Connection:
|
13
|
-
- keep-alive
|
14
|
-
Keep-Alive:
|
15
|
-
- 30
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 201
|
19
|
-
message: CREATED
|
20
|
-
headers:
|
21
|
-
Server:
|
22
|
-
- openresty/1.7.0.1
|
23
|
-
Date:
|
24
|
-
- Tue, 20 Jan 2015 17:22:27 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json
|
27
|
-
Content-Length:
|
28
|
-
- '313'
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Location:
|
32
|
-
- http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503908
|
33
|
-
body:
|
34
|
-
encoding: UTF-8
|
35
|
-
string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2015-01-20T17:22:27.000000Z\",\n\t\"price\"
|
36
|
-
: 1.14089,\n\t\"orderOpened\" : {\n\t\t\"id\" : 175503908,\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\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\t\"upperBound\"
|
39
|
-
: 0,\n\t\t\"lowerBound\" : 0,\n\t\t\"trailingStop\" : 0\n\t}\n}"
|
40
|
-
http_version:
|
41
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
42
|
-
- request:
|
43
|
-
method: get
|
44
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders?username=dwaymotim
|
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
|
-
- Tue, 20 Jan 2015 17:22:27 GMT
|
64
|
-
Content-Type:
|
65
|
-
- application/json
|
66
|
-
Content-Length:
|
67
|
-
- '352'
|
68
|
-
Connection:
|
69
|
-
- keep-alive
|
70
|
-
Etag:
|
71
|
-
- '"ef985ffec1846db3712dcb011f99a6b2dcdbb8b8"'
|
72
|
-
X-Result-Count:
|
73
|
-
- '1'
|
74
|
-
body:
|
75
|
-
encoding: UTF-8
|
76
|
-
string: "{\n\t\"orders\" : [\n\t\t{\n\t\t\t\"id\" : 175503908,\n\t\t\t\"instrument\"
|
77
|
-
: \"USD_JPY\",\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"type\"
|
78
|
-
: \"limit\",\n\t\t\t\"time\" : \"2015-01-20T17:22:27.000000Z\",\n\t\t\t\"price\"
|
79
|
-
: 1.14089,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"expiry\"
|
80
|
-
: \"2015-01-20T18:22:30.000000Z\",\n\t\t\t\"upperBound\" : 0,\n\t\t\t\"lowerBound\"
|
81
|
-
: 0,\n\t\t\t\"trailingStop\" : 0\n\t\t}\n\t]\n}"
|
82
|
-
http_version:
|
83
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
84
|
-
- request:
|
85
|
-
method: post
|
86
|
-
uri: http://api-sandbox.oanda.com/v1//accounts/5342358/orders
|
87
|
-
body:
|
88
|
-
encoding: UTF-8
|
89
|
-
string: username=dwaymotim
|
90
|
-
headers:
|
91
|
-
X-Accept-Datetime-Format:
|
92
|
-
- RFC3339
|
93
|
-
Connection:
|
94
|
-
- keep-alive
|
95
|
-
Keep-Alive:
|
96
|
-
- 30
|
97
|
-
response:
|
98
|
-
status:
|
99
|
-
code: 400
|
100
|
-
message: BAD_REQUEST
|
101
|
-
headers:
|
102
|
-
Server:
|
103
|
-
- openresty/1.7.0.1
|
104
|
-
Date:
|
105
|
-
- Tue, 20 Jan 2015 21:03:06 GMT
|
106
|
-
Content-Type:
|
107
|
-
- application/json
|
108
|
-
Content-Length:
|
109
|
-
- '145'
|
110
|
-
Connection:
|
111
|
-
- keep-alive
|
112
|
-
body:
|
113
|
-
encoding: UTF-8
|
114
|
-
string: "{\n\t\"code\" : 2,\n\t\"message\" : \"Missing required argument: type\",\n\t\"moreInfo\"
|
115
|
-
: \"http:\\/\\/developer.oanda.com\\/docs\\/v1\\/troubleshooting\\/#errors\"\n}"
|
116
|
-
http_version:
|
117
|
-
recorded_at: Tue, 20 Jan 2015 21:03:06 GMT
|
118
|
-
recorded_with: VCR 2.9.3
|
@@ -1,123 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders
|
6
|
-
body:
|
7
|
-
encoding: UTF-8
|
8
|
-
string: expiry=2015-01-20T18%3A22%3A30%2B00%3A00&instrument=USD_JPY&price=1.14089&side=buy&type=limit&units=10000&username=dwaymotim
|
9
|
-
headers:
|
10
|
-
X-Accept-Datetime-Format:
|
11
|
-
- RFC3339
|
12
|
-
Connection:
|
13
|
-
- keep-alive
|
14
|
-
Keep-Alive:
|
15
|
-
- 30
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 201
|
19
|
-
message: CREATED
|
20
|
-
headers:
|
21
|
-
Server:
|
22
|
-
- openresty/1.7.0.1
|
23
|
-
Date:
|
24
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
25
|
-
Content-Type:
|
26
|
-
- application/json
|
27
|
-
Content-Length:
|
28
|
-
- '313'
|
29
|
-
Connection:
|
30
|
-
- keep-alive
|
31
|
-
Location:
|
32
|
-
- http://api-sandbox.oanda.com/v1/accounts/5342358/orders/175503909
|
33
|
-
body:
|
34
|
-
encoding: UTF-8
|
35
|
-
string: "{\n\t\"instrument\" : \"USD_JPY\",\n\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\"price\"
|
36
|
-
: 1.14089,\n\t\"orderOpened\" : {\n\t\t\"id\" : 175503909,\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\"expiry\" : \"2015-01-20T18:22:30.000000Z\",\n\t\t\"upperBound\"
|
39
|
-
: 0,\n\t\t\"lowerBound\" : 0,\n\t\t\"trailingStop\" : 0\n\t}\n}"
|
40
|
-
http_version:
|
41
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
42
|
-
- request:
|
43
|
-
method: get
|
44
|
-
uri: http://api-sandbox.oanda.com/v1/accounts/5342358/orders?instrument=USD_JPY&username=dwaymotim
|
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
|
-
- Tue, 20 Jan 2015 17:22:28 GMT
|
64
|
-
Content-Type:
|
65
|
-
- application/json
|
66
|
-
Content-Length:
|
67
|
-
- '685'
|
68
|
-
Connection:
|
69
|
-
- keep-alive
|
70
|
-
Etag:
|
71
|
-
- '"bfd754dedf750354ad9ff74fff8fe8f7d140ca4c"'
|
72
|
-
X-Result-Count:
|
73
|
-
- '2'
|
74
|
-
body:
|
75
|
-
encoding: UTF-8
|
76
|
-
string: "{\n\t\"orders\" : [\n\t\t{\n\t\t\t\"id\" : 175503909,\n\t\t\t\"instrument\"
|
77
|
-
: \"USD_JPY\",\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"type\"
|
78
|
-
: \"limit\",\n\t\t\t\"time\" : \"2015-01-20T17:22:28.000000Z\",\n\t\t\t\"price\"
|
79
|
-
: 1.14089,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"expiry\"
|
80
|
-
: \"2015-01-20T18:22:30.000000Z\",\n\t\t\t\"upperBound\" : 0,\n\t\t\t\"lowerBound\"
|
81
|
-
: 0,\n\t\t\t\"trailingStop\" : 0\n\t\t},\n\t\t{\n\t\t\t\"id\" : 175503908,\n\t\t\t\"instrument\"
|
82
|
-
: \"USD_JPY\",\n\t\t\t\"units\" : 10000,\n\t\t\t\"side\" : \"buy\",\n\t\t\t\"type\"
|
83
|
-
: \"limit\",\n\t\t\t\"time\" : \"2015-01-20T17:22:27.000000Z\",\n\t\t\t\"price\"
|
84
|
-
: 1.14089,\n\t\t\t\"takeProfit\" : 0,\n\t\t\t\"stopLoss\" : 0,\n\t\t\t\"expiry\"
|
85
|
-
: \"2015-01-20T18:22:30.000000Z\",\n\t\t\t\"upperBound\" : 0,\n\t\t\t\"lowerBound\"
|
86
|
-
: 0,\n\t\t\t\"trailingStop\" : 0\n\t\t}\n\t]\n}"
|
87
|
-
http_version:
|
88
|
-
recorded_at: Tue, 20 Jan 2015 17:22:30 GMT
|
89
|
-
- request:
|
90
|
-
method: post
|
91
|
-
uri: http://api-sandbox.oanda.com/v1//accounts/5342358/orders
|
92
|
-
body:
|
93
|
-
encoding: UTF-8
|
94
|
-
string: username=dwaymotim
|
95
|
-
headers:
|
96
|
-
X-Accept-Datetime-Format:
|
97
|
-
- RFC3339
|
98
|
-
Connection:
|
99
|
-
- keep-alive
|
100
|
-
Keep-Alive:
|
101
|
-
- 30
|
102
|
-
response:
|
103
|
-
status:
|
104
|
-
code: 400
|
105
|
-
message: BAD_REQUEST
|
106
|
-
headers:
|
107
|
-
Server:
|
108
|
-
- openresty/1.7.0.1
|
109
|
-
Date:
|
110
|
-
- Tue, 20 Jan 2015 21:03:06 GMT
|
111
|
-
Content-Type:
|
112
|
-
- application/json
|
113
|
-
Content-Length:
|
114
|
-
- '145'
|
115
|
-
Connection:
|
116
|
-
- keep-alive
|
117
|
-
body:
|
118
|
-
encoding: UTF-8
|
119
|
-
string: "{\n\t\"code\" : 2,\n\t\"message\" : \"Missing required argument: type\",\n\t\"moreInfo\"
|
120
|
-
: \"http:\\/\\/developer.oanda.com\\/docs\\/v1\\/troubleshooting\\/#errors\"\n}"
|
121
|
-
http_version:
|
122
|
-
recorded_at: Tue, 20 Jan 2015 21:03:06 GMT
|
123
|
-
recorded_with: VCR 2.9.3
|