LibOFX

Data Fields
OfxPositionData Struct Reference

An abstraction of a security position held in an account. More...

## Data Fields
char | account_id [OFX_ACCOUNT_ID_LENGTH]
struct OfxAccountData * | account_ptr
int | account_id_valid

## OFX mandatory <INVPOS> elements
The OFX spec defines the following elements as mandatory. The associated variables should all contain valid data but you should not trust the servers. Check if the associated *_valid is true before using them.
enum | HeldInAccountType { OFX_HELDINACCT_CASH, OFX_HELDINACCT_MARGIN, OFX_HELDINACCT_SHORT, OFX_HELDINACCT_OTHER, OFX_HELDINACCT_CASH, OFX_HELDINACCT_MARGIN, OFX_HELDINACCT_SHORT, OFX_HELDINACCT_OTHER }
enum | PositionType { OFX_POSITION_SHORT, OFX_POSITION_LONG, OFX_POSITION_SHORT, OFX_POSITION_LONG }
enum | HeldInAccountType { OFX_HELDINACCT_CASH, OFX_HELDINACCT_MARGIN, OFX_HELDINACCT_SHORT, OFX_HELDINACCT_OTHER, OFX_HELDINACCT_CASH, OFX_HELDINACCT_MARGIN, OFX_HELDINACCT_SHORT, OFX_HELDINACCT_OTHER }
enum | PositionType { OFX_POSITION_SHORT, OFX_POSITION_LONG, OFX_POSITION_SHORT, OFX_POSITION_LONG }
char | unique_id [OFX_UNIQUE_ID_LENGTH]
int | unique_id_valid
char | unique_id_type [OFX_UNIQUE_ID_TYPE_LENGTH]
int | unique_id_type_valid
enum OfxPositionData::HeldInAccountType | heldinaccount_type
int | heldinaccount_type_valid
enum OfxPositionData::PositionType | position_type
int | position_type_valid
double | units
int | units_valid
double | unit_price
int | unit_price_valid
double | market_value
int | market_value_valid
time_t | date_unit_price
int | date_unit_price_valid

## OFX optional <INVPOS> elements
The OFX spec defines the following elements as optional. The associated variables may contain valid data. Check if the associated *_valid is true before using them.
enum | Inv401kPosnSource { OFX_401K_POSN_SOURCE_PRETAX, OFX_401K_POSN_SOURCE_AFTERTAX, OFX_401K_POSN_SOURCE_MATCH, OFX_401K_POSN_SOURCE_PROFITSHARING, OFX_401K_POSN_SOURCE_ROLLOVER, OFX_401K_POSN_SOURCE_OTHERVEST, OFX_401K_POSN_SOURCE_OTHERNONVEST, OFX_401K_POSN_SOURCE_PRETAX, OFX_401K_POSN_SOURCE_AFTERTAX, OFX_401K_POSN_SOURCE_MATCH, OFX_401K_POSN_SOURCE_PROFITSHARING, OFX_401K_POSN_SOURCE_ROLLOVER, OFX_401K_POSN_SOURCE_OTHERVEST, OFX_401K_POSN_SOURCE_OTHERNONVEST }
enum | Inv401kPosnSource { OFX_401K_POSN_SOURCE_PRETAX, OFX_401K_POSN_SOURCE_AFTERTAX, OFX_401K_POSN_SOURCE_MATCH, OFX_401K_POSN_SOURCE_PROFITSHARING, OFX_401K_POSN_SOURCE_ROLLOVER, OFX_401K_POSN_SOURCE_OTHERVEST, OFX_401K_POSN_SOURCE_OTHERNONVEST, OFX_401K_POSN_SOURCE_PRETAX, OFX_401K_POSN_SOURCE_AFTERTAX, OFX_401K_POSN_SOURCE_MATCH, OFX_401K_POSN_SOURCE_PROFITSHARING, OFX_401K_POSN_SOURCE_ROLLOVER, OFX_401K_POSN_SOURCE_OTHERVEST, OFX_401K_POSN_SOURCE_OTHERNONVEST }
char | memo [OFX_MEMO_LENGTH]
int | memo_valid
enum OfxPositionData::Inv401kPosnSource | inv_401k_source
int | inv_401k_source_valid
char | currency [OFX_CURRENCY_LENGTH]
int | currency_valid
double | currency_ratio
int | currency_ratio_valid
int | amounts_are_foreign_currency
int | amounts_are_foreign_currency_valid
struct OfxSecurityData * | security_data_ptr
int | security_data_valid

## Detailed Description

An abstraction of a security position held in an account.

The OfxPositionData structure is used to hold the position information inside a OfxPositionContainer class for investment positions.

Definition at line 1172 of file inc/libofx.h.

## Member Enumeration Documentation

## ◆ HeldInAccountType [1/2]

enum OfxPositionData::HeldInAccountType

The HELDINACCT subaccount type, OFX entry will be one of CASH, MARGIN, SHORT, OTHER

Enumerator
OFX_HELDINACCT_CASH | A cash account
OFX_HELDINACCT_MARGIN | A margin account
OFX_HELDINACCT_SHORT | A short account
OFX_HELDINACCT_OTHER | An "other" account
OFX_HELDINACCT_CASH | A cash account
OFX_HELDINACCT_MARGIN | A margin account
OFX_HELDINACCT_SHORT | A short account
OFX_HELDINACCT_OTHER | An "other" account

Definition at line 1198 of file inc/libofx.h.

## ◆ HeldInAccountType [2/2]

enum OfxPositionData::HeldInAccountType

The HELDINACCT subaccount type, OFX entry will be one of CASH, MARGIN, SHORT, OTHER

Enumerator
OFX_HELDINACCT_CASH | A cash account
OFX_HELDINACCT_MARGIN | A margin account
OFX_HELDINACCT_SHORT | A short account
OFX_HELDINACCT_OTHER | An "other" account
OFX_HELDINACCT_CASH | A cash account
OFX_HELDINACCT_MARGIN | A margin account
OFX_HELDINACCT_SHORT | A short account
OFX_HELDINACCT_OTHER | An "other" account

Definition at line 1198 of file libofx-0.10.7/inc/libofx.h.

## ◆ Inv401kPosnSource [1/2]

enum OfxPositionData::Inv401kPosnSource

<INV401KSOURCE> For 401(k) accounts, source of the money used for this security

Definition at line 1242 of file libofx-0.10.7/inc/libofx.h.

## ◆ Inv401kPosnSource [2/2]

enum OfxPositionData::Inv401kPosnSource

<INV401KSOURCE> For 401(k) accounts, source of the money used for this security

Definition at line 1242 of file inc/libofx.h.

## ◆ PositionType [1/2]

enum OfxPositionData::PositionType

The position type, either SHORT or LONG

Definition at line 1208 of file inc/libofx.h.

## ◆ PositionType [2/2]

enum OfxPositionData::PositionType

The position type, either SHORT or LONG

Definition at line 1208 of file libofx-0.10.7/inc/libofx.h.

## Field Documentation

## ◆ account_id

char OfxPositionData::account_id

Account for the position Use this for matching with the relevant account in your application

Definition at line 1175 of file inc/libofx.h.

## ◆ account_ptr

struct OfxAccountData * OfxPositionData::account_ptr

Pointer to the full account structure, see OfxAccountData

Definition at line 1178 of file inc/libofx.h.

## ◆ amounts_are_foreign_currency

int OfxPositionData::amounts_are_foreign_currency

Whether the amounts have already been converted to the default currency. An <ORIGCURRENCY> sets the flag to true, i.e. the amounts are reported in the foreign currency. A <CURRENCY> element sets the flag to false.

Definition at line 1265 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ currency

char OfxPositionData::currency

<CURSYM> The currency is a string in ISO-4217 format

Definition at line 1255 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ currency_ratio

double OfxPositionData::currency_ratio

Ratio of <CURDEF> currency to <CURSYM> currency

Definition at line 1259 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ date_unit_price

time_t OfxPositionData::date_unit_price

Date and time of unit price and market value

Definition at line 1228 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ market_value

double OfxPositionData::market_value

Market value of this position

Definition at line 1224 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ memo

char OfxPositionData::memo

Position memo

Definition at line 1238 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ security_data_ptr

struct OfxSecurityData * OfxPositionData::security_data_ptr

Pointer to the security data, if found, for convenience of the libofx user A pointer to the security's data.

Definition at line 1269 of file inc/libofx.h.

## ◆ unique_id

char OfxPositionData::unique_id

The id of the security held. Mandatory for investment positions

Definition at line 1190 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ unique_id_type

char OfxPositionData::unique_id_type

Usially "CUSIP" for FIs in north america

Definition at line 1192 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ unit_price

double OfxPositionData::unit_price

Bonds=of par; options=premium per share of underlying stock; all others=price per share

Definition at line 1220 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

## ◆ units

double OfxPositionData::units

Bonds=face value; options=contracts, all others=shares

Definition at line 1216 of file inc/libofx.h.

Referenced by OfxPositionContainer::add_attribute().

The documentation for this struct was generated from the following file:

- inc/libofx.h