Package com.qtsurfer.api.client.model
Class LivePaperAccount
java.lang.Object
com.qtsurfer.api.client.model.LivePaperAccount
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.24.0")
public class LivePaperAccount
extends Object
One simulated account: one per quote currency the run trades, or one per instrument when the run was started with `accounts: instrument`.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum`equity` at a closed trade, `mark` at a periodic mark-to-market (includes open positions at market price). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInstrumentsItem(LivePaperInstrument instrumentsItem) addOpenPositionsItem(LivePaperPosition openPositionsItem) booleanReturn true if this LivePaperAccount object is equal to o.equityAtMs(Long equityAtMs) equityKind(LivePaperAccount.EquityKindEnum equityKind) The account's quote currency; every amount below is in it.Latest recorded equity — see `equityKind`.Market time of that value.`equity` at a closed trade, `mark` at a periodic mark-to-market (includes open positions at market price).getGaps()Times open positions were lost because the run was restarted with them open.Get initialFundingWith `accounts: instrument`, the instrument the account is: `currency` is then its quote and several accounts can share it.Only for the shared account of a currency.getKpi()Get kpiGet openPositionsSum of the PnL of the closed trades.`realisedPnl` plus `unrealisedPnl`.Closed trades.What its open positions are worth over their cost as of the last mark, in the account's currency: the sum of `unrealisedPnl` over `openPositions`.inthashCode()initialFunding(Double initialFunding) instrument(String instrument) instruments(List<LivePaperInstrument> instruments) kpi(LivePaperKpi kpi) openPositions(List<LivePaperPosition> openPositions) realisedPnl(Double realisedPnl) voidsetCurrency(String currency) voidvoidsetEquityAtMs(Long equityAtMs) voidsetEquityKind(LivePaperAccount.EquityKindEnum equityKind) voidvoidsetInitialFunding(Double initialFunding) voidsetInstrument(String instrument) voidsetInstruments(List<LivePaperInstrument> instruments) voidsetKpi(LivePaperKpi kpi) voidsetOpenPositions(List<LivePaperPosition> openPositions) voidsetRealisedPnl(Double realisedPnl) voidsetTotalPnl(Double totalPnl) voidvoidsetUnrealisedPnl(Double unrealisedPnl) toString()Convert the instance into URL query string.toUrlQueryString(String prefix) Convert the instance into URL query string.unrealisedPnl(Double unrealisedPnl)
-
Field Details
-
JSON_PROPERTY_CURRENCY
- See Also:
-
JSON_PROPERTY_INSTRUMENT
- See Also:
-
JSON_PROPERTY_INITIAL_FUNDING
- See Also:
-
JSON_PROPERTY_EQUITY
- See Also:
-
JSON_PROPERTY_EQUITY_AT_MS
- See Also:
-
JSON_PROPERTY_EQUITY_KIND
- See Also:
-
JSON_PROPERTY_REALISED_PNL
- See Also:
-
JSON_PROPERTY_UNREALISED_PNL
- See Also:
-
JSON_PROPERTY_TOTAL_PNL
- See Also:
-
JSON_PROPERTY_TRADES
- See Also:
-
JSON_PROPERTY_GAPS
- See Also:
-
JSON_PROPERTY_OPEN_POSITIONS
- See Also:
-
JSON_PROPERTY_KPI
- See Also:
-
JSON_PROPERTY_INSTRUMENTS
- See Also:
-
-
Constructor Details
-
LivePaperAccount
public LivePaperAccount()
-
-
Method Details
-
currency
-
getCurrency
The account's quote currency; every amount below is in it.- Returns:
- currency
-
setCurrency
-
instrument
-
getInstrument
With `accounts: instrument`, the instrument the account is: `currency` is then its quote and several accounts can share it. Absent for the shared account of a currency. Such an account has no `instruments`, since it already is one instrument: its `unrealisedPnl` and `totalPnl` are that instrument's own. Its `initialFunding` is its own: never add it to another account's.- Returns:
- instrument
-
setInstrument
-
initialFunding
-
getInitialFunding
Get initialFunding- Returns:
- initialFunding
-
setInitialFunding
-
equity
-
getEquity
Latest recorded equity — see `equityKind`.- Returns:
- equity
-
setEquity
-
equityAtMs
-
getEquityAtMs
Market time of that value. Absent while the account holds its starting capital.- Returns:
- equityAtMs
-
setEquityAtMs
-
equityKind
-
getEquityKind
`equity` at a closed trade, `mark` at a periodic mark-to-market (includes open positions at market price).- Returns:
- equityKind
-
setEquityKind
-
realisedPnl
-
getRealisedPnl
Sum of the PnL of the closed trades.- Returns:
- realisedPnl
-
setRealisedPnl
-
unrealisedPnl
-
getUnrealisedPnl
What its open positions are worth over their cost as of the last mark, in the account's currency: the sum of `unrealisedPnl` over `openPositions`. `0` when it holds nothing. Absent while any of its positions has no current mark (see `openPositions`).- Returns:
- unrealisedPnl
-
setUnrealisedPnl
-
totalPnl
-
getTotalPnl
`realisedPnl` plus `unrealisedPnl`. Absent when `unrealisedPnl` is.- Returns:
- totalPnl
-
setTotalPnl
-
trades
-
getTrades
Closed trades.- Returns:
- trades
-
setTrades
-
gaps
-
getGaps
Times open positions were lost because the run was restarted with them open.- Returns:
- gaps
-
setGaps
-
openPositions
-
addOpenPositionsItem
-
getOpenPositions
Get openPositions- Returns:
- openPositions
-
setOpenPositions
-
kpi
-
getKpi
Get kpi- Returns:
- kpi
-
setKpi
-
instruments
-
addInstrumentsItem
-
getInstruments
Only for the shared account of a currency. What the account realised per instrument: one entry for every instrument that has closed a trade or holds a position now, in instrument order. Exact for what was realised, and not how the instrument would have done on its own, since its entries depended on what the others had locked from the same account. The instruments' `realisedPnl` add up to the account's.- Returns:
- instruments
-
setInstruments
-
equals
Return true if this LivePaperAccount object is equal to o. -
hashCode
public int hashCode() -
toString
-
toUrlQueryString
Convert the instance into URL query string.- Returns:
- URL query string
-
toUrlQueryString
Convert the instance into URL query string.- Parameters:
prefix- prefix of the query string- Returns:
- URL query string
-