Class LivePaperInstrument

java.lang.Object
com.qtsurfer.api.client.model.LivePaperInstrument

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.24.0") public class LivePaperInstrument extends Object
One instrument's part of a shared paper account.
  • Field Details

  • Constructor Details

    • LivePaperInstrument

      public LivePaperInstrument()
  • Method Details

    • instrument

      public LivePaperInstrument instrument(@Nonnull String instrument)
    • getInstrument

      @Nonnull public String getInstrument()
      Get instrument
      Returns:
      instrument
    • setInstrument

      public void setInstrument(@Nonnull String instrument)
    • trades

      public LivePaperInstrument trades(@Nonnull Long trades)
    • getTrades

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

      public void setTrades(@Nonnull Long trades)
    • wins

      public LivePaperInstrument wins(@Nonnull Long wins)
    • getWins

      @Nonnull public Long getWins()
      Closed trades with a PnL above zero.
      Returns:
      wins
    • setWins

      public void setWins(@Nonnull Long wins)
    • losses

      public LivePaperInstrument losses(@Nonnull Long losses)
    • getLosses

      @Nonnull public Long getLosses()
      The other closed trades; a trade with a PnL of exactly zero is a loss.
      Returns:
      losses
    • setLosses

      public void setLosses(@Nonnull Long losses)
    • realisedPnl

      public LivePaperInstrument realisedPnl(@Nonnull Double realisedPnl)
    • getRealisedPnl

      @Nonnull public Double getRealisedPnl()
      Sum of the PnL of its closed trades, in the account's currency.
      Returns:
      realisedPnl
    • setRealisedPnl

      public void setRealisedPnl(@Nonnull Double realisedPnl)
    • contributionPct

      public LivePaperInstrument contributionPct(@Nullable Double contributionPct)
    • getContributionPct

      @Nullable public Double getContributionPct()
      `realisedPnl` as a percent of the account's `initialFunding` (0-100 scale), so the contributions of the instruments add up to the account's realised return.
      Returns:
      contributionPct
    • setContributionPct

      public void setContributionPct(@Nullable Double contributionPct)
    • unrealisedPnl

      public LivePaperInstrument unrealisedPnl(@Nullable Double unrealisedPnl)
    • getUnrealisedPnl

      @Nullable public Double getUnrealisedPnl()
      What its open position is worth over its cost as of the last mark; `0` when it holds nothing. Absent while its position has no current mark (see `openPosition`).
      Returns:
      unrealisedPnl
    • setUnrealisedPnl

      public void setUnrealisedPnl(@Nullable Double unrealisedPnl)
    • totalPnl

      public LivePaperInstrument 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)
    • openPosition

      public LivePaperInstrument openPosition(@Nullable LivePaperInstrumentOpenPosition openPosition)
    • getOpenPosition

      @Nullable public LivePaperInstrumentOpenPosition getOpenPosition()
      Get openPosition
      Returns:
      openPosition
    • setOpenPosition

      public void setOpenPosition(@Nullable LivePaperInstrumentOpenPosition openPosition)
    • kpi

      public LivePaperInstrument kpi(@Nullable LivePaperKpi kpi)
    • getKpi

      @Nullable public LivePaperKpi getKpi()
      The KPIs of this instrument's closed trades alone, with the account's `initialFunding` as the capital (so `pnlTotalPercent` equals `contributionPct`). Absent until its first closed trade.
      Returns:
      kpi
    • setKpi

      public void setKpi(@Nullable LivePaperKpi kpi)
    • equals

      public boolean equals(Object o)
      Return true if this LivePaperInstrument 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