/** * One order call, read once into the fields `stdlib.md` 17.2 and 17.3 name. * * **The positions the arguments arrive in are read here and nowhere else.** * Which slot holds a quantity and which holds a trigger is a fact about the * library surface, and a fact read in two places is one that has to be corrected * in two places. The mapping to orders and the refusals both read this record, * so neither of them counts arguments. * * **An argument the script left out and an argument it wrote as absent are not * the same thing, and an order is where the difference matters most.** `buy()` * means "use the size I declared" and takes the declaration's own quantity. * `buy(qty = none)` means "I computed a size and it came out absent", which is a * sizing calculation that has not warmed up or a divisor that was zero, and it * is OS7002: an order is the one place in the language where doing nothing * quietly is worse than stopping loudly (`language.md` 6.8). * * The two used to arrive here as one value, because two of an order call's * defaults are absence itself and the compiler filled them in. So an order call * now carries one argument more than the language surface shows, and it is the * last one: the names of the arguments the script wrote, in parameter order * (`compiled-program.md` 4.10). `absent` is read from it, and names every * argument the script wrote that came out absent. Everything the script did not * write is left absent here and takes the default `stdlib.md` documents, which * the mapping applies. */ import type { Span } from '../../span/index.js'; import type { OrderSide, OrderType } from './intent.js'; /** * An order call, with every argument under the name its signature gives it. * * `trigger` is an order's stop price, which `buy` and `sell` spell `stop` and * `order.place` spells `trigger`. `stop` and `target` are a bracket's two * levels, which `exit` spells `stop` and `limit`. The two are separate fields * because they are separate things: one rests at a venue and one is a level the * strategy holds. */ export interface OrderCall { readonly name: string; /** Where the call is written, so a refusal points at it. */ readonly at: Span; /** Arguments the script wrote that came out absent, in signature order. */ readonly absent: readonly string[]; readonly side: OrderSide | null; /** The quantity the script stated, absent where it stated none. */ readonly qty: number | null; /** The type the script named, on the one call that takes one. */ readonly type: OrderType | null; readonly limit: number | null; readonly trigger: number | null; /** A bracket's target, as a price. */ readonly target: number | null; /** A bracket's stop, as a price. */ readonly stop: number | null; /** A bracket's target and stop as distances from the entry. */ readonly profit: number | null; readonly loss: number | null; /** The tag the call named, absent where it named none. */ readonly tag: string | null; } /** Reads one call, whichever of the nine it is. */ export declare function callOf(name: string, params: readonly string[], args: readonly unknown[], at: Span): OrderCall; //# sourceMappingURL=call.d.ts.map