nexustrade 1.29.0 → 1.34.0
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/AGENTS.md
CHANGED
|
@@ -261,13 +261,13 @@ const book = nt.portfolio("Momentum", [
|
|
|
261
261
|
],
|
|
262
262
|
weightIndicator: nt.RSI(nt.CANDIDATE, 14),
|
|
263
263
|
limit: 10,
|
|
264
|
-
deploymentPercent: 80,
|
|
264
|
+
deploymentPercent: nt.Value(80),
|
|
265
265
|
})),
|
|
266
266
|
], { initialValue: 100_000 });
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
Note the key is `universe`, not `universeConfig` (the Python SDK spells it
|
|
270
|
-
`universe_config`). `deploymentPercent: 80` invests 80% of the portfolio across
|
|
270
|
+
`universe_config`). `deploymentPercent: nt.Value(80)` invests 80% of the portfolio across
|
|
271
271
|
the selection and leaves the rest in cash — a **total** cap, not per-name.
|
|
272
272
|
</details>
|
|
273
273
|
|
package/README.md
CHANGED
|
@@ -90,6 +90,10 @@ exports.Month = Month;
|
|
|
90
90
|
exports.MovingAverageConvergenceDivergence = MovingAverageConvergenceDivergence;
|
|
91
91
|
exports.Multiply = Multiply;
|
|
92
92
|
exports.Negative = Negative;
|
|
93
|
+
exports.NewInsiderDisclosure = NewInsiderDisclosure;
|
|
94
|
+
exports.NewInstitutionalFiling = NewInstitutionalFiling;
|
|
95
|
+
exports.NewPoliticalDisclosure = NewPoliticalDisclosure;
|
|
96
|
+
exports.NewTradingWeek = NewTradingWeek;
|
|
93
97
|
exports.OnBalanceVolume = OnBalanceVolume;
|
|
94
98
|
exports.OpeningPrice = OpeningPrice;
|
|
95
99
|
exports.OptionCollateral = OptionCollateral;
|
|
@@ -107,6 +111,7 @@ exports.OptionSpreadEntryPrice = OptionSpreadEntryPrice;
|
|
|
107
111
|
exports.OptionUnrealizedPnL = OptionUnrealizedPnL;
|
|
108
112
|
exports.ParabolicSar = ParabolicSar;
|
|
109
113
|
exports.Plus = Plus;
|
|
114
|
+
exports.PoliticalPurchaseShare = PoliticalPurchaseShare;
|
|
110
115
|
exports.PoliticalTrades = PoliticalTrades;
|
|
111
116
|
exports.PortfolioValue = PortfolioValue;
|
|
112
117
|
exports.PositionMaxDrawdown = PositionMaxDrawdown;
|
|
@@ -1063,17 +1068,23 @@ function InitialValue() {
|
|
|
1063
1068
|
}
|
|
1064
1069
|
/**
|
|
1065
1070
|
* InsiderTrades indicator.
|
|
1066
|
-
* @param asset
|
|
1067
|
-
* @param
|
|
1068
|
-
* @param
|
|
1069
|
-
* @param
|
|
1071
|
+
* @param asset Pass CANDIDATE in a dynamic rebalance pipeline.
|
|
1072
|
+
* @param ownerCik Exact nonzero SEC reporting owner CIK, up to 10 digits. Omit for aggregate activity.
|
|
1073
|
+
* @param issuerCik Restrict an exact owner to this company CIK; omit to follow them across companies.
|
|
1074
|
+
* @param instrument Disclosed instrument; defaults to Equity. Call/Put, award and acquisition metrics, and budget shares require ownerCik. AwardCount is SEC code A issuer acquisitions, not cash purchases or vested-share proof. Its default Equity bucket includes unresolved restricted units. AcquisitionCount and AcquisitionSharePercent combine public code P purchases with code A issuer acquisitions. Shares use qualifying signal counts across all the owner's tickers.
|
|
1070
1075
|
*/
|
|
1071
|
-
function InsiderTrades(asset, metric
|
|
1076
|
+
function InsiderTrades(asset, metric, role, windowDays, ownerCik, issuerCik, instrument) {
|
|
1072
1077
|
const d = { type: "InsiderTrades" };
|
|
1073
1078
|
setAsset(d, "targetAsset", asset);
|
|
1074
1079
|
d["metric"] = metric;
|
|
1075
1080
|
d["role"] = role;
|
|
1076
1081
|
d["windowDays"] = windowDays;
|
|
1082
|
+
if (ownerCik !== undefined)
|
|
1083
|
+
d["ownerCik"] = ownerCik;
|
|
1084
|
+
if (issuerCik !== undefined)
|
|
1085
|
+
d["issuerCik"] = issuerCik;
|
|
1086
|
+
if (instrument !== undefined)
|
|
1087
|
+
d["instrument"] = instrument;
|
|
1077
1088
|
return d;
|
|
1078
1089
|
}
|
|
1079
1090
|
/**
|
|
@@ -1082,13 +1093,15 @@ function InsiderTrades(asset, metric = "NetValue", role = "Any", windowDays = 90
|
|
|
1082
1093
|
* @param manager Optional: a CIK such as 1067983, or part of a manager's name such as Renaissance Technologies. Leave empty for every manager. A CIK is exact; a name can match several firms
|
|
1083
1094
|
* @param metric Managers holding, shares or value held, concentration, or the change since the previous quarter
|
|
1084
1095
|
* @param windowDays Read a disclosed period only if its filing became public within this many trailing days
|
|
1096
|
+
* @param instrument Calls and puts require an exact manager CIK and its effective public book
|
|
1085
1097
|
*/
|
|
1086
|
-
function InstitutionalHoldings(asset, manager, metric = "HolderCount", windowDays = 180) {
|
|
1098
|
+
function InstitutionalHoldings(asset, manager, metric = "HolderCount", windowDays = 180, instrument = "Equity") {
|
|
1087
1099
|
const d = { type: "InstitutionalHoldings" };
|
|
1088
1100
|
setAsset(d, "targetAsset", asset);
|
|
1089
1101
|
d["manager"] = manager;
|
|
1090
1102
|
d["metric"] = metric;
|
|
1091
1103
|
d["windowDays"] = windowDays;
|
|
1104
|
+
d["instrument"] = instrument;
|
|
1092
1105
|
return d;
|
|
1093
1106
|
}
|
|
1094
1107
|
/**
|
|
@@ -1438,6 +1451,54 @@ function Negative(operand) {
|
|
|
1438
1451
|
d.indicators = [operand];
|
|
1439
1452
|
return d;
|
|
1440
1453
|
}
|
|
1454
|
+
/**
|
|
1455
|
+
* NewInsiderDisclosure indicator.
|
|
1456
|
+
* @param ownerCik Exact SEC reporting owner CIK. Omit for aggregate Form 4 activity.
|
|
1457
|
+
* @param issuerCik Optional company CIK; requires ownerCik.
|
|
1458
|
+
* @param role The reporting owner's role.
|
|
1459
|
+
* @param instrument Call and Put require ownerCik.
|
|
1460
|
+
* @param disclosureAction Which newly public Form 4 action triggers a decision. Award requires ownerCik.
|
|
1461
|
+
*/
|
|
1462
|
+
function NewInsiderDisclosure(ownerCik, issuerCik, role = "Any", instrument = "Equity", disclosureAction = "Any") {
|
|
1463
|
+
const d = { type: "NewInsiderDisclosure" };
|
|
1464
|
+
if (ownerCik !== undefined)
|
|
1465
|
+
d["ownerCik"] = ownerCik;
|
|
1466
|
+
if (issuerCik !== undefined)
|
|
1467
|
+
d["issuerCik"] = issuerCik;
|
|
1468
|
+
d["role"] = role;
|
|
1469
|
+
d["instrument"] = instrument;
|
|
1470
|
+
d["disclosureAction"] = disclosureAction;
|
|
1471
|
+
return d;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* NewInstitutionalFiling indicator.
|
|
1475
|
+
* @param manager Exact numeric SEC manager CIK. A new 13F accession, including an amendment, triggers one decision.
|
|
1476
|
+
*/
|
|
1477
|
+
function NewInstitutionalFiling(manager) {
|
|
1478
|
+
const d = { type: "NewInstitutionalFiling" };
|
|
1479
|
+
d["manager"] = manager;
|
|
1480
|
+
return d;
|
|
1481
|
+
}
|
|
1482
|
+
/**
|
|
1483
|
+
* NewPoliticalDisclosure indicator.
|
|
1484
|
+
* @param memberId Exact Bioguide member ID, such as P000197.
|
|
1485
|
+
* @param instrument Equity or option disclosures, never both for a public bot arm.
|
|
1486
|
+
* @param disclosureAction Which newly public trade sides trigger a decision.
|
|
1487
|
+
*/
|
|
1488
|
+
function NewPoliticalDisclosure(memberId, instrument, disclosureAction) {
|
|
1489
|
+
const d = { type: "NewPoliticalDisclosure" };
|
|
1490
|
+
d["memberId"] = memberId;
|
|
1491
|
+
d["instrument"] = instrument;
|
|
1492
|
+
d["disclosureAction"] = disclosureAction;
|
|
1493
|
+
return d;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* NewTradingWeek indicator.
|
|
1497
|
+
*/
|
|
1498
|
+
function NewTradingWeek() {
|
|
1499
|
+
const d = { type: "NewTradingWeek" };
|
|
1500
|
+
return d;
|
|
1501
|
+
}
|
|
1441
1502
|
/**
|
|
1442
1503
|
* OnBalanceVolume indicator.
|
|
1443
1504
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1672,11 +1733,26 @@ function Plus(left, right) {
|
|
|
1672
1733
|
d.indicators = [left, right];
|
|
1673
1734
|
return d;
|
|
1674
1735
|
}
|
|
1736
|
+
/**
|
|
1737
|
+
* PoliticalPurchaseShare indicator.
|
|
1738
|
+
* @param memberId Bioguide member id, for example P000197. The share uses the member's whole public purchase record.
|
|
1739
|
+
* @param instrument Which side of the equity/option purchase mix to return, as a percent from 0 to 100.
|
|
1740
|
+
* @param amountBasis Estimate for disclosed purchase ranges. Midpoint is the default.
|
|
1741
|
+
* @param purchaseScope AllPurchases preserves historical purchase flow. RemainingLots uses surviving purchase costs across identifiable tickers; unknown partial quantities retain their original estimate. Neither is current market value.
|
|
1742
|
+
*/
|
|
1743
|
+
function PoliticalPurchaseShare(memberId, instrument = "Equity", amountBasis = "Midpoint", purchaseScope = "AllPurchases") {
|
|
1744
|
+
const d = { type: "PoliticalPurchaseShare" };
|
|
1745
|
+
d["memberId"] = memberId;
|
|
1746
|
+
d["instrument"] = instrument;
|
|
1747
|
+
d["amountBasis"] = amountBasis;
|
|
1748
|
+
d["purchaseScope"] = purchaseScope;
|
|
1749
|
+
return d;
|
|
1750
|
+
}
|
|
1675
1751
|
/**
|
|
1676
1752
|
* PoliticalTrades indicator.
|
|
1677
1753
|
* @param asset Pass CANDIDATE inside a rebalance pipeline to bind each stock.
|
|
1678
1754
|
* @param filer Member full or last name. Pass an empty string for all members.
|
|
1679
|
-
* @param metric Amount-range aggregate, event count, distinct purchasing members, or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1755
|
+
* @param metric Amount-range aggregate, event count, distinct purchasing members, RemainingBuyAmount (surviving original purchase amounts; ignores window; unknown partial quantities retained), or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1680
1756
|
* @param windowDays Trailing calendar days measured from when each event became public.
|
|
1681
1757
|
* @param amountBasis Range endpoint used by amount metrics; LowerBound is conservative.
|
|
1682
1758
|
* @param instrument Equity excludes confirmed option disclosures; Option selects them explicitly.
|
|
@@ -90,9 +90,10 @@ export interface PerNameAllocation {
|
|
|
90
90
|
type: "percent of portfolio" | "dollars";
|
|
91
91
|
amount: number;
|
|
92
92
|
}
|
|
93
|
+
/** Author budget values as indicators, including Value for a constant. */
|
|
93
94
|
export interface DeploymentBudget {
|
|
94
95
|
type: DeploymentBudgetType;
|
|
95
|
-
amount:
|
|
96
|
+
amount: Indicator;
|
|
96
97
|
}
|
|
97
98
|
export interface ExpirationSelector {
|
|
98
99
|
minDaysToExpiration: number;
|
|
@@ -317,7 +318,8 @@ export interface DynamicRebalanceAction {
|
|
|
317
318
|
pipeline: PipelineStage[];
|
|
318
319
|
weightIndicator: Indicator | CandidateIndicator;
|
|
319
320
|
limit?: number;
|
|
320
|
-
deploymentPercent?:
|
|
321
|
+
deploymentPercent?: Indicator;
|
|
322
|
+
reserveOptionBudget?: DeploymentBudget;
|
|
321
323
|
perNameAllocation?: PerNameAllocation;
|
|
322
324
|
/**
|
|
323
325
|
* Candidate-bound gate on NON-TARGET FULL EXITS only. Omitted = always sell
|
|
@@ -345,10 +347,15 @@ export interface RebalanceOptionAction {
|
|
|
345
347
|
limit?: number;
|
|
346
348
|
totalBudget?: DeploymentBudget;
|
|
347
349
|
perNameAllocation?: OptionAllocation;
|
|
350
|
+
sizingMode?: "fixedPerName" | "proportionalToWeight" | "proportionalToWeightWholeContracts";
|
|
348
351
|
positionScope?: RebalanceOptionPositionScope;
|
|
349
352
|
sleeves?: RebalanceOptionSleeve[];
|
|
350
353
|
allocationPolicy?: AllocationPolicy;
|
|
351
354
|
exposurePolicy?: ExposurePolicy;
|
|
355
|
+
/** Simulated option replacement before modeled expiry when no full sale was disclosed. */
|
|
356
|
+
renewBeforeDays?: number;
|
|
357
|
+
/** Revisit continuing public option targets only when another option filing arrives. */
|
|
358
|
+
revisitDisclosedTargets?: boolean;
|
|
352
359
|
}
|
|
353
360
|
export type OptionParentSelectionSort = "oldest" | "highestPnl" | "nearestExpiry";
|
|
354
361
|
export type ParentStrikeOffset = {
|
|
@@ -497,7 +504,11 @@ export type FundamentalMetric = "totalRevenue" | "grossProfit" | "operatingIncom
|
|
|
497
504
|
export type PositionEffect = "open" | "close";
|
|
498
505
|
export type OrderStatus = "Pending" | "Accepted" | "Pending User Approval" | "Canceled" | "Filled" | "Partially Filled";
|
|
499
506
|
export type Side = "Buy" | "Sell";
|
|
507
|
+
export type Role = "Any" | "Officer" | "Director" | "TenPercentOwner";
|
|
508
|
+
export type Instrument = "Equity" | "Call" | "Put";
|
|
509
|
+
export type Instrument2 = "Equity" | "Option";
|
|
500
510
|
export type MinOrMax = "min" | "max";
|
|
511
|
+
export type AmountBasis = "LowerBound" | "Midpoint" | "UpperBound";
|
|
501
512
|
export declare const CANDIDATE: Candidate;
|
|
502
513
|
/** Portfolio-wide targetAssets: [] — rebalance cadence, not per-ticker DCA. */
|
|
503
514
|
export declare const PORTFOLIO_WIDE: PortfolioWide;
|
|
@@ -575,7 +586,8 @@ export declare const dynamicRebalance: (config: {
|
|
|
575
586
|
pipeline: PipelineStage[];
|
|
576
587
|
weightIndicator: Indicator | CandidateIndicator;
|
|
577
588
|
limit?: number;
|
|
578
|
-
deploymentPercent?:
|
|
589
|
+
deploymentPercent?: Indicator;
|
|
590
|
+
reserveOptionBudget?: DeploymentBudget;
|
|
579
591
|
perNameAllocation?: PerNameAllocation;
|
|
580
592
|
canSell?: Condition | CandidateCondition;
|
|
581
593
|
allowShorts?: boolean;
|
|
@@ -628,6 +640,7 @@ export declare const rebalanceOption: (config: {
|
|
|
628
640
|
limit?: number;
|
|
629
641
|
totalBudget?: DeploymentBudget;
|
|
630
642
|
perNameAllocation?: OptionAllocation;
|
|
643
|
+
sizingMode?: "fixedPerName" | "proportionalToWeight" | "proportionalToWeightWholeContracts";
|
|
631
644
|
positionScope?: RebalanceOptionPositionScope;
|
|
632
645
|
sleeves?: RebalanceOptionSleeve[];
|
|
633
646
|
allocationPolicy?: AllocationPolicy;
|
|
@@ -1006,20 +1019,21 @@ export declare function IndicatorWindowAgo(operand: Indicator, length: number, i
|
|
|
1006
1019
|
export declare function InitialValue(): Indicator;
|
|
1007
1020
|
/**
|
|
1008
1021
|
* InsiderTrades indicator.
|
|
1009
|
-
* @param asset
|
|
1010
|
-
* @param
|
|
1011
|
-
* @param
|
|
1012
|
-
* @param
|
|
1022
|
+
* @param asset Pass CANDIDATE in a dynamic rebalance pipeline.
|
|
1023
|
+
* @param ownerCik Exact nonzero SEC reporting owner CIK, up to 10 digits. Omit for aggregate activity.
|
|
1024
|
+
* @param issuerCik Restrict an exact owner to this company CIK; omit to follow them across companies.
|
|
1025
|
+
* @param instrument Disclosed instrument; defaults to Equity. Call/Put, award and acquisition metrics, and budget shares require ownerCik. AwardCount is SEC code A issuer acquisitions, not cash purchases or vested-share proof. Its default Equity bucket includes unresolved restricted units. AcquisitionCount and AcquisitionSharePercent combine public code P purchases with code A issuer acquisitions. Shares use qualifying signal counts across all the owner's tickers.
|
|
1013
1026
|
*/
|
|
1014
|
-
export declare function InsiderTrades(asset: AssetArg, metric
|
|
1027
|
+
export declare function InsiderTrades(asset: AssetArg, metric: "NetValue" | "BuyValue" | "SellValue" | "NetShares" | "BuyCount" | "SellCount" | "AwardCount" | "AcquisitionCount" | "DistinctBuyers" | "PurchaseSharePercent" | "AcquisitionSharePercent", role: Role, windowDays: number, ownerCik?: string, issuerCik?: string, instrument?: Instrument): Indicator;
|
|
1015
1028
|
/**
|
|
1016
1029
|
* InstitutionalHoldings indicator.
|
|
1017
1030
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
1018
1031
|
* @param manager Optional: a CIK such as 1067983, or part of a manager's name such as Renaissance Technologies. Leave empty for every manager. A CIK is exact; a name can match several firms
|
|
1019
1032
|
* @param metric Managers holding, shares or value held, concentration, or the change since the previous quarter
|
|
1020
1033
|
* @param windowDays Read a disclosed period only if its filing became public within this many trailing days
|
|
1034
|
+
* @param instrument Calls and puts require an exact manager CIK and its effective public book
|
|
1021
1035
|
*/
|
|
1022
|
-
export declare function InstitutionalHoldings(asset: AssetArg, manager: string, metric?: "HolderCount" | "TotalShares" | "TotalValue" | "ConcentrationTop5" | "NetShareChange" | "NetHolderChange" | "NewHolders" | "ClosedHolders", windowDays?: number): Indicator;
|
|
1036
|
+
export declare function InstitutionalHoldings(asset: AssetArg, manager: string, metric?: "HolderCount" | "TotalShares" | "TotalValue" | "BookSharePercent" | "ConcentrationTop5" | "NetShareChange" | "NetHolderChange" | "NewHolders" | "ClosedHolders", windowDays?: number, instrument?: Instrument): Indicator;
|
|
1023
1037
|
/**
|
|
1024
1038
|
* IsAsset indicator.
|
|
1025
1039
|
* @param matchAsset The specific asset to compare against (ex. UPRO, GLD)
|
|
@@ -1210,6 +1224,31 @@ export declare function Multiply(left: Indicator, right: Indicator): Indicator;
|
|
|
1210
1224
|
* Negative indicator.
|
|
1211
1225
|
*/
|
|
1212
1226
|
export declare function Negative(operand: Indicator): Indicator;
|
|
1227
|
+
/**
|
|
1228
|
+
* NewInsiderDisclosure indicator.
|
|
1229
|
+
* @param ownerCik Exact SEC reporting owner CIK. Omit for aggregate Form 4 activity.
|
|
1230
|
+
* @param issuerCik Optional company CIK; requires ownerCik.
|
|
1231
|
+
* @param role The reporting owner's role.
|
|
1232
|
+
* @param instrument Call and Put require ownerCik.
|
|
1233
|
+
* @param disclosureAction Which newly public Form 4 action triggers a decision. Award requires ownerCik.
|
|
1234
|
+
*/
|
|
1235
|
+
export declare function NewInsiderDisclosure(ownerCik?: string, issuerCik?: string, role?: Role, instrument?: Instrument, disclosureAction?: "Any" | "Purchase" | "Sale" | "Award"): Indicator;
|
|
1236
|
+
/**
|
|
1237
|
+
* NewInstitutionalFiling indicator.
|
|
1238
|
+
* @param manager Exact numeric SEC manager CIK. A new 13F accession, including an amendment, triggers one decision.
|
|
1239
|
+
*/
|
|
1240
|
+
export declare function NewInstitutionalFiling(manager: string): Indicator;
|
|
1241
|
+
/**
|
|
1242
|
+
* NewPoliticalDisclosure indicator.
|
|
1243
|
+
* @param memberId Exact Bioguide member ID, such as P000197.
|
|
1244
|
+
* @param instrument Equity or option disclosures, never both for a public bot arm.
|
|
1245
|
+
* @param disclosureAction Which newly public trade sides trigger a decision.
|
|
1246
|
+
*/
|
|
1247
|
+
export declare function NewPoliticalDisclosure(memberId: string, instrument: Instrument2, disclosureAction: "Any" | "Purchase" | "Sale"): Indicator;
|
|
1248
|
+
/**
|
|
1249
|
+
* NewTradingWeek indicator.
|
|
1250
|
+
*/
|
|
1251
|
+
export declare function NewTradingWeek(): Indicator;
|
|
1213
1252
|
/**
|
|
1214
1253
|
* OnBalanceVolume indicator.
|
|
1215
1254
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1334,18 +1373,26 @@ export declare function ParabolicSar(asset: AssetArg, interval?: Interval, step?
|
|
|
1334
1373
|
* Plus indicator.
|
|
1335
1374
|
*/
|
|
1336
1375
|
export declare function Plus(left: Indicator, right: Indicator): Indicator;
|
|
1376
|
+
/**
|
|
1377
|
+
* PoliticalPurchaseShare indicator.
|
|
1378
|
+
* @param memberId Bioguide member id, for example P000197. The share uses the member's whole public purchase record.
|
|
1379
|
+
* @param instrument Which side of the equity/option purchase mix to return, as a percent from 0 to 100.
|
|
1380
|
+
* @param amountBasis Estimate for disclosed purchase ranges. Midpoint is the default.
|
|
1381
|
+
* @param purchaseScope AllPurchases preserves historical purchase flow. RemainingLots uses surviving purchase costs across identifiable tickers; unknown partial quantities retain their original estimate. Neither is current market value.
|
|
1382
|
+
*/
|
|
1383
|
+
export declare function PoliticalPurchaseShare(memberId: string, instrument?: Instrument2, amountBasis?: AmountBasis, purchaseScope?: "AllPurchases" | "RemainingLots"): Indicator;
|
|
1337
1384
|
/**
|
|
1338
1385
|
* PoliticalTrades indicator.
|
|
1339
1386
|
* @param asset Pass CANDIDATE inside a rebalance pipeline to bind each stock.
|
|
1340
1387
|
* @param filer Member full or last name. Pass an empty string for all members.
|
|
1341
|
-
* @param metric Amount-range aggregate, event count, distinct purchasing members, or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1388
|
+
* @param metric Amount-range aggregate, event count, distinct purchasing members, RemainingBuyAmount (surviving original purchase amounts; ignores window; unknown partial quantities retained), or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1342
1389
|
* @param windowDays Trailing calendar days measured from when each event became public.
|
|
1343
1390
|
* @param amountBasis Range endpoint used by amount metrics; LowerBound is conservative.
|
|
1344
1391
|
* @param instrument Equity excludes confirmed option disclosures; Option selects them explicitly.
|
|
1345
1392
|
* @param chamber Optional advanced cohort filter; named-member requests should normally use All.
|
|
1346
1393
|
* @param memberId Bioguide id such as P000197. Matches exactly and overrides filer, because names collide.
|
|
1347
1394
|
*/
|
|
1348
|
-
export declare function PoliticalTrades(asset: AssetArg, filer: string, metric?: "NetAmount" | "BuyAmount" | "SellAmount" | "BuyCount" | "SellCount" | "DistinctBuyers" | "Held", windowDays?: number, amountBasis?:
|
|
1395
|
+
export declare function PoliticalTrades(asset: AssetArg, filer: string, metric?: "NetAmount" | "BuyAmount" | "RemainingBuyAmount" | "SellAmount" | "BuyCount" | "SellCount" | "DistinctBuyers" | "Held", windowDays?: number, amountBasis?: AmountBasis, instrument?: "Equity" | "Option" | "All", chamber?: "All" | "House" | "Senate", memberId?: string): Indicator;
|
|
1349
1396
|
/**
|
|
1350
1397
|
* PortfolioValue indicator.
|
|
1351
1398
|
*/
|
|
@@ -868,17 +868,23 @@ export function InitialValue() {
|
|
|
868
868
|
}
|
|
869
869
|
/**
|
|
870
870
|
* InsiderTrades indicator.
|
|
871
|
-
* @param asset
|
|
872
|
-
* @param
|
|
873
|
-
* @param
|
|
874
|
-
* @param
|
|
871
|
+
* @param asset Pass CANDIDATE in a dynamic rebalance pipeline.
|
|
872
|
+
* @param ownerCik Exact nonzero SEC reporting owner CIK, up to 10 digits. Omit for aggregate activity.
|
|
873
|
+
* @param issuerCik Restrict an exact owner to this company CIK; omit to follow them across companies.
|
|
874
|
+
* @param instrument Disclosed instrument; defaults to Equity. Call/Put, award and acquisition metrics, and budget shares require ownerCik. AwardCount is SEC code A issuer acquisitions, not cash purchases or vested-share proof. Its default Equity bucket includes unresolved restricted units. AcquisitionCount and AcquisitionSharePercent combine public code P purchases with code A issuer acquisitions. Shares use qualifying signal counts across all the owner's tickers.
|
|
875
875
|
*/
|
|
876
|
-
export function InsiderTrades(asset, metric
|
|
876
|
+
export function InsiderTrades(asset, metric, role, windowDays, ownerCik, issuerCik, instrument) {
|
|
877
877
|
const d = { type: "InsiderTrades" };
|
|
878
878
|
setAsset(d, "targetAsset", asset);
|
|
879
879
|
d["metric"] = metric;
|
|
880
880
|
d["role"] = role;
|
|
881
881
|
d["windowDays"] = windowDays;
|
|
882
|
+
if (ownerCik !== undefined)
|
|
883
|
+
d["ownerCik"] = ownerCik;
|
|
884
|
+
if (issuerCik !== undefined)
|
|
885
|
+
d["issuerCik"] = issuerCik;
|
|
886
|
+
if (instrument !== undefined)
|
|
887
|
+
d["instrument"] = instrument;
|
|
882
888
|
return d;
|
|
883
889
|
}
|
|
884
890
|
/**
|
|
@@ -887,13 +893,15 @@ export function InsiderTrades(asset, metric = "NetValue", role = "Any", windowDa
|
|
|
887
893
|
* @param manager Optional: a CIK such as 1067983, or part of a manager's name such as Renaissance Technologies. Leave empty for every manager. A CIK is exact; a name can match several firms
|
|
888
894
|
* @param metric Managers holding, shares or value held, concentration, or the change since the previous quarter
|
|
889
895
|
* @param windowDays Read a disclosed period only if its filing became public within this many trailing days
|
|
896
|
+
* @param instrument Calls and puts require an exact manager CIK and its effective public book
|
|
890
897
|
*/
|
|
891
|
-
export function InstitutionalHoldings(asset, manager, metric = "HolderCount", windowDays = 180) {
|
|
898
|
+
export function InstitutionalHoldings(asset, manager, metric = "HolderCount", windowDays = 180, instrument = "Equity") {
|
|
892
899
|
const d = { type: "InstitutionalHoldings" };
|
|
893
900
|
setAsset(d, "targetAsset", asset);
|
|
894
901
|
d["manager"] = manager;
|
|
895
902
|
d["metric"] = metric;
|
|
896
903
|
d["windowDays"] = windowDays;
|
|
904
|
+
d["instrument"] = instrument;
|
|
897
905
|
return d;
|
|
898
906
|
}
|
|
899
907
|
/**
|
|
@@ -1243,6 +1251,54 @@ export function Negative(operand) {
|
|
|
1243
1251
|
d.indicators = [operand];
|
|
1244
1252
|
return d;
|
|
1245
1253
|
}
|
|
1254
|
+
/**
|
|
1255
|
+
* NewInsiderDisclosure indicator.
|
|
1256
|
+
* @param ownerCik Exact SEC reporting owner CIK. Omit for aggregate Form 4 activity.
|
|
1257
|
+
* @param issuerCik Optional company CIK; requires ownerCik.
|
|
1258
|
+
* @param role The reporting owner's role.
|
|
1259
|
+
* @param instrument Call and Put require ownerCik.
|
|
1260
|
+
* @param disclosureAction Which newly public Form 4 action triggers a decision. Award requires ownerCik.
|
|
1261
|
+
*/
|
|
1262
|
+
export function NewInsiderDisclosure(ownerCik, issuerCik, role = "Any", instrument = "Equity", disclosureAction = "Any") {
|
|
1263
|
+
const d = { type: "NewInsiderDisclosure" };
|
|
1264
|
+
if (ownerCik !== undefined)
|
|
1265
|
+
d["ownerCik"] = ownerCik;
|
|
1266
|
+
if (issuerCik !== undefined)
|
|
1267
|
+
d["issuerCik"] = issuerCik;
|
|
1268
|
+
d["role"] = role;
|
|
1269
|
+
d["instrument"] = instrument;
|
|
1270
|
+
d["disclosureAction"] = disclosureAction;
|
|
1271
|
+
return d;
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* NewInstitutionalFiling indicator.
|
|
1275
|
+
* @param manager Exact numeric SEC manager CIK. A new 13F accession, including an amendment, triggers one decision.
|
|
1276
|
+
*/
|
|
1277
|
+
export function NewInstitutionalFiling(manager) {
|
|
1278
|
+
const d = { type: "NewInstitutionalFiling" };
|
|
1279
|
+
d["manager"] = manager;
|
|
1280
|
+
return d;
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* NewPoliticalDisclosure indicator.
|
|
1284
|
+
* @param memberId Exact Bioguide member ID, such as P000197.
|
|
1285
|
+
* @param instrument Equity or option disclosures, never both for a public bot arm.
|
|
1286
|
+
* @param disclosureAction Which newly public trade sides trigger a decision.
|
|
1287
|
+
*/
|
|
1288
|
+
export function NewPoliticalDisclosure(memberId, instrument, disclosureAction) {
|
|
1289
|
+
const d = { type: "NewPoliticalDisclosure" };
|
|
1290
|
+
d["memberId"] = memberId;
|
|
1291
|
+
d["instrument"] = instrument;
|
|
1292
|
+
d["disclosureAction"] = disclosureAction;
|
|
1293
|
+
return d;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* NewTradingWeek indicator.
|
|
1297
|
+
*/
|
|
1298
|
+
export function NewTradingWeek() {
|
|
1299
|
+
const d = { type: "NewTradingWeek" };
|
|
1300
|
+
return d;
|
|
1301
|
+
}
|
|
1246
1302
|
/**
|
|
1247
1303
|
* OnBalanceVolume indicator.
|
|
1248
1304
|
* @param asset Ticker name (ex. SPY, BTC)
|
|
@@ -1477,11 +1533,26 @@ export function Plus(left, right) {
|
|
|
1477
1533
|
d.indicators = [left, right];
|
|
1478
1534
|
return d;
|
|
1479
1535
|
}
|
|
1536
|
+
/**
|
|
1537
|
+
* PoliticalPurchaseShare indicator.
|
|
1538
|
+
* @param memberId Bioguide member id, for example P000197. The share uses the member's whole public purchase record.
|
|
1539
|
+
* @param instrument Which side of the equity/option purchase mix to return, as a percent from 0 to 100.
|
|
1540
|
+
* @param amountBasis Estimate for disclosed purchase ranges. Midpoint is the default.
|
|
1541
|
+
* @param purchaseScope AllPurchases preserves historical purchase flow. RemainingLots uses surviving purchase costs across identifiable tickers; unknown partial quantities retain their original estimate. Neither is current market value.
|
|
1542
|
+
*/
|
|
1543
|
+
export function PoliticalPurchaseShare(memberId, instrument = "Equity", amountBasis = "Midpoint", purchaseScope = "AllPurchases") {
|
|
1544
|
+
const d = { type: "PoliticalPurchaseShare" };
|
|
1545
|
+
d["memberId"] = memberId;
|
|
1546
|
+
d["instrument"] = instrument;
|
|
1547
|
+
d["amountBasis"] = amountBasis;
|
|
1548
|
+
d["purchaseScope"] = purchaseScope;
|
|
1549
|
+
return d;
|
|
1550
|
+
}
|
|
1480
1551
|
/**
|
|
1481
1552
|
* PoliticalTrades indicator.
|
|
1482
1553
|
* @param asset Pass CANDIDATE inside a rebalance pipeline to bind each stock.
|
|
1483
1554
|
* @param filer Member full or last name. Pass an empty string for all members.
|
|
1484
|
-
* @param metric Amount-range aggregate, event count, distinct purchasing members, or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1555
|
+
* @param metric Amount-range aggregate, event count, distinct purchasing members, RemainingBuyAmount (surviving original purchase amounts; ignores window; unknown partial quantities retained), or Held: 1 while the member still holds the asset (latest public disclosure is a purchase or partial sale), ignoring the window.
|
|
1485
1556
|
* @param windowDays Trailing calendar days measured from when each event became public.
|
|
1486
1557
|
* @param amountBasis Range endpoint used by amount metrics; LowerBound is conservative.
|
|
1487
1558
|
* @param instrument Equity excludes confirmed option disclosures; Option selects them explicitly.
|