questrade_api 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -9
- data/lib/questrade_api/client.rb +24 -0
- data/lib/questrade_api/rest/base.rb +2 -2
- data/lib/questrade_api/rest/candle.rb +45 -0
- data/lib/questrade_api/rest/option.rb +44 -0
- data/lib/questrade_api/rest/quote.rb +75 -0
- data/lib/questrade_api/version.rb +1 -1
- data/spec/fixtures/json/candles.json +13 -0
- data/spec/fixtures/json/options.json +33 -0
- data/spec/fixtures/json/quote_01.json +24 -0
- data/spec/fixtures/json/quotes.json +24 -0
- data/spec/questrade_api/rest/candle_spec.rb +48 -0
- data/spec/questrade_api/rest/option_spec.rb +59 -0
- data/spec/questrade_api/rest/quote_spec.rb +94 -0
- data/spec/questrade_api/rest/symbol_spec.rb +4 -0
- metadata +20 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc55678c85117d92ad613586840f18ea4a380e47
|
4
|
+
data.tar.gz: a4ca8fc7f3a6c99714f6d17cf0a18c1287879ca2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f627f715a2b4ad662954cd32ba0e6ffbfa5f7ea8678087fa32549244f8268ae22217d0fd914dd0bf52d0d3ba0a72d1a3f6a661968b64e49008a20e4f67a2c27
|
7
|
+
data.tar.gz: 41d579f99b870df5b496ac94dfe7127d5e72a4424e93eeb18a98c80cf582fb7046f90bbda10bfd55fdbc11bd1356acc9c11a18dbcdfbe9ce0926e587e2b6285a
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ client.search_symbols(prefix: 'BMO')
|
|
55
55
|
authorization = QuestradeApi::Authorization.new(access_token: 'access_token', api_server: 'url')
|
56
56
|
accounts = QuestradeApi::REST::Account.all(accounts)
|
57
57
|
```
|
58
|
-
For more advanced options, check out our [documentation](http://www.rubydoc.info/gems/questrade_api/0.0.
|
58
|
+
For more advanced options, check out our [documentation](http://www.rubydoc.info/gems/questrade_api/0.0.4).
|
59
59
|
|
60
60
|
## Current Status
|
61
61
|
|
@@ -78,15 +78,16 @@ Check the tables below for more details.
|
|
78
78
|
|
79
79
|
| Endpoint | Development | Documentation |
|
80
80
|
| --- | --- | --- |
|
81
|
-
| /symbols/ | DONE |
|
82
|
-
| /symbols/:id | |
|
83
|
-
| /symbols/search | DONE |
|
84
|
-
| /symbols/:id/options |
|
81
|
+
| /symbols/ | DONE | |
|
82
|
+
| /symbols/:id | | |
|
83
|
+
| /symbols/search | DONE | |
|
84
|
+
| /symbols/:id/options | DONE | |
|
85
85
|
| /markets | DONE | |
|
86
|
-
| /markets/quotes
|
87
|
-
| /markets/quotes
|
88
|
-
| /markets/quotes/
|
89
|
-
| /markets/
|
86
|
+
| /markets/quotes/ | DONE | |
|
87
|
+
| /markets/quotes/:id | DONE | |
|
88
|
+
| /markets/quotes/options | | |
|
89
|
+
| /markets/quotes/strategies | | |
|
90
|
+
| /markets/candles/:id | DONE | |
|
90
91
|
|
91
92
|
### Order Calls
|
92
93
|
|
data/lib/questrade_api/client.rb
CHANGED
@@ -9,6 +9,9 @@ require 'questrade_api/rest/order'
|
|
9
9
|
|
10
10
|
require 'questrade_api/rest/market'
|
11
11
|
require 'questrade_api/rest/symbol'
|
12
|
+
require 'questrade_api/rest/quote'
|
13
|
+
require 'questrade_api/rest/candle'
|
14
|
+
require 'questrade_api/rest/option'
|
12
15
|
|
13
16
|
module QuestradeApi
|
14
17
|
# @author Bruno Meira <goesmeira@gmail.com>
|
@@ -86,6 +89,27 @@ module QuestradeApi
|
|
86
89
|
QuestradeApi::REST::Symbol.search(@authorization, params)
|
87
90
|
end
|
88
91
|
|
92
|
+
def quotes(ids)
|
93
|
+
QuestradeApi::REST::Quote.all(@authorization, ids)
|
94
|
+
end
|
95
|
+
|
96
|
+
def quote(id)
|
97
|
+
quote =
|
98
|
+
QuestradeApi::REST::Quote.new(authorization: @authorization, id: id)
|
99
|
+
|
100
|
+
quote.get
|
101
|
+
|
102
|
+
quote
|
103
|
+
end
|
104
|
+
|
105
|
+
def candles(symbol_id, params)
|
106
|
+
QuestradeApi::REST::Candle.all(@authorization, symbol_id, params)
|
107
|
+
end
|
108
|
+
|
109
|
+
def symbol_options(symbol_id)
|
110
|
+
QuestradeApi::REST::Option.all(@authorization, symbol_id)
|
111
|
+
end
|
112
|
+
|
89
113
|
private
|
90
114
|
|
91
115
|
def refresh_token?
|
@@ -58,9 +58,9 @@ module QuestradeApi
|
|
58
58
|
|
59
59
|
def get(params = {})
|
60
60
|
response = @connection.get do |req|
|
61
|
-
req.path = self.class.endpoint
|
61
|
+
req.path = params[:endpoint] || self.class.endpoint
|
62
62
|
|
63
|
-
params.each do |key, value|
|
63
|
+
params.fetch(:params, []).each do |key, value|
|
64
64
|
req.params[key] = value
|
65
65
|
end
|
66
66
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'questrade_api/rest/base'
|
2
|
+
|
3
|
+
module QuestradeApi
|
4
|
+
module REST
|
5
|
+
class Candle < QuestradeApi::REST::Base
|
6
|
+
def initialize(params)
|
7
|
+
@raw_body = params[:data]
|
8
|
+
build_data(params[:data]) if @raw_body
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.all(authorization, symbol_id, params)
|
12
|
+
response = super(access_token: authorization.access_token,
|
13
|
+
endpoint: endpoint(symbol_id),
|
14
|
+
url: authorization.url,
|
15
|
+
params: params)
|
16
|
+
|
17
|
+
if response.status == 200
|
18
|
+
result = OpenStruct.new(candles: [])
|
19
|
+
result.candles = parse_candles(response.body)
|
20
|
+
response = result
|
21
|
+
end
|
22
|
+
|
23
|
+
response
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.endpoint(symbol_id)
|
27
|
+
"#{BASE_ENDPOINT}/markets/candles/#{symbol_id}"
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.parse_candles(body)
|
31
|
+
raw = JSON.parse(body)
|
32
|
+
|
33
|
+
candles = []
|
34
|
+
|
35
|
+
raw['candles'].each do |candle|
|
36
|
+
candles << new(data: candle)
|
37
|
+
end
|
38
|
+
|
39
|
+
candles
|
40
|
+
end
|
41
|
+
|
42
|
+
private_class_method :parse_candles
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'questrade_api/rest/base'
|
2
|
+
|
3
|
+
module QuestradeApi
|
4
|
+
module REST
|
5
|
+
class Option < QuestradeApi::REST::Base
|
6
|
+
def initialize(params)
|
7
|
+
@raw_body = params[:data]
|
8
|
+
build_data(params[:data]) if @raw_body
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.all(authorization, symbol_id)
|
12
|
+
response = super(access_token: authorization.access_token,
|
13
|
+
endpoint: endpoint(symbol_id),
|
14
|
+
url: authorization.url)
|
15
|
+
|
16
|
+
if response.status == 200
|
17
|
+
result = OpenStruct.new(options: [])
|
18
|
+
result.options = parse_options(response.body)
|
19
|
+
response = result
|
20
|
+
end
|
21
|
+
|
22
|
+
response
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.endpoint(symbol_id)
|
26
|
+
"#{BASE_ENDPOINT}/symbol/#{symbol_id}/options"
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.parse_options(body)
|
30
|
+
raw = JSON.parse(body)
|
31
|
+
|
32
|
+
options = []
|
33
|
+
|
34
|
+
raw['options'].each do |option|
|
35
|
+
options << new(data: option)
|
36
|
+
end
|
37
|
+
|
38
|
+
options
|
39
|
+
end
|
40
|
+
|
41
|
+
private_class_method :parse_options
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'questrade_api/rest/base'
|
2
|
+
|
3
|
+
module QuestradeApi
|
4
|
+
module REST
|
5
|
+
class Quote < QuestradeApi::REST::Base
|
6
|
+
attr_accessor :id
|
7
|
+
|
8
|
+
def initialize(params)
|
9
|
+
super(params[:authorization])
|
10
|
+
@id = params[:id]
|
11
|
+
|
12
|
+
@raw_body = params[:data]
|
13
|
+
build_data(params[:data]) if @raw_body
|
14
|
+
end
|
15
|
+
|
16
|
+
def get
|
17
|
+
response = super(endpoint: endpoint)
|
18
|
+
|
19
|
+
if response.status == 200
|
20
|
+
parse_quotes(response.body)
|
21
|
+
end
|
22
|
+
|
23
|
+
response
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.all(authorization, ids)
|
27
|
+
response = super(access_token: authorization.access_token,
|
28
|
+
endpoint: endpoint,
|
29
|
+
url: authorization.url,
|
30
|
+
params: { ids: ids.join(',') })
|
31
|
+
|
32
|
+
if response.status == 200
|
33
|
+
result = OpenStruct.new(quotes: [])
|
34
|
+
result.quotes = parse_quotes(authorization, response.body)
|
35
|
+
response = result
|
36
|
+
end
|
37
|
+
|
38
|
+
response
|
39
|
+
end
|
40
|
+
|
41
|
+
def endpoint
|
42
|
+
self.class.endpoint + "/#{id}"
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.endpoint
|
46
|
+
"#{BASE_ENDPOINT}/markets/quotes"
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.parse_quotes(authorization, body)
|
50
|
+
raw = JSON.parse(body)
|
51
|
+
|
52
|
+
quotes = []
|
53
|
+
|
54
|
+
raw['quotes'].each do |quote|
|
55
|
+
quotes << new(authorization: authorization,
|
56
|
+
id: quote['symbolId'], data: quote)
|
57
|
+
end
|
58
|
+
|
59
|
+
quotes
|
60
|
+
end
|
61
|
+
|
62
|
+
private_class_method :parse_quotes
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def parse_quotes(body)
|
67
|
+
raw = JSON.parse(body)
|
68
|
+
|
69
|
+
raw['quotes'].each do |quote|
|
70
|
+
build_data(quote)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"options": [
|
3
|
+
{
|
4
|
+
"expiryDate": "2015-01-17T00:00:00.000000-05:00",
|
5
|
+
"description": "BANK OF MONTREAL",
|
6
|
+
"listingExchange": "MX",
|
7
|
+
"optionExerciseType": "American",
|
8
|
+
"chainPerRoot": [
|
9
|
+
{
|
10
|
+
"root": "BMO",
|
11
|
+
"chainPerStrikePrice": [
|
12
|
+
{
|
13
|
+
"strikePrice": 60,
|
14
|
+
"callSymbolId": 6101993,
|
15
|
+
"putSymbolId": 6102009
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"strikePrice": 62,
|
19
|
+
"callSymbolId": 6101994,
|
20
|
+
"putSymbolId": 6102010
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"strikePrice": 64,
|
24
|
+
"callSymbolId": 6101995,
|
25
|
+
"putSymbolId": 6102011
|
26
|
+
}
|
27
|
+
],
|
28
|
+
"multiplier": 100
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"quotes": [
|
3
|
+
{
|
4
|
+
"symbol": "THI.TO",
|
5
|
+
"symbolId": 38738,
|
6
|
+
"tier": "",
|
7
|
+
"bidPrice": 83.65,
|
8
|
+
"bidSize": 6500,
|
9
|
+
"askPrice": 83.67,
|
10
|
+
"askSize": 9100,
|
11
|
+
"lastTradePriceTrHrs": 83.66,
|
12
|
+
"lastTradePrice": 83.66,
|
13
|
+
"lastTradeSize": 3100,
|
14
|
+
"lastTradeTick": "Equal",
|
15
|
+
"lastTradeTime": "2014-10-24T20:06:40.131000-04:00",
|
16
|
+
"volume": 80483500,
|
17
|
+
"openPrice": 83.66,
|
18
|
+
"highPrice": 83.86,
|
19
|
+
"lowPrice": 83.66,
|
20
|
+
"delay": 0,
|
21
|
+
"isHalted": false
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"quotes": [
|
3
|
+
{
|
4
|
+
"symbol": "THI.TO",
|
5
|
+
"symbolId": 38738,
|
6
|
+
"tier": "",
|
7
|
+
"bidPrice": 83.65,
|
8
|
+
"bidSize": 6500,
|
9
|
+
"askPrice": 83.67,
|
10
|
+
"askSize": 9100,
|
11
|
+
"lastTradePriceTrHrs": 83.66,
|
12
|
+
"lastTradePrice": 83.66,
|
13
|
+
"lastTradeSize": 3100,
|
14
|
+
"lastTradeTick": "Equal",
|
15
|
+
"lastTradeTime": "2014-10-24T20:06:40.131000-04:00",
|
16
|
+
"volume": 80483500,
|
17
|
+
"openPrice": 83.66,
|
18
|
+
"highPrice": 83.86,
|
19
|
+
"lowPrice": 83.66,
|
20
|
+
"delay": 0,
|
21
|
+
"isHalted": false
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'questrade_api/rest/candle'
|
3
|
+
|
4
|
+
describe QuestradeApi::REST::Candle do
|
5
|
+
include JSONFixtures
|
6
|
+
|
7
|
+
let(:access_token) { 'XXXX' }
|
8
|
+
let(:url) { 'http://test.com'}
|
9
|
+
let(:authorization) { OpenStruct.new(access_token: access_token, url: url) }
|
10
|
+
|
11
|
+
context '.all' do
|
12
|
+
it 'fetches candle for an specific symbol' do
|
13
|
+
start_time = '2014-10-01T00:00:00-05:00'
|
14
|
+
end_time = '2014-10-01T00:00:00-05:00'
|
15
|
+
interval='OneDay'
|
16
|
+
stub_request(:get, 'http://test.com/v1/markets/candles/1010?startTime=2014-10-01T00:00:00-05:00&endTime=2014-10-01T00:00:00-05:00&interval=OneDay')
|
17
|
+
.to_return(status: 200, body: json_string('candles.json'))
|
18
|
+
|
19
|
+
params = {
|
20
|
+
startTime: start_time,
|
21
|
+
endTime: end_time,
|
22
|
+
interval: interval
|
23
|
+
}
|
24
|
+
|
25
|
+
response = QuestradeApi::REST::Candle.all(authorization, 1010, params)
|
26
|
+
|
27
|
+
expect(response.candles.size).to be(1)
|
28
|
+
|
29
|
+
first_candle = response.candles.first
|
30
|
+
expect(first_candle.data.to_h).to eq(
|
31
|
+
start: "2014-01-02T00:00:00.000000-05:00",
|
32
|
+
end: "2014-01-03T00:00:00.000000-05:00",
|
33
|
+
low: 70.3,
|
34
|
+
high: 70.78,
|
35
|
+
open: 70.68,
|
36
|
+
close: 70.73,
|
37
|
+
volume: 983609
|
38
|
+
)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context '.endpoint' do
|
43
|
+
it 'returns the right endpoint' do
|
44
|
+
url = "/v1/markets/candles/1019"
|
45
|
+
expect(QuestradeApi::REST::Candle.endpoint(1019)).to eq(url)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'questrade_api/rest/option'
|
3
|
+
|
4
|
+
describe QuestradeApi::REST::Option do
|
5
|
+
include JSONFixtures
|
6
|
+
|
7
|
+
let(:access_token) { 'XXXX' }
|
8
|
+
let(:url) { 'http://test.com'}
|
9
|
+
let(:authorization) { OpenStruct.new(access_token: access_token, url: url) }
|
10
|
+
|
11
|
+
context '.all' do
|
12
|
+
it 'fetches option chain for an specific symbol' do
|
13
|
+
stub_request(:get, 'http://test.com/v1/symbol/9291/options')
|
14
|
+
.to_return(status: 200, body: json_string('options.json'))
|
15
|
+
|
16
|
+
response = QuestradeApi::REST::Option.all(authorization, 9291)
|
17
|
+
|
18
|
+
expect(response.options.size).to be(1)
|
19
|
+
|
20
|
+
first_option = response.options.first
|
21
|
+
expect(first_option.data.to_h).to eq(
|
22
|
+
expiry_date: '2015-01-17T00:00:00.000000-05:00',
|
23
|
+
description: 'BANK OF MONTREAL',
|
24
|
+
listing_exchange: 'MX',
|
25
|
+
option_exercise_type: 'American',
|
26
|
+
chain_per_root: [
|
27
|
+
{
|
28
|
+
"root" => "BMO",
|
29
|
+
"chainPerStrikePrice" => [
|
30
|
+
{
|
31
|
+
"strikePrice" => 60,
|
32
|
+
"callSymbolId" => 6101993,
|
33
|
+
"putSymbolId" => 6102009
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"strikePrice" => 62,
|
37
|
+
"callSymbolId" => 6101994,
|
38
|
+
"putSymbolId" => 6102010
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"strikePrice" => 64,
|
42
|
+
"callSymbolId" => 6101995,
|
43
|
+
"putSymbolId" => 6102011
|
44
|
+
}
|
45
|
+
],
|
46
|
+
"multiplier" => 100
|
47
|
+
}
|
48
|
+
]
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context '.endpoint' do
|
54
|
+
it 'returns the right endpoint' do
|
55
|
+
url = "/v1/symbol/#{10}/options"
|
56
|
+
expect(QuestradeApi::REST::Option.endpoint(10)).to eq(url)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'questrade_api/rest/quote'
|
3
|
+
|
4
|
+
describe QuestradeApi::REST::Quote do
|
5
|
+
include JSONFixtures
|
6
|
+
|
7
|
+
let(:access_token) { 'XXXX' }
|
8
|
+
let(:url) { 'http://test.com'}
|
9
|
+
let(:authorization) { OpenStruct.new(access_token: access_token, url: url) }
|
10
|
+
|
11
|
+
context '#endpoint' do
|
12
|
+
subject { QuestradeApi::REST::Quote.new(authorization: authorization, id: 10) }
|
13
|
+
|
14
|
+
it 'returns the right endpoint' do
|
15
|
+
url = "/v1/markets/quotes/#{10}"
|
16
|
+
|
17
|
+
expect(subject.endpoint).to eq(url)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context '#get' do
|
22
|
+
subject { QuestradeApi::REST::Quote.new(authorization: authorization, id: 10) }
|
23
|
+
|
24
|
+
it 'fetches quote data' do
|
25
|
+
stub_request(:get, 'http://test.com/v1/markets/quotes/10')
|
26
|
+
.to_return(status: 200, body: json_string('quote_01.json'))
|
27
|
+
|
28
|
+
expect(subject.data).to be_nil
|
29
|
+
|
30
|
+
subject.get
|
31
|
+
|
32
|
+
expect(subject.data.to_h).to eq(
|
33
|
+
symbol: "THI.TO",
|
34
|
+
symbol_id: 38738,
|
35
|
+
tier: "",
|
36
|
+
bid_price: 83.65,
|
37
|
+
bid_size: 6500,
|
38
|
+
ask_price: 83.67,
|
39
|
+
ask_size: 9100,
|
40
|
+
last_trade_price_tr_hrs: 83.66,
|
41
|
+
last_trade_price: 83.66,
|
42
|
+
last_trade_size: 3100,
|
43
|
+
last_trade_tick: "Equal",
|
44
|
+
last_trade_time: "2014-10-24T20:06:40.131000-04:00",
|
45
|
+
volume: 80483500,
|
46
|
+
open_price: 83.66,
|
47
|
+
high_price: 83.86,
|
48
|
+
low_price: 83.66,
|
49
|
+
delay: 0,
|
50
|
+
is_halted: false
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context '.all' do
|
56
|
+
it 'fetches quote for an specific symbol' do
|
57
|
+
stub_request(:get, 'http://test.com/v1/markets/quotes?ids=12,11')
|
58
|
+
.to_return(status: 200, body: json_string('quotes.json'))
|
59
|
+
|
60
|
+
response = QuestradeApi::REST::Quote.all(authorization, [12, 11])
|
61
|
+
|
62
|
+
expect(response.quotes.size).to be(1)
|
63
|
+
|
64
|
+
first_quote = response.quotes.first
|
65
|
+
expect(first_quote.data.to_h).to eq(
|
66
|
+
symbol: "THI.TO",
|
67
|
+
symbol_id: 38738,
|
68
|
+
tier: "",
|
69
|
+
bid_price: 83.65,
|
70
|
+
bid_size: 6500,
|
71
|
+
ask_price: 83.67,
|
72
|
+
ask_size: 9100,
|
73
|
+
last_trade_price_tr_hrs: 83.66,
|
74
|
+
last_trade_price: 83.66,
|
75
|
+
last_trade_size: 3100,
|
76
|
+
last_trade_tick: "Equal",
|
77
|
+
last_trade_time: "2014-10-24T20:06:40.131000-04:00",
|
78
|
+
volume: 80483500,
|
79
|
+
open_price: 83.66,
|
80
|
+
high_price: 83.86,
|
81
|
+
low_price: 83.66,
|
82
|
+
delay: 0,
|
83
|
+
is_halted: false
|
84
|
+
)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
context '.endpoint' do
|
89
|
+
it 'returns the right endpoint' do
|
90
|
+
url = "/v1/markets/quotes"
|
91
|
+
expect(QuestradeApi::REST::Quote.endpoint).to eq(url)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: questrade_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Meira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -90,10 +90,13 @@ files:
|
|
90
90
|
- lib/questrade_api/rest/activity.rb
|
91
91
|
- lib/questrade_api/rest/balance.rb
|
92
92
|
- lib/questrade_api/rest/base.rb
|
93
|
+
- lib/questrade_api/rest/candle.rb
|
93
94
|
- lib/questrade_api/rest/execution.rb
|
94
95
|
- lib/questrade_api/rest/market.rb
|
96
|
+
- lib/questrade_api/rest/option.rb
|
95
97
|
- lib/questrade_api/rest/order.rb
|
96
98
|
- lib/questrade_api/rest/position.rb
|
99
|
+
- lib/questrade_api/rest/quote.rb
|
97
100
|
- lib/questrade_api/rest/symbol.rb
|
98
101
|
- lib/questrade_api/rest/time.rb
|
99
102
|
- lib/questrade_api/version.rb
|
@@ -101,10 +104,14 @@ files:
|
|
101
104
|
- spec/fixtures/json/accounts.json
|
102
105
|
- spec/fixtures/json/activities.json
|
103
106
|
- spec/fixtures/json/balances.json
|
107
|
+
- spec/fixtures/json/candles.json
|
104
108
|
- spec/fixtures/json/executions.json
|
105
109
|
- spec/fixtures/json/markets.json
|
110
|
+
- spec/fixtures/json/options.json
|
106
111
|
- spec/fixtures/json/orders.json
|
107
112
|
- spec/fixtures/json/positions.json
|
113
|
+
- spec/fixtures/json/quote_01.json
|
114
|
+
- spec/fixtures/json/quotes.json
|
108
115
|
- spec/fixtures/json/symbols.json
|
109
116
|
- spec/fixtures/json/symbols_search.json
|
110
117
|
- spec/fixtures/json/time.json
|
@@ -113,10 +120,13 @@ files:
|
|
113
120
|
- spec/questrade_api/rest/account_spec.rb
|
114
121
|
- spec/questrade_api/rest/activity_spec.rb
|
115
122
|
- spec/questrade_api/rest/balance_spec.rb
|
123
|
+
- spec/questrade_api/rest/candle_spec.rb
|
116
124
|
- spec/questrade_api/rest/execution_spec.rb
|
117
125
|
- spec/questrade_api/rest/market_spec.rb
|
126
|
+
- spec/questrade_api/rest/option_spec.rb
|
118
127
|
- spec/questrade_api/rest/order_spec.rb
|
119
128
|
- spec/questrade_api/rest/position_spec.rb
|
129
|
+
- spec/questrade_api/rest/quote_spec.rb
|
120
130
|
- spec/questrade_api/rest/symbol_spec.rb
|
121
131
|
- spec/questrade_api/rest/time_spec.rb
|
122
132
|
- spec/spec_helper.rb
|
@@ -141,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
151
|
version: '0'
|
142
152
|
requirements: []
|
143
153
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.5.1
|
145
155
|
signing_key:
|
146
156
|
specification_version: 4
|
147
157
|
summary: An elegant Ruby gem to interact with Questrade API
|
@@ -149,10 +159,14 @@ test_files:
|
|
149
159
|
- spec/fixtures/json/accounts.json
|
150
160
|
- spec/fixtures/json/activities.json
|
151
161
|
- spec/fixtures/json/balances.json
|
162
|
+
- spec/fixtures/json/candles.json
|
152
163
|
- spec/fixtures/json/executions.json
|
153
164
|
- spec/fixtures/json/markets.json
|
165
|
+
- spec/fixtures/json/options.json
|
154
166
|
- spec/fixtures/json/orders.json
|
155
167
|
- spec/fixtures/json/positions.json
|
168
|
+
- spec/fixtures/json/quote_01.json
|
169
|
+
- spec/fixtures/json/quotes.json
|
156
170
|
- spec/fixtures/json/symbols.json
|
157
171
|
- spec/fixtures/json/symbols_search.json
|
158
172
|
- spec/fixtures/json/time.json
|
@@ -161,10 +175,13 @@ test_files:
|
|
161
175
|
- spec/questrade_api/rest/account_spec.rb
|
162
176
|
- spec/questrade_api/rest/activity_spec.rb
|
163
177
|
- spec/questrade_api/rest/balance_spec.rb
|
178
|
+
- spec/questrade_api/rest/candle_spec.rb
|
164
179
|
- spec/questrade_api/rest/execution_spec.rb
|
165
180
|
- spec/questrade_api/rest/market_spec.rb
|
181
|
+
- spec/questrade_api/rest/option_spec.rb
|
166
182
|
- spec/questrade_api/rest/order_spec.rb
|
167
183
|
- spec/questrade_api/rest/position_spec.rb
|
184
|
+
- spec/questrade_api/rest/quote_spec.rb
|
168
185
|
- spec/questrade_api/rest/symbol_spec.rb
|
169
186
|
- spec/questrade_api/rest/time_spec.rb
|
170
187
|
- spec/spec_helper.rb
|