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`.
  • Field Details

  • Constructor Details

    • LivePaperAccount

      public LivePaperAccount()
  • Method Details

    • currency

      public LivePaperAccount currency(@Nonnull String currency)
    • getCurrency

      @Nonnull public String getCurrency()
      The account's quote currency; every amount below is in it.
      Returns:
      currency
    • setCurrency

      public void setCurrency(@Nonnull String currency)
    • instrument

      public LivePaperAccount instrument(@Nullable String instrument)
    • getInstrument

      @Nullable public String 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

      public void setInstrument(@Nullable String instrument)
    • initialFunding

      public LivePaperAccount initialFunding(@Nonnull Double initialFunding)
    • getInitialFunding

      @Nonnull public Double getInitialFunding()
      Get initialFunding
      Returns:
      initialFunding
    • setInitialFunding

      public void setInitialFunding(@Nonnull Double initialFunding)
    • equity

      public LivePaperAccount equity(@Nonnull Double equity)
    • getEquity

      @Nonnull public Double getEquity()
      Latest recorded equity — see `equityKind`.
      Returns:
      equity
    • setEquity

      public void setEquity(@Nonnull Double equity)
    • equityAtMs

      public LivePaperAccount equityAtMs(@Nullable Long equityAtMs)
    • getEquityAtMs

      @Nullable public Long getEquityAtMs()
      Market time of that value. Absent while the account holds its starting capital.
      Returns:
      equityAtMs
    • setEquityAtMs

      public void setEquityAtMs(@Nullable Long equityAtMs)
    • equityKind

      public LivePaperAccount equityKind(@Nullable LivePaperAccount.EquityKindEnum equityKind)
    • getEquityKind

      @Nullable public LivePaperAccount.EquityKindEnum getEquityKind()
      `equity` at a closed trade, `mark` at a periodic mark-to-market (includes open positions at market price).
      Returns:
      equityKind
    • setEquityKind

      public void setEquityKind(@Nullable LivePaperAccount.EquityKindEnum equityKind)
    • realisedPnl

      public LivePaperAccount realisedPnl(@Nonnull Double realisedPnl)
    • getRealisedPnl

      @Nonnull public Double getRealisedPnl()
      Sum of the PnL of the closed trades.
      Returns:
      realisedPnl
    • setRealisedPnl

      public void setRealisedPnl(@Nonnull Double realisedPnl)
    • unrealisedPnl

      public LivePaperAccount unrealisedPnl(@Nullable Double unrealisedPnl)
    • getUnrealisedPnl

      @Nullable public Double 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

      public void setUnrealisedPnl(@Nullable Double unrealisedPnl)
    • totalPnl

      public LivePaperAccount totalPnl(@Nullable Double totalPnl)
    • getTotalPnl

      @Nullable public Double getTotalPnl()
      `realisedPnl` plus `unrealisedPnl`. Absent when `unrealisedPnl` is.
      Returns:
      totalPnl
    • setTotalPnl

      public void setTotalPnl(@Nullable Double totalPnl)
    • trades

      public LivePaperAccount trades(@Nonnull Long trades)
    • getTrades

      @Nonnull public Long getTrades()
      Closed trades.
      Returns:
      trades
    • setTrades

      public void setTrades(@Nonnull Long trades)
    • gaps

      public LivePaperAccount gaps(@Nonnull Integer gaps)
    • getGaps

      @Nonnull public Integer getGaps()
      Times open positions were lost because the run was restarted with them open.
      Returns:
      gaps
    • setGaps

      public void setGaps(@Nonnull Integer gaps)
    • openPositions

      public LivePaperAccount openPositions(@Nonnull List<LivePaperPosition> openPositions)
    • addOpenPositionsItem

      public LivePaperAccount addOpenPositionsItem(LivePaperPosition openPositionsItem)
    • getOpenPositions

      @Nonnull public List<LivePaperPosition> getOpenPositions()
      Get openPositions
      Returns:
      openPositions
    • setOpenPositions

      public void setOpenPositions(@Nonnull List<LivePaperPosition> openPositions)
    • kpi

      public LivePaperAccount kpi(@Nullable LivePaperKpi kpi)
    • getKpi

      @Nullable public LivePaperKpi getKpi()
      Get kpi
      Returns:
      kpi
    • setKpi

      public void setKpi(@Nullable LivePaperKpi kpi)
    • instruments

      public LivePaperAccount instruments(@Nullable List<LivePaperInstrument> instruments)
    • addInstrumentsItem

      public LivePaperAccount addInstrumentsItem(LivePaperInstrument instrumentsItem)
    • getInstruments

      @Nullable public List<LivePaperInstrument> 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

      public void setInstruments(@Nullable List<LivePaperInstrument> instruments)
    • equals

      public boolean equals(Object o)
      Return true if this LivePaperAccount object is equal to o.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUrlQueryString

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string