acttrader-charts 1.4.0-beta.8 → 1.4.0-beta.9
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 +14 -2
- package/dist/{MACD-DhhHgWNz.d.cts → MACD-bQUtyW2N.d.cts} +11 -1
- package/dist/{MACD-DhhHgWNz.d.ts → MACD-bQUtyW2N.d.ts} +11 -1
- package/dist/{chunk-4G4AO6TL.js → chunk-M4RUXSMW.js} +3 -3
- package/dist/{chunk-4G4AO6TL.js.map → chunk-M4RUXSMW.js.map} +1 -1
- package/dist/index.cjs +142 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +143 -75
- package/dist/index.js.map +1 -1
- package/dist/indicators/index.cjs +1 -1
- package/dist/indicators/index.cjs.map +1 -1
- package/dist/indicators/index.d.cts +2 -2
- package/dist/indicators/index.d.ts +2 -2
- package/dist/indicators/index.js +1 -1
- package/dist/webview/chart.html +20 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ const chart = new ChartEngine({
|
|
|
69
69
|
// changes, and (unless `reloadOnPriceSourceChange: false`) whenever the price source changes.
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
If the first fetch returns fewer than `minInitialBars` (default `10`), the engine automatically widens the lookback window and calls `dataLoader` again — up to the `maxLookbackMs` ceiling (default 365 days). This keeps the chart useful on weekends, holidays, or for instruments that just listed.
|
|
72
|
+
If the first fetch returns fewer than `minInitialBars` (default `10`), the engine automatically widens the lookback window and calls `dataLoader` again — up to the `maxLookbackMs` ceiling (default 365 days). That ceiling limits only the retries: with no duration selected, the first fetch always asks for `maxCandles` bars, so a 1W chart loads about four years rather than one. This keeps the chart useful on weekends, holidays, or for instruments that just listed. The engine keeps the retry that returned the most bars and stops widening once a wider window returns fewer, because feeds often return nothing for very large ranges (17 days of 1m). A failed retry keeps the bars already received. If no retry returned any bar, or the first request failed, the engine shows a **"No data available"** overlay (customise the text via `labels.chart.noData`). Scrolling back into older history follows the same rule.
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -532,7 +532,7 @@ use `{symbol}` and `{count}`. The maths behind the pill is exported as
|
|
|
532
532
|
| `tickActivityMs` | | `30000` | ms the stream dot stays green after last tick |
|
|
533
533
|
| `maxCandles` | | `200` | Max bars fetched per data-load request |
|
|
534
534
|
| `minInitialBars` | | `10` | If `dataLoader` returns fewer bars, the fetch window auto-widens and retries (handles weekends, market closures, and sparse symbols) |
|
|
535
|
-
| `maxLookbackMs` | | `31_536_000_000` | Hard ceiling on auto-widening lookback (ms). Retries stop once the window reaches this. Default: 365 days |
|
|
535
|
+
| `maxLookbackMs` | | `31_536_000_000` | Hard ceiling on auto-widening lookback (ms). Retries stop once the window reaches this. Default: 365 days. The first request (no duration selected) always covers `maxCandles` bars even when that is longer, e.g. 200 × 1W ≈ 4 years, so long-period studies (TEMA, TRIX, KVO, CRSI) draw on weekly charts |
|
|
536
536
|
| `prefetchThreshold` | | `80` | Bars from start of data at which historical fetch triggers (min 20) |
|
|
537
537
|
| `mobileBarDivisor` | | `2` | Divide desktop visible bar count on touch devices (`2`, `3`, or `4`) |
|
|
538
538
|
| `momentumScrollEnabled` | | `true` | Enable momentum (kinetic) scrolling — chart coasts after a fast flick |
|
|
@@ -1908,6 +1908,14 @@ needs two. Until then their pane shows *"Click Compare in the chart header to ad
|
|
|
1908
1908
|
indicator"* instead of staying blank, and they fill in as soon as the compare
|
|
1909
1909
|
loads.
|
|
1910
1910
|
|
|
1911
|
+
**No volume, no plot.** When no loaded bar has volume, volume studies are not
|
|
1912
|
+
plotted at all — no line, no pane, no pill — and the indicator menus leave them
|
|
1913
|
+
out (the Volume heading too, when it would be empty), in search as well. One
|
|
1914
|
+
added anyway (API, bridge, saved layout) is kept and shows a short notice; it
|
|
1915
|
+
appears by itself once data with volume loads. `dataLoaded` carries `hasVolume`
|
|
1916
|
+
and `barCount`; the WebView bridge also posts `volumeAvailability { hasVolume }`
|
|
1917
|
+
and marks catalog indicators `requiresVolume`.
|
|
1918
|
+
|
|
1911
1919
|
**Bars without volume become gaps.** Volume studies (Volume, OBV, A/D, MFI, CMF,
|
|
1912
1920
|
VWAP, EOM, EFI, Klinger, Volume Oscillator, Net Volume, PVT, Chaikin Oscillator)
|
|
1913
1921
|
draw nothing on bars whose feed sent no volume (missing or 0). The line ends at
|
|
@@ -1918,6 +1926,10 @@ no volume in view says *"No volume data from the feed for these bars"*.
|
|
|
1918
1926
|
loaded history when that is shorter. **Zig Zag** always draws its latest leg,
|
|
1919
1927
|
even when no swing has reached the deviation yet. Large sub-pane axis values are
|
|
1920
1928
|
shortened (1.83M, -45.6B).
|
|
1929
|
+
**Chande Kroll Stop** follows the standard formula (stop short = highest of the
|
|
1930
|
+
high stop, stop long = lowest of the low stop), so both lines sit near price. The
|
|
1931
|
+
main pane's auto-scale includes the upper and lower lines of band studies (52W
|
|
1932
|
+
H/L, Chande Kroll, Bollinger, …), so those lines stay on screen.
|
|
1921
1933
|
|
|
1922
1934
|
### Native wrapper parity
|
|
1923
1935
|
|
|
@@ -1465,7 +1465,9 @@ interface ChartConfig {
|
|
|
1465
1465
|
/**
|
|
1466
1466
|
* Hard ceiling (in milliseconds) on how far back auto-widening retries
|
|
1467
1467
|
* can reach when chasing enough bars. Retries stop once the window meets
|
|
1468
|
-
* or exceeds this value. Default: 365 days.
|
|
1468
|
+
* or exceeds this value. Default: 365 days. Without a duration, the first
|
|
1469
|
+
* request always covers `maxCandles` bars, even when that is longer
|
|
1470
|
+
* (e.g. 200 × 1W ≈ 4 years), so long-period studies have bars to draw.
|
|
1469
1471
|
*/
|
|
1470
1472
|
maxLookbackMs?: number;
|
|
1471
1473
|
/**
|
|
@@ -2784,6 +2786,14 @@ type ChartEventMap = {
|
|
|
2784
2786
|
end: Date;
|
|
2785
2787
|
/** Candle price source the bars were requested with (see `DataLoaderParams.priceSource`). */
|
|
2786
2788
|
priceSource: 'bid' | 'ask' | 'ltp';
|
|
2789
|
+
/** Bars on the chart after the load. */
|
|
2790
|
+
barCount: number;
|
|
2791
|
+
/**
|
|
2792
|
+
* Whether any loaded bar has volume. When false, volume studies
|
|
2793
|
+
* (Volume, VWAP, OBV, MFI, …) are not plotted; native menus can grey
|
|
2794
|
+
* them out — the catalog marks them `requiresVolume`.
|
|
2795
|
+
*/
|
|
2796
|
+
hasVolume: boolean;
|
|
2787
2797
|
};
|
|
2788
2798
|
/** Emitted when the user clicks the × button on a trade, position, or bracket (SL/TP) level. */
|
|
2789
2799
|
tradeLevelClose: {
|
|
@@ -1465,7 +1465,9 @@ interface ChartConfig {
|
|
|
1465
1465
|
/**
|
|
1466
1466
|
* Hard ceiling (in milliseconds) on how far back auto-widening retries
|
|
1467
1467
|
* can reach when chasing enough bars. Retries stop once the window meets
|
|
1468
|
-
* or exceeds this value. Default: 365 days.
|
|
1468
|
+
* or exceeds this value. Default: 365 days. Without a duration, the first
|
|
1469
|
+
* request always covers `maxCandles` bars, even when that is longer
|
|
1470
|
+
* (e.g. 200 × 1W ≈ 4 years), so long-period studies have bars to draw.
|
|
1469
1471
|
*/
|
|
1470
1472
|
maxLookbackMs?: number;
|
|
1471
1473
|
/**
|
|
@@ -2784,6 +2786,14 @@ type ChartEventMap = {
|
|
|
2784
2786
|
end: Date;
|
|
2785
2787
|
/** Candle price source the bars were requested with (see `DataLoaderParams.priceSource`). */
|
|
2786
2788
|
priceSource: 'bid' | 'ask' | 'ltp';
|
|
2789
|
+
/** Bars on the chart after the load. */
|
|
2790
|
+
barCount: number;
|
|
2791
|
+
/**
|
|
2792
|
+
* Whether any loaded bar has volume. When false, volume studies
|
|
2793
|
+
* (Volume, VWAP, OBV, MFI, …) are not plotted; native menus can grey
|
|
2794
|
+
* them out — the catalog marks them `requiresVolume`.
|
|
2795
|
+
*/
|
|
2796
|
+
hasVolume: boolean;
|
|
2787
2797
|
};
|
|
2788
2798
|
/** Emitted when the user clicks the × button on a trade, position, or bracket (SL/TP) level. */
|
|
2789
2799
|
tradeLevelClose: {
|
|
@@ -1806,7 +1806,7 @@ function chandeKroll(bars, period = 10, mult = 3, stopPeriod = 9) {
|
|
|
1806
1806
|
);
|
|
1807
1807
|
const preHigh = combine(hi, a, (h, v) => h - mult * v);
|
|
1808
1808
|
const preLow = combine(lo, a, (l, v) => l + mult * v);
|
|
1809
|
-
return { upper: highest(
|
|
1809
|
+
return { upper: highest(preHigh, stopPeriod), lower: lowest(preLow, stopPeriod) };
|
|
1810
1810
|
}
|
|
1811
1811
|
function envelopes(bars, values, period = 20, percent = 2, method = "SMA") {
|
|
1812
1812
|
const middle = applyMa(method, values, period, bars);
|
|
@@ -5902,5 +5902,5 @@ var LinearRegression = class {
|
|
|
5902
5902
|
};
|
|
5903
5903
|
|
|
5904
5904
|
export { ADX, ATR, AccDistribution, AdaptiveMA, AdvanceDecline, AlligatorIndicator, AwesomeOscillator, BREADTH_HINT, BandIndicatorBase, BollingerBands, CCI, CMF, COMPARE_HINT, ChannelIndicator, CorrelationCoefficient, CorrelationLog, CrossIndicator, DonchianChannels, DualLineIndicator, EMA, EXTRA_INDICATORS, FibRetracementIndicator, FractalIndicator, HMA, HeikinAshi, HistogramIndicatorBase, HistogramOscillator, IchimokuCloud, KeltnerChannels, LineIndicatorBase, LinearRegression, MACD, MARibbon, MFI, MaChannel, MovingAverage, MultiMA, NO_VOLUME_TITLE, OBV, ParabolicSAR, PivotPoints, ROC, RSI, RatioIndicator, SMA, SignalOscillator, SimpleOscillator, SimpleOverlay, SpreadIndicator, StochRSI, Stochastic, Supertrend, VOL, VOLUME_STUDIES, VWAP, VolumeProfileVisibleRange, WMA, WilliamsR, accelerator, alignCompare, allEmpty, alligator, alma, applyMa, aroon, asi, atr, averagePrice, awesome, balanceOfPower, bollingerPercentB, bollingerWidth, chaikinOscillator, chaikinVolatility, chandeKroll, change, chopZone, choppiness, cmo, colorField, combine, connorsRsi, coppock, correlation, cumulative, dema, dmi, dpo, drawPaneHint, easeOfMovement, ema, envelopes, extraIndicatorOptions, extraIndicatorPresets, extraIndicatorSchemas, extraSingleInstance, fisherTransform, forceIndex, fractals, hammingMa, highest, historicalVolatility, hma, klinger, kst, linregAt, linregSlope, lowest, lsma, maCross, majorityRule, mapSeries, massIndex, mcginley, medianPrice, methodField, momentum, netVolume, numField, periodField, priceChannel, priceOscillator, priceVolumeTrend, rankCorrelation, relativeVigor, relativeVolatility, rma, rocPct, rsiSeries, sma, smiErgodic, sourceField, sourceSeries, sourceValue, standardError, standardErrorBands, stdev, tema, toResults, trendStrength, trix, trueRange, tsi, typicalPrice, ultimate, volatilityIndex, volatilityOhlc, volatilityZeroTrend, volumeOscillator, vortex, vwma, wma, yearlyHighLow, zigzag };
|
|
5905
|
-
//# sourceMappingURL=chunk-
|
|
5906
|
-
//# sourceMappingURL=chunk-
|
|
5905
|
+
//# sourceMappingURL=chunk-M4RUXSMW.js.map
|
|
5906
|
+
//# sourceMappingURL=chunk-M4RUXSMW.js.map
|