snaptrade 2.0.203 → 2.0.204
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 +19 -9
- data/lib/snaptrade/api/trading_api.rb +14 -6
- 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/version.rb +1 -1
- data/lib/snaptrade.rb +1 -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
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d49d5c08cb9a40f52ea37f9329cf5617cab52c12683ac9a0536af8ab63b548a7
|
|
4
|
+
data.tar.gz: 8498700322066b21498f954120bf5287f11ba9929e782a4d1fdd5303f5670d7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ead930da246e29f36bdf30d97cd626e8318ecccb0a75c7c575b4c2304489199dbc8cd6ba96c5c656ba9490fd4d730d562be2adeed3afdcf8f22ecaf51d7f76be
|
|
7
|
+
data.tar.gz: 5ed9163deb7550bcb877a389e287d9ac7ed9738595824e7e417fdf09af3a92f0906489cc54e5c7113cef38317480bbac381dc4c005ec65629f57aee9ff484789
|
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.204)
|
|
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.204'
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -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)
|
|
@@ -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: {})
|
|
@@ -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: {})
|
|
@@ -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
|
|
@@ -19,7 +19,6 @@ module SnapTrade
|
|
|
19
19
|
# The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
|
|
20
20
|
attr_accessor :orders
|
|
21
21
|
|
|
22
|
-
# An optional client-provided identifier for this complex order. Passed through to the brokerage and returned in the response.
|
|
23
22
|
attr_accessor :client_order_id
|
|
24
23
|
|
|
25
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -28,12 +28,15 @@ module SnapTrade
|
|
|
28
28
|
# 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.
|
|
29
29
|
attr_accessor :order_type
|
|
30
30
|
|
|
31
|
-
# 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.
|
|
31
|
+
# 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.
|
|
32
32
|
attr_accessor :time_in_force
|
|
33
33
|
|
|
34
34
|
# 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.
|
|
35
35
|
attr_accessor :trading_session
|
|
36
36
|
|
|
37
|
+
# 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.
|
|
38
|
+
attr_accessor :expiry_date
|
|
39
|
+
|
|
37
40
|
# The limit price for `Limit` and `StopLimit` orders.
|
|
38
41
|
attr_accessor :price
|
|
39
42
|
|
|
@@ -45,6 +48,8 @@ module SnapTrade
|
|
|
45
48
|
|
|
46
49
|
attr_accessor :notional_value
|
|
47
50
|
|
|
51
|
+
attr_accessor :client_order_id
|
|
52
|
+
|
|
48
53
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
54
|
def self.attribute_map
|
|
50
55
|
{
|
|
@@ -55,10 +60,12 @@ module SnapTrade
|
|
|
55
60
|
:'order_type' => :'order_type',
|
|
56
61
|
:'time_in_force' => :'time_in_force',
|
|
57
62
|
:'trading_session' => :'trading_session',
|
|
63
|
+
:'expiry_date' => :'expiry_date',
|
|
58
64
|
:'price' => :'price',
|
|
59
65
|
:'stop' => :'stop',
|
|
60
66
|
:'units' => :'units',
|
|
61
|
-
:'notional_value' => :'notional_value'
|
|
67
|
+
:'notional_value' => :'notional_value',
|
|
68
|
+
:'client_order_id' => :'client_order_id'
|
|
62
69
|
}
|
|
63
70
|
end
|
|
64
71
|
|
|
@@ -75,12 +82,14 @@ module SnapTrade
|
|
|
75
82
|
:'universal_symbol_id' => :'String',
|
|
76
83
|
:'symbol' => :'String',
|
|
77
84
|
:'order_type' => :'OrderTypeStrict',
|
|
78
|
-
:'time_in_force' => :'
|
|
85
|
+
:'time_in_force' => :'ManualTradePlaceTimeInForceStrict',
|
|
79
86
|
:'trading_session' => :'TradingSession',
|
|
87
|
+
:'expiry_date' => :'Time',
|
|
80
88
|
:'price' => :'Float',
|
|
81
89
|
:'stop' => :'Float',
|
|
82
90
|
:'units' => :'Float',
|
|
83
|
-
:'notional_value' => :'ManualTradeFormNotionalValue'
|
|
91
|
+
:'notional_value' => :'ManualTradeFormNotionalValue',
|
|
92
|
+
:'client_order_id' => :'String'
|
|
84
93
|
}
|
|
85
94
|
end
|
|
86
95
|
|
|
@@ -89,10 +98,12 @@ module SnapTrade
|
|
|
89
98
|
Set.new([
|
|
90
99
|
:'universal_symbol_id',
|
|
91
100
|
:'symbol',
|
|
101
|
+
:'expiry_date',
|
|
92
102
|
:'price',
|
|
93
103
|
:'stop',
|
|
94
104
|
:'units',
|
|
95
|
-
:'notional_value'
|
|
105
|
+
:'notional_value',
|
|
106
|
+
:'client_order_id'
|
|
96
107
|
])
|
|
97
108
|
end
|
|
98
109
|
|
|
@@ -141,6 +152,10 @@ module SnapTrade
|
|
|
141
152
|
self.trading_session = 'REGULAR'
|
|
142
153
|
end
|
|
143
154
|
|
|
155
|
+
if attributes.key?(:'expiry_date')
|
|
156
|
+
self.expiry_date = attributes[:'expiry_date']
|
|
157
|
+
end
|
|
158
|
+
|
|
144
159
|
if attributes.key?(:'price')
|
|
145
160
|
self.price = attributes[:'price']
|
|
146
161
|
end
|
|
@@ -156,6 +171,10 @@ module SnapTrade
|
|
|
156
171
|
if attributes.key?(:'notional_value')
|
|
157
172
|
self.notional_value = attributes[:'notional_value']
|
|
158
173
|
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'client_order_id')
|
|
176
|
+
self.client_order_id = attributes[:'client_order_id']
|
|
177
|
+
end
|
|
159
178
|
end
|
|
160
179
|
|
|
161
180
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -203,10 +222,12 @@ module SnapTrade
|
|
|
203
222
|
order_type == o.order_type &&
|
|
204
223
|
time_in_force == o.time_in_force &&
|
|
205
224
|
trading_session == o.trading_session &&
|
|
225
|
+
expiry_date == o.expiry_date &&
|
|
206
226
|
price == o.price &&
|
|
207
227
|
stop == o.stop &&
|
|
208
228
|
units == o.units &&
|
|
209
|
-
notional_value == o.notional_value
|
|
229
|
+
notional_value == o.notional_value &&
|
|
230
|
+
client_order_id == o.client_order_id
|
|
210
231
|
end
|
|
211
232
|
|
|
212
233
|
# @see the `==` method
|
|
@@ -218,7 +239,7 @@ module SnapTrade
|
|
|
218
239
|
# Calculates hash code according to all attributes.
|
|
219
240
|
# @return [Integer] Hash code
|
|
220
241
|
def hash
|
|
221
|
-
[account_id, action, universal_symbol_id, symbol, order_type, time_in_force, trading_session, price, stop, units, notional_value].hash
|
|
242
|
+
[account_id, action, universal_symbol_id, symbol, order_type, time_in_force, trading_session, expiry_date, price, stop, units, notional_value, client_order_id].hash
|
|
222
243
|
end
|
|
223
244
|
|
|
224
245
|
# Builds the object from hash
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SnapTrade
|
|
3
|
+
|
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: api@snaptrade.com
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module SnapTrade
|
|
14
|
+
class ManualTradePlaceTimeInForceStrict
|
|
15
|
+
FOK = "FOK".freeze
|
|
16
|
+
DAY = "Day".freeze
|
|
17
|
+
GTC = "GTC".freeze
|
|
18
|
+
IOC = "IOC".freeze
|
|
19
|
+
GTD = "GTD".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [FOK, DAY, GTC, IOC, GTD].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if ManualTradePlaceTimeInForceStrict.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #ManualTradePlaceTimeInForceStrict"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
|
@@ -117,6 +117,7 @@ require 'snaptrade/models/manual_trade_form_complex_type'
|
|
|
117
117
|
require 'snaptrade/models/manual_trade_form_notional_value'
|
|
118
118
|
require 'snaptrade/models/manual_trade_form_with_options'
|
|
119
119
|
require 'snaptrade/models/manual_trade_impact'
|
|
120
|
+
require 'snaptrade/models/manual_trade_place_time_in_force_strict'
|
|
120
121
|
require 'snaptrade/models/manual_trade_replace_form'
|
|
121
122
|
require 'snaptrade/models/manual_trade_symbol'
|
|
122
123
|
require 'snaptrade/models/mleg_action_strict'
|
|
@@ -62,6 +62,12 @@ describe SnapTrade::ManualTradeFormWithOptions do
|
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
+
describe 'test attribute "expiry_date"' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
65
71
|
describe 'test attribute "price"' do
|
|
66
72
|
it 'should work' do
|
|
67
73
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
@@ -86,4 +92,10 @@ describe SnapTrade::ManualTradeFormWithOptions do
|
|
|
86
92
|
end
|
|
87
93
|
end
|
|
88
94
|
|
|
95
|
+
describe 'test attribute "client_order_id"' do
|
|
96
|
+
it 'should work' do
|
|
97
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
89
101
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SnapTrade
|
|
3
|
+
|
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: api@snaptrade.com
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::ManualTradePlaceTimeInForceStrict
|
|
15
|
+
describe SnapTrade::ManualTradePlaceTimeInForceStrict do
|
|
16
|
+
let(:instance) { SnapTrade::ManualTradePlaceTimeInForceStrict.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of ManualTradePlaceTimeInForceStrict' do
|
|
19
|
+
it 'should create an instance of ManualTradePlaceTimeInForceStrict' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::ManualTradePlaceTimeInForceStrict)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snaptrade
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.204
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -197,6 +197,7 @@ files:
|
|
|
197
197
|
- lib/snaptrade/models/manual_trade_form_notional_value.rb
|
|
198
198
|
- lib/snaptrade/models/manual_trade_form_with_options.rb
|
|
199
199
|
- lib/snaptrade/models/manual_trade_impact.rb
|
|
200
|
+
- lib/snaptrade/models/manual_trade_place_time_in_force_strict.rb
|
|
200
201
|
- lib/snaptrade/models/manual_trade_replace_form.rb
|
|
201
202
|
- lib/snaptrade/models/manual_trade_symbol.rb
|
|
202
203
|
- lib/snaptrade/models/mleg_action_strict.rb
|
|
@@ -420,6 +421,7 @@ files:
|
|
|
420
421
|
- spec/models/manual_trade_form_spec.rb
|
|
421
422
|
- spec/models/manual_trade_form_with_options_spec.rb
|
|
422
423
|
- spec/models/manual_trade_impact_spec.rb
|
|
424
|
+
- spec/models/manual_trade_place_time_in_force_strict_spec.rb
|
|
423
425
|
- spec/models/manual_trade_replace_form_spec.rb
|
|
424
426
|
- spec/models/manual_trade_spec.rb
|
|
425
427
|
- spec/models/manual_trade_symbol_spec.rb
|
|
@@ -690,6 +692,7 @@ test_files:
|
|
|
690
692
|
- spec/models/monthly_dividends_spec.rb
|
|
691
693
|
- spec/models/manual_trade_form_with_options_spec.rb
|
|
692
694
|
- spec/models/brokerage_instrument_spec.rb
|
|
695
|
+
- spec/models/manual_trade_place_time_in_force_strict_spec.rb
|
|
693
696
|
- spec/models/stop_loss_spec.rb
|
|
694
697
|
- spec/models/instrument_spec.rb
|
|
695
698
|
- spec/models/performance_custom_spec.rb
|