Learn R Programming

charlesschwabapi (version 1.0.5)

place_order: Place Order for Specific Account

Description

Given the tokens object from the `get_authentication_tokens` function, the encrypted account ID, and the request body (JSON), place the specific order. Note that due to the complexity of the orders that can be created, currently this function allows maximum flexibility by not cultivating an easier solution to building the request body and assumes the user passes the appropriate JSON. As a result, it is strongly encouraged to look at the documentation for how to build the proper orders for programmatic execution and do robust testing outside of market hours to ensure that when a live trade comes it will be just as the user intended. The user of this function assumes all risk that trades could not be executed exactly as intended.

Usage

place_order(tokens, encrypted_account_id, request_body)

Value

Returns a numeric order number and a message informing the user if the order was successfully placed/created or if there was an error.

Arguments

tokens

token object from `get_authentication_tokens` function (list).

encrypted_account_id

encrypted ID of the account from `get_account_numbers` function (string).

request_body

Valid request to API for placing an order (JSON).

Author

Nick Bultman, njbultman74@gmail.com, July 2024