Schwab icon

Schwab

Interact with Schwab Trader API

Overview

This node integrates with the Schwab Trader API to place orders on a trading account. It allows users to submit detailed order requests, specifying various parameters such as order type, quantity, price, and timing instructions. This node is beneficial for automating trading workflows, enabling programmatic control over order placement without manual intervention.

Practical examples include:

  • Automatically placing market or limit orders based on signals from other systems.
  • Scheduling complex multi-leg option strategies.
  • Managing order lifecycles with custom durations and special instructions.

Properties

Name Meaning
Account Number The encrypted ID of the trading account where the order will be placed.
Session Trading session during which the order is active. Options: NORMAL, AM, PM, SEAMLESS.
Duration How long the order remains active. Options include DAY, GOOD TILL CANCEL, FILL OR KILL, IMMEDIATE OR CANCEL, END OF WEEK, END OF MONTH, NEXT END OF MONTH, UNKNOWN.
Order Type Type of order to place. Options include MARKET, LIMIT, STOP, STOP LIMIT, TRAILING STOP, CABINET, NON MARKETABLE, MARKET ON CLOSE, EXERCISE, TRAILING STOP LIMIT, NET DEBIT, NET CREDIT, NET ZERO, LIMIT ON CLOSE.
Cancel Time Specific time when the order should be canceled if not filled.
Complex Order Strategy Type Specifies complex multi-leg order strategies like COVERED, VERTICAL, BACK RATIO, CALENDAR, DIAGONAL, STRADDLE, STRANGLE, BUTTERFLY, CONDOR, IRON CONDOR, etc.
Quantity Number of units/shares/contracts to buy or sell.
Filled Quantity Number of units already filled in the order.
Remaining Quantity Number of units remaining to be filled.
Destination Link Name Identifier for routing the order to a specific destination or broker link.
Release Time Time when the order becomes active.
Stop Price Price at which a stop order triggers.
Stop Price Link Basis Basis for linking the stop price. Options: MANUAL, BASE, TRIGGER, LAST, BID, ASK, ASK BID, MARK, AVERAGE.
Stop Price Link Type Type of stop price linkage. Options: VALUE, PERCENT, TICK.
Stop Price Offset Offset applied to the stop price.
Stop Type Type of stop order. Options: STANDARD, BID, ASK, LAST, MARK.
Price Link Basis Basis for linking the price. Options: MANUAL, BASE, TRIGGER, LAST, BID, ASK, ASK BID, MARK, AVERAGE.
Price Link Type Type of price linkage. Options: VALUE, PERCENT, TICK.
Price Limit or trigger price for the order.
Tax Lot Method Method for tax lot identification. Options: FIFO, LIFO, HIGH COST, LOW COST, AVERAGE COST, SPECIFIC LOT, LOSS HARVESTER.
Order Leg Collection JSON array describing individual legs of the order, including instruments involved.
Activation Price Price at which an order activates (for conditional orders).
Special Instruction Additional instructions for order execution. Options: ALL OR NONE, DO NOT REDUCE, ALL OR NONE DO NOT REDUCE.
Order Strategy Type Strategy type for the order. Options: SINGLE, CANCEL, RECALL, PAIR, FLATTEN, TWO DAY SWAP, BLAST ALL, OCO, TRIGGER.
Order Id Unique identifier for the order (used for modifications or references).
Cancelable Boolean indicating if the order can be canceled.
Editable Boolean indicating if the order can be edited.
Status Current status of the order. Options include AWAITING PARENT ORDER, AWAITING CONDITION, ACCEPTED, QUEUED, WORKING, REJECTED, FILLED, CANCELED, EXPIRED, NEW, UNKNOWN, etc.
Entered Time Timestamp when the order was entered.
Close Time Timestamp when the order was closed.
Order Activity Collection JSON array detailing activities related to the order, such as executions.
Replacing Order Collection JSON array of orders that replace this order.
Child Order Strategies JSON array of child orders associated with this order strategy.
Status Description Text description providing additional details about the order status.
Additional Headers Optional custom HTTP headers to send with the request. Authorization headers are handled automatically.

Output

The node outputs the response from the Schwab Trader API after placing the order. The output is structured as JSON and typically contains details about the placed order, including confirmation data, order identifiers, status, and any error messages if applicable.

If the API returns an array of objects, each object is output as a separate item. Otherwise, a single JSON object representing the order response is output.

No binary data output is indicated.

Dependencies

  • Requires an OAuth2 API credential configured for authenticating with the Schwab Trader API.
  • The node sends requests to https://api.schwabapi.com/trader/v1.
  • Users may optionally add custom HTTP headers per request.
  • Proper API permissions and account access are necessary to place orders.

Troubleshooting

  • Common Issues:

    • Missing or invalid API credentials will cause authentication failures.
    • Incorrect or incomplete order parameters may result in API errors or rejected orders.
    • Network connectivity issues can prevent successful API calls.
    • JSON parsing errors if malformed JSON is provided in properties like orderLegCollection.
  • Error Messages:

    • Errors returned by the API include HTTP status codes and descriptive messages.
    • If the node is set to continue on failure, error details are included in the output JSON under an error field.
    • Common error resolution steps include verifying credentials, checking parameter values, and ensuring required fields are populated.

Links and References

Discussion