@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.mjs
CHANGED
|
@@ -68460,6 +68460,26 @@ const EffectiveTradingPolicySchema = objectType({
|
|
|
68460
68460
|
perTradeEquityAllocationPct: numberType(),
|
|
68461
68461
|
/** Percentage of the crypto allocation slice of account equity allocated per crypto trade. Canonical replacement for legacy AlpacaAccount.cryptoTradeAllocationPct. */
|
|
68462
68462
|
perTradeCryptoAllocationPct: numberType(),
|
|
68463
|
+
/**
|
|
68464
|
+
* Wash-trade cooldown period in milliseconds for equities. Defines the
|
|
68465
|
+
* minimum elapsed time between opposing-side fills on the same symbol per
|
|
68466
|
+
* FINRA Rule 5210, mirroring the 30s default already enforced for crypto.
|
|
68467
|
+
* Mirrors `TradingPolicy.equityWashTradeCooldownMs` in backend-legacy.
|
|
68468
|
+
* Optional so that legacy snapshots that pre-date this field continue to
|
|
68469
|
+
* parse cleanly; consumers should fall back to a 30_000ms static default
|
|
68470
|
+
* when undefined.
|
|
68471
|
+
*/
|
|
68472
|
+
equityWashTradeCooldownMs: numberType().int().nonnegative().optional(),
|
|
68473
|
+
/**
|
|
68474
|
+
* Maximum daily portfolio loss as a fraction of account equity, evaluated
|
|
68475
|
+
* intraday from the broker's `equity` vs `last_equity` delta. Breach
|
|
68476
|
+
* activates a 24h `BLOCK_NEW_OPENS` halt per Reg-T daily-loss-limit
|
|
68477
|
+
* controls. Optional so legacy snapshots parse cleanly; consumers
|
|
68478
|
+
* should fall back to the static default in `defaultRiskConfig.dailyLossLimits.maxDailyLossPercent`
|
|
68479
|
+
* (3%) when undefined. Range constrained to [0, 1) — a 100% daily-loss
|
|
68480
|
+
* threshold would be nonsensical.
|
|
68481
|
+
*/
|
|
68482
|
+
maxDailyLossPercent: numberType().min(0).max(1).optional(),
|
|
68463
68483
|
macroOverlayEnabled: booleanType(),
|
|
68464
68484
|
sectorOverlayEnabled: booleanType(),
|
|
68465
68485
|
volatilityOverlayEnabled: booleanType(),
|
|
@@ -68526,6 +68546,10 @@ const DEFAULT_TRADING_POLICY = EffectiveTradingPolicySchema.parse({
|
|
|
68526
68546
|
maxOpenOrders: 50,
|
|
68527
68547
|
perTradeEquityAllocationPct: 5,
|
|
68528
68548
|
perTradeCryptoAllocationPct: 5,
|
|
68549
|
+
// 30s wash-trade cooldown matches backend-legacy `TradingPolicy.equityWashTradeCooldownMs` default.
|
|
68550
|
+
equityWashTradeCooldownMs: 30_000,
|
|
68551
|
+
// Mirrors `defaultRiskConfig.dailyLossLimits.maxDailyLossPercent` (3% intraday loss limit).
|
|
68552
|
+
maxDailyLossPercent: 0.03,
|
|
68529
68553
|
macroOverlayEnabled: false,
|
|
68530
68554
|
sectorOverlayEnabled: false,
|
|
68531
68555
|
volatilityOverlayEnabled: false,
|