@pipsend/charts 1.0.0 → 1.1.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/dist/pipsend-charts.development.mjs +63 -30
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +63 -30
- package/dist/pipsend-charts.standalone.development.mjs +63 -30
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +9 -9
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v1.
|
|
3
|
+
* Pipsend Charts v1.1.0
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -18529,33 +18529,67 @@
|
|
|
18529
18529
|
}
|
|
18530
18530
|
}
|
|
18531
18531
|
/**
|
|
18532
|
-
*
|
|
18532
|
+
* Automatically calculate pip configuration based on price
|
|
18533
|
+
* This is completely generic and works for any instrument
|
|
18533
18534
|
*/
|
|
18534
|
-
|
|
18535
|
-
//
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
//
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18546
|
-
|
|
18547
|
-
|
|
18548
|
-
|
|
18549
|
-
|
|
18550
|
-
|
|
18551
|
-
|
|
18552
|
-
|
|
18535
|
+
function calculatePipConfig(price) {
|
|
18536
|
+
// Convert price to string to analyze decimal places
|
|
18537
|
+
const priceStr = price.toString();
|
|
18538
|
+
const parts = priceStr.split('.');
|
|
18539
|
+
// Count decimal places
|
|
18540
|
+
const decimals = parts.length > 1 ? parts[1].length : 0;
|
|
18541
|
+
// Calculate pip value based on decimal places
|
|
18542
|
+
// Strategy: 1 pip = smallest meaningful price movement
|
|
18543
|
+
// For prices with many decimals, use 0.0001 (FX style)
|
|
18544
|
+
// For prices with few decimals, use 0.1 or 1
|
|
18545
|
+
let pipValue;
|
|
18546
|
+
if (decimals >= 5) {
|
|
18547
|
+
// Very high precision (rare, but handle it)
|
|
18548
|
+
pipValue = 0.00001;
|
|
18549
|
+
}
|
|
18550
|
+
else if (decimals === 4) {
|
|
18551
|
+
// FX majors: 1.2345 → pip = 0.0001
|
|
18552
|
+
pipValue = 0.0001;
|
|
18553
|
+
}
|
|
18554
|
+
else if (decimals === 3) {
|
|
18555
|
+
// JPY pairs or some commodities: 123.456 → pip = 0.001
|
|
18556
|
+
pipValue = 0.001;
|
|
18557
|
+
}
|
|
18558
|
+
else if (decimals === 2) {
|
|
18559
|
+
// Most commodities/indices: 1234.56 → pip = 0.01
|
|
18560
|
+
pipValue = 0.01;
|
|
18561
|
+
}
|
|
18562
|
+
else if (decimals === 1) {
|
|
18563
|
+
// Some indices: 12345.6 → pip = 0.1
|
|
18564
|
+
pipValue = 0.1;
|
|
18565
|
+
}
|
|
18566
|
+
else {
|
|
18567
|
+
// Whole numbers: 12345 → pip = 1
|
|
18568
|
+
pipValue = 1;
|
|
18569
|
+
}
|
|
18570
|
+
return {
|
|
18571
|
+
pipValue,
|
|
18572
|
+
decimals
|
|
18573
|
+
};
|
|
18574
|
+
}
|
|
18553
18575
|
/**
|
|
18554
|
-
* Helper function
|
|
18576
|
+
* Helper function for backward compatibility
|
|
18577
|
+
* Now ignores symbol and uses price-based detection
|
|
18555
18578
|
*/
|
|
18556
|
-
function getPipConfig(
|
|
18557
|
-
|
|
18558
|
-
|
|
18579
|
+
function getPipConfig(symbolOrPrice, price) {
|
|
18580
|
+
// If first argument is a number, use it as price
|
|
18581
|
+
if (typeof symbolOrPrice === 'number') {
|
|
18582
|
+
return calculatePipConfig(symbolOrPrice);
|
|
18583
|
+
}
|
|
18584
|
+
// If price is provided, use it
|
|
18585
|
+
if (price !== undefined) {
|
|
18586
|
+
return calculatePipConfig(price);
|
|
18587
|
+
}
|
|
18588
|
+
// Fallback: return default config (will be recalculated when price is known)
|
|
18589
|
+
return {
|
|
18590
|
+
pipValue: 0.1,
|
|
18591
|
+
decimals: 1
|
|
18592
|
+
};
|
|
18559
18593
|
}
|
|
18560
18594
|
|
|
18561
18595
|
class PositionPaneRenderer {
|
|
@@ -18606,11 +18640,10 @@
|
|
|
18606
18640
|
entryLineColor: '#ffffff',
|
|
18607
18641
|
opacity: 0.3,
|
|
18608
18642
|
showTooltips: true,
|
|
18609
|
-
symbol: 'DEFAULT',
|
|
18610
18643
|
...options,
|
|
18611
18644
|
};
|
|
18612
|
-
// Initialize calculator
|
|
18613
|
-
const pipConfig = this._private__positionOptions.pipConfig || getPipConfig(this._private__positionOptions.
|
|
18645
|
+
// Initialize calculator with automatic pip detection based on entry price
|
|
18646
|
+
const pipConfig = this._private__positionOptions.pipConfig || getPipConfig(this._private__positionOptions.entryPrice);
|
|
18614
18647
|
this._private__calculator = new PositionCalculator(pipConfig);
|
|
18615
18648
|
// Create primitive and setup
|
|
18616
18649
|
this._private__createPrimitive();
|
|
@@ -24132,7 +24165,7 @@
|
|
|
24132
24165
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
24133
24166
|
*/
|
|
24134
24167
|
function version() {
|
|
24135
|
-
return "1.
|
|
24168
|
+
return "1.1.0";
|
|
24136
24169
|
}
|
|
24137
24170
|
|
|
24138
24171
|
var PipsendChartsModule = /*#__PURE__*/Object.freeze({
|
|
@@ -24146,7 +24179,6 @@
|
|
|
24146
24179
|
CircleTool: CircleTool,
|
|
24147
24180
|
get ColorType () { return ColorType; },
|
|
24148
24181
|
get CrosshairMode () { return CrosshairMode; },
|
|
24149
|
-
DEFAULT_PIP_CONFIGS: DEFAULT_PIP_CONFIGS,
|
|
24150
24182
|
DEFAULT_SESSIONS: DEFAULT_SESSIONS,
|
|
24151
24183
|
DraggablePriceLine: DraggablePriceLine,
|
|
24152
24184
|
DrawingToolsManager: DrawingToolsManager,
|
|
@@ -24190,6 +24222,7 @@
|
|
|
24190
24222
|
applyStochastic: applyStochastic,
|
|
24191
24223
|
applyVolume: applyVolume,
|
|
24192
24224
|
applyWMA: applyWMA,
|
|
24225
|
+
calculatePipConfig: calculatePipConfig,
|
|
24193
24226
|
createArrowTool: createArrowTool,
|
|
24194
24227
|
createBrushTool: createBrushTool,
|
|
24195
24228
|
createChart: createChart,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* Pipsend Charts v1.
|
|
3
|
+
* Pipsend Charts v1.1.0
|
|
4
4
|
* Copyright (c) 2026 Pipsend
|
|
5
5
|
* Licensed under MIT License
|
|
6
6
|
* Built on TradingView Lightweight Charts™ (Apache 2.0)
|
|
@@ -18526,33 +18526,67 @@ class PositionCalculator {
|
|
|
18526
18526
|
}
|
|
18527
18527
|
}
|
|
18528
18528
|
/**
|
|
18529
|
-
*
|
|
18529
|
+
* Automatically calculate pip configuration based on price
|
|
18530
|
+
* This is completely generic and works for any instrument
|
|
18530
18531
|
*/
|
|
18531
|
-
|
|
18532
|
-
//
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18538
|
-
|
|
18539
|
-
//
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
|
|
18544
|
-
|
|
18545
|
-
|
|
18546
|
-
|
|
18547
|
-
|
|
18548
|
-
|
|
18549
|
-
}
|
|
18532
|
+
function calculatePipConfig(price) {
|
|
18533
|
+
// Convert price to string to analyze decimal places
|
|
18534
|
+
const priceStr = price.toString();
|
|
18535
|
+
const parts = priceStr.split('.');
|
|
18536
|
+
// Count decimal places
|
|
18537
|
+
const decimals = parts.length > 1 ? parts[1].length : 0;
|
|
18538
|
+
// Calculate pip value based on decimal places
|
|
18539
|
+
// Strategy: 1 pip = smallest meaningful price movement
|
|
18540
|
+
// For prices with many decimals, use 0.0001 (FX style)
|
|
18541
|
+
// For prices with few decimals, use 0.1 or 1
|
|
18542
|
+
let pipValue;
|
|
18543
|
+
if (decimals >= 5) {
|
|
18544
|
+
// Very high precision (rare, but handle it)
|
|
18545
|
+
pipValue = 0.00001;
|
|
18546
|
+
}
|
|
18547
|
+
else if (decimals === 4) {
|
|
18548
|
+
// FX majors: 1.2345 → pip = 0.0001
|
|
18549
|
+
pipValue = 0.0001;
|
|
18550
|
+
}
|
|
18551
|
+
else if (decimals === 3) {
|
|
18552
|
+
// JPY pairs or some commodities: 123.456 → pip = 0.001
|
|
18553
|
+
pipValue = 0.001;
|
|
18554
|
+
}
|
|
18555
|
+
else if (decimals === 2) {
|
|
18556
|
+
// Most commodities/indices: 1234.56 → pip = 0.01
|
|
18557
|
+
pipValue = 0.01;
|
|
18558
|
+
}
|
|
18559
|
+
else if (decimals === 1) {
|
|
18560
|
+
// Some indices: 12345.6 → pip = 0.1
|
|
18561
|
+
pipValue = 0.1;
|
|
18562
|
+
}
|
|
18563
|
+
else {
|
|
18564
|
+
// Whole numbers: 12345 → pip = 1
|
|
18565
|
+
pipValue = 1;
|
|
18566
|
+
}
|
|
18567
|
+
return {
|
|
18568
|
+
pipValue,
|
|
18569
|
+
decimals
|
|
18570
|
+
};
|
|
18571
|
+
}
|
|
18550
18572
|
/**
|
|
18551
|
-
* Helper function
|
|
18573
|
+
* Helper function for backward compatibility
|
|
18574
|
+
* Now ignores symbol and uses price-based detection
|
|
18552
18575
|
*/
|
|
18553
|
-
function getPipConfig(
|
|
18554
|
-
|
|
18555
|
-
|
|
18576
|
+
function getPipConfig(symbolOrPrice, price) {
|
|
18577
|
+
// If first argument is a number, use it as price
|
|
18578
|
+
if (typeof symbolOrPrice === 'number') {
|
|
18579
|
+
return calculatePipConfig(symbolOrPrice);
|
|
18580
|
+
}
|
|
18581
|
+
// If price is provided, use it
|
|
18582
|
+
if (price !== undefined) {
|
|
18583
|
+
return calculatePipConfig(price);
|
|
18584
|
+
}
|
|
18585
|
+
// Fallback: return default config (will be recalculated when price is known)
|
|
18586
|
+
return {
|
|
18587
|
+
pipValue: 0.1,
|
|
18588
|
+
decimals: 1
|
|
18589
|
+
};
|
|
18556
18590
|
}
|
|
18557
18591
|
|
|
18558
18592
|
class PositionPaneRenderer {
|
|
@@ -18603,11 +18637,10 @@ class PositionTool extends DrawingToolBase {
|
|
|
18603
18637
|
entryLineColor: '#ffffff',
|
|
18604
18638
|
opacity: 0.3,
|
|
18605
18639
|
showTooltips: true,
|
|
18606
|
-
symbol: 'DEFAULT',
|
|
18607
18640
|
...options,
|
|
18608
18641
|
};
|
|
18609
|
-
// Initialize calculator
|
|
18610
|
-
const pipConfig = this._private__positionOptions.pipConfig || getPipConfig(this._private__positionOptions.
|
|
18642
|
+
// Initialize calculator with automatic pip detection based on entry price
|
|
18643
|
+
const pipConfig = this._private__positionOptions.pipConfig || getPipConfig(this._private__positionOptions.entryPrice);
|
|
18611
18644
|
this._private__calculator = new PositionCalculator(pipConfig);
|
|
18612
18645
|
// Create primitive and setup
|
|
18613
18646
|
this._private__createPrimitive();
|
|
@@ -24129,7 +24162,7 @@ const customSeriesDefaultOptions = {
|
|
|
24129
24162
|
* Returns the current version as a string. For example `'1.0.0'`.
|
|
24130
24163
|
*/
|
|
24131
24164
|
function version() {
|
|
24132
|
-
return "1.
|
|
24165
|
+
return "1.1.0";
|
|
24133
24166
|
}
|
|
24134
24167
|
|
|
24135
|
-
export { areaSeries as AreaSeries, ArrowTool, barSeries as BarSeries, baselineSeries as BaselineSeries, BrushTool, candlestickSeries as CandlestickSeries, CircleTool, ColorType, CrosshairMode,
|
|
24168
|
+
export { areaSeries as AreaSeries, ArrowTool, barSeries as BarSeries, baselineSeries as BaselineSeries, BrushTool, candlestickSeries as CandlestickSeries, CircleTool, ColorType, CrosshairMode, DEFAULT_SESSIONS, DraggablePriceLine, DrawingToolsManager, EXTENDED_FIBONACCI_RATIOS, FibonacciCalculator, FibonacciExtensionTool, FibonacciFanTool, FibonacciTool, GanttTool, histogramSeries as HistogramSeries, HorizontalLineTool, InteractiveLineManager, LastPriceAnimationMode, lineSeries as LineSeries, LineStyle, LineType, MismatchDirection, PositionCalculator, PositionMarkersManager, PositionTool, PriceLineSource, PriceScaleMode, RectangleTool, RulerCalculator, RulerTool, STANDARD_FIBONACCI_RATIOS, TextTool, TickMarkType, TrackingModeExitMode, TradingSessionsIndicator, TrendLineTool, VerticalLineTool, VolumeProfileIndicator, applyATR, applyBollingerBands, applyEMA, applyMACD, applyOBV, applyRSI, applySMA, applyStochastic, applyVolume, applyWMA, calculatePipConfig, createArrowTool, createBrushTool, createChart, createChartEx, createCircleTool, createFibonacciExtensionTool, createFibonacciFanTool, createFibonacciTool, createGanttTool, createHorizontalLineTool, createImageWatermark, createInteractiveLineManager, createOptionsChart, createPositionMarkers, createPositionTool, createRectangleTool, createRulerTool, createSeriesMarkers, createTextTool, createTextWatermark, createTradingLine, createTradingSessionsIndicator, createTrendLineTool, createUpDownMarkers, createVerticalLineTool, createVolumeProfileIndicator, createYieldCurveChart, customSeriesDefaultOptions, defaultHorzScaleBehavior, getPipConfig, isBusinessDay, isUTCTimestamp, setOBVVolumeData, setVolumeData, setVolumeProfileData, version };
|