LibOFX
OfxPositionData Struct Reference

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

Data Fields

char account_id [OFX_ACCOUNT_ID_LENGTH]
 
struct OfxAccountDataaccount_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 OfxSecurityDatasecurity_data_ptr
 
int security_data_valid
 

Detailed Description

An abstraction of a security position held in an account.

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

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

Member Enumeration Documentation

◆ HeldInAccountType [1/2]

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 1187 of file inc/libofx.h.

◆ HeldInAccountType [2/2]

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 1187 of file libofx-0.10.0/inc/libofx.h.

◆ Inv401kPosnSource [1/2]

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

Definition at line 1231 of file libofx-0.10.0/inc/libofx.h.

◆ Inv401kPosnSource [2/2]

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

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

◆ PositionType [1/2]

The position type, either SHORT or LONG

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

◆ PositionType [2/2]

The position type, either SHORT or LONG

Definition at line 1197 of file libofx-0.10.0/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 1164 of file inc/libofx.h.

◆ account_ptr

struct OfxAccountData * OfxPositionData::account_ptr

Pointer to the full account structure, see OfxAccountData

Definition at line 1167 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 1254 of file inc/libofx.h.

◆ currency

char OfxPositionData::currency

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

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

◆ currency_ratio

double OfxPositionData::currency_ratio

Ratio of <CURDEF> currency to <CURSYM> currency

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

◆ date_unit_price

time_t OfxPositionData::date_unit_price

Date and time of unit price and market value

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

◆ market_value

double OfxPositionData::market_value

Market value of this position

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

◆ memo

char OfxPositionData::memo

Position memo

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

◆ 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 1258 of file inc/libofx.h.

◆ unique_id

char OfxPositionData::unique_id

The id of the security held. Mandatory for investment positions

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

Referenced by OfxSecurityContainer::add_attribute().

◆ unique_id_type

char OfxPositionData::unique_id_type

Usially "CUSIP" for FIs in north america

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

Referenced by OfxSecurityContainer::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 1209 of file inc/libofx.h.

◆ units

double OfxPositionData::units

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

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


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