Read a run's paper equity curve
One paper account's equity curve, oldest first, in the same shape as every other equity
curve of this API (EquityCurveResult): {points, meta}, or {timestamps, equities, meta}
with outMode=SHORT, shaped by the same outMode, resample and differential query
parameters, with the account's currency and its gaps alongside. The curve is kept for
the life of the run, so unlike signals it has no moving window.
It is one series of running equity: the value after every closed trade and, every minute
of market time while positions are open, the value marked to market. Where the run was
restarted with positions open, those positions are not carried over, so the curve has no
value there: that moment is listed in gaps and is not a point of the curve.
A run has one account per quote currency and accounts are never summed. currency chooses
the account; it may be left out only when the run has a single account, or none yet (an
empty curve). In a run started with accounts: instrument each instrument is an account:
instrument selects it, and the answer is that account's own curve, its equity with its
gaps, with the instrument beside the currency. currency may then be given instead
only while it names a single account, and measure does not apply (400).
sinceMs reads from that market time on, inclusive, which is how a client that already
holds a curve reads only what is new. A curve too long to be read in one request answers
400: narrow it with sinceMs, or page it. As for any equity curve, the server may force
a smaller representation above its size thresholds: meta.outMode is the source of truth
for what came back.
Paging is opt-in. With limit or cursor the answer is one page of the raw curve, oldest
first, with _links.next while there is more: the way to read a long curve at full
resolution, since a long one is otherwise resampled. A page has the same shape (outMode
and differential apply to it, and each page is decoded on its own), holds at most limit
entries (a gap counts as one), and resample cannot be combined with it. The cursor is
opaque: follow _links.next.href as given.
With instrument the answer is that instrument's cumulative realised PnL, from 0, in the
same shape, with the same options and paging: a point at each of its closed trades. The
instrument belongs to the account of its quote currency, so currency need not be given.
measure says what the values are: equity for an account's curve, realisedPnl for an
instrument's (the shape calls them equity either way). The last values of the curves of
the instruments of an account add up to the account's realisedPnl. In between they
follow the realised part of the account's own curve only up to the order the trades were
processed in: that curve is recorded in that order and this one is served by event time,
and two instruments that close almost together can be stamped slightly out of it, so at
those points the two differ by one trade. The gaps of an account are not attributed to an
instrument, so gaps is empty.
An instrument's curve can include what it holds and has not sold: with measure=totalPnl
each point is the instrument's realised PnL up to then plus the unrealised value of its open
position, at each closed trade (where nothing is held, so it is the realised PnL) and at
each mark while a position is open. The answer says measure: totalPnl. measure is only
for an instrument's curve: an account's is equity and already includes its marks.
Readable by the run's owner, and by anyone if the run is public and has reached the live
stage.
Read a run's paper equity curve One paper account's equity curve, oldest first, in the same shape as every other equity curve of this API (
EquityCurveResult):{points, meta}, or{timestamps, equities, meta}withoutMode=SHORT, shaped by the sameoutMode,resampleanddifferentialquery parameters, with the account'scurrencyand itsgapsalongside. The curve is kept for the life of the run, so unlike signals it has no moving window.It is one series of running equity: the value after every closed trade and, every minute of market time while positions are open, the value marked to market. Where the run was restarted with positions open, those positions are not carried over, so the curve has no value there: that moment is listed in
gapsand is not a point of the curve.A run has one account per quote currency and accounts are never summed.
currencychooses the account; it may be left out only when the run has a single account, or none yet (an empty curve). In a run started withaccounts: instrumenteach instrument is an account:instrumentselects it, and the answer is that account's own curve, itsequitywith itsgaps, with theinstrumentbeside thecurrency.currencymay then be given instead only while it names a single account, andmeasuredoes not apply (400).sinceMsreads from that market time on, inclusive, which is how a client that already holds a curve reads only what is new. A curve too long to be read in one request answers400: narrow it withsinceMs, or page it. As for any equity curve, the server may force a smaller representation above its size thresholds:meta.outModeis the source of truth for what came back.Paging is opt-in. With
limitorcursorthe answer is one page of the raw curve, oldest first, with_links.nextwhile there is more: the way to read a long curve at full resolution, since a long one is otherwise resampled. A page has the same shape (outModeanddifferentialapply to it, and each page is decoded on its own), holds at mostlimitentries (a gap counts as one), andresamplecannot be combined with it. The cursor is opaque: follow_links.next.hrefas given.With
instrumentthe answer is that instrument's cumulative realised PnL, from 0, in the same shape, with the same options and paging: a point at each of its closed trades. The instrument belongs to the account of its quote currency, socurrencyneed not be given.measuresays what the values are:equityfor an account's curve,realisedPnlfor an instrument's (the shape calls themequityeither way). The last values of the curves of the instruments of an account add up to the account'srealisedPnl. In between they follow the realised part of the account's own curve only up to the order the trades were processed in: that curve is recorded in that order and this one is served by event time, and two instruments that close almost together can be stamped slightly out of it, so at those points the two differ by one trade. The gaps of an account are not attributed to an instrument, sogapsis empty.An instrument's curve can include what it holds and has not sold: with
measure=totalPnleach point is the instrument's realised PnL up to then plus the unrealised value of its open position, at each closed trade (where nothing is held, so it is the realised PnL) and at each mark while a position is open. The answer saysmeasure: totalPnl.measureis only for an instrument's curve: an account's isequityand already includes its marks.Readable by the run's owner, and by anyone if the run is
publicand has reached thelivestage.