/** * One order call becomes one or more intents, `stdlib.md` 17.2 and 17.3. * * **This file says what a call means; `sizing.ts` says how much it sends and * against which position.** The two were one file until the second question * arrived: how many orders a call becomes, how large each of them is and which * position reference each one carries is arithmetic over what the leg holds, and * it is long enough written down to crowd out the vocabulary of the calls. The * sentences below about the split are still this file's, because they are why * the calls mean what they mean. * * **Every order states its own side and its own quantity outright.** Nothing * here computes a delta against an account position, for the reason 17.1 gives: * an account position is held per contract, so a second strategy, a manual * trade or this same script started twice all land in that one row, and an * order sized against it is sized against somebody else's trade. * * What a flattening order does compute against is the strategy's **own** * position, folded from its own settled fills, which is a different number with * a different owner. * * **No order crosses zero.** An instruction that would take a leg from long to * short is two orders, one closing the outgoing position and one opening the * replacement, each carrying its own position reference, so that a fill * arriving late can still say which of the two it settled. That is the split * `entering` makes, and `order.reverse` is the same pair written as one call. * * **A reducing order is sized against what is available to reduce**, which is * the settled position less everything already working against it. A position * is folded from settled fills and from nothing else (`stdlib.md` 17.8), so an * order the destination has not answered has filled nothing and has moved no * position figure: measured against the leg alone, a second close sends the * whole of it again, on the same bar and on every bar after it, and the leg * ends short with no quantity written anywhere. `closableUnits` answers it and * the ledger's own rows are where it is read from. * * **A bracket is an instruction, not an order.** `exit` and `order.bracket` set * the leg's own protective level, which is what `stdlib.md` 17.2 means when it * says a leg carries at most one stop and at most one target at a time. The tag * they take defaults to the empty string and rides along as a label, for the * destination and the report. It is not a reference to an order that has to * exist, so a bracket naming a tag nothing was ever placed with is an ordinary * call and is not refused: the level it sets belongs to the leg either way, and * `refuse.ts` measures it from the leg's own average entry price. They send an * intent so that a host has something to act on, and they append no ledger row * and move no position, because nothing has been ordered until the level is * reached. * * **A tag on a call that flattens is the other kind.** `close`'s tag defaults to * absence rather than to the empty string, and it names the part of the position * that tag entered, which is a reference to rows this ledger holds. A tag no * order in the file can place is OS7016, at the call, before any bar runs. * * **Nothing here refuses anything.** This file says what a call means; `refuse.ts` * says what the language will not do, and the ledger asks it first. The two were * one file once, and what that produced was a call whose quantity did not make * sense returning an empty list: no order, no refusal, and a script that had * been told nothing. */ import type { OrderCall } from './call.js'; import type { OrderIntent } from './intent.js'; import type { MappedOrder, Placement, PlacingContext } from './sizing.js'; export type { MappedOrder, Placement, PlacingContext } from './sizing.js'; /** * The orders one call sends, in the order it sends them. * * A call that has nothing to send sends nothing: flattening a leg that holds * nothing and reversing a position that does not exist are both instructions * about a position the strategy does not hold, and inventing a side for either * would be the engine deciding a direction the script never stated. */ export declare function ordersFor(call: OrderCall, ctx: PlacingContext): readonly MappedOrder[]; /** The intent one placement becomes, `host-interface.md` 7.1. */ export declare function intentFor(placement: Placement, intentId: number, ctx: PlacingContext): OrderIntent; //# sourceMappingURL=place.d.ts.map