@adaptic/utils 0.0.985 → 0.0.986
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/trading-policy/defaults/default-trading-policy.d.ts.map +1 -1
- package/dist/types/trading-policy/schemas/effective-policy.schema.d.ts +24 -0
- package/dist/types/trading-policy/schemas/effective-policy.schema.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -68462,6 +68462,26 @@ const EffectiveTradingPolicySchema = objectType({
|
|
|
68462
68462
|
perTradeEquityAllocationPct: numberType(),
|
|
68463
68463
|
/** Percentage of the crypto allocation slice of account equity allocated per crypto trade. Canonical replacement for legacy AlpacaAccount.cryptoTradeAllocationPct. */
|
|
68464
68464
|
perTradeCryptoAllocationPct: numberType(),
|
|
68465
|
+
/**
|
|
68466
|
+
* Wash-trade cooldown period in milliseconds for equities. Defines the
|
|
68467
|
+
* minimum elapsed time between opposing-side fills on the same symbol per
|
|
68468
|
+
* FINRA Rule 5210, mirroring the 30s default already enforced for crypto.
|
|
68469
|
+
* Mirrors `TradingPolicy.equityWashTradeCooldownMs` in backend-legacy.
|
|
68470
|
+
* Optional so that legacy snapshots that pre-date this field continue to
|
|
68471
|
+
* parse cleanly; consumers should fall back to a 30_000ms static default
|
|
68472
|
+
* when undefined.
|
|
68473
|
+
*/
|
|
68474
|
+
equityWashTradeCooldownMs: numberType().int().nonnegative().optional(),
|
|
68475
|
+
/**
|
|
68476
|
+
* Maximum daily portfolio loss as a fraction of account equity, evaluated
|
|
68477
|
+
* intraday from the broker's `equity` vs `last_equity` delta. Breach
|
|
68478
|
+
* activates a 24h `BLOCK_NEW_OPENS` halt per Reg-T daily-loss-limit
|
|
68479
|
+
* controls. Optional so legacy snapshots parse cleanly; consumers
|
|
68480
|
+
* should fall back to the static default in `defaultRiskConfig.dailyLossLimits.maxDailyLossPercent`
|
|
68481
|
+
* (3%) when undefined. Range constrained to [0, 1) — a 100% daily-loss
|
|
68482
|
+
* threshold would be nonsensical.
|
|
68483
|
+
*/
|
|
68484
|
+
maxDailyLossPercent: numberType().min(0).max(1).optional(),
|
|
68465
68485
|
macroOverlayEnabled: booleanType(),
|
|
68466
68486
|
sectorOverlayEnabled: booleanType(),
|
|
68467
68487
|
volatilityOverlayEnabled: booleanType(),
|
|
@@ -68528,6 +68548,10 @@ const DEFAULT_TRADING_POLICY = EffectiveTradingPolicySchema.parse({
|
|
|
68528
68548
|
maxOpenOrders: 50,
|
|
68529
68549
|
perTradeEquityAllocationPct: 5,
|
|
68530
68550
|
perTradeCryptoAllocationPct: 5,
|
|
68551
|
+
// 30s wash-trade cooldown matches backend-legacy `TradingPolicy.equityWashTradeCooldownMs` default.
|
|
68552
|
+
equityWashTradeCooldownMs: 30_000,
|
|
68553
|
+
// Mirrors `defaultRiskConfig.dailyLossLimits.maxDailyLossPercent` (3% intraday loss limit).
|
|
68554
|
+
maxDailyLossPercent: 0.03,
|
|
68531
68555
|
macroOverlayEnabled: false,
|
|
68532
68556
|
sectorOverlayEnabled: false,
|
|
68533
68557
|
volatilityOverlayEnabled: false,
|