@barchart/chart-lib 2.412.4 → 2.413.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.
@@ -1249,6 +1249,64 @@ declare module "@barchart/chart-lib" {
1249
1249
  curves?: Curve[],
1250
1250
  ): StudyOptions;
1251
1251
 
1252
+ export type CustomStudyOutputOptions = {
1253
+ /** Start of the range to compute over; defaults to the first bar of the basis series. */
1254
+ from?: Date;
1255
+ /** End of the range to compute over; defaults to the last bar of the basis series. */
1256
+ to?: Date;
1257
+ /** The instrument's minimum price movement; needed by VOLAP in `MinIncrements` level mode. */
1258
+ minMovement?: number;
1259
+ };
1260
+
1261
+ /** One price level of a volume profile. */
1262
+ export type VolumeAtPriceLevel = {
1263
+ priceLow: number;
1264
+ priceHigh: number;
1265
+ upVolume: number;
1266
+ downVolume: number;
1267
+ totalVolume: number;
1268
+ inValueArea: boolean;
1269
+ };
1270
+
1271
+ export type VolumeAtPriceProfile = {
1272
+ /** Time of the first bar included in the profile. */
1273
+ from: Date;
1274
+ /** Time of the last bar included in the profile. */
1275
+ to: Date;
1276
+ /** Number of bars whose volume was tallied. */
1277
+ barCount: number;
1278
+ priceLow: number;
1279
+ priceHigh: number;
1280
+ levelHeight: number;
1281
+ totalVolume: number;
1282
+ /** The level with the highest total volume (point of control); null when there is no volume. */
1283
+ pointOfControl: VolumeAtPriceLevel | null;
1284
+ /** The contiguous price range around the point of control holding `ValueRangePercent` of the volume. */
1285
+ valueArea: { priceLow: number; priceHigh: number; totalVolume: number } | null;
1286
+ /** All levels from the lowest to the highest price, including levels without volume. */
1287
+ levels: VolumeAtPriceLevel[];
1288
+ };
1289
+
1290
+ export type VolumeAtPriceOutput = {
1291
+ study: "VOLAP";
1292
+ profiles: VolumeAtPriceProfile[];
1293
+ };
1294
+
1295
+ /** Output of a study with `meta.output: "custom"`; the shape depends on the study. */
1296
+ export type CustomStudyOutput = VolumeAtPriceOutput;
1297
+
1298
+ /**
1299
+ * Computes the output of a study whose taxonomy entry declares `meta.output: "custom"`; such studies
1300
+ * produce no time series values. `series` is the ready series `makeStudy` created for the study and
1301
+ * `inputs` are the study inputs in `StudyOptions` form. Throws for studies without custom output.
1302
+ */
1303
+ export function computeCustomStudyOutput(
1304
+ studyId: string,
1305
+ series: TimeSeries,
1306
+ inputs: StudyOptions["inputs"],
1307
+ options?: CustomStudyOutputOptions,
1308
+ ): CustomStudyOutput;
1309
+
1252
1310
  export enum ExpressionMissingBar {
1253
1311
  UsePrevious,
1254
1312
  UseNext,
@@ -2809,6 +2867,11 @@ declare module "@barchart/chart-lib" {
2809
2867
  singleFieldBased: boolean;
2810
2868
  range?: StudyMetaRange;
2811
2869
  enumerations?: StudyEnumeration[];
2870
+ /**
2871
+ * Absent for studies with regular time series output. `"custom"` marks a study whose results are
2872
+ * drawn rather than stored as time series values; get them with `computeCustomStudyOutput`.
2873
+ */
2874
+ output?: "custom";
2812
2875
  }
2813
2876
 
2814
2877
  export interface StudyInput {