@pipsend/charts 2.0.1 → 2.2.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/README.md +70 -0
- package/dist/pipsend-charts.development.mjs +244 -3
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +246 -2
- package/dist/pipsend-charts.standalone.development.mjs +244 -3
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +97 -0
- package/package.json +1 -1
package/dist/typings.d.ts
CHANGED
|
@@ -1902,6 +1902,28 @@ export declare function applyDonchianChannels(series: ISeriesApi<SeriesType>, ch
|
|
|
1902
1902
|
export declare function applyEMA(series: ISeriesApi<SeriesType>, chart: IChartApi, options?: EMAOptions): IndicatorRuntime<EMAOptions> & {
|
|
1903
1903
|
series: ISeriesApi<"Line">;
|
|
1904
1904
|
};
|
|
1905
|
+
/**
|
|
1906
|
+
* Draw a source series as Heikin Ashi candles.
|
|
1907
|
+
*
|
|
1908
|
+
* The source series is left in place holding its real prices — it is only
|
|
1909
|
+
* painted transparent — so indicators bound to it keep computing on the true
|
|
1910
|
+
* OHLC, its price lines and primitives stay on screen, and `remove()` puts the
|
|
1911
|
+
* chart back exactly as it was. That makes this usable as a chart-type toggle:
|
|
1912
|
+
*
|
|
1913
|
+
* ```js
|
|
1914
|
+
* const ha = applyHeikinAshi(candleSeries, chart);
|
|
1915
|
+
* // …back to regular candles:
|
|
1916
|
+
* ha.remove();
|
|
1917
|
+
* ```
|
|
1918
|
+
*
|
|
1919
|
+
* @param series - Source OHLC series (a candlestick or bar series).
|
|
1920
|
+
* @param chart - Chart instance.
|
|
1921
|
+
* @param options - Heikin Ashi configuration options.
|
|
1922
|
+
* @returns The Heikin Ashi candlestick series, plus live control over its options.
|
|
1923
|
+
*/
|
|
1924
|
+
export declare function applyHeikinAshi(series: ISeriesApi<SeriesType>, chart: IChartApi, options?: HeikinAshiOptions): IndicatorRuntime<HeikinAshiOptions> & {
|
|
1925
|
+
series: ISeriesApi<"Candlestick">;
|
|
1926
|
+
};
|
|
1905
1927
|
/**
|
|
1906
1928
|
* Ichimoku Kinko Hyo.
|
|
1907
1929
|
*
|
|
@@ -2106,6 +2128,32 @@ export declare function applyWMA(series: ISeriesApi<SeriesType>, chart: IChartAp
|
|
|
2106
2128
|
export declare function applyWilliamsR(series: ISeriesApi<SeriesType>, chart: IChartApi, options?: WilliamsROptions): IndicatorRuntime<WilliamsROptions> & {
|
|
2107
2129
|
series: ISeriesApi<"Line">;
|
|
2108
2130
|
};
|
|
2131
|
+
/**
|
|
2132
|
+
* Turns raw OHLC bars into Heikin Ashi ones.
|
|
2133
|
+
*
|
|
2134
|
+
* Heikin Ashi is a price transform, not an overlay: each candle averages itself
|
|
2135
|
+
* with the one before it, which drops most of the single-bar noise and leaves
|
|
2136
|
+
* runs of same-coloured bodies while a trend holds.
|
|
2137
|
+
*
|
|
2138
|
+
* ```
|
|
2139
|
+
* close = (O + H + L + C) / 4
|
|
2140
|
+
* open = (previous open + previous close) / 2 // first bar: (O + C) / 2
|
|
2141
|
+
* high = max(H, open, close)
|
|
2142
|
+
* low = min(L, open, close)
|
|
2143
|
+
* ```
|
|
2144
|
+
*
|
|
2145
|
+
* Because every bar folds in the one before it, the result depends on where the
|
|
2146
|
+
* data starts: the same bar computed from a longer history differs slightly.
|
|
2147
|
+
* The difference decays over a few bars, so pass the whole series rather than a
|
|
2148
|
+
* recent window when you can.
|
|
2149
|
+
*
|
|
2150
|
+
* Whitespace items are passed through untouched, and do not advance the
|
|
2151
|
+
* running open/close — a gap in the data is not a bar.
|
|
2152
|
+
*
|
|
2153
|
+
* @param bars - Source bars, ordered oldest to newest.
|
|
2154
|
+
* @returns The transformed bars, one per input item.
|
|
2155
|
+
*/
|
|
2156
|
+
export declare function calculateHeikinAshi<HorzScaleItem = Time>(bars: readonly HeikinAshiInput<HorzScaleItem>[]): HeikinAshiPoint<HorzScaleItem>[];
|
|
2109
2157
|
/**
|
|
2110
2158
|
* Automatically calculate pip configuration based on price
|
|
2111
2159
|
* This is completely generic and works for any instrument
|
|
@@ -2426,6 +2474,21 @@ export declare function defaultHorzScaleBehavior(): new () => IHorzScaleBehavior
|
|
|
2426
2474
|
* Now ignores symbol and uses price-based detection
|
|
2427
2475
|
*/
|
|
2428
2476
|
export declare function getPipConfig(symbolOrPrice: string | number, price?: number): PipConfig;
|
|
2477
|
+
/**
|
|
2478
|
+
* Take a series off the screen without hiding it.
|
|
2479
|
+
*
|
|
2480
|
+
* `visible: false` takes down everything hung off the series as well: its
|
|
2481
|
+
* price lines, primitives and price-axis label stop rendering. A transform
|
|
2482
|
+
* that only wants the bars themselves out of the way — Heikin Ashi drawing
|
|
2483
|
+
* over its source — needs the series to stay visible to the engine, so its
|
|
2484
|
+
* paint is made transparent instead and the last-value label and price line
|
|
2485
|
+
* are switched off. Custom series have no known colours; those fall back to
|
|
2486
|
+
* `visible: false`.
|
|
2487
|
+
*
|
|
2488
|
+
* @param series - Series to blank out.
|
|
2489
|
+
* @returns Puts back the options the series had when it was blanked.
|
|
2490
|
+
*/
|
|
2491
|
+
export declare function hideSeriesPaint(series: ISeriesApi<SeriesType>): () => void;
|
|
2429
2492
|
/**
|
|
2430
2493
|
* Check if a time value is a business day object.
|
|
2431
2494
|
*
|
|
@@ -3612,6 +3675,36 @@ export interface HandleScrollOptions {
|
|
|
3612
3675
|
*/
|
|
3613
3676
|
vertTouchDrag: boolean;
|
|
3614
3677
|
}
|
|
3678
|
+
export interface HeikinAshiOptions {
|
|
3679
|
+
/** Pane the candles are drawn in. Fixed at creation. */
|
|
3680
|
+
paneIndex?: number;
|
|
3681
|
+
/** Color of rising Heikin Ashi candles. */
|
|
3682
|
+
upColor?: string;
|
|
3683
|
+
/** Color of falling Heikin Ashi candles. */
|
|
3684
|
+
downColor?: string;
|
|
3685
|
+
/** Enable candle borders. */
|
|
3686
|
+
borderVisible?: boolean;
|
|
3687
|
+
/** Border color of rising candles. */
|
|
3688
|
+
borderUpColor?: string;
|
|
3689
|
+
/** Border color of falling candles. */
|
|
3690
|
+
borderDownColor?: string;
|
|
3691
|
+
/** Enable high and low price candle wicks. */
|
|
3692
|
+
wickVisible?: boolean;
|
|
3693
|
+
/** Wick color of rising candles. */
|
|
3694
|
+
wickUpColor?: string;
|
|
3695
|
+
/** Wick color of falling candles. */
|
|
3696
|
+
wickDownColor?: string;
|
|
3697
|
+
/**
|
|
3698
|
+
* Blank out the source series while the Heikin Ashi candles are shown, so
|
|
3699
|
+
* the two do not overlap. The source is painted transparent rather than
|
|
3700
|
+
* hidden: it stays visible to the engine, so its price lines, primitives
|
|
3701
|
+
* and everything else hung off it keep rendering. `remove()` puts its paint
|
|
3702
|
+
* back.
|
|
3703
|
+
*
|
|
3704
|
+
* @defaultValue `true`
|
|
3705
|
+
*/
|
|
3706
|
+
hideSource?: boolean;
|
|
3707
|
+
}
|
|
3615
3708
|
/**
|
|
3616
3709
|
* Structure describing a single item of data for histogram series
|
|
3617
3710
|
*/
|
|
@@ -7478,6 +7571,10 @@ export type DrawingToolType = "ruler" | "fibonacci" | "position" | "trendline" |
|
|
|
7478
7571
|
* The valid values are integers in range [0, 255]
|
|
7479
7572
|
*/
|
|
7480
7573
|
export type GreenComponent = Nominal<number, "GreenComponent">;
|
|
7574
|
+
/** A bar the Heikin Ashi transform can read: a real OHLC bar, or a gap. */
|
|
7575
|
+
export type HeikinAshiInput<HorzScaleItem = Time> = OhlcData<HorzScaleItem> | WhitespaceData<HorzScaleItem>;
|
|
7576
|
+
/** What it produces: a smoothed candle per input bar, gaps passed through. */
|
|
7577
|
+
export type HeikinAshiPoint<HorzScaleItem = Time> = CandlestickData<HorzScaleItem> | WhitespaceData<HorzScaleItem>;
|
|
7481
7578
|
/**
|
|
7482
7579
|
* Represents histogram series options.
|
|
7483
7580
|
*/
|
package/package.json
CHANGED