alpaca-trade-api 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/alpaca/trade/api.rb +1 -0
- data/lib/alpaca/trade/api/client.rb +7 -0
- data/lib/alpaca/trade/api/last_trade.rb +15 -0
- data/lib/alpaca/trade/api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e5e11fb99efb22e866a8f2cba25f51c4461243a1e29c6a27bca7e37f6d90ab6
|
4
|
+
data.tar.gz: bf33b4ac115ec3db6d12f1f9e8463dccd0c33bef5eeba88625ee3e0ca8583f42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6c4b7f0efdd86c0930db2e7c4cda494faab106722afa5d4187b242750e9885f2ae8845af1ca947200be2432869f0503fc9a11bff47dde20762259b5aa44bf00
|
7
|
+
data.tar.gz: 9a9900150e64e4c9e7366578edf42fcb803c08f97a622737f55678e00227f309ae6a8718cf76fe4e7e7f5b340bbb8d914308f2bfbdcf55dfea3fae74c72e7437
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.5.0] - 2020-05-25
|
8
|
+
### Added
|
9
|
+
- Implemented Client#last_trade. Thanks @nathanworden.
|
10
|
+
|
7
11
|
## [0.4.1] - 2020-04-25
|
8
12
|
### Fixed
|
9
13
|
- Added explicit `BigDecimal` require.
|
data/Gemfile.lock
CHANGED
data/lib/alpaca/trade/api.rb
CHANGED
@@ -97,6 +97,13 @@ module Alpaca
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
+
def last_trade(symbol:)
|
101
|
+
response = get_request(data_endpoint, "v1/last/stocks/#{symbol}")
|
102
|
+
raise InvalidRequest, JSON.parse(response.body)['message'] if response.status == 404
|
103
|
+
|
104
|
+
LastTrade.new(JSON.parse(response.body))
|
105
|
+
end
|
106
|
+
|
100
107
|
def new_order(symbol:, qty:, side:, type:, time_in_force:, limit_price: nil,
|
101
108
|
stop_price: nil, extended_hours: false, client_order_id: nil, order_class: nil,
|
102
109
|
take_profit: nil, stop_loss: nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpaca-trade-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloves Carneiro Jr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,6 +165,7 @@ files:
|
|
165
165
|
- lib/alpaca/trade/api/clock.rb
|
166
166
|
- lib/alpaca/trade/api/configuration.rb
|
167
167
|
- lib/alpaca/trade/api/errors.rb
|
168
|
+
- lib/alpaca/trade/api/last_trade.rb
|
168
169
|
- lib/alpaca/trade/api/order.rb
|
169
170
|
- lib/alpaca/trade/api/position.rb
|
170
171
|
- lib/alpaca/trade/api/version.rb
|