questrade_api 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4ded11a2d448dfa40a7da186b112118a97cfbe9d
4
+ data.tar.gz: d44c839445d9f7b17435447011269540fa70e9af
5
+ SHA512:
6
+ metadata.gz: 16429ac6177b3a1629e9b60b1e0509e1a93d5e8623ca58d91ddae8edb131b5b93e1d759dc18583a43389d8f0aef92920cdb5765a00e95cf4867b6b5fd4cef01e
7
+ data.tar.gz: a7875e088aa7cd1ac4dfe0eb1c5c8e19e6393960687073b0ab1d6b4bb0925ccbca6003be9b2322ae07a400739f354a22d2dfd150f2fccdc3a9e2af3e46f45a8a
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in questrade_api.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2017 Bruno Meira
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # QuestradeApi
2
+
3
+ A Ruby interface to use the [Questrade API](http://www.questrade.com/api).
4
+
5
+ ## Quick Start
6
+
7
+ 1. Create a Questrade Demo Account on: <http://www.questrade.com/api/free-practice-account>
8
+
9
+ 2. Add the following line to your Gemfile
10
+
11
+ ```
12
+ gem 'questrade_api'
13
+
14
+ ```
15
+
16
+ 3. Run Bundle to install gem
17
+
18
+ ```
19
+ $ bundle
20
+
21
+ ```
22
+
23
+ 4. Follow the tutorial on <http://www.questrade.com/api/documentation/getting-started> to generate a refresh token
24
+
25
+ 5. Copy the snippet of code below to your application, and replace the 'XXXX' token with the token generated on step 4.
26
+
27
+ ```ruby
28
+ # By default this API calls the practice(demo) endpoint.
29
+ # Check our documentation to learn how to call the live endpoint.
30
+ client = QuestradeApi::Client.new(refresh_token: 'XXXX')
31
+
32
+ ```
33
+
34
+ 6. That's all you need to access the API. A few examples of what you can do with it:
35
+
36
+ ```ruby
37
+ # Get Questrade's current server time
38
+ client.time
39
+
40
+ # list of all accounts
41
+ client.accounts
42
+
43
+ # List of all balances of an specific account
44
+ client.balances('account_id')
45
+
46
+ # List of positions of an specific account
47
+ client.positions('account_id')
48
+
49
+ # Activities of an specific period of time for an specific account
50
+ client.activities('account_id', startTime: DateTime.yesterday.to_s, endTime: DateTime.now.to_s)
51
+
52
+ # In case you already have a valid access token and its respective URL, you can use the QuestradeApi::REST objects. Example:
53
+ # authorization can be any object that responds to url and access_token
54
+ authorization = QuestradeApi::Authorization.new(access_token: 'access_token', api_server: 'url')
55
+ accounts = QuestradeApi::REST::Account.all(accounts)
56
+
57
+ ```
58
+
59
+ For more advanced options, check out our [documentation](http://www.google.com).
60
+
61
+ ## Current Status
62
+
63
+ This Project is under development and some endpoints are still not accessible through the gem.
64
+ Check the tables below for more details.
65
+
66
+ <dl>
67
+ <dt>LEGEND</dt>
68
+
69
+ <dd>:green_heart: = Available</dd>
70
+ <dd>:heart: = Not Available</dd>
71
+ </dl>
72
+
73
+ ### Account Calls
74
+
75
+ | Endpoint | Development | Documentation |
76
+ | --- | --- | --- |
77
+ | /time | :green_heart: | :green_heart: |
78
+ | /accounts | :green_heart: | :green_heart: |
79
+ | /accounts/:id/positions | :green_heart: | :heart: |
80
+ | /accounts/:id/balances | :green_heart: | :heart: |
81
+ | /accounts/:id/executions | :green_heart: | :heart: |
82
+ | /accounts/:id/orders | :green_heart: | :heart: |
83
+ | /accounts/:id/activities | :green_heart: | :heart: |
84
+
85
+ ### Market Calls
86
+
87
+ | Endpoint | Development | Documentation |
88
+ | --- | --- | --- |
89
+ | /symbols/:id | :heart: | :heart: |
90
+ | /symbols/:search | :heart: | :heart: |
91
+ | /symbols/:id/options | :heart: | :heart: |
92
+ | /markets | :green_heart: | :heart: |
93
+ | /markets/quotes/:id | :heart: | :heart: |
94
+ | /markets/quotes/options | :heart: | :heart: |
95
+ | /markets/quotes/strategies | :heart: | :heart: |
96
+ | /markets/candles/:id | :heart: | :heart: |
97
+
98
+ ### Order Calls
99
+
100
+ | Endpoint | Development | Documentation |
101
+ | --- | --- | --- |
102
+ | POST accounts/:id/orders | :heart: | :heart: |
103
+ | POST accounts/:id/orders/impact | :heart: | :heart: |
104
+ | DELETE accounts/:id/orders | :heart: | :heart: |
105
+ | POST accounts/:id/orders/brackets | :heart: | :heart: |
106
+ | POST accounts/:id/orders/strategy | :heart: | :heart: |
107
+
108
+ ## Contributing
109
+
110
+ Contributions are more than welcome.
111
+ The only thing we ask is that before you send a Pull Request, please check if you completed the steps below:
112
+
113
+ 1. Write and/or update affected tests
114
+ 3. Write and/or update documentation
115
+ 4. Run RuboCop and update code, if needed
116
+ 5. Run test suite
117
+ 6. Test if the changes are working properly and didn't break any affected area
118
+
119
+ ## Note
120
+
121
+ This is an open-source project, licensed under the MIT License(see [LICENSE]), and was developed as a labour of love.
122
+ We are not responsible for any damages, capital losses, or any claim caused by the use of this gem.
123
+
124
+ USE IT AT YOUR OWN RISK.
125
+
126
+ [LICENSE]: LICENSE.txt
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :console do
4
+ exec "irb -r questrade_api -I ./lib"
5
+ end
@@ -0,0 +1,6 @@
1
+ # @author Bruno Meira <goesmeira@gmail.com>
2
+ module QuestradeApi
3
+ end
4
+
5
+ require 'questrade_api/client'
6
+ require 'questrade_api/authorization'
@@ -0,0 +1,3 @@
1
+ module QuestradeApi
2
+ VERSION = '0.0.1'.freeze
3
+ end
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'questrade_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "questrade_api"
8
+ spec.version = QuestradeApi::VERSION
9
+ spec.authors = ["Bruno Meira"]
10
+ spec.email = ["goesmeira@gmail.com"]
11
+ spec.summary = "An elegant Ruby gem to interact with Questrade API"
12
+ spec.homepage = 'https://github.com/brunomeira/questrade_api'
13
+
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.14"
22
+ spec.add_development_dependency "guard"
23
+ spec.add_development_dependency "guard-rspec"
24
+ spec.add_development_dependency 'rspec', '~> 3.5'
25
+ spec.add_development_dependency 'webmock', '~> 2.3'
26
+ spec.add_development_dependency 'rubocop', '~> 0.47'
27
+
28
+ spec.add_dependency 'faraday', '~> 0.9'
29
+ end
metadata ADDED
@@ -0,0 +1,150 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: questrade_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bruno Meira
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.5'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.3'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.47'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.47'
97
+ - !ruby/object:Gem::Dependency
98
+ name: faraday
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.9'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.9'
111
+ description:
112
+ email:
113
+ - goesmeira@gmail.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - Gemfile
120
+ - LICENSE.txt
121
+ - README.md
122
+ - Rakefile
123
+ - lib/questrade_api.rb
124
+ - lib/questrade_api/version.rb
125
+ - questrade_api.gemspec
126
+ homepage: https://github.com/brunomeira/questrade_api
127
+ licenses:
128
+ - MIT
129
+ metadata: {}
130
+ post_install_message:
131
+ rdoc_options: []
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ required_rubygems_version: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ requirements: []
145
+ rubyforge_project:
146
+ rubygems_version: 2.5.1
147
+ signing_key:
148
+ specification_version: 4
149
+ summary: An elegant Ruby gem to interact with Questrade API
150
+ test_files: []