Strategy Field

Exit time in force

By default, TradersPost will send the approprate time in force of either gtc or day depending on the scenario and broker. If you want to explicitly control this, you can select a different Exit time in force in your strategy settings. Or you can send a custom timeInForce from your webhook. The value in the JSON will override the value selected in the strategy settings.

The timeInForce parameter specifies how long the order will remain active before it is executed or canceled. The following are the valid values for the timeInForce parameter:

  • day - The order is valid for the trading day and will be canceled if not executed by the end of the trading day.
  • gtc - The order is good until canceled and will remain active until it is executed or canceled.
  • opg - The order is valid for the opening of the market and will be canceled if not executed at the market open.
  • cls - The order is valid for the closing of the market and will be canceled if not executed at the market close.
  • ioc - The order is immediate or canceled, meaning it must be executed immediately or canceled.
  • fok - The order is fill or kill, meaning it must be executed immediately in its entirety or canceled.

Here is an example of a limit order with a time in force of gtc and extendedHours set to true:

{
    "ticker": "AAPL",
    "action": "sell",
    "orderType": "limit",
    "limitPrice": 150,
    "timeInForce": "day",
    "extendedHours": true
}
If you send a timeInForce that is not supported by your broker, TradersPost will fallback to the time in force configured in your strategy settings.

Ready to automate your trading? Sign up for free today.