snaptrade 2.0.40 → 2.0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -8
- data/README.md +16 -15
- data/lib/snaptrade/api/reference_data_api.rb +42 -46
- data/lib/snaptrade/api/trading_api.rb +4 -4
- data/lib/snaptrade/models/connection_portal_version.rb +3 -2
- data/lib/snaptrade/models/options_position.rb +1 -1
- data/lib/snaptrade/models/symbol_query.rb +1 -1
- data/lib/snaptrade/models/universal_activity.rb +1 -1
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/reference_data_api_spec.rb +8 -8
- data/spec/api/trading_api_spec.rb +1 -1
- metadata +100 -100
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0e42437344c3de95a109e8b65a5297915515a37230c0aa443eaeace9213dab
|
4
|
+
data.tar.gz: 0d6217ba0036003029c403384e8355b2785a485e98443b6bc07513b47f482d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff422a9c92ce394d98e1d0de8aeaee6f73e07864d8e369551be867ebd1af291aac78ac5461969e605f8b21045c269f485b1233b6b787426258991c8a6a2ea68d
|
7
|
+
data.tar.gz: f1a5b614e521789000a54df2252ca23191043f60ee9ee5a3a748e53683ba34a70ca555588b4d2f15de83785ec6a294389c7986b1416a4547cc1b01e32fd60642
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.42)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
method_source (1.1.0)
|
30
30
|
multipart-post (2.4.1)
|
31
31
|
parallel (1.26.3)
|
32
|
-
parser (3.3.
|
32
|
+
parser (3.3.5.0)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
racc
|
35
35
|
pry (0.14.2)
|
@@ -42,15 +42,14 @@ GEM
|
|
42
42
|
rainbow (3.1.1)
|
43
43
|
rake (13.0.6)
|
44
44
|
regexp_parser (2.9.2)
|
45
|
-
reline (0.5.
|
45
|
+
reline (0.5.10)
|
46
46
|
io-console (~> 0.5)
|
47
|
-
rexml (3.3.
|
48
|
-
strscan
|
47
|
+
rexml (3.3.7)
|
49
48
|
rspec (3.13.0)
|
50
49
|
rspec-core (~> 3.13.0)
|
51
50
|
rspec-expectations (~> 3.13.0)
|
52
51
|
rspec-mocks (~> 3.13.0)
|
53
|
-
rspec-core (3.13.
|
52
|
+
rspec-core (3.13.1)
|
54
53
|
rspec-support (~> 3.13.0)
|
55
54
|
rspec-expectations (3.13.2)
|
56
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -68,11 +67,10 @@ GEM
|
|
68
67
|
rubocop-ast (>= 1.2.0, < 2.0)
|
69
68
|
ruby-progressbar (~> 1.7)
|
70
69
|
unicode-display_width (>= 1.4.0, < 3.0)
|
71
|
-
rubocop-ast (1.32.
|
70
|
+
rubocop-ast (1.32.3)
|
72
71
|
parser (>= 3.3.1.0)
|
73
72
|
ruby-progressbar (1.13.0)
|
74
73
|
ruby2_keywords (0.0.5)
|
75
|
-
strscan (3.1.0)
|
76
74
|
unicode-display_width (2.5.0)
|
77
75
|
|
78
76
|
PLATFORMS
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
8
8
|
|
9
|
-
[![npm](https://img.shields.io/badge/gem-v2.0.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.42-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.42)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
70
|
Add to Gemfile:
|
71
71
|
|
72
72
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
73
|
+
gem 'snaptrade', '~> 2.0.42'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Getting Started<a id="getting-started"></a>
|
@@ -1161,16 +1161,14 @@ p result
|
|
1161
1161
|
|
1162
1162
|
### `snaptrade.reference_data.get_symbols`<a id="snaptradereference_dataget_symbols"></a>
|
1163
1163
|
|
1164
|
-
Returns a list of Universal Symbol objects that match
|
1165
|
-
|
1166
|
-
Matches on ticker or name.
|
1164
|
+
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
1167
1165
|
|
1168
1166
|
|
1169
1167
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
1170
1168
|
|
1171
1169
|
```ruby
|
1172
1170
|
result = snaptrade.reference_data.get_symbols(
|
1173
|
-
substring: "
|
1171
|
+
substring: "AAPL",
|
1174
1172
|
)
|
1175
1173
|
p result
|
1176
1174
|
```
|
@@ -1178,6 +1176,8 @@ p result
|
|
1178
1176
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
1179
1177
|
|
1180
1178
|
##### substring: `String`<a id="substring-string"></a>
|
1179
|
+
The search query for symbols.
|
1180
|
+
|
1181
1181
|
#### 🔄 Return<a id="🔄-return"></a>
|
1182
1182
|
|
1183
1183
|
[UniversalSymbol](./lib/snaptrade/models/universal_symbol.rb)
|
@@ -1193,7 +1193,8 @@ p result
|
|
1193
1193
|
|
1194
1194
|
### `snaptrade.reference_data.get_symbols_by_ticker`<a id="snaptradereference_dataget_symbols_by_ticker"></a>
|
1195
1195
|
|
1196
|
-
Returns the Universal Symbol object specified by the ticker or the
|
1196
|
+
Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on "Yahoo Finance Market Coverage and Data Delays"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
1197
|
+
|
1197
1198
|
|
1198
1199
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
1199
1200
|
|
@@ -1207,7 +1208,7 @@ p result
|
|
1207
1208
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
1208
1209
|
|
1209
1210
|
##### query: `String`<a id="query-string"></a>
|
1210
|
-
The ticker or
|
1211
|
+
The ticker or Universal Symbol ID to look up the symbol with.
|
1211
1212
|
|
1212
1213
|
#### 🔄 Return<a id="🔄-return"></a>
|
1213
1214
|
|
@@ -1327,9 +1328,9 @@ p result
|
|
1327
1328
|
|
1328
1329
|
### `snaptrade.reference_data.symbol_search_user_account`<a id="snaptradereference_datasymbol_search_user_account"></a>
|
1329
1330
|
|
1330
|
-
Returns a list of
|
1331
|
-
|
1332
|
-
|
1331
|
+
Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
1332
|
+
|
1333
|
+
The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
1333
1334
|
|
1334
1335
|
|
1335
1336
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -1339,7 +1340,7 @@ result = snaptrade.reference_data.symbol_search_user_account(
|
|
1339
1340
|
user_id: "snaptrade-user-123",
|
1340
1341
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
1341
1342
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
1342
|
-
substring: "
|
1343
|
+
substring: "AAPL",
|
1343
1344
|
)
|
1344
1345
|
p result
|
1345
1346
|
```
|
@@ -1349,9 +1350,9 @@ p result
|
|
1349
1350
|
##### user_id: `String`<a id="user_id-string"></a>
|
1350
1351
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
1351
1352
|
##### account_id: `String`<a id="account_id-string"></a>
|
1352
|
-
The ID of the account to search for symbols within.
|
1353
|
-
|
1354
1353
|
##### substring: `String`<a id="substring-string"></a>
|
1354
|
+
The search query for symbols.
|
1355
|
+
|
1355
1356
|
#### 🔄 Return<a id="🔄-return"></a>
|
1356
1357
|
|
1357
1358
|
[UniversalSymbol](./lib/snaptrade/models/universal_symbol.rb)
|
@@ -1521,7 +1522,7 @@ Should be set to `True` if `symbols` are comprised of tickers. Defaults to
|
|
1521
1522
|
|
1522
1523
|
### `snaptrade.trading.place_force_order`<a id="snaptradetradingplace_force_order"></a>
|
1523
1524
|
|
1524
|
-
Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
1525
|
+
Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
1525
1526
|
|
1526
1527
|
This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
|
1527
1528
|
|
@@ -333,13 +333,11 @@ module SnapTrade
|
|
333
333
|
end
|
334
334
|
|
335
335
|
|
336
|
-
# Search
|
336
|
+
# Search symbols
|
337
337
|
#
|
338
|
-
# Returns a list of Universal Symbol objects that match
|
339
|
-
#
|
340
|
-
# Matches on ticker or name.
|
338
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
341
339
|
#
|
342
|
-
# @param substring [String]
|
340
|
+
# @param substring [String] The search query for symbols.
|
343
341
|
# @param body [SymbolQuery]
|
344
342
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
345
343
|
def get_symbols(substring: SENTINEL, extra: {})
|
@@ -350,13 +348,11 @@ module SnapTrade
|
|
350
348
|
data
|
351
349
|
end
|
352
350
|
|
353
|
-
# Search
|
351
|
+
# Search symbols
|
354
352
|
#
|
355
|
-
# Returns a list of Universal Symbol objects that match
|
356
|
-
#
|
357
|
-
# Matches on ticker or name.
|
353
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
358
354
|
#
|
359
|
-
# @param substring [String]
|
355
|
+
# @param substring [String] The search query for symbols.
|
360
356
|
# @param body [SymbolQuery]
|
361
357
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
362
358
|
def get_symbols_with_http_info(substring: SENTINEL, extra: {})
|
@@ -366,8 +362,8 @@ module SnapTrade
|
|
366
362
|
get_symbols_with_http_info_impl(extra)
|
367
363
|
end
|
368
364
|
|
369
|
-
# Search
|
370
|
-
# Returns a list of Universal Symbol objects that match
|
365
|
+
# Search symbols
|
366
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
371
367
|
# @param [Hash] opts the optional parameters
|
372
368
|
# @option opts [SymbolQuery] :symbol_query
|
373
369
|
# @return [Array<UniversalSymbol>]
|
@@ -376,8 +372,8 @@ module SnapTrade
|
|
376
372
|
data
|
377
373
|
end
|
378
374
|
|
379
|
-
# Search
|
380
|
-
# Returns a list of Universal Symbol objects that match
|
375
|
+
# Search symbols
|
376
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
381
377
|
# @param [Hash] opts the optional parameters
|
382
378
|
# @option opts [SymbolQuery] :symbol_query
|
383
379
|
# @return [Array<(Array<UniversalSymbol>, Integer, Hash)>] Array<UniversalSymbol> data, response status code and response headers
|
@@ -431,30 +427,30 @@ module SnapTrade
|
|
431
427
|
end
|
432
428
|
|
433
429
|
|
434
|
-
# Get
|
430
|
+
# Get symbol detail
|
435
431
|
#
|
436
|
-
# Returns the Universal Symbol object specified by the ticker or the
|
432
|
+
# Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on "Yahoo Finance Market Coverage and Data Delays"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
437
433
|
#
|
438
|
-
# @param query [String] The ticker or
|
434
|
+
# @param query [String] The ticker or Universal Symbol ID to look up the symbol with.
|
439
435
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
440
436
|
def get_symbols_by_ticker(query:, extra: {})
|
441
437
|
data, _status_code, _headers = get_symbols_by_ticker_with_http_info_impl(query, extra)
|
442
438
|
data
|
443
439
|
end
|
444
440
|
|
445
|
-
# Get
|
441
|
+
# Get symbol detail
|
446
442
|
#
|
447
|
-
# Returns the Universal Symbol object specified by the ticker or the
|
443
|
+
# Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on "Yahoo Finance Market Coverage and Data Delays"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
448
444
|
#
|
449
|
-
# @param query [String] The ticker or
|
445
|
+
# @param query [String] The ticker or Universal Symbol ID to look up the symbol with.
|
450
446
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
451
447
|
def get_symbols_by_ticker_with_http_info(query:, extra: {})
|
452
448
|
get_symbols_by_ticker_with_http_info_impl(query, extra)
|
453
449
|
end
|
454
450
|
|
455
|
-
# Get
|
456
|
-
# Returns the Universal Symbol object specified by the ticker or the
|
457
|
-
# @param query [String] The ticker or
|
451
|
+
# Get symbol detail
|
452
|
+
# Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
453
|
+
# @param query [String] The ticker or Universal Symbol ID to look up the symbol with.
|
458
454
|
# @param [Hash] opts the optional parameters
|
459
455
|
# @return [UniversalSymbol]
|
460
456
|
private def get_symbols_by_ticker_impl(query, opts = {})
|
@@ -462,9 +458,9 @@ module SnapTrade
|
|
462
458
|
data
|
463
459
|
end
|
464
460
|
|
465
|
-
# Get
|
466
|
-
# Returns the Universal Symbol object specified by the ticker or the
|
467
|
-
# @param query [String] The ticker or
|
461
|
+
# Get symbol detail
|
462
|
+
# Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
463
|
+
# @param query [String] The ticker or Universal Symbol ID to look up the symbol with.
|
468
464
|
# @param [Hash] opts the optional parameters
|
469
465
|
# @return [Array<(UniversalSymbol, Integer, Hash)>] UniversalSymbol data, response status code and response headers
|
470
466
|
private def get_symbols_by_ticker_with_http_info_impl(query, opts = {})
|
@@ -484,7 +480,7 @@ module SnapTrade
|
|
484
480
|
# header parameters
|
485
481
|
header_params = opts[:header_params] || {}
|
486
482
|
# HTTP header 'Accept' (if needed)
|
487
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
483
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
488
484
|
|
489
485
|
# form parameters
|
490
486
|
form_params = opts[:form_params] || {}
|
@@ -831,16 +827,16 @@ module SnapTrade
|
|
831
827
|
end
|
832
828
|
|
833
829
|
|
834
|
-
# Search
|
830
|
+
# Search account symbols
|
835
831
|
#
|
836
|
-
# Returns a list of
|
837
|
-
#
|
838
|
-
#
|
832
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
833
|
+
#
|
834
|
+
# The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
839
835
|
#
|
840
836
|
# @param user_id [String]
|
841
837
|
# @param user_secret [String]
|
842
|
-
# @param account_id [String]
|
843
|
-
# @param substring [String]
|
838
|
+
# @param account_id [String]
|
839
|
+
# @param substring [String] The search query for symbols.
|
844
840
|
# @param body [SymbolQuery]
|
845
841
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
846
842
|
def symbol_search_user_account(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {})
|
@@ -851,16 +847,16 @@ module SnapTrade
|
|
851
847
|
data
|
852
848
|
end
|
853
849
|
|
854
|
-
# Search
|
850
|
+
# Search account symbols
|
855
851
|
#
|
856
|
-
# Returns a list of
|
857
|
-
#
|
858
|
-
#
|
852
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
853
|
+
#
|
854
|
+
# The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
859
855
|
#
|
860
856
|
# @param user_id [String]
|
861
857
|
# @param user_secret [String]
|
862
|
-
# @param account_id [String]
|
863
|
-
# @param substring [String]
|
858
|
+
# @param account_id [String]
|
859
|
+
# @param substring [String] The search query for symbols.
|
864
860
|
# @param body [SymbolQuery]
|
865
861
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
866
862
|
def symbol_search_user_account_with_http_info(user_id:, user_secret:, account_id:, substring: SENTINEL, extra: {})
|
@@ -870,11 +866,11 @@ module SnapTrade
|
|
870
866
|
symbol_search_user_account_with_http_info_impl(user_id, user_secret, account_id, extra)
|
871
867
|
end
|
872
868
|
|
873
|
-
# Search
|
874
|
-
# Returns a list of
|
869
|
+
# Search account symbols
|
870
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
875
871
|
# @param user_id [String]
|
876
872
|
# @param user_secret [String]
|
877
|
-
# @param account_id [String]
|
873
|
+
# @param account_id [String]
|
878
874
|
# @param [Hash] opts the optional parameters
|
879
875
|
# @option opts [SymbolQuery] :symbol_query
|
880
876
|
# @return [Array<UniversalSymbol>]
|
@@ -883,11 +879,11 @@ module SnapTrade
|
|
883
879
|
data
|
884
880
|
end
|
885
881
|
|
886
|
-
# Search
|
887
|
-
# Returns a list of
|
882
|
+
# Search account symbols
|
883
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
888
884
|
# @param user_id [String]
|
889
885
|
# @param user_secret [String]
|
890
|
-
# @param account_id [String]
|
886
|
+
# @param account_id [String]
|
891
887
|
# @param [Hash] opts the optional parameters
|
892
888
|
# @option opts [SymbolQuery] :symbol_query
|
893
889
|
# @return [Array<(Array<UniversalSymbol>, Integer, Hash)>] Array<UniversalSymbol> data, response status code and response headers
|
@@ -918,7 +914,7 @@ module SnapTrade
|
|
918
914
|
# header parameters
|
919
915
|
header_params = opts[:header_params] || {}
|
920
916
|
# HTTP header 'Accept' (if needed)
|
921
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
917
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
922
918
|
# HTTP header 'Content-Type'
|
923
919
|
content_type = @api_client.select_header_content_type(['application/json'])
|
924
920
|
if !content_type.nil?
|
@@ -410,7 +410,7 @@ module SnapTrade
|
|
410
410
|
|
411
411
|
# Place order
|
412
412
|
#
|
413
|
-
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
413
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
414
414
|
#
|
415
415
|
# This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
|
416
416
|
#
|
@@ -447,7 +447,7 @@ module SnapTrade
|
|
447
447
|
|
448
448
|
# Place order
|
449
449
|
#
|
450
|
-
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
450
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
451
451
|
#
|
452
452
|
# This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact).
|
453
453
|
#
|
@@ -482,7 +482,7 @@ module SnapTrade
|
|
482
482
|
end
|
483
483
|
|
484
484
|
# Place order
|
485
|
-
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
485
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It's recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
486
486
|
# @param user_id [String]
|
487
487
|
# @param user_secret [String]
|
488
488
|
# @param manual_trade_form [ManualTradeForm]
|
@@ -494,7 +494,7 @@ module SnapTrade
|
|
494
494
|
end
|
495
495
|
|
496
496
|
# Place order
|
497
|
-
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
497
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It's recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
498
498
|
# @param user_id [String]
|
499
499
|
# @param user_secret [String]
|
500
500
|
# @param manual_trade_form [ManualTradeForm]
|
@@ -12,11 +12,12 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
class ConnectionPortalVersion
|
15
|
-
|
15
|
+
V4 = "v4".freeze
|
16
16
|
V3 = "v3".freeze
|
17
|
+
V2 = "v2".freeze
|
17
18
|
|
18
19
|
def self.all_vars
|
19
|
-
@all_vars ||= [
|
20
|
+
@all_vars ||= [V4, V3, V2].freeze
|
20
21
|
end
|
21
22
|
|
22
23
|
# Builds the enum from string
|
@@ -15,7 +15,7 @@ module SnapTrade
|
|
15
15
|
class OptionsPosition
|
16
16
|
attr_accessor :symbol
|
17
17
|
|
18
|
-
# Last known market price
|
18
|
+
# Last known market price _per share_ of the option contract. The freshness of this price depends on the brokerage. Some brokerages provide real-time prices, while others provide delayed prices. It is recommended that you rely on your own third-party market data provider for most up to date prices.
|
19
19
|
attr_accessor :price
|
20
20
|
|
21
21
|
# The number of contracts for this option position. A positive number indicates a long position, while a negative number indicates a short position.
|
@@ -13,7 +13,7 @@ require 'time'
|
|
13
13
|
module SnapTrade
|
14
14
|
# A transaction or activity from an institution
|
15
15
|
class UniversalActivity
|
16
|
-
# Unique identifier for the transaction. This is the ID used to reference the transaction in SnapTrade.
|
16
|
+
# Unique identifier for the transaction. This is the ID used to reference the transaction in SnapTrade. Please note that this ID _can_ change if the transaction is deleted and re-added. Under normal circumstances, SnapTrade does not delete transactions. The only time this would happen is if SnapTrade re-fetches and reprocesses the data from the brokerage, which is rare. If you require a stable ID, please let us know and we can work with you to provide one.
|
17
17
|
attr_accessor :id
|
18
18
|
|
19
19
|
attr_accessor :account
|
data/lib/snaptrade/version.rb
CHANGED
@@ -73,8 +73,8 @@ describe 'ReferenceDataApi' do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
# unit tests for get_symbols
|
76
|
-
# Search
|
77
|
-
# Returns a list of Universal Symbol objects that match
|
76
|
+
# Search symbols
|
77
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned.
|
78
78
|
# @param [Hash] opts the optional parameters
|
79
79
|
# @option opts [SymbolQuery] :symbol_query
|
80
80
|
# @return [Array<UniversalSymbol>]
|
@@ -85,9 +85,9 @@ describe 'ReferenceDataApi' do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
# unit tests for get_symbols_by_ticker
|
88
|
-
# Get
|
89
|
-
# Returns the Universal Symbol object specified by the ticker or the
|
90
|
-
# @param query The ticker or
|
88
|
+
# Get symbol detail
|
89
|
+
# Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
90
|
+
# @param query The ticker or Universal Symbol ID to look up the symbol with.
|
91
91
|
# @param [Hash] opts the optional parameters
|
92
92
|
# @return [UniversalSymbol]
|
93
93
|
describe 'get_symbols_by_ticker test' do
|
@@ -142,11 +142,11 @@ describe 'ReferenceDataApi' do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
# unit tests for symbol_search_user_account
|
145
|
-
# Search
|
146
|
-
# Returns a list of
|
145
|
+
# Search account symbols
|
146
|
+
# Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
|
147
147
|
# @param user_id
|
148
148
|
# @param user_secret
|
149
|
-
# @param account_id
|
149
|
+
# @param account_id
|
150
150
|
# @param [Hash] opts the optional parameters
|
151
151
|
# @option opts [SymbolQuery] :symbol_query
|
152
152
|
# @return [Array<UniversalSymbol>]
|
@@ -74,7 +74,7 @@ describe 'TradingApi' do
|
|
74
74
|
|
75
75
|
# unit tests for place_force_order
|
76
76
|
# Place order
|
77
|
-
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
|
77
|
+
# Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It's recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
78
78
|
# @param user_id
|
79
79
|
# @param user_secret
|
80
80
|
# @param manual_trade_form
|
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: 2.0.
|
4
|
+
version: 2.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -355,125 +355,125 @@ signing_key:
|
|
355
355
|
specification_version: 4
|
356
356
|
summary: SnapTrade Ruby Gem
|
357
357
|
test_files:
|
358
|
-
- spec/api/reference_data_api_spec.rb
|
359
|
-
- spec/api/connections_api_spec.rb
|
360
|
-
- spec/api/api_status_api_spec.rb
|
361
358
|
- spec/api/trading_api_spec.rb
|
362
|
-
- spec/api/
|
363
|
-
- spec/api/options_api_spec.rb
|
359
|
+
- spec/api/connections_api_spec.rb
|
364
360
|
- spec/api/authentication_api_spec.rb
|
365
361
|
- spec/api/transactions_and_reporting_api_spec.rb
|
362
|
+
- spec/api/account_information_api_spec.rb
|
363
|
+
- spec/api/options_api_spec.rb
|
364
|
+
- spec/api/api_status_api_spec.rb
|
365
|
+
- spec/api/reference_data_api_spec.rb
|
366
366
|
- spec/api_client_spec.rb
|
367
367
|
- spec/configuration_spec.rb
|
368
368
|
- spec/getting_started_spec.rb
|
369
|
-
- spec/models/
|
370
|
-
- spec/models/
|
371
|
-
- spec/models/
|
372
|
-
- spec/models/
|
373
|
-
- spec/models/underlying_symbol_exchange_spec.rb
|
374
|
-
- spec/models/type_spec.rb
|
375
|
-
- spec/models/sub_period_return_rate_spec.rb
|
376
|
-
- spec/models/brokerage_spec.rb
|
377
|
-
- spec/models/underlying_symbol_spec.rb
|
369
|
+
- spec/models/validated_trade_body_spec.rb
|
370
|
+
- spec/models/connections_session_events200_response_inner_spec.rb
|
371
|
+
- spec/models/option_leg_spec.rb
|
372
|
+
- spec/models/currency_spec.rb
|
378
373
|
- spec/models/model404_failed_request_response_spec.rb
|
379
|
-
- spec/models/
|
380
|
-
- spec/models/
|
381
|
-
- spec/models/manual_trade_form_spec.rb
|
382
|
-
- spec/models/option_strategy_legs_inner_spec.rb
|
383
|
-
- spec/models/session_event_type_spec.rb
|
374
|
+
- spec/models/sub_period_return_rate_spec.rb
|
375
|
+
- spec/models/options_symbol_spec.rb
|
384
376
|
- spec/models/account_holdings_spec.rb
|
385
|
-
- spec/models/
|
386
|
-
- spec/models/
|
387
|
-
- spec/models/
|
388
|
-
- spec/models/
|
389
|
-
- spec/models/
|
390
|
-
- spec/models/net_dividend_spec.rb
|
391
|
-
- spec/models/manual_trade_balance_spec.rb
|
392
|
-
- spec/models/session_event_spec.rb
|
393
|
-
- spec/models/option_strategy_spec.rb
|
394
|
-
- spec/models/authentication_login_snap_trade_user200_response_spec.rb
|
395
|
-
- spec/models/partner_data_spec.rb
|
396
|
-
- spec/models/account_balance_total_spec.rb
|
397
|
-
- spec/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner_spec.rb
|
398
|
-
- spec/models/options_position_currency_spec.rb
|
399
|
-
- spec/models/universal_activity_spec.rb
|
400
|
-
- spec/models/symbol_figi_instrument_spec.rb
|
401
|
-
- spec/models/action_strict_spec.rb
|
402
|
-
- spec/models/options_position_spec.rb
|
403
|
-
- spec/models/balance_spec.rb
|
404
|
-
- spec/models/strategy_quotes_spec.rb
|
377
|
+
- spec/models/manual_trade_form_notional_value_spec.rb
|
378
|
+
- spec/models/brokerage_type_spec.rb
|
379
|
+
- spec/models/encrypted_response_spec.rb
|
380
|
+
- spec/models/account_order_record_spec.rb
|
381
|
+
- spec/models/snap_trade_register_user_request_body_spec.rb
|
405
382
|
- spec/models/dividend_at_date_spec.rb
|
406
|
-
- spec/models/net_contributions_spec.rb
|
407
|
-
- spec/models/model403_failed_request_response_spec.rb
|
408
|
-
- spec/models/currency_spec.rb
|
409
|
-
- spec/models/strategy_order_record_status_spec.rb
|
410
|
-
- spec/models/option_leg_spec.rb
|
411
|
-
- spec/models/login_redirect_uri_spec.rb
|
412
|
-
- spec/models/status_spec.rb
|
413
|
-
- spec/models/account_spec.rb
|
414
383
|
- spec/models/option_leg_action_spec.rb
|
384
|
+
- spec/models/manual_trade_impact_spec.rb
|
385
|
+
- spec/models/options_position_spec.rb
|
386
|
+
- spec/models/option_strategy_spec.rb
|
415
387
|
- spec/models/us_exchange_spec.rb
|
416
|
-
- spec/models/
|
417
|
-
- spec/models/
|
418
|
-
- spec/models/
|
419
|
-
- spec/models/symbol_spec.rb
|
420
|
-
- spec/models/underlying_symbol_type_spec.rb
|
421
|
-
- spec/models/security_type_spec.rb
|
388
|
+
- spec/models/model402_brokerage_auth_disabled_response_spec.rb
|
389
|
+
- spec/models/manual_trade_balance_spec.rb
|
390
|
+
- spec/models/login_redirect_uri_spec.rb
|
422
391
|
- spec/models/account_order_record_option_symbol_spec.rb
|
423
|
-
- spec/models/
|
424
|
-
- spec/models/
|
425
|
-
- spec/models/account_balance_spec.rb
|
426
|
-
- spec/models/validated_trade_body_spec.rb
|
392
|
+
- spec/models/account_order_record_universal_symbol_spec.rb
|
393
|
+
- spec/models/option_chain_inner_chain_per_root_inner_spec.rb
|
427
394
|
- spec/models/brokerage_authorization_refresh_confirmation_spec.rb
|
428
|
-
- spec/models/options_symbol_spec.rb
|
429
|
-
- spec/models/exchange_rate_pairs_spec.rb
|
430
|
-
- spec/models/manual_trade_impact_spec.rb
|
431
|
-
- spec/models/manual_trade_and_impact_spec.rb
|
432
|
-
- spec/models/auth_type_spec.rb
|
433
|
-
- spec/models/model500_unexpected_exception_response_spec.rb
|
434
|
-
- spec/models/symbol_exchange_spec.rb
|
435
|
-
- spec/models/brokerage_authorization_type_read_only_spec.rb
|
436
395
|
- spec/models/manual_trade_symbol_spec.rb
|
437
|
-
- spec/models/
|
438
|
-
- spec/models/model403_feature_not_enabled_response_spec.rb
|
439
|
-
- spec/models/manual_trade_spec.rb
|
440
|
-
- spec/models/account_order_record_spec.rb
|
441
|
-
- spec/models/trading_cancel_user_account_order_request_spec.rb
|
442
|
-
- spec/models/manual_trade_form_notional_value_spec.rb
|
443
|
-
- spec/models/order_type_strict_spec.rb
|
444
|
-
- spec/models/notional_value_spec.rb
|
445
|
-
- spec/models/brokerage_authorization_disabled_confirmation_spec.rb
|
446
|
-
- spec/models/universal_activity_symbol_spec.rb
|
447
|
-
- spec/models/universal_activity_option_symbol_spec.rb
|
448
|
-
- spec/models/option_type_spec.rb
|
396
|
+
- spec/models/account_spec.rb
|
449
397
|
- spec/models/snap_trade_holdings_total_value_spec.rb
|
450
|
-
- spec/models/
|
451
|
-
- spec/models/
|
452
|
-
- spec/models/
|
453
|
-
- spec/models/
|
454
|
-
- spec/models/
|
398
|
+
- spec/models/account_simple_spec.rb
|
399
|
+
- spec/models/option_chain_inner_spec.rb
|
400
|
+
- spec/models/brokerage_authorization_type_read_only_spec.rb
|
401
|
+
- spec/models/snap_trade_login_user_request_body_spec.rb
|
402
|
+
- spec/models/strategy_quotes_spec.rb
|
403
|
+
- spec/models/net_dividend_spec.rb
|
404
|
+
- spec/models/symbol_query_spec.rb
|
405
|
+
- spec/models/authentication_login_snap_trade_user200_response_spec.rb
|
406
|
+
- spec/models/brokerage_authorization_spec.rb
|
407
|
+
- spec/models/connection_type_spec.rb
|
408
|
+
- spec/models/model403_failed_request_response_spec.rb
|
409
|
+
- spec/models/universal_activity_spec.rb
|
410
|
+
- spec/models/manual_trade_form_spec.rb
|
411
|
+
- spec/models/snap_trade_holdings_account_spec.rb
|
455
412
|
- spec/models/position_spec.rb
|
456
|
-
- spec/models/
|
413
|
+
- spec/models/trading_cancel_user_account_order_request_spec.rb
|
414
|
+
- spec/models/symbols_quotes_inner_spec.rb
|
457
415
|
- spec/models/model402_brokerage_auth_already_disabled_exception_spec.rb
|
458
|
-
- spec/models/
|
459
|
-
- spec/models/
|
460
|
-
- spec/models/
|
461
|
-
- spec/models/
|
416
|
+
- spec/models/options_place_option_strategy_request_spec.rb
|
417
|
+
- spec/models/account_balance_spec.rb
|
418
|
+
- spec/models/universal_activity_symbol_spec.rb
|
419
|
+
- spec/models/partner_data_spec.rb
|
420
|
+
- spec/models/action_strict_spec.rb
|
421
|
+
- spec/models/model401_failed_request_response_spec.rb
|
422
|
+
- spec/models/symbol_spec.rb
|
423
|
+
- spec/models/options_position_currency_spec.rb
|
424
|
+
- spec/models/option_type_spec.rb
|
425
|
+
- spec/models/holdings_status_spec.rb
|
426
|
+
- spec/models/session_event_type_spec.rb
|
462
427
|
- spec/models/figi_instrument_spec.rb
|
463
|
-
- spec/models/
|
464
|
-
- spec/models/
|
465
|
-
- spec/models/
|
466
|
-
- spec/models/
|
467
|
-
- spec/models/
|
428
|
+
- spec/models/model403_feature_not_enabled_response_spec.rb
|
429
|
+
- spec/models/net_contributions_spec.rb
|
430
|
+
- spec/models/auth_type_spec.rb
|
431
|
+
- spec/models/strategy_type_spec.rb
|
432
|
+
- spec/models/manual_trade_spec.rb
|
433
|
+
- spec/models/underlying_symbol_exchange_spec.rb
|
468
434
|
- spec/models/account_order_record_status_spec.rb
|
469
|
-
- spec/models/
|
470
|
-
- spec/models/
|
435
|
+
- spec/models/exchange_rate_pairs_spec.rb
|
436
|
+
- spec/models/symbol_figi_instrument_spec.rb
|
471
437
|
- spec/models/delete_user_response_spec.rb
|
472
|
-
- spec/models/
|
473
|
-
- spec/models/
|
474
|
-
- spec/models/
|
438
|
+
- spec/models/brokerage_authorization_disabled_confirmation_spec.rb
|
439
|
+
- spec/models/order_type_strict_spec.rb
|
440
|
+
- spec/models/options_get_option_strategy_request_spec.rb
|
475
441
|
- spec/models/option_brokerage_symbol_spec.rb
|
476
|
-
- spec/models/
|
442
|
+
- spec/models/option_chain_inner_chain_per_root_inner_chain_per_strike_price_inner_spec.rb
|
443
|
+
- spec/models/account_sync_status_spec.rb
|
444
|
+
- spec/models/universal_activity_option_symbol_spec.rb
|
445
|
+
- spec/models/model500_unexpected_exception_response_spec.rb
|
446
|
+
- spec/models/manual_trade_and_impact_spec.rb
|
447
|
+
- spec/models/connection_portal_version_spec.rb
|
448
|
+
- spec/models/underlying_symbol_type_spec.rb
|
449
|
+
- spec/models/balance_spec.rb
|
450
|
+
- spec/models/universal_activity_currency_spec.rb
|
451
|
+
- spec/models/type_spec.rb
|
452
|
+
- spec/models/symbol_exchange_spec.rb
|
453
|
+
- spec/models/exchange_spec.rb
|
454
|
+
- spec/models/symbol_currency_spec.rb
|
455
|
+
- spec/models/position_symbol_spec.rb
|
456
|
+
- spec/models/performance_custom_spec.rb
|
457
|
+
- spec/models/status_spec.rb
|
458
|
+
- spec/models/brokerage_spec.rb
|
459
|
+
- spec/models/strategy_order_record_status_spec.rb
|
460
|
+
- spec/models/monthly_dividends_spec.rb
|
461
|
+
- spec/models/strategy_order_record_spec.rb
|
462
|
+
- spec/models/time_in_force_strict_spec.rb
|
477
463
|
- spec/models/model400_failed_request_response_spec.rb
|
464
|
+
- spec/models/past_value_spec.rb
|
465
|
+
- spec/models/encrypted_response_encrypted_message_data_spec.rb
|
478
466
|
- spec/models/account_holdings_account_spec.rb
|
467
|
+
- spec/models/option_strategy_legs_inner_spec.rb
|
468
|
+
- spec/models/account_balance_total_spec.rb
|
469
|
+
- spec/models/transactions_status_spec.rb
|
470
|
+
- spec/models/security_type_spec.rb
|
471
|
+
- spec/models/balance_currency_spec.rb
|
472
|
+
- spec/models/session_event_spec.rb
|
473
|
+
- spec/models/brokerage_authorization_type_read_only_brokerage_spec.rb
|
474
|
+
- spec/models/notional_value_spec.rb
|
475
|
+
- spec/models/user_i_dand_secret_spec.rb
|
476
|
+
- spec/models/universal_symbol_spec.rb
|
477
|
+
- spec/models/underlying_symbol_spec.rb
|
478
|
+
- spec/models/strategy_quotes_greek_spec.rb
|
479
479
|
- spec/spec_helper.rb
|