Firstrade API Node - v1.0.2
    Preparing search index...

    Class FTAccountData

    Class for storing account information.

    Index

    Constructors

    Properties

    accountBalances: Record<string, any> = {}
    accountNumbers: string[] = []
    allAccounts: any[] = []
    session: FTSession
    userInfo: any = {}

    Methods

    • Cancel an existing order.

      Parameters

      • orderId: string

        The order ID to cancel.

      Returns Promise<any>

      Response from the API.

    • Get account balances for a given account.

      Parameters

      • account: string

        Account number of the account you want to get balances for.

      Returns Promise<any>

      Response from the API.

    • Get account history for a given account.

      Parameters

      • account: string

        Account number of the account you want to get history for.

      • dateRange: string = "ytd"

        The range of the history. Defaults to "ytd".

      • OptionalcustomRange: [string, string]

        The custom range of the history format [YYYY-MM-DD, YYYY-MM-DD]. Required if dateRange is "cust".

      Returns Promise<any>

      Response from the API.

    • Return a filtered, flattened view of useful balance fields.

      Parameters

      • account: string

        Account number to query balances for.

      • Optionalkeywords: string[]

        Additional case-insensitive substrings to match in keys.

      Returns Promise<Record<string, any>>

      A dict mapping dot-notated keys to values from the balances response.

    • Retrieve existing order data for a given account.

      Parameters

      • account: string

        Account number of the account to retrieve orders for.

      • perPage: number = 0

        Number of orders to retrieve per page. Defaults to 0 (all orders).

      Returns Promise<any>

      Response from the API.

    • Get currently held positions for a given account.

      Parameters

      • account: string

        Account number of the account you want to get positions for.

      Returns Promise<any>

      Response from the API.

    • Initialize account data by fetching user info and account list.

      Returns Promise<void>