snaptrade 1.17.9 → 1.17.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01d2791faf8d79c80e2736f81825f3a61d0633de757bfbbc9f8b151612d2efb3
4
- data.tar.gz: b4c5c2dced52d4e8fce5824d84e3b2e6771544f3dba0c7629f48f54ab5f40a03
3
+ metadata.gz: 89a20280d9b851518ff6cb3d0de7d9da7e10ca979110d76bde7d65ded8b3cea0
4
+ data.tar.gz: 8777f7b671a47885513f3e26dbe3952590e37f95dbfb2700582bf747a29926a5
5
5
  SHA512:
6
- metadata.gz: 276386e7e7e23442b73b0ae0de07d312cc7f9ebcc361570e2645643c2547a50579f23738d669a14e15eb7e1f2630b1541ed2c8139e5f55280c6755b9076dda30
7
- data.tar.gz: 1a81481605ab5e5eae527cc97c3c927d48ba238a850ccff718f13cc7694216d24a8650398948b845f713eed9ef1a457999a3b10ef61bc0585dd301345d77c725
6
+ metadata.gz: 4386f8003ff97d7572b654cab71a0fed781bd470d021e9f0fa1d5f89bcdad6fa907d22c2c03b4a21e9c05679cdc43c5f21963727073e43025fce0a0057dca059
7
+ data.tar.gz: d02afd9d1eccb3f8ccf03a8e6271874e7e73e50d6ce08ce7e433a8151e2abcbe23570a49b27bf6efcb5c5d09cdd25a2ffc00eb894413a4af224c351b84fedaaf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (1.17.8)
4
+ snaptrade (1.17.10)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ For more information, please visit [https://snaptrade.com/](https://snaptrade.co
9
9
  Add to Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'snaptrade', '~> 1.17.9'
12
+ gem 'snaptrade', '~> 1.17.11'
13
13
  ```
14
14
 
15
15
  ## Getting Started
@@ -10,7 +10,7 @@
10
10
  | **universal_symbol** | [**UniversalSymbol**](UniversalSymbol.md) | | [optional] |
11
11
  | **option_symbol** | [**OptionsSymbol**](OptionsSymbol.md) | | [optional] |
12
12
  | **action** | [**Action**](Action.md) | | [optional] |
13
- | **total_quantity** | **Float** | Trade Units | [optional] |
13
+ | **total_quantity** | **Float** | Trade Units. Cannot work with notional value. | [optional] |
14
14
  | **open_quantity** | **Float** | Trade Units | [optional] |
15
15
  | **canceled_quantity** | **Float** | Trade Units | [optional] |
16
16
  | **filled_quantity** | **Float** | Trade Units | [optional] |
data/docs/ManualTrade.md CHANGED
@@ -10,7 +10,7 @@
10
10
  | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
11
11
  | **symbol** | [**ManualTradeSymbol**](ManualTradeSymbol.md) | | [optional] |
12
12
  | **action** | [**Action**](Action.md) | | [optional] |
13
- | **units** | **Float** | Trade Units | [optional] |
13
+ | **units** | **Float** | Trade Units. Cannot work with notional value. | [optional] |
14
14
  | **price** | **Float** | Trade Price if limit or stop limit order | [optional] |
15
15
 
16
16
  ## Example
@@ -10,8 +10,9 @@
10
10
  | **price** | **Float** | Trade Price if limit or stop limit order | [optional] |
11
11
  | **stop** | **Float** | Stop Price. If stop loss or stop limit order, the price to trigger the stop | [optional] |
12
12
  | **time_in_force** | [**TimeInForce**](TimeInForce.md) | | [optional] |
13
- | **units** | **Float** | Trade Units | [optional] |
13
+ | **units** | **Float** | Trade Units. Cannot work with notional value. | [optional] |
14
14
  | **universal_symbol_id** | **String** | | [optional] |
15
+ | **notional_value** | **Float** | Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades** | [optional] |
15
16
 
16
17
  ## Example
17
18
 
@@ -26,7 +27,8 @@ instance = SnapTrade::ManualTradeForm.new(
26
27
  stop: 31.33,
27
28
  time_in_force: null,
28
29
  units: null,
29
- universal_symbol_id: 2bcd7cc3-e922-4976-bce1-9858296801c3
30
+ universal_symbol_id: 2bcd7cc3-e922-4976-bce1-9858296801c3,
31
+ notional_value: 100
30
32
  )
31
33
  ```
32
34
 
data/docs/TradingApi.md CHANGED
@@ -103,6 +103,7 @@ stop = 31.33
103
103
  time_in_force = "Day"
104
104
  units = 3.14
105
105
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
106
+ notional_value = 100
106
107
 
107
108
  begin
108
109
  # Check impact of trades on account.
@@ -117,6 +118,7 @@ begin
117
118
  time_in_force: time_in_force,
118
119
  units: units,
119
120
  universal_symbol_id: universal_symbol_id,
121
+ notional_value: notional_value,
120
122
  )
121
123
  p result
122
124
  rescue SnapTrade::ApiError => e
@@ -139,6 +141,7 @@ stop = 31.33
139
141
  time_in_force = "Day"
140
142
  units = 3.14
141
143
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
144
+ notional_value = 100
142
145
 
143
146
  begin
144
147
  # Check impact of trades on account.
@@ -153,6 +156,7 @@ begin
153
156
  time_in_force: time_in_force,
154
157
  units: units,
155
158
  universal_symbol_id: universal_symbol_id,
159
+ notional_value: notional_value,
156
160
  )
157
161
  p status_code # => 2xx
158
162
  p headers # => { ... }
@@ -271,6 +275,7 @@ stop = 31.33
271
275
  time_in_force = "Day"
272
276
  units = 3.14
273
277
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
278
+ notional_value = 100
274
279
 
275
280
  begin
276
281
  # Place a trade with NO validation.
@@ -285,6 +290,7 @@ begin
285
290
  time_in_force: time_in_force,
286
291
  units: units,
287
292
  universal_symbol_id: universal_symbol_id,
293
+ notional_value: notional_value,
288
294
  )
289
295
  p result
290
296
  rescue SnapTrade::ApiError => e
@@ -307,6 +313,7 @@ stop = 31.33
307
313
  time_in_force = "Day"
308
314
  units = 3.14
309
315
  universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
316
+ notional_value = 100
310
317
 
311
318
  begin
312
319
  # Place a trade with NO validation.
@@ -321,6 +328,7 @@ begin
321
328
  time_in_force: time_in_force,
322
329
  units: units,
323
330
  universal_symbol_id: universal_symbol_id,
331
+ notional_value: notional_value,
324
332
  )
325
333
  p status_code # => 2xx
326
334
  p headers # => { ... }
@@ -143,11 +143,12 @@ module SnapTrade
143
143
  # @param price [Float] Trade Price if limit or stop limit order
144
144
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
145
145
  # @param time_in_force [TimeInForce]
146
- # @param units [Float] Trade Units
146
+ # @param units [Float] Trade Units. Cannot work with notional value.
147
147
  # @param universal_symbol_id [String]
148
+ # @param notional_value [Float] Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades**
148
149
  # @param body [ManualTradeForm]
149
150
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
150
- def get_order_impact(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, extra: {})
151
+ def get_order_impact(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
151
152
  _body = {}
152
153
  _body[:account_id] = account_id if account_id != SENTINEL
153
154
  _body[:action] = action if action != SENTINEL
@@ -157,6 +158,7 @@ module SnapTrade
157
158
  _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
158
159
  _body[:units] = units if units != SENTINEL
159
160
  _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
161
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
160
162
  manual_trade_form = _body
161
163
  data, _status_code, _headers = get_order_impact_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
162
164
  data
@@ -171,11 +173,12 @@ module SnapTrade
171
173
  # @param price [Float] Trade Price if limit or stop limit order
172
174
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
173
175
  # @param time_in_force [TimeInForce]
174
- # @param units [Float] Trade Units
176
+ # @param units [Float] Trade Units. Cannot work with notional value.
175
177
  # @param universal_symbol_id [String]
178
+ # @param notional_value [Float] Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades**
176
179
  # @param body [ManualTradeForm]
177
180
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
178
- def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, extra: {})
181
+ def get_order_impact_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
179
182
  _body = {}
180
183
  _body[:account_id] = account_id if account_id != SENTINEL
181
184
  _body[:action] = action if action != SENTINEL
@@ -185,6 +188,7 @@ module SnapTrade
185
188
  _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
186
189
  _body[:units] = units if units != SENTINEL
187
190
  _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
191
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
188
192
  manual_trade_form = _body
189
193
  get_order_impact_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
190
194
  end
@@ -390,11 +394,12 @@ module SnapTrade
390
394
  # @param price [Float] Trade Price if limit or stop limit order
391
395
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
392
396
  # @param time_in_force [TimeInForce]
393
- # @param units [Float] Trade Units
397
+ # @param units [Float] Trade Units. Cannot work with notional value.
394
398
  # @param universal_symbol_id [String]
399
+ # @param notional_value [Float] Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades**
395
400
  # @param body [ManualTradeForm]
396
401
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
397
- def place_force_order(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, extra: {})
402
+ def place_force_order(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
398
403
  _body = {}
399
404
  _body[:account_id] = account_id if account_id != SENTINEL
400
405
  _body[:action] = action if action != SENTINEL
@@ -404,6 +409,7 @@ module SnapTrade
404
409
  _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
405
410
  _body[:units] = units if units != SENTINEL
406
411
  _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
412
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
407
413
  manual_trade_form = _body
408
414
  data, _status_code, _headers = place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
409
415
  data
@@ -418,11 +424,12 @@ module SnapTrade
418
424
  # @param price [Float] Trade Price if limit or stop limit order
419
425
  # @param stop [Float] Stop Price. If stop loss or stop limit order, the price to trigger the stop
420
426
  # @param time_in_force [TimeInForce]
421
- # @param units [Float] Trade Units
427
+ # @param units [Float] Trade Units. Cannot work with notional value.
422
428
  # @param universal_symbol_id [String]
429
+ # @param notional_value [Float] Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades**
423
430
  # @param body [ManualTradeForm]
424
431
  # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
425
- def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, extra: {})
432
+ def place_force_order_with_http_info(user_id:, user_secret:, account_id: SENTINEL, action: SENTINEL, order_type: SENTINEL, price: SENTINEL, stop: SENTINEL, time_in_force: SENTINEL, units: SENTINEL, universal_symbol_id: SENTINEL, notional_value: SENTINEL, extra: {})
426
433
  _body = {}
427
434
  _body[:account_id] = account_id if account_id != SENTINEL
428
435
  _body[:action] = action if action != SENTINEL
@@ -432,6 +439,7 @@ module SnapTrade
432
439
  _body[:time_in_force] = time_in_force if time_in_force != SENTINEL
433
440
  _body[:units] = units if units != SENTINEL
434
441
  _body[:universal_symbol_id] = universal_symbol_id if universal_symbol_id != SENTINEL
442
+ _body[:notional_value] = notional_value if notional_value != SENTINEL
435
443
  manual_trade_form = _body
436
444
  place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form, extra)
437
445
  end
@@ -27,7 +27,7 @@ module SnapTrade
27
27
 
28
28
  attr_accessor :action
29
29
 
30
- # Trade Units
30
+ # Trade Units. Cannot work with notional value.
31
31
  attr_accessor :total_quantity
32
32
 
33
33
  # Trade Units
@@ -26,7 +26,7 @@ module SnapTrade
26
26
 
27
27
  attr_accessor :action
28
28
 
29
- # Trade Units
29
+ # Trade Units. Cannot work with notional value.
30
30
  attr_accessor :units
31
31
 
32
32
  # Trade Price if limit or stop limit order
@@ -28,11 +28,14 @@ module SnapTrade
28
28
 
29
29
  attr_accessor :time_in_force
30
30
 
31
- # Trade Units
31
+ # Trade Units. Cannot work with notional value.
32
32
  attr_accessor :units
33
33
 
34
34
  attr_accessor :universal_symbol_id
35
35
 
36
+ # Dollar amount to trade. Cannot work with units. Can only work for market order types and day for time in force. **Only available for Alpaca and Alpaca Paper. Please contact support to get access to place notional trades**
37
+ attr_accessor :notional_value
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -43,7 +46,8 @@ module SnapTrade
43
46
  :'stop' => :'stop',
44
47
  :'time_in_force' => :'time_in_force',
45
48
  :'units' => :'units',
46
- :'universal_symbol_id' => :'universal_symbol_id'
49
+ :'universal_symbol_id' => :'universal_symbol_id',
50
+ :'notional_value' => :'notional_value'
47
51
  }
48
52
  end
49
53
 
@@ -62,7 +66,8 @@ module SnapTrade
62
66
  :'stop' => :'Float',
63
67
  :'time_in_force' => :'TimeInForce',
64
68
  :'units' => :'Float',
65
- :'universal_symbol_id' => :'String'
69
+ :'universal_symbol_id' => :'String',
70
+ :'notional_value' => :'Float'
66
71
  }
67
72
  end
68
73
 
@@ -71,6 +76,7 @@ module SnapTrade
71
76
  Set.new([
72
77
  :'price',
73
78
  :'stop',
79
+ :'notional_value'
74
80
  ])
75
81
  end
76
82
 
@@ -120,6 +126,10 @@ module SnapTrade
120
126
  if attributes.key?(:'universal_symbol_id')
121
127
  self.universal_symbol_id = attributes[:'universal_symbol_id']
122
128
  end
129
+
130
+ if attributes.key?(:'notional_value')
131
+ self.notional_value = attributes[:'notional_value']
132
+ end
123
133
  end
124
134
 
125
135
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -147,7 +157,8 @@ module SnapTrade
147
157
  stop == o.stop &&
148
158
  time_in_force == o.time_in_force &&
149
159
  units == o.units &&
150
- universal_symbol_id == o.universal_symbol_id
160
+ universal_symbol_id == o.universal_symbol_id &&
161
+ notional_value == o.notional_value
151
162
  end
152
163
 
153
164
  # @see the `==` method
@@ -159,7 +170,7 @@ module SnapTrade
159
170
  # Calculates hash code according to all attributes.
160
171
  # @return [Integer] Hash code
161
172
  def hash
162
- [account_id, action, order_type, price, stop, time_in_force, units, universal_symbol_id].hash
173
+ [account_id, action, order_type, price, stop, time_in_force, units, universal_symbol_id, notional_value].hash
163
174
  end
164
175
 
165
176
  # Builds the object from hash
@@ -9,5 +9,5 @@ Contact: api@snaptrade.com
9
9
  =end
10
10
 
11
11
  module SnapTrade
12
- VERSION = '1.17.9'
12
+ VERSION = '1.17.11'
13
13
  end
@@ -69,4 +69,10 @@ describe SnapTrade::ManualTradeForm do
69
69
  end
70
70
  end
71
71
 
72
+ describe 'test attribute "notional_value"' do
73
+ it 'should work' do
74
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
75
+ end
76
+ end
77
+
72
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snaptrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.9
4
+ version: 1.17.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - SnapTrade
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-12 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday