Legs: cheapest symbol that reaches the target hold, last stands, a reserve that grows with size
- A batch sizes its leg on every mapped candidate, each at the leverage the broker states for it, and trades the cheapest (spread, commissions, expected swap) that reaches the target hold — else the quickest. The dashboard ranks the same way from a half-hourly candidate survey. - Last stand: when a daily-loss stop-out would leave the account within 15% of that loss above its max-drawdown floor (the account type's static max loss, or the broker's liquidation floor), the leg carries no daily-loss stop and is sized against the firm's own breach. - The daily-loss reserve is 10% of the limit or 0.1% of the position, whichever is more, since a stop's slippage grows with the position. - The account type's max notional is gone: the broker's margin rates cap each symbol. planLegSize holds the one sizing rule fireLeg, the pick and the dashboard share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a2d9df5ba4
commit
a2cd3a94c9
+11
-1
@@ -18,6 +18,13 @@ export interface PlatformAccount {
|
||||
active: boolean;
|
||||
}
|
||||
|
||||
/** How the batch's leg would size on a candidate instrument (see planLegSize):
|
||||
* null when it can't be sized there. */
|
||||
export interface PickContext {
|
||||
targetHoldHours: number;
|
||||
evaluate(contract: PlatformContract): { notional: number; holdHours: number; cost: number } | null;
|
||||
}
|
||||
|
||||
export interface PlatformContract {
|
||||
id: number | string;
|
||||
name: string;
|
||||
@@ -105,7 +112,10 @@ export interface PlatformClient {
|
||||
/** Drop the account's history from memory (the wipe routes), so it reads
|
||||
* unloaded until the next fetch rebuilds it. */
|
||||
forgetHistory(accountId: number, accountName: string): void;
|
||||
findFrontMonthContract(productName: string): Promise<PlatformContract | null>;
|
||||
/** The contract a product trades as. A platform that chooses between
|
||||
* instruments (DXTrade's symbol map) ranks them with `pick` when given —
|
||||
* how a leg would size on each — and platforms that don't, ignore it. */
|
||||
findFrontMonthContract(productName: string, pick?: PickContext): Promise<PlatformContract | null>;
|
||||
fetchInstrumentFees(symbols: string[]): Promise<{ [symbol: string]: number }>;
|
||||
|
||||
sendOrder(
|
||||
|
||||
Reference in New Issue
Block a user