Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .konfig/generate-id.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
57e4306c-afdd-4579-be29-74de65f3dcfb
06ced896-0ac1-47b3-b506-5a377cd78777
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2725,6 +2725,7 @@ $result = $snaptrade->trading->placeForceOrder(
universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
symbol: "AAPL",
trading_session: "REGULAR",
expiry_date: "2026-08-21T23:27:55.027Z",
price: 31.33,
stop: 31.33,
units: 10.5,
Expand Down Expand Up @@ -2758,6 +2759,10 @@ The security's trading ticker symbol. If 'symbol' is provided, then 'universal_s

##### trading_session:<a id="trading_session"></a>

##### expiry_date: `\DateTime`<a id="expiry_date-datetime"></a>

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.

##### price: `float`<a id="price-float"></a>

The limit price for `Limit` and `StopLimit` orders.
Expand Down
4 changes: 4 additions & 0 deletions lib/Api/TradingApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -5051,6 +5051,7 @@ public function placeForceOrder(
$universal_symbol_id = SENTINEL_VALUE,
$symbol = SENTINEL_VALUE,
$trading_session = SENTINEL_VALUE,
$expiry_date = SENTINEL_VALUE,
$price = SENTINEL_VALUE,
$stop = SENTINEL_VALUE,
$units = SENTINEL_VALUE,
Expand All @@ -5066,6 +5067,7 @@ public function placeForceOrder(
$this->setRequestBodyProperty($_body, "order_type", $order_type);
$this->setRequestBodyProperty($_body, "time_in_force", $time_in_force);
$this->setRequestBodyProperty($_body, "trading_session", $trading_session);
$this->setRequestBodyProperty($_body, "expiry_date", $expiry_date);
$this->setRequestBodyProperty($_body, "price", $price);
$this->setRequestBodyProperty($_body, "stop", $stop);
$this->setRequestBodyProperty($_body, "units", $units);
Expand Down Expand Up @@ -5269,6 +5271,7 @@ public function placeForceOrderAsync(
$universal_symbol_id = SENTINEL_VALUE,
$symbol = SENTINEL_VALUE,
$trading_session = SENTINEL_VALUE,
$expiry_date = SENTINEL_VALUE,
$price = SENTINEL_VALUE,
$stop = SENTINEL_VALUE,
$units = SENTINEL_VALUE,
Expand All @@ -5284,6 +5287,7 @@ public function placeForceOrderAsync(
$this->setRequestBodyProperty($_body, "order_type", $order_type);
$this->setRequestBodyProperty($_body, "time_in_force", $time_in_force);
$this->setRequestBodyProperty($_body, "trading_session", $trading_session);
$this->setRequestBodyProperty($_body, "expiry_date", $expiry_date);
$this->setRequestBodyProperty($_body, "price", $price);
$this->setRequestBodyProperty($_body, "stop", $stop);
$this->setRequestBodyProperty($_body, "units", $units);
Expand Down
49 changes: 46 additions & 3 deletions lib/Model/ManualTradeFormWithOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe
'universal_symbol_id' => 'string',
'symbol' => 'string',
'order_type' => '\SnapTrade\Model\OrderTypeStrict',
'time_in_force' => '\SnapTrade\Model\TimeInForceStrict',
'time_in_force' => '\SnapTrade\Model\ManualTradePlaceTimeInForceStrict',
'trading_session' => '\SnapTrade\Model\TradingSession',
'expiry_date' => '\DateTime',
'price' => 'float',
'stop' => 'float',
'units' => 'float',
Expand All @@ -79,6 +80,7 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe
'order_type' => null,
'time_in_force' => null,
'trading_session' => null,
'expiry_date' => 'date-time',
'price' => null,
'stop' => null,
'units' => null,
Expand All @@ -98,6 +100,7 @@ class ManualTradeFormWithOptions implements ModelInterface, ArrayAccess, \JsonSe
'order_type' => false,
'time_in_force' => false,
'trading_session' => false,
'expiry_date' => true,
'price' => true,
'stop' => true,
'units' => true,
Expand Down Expand Up @@ -197,6 +200,7 @@ public function isNullableSetToNull(string $property): bool
'order_type' => 'order_type',
'time_in_force' => 'time_in_force',
'trading_session' => 'trading_session',
'expiry_date' => 'expiry_date',
'price' => 'price',
'stop' => 'stop',
'units' => 'units',
Expand All @@ -216,6 +220,7 @@ public function isNullableSetToNull(string $property): bool
'order_type' => 'setOrderType',
'time_in_force' => 'setTimeInForce',
'trading_session' => 'setTradingSession',
'expiry_date' => 'setExpiryDate',
'price' => 'setPrice',
'stop' => 'setStop',
'units' => 'setUnits',
Expand All @@ -235,6 +240,7 @@ public function isNullableSetToNull(string $property): bool
'order_type' => 'getOrderType',
'time_in_force' => 'getTimeInForce',
'trading_session' => 'getTradingSession',
'expiry_date' => 'getExpiryDate',
'price' => 'getPrice',
'stop' => 'getStop',
'units' => 'getUnits',
Expand Down Expand Up @@ -305,6 +311,7 @@ public function __construct(array $data = null)
$this->setIfExists('order_type', $data ?? [], null);
$this->setIfExists('time_in_force', $data ?? [], null);
$this->setIfExists('trading_session', $data ?? [], null);
$this->setIfExists('expiry_date', $data ?? [], null);
$this->setIfExists('price', $data ?? [], null);
$this->setIfExists('stop', $data ?? [], null);
$this->setIfExists('units', $data ?? [], null);
Expand Down Expand Up @@ -527,7 +534,7 @@ public function setOrderType($order_type)
/**
* Gets time_in_force
*
* @return \SnapTrade\Model\TimeInForceStrict
* @return \SnapTrade\Model\ManualTradePlaceTimeInForceStrict
*/
public function getTimeInForce()
{
Expand All @@ -537,7 +544,7 @@ public function getTimeInForce()
/**
* Sets time_in_force
*
* @param \SnapTrade\Model\TimeInForceStrict $time_in_force time_in_force
* @param \SnapTrade\Model\ManualTradePlaceTimeInForceStrict $time_in_force time_in_force
*
* @return self
*/
Expand Down Expand Up @@ -582,6 +589,42 @@ public function setTradingSession($trading_session)
return $this;
}

/**
* Gets expiry_date
*
* @return \DateTime|null
*/
public function getExpiryDate()
{
return $this->container['expiry_date'];
}

/**
* Sets expiry_date
*
* @param \DateTime|null $expiry_date 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.
*
* @return self
*/
public function setExpiryDate($expiry_date)
{

if (is_null($expiry_date)) {
array_push($this->openAPINullablesSetToNull, 'expiry_date');
} else {
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
$index = array_search('expiry_date', $nullablesSetToNull);
if ($index !== FALSE) {
unset($nullablesSetToNull[$index]);
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
}
}

$this->container['expiry_date'] = $expiry_date;

return $this;
}

/**
* Gets price
*
Expand Down
65 changes: 65 additions & 0 deletions lib/Model/ManualTradePlaceTimeInForceStrict.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
/**
* ManualTradePlaceTimeInForceStrict
*
* PHP version 7.4
*
* @category Class
* @package SnapTrade
* @author Konfig
* @link https://konfigthis.com
*/

/**
* SnapTrade
*
* Connect brokerage accounts to your app for live positions and trading
*
* The version of the OpenAPI document: 1.0.0
* Contact: api@snaptrade.com
* Generated by: https://konfigthis.com
*/


namespace SnapTrade\Model;
use \SnapTrade\ObjectSerializer;

/**
* ManualTradePlaceTimeInForceStrict Class Doc Comment
*
* @category Class
* @description 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: - &#x60;Day&#x60; - Day. The order is valid only for the trading day on which it is placed. - &#x60;GTC&#x60; - Good Til Canceled. The order is valid until it is executed or canceled. - &#x60;FOK&#x60; - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - &#x60;IOC&#x60; - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - &#x60;GTD&#x60; - Good Til Date. The order is valid until &#x60;expiry_date&#x60;, 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.
* @package SnapTrade
*/
class ManualTradePlaceTimeInForceStrict
{
/**
* Possible values of this enum
*/
public const FOK = 'FOK';

public const DAY = 'Day';

public const GTC = 'GTC';

public const IOC = 'IOC';

public const GTD = 'GTD';

/**
* Gets allowable values of the enum
* @return string[]
*/
public static function getAllowableEnumValues()
{
return [
self::FOK,
self::DAY,
self::GTC,
self::IOC,
self::GTD
];
}
}


9 changes: 9 additions & 0 deletions test/Model/ManualTradeFormWithOptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ public function testPropertyTradingSession()
$this->markTestIncomplete('Not implemented');
}

/**
* Test attribute "expiry_date"
*/
public function testPropertyExpiryDate()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}

/**
* Test attribute "price"
*/
Expand Down
74 changes: 74 additions & 0 deletions test/Model/ManualTradePlaceTimeInForceStrictTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php
/**
* ManualTradePlaceTimeInForceStrictTest
*
* PHP version 7.4
*
* @category Class
* @package SnapTrade
* @author Konfig
* @link https://konfigthis.com
*/

/**
* SnapTrade
*
* Connect brokerage accounts to your app for live positions and trading
*
* The version of the OpenAPI document: 1.0.0
* Contact: api@snaptrade.com
* Generated by: https://konfigthis.com
*/


namespace SnapTrade\Test\Model;

use PHPUnit\Framework\TestCase;

/**
* ManualTradePlaceTimeInForceStrictTest Class Doc Comment
*
* @category Class
* @description 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: - &#x60;Day&#x60; - Day. The order is valid only for the trading day on which it is placed. - &#x60;GTC&#x60; - Good Til Canceled. The order is valid until it is executed or canceled. - &#x60;FOK&#x60; - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - &#x60;IOC&#x60; - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - &#x60;GTD&#x60; - Good Til Date. The order is valid until &#x60;expiry_date&#x60;, 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.
* @package SnapTrade
*/
class ManualTradePlaceTimeInForceStrictTest extends TestCase
{

/**
* Setup before running any test case
*/
public static function setUpBeforeClass(): void
{
}

/**
* Setup before running each test case
*/
public function setUp(): void
{
}

/**
* Clean up after running each test case
*/
public function tearDown(): void
{
}

/**
* Clean up after running all test cases
*/
public static function tearDownAfterClass(): void
{
}

/**
* Test "ManualTradePlaceTimeInForceStrict"
*/
public function testManualTradePlaceTimeInForceStrict()
{
// TODO: implement
$this->markTestIncomplete('Not implemented');
}
}