Webhook Message

Invalid Time In Force

Invalid timeInForce provided. Time in force must be one of: day, gtc, gtd, opg, cls, ioc, fok

This message indicates that the timeInForce value provided in the request is invalid. TradersPost requires that the timeInForce parameter be one of the following values: day, gtc, opg, cls, ioc, or fok. Any other value will be considered invalid, and the request will not be processed.

If you send a time in force that is not supported by your broker, TradersPost will fallback to the time in force configured in your 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.

Invalid timeInForce example:

{
    "ticker": "AAPL",
    "action": "buy",
    "orderType": "limit",
    "limitPrice": 150,
    "timeInForce": "invalid"
}

Valid timeInForce example:

{
    "ticker": "AAPL",
    "action": "buy",
    "orderType": "limit",
    "limitPrice": 150,
    "timeInForce": "day"
}

In the above examples, a valid timeInForce value ensures that the request meets the required parameters for processing.

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