Repairing a recording from another feed¶
Two feeds of one trading day (two computers, or two brokers) record the same market, and a feed that dropped, or
started late, lacks some of what the other has. brisk repair compares recordings of the same day and writes copies of
yours with what only the other feed holds added:
brisk repair recordings/sbi-am --from recordings/eshiten-am # compare them: prints counts, writes nothing
brisk repair recordings/sbi-am --from recordings/eshiten-am --output recordings/sbi-am-repaired
brisk repair days/sbi --from days/eshiten --output days/repaired # folders of recordings: each is paired by its time
- Which recordings repair which. A recording is repaired from the other feed's recordings of its day that cover mostly
the same time (at least half of the shorter one's). Recordings with different times, such as a morning's and an
afternoon's, are pieces one after the other, not partners: a morning is never repaired from an afternoon. Give folders
(a
brisk live --outputfolder holds one recording a piece) and each recording finds its own partners, one or several, and is repaired from each in turn. - How updates are matched. A quote update is identified by its security and BRiSK's frame number (a frame's trades
together). The counts say, of each recording's updates, how many are same (the other has them, alike), only
(the other was running and lacks them), conflict (the other has that frame with other content) and outside
(before the other started or after it ended); and of its blocks (a security over
--windowminutes, 5 by default), how many are identical, lack something the other has, are lacking on both sides, or conflict. - What it writes. Your recording as it is, plus what only the other holds, in batches of their own among yours;
checked as the archive checks a broker's recording and packaged, so
brisk uploadtakes it. Where the two disagree yours stands. An update that would run backwards in time among your recording's own is counted underleft_outin the report and not added. A recording that gains nothing is not written; one recording's goes into--output, several into a folder of them by name. - How far it reaches. Only frames within your recording's own time are added, except where another recording of the
day follows it (a piece you gave, in a folder or on the command line): the gap before that one is closed, up to a
microsecond before it starts and never into it, so no time is stored twice. A recording nothing is known to follow is not
extended; for one such (a feed that stopped early)
--until 15:30:00(Tokyo's) goes that far, but not into a recording that follows. - Receipt times. An update your recording lost while it ran (it holds a later update of that security) goes in a batch of its
own just before the batch of that later update, with that batch's receipt time: a security's updates then run forward in
market time, in frame and in receipt time alike, and none counts as received before your computer knew the next one. The
report's
borrowed_receiptcounts them. (A batch holds one update of a security, so the neighbours' batches have no room; and the other feed's own batch clock can lie after your next update's, because one feed can run tens of milliseconds behind the other.) What follows everything your recording holds of a security (the gap before the next piece, a feed that stopped early) and the trades go in batches of the other's own, with its receipt time (its computer's clock); yours keep yours. - When it refuses. If a pair does not number its frames alike (most of the other's updates that yours has a frame of must be the same), no frame says what is missing: it counts and writes nothing. Recordings must be of the same day and in the current format (briskapi 1.5 or later), and the ones repaired must have ended. No recording is ever changed.