snaptrade 2.0.203 → 2.0.205
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/Gemfile.lock +1 -1
- data/README.md +21 -11
- data/lib/snaptrade/api/connections_api.rb +4 -4
- data/lib/snaptrade/api/trading_api.rb +18 -10
- data/lib/snaptrade/models/account_position.rb +1 -1
- data/lib/snaptrade/models/account_universal_activity.rb +12 -1
- data/lib/snaptrade/models/account_universal_activity_currency.rb +1 -1
- data/lib/snaptrade/models/account_universal_activity_currency_universal_symbol.rb +304 -0
- data/lib/snaptrade/models/brokerage_authorization.rb +14 -4
- data/lib/snaptrade/models/manual_trade_form_complex.rb +0 -1
- data/lib/snaptrade/models/manual_trade_form_with_options.rb +28 -7
- data/lib/snaptrade/models/manual_trade_place_time_in_force_strict.rb +40 -0
- data/lib/snaptrade/models/model429_too_many_requests_response.rb +238 -0
- data/lib/snaptrade/models/position.rb +1 -1
- data/lib/snaptrade/models/universal_activity.rb +12 -1
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +3 -0
- data/spec/api/connections_api_spec.rb +1 -1
- data/spec/api/trading_api_spec.rb +1 -1
- data/spec/models/account_universal_activity_currency_universal_symbol_spec.rb +77 -0
- data/spec/models/account_universal_activity_spec.rb +6 -0
- data/spec/models/brokerage_authorization_spec.rb +6 -0
- data/spec/models/manual_trade_form_with_options_spec.rb +12 -0
- data/spec/models/manual_trade_place_time_in_force_strict_spec.rb +23 -0
- data/spec/models/model429_too_many_requests_response_spec.rb +41 -0
- data/spec/models/universal_activity_spec.rb +6 -0
- metadata +201 -192
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b7926d475d4e1b1af8898e963c1b07ce00658ac7f1418831c1570422ef8b38a
|
|
4
|
+
data.tar.gz: ede2fd0b777d2969fd4041f7566d2cc8c3c73d837ce5a214b8c3f646bebb382b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1a16d2f0e181121bce08f92b2a49b2c6fbb4351dcb08eae60935b1264c30b34ca304c275046ab576e142067b1d412885031d1ce7ffe09ff264ae529868a28b76
|
|
7
|
+
data.tar.gz: 463f516bea91940bfa5315c0acbd891461b1dcbd0c9e3887ada9b6ad78895a31f15cc40499b300c8882e08b104adb547d92c488251143605e97c0751c0d43145
|
data/Gemfile.lock
CHANGED
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
|
-
[](https://rubygems.org/gems/snaptrade/versions/2.0.205)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -94,7 +94,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
94
94
|
Add to Gemfile:
|
|
95
95
|
|
|
96
96
|
```ruby
|
|
97
|
-
gem 'snaptrade', '~> 2.0.
|
|
97
|
+
gem 'snaptrade', '~> 2.0.205'
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1165,7 +1165,7 @@ Trigger a holdings update for all accounts under this connection. Updates will b
|
|
|
1165
1165
|
This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
|
|
1166
1166
|
|
|
1167
1167
|
**Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
1168
|
-
**Please note this endpoint is disabled for Personal and Pay as you
|
|
1168
|
+
**Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
1169
1169
|
|
|
1170
1170
|
|
|
1171
1171
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -2400,7 +2400,7 @@ Must be `null` if `notional_value` is provided.
|
|
|
2400
2400
|
|
|
2401
2401
|
### `snaptrade.trading.place_complex_order`<a id="snaptradetradingplace_complex_order"></a>
|
|
2402
2402
|
|
|
2403
|
-
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
2403
|
+
Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
2404
2404
|
Only supported on certain brokerages.
|
|
2405
2405
|
Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
2406
2406
|
|
|
@@ -2432,7 +2432,7 @@ result = snaptrade.trading.place_complex_order(
|
|
|
2432
2432
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2433
2433
|
user_id: "snaptrade-user-123",
|
|
2434
2434
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2435
|
-
client_order_id: "
|
|
2435
|
+
client_order_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
2436
2436
|
)
|
|
2437
2437
|
p result
|
|
2438
2438
|
```
|
|
@@ -2455,10 +2455,7 @@ The ID of the account to execute the trade on.
|
|
|
2455
2455
|
|
|
2456
2456
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
2457
2457
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2458
|
-
##### client_order_id: `String
|
|
2459
|
-
An optional client-provided identifier for this complex order. Passed through to
|
|
2460
|
-
the brokerage and returned in the response.
|
|
2461
|
-
|
|
2458
|
+
##### client_order_id: [`String`](./lib/snaptrade/models/string.rb)<a id="client_order_id-stringlibsnaptrademodelsstringrb"></a>
|
|
2462
2459
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2463
2460
|
|
|
2464
2461
|
[ComplexOrderResponse](./lib/snaptrade/models/complex_order_response.rb)
|
|
@@ -2576,10 +2573,12 @@ result = snaptrade.trading.place_force_order(
|
|
|
2576
2573
|
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
2577
2574
|
symbol: "AAPL",
|
|
2578
2575
|
trading_session: "REGULAR",
|
|
2576
|
+
expiry_date: "2026-08-21T23:27:55.027Z",
|
|
2579
2577
|
price: 31.33,
|
|
2580
2578
|
stop: 31.33,
|
|
2581
2579
|
units: 10.5,
|
|
2582
2580
|
notional_value: None,
|
|
2581
|
+
client_order_id: "550e8400-e29b-41d4-a716-446655440000",
|
|
2583
2582
|
)
|
|
2584
2583
|
p result
|
|
2585
2584
|
```
|
|
@@ -2600,7 +2599,7 @@ The type of order to place. - For `Limit` and `StopLimit` orders, the `price`
|
|
|
2600
2599
|
field is required. - For `Stop` and `StopLimit` orders, the `stop` field is
|
|
2601
2600
|
required.
|
|
2602
2601
|
|
|
2603
|
-
##### time_in_force: [`
|
|
2602
|
+
##### time_in_force: [`ManualTradePlaceTimeInForceStrict`](./lib/snaptrade/models/manual_trade_place_time_in_force_strict.rb)<a id="time_in_force-manualtradeplacetimeinforcestrictlibsnaptrademodelsmanual_trade_place_time_in_force_strictrb"></a>
|
|
2604
2603
|
The Time in Force type for the order. This field indicates how long the order
|
|
2605
2604
|
will remain active before it is executed or expires. Here are the supported
|
|
2606
2605
|
values: - `Day` - Day. The order is valid only for the trading day on which it
|
|
@@ -2608,7 +2607,10 @@ is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed
|
|
|
2608
2607
|
or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety
|
|
2609
2608
|
immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order
|
|
2610
2609
|
must be executed immediately. Any portion of the order that cannot be filled
|
|
2611
|
-
immediately will be canceled.
|
|
2610
|
+
immediately will be canceled. - `GTD` - Good Til Date. The order is valid until
|
|
2611
|
+
`expiry_date`, which is required. Not available for market orders. GTD orders
|
|
2612
|
+
are only available on certain brokerages. Visit
|
|
2613
|
+
https://support.snaptrade.com/brokerages for brokerage support.
|
|
2612
2614
|
|
|
2613
2615
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
2614
2616
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
@@ -2626,6 +2628,13 @@ order will be placed in. This is only available for certain brokerages. Defaults
|
|
|
2626
2628
|
to REGULAR. Here are the supported values: - `REGULAR` - Regular trading hours.
|
|
2627
2629
|
- `EXTENDED` - Extended trading hours.
|
|
2628
2630
|
|
|
2631
|
+
##### expiry_date: `Time`<a id="expiry_date-time"></a>
|
|
2632
|
+
Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format
|
|
2633
|
+
indicating when the order expires. Required when `time_in_force` is `GTD`.
|
|
2634
|
+
Include a timezone offset or `Z` for UTC; if no timezone is provided, UTC is
|
|
2635
|
+
assumed. GTD orders are only available on certain brokerages. Visit
|
|
2636
|
+
https://support.snaptrade.com/brokerages for brokerage support.
|
|
2637
|
+
|
|
2629
2638
|
##### price: `Float`<a id="price-float"></a>
|
|
2630
2639
|
The limit price for `Limit` and `StopLimit` orders.
|
|
2631
2640
|
|
|
@@ -2639,6 +2648,7 @@ provided. If placing an Option order, this field represents the number of
|
|
|
2639
2648
|
contracts to buy or sell. (e.g., 1 contract = 100 shares).
|
|
2640
2649
|
|
|
2641
2650
|
##### notional_value: [`ManualTradeFormNotionalValue`](./lib/snaptrade/models/manual_trade_form_notional_value.rb)<a id="notional_value-manualtradeformnotionalvaluelibsnaptrademodelsmanual_trade_form_notional_valuerb"></a>
|
|
2651
|
+
##### client_order_id: [`String`](./lib/snaptrade/models/string.rb)<a id="client_order_id-stringlibsnaptrademodelsstringrb"></a>
|
|
2642
2652
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2643
2653
|
|
|
2644
2654
|
[AccountOrderRecord](./lib/snaptrade/models/account_order_record.rb)
|
|
@@ -556,7 +556,7 @@ module SnapTrade
|
|
|
556
556
|
# This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
|
|
557
557
|
#
|
|
558
558
|
# **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
559
|
-
# **Please note this endpoint is disabled for Personal and Pay as you
|
|
559
|
+
# **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
560
560
|
#
|
|
561
561
|
# @param authorization_id [String]
|
|
562
562
|
# @param user_id [String]
|
|
@@ -573,7 +573,7 @@ module SnapTrade
|
|
|
573
573
|
# This endpoint will also trigger a transaction sync for the past day if one has not yet occurred.
|
|
574
574
|
#
|
|
575
575
|
# **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
576
|
-
# **Please note this endpoint is disabled for Personal and Pay as you
|
|
576
|
+
# **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
577
577
|
#
|
|
578
578
|
# @param authorization_id [String]
|
|
579
579
|
# @param user_id [String]
|
|
@@ -584,7 +584,7 @@ module SnapTrade
|
|
|
584
584
|
end
|
|
585
585
|
|
|
586
586
|
# Refresh holdings for a connection
|
|
587
|
-
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you
|
|
587
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
588
588
|
# @param authorization_id [String]
|
|
589
589
|
# @param user_id [String]
|
|
590
590
|
# @param user_secret [String]
|
|
@@ -596,7 +596,7 @@ module SnapTrade
|
|
|
596
596
|
end
|
|
597
597
|
|
|
598
598
|
# Refresh holdings for a connection
|
|
599
|
-
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you
|
|
599
|
+
# Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
600
600
|
# @param authorization_id [String]
|
|
601
601
|
# @param user_id [String]
|
|
602
602
|
# @param user_secret [String]
|
|
@@ -1083,7 +1083,7 @@ module SnapTrade
|
|
|
1083
1083
|
|
|
1084
1084
|
# Place complex order
|
|
1085
1085
|
#
|
|
1086
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1086
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1087
1087
|
# Only supported on certain brokerages.
|
|
1088
1088
|
# Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
1089
1089
|
#
|
|
@@ -1096,7 +1096,7 @@ module SnapTrade
|
|
|
1096
1096
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1097
1097
|
# @param user_id [String]
|
|
1098
1098
|
# @param user_secret [String]
|
|
1099
|
-
# @param client_order_id [String]
|
|
1099
|
+
# @param client_order_id [String]
|
|
1100
1100
|
# @param body [ManualTradeFormComplex]
|
|
1101
1101
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1102
1102
|
def place_complex_order(type:, orders:, account_id:, user_id:, user_secret:, client_order_id: SENTINEL, extra: {})
|
|
@@ -1111,7 +1111,7 @@ module SnapTrade
|
|
|
1111
1111
|
|
|
1112
1112
|
# Place complex order
|
|
1113
1113
|
#
|
|
1114
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1114
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1115
1115
|
# Only supported on certain brokerages.
|
|
1116
1116
|
# Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support.
|
|
1117
1117
|
#
|
|
@@ -1124,7 +1124,7 @@ module SnapTrade
|
|
|
1124
1124
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1125
1125
|
# @param user_id [String]
|
|
1126
1126
|
# @param user_secret [String]
|
|
1127
|
-
# @param client_order_id [String]
|
|
1127
|
+
# @param client_order_id [String]
|
|
1128
1128
|
# @param body [ManualTradeFormComplex]
|
|
1129
1129
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1130
1130
|
def place_complex_order_with_http_info(type:, orders:, account_id:, user_id:, user_secret:, client_order_id: SENTINEL, extra: {})
|
|
@@ -1137,7 +1137,7 @@ module SnapTrade
|
|
|
1137
1137
|
end
|
|
1138
1138
|
|
|
1139
1139
|
# Place complex order
|
|
1140
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1140
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1141
1141
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1142
1142
|
# @param user_id [String]
|
|
1143
1143
|
# @param user_secret [String]
|
|
@@ -1150,7 +1150,7 @@ module SnapTrade
|
|
|
1150
1150
|
end
|
|
1151
1151
|
|
|
1152
1152
|
# Place complex order
|
|
1153
|
-
# Places a complex conditional order (OCO, OTO, or OTOCO).
|
|
1153
|
+
# Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
|
|
1154
1154
|
# @param account_id [String] The ID of the account to execute the trade on.
|
|
1155
1155
|
# @param user_id [String]
|
|
1156
1156
|
# @param user_secret [String]
|
|
@@ -1394,19 +1394,21 @@ module SnapTrade
|
|
|
1394
1394
|
# @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
|
1395
1395
|
# @param action [ActionStrictWithOptions] The action describes the intent or side of a trade. This is either `BUY` or `SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or `SELL_TO_CLOSE` for Options.
|
|
1396
1396
|
# @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
|
1397
|
-
# @param time_in_force [
|
|
1397
|
+
# @param time_in_force [ManualTradePlaceTimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until `expiry_date`, which is required. Not available for market orders. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
1398
1398
|
# @param user_id [String]
|
|
1399
1399
|
# @param user_secret [String]
|
|
1400
1400
|
# @param universal_symbol_id [String] The universal symbol ID of the security to trade. Must be 'null' if `symbol` is provided, otherwise must be provided.
|
|
1401
1401
|
# @param symbol [String] The security's trading ticker symbol. If 'symbol' is provided, then 'universal_symbol_id' must be 'null'.
|
|
1402
1402
|
# @param trading_session [TradingSession] The trading session for the order. This field indicates which market session the order will be placed in. This is only available for certain brokerages. Defaults to REGULAR. Here are the supported values: - `REGULAR` - Regular trading hours. - `EXTENDED` - Extended trading hours.
|
|
1403
|
+
# @param expiry_date [Time] Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the order expires. Required when `time_in_force` is `GTD`. Include a timezone offset or `Z` for UTC; if no timezone is provided, UTC is assumed. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
1403
1404
|
# @param price [Float] The limit price for `Limit` and `StopLimit` orders.
|
|
1404
1405
|
# @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
1405
1406
|
# @param units [Float] For Equity orders, this represents the number of shares for the order. This can be a decimal for fractional orders. Must be `null` if `notional_value` is provided. If placing an Option order, this field represents the number of contracts to buy or sell. (e.g., 1 contract = 100 shares).
|
|
1406
1407
|
# @param notional_value [ManualTradeFormNotionalValue]
|
|
1408
|
+
# @param client_order_id [String]
|
|
1407
1409
|
# @param body [ManualTradeFormWithOptions]
|
|
1408
1410
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1409
|
-
def place_force_order(account_id:, action:, order_type:, time_in_force:, user_id:, user_secret:, universal_symbol_id: SENTINEL, symbol: SENTINEL, trading_session: 'REGULAR', price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
|
|
1411
|
+
def place_force_order(account_id:, action:, order_type:, time_in_force:, user_id:, user_secret:, universal_symbol_id: SENTINEL, symbol: SENTINEL, trading_session: 'REGULAR', expiry_date: SENTINEL, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, client_order_id: SENTINEL, extra: {})
|
|
1410
1412
|
_body = {}
|
|
1411
1413
|
_body[:account_id] = account_id if account_id != SENTINEL
|
|
1412
1414
|
_body[:action] = action if action != SENTINEL
|
|
@@ -1415,10 +1417,12 @@ module SnapTrade
|
|
|
1415
1417
|
_body[:order_type] = order_type if order_type != SENTINEL
|
|
1416
1418
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|
|
1417
1419
|
_body[:trading_session] = trading_session if trading_session != SENTINEL
|
|
1420
|
+
_body[:expiry_date] = expiry_date if expiry_date != SENTINEL
|
|
1418
1421
|
_body[:price] = price if price != SENTINEL
|
|
1419
1422
|
_body[:stop] = stop if stop != SENTINEL
|
|
1420
1423
|
_body[:units] = units if units != SENTINEL
|
|
1421
1424
|
_body[:notional_value] = notional_value if notional_value != SENTINEL
|
|
1425
|
+
_body[:client_order_id] = client_order_id if client_order_id != SENTINEL
|
|
1422
1426
|
manual_trade_form_with_options = _body
|
|
1423
1427
|
data, _status_code, _headers = place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form_with_options, extra)
|
|
1424
1428
|
data
|
|
@@ -1435,19 +1439,21 @@ module SnapTrade
|
|
|
1435
1439
|
# @param account_id [String] Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
|
1436
1440
|
# @param action [ActionStrictWithOptions] The action describes the intent or side of a trade. This is either `BUY` or `SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or `SELL_TO_CLOSE` for Options.
|
|
1437
1441
|
# @param order_type [OrderTypeStrict] The type of order to place. - For `Limit` and `StopLimit` orders, the `price` field is required. - For `Stop` and `StopLimit` orders, the `stop` field is required.
|
|
1438
|
-
# @param time_in_force [
|
|
1442
|
+
# @param time_in_force [ManualTradePlaceTimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until `expiry_date`, which is required. Not available for market orders. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
1439
1443
|
# @param user_id [String]
|
|
1440
1444
|
# @param user_secret [String]
|
|
1441
1445
|
# @param universal_symbol_id [String] The universal symbol ID of the security to trade. Must be 'null' if `symbol` is provided, otherwise must be provided.
|
|
1442
1446
|
# @param symbol [String] The security's trading ticker symbol. If 'symbol' is provided, then 'universal_symbol_id' must be 'null'.
|
|
1443
1447
|
# @param trading_session [TradingSession] The trading session for the order. This field indicates which market session the order will be placed in. This is only available for certain brokerages. Defaults to REGULAR. Here are the supported values: - `REGULAR` - Regular trading hours. - `EXTENDED` - Extended trading hours.
|
|
1448
|
+
# @param expiry_date [Time] Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the order expires. Required when `time_in_force` is `GTD`. Include a timezone offset or `Z` for UTC; if no timezone is provided, UTC is assumed. GTD orders are only available on certain brokerages. Visit https://support.snaptrade.com/brokerages for brokerage support.
|
|
1444
1449
|
# @param price [Float] The limit price for `Limit` and `StopLimit` orders.
|
|
1445
1450
|
# @param stop [Float] The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
|
|
1446
1451
|
# @param units [Float] For Equity orders, this represents the number of shares for the order. This can be a decimal for fractional orders. Must be `null` if `notional_value` is provided. If placing an Option order, this field represents the number of contracts to buy or sell. (e.g., 1 contract = 100 shares).
|
|
1447
1452
|
# @param notional_value [ManualTradeFormNotionalValue]
|
|
1453
|
+
# @param client_order_id [String]
|
|
1448
1454
|
# @param body [ManualTradeFormWithOptions]
|
|
1449
1455
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1450
|
-
def place_force_order_with_http_info(account_id:, action:, order_type:, time_in_force:, user_id:, user_secret:, universal_symbol_id: SENTINEL, symbol: SENTINEL, trading_session: 'REGULAR', price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, extra: {})
|
|
1456
|
+
def place_force_order_with_http_info(account_id:, action:, order_type:, time_in_force:, user_id:, user_secret:, universal_symbol_id: SENTINEL, symbol: SENTINEL, trading_session: 'REGULAR', expiry_date: SENTINEL, price: SENTINEL, stop: SENTINEL, units: SENTINEL, notional_value: SENTINEL, client_order_id: SENTINEL, extra: {})
|
|
1451
1457
|
_body = {}
|
|
1452
1458
|
_body[:account_id] = account_id if account_id != SENTINEL
|
|
1453
1459
|
_body[:action] = action if action != SENTINEL
|
|
@@ -1456,10 +1462,12 @@ module SnapTrade
|
|
|
1456
1462
|
_body[:order_type] = order_type if order_type != SENTINEL
|
|
1457
1463
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|
|
1458
1464
|
_body[:trading_session] = trading_session if trading_session != SENTINEL
|
|
1465
|
+
_body[:expiry_date] = expiry_date if expiry_date != SENTINEL
|
|
1459
1466
|
_body[:price] = price if price != SENTINEL
|
|
1460
1467
|
_body[:stop] = stop if stop != SENTINEL
|
|
1461
1468
|
_body[:units] = units if units != SENTINEL
|
|
1462
1469
|
_body[:notional_value] = notional_value if notional_value != SENTINEL
|
|
1470
|
+
_body[:client_order_id] = client_order_id if client_order_id != SENTINEL
|
|
1463
1471
|
manual_trade_form_with_options = _body
|
|
1464
1472
|
place_force_order_with_http_info_impl(user_id, user_secret, manual_trade_form_with_options, extra)
|
|
1465
1473
|
end
|
|
@@ -30,7 +30,7 @@ module SnapTrade
|
|
|
30
30
|
# Present for mutual fund positions that are also counted in cash balance or buying power.
|
|
31
31
|
attr_accessor :cash_equivalent
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# List of tax lots for the given position (disabled by default, only available on paid plans, contact support if needed)
|
|
34
34
|
attr_accessor :tax_lots
|
|
35
35
|
|
|
36
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -18,6 +18,8 @@ module SnapTrade
|
|
|
18
18
|
|
|
19
19
|
attr_accessor :symbol
|
|
20
20
|
|
|
21
|
+
attr_accessor :currency_universal_symbol
|
|
22
|
+
|
|
21
23
|
attr_accessor :option_symbol
|
|
22
24
|
|
|
23
25
|
# The price of the security for the transaction. This is mostly applicable to `BUY`, `SELL`, and `DIVIDEND` transactions. For option transactions, this represents the price per share of the option contract.
|
|
@@ -63,6 +65,7 @@ module SnapTrade
|
|
|
63
65
|
{
|
|
64
66
|
:'id' => :'id',
|
|
65
67
|
:'symbol' => :'symbol',
|
|
68
|
+
:'currency_universal_symbol' => :'currency_universal_symbol',
|
|
66
69
|
:'option_symbol' => :'option_symbol',
|
|
67
70
|
:'price' => :'price',
|
|
68
71
|
:'units' => :'units',
|
|
@@ -90,6 +93,7 @@ module SnapTrade
|
|
|
90
93
|
{
|
|
91
94
|
:'id' => :'String',
|
|
92
95
|
:'symbol' => :'AccountUniversalActivitySymbol',
|
|
96
|
+
:'currency_universal_symbol' => :'AccountUniversalActivityCurrencyUniversalSymbol',
|
|
93
97
|
:'option_symbol' => :'AccountUniversalActivityOptionSymbol',
|
|
94
98
|
:'price' => :'Float',
|
|
95
99
|
:'units' => :'Float',
|
|
@@ -111,8 +115,10 @@ module SnapTrade
|
|
|
111
115
|
def self.openapi_nullable
|
|
112
116
|
Set.new([
|
|
113
117
|
:'symbol',
|
|
118
|
+
:'currency_universal_symbol',
|
|
114
119
|
:'option_symbol',
|
|
115
120
|
:'amount',
|
|
121
|
+
:'currency',
|
|
116
122
|
:'trade_date',
|
|
117
123
|
:'fx_rate',
|
|
118
124
|
:'external_reference_id'
|
|
@@ -142,6 +148,10 @@ module SnapTrade
|
|
|
142
148
|
self.symbol = attributes[:'symbol']
|
|
143
149
|
end
|
|
144
150
|
|
|
151
|
+
if attributes.key?(:'currency_universal_symbol')
|
|
152
|
+
self.currency_universal_symbol = attributes[:'currency_universal_symbol']
|
|
153
|
+
end
|
|
154
|
+
|
|
145
155
|
if attributes.key?(:'option_symbol')
|
|
146
156
|
self.option_symbol = attributes[:'option_symbol']
|
|
147
157
|
end
|
|
@@ -219,6 +229,7 @@ module SnapTrade
|
|
|
219
229
|
self.class == o.class &&
|
|
220
230
|
id == o.id &&
|
|
221
231
|
symbol == o.symbol &&
|
|
232
|
+
currency_universal_symbol == o.currency_universal_symbol &&
|
|
222
233
|
option_symbol == o.option_symbol &&
|
|
223
234
|
price == o.price &&
|
|
224
235
|
units == o.units &&
|
|
@@ -244,7 +255,7 @@ module SnapTrade
|
|
|
244
255
|
# Calculates hash code according to all attributes.
|
|
245
256
|
# @return [Integer] Hash code
|
|
246
257
|
def hash
|
|
247
|
-
[id, symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
|
|
258
|
+
[id, symbol, currency_universal_symbol, option_symbol, price, units, amount, currency, type, option_type, description, trade_date, settlement_date, fee, fx_rate, institution, external_reference_id].hash
|
|
248
259
|
end
|
|
249
260
|
|
|
250
261
|
# Builds the object from hash
|
|
@@ -11,7 +11,7 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
# The currency in which the transaction `price` and `
|
|
14
|
+
# The currency in which the transaction `price`, `amount`, and `fee` are denominated. This is `null` when those values are denominated in `currency_universal_symbol`.
|
|
15
15
|
class AccountUniversalActivityCurrency
|
|
16
16
|
# Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
|
17
17
|
attr_accessor :id
|