snaptrade 1.16.3 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -20
- data/README.md +5 -5
- data/docs/AccountHoldings.md +2 -2
- data/docs/AccountHoldingsAccount.md +2 -2
- data/docs/AccountInformationApi.md +64 -64
- data/docs/AccountOrderRecord.md +2 -2
- data/docs/AuthenticationApi.md +32 -32
- data/docs/Balance.md +1 -1
- data/docs/Brokerage.md +1 -1
- data/docs/BrokerageAuthorization.md +1 -1
- data/docs/BrokerageAuthorizationTypeReadOnly.md +1 -1
- data/docs/BrokerageSymbol.md +1 -1
- data/docs/BrokerageSymbolOptionSymbol.md +1 -1
- data/docs/BrokerageSymbolSymbol.md +7 -7
- data/docs/ConnectionsApi.md +30 -30
- data/docs/EncryptedResponse.md +1 -1
- data/docs/ErrorLogsApi.md +6 -6
- data/docs/ExchangeRatePairs.md +2 -2
- data/docs/ExcludedAsset.md +1 -1
- data/docs/ManualTrade.md +1 -1
- data/docs/ManualTradeAndImpact.md +2 -2
- data/docs/ManualTradeBalance.md +2 -2
- data/docs/ManualTradeSymbol.md +1 -1
- data/docs/ModelAssetClassDetails.md +1 -1
- data/docs/ModelAssetClassTarget.md +1 -1
- data/docs/ModelPortfolioAssetClass.md +1 -1
- data/docs/ModelPortfolioDetails.md +1 -1
- data/docs/ModelPortfolioSecurity.md +1 -1
- data/docs/MonthlyDividends.md +1 -1
- data/docs/NetContributions.md +1 -1
- data/docs/NetDividend.md +1 -1
- data/docs/OptionStrategy.md +1 -1
- data/docs/OptionsApi.md +58 -58
- data/docs/OptionsHoldings.md +2 -2
- data/docs/OptionsPosition.md +1 -1
- data/docs/OptionsSymbol.md +1 -1
- data/docs/PastValue.md +1 -1
- data/docs/PerformanceCustom.md +1 -1
- data/docs/PortfolioGroupInfo.md +1 -1
- data/docs/PortfolioGroupPosition.md +1 -1
- data/docs/PortfolioGroupSettings.md +1 -1
- data/docs/Position.md +1 -1
- data/docs/PositionSymbol.md +1 -1
- data/docs/ReferenceDataApi.md +28 -28
- data/docs/SnapTradeHoldingsAccount.md +1 -1
- data/docs/StrategyOrderRecord.md +1 -1
- data/docs/StrategyQuotes.md +2 -2
- data/docs/SubPeriodReturnRate.md +2 -2
- data/docs/Symbol.md +3 -3
- data/docs/SymbolsQuotesInner.md +1 -1
- data/docs/TargetAsset.md +1 -1
- data/docs/Trade.md +3 -3
- data/docs/TradeExecutionStatus.md +3 -3
- data/docs/TradeImpact.md +2 -2
- data/docs/TradingApi.md +84 -84
- data/docs/TransactionsAndReportingApi.md +32 -32
- data/docs/TransactionsStatus.md +1 -1
- data/docs/UnderlyingSymbol.md +3 -3
- data/docs/UniversalActivity.md +5 -5
- data/docs/UniversalSymbol.md +7 -7
- data/docs/UniversalSymbolTicker.md +3 -3
- data/docs/UserSettings.md +1 -1
- data/header.png +0 -0
- data/lib/snaptrade/api/account_information_api.rb +0 -16
- data/lib/snaptrade/api/api_status_api.rb +0 -2
- data/lib/snaptrade/api/authentication_api.rb +0 -10
- data/lib/snaptrade/api/connections_api.rb +0 -8
- data/lib/snaptrade/api/error_logs_api.rb +0 -2
- data/lib/snaptrade/api/options_api.rb +0 -10
- data/lib/snaptrade/api/reference_data_api.rb +0 -22
- data/lib/snaptrade/api/trading_api.rb +0 -12
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +0 -4
- data/lib/snaptrade/models/brokerage_symbol_symbol.rb +30 -0
- data/lib/snaptrade/models/universal_activity.rb +1 -1
- data/lib/snaptrade/models/universal_symbol.rb +30 -0
- data/lib/snaptrade/version.rb +1 -1
- metadata +4 -3
data/docs/ReferenceDataApi.md
CHANGED
@@ -33,8 +33,8 @@ currency_pair = "currencyPair_example"
|
|
33
33
|
begin
|
34
34
|
# Return the exchange rate of a currency pair
|
35
35
|
result = SnapTrade::ReferenceData.get_currency_exchange_rate_pair(
|
36
|
-
|
37
|
-
|
36
|
+
currency_pair: currency_pair,
|
37
|
+
)
|
38
38
|
p result
|
39
39
|
rescue SnapTrade::ApiError => e
|
40
40
|
puts "Exception when calling SnapTrade::ReferenceData.get_currency_exchange_rate_pair: #{e}"
|
@@ -51,8 +51,8 @@ currency_pair = "currencyPair_example"
|
|
51
51
|
begin
|
52
52
|
# Return the exchange rate of a currency pair
|
53
53
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_currency_exchange_rate_pair_with_http_info(
|
54
|
-
|
55
|
-
|
54
|
+
currency_pair: currency_pair,
|
55
|
+
)
|
56
56
|
p status_code # => 2xx
|
57
57
|
p headers # => { ... }
|
58
58
|
p data # => ExchangeRatePairs
|
@@ -229,8 +229,8 @@ substring = "apple"
|
|
229
229
|
begin
|
230
230
|
# Search for symbols
|
231
231
|
result = SnapTrade::ReferenceData.get_symbols(
|
232
|
-
|
233
|
-
|
232
|
+
substring: substring,
|
233
|
+
)
|
234
234
|
p result
|
235
235
|
rescue SnapTrade::ApiError => e
|
236
236
|
puts "Exception when calling SnapTrade::ReferenceData.get_symbols: #{e}"
|
@@ -247,8 +247,8 @@ substring = "apple"
|
|
247
247
|
begin
|
248
248
|
# Search for symbols
|
249
249
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_symbols_with_http_info(
|
250
|
-
|
251
|
-
|
250
|
+
substring: substring,
|
251
|
+
)
|
252
252
|
p status_code # => 2xx
|
253
253
|
p headers # => { ... }
|
254
254
|
p data # => Array<UniversalSymbol>
|
@@ -285,9 +285,9 @@ symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
|
|
285
285
|
begin
|
286
286
|
# Get details of a symbol by the ticker
|
287
287
|
result = SnapTrade::ReferenceData.get_symbols_by_ticker(
|
288
|
-
|
289
|
-
|
290
|
-
|
288
|
+
ticker: ticker,
|
289
|
+
symbol_id: symbol_id,
|
290
|
+
)
|
291
291
|
p result
|
292
292
|
rescue SnapTrade::ApiError => e
|
293
293
|
puts "Exception when calling SnapTrade::ReferenceData.get_symbols_by_ticker: #{e}"
|
@@ -305,9 +305,9 @@ symbol_id = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
|
|
305
305
|
begin
|
306
306
|
# Get details of a symbol by the ticker
|
307
307
|
data, status_code, headers, response = SnapTrade::ReferenceData.get_symbols_by_ticker_with_http_info(
|
308
|
-
|
309
|
-
|
310
|
-
|
308
|
+
ticker: ticker,
|
309
|
+
symbol_id: symbol_id,
|
310
|
+
)
|
311
311
|
p status_code # => 2xx
|
312
312
|
p headers # => { ... }
|
313
313
|
p data # => UniversalSymbol
|
@@ -344,8 +344,8 @@ brokerage = "QUESTRADE,ALPACA"
|
|
344
344
|
begin
|
345
345
|
# List of all brokerage authorization types
|
346
346
|
result = SnapTrade::ReferenceData.list_all_brokerage_authorization_type(
|
347
|
-
|
348
|
-
|
347
|
+
brokerage: brokerage,
|
348
|
+
)
|
349
349
|
p result
|
350
350
|
rescue SnapTrade::ApiError => e
|
351
351
|
puts "Exception when calling SnapTrade::ReferenceData.list_all_brokerage_authorization_type: #{e}"
|
@@ -362,8 +362,8 @@ brokerage = "QUESTRADE,ALPACA"
|
|
362
362
|
begin
|
363
363
|
# List of all brokerage authorization types
|
364
364
|
data, status_code, headers, response = SnapTrade::ReferenceData.list_all_brokerage_authorization_type_with_http_info(
|
365
|
-
|
366
|
-
|
365
|
+
brokerage: brokerage,
|
366
|
+
)
|
367
367
|
p status_code # => 2xx
|
368
368
|
p headers # => { ... }
|
369
369
|
p data # => Array<BrokerageAuthorizationTypeReadOnly>
|
@@ -543,11 +543,11 @@ substring = "apple"
|
|
543
543
|
begin
|
544
544
|
# Search for symbols available in an account
|
545
545
|
result = SnapTrade::ReferenceData.symbol_search_user_account(
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
546
|
+
user_id: user_id,
|
547
|
+
user_secret: user_secret,
|
548
|
+
account_id: account_id,
|
549
|
+
substring: substring,
|
550
|
+
)
|
551
551
|
p result
|
552
552
|
rescue SnapTrade::ApiError => e
|
553
553
|
puts "Exception when calling SnapTrade::ReferenceData.symbol_search_user_account: #{e}"
|
@@ -567,11 +567,11 @@ substring = "apple"
|
|
567
567
|
begin
|
568
568
|
# Search for symbols available in an account
|
569
569
|
data, status_code, headers, response = SnapTrade::ReferenceData.symbol_search_user_account_with_http_info(
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
570
|
+
user_id: user_id,
|
571
|
+
user_secret: user_secret,
|
572
|
+
account_id: account_id,
|
573
|
+
substring: substring,
|
574
|
+
)
|
575
575
|
p status_code # => 2xx
|
576
576
|
p headers # => { ... }
|
577
577
|
p data # => Array<UniversalSymbol>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **id** | **String** | | [optional] |
|
8
|
-
| **brokerage_authorization** |
|
8
|
+
| **brokerage_authorization** | **BrokerageAuthorization** | | [optional] |
|
9
9
|
| **portfolio_group** | **String** | | [optional] |
|
10
10
|
| **name** | **String** | | [optional] |
|
11
11
|
| **number** | **String** | | [optional] |
|
data/docs/StrategyOrderRecord.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **strategy** |
|
7
|
+
| **strategy** | **OptionStrategy** | | [optional] |
|
8
8
|
| **status** | [**StrategyOrderRecordStatus**](StrategyOrderRecordStatus.md) | | [optional] |
|
9
9
|
| **filled_quantity** | **Float** | | [optional] |
|
10
10
|
| **open_quantity** | **Float** | | [optional] |
|
data/docs/StrategyQuotes.md
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **strategy** |
|
7
|
+
| **strategy** | **OptionStrategy** | | [optional] |
|
8
8
|
| **open_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
9
9
|
| **bid_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
10
10
|
| **ask_price** | **Float** | Trade Price if limit or stop limit order | [optional] |
|
11
11
|
| **volatility** | **Float** | | [optional] |
|
12
|
-
| **greek** |
|
12
|
+
| **greek** | **StrategyQuotesGreek** | | [optional] |
|
13
13
|
|
14
14
|
## Example
|
15
15
|
|
data/docs/SubPeriodReturnRate.md
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
require 'snaptrade'
|
15
15
|
|
16
16
|
instance = SnapTrade::SubPeriodReturnRate.new(
|
17
|
-
period_start:
|
18
|
-
period_end:
|
17
|
+
period_start: Sun Jan 23 16:00:00 PST 2022,
|
18
|
+
period_end: Sun Jan 23 16:00:00 PST 2022,
|
19
19
|
rate_of_return: 0.012312367452
|
20
20
|
)
|
21
21
|
```
|
data/docs/Symbol.md
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
| **symbol** | **String** | | [optional] |
|
9
9
|
| **raw_symbol** | **String** | | [optional] |
|
10
10
|
| **name** | **String** | | [optional] |
|
11
|
-
| **currency** |
|
12
|
-
| **exchange** |
|
13
|
-
| **type** |
|
11
|
+
| **currency** | **Currency** | | [optional] |
|
12
|
+
| **exchange** | **Exchange** | | [optional] |
|
13
|
+
| **type** | **SecurityType** | | [optional] |
|
14
14
|
|
15
15
|
## Example
|
16
16
|
|
data/docs/SymbolsQuotesInner.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **symbol** |
|
7
|
+
| **symbol** | **UniversalSymbol** | | [optional] |
|
8
8
|
| **bid_price** | **Float** | | [optional] |
|
9
9
|
| **ask_price** | **Float** | | [optional] |
|
10
10
|
| **last_trade_price** | **Float** | | [optional] |
|
data/docs/TargetAsset.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **id** | **String** | | [optional] |
|
8
|
-
| **symbol** |
|
8
|
+
| **symbol** | **UniversalSymbol** | | [optional] |
|
9
9
|
| **percent** | **Float** | | [optional] |
|
10
10
|
| **is_supported** | **Boolean** | | [optional] |
|
11
11
|
| **is_excluded** | **Boolean** | | [optional] |
|
data/docs/Trade.md
CHANGED
@@ -5,9 +5,9 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **id** | **String** | | [optional] |
|
8
|
-
| **account** |
|
9
|
-
| **symbol** |
|
10
|
-
| **universal_symbol** |
|
8
|
+
| **account** | **Account** | | [optional] |
|
9
|
+
| **symbol** | **BrokerageSymbol** | | [optional] |
|
10
|
+
| **universal_symbol** | **UniversalSymbol** | | [optional] |
|
11
11
|
| **action** | [**TradeAction**](TradeAction.md) | | [optional] |
|
12
12
|
| **units** | **Integer** | | [optional] |
|
13
13
|
| **price** | **Float** | | [optional] |
|
@@ -4,9 +4,9 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **symbol** |
|
8
|
-
| **universal_symbol** |
|
9
|
-
| **trade** |
|
7
|
+
| **symbol** | **BrokerageSymbol** | | [optional] |
|
8
|
+
| **universal_symbol** | **UniversalSymbol** | | [optional] |
|
9
|
+
| **trade** | **Trade** | | [optional] |
|
10
10
|
| **state** | [**State**](State.md) | | [optional] |
|
11
11
|
| **filled_units** | **Integer** | Number of filled units | [optional] |
|
12
12
|
| **action** | [**TradeExecutionStatusAction**](TradeExecutionStatusAction.md) | | [optional] |
|
data/docs/TradeImpact.md
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **account** |
|
8
|
-
| **currency** |
|
7
|
+
| **account** | **Account** | | [optional] |
|
8
|
+
| **currency** | **Currency** | | [optional] |
|
9
9
|
| **remaining_cash** | **Float** | Remaining balance after executing all trades | [optional] |
|
10
10
|
| **estimated_commissions** | **Float** | Total estimated commissions across all trades to make | [optional] |
|
11
11
|
| **forex_fees** | **Float** | Estimated forex fees to pay to excute trades | [optional] |
|
data/docs/TradingApi.md
CHANGED
@@ -31,11 +31,11 @@ brokerage_order_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
31
31
|
begin
|
32
32
|
# Cancel open order in account
|
33
33
|
result = SnapTrade::Trading.cancel_user_account_order(
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
user_id: user_id,
|
35
|
+
user_secret: user_secret,
|
36
|
+
account_id: account_id,
|
37
|
+
brokerage_order_id: brokerage_order_id,
|
38
|
+
)
|
39
39
|
p result
|
40
40
|
rescue SnapTrade::ApiError => e
|
41
41
|
puts "Exception when calling SnapTrade::Trading.cancel_user_account_order: #{e}"
|
@@ -55,11 +55,11 @@ brokerage_order_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
55
55
|
begin
|
56
56
|
# Cancel open order in account
|
57
57
|
data, status_code, headers, response = SnapTrade::Trading.cancel_user_account_order_with_http_info(
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
user_id: user_id,
|
59
|
+
user_secret: user_secret,
|
60
|
+
account_id: account_id,
|
61
|
+
brokerage_order_id: brokerage_order_id,
|
62
|
+
)
|
63
63
|
p status_code # => 2xx
|
64
64
|
p headers # => { ... }
|
65
65
|
p data # => AccountOrderRecord
|
@@ -107,17 +107,17 @@ universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
107
107
|
begin
|
108
108
|
# Check impact of trades on account.
|
109
109
|
result = SnapTrade::Trading.get_order_impact(
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
110
|
+
user_id: user_id,
|
111
|
+
user_secret: user_secret,
|
112
|
+
account_id: account_id,
|
113
|
+
action: action,
|
114
|
+
order_type: order_type,
|
115
|
+
price: price,
|
116
|
+
stop: stop,
|
117
|
+
time_in_force: time_in_force,
|
118
|
+
units: units,
|
119
|
+
universal_symbol_id: universal_symbol_id,
|
120
|
+
)
|
121
121
|
p result
|
122
122
|
rescue SnapTrade::ApiError => e
|
123
123
|
puts "Exception when calling SnapTrade::Trading.get_order_impact: #{e}"
|
@@ -143,17 +143,17 @@ universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
143
143
|
begin
|
144
144
|
# Check impact of trades on account.
|
145
145
|
data, status_code, headers, response = SnapTrade::Trading.get_order_impact_with_http_info(
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
146
|
+
user_id: user_id,
|
147
|
+
user_secret: user_secret,
|
148
|
+
account_id: account_id,
|
149
|
+
action: action,
|
150
|
+
order_type: order_type,
|
151
|
+
price: price,
|
152
|
+
stop: stop,
|
153
|
+
time_in_force: time_in_force,
|
154
|
+
units: units,
|
155
|
+
universal_symbol_id: universal_symbol_id,
|
156
|
+
)
|
157
157
|
p status_code # => 2xx
|
158
158
|
p headers # => { ... }
|
159
159
|
p data # => ManualTradeAndImpact
|
@@ -195,12 +195,12 @@ use_ticker = True
|
|
195
195
|
begin
|
196
196
|
# Get symbol quotes
|
197
197
|
result = SnapTrade::Trading.get_user_account_quotes(
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
198
|
+
user_id: user_id,
|
199
|
+
user_secret: user_secret,
|
200
|
+
symbols: symbols,
|
201
|
+
account_id: account_id,
|
202
|
+
use_ticker: use_ticker,
|
203
|
+
)
|
204
204
|
p result
|
205
205
|
rescue SnapTrade::ApiError => e
|
206
206
|
puts "Exception when calling SnapTrade::Trading.get_user_account_quotes: #{e}"
|
@@ -221,12 +221,12 @@ use_ticker = True
|
|
221
221
|
begin
|
222
222
|
# Get symbol quotes
|
223
223
|
data, status_code, headers, response = SnapTrade::Trading.get_user_account_quotes_with_http_info(
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
224
|
+
user_id: user_id,
|
225
|
+
user_secret: user_secret,
|
226
|
+
symbols: symbols,
|
227
|
+
account_id: account_id,
|
228
|
+
use_ticker: use_ticker,
|
229
|
+
)
|
230
230
|
p status_code # => 2xx
|
231
231
|
p headers # => { ... }
|
232
232
|
p data # => Array<SymbolsQuotesInner>
|
@@ -275,17 +275,17 @@ universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
275
275
|
begin
|
276
276
|
# Place a trade with NO validation.
|
277
277
|
result = SnapTrade::Trading.place_force_order(
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
278
|
+
user_id: user_id,
|
279
|
+
user_secret: user_secret,
|
280
|
+
account_id: account_id,
|
281
|
+
action: action,
|
282
|
+
order_type: order_type,
|
283
|
+
price: price,
|
284
|
+
stop: stop,
|
285
|
+
time_in_force: time_in_force,
|
286
|
+
units: units,
|
287
|
+
universal_symbol_id: universal_symbol_id,
|
288
|
+
)
|
289
289
|
p result
|
290
290
|
rescue SnapTrade::ApiError => e
|
291
291
|
puts "Exception when calling SnapTrade::Trading.place_force_order: #{e}"
|
@@ -311,17 +311,17 @@ universal_symbol_id = "2bcd7cc3-e922-4976-bce1-9858296801c3"
|
|
311
311
|
begin
|
312
312
|
# Place a trade with NO validation.
|
313
313
|
data, status_code, headers, response = SnapTrade::Trading.place_force_order_with_http_info(
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
314
|
+
user_id: user_id,
|
315
|
+
user_secret: user_secret,
|
316
|
+
account_id: account_id,
|
317
|
+
action: action,
|
318
|
+
order_type: order_type,
|
319
|
+
price: price,
|
320
|
+
stop: stop,
|
321
|
+
time_in_force: time_in_force,
|
322
|
+
units: units,
|
323
|
+
universal_symbol_id: universal_symbol_id,
|
324
|
+
)
|
325
325
|
p status_code # => 2xx
|
326
326
|
p headers # => { ... }
|
327
327
|
p data # => AccountOrderRecord
|
@@ -362,11 +362,11 @@ second_trade_id = None
|
|
362
362
|
begin
|
363
363
|
# Place a OCO (One Cancels Other) order
|
364
364
|
result = SnapTrade::Trading.place_oco_order(
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
365
|
+
user_id: user_id,
|
366
|
+
user_secret: user_secret,
|
367
|
+
first_trade_id: first_trade_id,
|
368
|
+
second_trade_id: second_trade_id,
|
369
|
+
)
|
370
370
|
p result
|
371
371
|
rescue SnapTrade::ApiError => e
|
372
372
|
puts "Exception when calling SnapTrade::Trading.place_oco_order: #{e}"
|
@@ -386,11 +386,11 @@ second_trade_id = None
|
|
386
386
|
begin
|
387
387
|
# Place a OCO (One Cancels Other) order
|
388
388
|
data, status_code, headers, response = SnapTrade::Trading.place_oco_order_with_http_info(
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
389
|
+
user_id: user_id,
|
390
|
+
user_secret: user_secret,
|
391
|
+
first_trade_id: first_trade_id,
|
392
|
+
second_trade_id: second_trade_id,
|
393
|
+
)
|
394
394
|
p status_code # => 2xx
|
395
395
|
p headers # => { ... }
|
396
396
|
p data # => AccountOrderRecord
|
@@ -430,10 +430,10 @@ user_secret = "USERSECRET123"
|
|
430
430
|
begin
|
431
431
|
# Place order
|
432
432
|
result = SnapTrade::Trading.place_order(
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
433
|
+
trade_id: trade_id,
|
434
|
+
user_id: user_id,
|
435
|
+
user_secret: user_secret,
|
436
|
+
)
|
437
437
|
p result
|
438
438
|
rescue SnapTrade::ApiError => e
|
439
439
|
puts "Exception when calling SnapTrade::Trading.place_order: #{e}"
|
@@ -452,10 +452,10 @@ user_secret = "USERSECRET123"
|
|
452
452
|
begin
|
453
453
|
# Place order
|
454
454
|
data, status_code, headers, response = SnapTrade::Trading.place_order_with_http_info(
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
455
|
+
trade_id: trade_id,
|
456
|
+
user_id: user_id,
|
457
|
+
user_secret: user_secret,
|
458
|
+
)
|
459
459
|
p status_code # => 2xx
|
460
460
|
p headers # => { ... }
|
461
461
|
p data # => AccountOrderRecord
|
@@ -32,14 +32,14 @@ type = "DIVIDEND"
|
|
32
32
|
begin
|
33
33
|
# Get transaction history for a user
|
34
34
|
result = SnapTrade::TransactionsAndReporting.get_activities(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
user_id: user_id,
|
36
|
+
user_secret: user_secret,
|
37
|
+
start_date: start_date,
|
38
|
+
end_date: end_date,
|
39
|
+
accounts: accounts,
|
40
|
+
brokerage_authorizations: brokerage_authorizations,
|
41
|
+
type: type,
|
42
|
+
)
|
43
43
|
p result
|
44
44
|
rescue SnapTrade::ApiError => e
|
45
45
|
puts "Exception when calling SnapTrade::TransactionsAndReporting.get_activities: #{e}"
|
@@ -62,14 +62,14 @@ type = "DIVIDEND"
|
|
62
62
|
begin
|
63
63
|
# Get transaction history for a user
|
64
64
|
data, status_code, headers, response = SnapTrade::TransactionsAndReporting.get_activities_with_http_info(
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
user_id: user_id,
|
66
|
+
user_secret: user_secret,
|
67
|
+
start_date: start_date,
|
68
|
+
end_date: end_date,
|
69
|
+
accounts: accounts,
|
70
|
+
brokerage_authorizations: brokerage_authorizations,
|
71
|
+
type: type,
|
72
|
+
)
|
73
73
|
p status_code # => 2xx
|
74
74
|
p headers # => { ... }
|
75
75
|
p data # => Array<UniversalActivity>
|
@@ -119,14 +119,14 @@ frequency = "monthly"
|
|
119
119
|
begin
|
120
120
|
# Get performance information for a specific timeframe
|
121
121
|
result = SnapTrade::TransactionsAndReporting.get_reporting_custom_range(
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
122
|
+
start_date: start_date,
|
123
|
+
end_date: end_date,
|
124
|
+
user_id: user_id,
|
125
|
+
user_secret: user_secret,
|
126
|
+
accounts: accounts,
|
127
|
+
detailed: detailed,
|
128
|
+
frequency: frequency,
|
129
|
+
)
|
130
130
|
p result
|
131
131
|
rescue SnapTrade::ApiError => e
|
132
132
|
puts "Exception when calling SnapTrade::TransactionsAndReporting.get_reporting_custom_range: #{e}"
|
@@ -149,14 +149,14 @@ frequency = "monthly"
|
|
149
149
|
begin
|
150
150
|
# Get performance information for a specific timeframe
|
151
151
|
data, status_code, headers, response = SnapTrade::TransactionsAndReporting.get_reporting_custom_range_with_http_info(
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
152
|
+
start_date: start_date,
|
153
|
+
end_date: end_date,
|
154
|
+
user_id: user_id,
|
155
|
+
user_secret: user_secret,
|
156
|
+
accounts: accounts,
|
157
|
+
detailed: detailed,
|
158
|
+
frequency: frequency,
|
159
|
+
)
|
160
160
|
p status_code # => 2xx
|
161
161
|
p headers # => { ... }
|
162
162
|
p data # => PerformanceCustom
|
data/docs/TransactionsStatus.md
CHANGED
data/docs/UnderlyingSymbol.md
CHANGED
@@ -7,9 +7,9 @@
|
|
7
7
|
| **id** | **String** | | [optional] |
|
8
8
|
| **symbol** | **String** | | [optional] |
|
9
9
|
| **description** | **String** | | [optional] |
|
10
|
-
| **currency** |
|
11
|
-
| **exchange** |
|
12
|
-
| **type** |
|
10
|
+
| **currency** | **Currency** | | [optional] |
|
11
|
+
| **exchange** | **USExchange** | | [optional] |
|
12
|
+
| **type** | **SecurityType** | | [optional] |
|
13
13
|
| **currencies** | [**Array<Currency>**](Currency.md) | | [optional] |
|
14
14
|
|
15
15
|
## Example
|
data/docs/UniversalActivity.md
CHANGED
@@ -5,19 +5,19 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **id** | **String** | | [optional] |
|
8
|
-
| **account** |
|
8
|
+
| **account** | **AccountSimple** | | [optional] |
|
9
9
|
| **amount** | **Float** | | [optional] |
|
10
|
-
| **currency** |
|
10
|
+
| **currency** | **Currency** | | [optional] |
|
11
11
|
| **description** | **String** | | [optional] |
|
12
12
|
| **fee** | **Float** | | [optional] |
|
13
|
-
| **fx_rate** | **Float** | The forex conversion rate involved in the transaction if provided by the brokerage | [optional] |
|
13
|
+
| **fx_rate** | **Float** | The forex conversion rate involved in the transaction if provided by the brokerage. Used in cases where securities of one currency are purchased in a different currency, and the forex conversion is automatic. In those cases, price, amount and fee will be in the top level currency (activity -> currency) | [optional] |
|
14
14
|
| **institution** | **String** | | [optional] |
|
15
15
|
| **option_type** | **String** | If an option transaction, then it's type (BUY_TO_OPEN, SELL_TO_CLOSE, etc), otherwise empty string | [optional] |
|
16
16
|
| **price** | **Float** | | [optional] |
|
17
17
|
| **settlement_date** | **String** | | [optional] |
|
18
18
|
| **external_reference_id** | **String** | Reference ID from brokerage used to identify related transactions. For example if an order comprises of several transactions (buy, fee, fx), they can be grouped if they share the same external_reference_id | [optional] |
|
19
|
-
| **symbol** |
|
20
|
-
| **option_symbol** |
|
19
|
+
| **symbol** | **Symbol** | | [optional] |
|
20
|
+
| **option_symbol** | **OptionsSymbol** | | [optional] |
|
21
21
|
| **trade_date** | **String** | | [optional] |
|
22
22
|
| **type** | **String** | Potential values include (but are not limited to) - DIVIDEND - BUY - SELL - CONTRIBUTION - WITHDRAWAL - EXTERNAL_ASSET_TRANSFER_IN - EXTERNAL_ASSET_TRANSFER_OUT - INTERNAL_CASH_TRANSFER_IN - INTERNAL_CASH_TRANSFER_OUT - INTERNAL_ASSET_TRANSFER_IN - INTERNAL_ASSET_TRANSFER_OUT - INTEREST - REBATE - GOV_GRANT - TAX - FEE - REI - FXT | [optional] |
|
23
23
|
| **units** | **Float** | Usually but not necessarily an integer | [optional] |
|