')),
this._dv.css('width', '100%'),
this._dv.css('height', '100%'),
this._dv.css('position', 'relative'),
this._dv.css('overflow', 'hidden'),
this._dv.appendTo(this.jqCell),
(this.canvas = y(this._dv, new g(16, 16))),
$(this.canvas).css('position', 'absolute'),
$(this.canvas).css('z-order', '2'),
$(this.canvas).css('left', 0),
$(this.canvas).css('top', 0),
(this.ctx = this.canvas.getContext('2d')),
(this.top_canvas = y(this._dv, new g(16, 16))),
$(this.top_canvas).css('position', 'absolute'),
$(this.top_canvas).css('z-order', '1'),
$(this.top_canvas).css('left', 0),
$(this.top_canvas).css('top', 0),
(this.top_ctx = this.top_canvas.getContext('2d')),
(this._textWidthCache = new s()),
this.restoreDefaultCursor(),
this.update(),
(this._mouseEventHandler = new v(this.jqCell, this, !0)),
(this.dialog = this.pane.chart().dialog),
(this.contextMenu = null),
(this.actions = {}),
(this._isVisible = !0),
this.priceScale().onMarksChanged.subscribe(this, this.onMarksChanged);
}
function o(e) {
var t = new T(e);
return function(e, i) {
return isNumber(i) && !e.isLog() ? t.format(i) : '';
};
}
var r, s, a, l, c, h, u, d, p, _, f, m, y, g, v, S, b, w, P, T, x, C;
i(636),
(r = i(0).LineDataSource),
(s = i(115)),
(a = i(41)),
(l = a.Action),
(c = a.ActionSeparator),
(h = i(88)),
(u = i(639)),
(d = i(18)),
(p = i(81)),
(_ = p.resizeCanvas),
(f = p.hardResizeCanvas),
(m = p.clearRect),
(y = p.addCanvasTo),
(g = p.Size),
(v = i(110).MouseEventHandler),
(S = i(39).trackEvent),
(b = i(116).makeFont),
(w = i(181).ActionBinder),
(P = i(4).getLogger('Chart.PriceAxisWidget')),
(T = i(193).LimitedPrecisionNumericFormatter),
(x = { contextMenuEnabled: !0 }),
(n.prototype._BORDER_SIZE = 1),
(n.prototype._OFFSET_SIZE = 1),
(n.prototype._TICK_LENGTH = 3),
(n.LHS = 1),
(n.RHS = 2),
(n.isLeft = function(e) {
return (
e === n.LHS || (e !== n.RHS && (P.logDebug('PriceAxisWidget.isLeft: wrong side'), !1))
);
}),
(n.prototype.destroy = function() {
this.actions.reset && this.actions.reset.setActive(!1),
this._mouseEventHandler.destroy();
}),
(n.prototype.backgroundColor = function() {
return this.pane
.chart()
.properties()
.paneProperties.background.value();
}),
(n.prototype.lineColor = function() {
return this._properties.lineColor.value();
}),
(n.prototype.textColor = function() {
return this._properties.textColor.value();
}),
(n.prototype.fontSize = function() {
return this._properties.fontSize.value();
}),
(n.prototype.baseFont = function() {
return b(this.fontSize(), 'Arial', '');
}),
(n.prototype.rendererOptions = function() {
var e, t, i;
return (
this._rendererOptions ||
(this._rendererOptions = {
isLeft: this._isLeft,
width: 0,
height: 0,
borderSize: this._BORDER_SIZE,
offsetSize: this._OFFSET_SIZE,
tickLength: this._TICK_LENGTH,
fontSize: NaN,
font: '',
widthCache: new s(),
_tickmarksCache: new u(11, 'Arial', '', '#000'),
color: '',
}),
(e = this._rendererOptions),
(t = !1),
e.color !== this.textColor() && ((e.color = this.textColor()), (t = !0)),
e.fontSize !== this.fontSize() &&
((i = this.fontSize()),
(e.fontSize = i),
(e.font = b(this.fontSize(), "'Trebuchet MS', Tahoma, Arial, sans-serif", '')),
(e.paddingTop = Math.floor(i / 3.5)),
(e.paddingBottom = e.paddingTop),
(e.paddingInner = Math.max(Math.ceil(i / 3 - e.tickLength / 2), 0)),
(e.paddingOuter = Math.ceil(i / 3)),
(e.baselineOffset = Math.round(i / 5)),
e.widthCache.reset(),
(t = !0)),
t && e._tickmarksCache.reset(e.fontSize, 'Arial', '', e.color),
this.size && ((e.width = this.size.w), (e.height = this.size.h)),
this._rendererOptions
);
}),
(n.prototype.mouseDownEvent = function(e) {
var i, n;
!this.priceScale().isEmpty() &&
t.enabled('chart_zoom') &&
((i = this.pane.chart().model()),
(n = this.pane.state()),
(this._mousedown = !0),
this.setCursor('ns-resize'),
i.startScalePrice(n, this.priceScale(), e.localY));
}),
(n.prototype.pressedMouseMoveEvent = function(e) {
var t = this.pane.chart().model(),
i = this.pane.state(),
n = this.priceScale();
t.scalePriceTo(i, n, e.localY);
}),
(n.prototype.mouseDownOutsideEvent = function(e) {
var t,
i = this.pane.chart().model(),
n = this.pane.state();
n &&
((t = this.priceScale()),
this._mousedown &&
((this._mousedown = !1), i.endScalePrice(n, t), this.restoreDefaultCursor()));
}),
(n.prototype.mouseUpEvent = function(e) {
var t = this.pane.chart().model(),
i = this.pane.state(),
n = this.priceScale();
(this._mousedown = !1), t.endScalePrice(i, n), this.restoreDefaultCursor();
}),
(n.prototype._initActions = function(e) {
var t, i, o, r, s, a, c, h;
this.pane.state() &&
((this.actions = {}),
(i = this),
(this.actions.reset = new l({
text: $.t('Reset Scale'),
shortcut: 'Alt+R',
statName: 'ResetScale',
})),
this.actions.reset.callbacks().subscribe(this, n.prototype.reset),
this.priceScale().mainSource() instanceof TradingView.Series &&
((o = function() {
(t = { lockScale: this.value() }),
this._undoModel.setPriceScaleMode(t, i.priceScale(), this._undoText);
}),
(r = C(
this.priceScale(),
this.pane
.chart()
.model()
.model()
.mainSeriesScaleRatio(),
)),
(this.actions.setLockScale = new l({
text: $.t('Lock Scale') + ' ' + r,
checkable: !0,
checked: this.priceScale().isLockScale(),
statName: 'ToggleLockScale',
})),
(this._lockScaleBinding = new w(
this.actions.setLockScale,
this.priceScale().properties().lockScale,
this.pane.chart().model(),
'Lock Scale',
o,
)),
this._lockScaleBinding.setValue(this.priceScale().isLockScale())),
(s = function() {
(t = { autoScale: this.value() }),
this._undoModel.setPriceScaleMode(t, i.priceScale(), this._undoText);
}),
(this.actions.setAutoScale = new l({
text: $.t('Auto Scale'),
checkable: !0,
checked: !0,
statName: 'ToggleAutoScale',
})),
(this._autoScaleBinding = new w(
this.actions.setAutoScale,
this.priceScale().properties().autoScale,
this.pane.chart().model(),
'Undo AutoScale',
s,
)),
this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),
(a = function() {
(t = { percentage: this.value() }),
this._undoModel.setPriceScaleMode(t, i.priceScale(), this._undoText);
}),
(this.actions.setPercentage = new l({
text: $.t('Percentage', { context: 'scale_menu' }),
checkable: !0,
checked: !1,
statName: 'TogglePercantage',
})),
(this.actions.setPercentage.binding = new w(
this.actions.setPercentage,
this.priceScale().properties().percentage,
this.pane.chart().model(),
'Undo Percentage',
a,
)),
(c = function() {
(t = { indexedTo100: this.value() }),
this._undoModel.setPriceScaleMode(t, i.priceScale(), this._undoText);
}),
(this.actions.setIndexedTo100 = new l({
text: $.t('Indexed to 100', { context: 'scale_menu' }),
checkable: !0,
checked: !1,
statName: 'ToggleIndexedTo100',
})),
(this.actions.setIndexedTo100.binding = new w(
this.actions.setIndexedTo100,
this.priceScale().properties().indexedTo100,
this.pane.chart().model(),
'Undo Indexed to 100',
c,
)),
(h = function() {
(t = { log: this.value() }),
this._undoModel.setPriceScaleMode(t, i.priceScale(), this._undoText);
}),
(this.actions.setLog = new l({
text: $.t('Log Scale', { context: 'scale_menu' }),
checkable: !0,
checked: !1,
statName: 'ToggleLogScale',
})),
(this.actions.setLog.binding = new w(
this.actions.setLog,
this.priceScale().properties().log,
this.pane.chart().model(),
'Undo Log Scale',
h,
)),
(this.actions.alignLabels = new l({
text: $.t('No Overlapping Labels', { context: 'scale_menu' }),
checkable: !0,
checked: !1,
statName: 'TogglePreciseLabels',
})),
(this.actions.alignLabels.binding = new w(
this.actions.alignLabels,
this.priceScale().properties().alignLabels,
this.pane.chart().model(),
'No Overlapping Labels',
)),
this._updateScalesActions());
}),
(n.prototype._updateScalesActions = function() {
var e = this.priceScale(),
t = e.mainSource() instanceof TradingView.Series,
i = e.mainSource().properties();
this.actions.setPercentage.setEnabled(
!(
e.isLog() ||
(t && e.isLockScale()) ||
(t && i.style.value() === TradingView.Series.STYLE_PNF)
),
),
this.actions.setIndexedTo100.setEnabled(
!(
e.isLog() ||
(t && e.isLockScale()) ||
(t && i.style.value() === TradingView.Series.STYLE_PNF)
),
),
this.actions.setLog.setEnabled(
!(
e.isPercentage() ||
e.isIndexedTo100() ||
(t && e.isLockScale()) ||
(t && i.style.value() === TradingView.Series.STYLE_PNF)
),
),
this.actions.setAutoScale.setChecked(e.properties().autoScale.value()),
this.actions.setAutoScale.setEnabled(!e.properties().autoScaleDisabled.value());
}),
(n.prototype.mouseClickEvent = function(e) {}),
(n.prototype.mouseDoubleClickEvent = function(e) {
this.reset(), S('GUI', 'Double click price scale');
}),
(n.prototype.contextMenuEvent = function(e, t) {
this._options.contextMenuEnabled && this._createContextMenu().show(e);
}),
(n.prototype._createContextMenu = function() {
return h.createMenu(this.getContextMenuActions(), {
statName: 'PriceScaleContextMenu',
});
}),
(n.prototype.getContextMenuActions = function() {
var e, i;
return (
this._initActions(),
(e = this.pane.chart().actions()),
(i = []),
i.push(
this.actions.reset,
new c(),
e.showLeftAxis,
e.showRightAxis,
new c(),
this.actions.setAutoScale,
),
this.actions.setLockScale && i.push(this.actions.setLockScale),
i.push(
e.scaleSeriesOnly,
new c(),
this.actions.setPercentage,
this.actions.setIndexedTo100,
this.actions.setLog,
new c(),
),
t.enabled('fundamental_widget') ||
i.push(e.showSymbolLabelsAction, e.showSeriesLastValue),
i.push(e.showStudyPlotNamesAction, e.showStudyLastValue),
t.enabled('countdown') && i.push(e.showCountdown),
i.push(this.actions.alignLabels),
!TradingView.onWidget() &&
t.enabled('show_chart_property_page') &&
t.enabled('chart_property_page_scales') &&
e.scalesProperties &&
i.push(new c(), e.scalesProperties),
i
);
}),
(n.prototype.backLabels = function(e) {
var t,
i,
n,
o,
r,
s = [],
a = this.priceScale()
.orderedSources()
.slice(),
l = this.pane,
c = l.chart().model(),
h = l.state(),
u = [],
d = c.sourceBeingMoved() || c.lineBeingEdited() || c.lineBeingCreated();
if (
(d && u.push(d),
c.selectedSource() && u.push(c.selectedSource()),
c.hoveredSource() && u.push(c.hoveredSource()),
this.priceScale() === h.defaultPriceScale())
)
for (t = this.pane.state().dataSources(), i = 0; i < t.length; i++)
h.isOverlay(t[i]) && a.push(t[i]);
for (i = 0; i < a.length; ++i)
if (
((n = a[i]),
(e || -1 === u.indexOf(n)) && (o = n.priceAxisViews(h, n.priceScale())))
)
for (r = 0; r < o.length; r++) s.push(o[r]);
return s;
}),
(n.prototype.optimalWidth = function() {
var e, t, i, n, o, r, s;
if (!this.isVisible()) return 0;
if (((e = 0), (t = this.rendererOptions()), this.pane.state()))
for (
i = this.ctx,
n = this.priceScale().marks(),
i.setFont(this.baseFont()),
n.length > 0 &&
(e = Math.max(
t.widthCache.measureText(i, n[0].label),
t.widthCache.measureText(i, n[n.length - 1].label),
)),
o = this.backLabels(!0),
r = o.length;
r--;
)
(s = t.widthCache.measureText(i, o[r].text())) > e && (e = s);
return Math.ceil(
t.offsetSize + t.borderSize + t.tickLength + t.paddingInner + t.paddingOuter + e,
);
}),
(n.prototype.setSize = function(e) {
(this.size && this.size.equals(e)) ||
((this.size = e),
_(this.canvas, e),
_(this.top_canvas, e),
this.jqCell.css({ width: e.w, 'min-width': e.w, height: e.h }));
}),
(n.prototype.update = function() {}),
(n.prototype._hightlightBackground = function(e, t, i) {
var n, o, r, s, a, l, c;
if (i) {
for (n = t[0].price, o = t[0].price, r = 1; r < t.length; r++)
(n = Math.min(n, t[r].price)), (o = Math.max(o, t[r].price));
(s = i.firstValue()),
(a = this.priceScale().priceToCoordinate(n, s)),
(l = this.priceScale().priceToCoordinate(o, s)),
(c = 'rgba(109, 158, 235, 0.3)'),
m(e, 1, a, this.size.w - 1, l - a, c);
}
}),
(n.prototype.drawBackground = function(e) {
var t, i, n, o;
if (
(m(e, 0, 0, this.size.w, this.size.h, this.backgroundColor()),
(t = this.pane.chart().model()),
(i = t.model().selectedSource()) &&
i.priceScale() === this.priceScale() &&
i instanceof r)
) {
if (((n = i.axisPoints()), 0 === n.length)) return;
this._hightlightBackground(e, n, i.ownerSource());
}
(o = t.model().crossHairSource()),
o.startMeasurePoint() &&
this._hightlightBackground(
e,
o.measurePoints(),
this.pane.state().mainDataSource(),
);
}),
(n.prototype.drawBorder = function(e) {
var t, i, n;
e.save(),
(e.fillStyle = this.lineColor()),
(t = this.size.h),
this._isLeft
? (e.translate(-0.5, -0.5),
(i = this.size.w - this._BORDER_SIZE - 1),
(n = this.size.w - 1))
: (e.translate(0.5, -0.5), (i = 0), (n = i + this._BORDER_SIZE)),
e.fillRect(i, 0, n - i, t),
e.restore();
}),
(n.prototype.drawTickMarks = function(e) {
var t, i, n, o, r, s;
if (
(e.save(),
(e.strokeStyle = this.lineColor()),
(t = this.priceScale().marks()),
(e.fillStyle = this.textColor()),
e.setFont(this.baseFont()),
(i = this),
e.translate(-0.5, -0.5),
(n = this.rendererOptions()),
i._isLeft)
) {
for (
e.fillStyle = i.lineColor(),
e.beginPath(),
o = this.size.w - i._OFFSET_SIZE - i._BORDER_SIZE - i._TICK_LENGTH,
r = t.length;
r--;
)
e.rect(o, t[r].coord, i._TICK_LENGTH, 1);
for (e.fill(), r = t.length; r--; )
n._tickmarksCache.paintTo(e, t[r].label, o - n.paddingInner, t[r].coord, 'right');
} else {
for (
e.fillStyle = i.lineColor(),
e.beginPath(),
s = i._BORDER_SIZE + i._OFFSET_SIZE,
r = t.length;
r--;
)
e.rect(s, t[r].coord, i._TICK_LENGTH, 1);
for (e.fill(), r = t.length; r--; )
n._tickmarksCache.paintTo(
e,
t[r].label,
s + i._TICK_LENGTH + n.paddingInner,
t[r].coord,
'left',
);
}
e.restore();
}),
(n.prototype._alignLabels = function() {
var e,
t,
i,
n,
o,
r,
s,
a,
l,
c,
h,
u,
d,
p,
_,
f = this.size.h / 2,
m = [],
y = this.priceScale()
.orderedSources()
.slice(),
g = this.pane,
v = g.state(),
S = this.rendererOptions();
if (this.priceScale() === v.defaultPriceScale())
for (e = this.pane.state().dataSources(), t = 0; t < e.length; t++)
v.isOverlay(e[t]) && y.push(e[t]);
for (i = this.priceScale().mainSource(), t = 0; t < y.length; ++t)
if (((n = y[t]), (o = n.priceAxisViews(v, n.priceScale())))) {
for (r = 0; r < o.length; r++) (s = o[r]), s.isVisible() && m.push(s);
i === n && o.length > 0 && (f = o[0].floatCoordinate());
}
for (
a = m.filter(function(e) {
return e.floatCoordinate() <= f;
}),
l = m.filter(function(e) {
return e.floatCoordinate() > f;
}),
a.sort(function(e, t) {
return t.floatCoordinate() - e.floatCoordinate();
}),
a.length && l.length && l.push(a[0]),
l.sort(function(e, t) {
return e.floatCoordinate() - t.floatCoordinate();
}),
c = m.length,
t = 0;
t < c;
t++
)
(s = m[t]), s.setFixedCoordinate(s.coordinate());
if (((h = this.priceScale().properties()), h.alignLabels && h.alignLabels.value())) {
for (t = 1; t < a.length; t++)
(s = a[t]),
(u = a[t - 1]),
(d = u.height(S, !1)),
(p = s.coordinate()),
(_ = u.getFixedCoordinate()),
(p || _) && p > _ - d && s.setFixedCoordinate(_ - d);
for (r = 1; r < l.length; r++)
(s = l[r]),
(u = l[r - 1]),
(d = u.height(S, !0)),
(p = s.coordinate()),
(_ = u.getFixedCoordinate()),
(p || _) && p < _ + d && s.setFixedCoordinate(_ + d);
}
}),
(n.prototype.drawBackLabels = function(e) {
var t, i, n, o;
for (
e.save(), t = this.backLabels(), i = this.rendererOptions(), n = 0;
n < t.length;
n++
)
(o = t[n]), o.renderer().draw(e, i);
e.restore();
}),
(n.prototype.drawCrossHairLabel = function(e) {
var t,
i,
n,
o,
r,
s,
a = this.pane
.chart()
.model()
.model(),
l = [],
c = a.sourceBeingMoved() || a.lineBeingEdited() || a.lineBeingCreated();
for (
c && l.push({ source: c, scale: c.priceScale() }),
a.selectedSource() &&
l.push({ source: a.selectedSource(), scale: a.selectedSource().priceScale() }),
a.hoveredSource() &&
l.push({ source: a.hoveredSource(), scale: a.hoveredSource().priceScale() }),
l.push({ source: a.crossHairSource(), scale: this.priceScale() }),
t = this.pane.state(),
i = 0;
i < l.length;
i++
)
if (((n = l[i]), (o = n.source.priceAxisViews(t, n.scale))))
for (r = 0; r < o.length; r++)
(s = o[r]), e.save(), s.renderer().draw(e, this.rendererOptions()), e.restore();
}),
(n.prototype.priceScale = function() {
var e = this.pane.state(),
t = [];
return (
(t = this._isLeft
? [e.leftPriceScale(), e.rightPriceScale()]
: [e.rightPriceScale(), e.leftPriceScale()]),
null === t[0].mainSource() ? (null === t[1].mainSource() ? t[0] : t[1]) : t[0]
);
}),
(n.prototype.isVisible = function() {
return this._isVisible;
}),
(n.prototype.setVisible = function(e) {
(e = !!e) !== this._isVisible &&
(e ? this.jqCell.css('display', 'table-cell') : this.jqCell.css('display', 'none'),
(this._isVisible = e));
}),
(n.prototype.setAutoScale = function(e) {
var t = this.pane.state,
i = this.priceScale();
this.pane
.chart()
.model()
.setPriceAutoScale(t, i, e);
}),
(n.prototype.reset = function() {
var e = this.pane.state(),
t = this.priceScale();
this.pane
.chart()
.model()
.resetPriceScale(e, t);
}),
(n.prototype.hardResetCanvas = function() {
this.size && (f(this.canvas, this.size), f(this.top_canvas, this.size));
}),
(n.prototype.paint = function(e) {
this._isVisible &&
e &&
(e === d.UPDATE_CURSOR_ONLY
? (this.top_ctx.clearRect(-0.5, -0.5, this.size.w, this.size.h),
this.drawCrossHairLabel(this.top_ctx))
: (this._alignLabels(),
this.drawBackground(this.ctx),
this.drawBorder(this.ctx),
this.pane.state() &&
(this.drawTickMarks(this.ctx),
this.drawBackLabels(this.ctx),
this.top_ctx.clearRect(-0.5, -0.5, this.size.w, this.size.h),
this.drawCrossHairLabel(this.top_ctx))));
}),
(n.prototype.restoreDefaultCursor = function() {
this.setCursor('');
}),
(n.prototype.setCursor = function(e) {
var t = '';
('grabbing' !== e && 'ns-resize' !== e) || (t = 'price-axis--cursor-' + e),
this._currentCursorClassName !== t &&
(this._currentCursorClassName &&
this.jqCell.removeClass(this._currentCursorClassName),
t && this.jqCell.addClass(t),
(this._currentCursorClassName = t),
this.jqCell.css('cursor'));
}),
(n.prototype.image = function() {
var e = {};
return (
(e.content = this.canvas.toDataURL()),
(e.contentWidth = this.size.w),
(e.contentHeight = this.size.h),
e
);
}),
(n.prototype.onMarksChanged = function() {
var e,
t = this.optimalWidth();
this._prevOptimalWidth < t &&
((e = this),
this.updateTimeout ||
(this.updateTimeout = setTimeout(function() {
e.pane &&
e.pane.chart &&
e.pane.chart() &&
e.pane
.chart()
.model()
.model()
.fullUpdate(),
(e.updateTimeout = null);
}, 100))),
(this._prevOptimalWidth = t);
}),
(C = o(7)),
(e.exports = { PriceAxisWidget: n, scaleRatioForContextMenuTransformer: o });
}.call(t, i(5)));
},
,
,
function(e, t, i) {
'use strict';
function n() {
return new Promise(function(e) {
i.e(20)
.then(
function(t) {
e(i(332));
}.bind(null, i),
)
.catch(i.oe);
});
}
function o(e, t) {
return n().then(function(i) {
return i.bindToInput(e, t);
});
}
function r(e) {
return /[\d,]/.test(e);
}
function s(e) {
Object(f.setLastUsedResolution)(e), m.linking.interval.setValue(e);
}
function a(e) {
if (!Object(d.globalKeypressMatches)(e)) return !1;
e.preventDefault();
var t = String.fromCharCode(e.charCode);
return (
r(t) && p.enabled('show_interval_dialog_on_key_press')
? Object(_.showChangeIntervalDialog)(
{ callback: s, ownerDocument: e.target && e.target.ownerDocument },
t,
)
: p.enabled('symbol_search_hot_key') &&
n().then(function(i) {
i.showDialog({
initialValue: t,
callback: function(e, t) {
m.linking.symbol.setValue(e), t && s(t);
},
ownerDocument: e.target && e.target.ownerDocument,
});
}),
!0
);
}
function l() {
u.pushBackListener('symbolEdit', a);
}
function c(e) {
return n().then(function(t) {
return t.showDialog(e);
});
}
function h(e) {
return n().then(function(t) {
return t.setSearchRequestDelay(e);
});
}
var u, d, p, _, f, m;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.bindToInput = o),
(t.activateKeyPressHandler = l),
(t.showDialog = c),
(t.setSearchRequestDelay = h),
(u = i(307)),
(d = i(311)),
(p = i(5)),
i.n(p),
(_ = i(249)),
(f = i(61)),
(m = i(62));
},
function(e, t, i) {
'use strict';
function n(e, t, i) {
function n(e, t, i, n, o, r) {
var s = 0;
return e < i ? (s |= 1) : e > o && (s |= 2), t < n ? (s |= 4) : t > r && (s |= 8), s;
}
for (
var o,
r,
s,
a = e[0].x,
l = e[0].y,
c = e[1].x,
h = e[1].y,
u = t.x,
d = t.y,
p = i.x,
_ = i.y,
f = n(a, l, u, d, p, _),
y = n(c, h, u, d, p, _),
g = !1,
v = 0;
;
) {
if (v > 1e3) throw Error('Cohen - Sutherland algorithm: infinity loop');
if ((v++, !(f | y))) {
g = !0;
break;
}
if (f & y) break;
(o = f || y),
(r = void 0),
(s = void 0),
8 & o
? ((r = a + ((c - a) * (_ - l)) / (h - l)), (s = _))
: 4 & o
? ((r = a + ((c - a) * (d - l)) / (h - l)), (s = d))
: 2 & o
? ((s = l + ((h - l) * (p - a)) / (c - a)), (r = p))
: ((s = l + ((h - l) * (u - a)) / (c - a)), (r = u)),
o === f
? ((a = r), (l = s), (f = n(a, l, u, d, p, _)))
: ((c = r), (h = s), (y = n(c, h, u, d, p, _)));
}
return g
? m.equalPoints(m.point(a, l), m.point(c, h))
? m.point(a, l)
: m.lineSegment(m.point(a, l), m.point(c, h))
: null;
}
function o(e, t) {
var i,
n,
o = e.A,
r = t.A,
s = e.B,
a = t.B,
l = e.C,
c = t.C,
h = o * a - r * s;
return Math.abs(h) < 1e-6
? null
: ((i = (s * c - a * l) / h), (n = (r * l - o * c) / h), new m.Point(i, n));
}
function r(e, t, i, n) {
var o,
r = t.subtract(e),
s = n.subtract(i),
a = r.x * s.y - r.y * s.x;
return Math.abs(a) < 1e-6 ? null : ((o = e.subtract(i)), (o.y * s.x - o.x * s.y) / a);
}
function s(e, t, i, n) {
var o,
s,
a,
l = r(e, t, i, n);
return null === l
? null
: ((o = t.subtract(e)),
(s = o.scaled(l).add(e)),
(a = y.distanceToSegment(i, n, s)),
Math.abs(a.distance) < 1e-6 ? l : null);
}
function a(e, t) {
return -(e.C + e.B * t) / e.A;
}
function l(e, t) {
return -(e.C + e.A * t) / e.B;
}
function c(e, t) {
var i, n, o;
for (i = 0, n = e; i < n.length; i++) if (((o = n[i]), m.equalPoints(o, t))) return !1;
return e.push(t), !0;
}
function h(e, t, i) {
var n,
o,
r,
s,
h,
u = t.x,
d = t.y,
p = i.x,
_ = i.y;
if (0 === e.A)
return (
(n = -e.C / e.B), d <= n && n <= _ ? m.lineSegment(m.point(u, n), m.point(p, n)) : null
);
if (0 === e.B)
return (
(o = -e.C / e.A), u <= o && o <= p ? m.lineSegment(m.point(o, d), m.point(o, _)) : null
);
switch (
((r = []),
(s = function(t) {
var i = l(e, t);
d <= i && i <= _ && c(r, new m.Point(t, i));
}),
(h = function(t) {
var i = a(e, t);
u <= i && i <= p && c(r, new m.Point(i, t));
}),
s(u),
h(d),
s(p),
h(_),
r.length)
) {
case 0:
return null;
case 1:
return r[0];
case 2:
return m.equalPoints(r[0], r[1]) ? r[0] : m.lineSegment(r[0], r[1]);
}
return f.assert(!1, 'We should have at most two intersection points'), null;
}
function u(e, t, i, n) {
var o,
r = s(e, t, i, new m.Point(n.x, i.y)),
a = s(e, t, new m.Point(n.x, i.y), n),
l = s(e, t, n, new m.Point(i.x, n.y)),
c = s(e, t, new m.Point(i.x, n.y), i),
h = [];
return (
null !== r && r >= 0 && h.push(r),
null !== a && a >= 0 && h.push(a),
null !== l && l >= 0 && h.push(l),
null !== c && c >= 0 && h.push(c),
0 === h.length
? null
: (h.sort(function(e, t) {
return e - t;
}),
(o = g.pointInRectangle(e, i, n) ? h[0] : h[h.length - 1]),
e.addScaled(t.subtract(e), o))
);
}
function d(e, t) {
return !(e.length > 0 && m.equalPoints(e[e.length - 1], t)) && (e.push(t), !0);
}
function p(e, t) {
var i,
n,
r,
s,
a,
l = [];
for (i = 0; i < e.length; ++i)
(n = e[i]),
(r = e[(i + 1) % e.length]),
(s = m.lineThroughPoints(n, r)),
g.pointInHalfplane(n, t)
? (d(l, n), g.pointInHalfplane(r, t) || (null !== (a = o(s, t.edge)) && d(l, a)))
: g.pointInHalfplane(r, t) && null !== (a = o(s, t.edge)) && d(l, a);
return l.length >= 3 ? l : null;
}
function _(e, t) {
var i,
n,
o,
r,
s,
a = e;
for (i = 0; i < t.length && null !== a; ++i)
(n = t[i]),
(o = t[(i + 1) % t.length]),
(r = t[(i + 2) % t.length]),
(s = m.lineThroughPoints(n, o)),
(a = p(a, m.halfplaneThroughPoint(s, r)));
return a;
}
var f, m, y, g;
Object.defineProperty(t, '__esModule', { value: !0 }),
(f = i(7)),
(m = i(6)),
(y = i(30)),
(g = i(60)),
(t.intersectLineSegmentAndRectangle = n),
(t.intersectLines = o),
(t.intersectLineSegments = s),
(t.intersectLineAndRectangle = h),
(t.intersectRayAndRectangle = u),
(t.intersectPolygonAndHalfplane = p),
(t.intersectPolygons = _);
},
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'TimeFormatter', function() {
return o;
}),
(n = i(21)),
(o = (function() {
function e(e) {
this._formatStr = e || '%h:%m:%s';
}
return (
(e.prototype.format = function(e) {
return n.customFormatters.timeFormatter
? n.customFormatters.timeFormatter.format(e)
: this._formatStr
.replace('%h', Object(n.numberToStringWithLeadingZero)(e.getUTCHours(), 2))
.replace('%m', Object(n.numberToStringWithLeadingZero)(e.getUTCMinutes(), 2))
.replace('%s', Object(n.numberToStringWithLeadingZero)(e.getUTCSeconds(), 2));
}),
(e.prototype.formatLocal = function(e) {
return n.customFormatters.timeFormatter
? n.customFormatters.timeFormatter.formatLocal
? n.customFormatters.timeFormatter.formatLocal(e)
: n.customFormatters.timeFormatter.format(e)
: this._formatStr
.replace('%h', Object(n.numberToStringWithLeadingZero)(e.getHours(), 2))
.replace('%m', Object(n.numberToStringWithLeadingZero)(e.getMinutes(), 2))
.replace('%s', Object(n.numberToStringWithLeadingZero)(e.getSeconds(), 2));
}),
e
);
})());
},
function(e, t, i) {
'use strict';
var n = i(18),
o = { _fontHeightCache: {}, _parsedColorCache: {} };
(o._parseColor = function(e) {
var t, i, n;
return this._parsedColorCache[e]
? this._parsedColorCache[e]
: ((t = document.createElement('div')),
(t.style.color = e),
(i =
t.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i) ||
t.style.color.match(
/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i,
)),
(n = { r: i[1], g: i[2], b: i[3], a: i[4] || '1' }),
(this._parsedColorCache[e] = n),
n);
}),
(o.getColorFromProperties = function(e, t) {
var i = 1 - t.value() / 100,
n = this._parseColor(e.value());
return 'rgba(' + n.r + ',' + n.g + ',' + n.b + ',' + i + ')';
}),
(o.setColorToProperties = function(e, t, i) {
var n,
o = this._parseColor(e);
t.setValue('rgb(' + o.r + ',' + o.g + ',' + o.b + ')'),
(n = 100 * (1 - o.a)),
i.setValue(Math.max(0, Math.min(n, 100)));
}),
(o._parseFont = function(e) {
var t,
i,
n = document.createElement('div');
return (
(n.style.font = e),
(t = n.style.fontSize.match(/(\d+)pt/)),
(i = t && t[0] === n.style.fontSize),
{
family: n.style.fontFamily,
size: i ? t[1] : '',
bold: 'bold' === n.style.fontWeight,
italic: 'italic' === n.style.fontStyle,
}
);
}),
(o.getFontFromProperties = function(e, t, i, n) {
return [
i.value() ? 'bold' : '',
n.value() ? 'italic' : '',
t.value() + 'pt',
e.value(),
].join(' ');
}),
(o.setFontToProperties = function(e, t, i, n, o) {
var r = this._parseFont(e);
r.family.length > 0 && t.setValue(r.family),
r.size.length > 0 && i.setValue(r.size),
n.setValue(r.bold),
o.setValue(r.italic);
}),
(o.fontHeight = function(e) {
var t, i;
return (
this._fontHeightCache[e] ||
((t = document.createElement('span')),
t.appendChild(document.createTextNode('height')),
document.body.appendChild(t),
(t.style.cssText = 'font: ' + e + '; white-space: nowrap; display: inline;'),
(i = t.offsetHeight),
document.body.removeChild(t),
(this._fontHeightCache[e] = Math.ceil(i))),
this._fontHeightCache[e]
);
}),
(o.drawPolyHoverOrPress = function(e, t, i, n) {
n
? (e.save(),
(e.fillStyle = 'rgba(0, 0, 0, 0.15)'),
CanvasEx.drawPoly(e, t, !0),
e.restore())
: i &&
(e.save(),
(e.fillStyle = 'rgba(0, 0, 0, 0.1)'),
CanvasEx.drawPoly(e, t, !0),
e.restore());
}),
(o.repaint = function(e) {
var t = new n(n.LIGHT_UPDATE);
(t.force = !0), e.invalidate(t);
}),
(o.roundToMinTick = function(e, t) {
var i = e.mainSource().base(),
n = 1 / i;
return n * Math.round(t / n);
}),
(e.exports = o);
},
function(e, t, i) {
'use strict';
function n() {
clearTimeout(W), clearTimeout(H), clearTimeout(j);
}
function o(e, t) {
j = setTimeout(e, t);
}
function r(e, t) {
H = setTimeout(e, t);
}
function s(e, t) {
W = setTimeout(e, t);
}
function a() {
var e = document.getElementById(z);
if (e) return void (U = e);
(U = document.createElement('div')), (U.id = z), document.body.appendChild(U);
}
function l() {
U.innerHTML = '';
}
function c(e) {
return q.then(function() {
l(), U.appendChild(e);
});
}
function h(e, t) {
var i,
n = G.includes(t) ? Y[t] : '';
(i = e.classList).remove.apply(
i,
G.map(function(e) {
return Y[e];
}).filter(function(e) {
return !!e;
}),
),
n && !e.classList.contains(n) && e.classList.add(n);
}
function u(e, t) {
var i = K.get(e);
return i && i[t];
}
function d(e, t, i) {
var n = K.get(e) || {};
(n[t] = i), K.set(e, n);
}
function p(e) {
var t = e.getAttribute('title');
return t && (d(e, 'text', t), e.removeAttribute('title')), u(e, 'text') || '';
}
function _(e) {
var t = p(e),
i = e.getBoundingClientRect(),
n = { h: i.height, w: i.width, x: i.left, y: i.top },
o = e.getAttribute('data-color-theme') || '',
r = e.classList.contains('common-tooltip-html'),
s = parseInt(e.getAttribute('data-tooltip-delay') || ''),
a = { type: 'none' };
return (
t && (a = { type: r ? 'html' : 'text', data: t }),
{
above: e.classList.contains('common-tooltip-above'),
below: e.classList.contains('common-tooltip-below'),
otl: e.classList.contains('common-tooltip-otl'),
otr: e.classList.contains('common-tooltip-otr'),
vertical: e.classList.contains('common-tooltip-vertical'),
hotkey: e.getAttribute('data-tooltip-hotkey'),
narrow: e.classList.contains('common-tooltip-narrow'),
colorTheme: o,
tooltipDelay: s,
rect: n,
content: a,
}
);
}
function f(e) {
var t,
i,
n,
o,
r,
s,
a = b(),
l = x(a),
c = e.content;
switch (c.type) {
case 'element':
(l.innerHTML = ''), l.appendChild(c.data);
break;
case 'html':
l.innerHTML = c.data;
break;
case 'text':
e.hotkey
? ((i = P()), (i.innerText = c.data), l.appendChild(i))
: (l.innerText = c.data);
}
return (
e.hotkey &&
((n = 'none' !== c.type),
(o = w()),
(r = Object(Z.a)(e.hotkey)),
(s = S(r.keys)),
(o.innerHTML = (t = r.text).format
.apply(t, s)
.replace(/\s\+\s/g, '
+')),
l.classList.add(Q['common-tooltip__body--with-hotkey']),
n && o.classList.add(Q['common-tooltip__hotkey-block--divider']),
l.appendChild(o)),
a
);
}
function m(e, t) {
var i,
n,
o,
r,
s,
a,
l,
c,
u,
d,
p,
_,
f,
m,
y,
g,
S = t.rect;
S &&
(h(e, t.colorTheme || 'default'),
t.addClass && e.classList.add(t.addClass),
(i = x(e)),
i.classList.toggle(Q['common-tooltip__body--width_wide'], !!t.wide),
i.classList.toggle(Q['common-tooltip__body--width_narrow'], !!t.narrow),
i.classList.toggle(Q['common-tooltip__body--no-buttons'], !0),
e.classList.toggle(Q['common-tooltip--no-pointer-events'], !Modernizr.pointerevents),
(i.style.left = v(0)),
(i.style.width = v(i.clientWidth + 2)),
(n = document.body.clientWidth),
(o = document.body.clientHeight),
(r = t.vertical),
(s = (r && S.w < 20) || (!r && S.h < 20)),
e.classList.toggle(Q['common-tooltip--farther'], s),
e.classList.toggle(Q['common-tooltip--vertical'], r),
e.classList.toggle(Q['common-tooltip--horizontal'], !r),
(a = T(e)),
(l = ''),
r
? ((e.style.left = v(S.x + S.w)),
(e.style.top = v(S.y - (e.offsetHeight - S.h) / 2)),
(c = (e.querySelector(':last-child') || i).getBoundingClientRect().right),
(u = c + ee > n),
e.classList.toggle(Q['common-tooltip--direction_reversed'], u),
e.classList.toggle(Q['common-tooltip--direction_normal'], !u),
(l = u ? 'after' : 'before'),
X.IS_RTL
? ((l = t.otr ? 'after' : l), (l = t.otl ? 'before' : l))
: ((l = t.otr ? 'before' : l), (l = t.otl ? 'after' : l)),
a.classList.toggle(Q['common-tooltip__ear-holder--before'], 'before' === l),
a.classList.toggle(Q['common-tooltip__ear-holder--after'], 'after' === l),
'after' === l && ((e.style.left = 'auto'), (e.style.right = v(n - S.x))))
: ((d = S.x - (i.offsetWidth - S.w) / 2),
(p = n - ee - e.offsetWidth),
(_ = Math.max(ee, Math.min(d, p))),
(e.style.bottom = v(o - S.y)),
(e.style.left = v(_)),
(u = p < d),
e.classList.toggle(Q['common-tooltip--direction_reversed'], u),
e.classList.toggle(Q['common-tooltip--direction_normal'], !u),
(f = i.getBoundingClientRect().top),
(l = f < ee ? 'below' : 'above'),
(l = t.above ? 'above' : l),
(l = t.below ? 'below' : l),
a.classList.toggle(Q['common-tooltip__ear-holder--above'], 'above' === l),
a.classList.toggle(Q['common-tooltip__ear-holder--below'], 'below' === l),
'below' === l && ((e.style.bottom = 'auto'), (e.style.top = v(S.y + S.h))),
(m = C(e)),
(y = i.getBoundingClientRect().left),
(g = Math.round(S.x + S.w / 2 - (y + i.clientWidth / 2))),
(e.style.left = v(_ + g)),
(e.style.width = v(i.clientWidth + m.clientWidth)),
(g = u ? Math.max(0, g) : Math.min(0, g)),
(m.style.left = v(-g)),
(i.style.left = v(-g))));
}
function y(e) {
e.classList.toggle(Q['common-tooltip--hidden'], !1);
}
function g(e) {
e.classList.toggle(Q['common-tooltip--hidden'], !0);
}
function v(e) {
return Math.floor(e) + 'px';
}
function S(e) {
return e.map(function(e) {
return '
' + e + '';
});
}
function b() {
return re.cloneNode(!0);
}
function w() {
return se.cloneNode(!0);
}
function P() {
return ae.cloneNode(!0);
}
function T(e) {
return e.querySelector('.' + Q['common-tooltip__ear-holder']);
}
function x(e) {
return e.querySelector('.' + Q['common-tooltip__body']);
}
function C(e) {
return e.querySelector('.' + Q['common-tooltip__button-container']);
}
function L(e, t) {
var i, n, o, r, s;
return (
void 0 === t && (t = {}),
(i = B(t)),
(n = i.content),
(o = N.e(i, ['content'])),
(r = _(e)),
(s = Object.assign(r, o)),
'none' !== n.type && (s.content = n),
!('none' === s.content.type && !s.hotkey) && (I(s), !0)
);
}
function I(e) {
var t = B(e),
i = f(t);
(he = { options: t, element: i }),
c(i).then(function() {
n(),
ce
? V(i)
: (g(i),
s(function() {
return V(i);
}, E(t)));
});
}
function A(e) {
return p(e);
}
function k(e) {
var t,
i,
n,
o = e.target,
r = e.currentTarget,
s = O(o, r, 'apply-common-tooltip'),
a = function(t) {
var i, n, o;
if ('buttons' in e) {
if (1 & e.buttons) return 'continue';
} else if (1 === e.which) return 'continue';
if (
(i = function() {
return L(t);
})()
)
return (
(n = function() {
t.removeEventListener('common-tooltip-update', i),
t.removeEventListener('mouseleave', n),
t.removeEventListener('mousedown', n),
document.removeEventListener('scroll', n),
M();
}),
(o = function(e) {
27 === e.keyCode && (document.removeEventListener('keydown', o), n());
}),
t.addEventListener('common-tooltip-update', i),
t.addEventListener('mouseleave', n),
t.addEventListener('mousedown', n),
document.addEventListener('scroll', n),
document.addEventListener('keydown', o),
'break'
);
};
for (t = 0, i = s; t < i.length && ((n = i[t]), 'break' !== a(n)); t++);
}
function E(e) {
return 'number' != typeof e.tooltipDelay || isNaN(e.tooltipDelay) ? le : e.tooltipDelay;
}
function M() {
var e, t, i;
n(),
ce &&
he &&
((e = he.element),
(t = he.options),
(i = function() {
e.removeEventListener('mouseleave', i),
g(e),
o(function() {
l(), (ce = !1), (he = null);
}, le / 2);
}),
t.tooltipHideDelay
? r(function() {
e.querySelector(':hover') ? e.addEventListener('mouseleave', i) : i();
}, t.tooltipHideDelay)
: i());
}
function V(e) {
var t,
i = Object($.ensureNotNull)(he).options;
m(e, i),
y(e),
(ce = !0),
i.forceHideOnMove &&
((t = function() {
document.removeEventListener('mousemove', t), M();
}),
document.addEventListener('mousemove', t));
}
function D(e) {
return e && (e.nodeType === Node.ELEMENT_NODE ? e : null);
}
function O(e, t, i) {
for (var n = []; e && e !== t; )
e.classList && e.classList.contains(i) && n.push(e),
(e = e.parentElement || D(e.parentNode));
return n;
}
function R(e) {
return 'content' in e;
}
function B(e) {
var t, i, n, o, r;
return R(e)
? e
: ((t = e.inner),
(i = e.html),
(n = e.text),
(o = N.e(e, ['inner', 'html', 'text'])),
(r = { type: 'none' }),
t && (r = { type: 'element', data: t }),
n && (r = { type: i ? 'html' : 'text', data: n }),
N.a({ content: r }, o));
}
var N,
F,
W,
H,
j,
z,
U,
q,
$,
Y,
G,
K,
Z,
J,
X,
Q,
ee,
te,
ie,
ne,
oe,
re,
se,
ae,
le,
ce,
he;
Object.defineProperty(t, '__esModule', { value: !0 }),
(N = i(1)),
(F = i(127)),
(W = 0),
(H = 0),
(j = 0),
(z = 'tooltip-root-element'),
(q = new Promise(function(e) {
'interactive' === document.readyState
? (a(), e())
: document.addEventListener('DOMContentLoaded', function() {
a(), e();
});
})),
($ = i(7)),
(Y = { default: '', white: 'theme-white', 'round-shadow': 'theme-round-shadow' }),
(G = Object.keys(Y)),
(K = new WeakMap()),
(Z = i(306)),
(J = i(202)),
(X = i(38)),
i(85),
(Q = i(473)),
(ee = 10),
(te = 'common-tooltip-wrapper'),
(ie =
'\n\t
\n'),
(ne = '\n\t
\n'),
(oe = '\n\t
\n'),
(re = Object(J.b)(ie)),
(se = Object(J.b)(ne)),
(ae = Object(J.b)(oe)),
(t.showOnElement = L),
(t.show = I),
(t.updateTooltipText = A),
(t.hide = M),
(le = 500),
(ce = !1),
(he = null),
Modernizr.touch || document.addEventListener('mouseover', k, !0);
},
function(e, t, i) {
'use strict';
function n(e, t, i, n, o) {
function r(e) {
return t && t[e] ? t[e] : e;
}
function s(e, t, i, n) {
var o = r(t[0]);
return (
!!e.hasOwnProperty(o) &&
(t.length > 1
? s(e[o], t.slice(1), i)
: (e[o] && e[o].setValue ? e[o].setValue(i) : (e[o] = i), !0))
);
}
function a(e) {
i || y.logWarn('Path `' + e + '` does not exist.');
}
var l, c, h, u;
if (n)
for (l in n)
(c = l.split('.')),
(h = r(c[0])),
(u = void 0 !== o && o === c[0]),
0 !== c.length && u && ((c = c.slice(1)), (h = r(c[0]))),
0 !== c.length && e.hasOwnProperty(h) ? s(e, c, n[l]) || a(l) : u && a(l);
}
function o(e, t, i, o) {
window.__defaultsOverrides && n(e, t, i, window.__defaultsOverrides, o);
}
function r() {
var e = /^linetool.+/;
Object.keys(TradingView.defaultProperties).forEach(function(t) {
e.test(t) && o(TradingView.defaultProperties[t], null, !1, t);
});
}
function s(e, t) {
return t ? c(e, t) : a(e);
}
function a(e) {
var t,
i = g(e);
return (
window._UNIT_TESTS ||
((t = TradingView.clone(TVSettings.getJSON(e, null))) && TradingView.merge(i, t)),
i
);
}
function l(e) {
var t, i;
return (
!!e && ((e = '' + e), (t = RegExp('\\d+')), (i = t.exec(e)), null !== i && i[0] === e)
);
}
function c(e, t) {
var i,
n,
o,
r,
s = g(e);
return (
window._UNIT_TESTS ||
((i = TradingView.clone(TVSettings.getJSON(e, null))),
e.startsWith('study_') &&
i &&
l(i.version) &&
((n = i.inputs),
(o = t.updateStudyInputs(i.id, i.version, 'last', n, null)),
(i.inputs = o),
(r = t.updateStudyState(i, i)),
(i = r)),
TradingView.merge(s, i)),
s
);
}
var h = i(40),
u = i(247).LineToolPitchforkStyle,
d = i(203).LineToolBarsPatternMode,
p = i(86).PlotType,
_ = i(161),
f = i(103).LineEnd,
m = i(323).StatsPosition,
y = i(4).getLogger('Chart.Defaults'),
g = function(e) {
var t,
i,
n,
s,
a,
l,
c,
y,
g = {
a: function(e, t) {
return { color: e, visible: t };
},
b: function(e, t, i) {
return { coeff: e, color: t, visible: i };
},
c: function(e, t, i, n, o) {
return {
coeff: e,
color: t,
visible: i,
linestyle: void 0 === n ? CanvasEx.LINESTYLE_SOLID : n,
linewidth: void 0 === o ? 1 : o,
};
},
d: function(e, t, i) {
return { color: e, width: i, visible: t };
},
e: function(e, t, i, n, o) {
return { color: e, visible: t, width: i, x: n, y: o };
},
f: function(e, t, i, n, o, r) {
return {
coeff1: e,
coeff2: t,
color: i,
visible: n,
linestyle: void 0 === o ? CanvasEx.LINESTYLE_SOLID : o,
linewidth: void 0 === r ? 1 : r,
};
},
};
if (void 0 === TradingView.defaultProperties) {
switch (window.locale) {
case 'ar_AE':
t = 'Asia/Dubai';
break;
case 'au':
t = 'Australia/Sydney';
break;
case 'br':
t = 'America/Sao_Paulo';
break;
case 'ca':
t = 'America/Toronto';
break;
case 'de_DE':
case 'it':
t = 'Europe/Berlin';
break;
case 'es':
t = 'Europe/Madrid';
break;
case 'fa_IR':
t = 'Asia/Tehran';
break;
case 'fr':
case 'sv_SE':
t = 'Europe/Paris';
break;
case 'he_IL':
case 'tr':
t = 'Europe/Athens';
break;
case 'hu_HU':
case 'pl':
t = 'Europe/Warsaw';
break;
case 'id':
case 'th_TH':
case 'vi_VN':
t = 'Asia/Bangkok';
break;
case 'in':
t = 'Asia/Kolkata';
break;
case 'ja':
case 'kr':
t = 'Asia/Tokyo';
break;
case 'ms_MY':
t = 'Asia/Singapore';
break;
case 'ru':
t = 'Europe/Moscow';
break;
case 'uk':
t = 'Europe/London';
break;
case 'zh_CN':
case 'zh_TW':
t = 'Asia/Shanghai';
break;
default:
t = 'Etc/UTC';
}
(TradingView.defaultProperties = {
chartproperties: {
timezone: t,
dataWindowProperties: {
background: 'rgba( 255, 254, 206, 0.2)',
border: 'rgba( 96, 96, 144, 1)',
font: 'Verdana',
fontBold: !1,
fontItalic: !1,
fontSize: 10,
transparency: 80,
visible: !0,
},
paneProperties: {
background: '#ffffff',
gridProperties: { color: '#e1ecf2', style: CanvasEx.LINESTYLE_SOLID },
vertGridProperties: { color: '#e1ecf2', style: CanvasEx.LINESTYLE_SOLID },
horzGridProperties: { color: '#e1ecf2', style: CanvasEx.LINESTYLE_SOLID },
crossHairProperties: {
color: '#758696',
style: CanvasEx.LINESTYLE_DASHED,
transparency: 0,
width: 1,
},
topMargin: 5,
bottomMargin: 5,
leftAxisProperties: {
autoScale: !0,
autoScaleDisabled: !1,
lockScale: !1,
percentage: !1,
percentageDisabled: !1,
indexedTo100: !1,
log: !1,
logDisabled: !1,
alignLabels: !0,
},
rightAxisProperties: {
autoScale: !0,
autoScaleDisabled: !1,
lockScale: !1,
percentage: !1,
percentageDisabled: !1,
log: !1,
logDisabled: !1,
alignLabels: !0,
},
legendProperties: {
showStudyArguments: !0,
showStudyTitles: !0,
showStudyValues: !0,
showSeriesTitle: !0,
showSeriesOHLC: !0,
showLegend: !0,
showBarChange: !0,
showOnlyPriceSource: !0,
},
},
scalesProperties: {
showLeftScale: !1,
showRightScale: !0,
backgroundColor: '#ffffff',
lineColor: '#555',
textColor: '#555',
fontSize: 11,
scaleSeriesOnly: !1,
showSeriesLastValue: !0,
showSeriesPrevCloseValue: !1,
showStudyLastValue: !1,
showSymbolLabels: !1,
showStudyPlotLabels: !1,
barSpacing: _.DEFAULT_BAR_SPACING,
},
mainSeriesProperties: {
style: h.STYLE_CANDLES,
esdShowDividends: !0,
esdShowSplits: !0,
esdShowEarnings: !0,
esdShowBreaks: !1,
esdBreaksStyle: {
color: 'rgba( 235, 77, 92, 1)',
style: CanvasEx.LINESTYLE_DASHED,
width: 1,
},
esdFlagSize: 2,
showCountdown: !0,
showInDataWindow: !0,
visible: !0,
showPriceLine: !0,
priceLineWidth: 1,
priceLineColor: '',
baseLineColor: '#B2B5BE',
showPrevClosePriceLine: !1,
prevClosePriceLineWidth: 1,
prevClosePriceLineColor: 'rgba( 85, 85, 85, 1)',
minTick: 'default',
extendedHours: !1,
sessVis: !1,
statusViewStyle: {
fontSize: 17,
showExchange: !0,
showInterval: !0,
showSymbolAsDescription: !1,
},
candleStyle: {
upColor: '#53b987',
downColor: '#eb4d5c',
drawWick: !0,
drawBorder: !0,
borderColor: '#378658',
borderUpColor: '#53b987',
borderDownColor: '#eb4d5c',
wickColor: '#737375',
wickUpColor: '#a9cdd3',
wickDownColor: '#f5a6ae',
barColorsOnPrevClose: !1,
},
hollowCandleStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
drawWick: !0,
drawBorder: !0,
borderColor: 'rgba( 55, 134, 88, 1)',
borderUpColor: 'rgba( 83, 185, 135, 1)',
borderDownColor: 'rgba( 255, 77, 92, 1)',
wickColor: 'rgba( 115, 115, 117, 1)',
wickUpColor: 'rgba( 169, 220, 195, 1)',
wickDownColor: 'rgba( 245, 166, 174, 1)',
},
haStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
drawWick: !0,
drawBorder: !0,
borderColor: 'rgba( 55, 134, 88, 1)',
borderUpColor: 'rgba( 83, 185, 135, 1)',
borderDownColor: 'rgba( 255, 77, 92, 1)',
wickColor: 'rgba( 115, 115, 117, 1)',
wickUpColor: 'rgba( 83, 185, 135, 1)',
wickDownColor: 'rgba( 255, 77, 92, 1)',
showRealLastPrice: !1,
barColorsOnPrevClose: !1,
inputs: {},
inputInfo: {},
},
barStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
barColorsOnPrevClose: !1,
dontDrawOpen: !1,
},
lineStyle: {
color: 'rgba( 60, 120, 216, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
priceSource: 'close',
styleType: h.STYLE_LINE_TYPE_SIMPLE,
},
areaStyle: {
color1: 'rgba( 96, 96, 144, 0.5)',
color2: 'rgba( 1, 246, 245, 0.5)',
linecolor: 'rgba( 0, 148, 255, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
priceSource: 'close',
transparency: 50,
},
priceAxisProperties: {
autoScale: !0,
autoScaleDisabled: !1,
lockScale: !1,
percentage: !1,
percentageDisabled: !1,
log: !1,
logDisabled: !1,
},
renkoStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
borderUpColor: 'rgba( 83, 185, 135, 1)',
borderDownColor: 'rgba( 255, 77, 92, 1)',
upColorProjection: 'rgba( 169, 220, 195, 1)',
downColorProjection: 'rgba( 245, 166, 174, 1)',
borderUpColorProjection: 'rgba( 169, 220, 195, 1)',
borderDownColorProjection: 'rgba( 245, 166, 174, 1)',
wickUpColor: 'rgba( 83, 185, 135, 1)',
wickDownColor: 'rgba( 255, 77, 92, 1)',
inputs: { source: 'close', boxSize: 3, style: 'ATR', atrLength: 14, wicks: !0 },
inputInfo: {
source: { name: 'Source' },
boxSize: { name: 'Box size' },
style: { name: 'Style' },
atrLength: { name: 'ATR Length' },
wicks: { name: 'Wicks' },
},
},
pbStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
borderUpColor: 'rgba( 83, 185, 135, 1)',
borderDownColor: 'rgba( 255, 77, 92, 1)',
upColorProjection: 'rgba( 169, 220, 195, 1)',
downColorProjection: 'rgba( 245, 166, 174, 1)',
borderUpColorProjection: 'rgba( 169, 220, 195, 1)',
borderDownColorProjection: 'rgba( 245, 166, 174, 1)',
inputs: { source: 'close', lb: 3 },
inputInfo: { source: { name: 'Source' }, lb: { name: 'Number of line' } },
},
kagiStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
upColorProjection: 'rgba( 169, 220, 195, 1)',
downColorProjection: 'rgba( 245, 166, 174, 1)',
inputs: { source: 'close', style: 'ATR', atrLength: 14, reversalAmount: 1 },
inputInfo: {
source: { name: 'Source' },
style: { name: 'Style' },
atrLength: { name: 'ATR Length' },
reversalAmount: { name: 'Reversal amount' },
},
},
pnfStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
upColorProjection: 'rgba( 169, 220, 195, 1)',
downColorProjection: 'rgba( 245, 166, 174, 1)',
inputs: {
sources: 'Close',
reversalAmount: 3,
boxSize: 1,
style: 'ATR',
atrLength: 14,
},
inputInfo: {
sources: { name: 'Source' },
boxSize: { name: 'Box size' },
reversalAmount: { name: 'Reversal amount' },
style: { name: 'Style' },
atrLength: { name: 'ATR Length' },
},
},
baselineStyle: {
baselineColor: 'rgba( 117, 134, 150, 1)',
topFillColor1: 'rgba( 83, 185, 135, 0.1)',
topFillColor2: 'rgba( 83, 185, 135, 0.1)',
bottomFillColor1: 'rgba( 235, 77, 92, 0.1)',
bottomFillColor2: 'rgba( 235, 77, 92, 0.1)',
topLineColor: 'rgba( 83, 185, 135, 1)',
bottomLineColor: 'rgba( 235, 77, 92, 1)',
topLineWidth: 1,
bottomLineWidth: 1,
priceSource: 'close',
transparency: 50,
baseLevelPercentage: 50,
},
rangeStyle: {
upColor: 'rgba( 83, 185, 135, 1)',
downColor: 'rgba( 255, 77, 92, 1)',
upColorProjection: 'rgba( 169, 220, 195, 1)',
downColorProjection: 'rgba( 245, 166, 174, 1)',
inputs: { range: 10, phantomBars: !1 },
inputInfo: { range: { name: 'Range' }, phantomBars: { name: 'Phantom Bars' } },
},
},
symbolWatermarkProperties: { color: 'rgba( 85, 85, 85, 0)', transparency: 100 },
chartEventsSourceProperties: {
visible: !0,
futureOnly: !0,
breaks: {
color: 'rgba(85, 85, 85, 1)',
visible: !1,
style: CanvasEx.LINESTYLE_DASHED,
width: 1,
},
},
tradingProperties: {
showPositions: !0,
showOrders: !0,
showExecutions: !0,
extendLeft: !0,
lineLength: 5,
lineWidth: 1,
lineStyle: CanvasEx.LINESTYLE_DASHED,
},
alertsProperties: {
labels: {
visible: !0,
color: 'rgba( 215, 84, 66, 1)',
highlightColor: 'rgba( 255, 255, 51, 1)',
hoverColor: 'rgba( 245, 227, 135, 1)',
line: { visible: !0, style: CanvasEx.LINESTYLE_DASHED, width: 1 },
},
fakeLabels: {
visible: !0,
color: 'rgba( 119, 119, 119, 1)',
line: { visible: !0, style: CanvasEx.LINESTYLE_DASHED, width: 1 },
},
drawingIcon: { color: 'rgba( 170, 170, 170, 1)' },
},
editorFontsList: ['Verdana', 'Courier New', 'Times New Roman', 'Arial'],
volumePaneSize: 'large',
},
drawings: {
magnet: !1,
stayInDrawingMode: !1,
drawOnAllCharts: !0,
crossHairColor: '#585858',
crossHairStyle: CanvasEx.LINESTYLE_DASHED,
crossHairWidth: 1,
},
linetoolorder: {
singleChartOnly: !0,
extendLeft: 'inherit',
lineLength: 'inherit',
lineColor: 'rgba( 255, 0, 0, 1)',
lineTransparency: 0,
lineStyle: 'inherit',
lineWidth: 'inherit',
bodyBorderColor: 'rgba( 255, 0, 0, 0)',
bodyBorderTransparency: 0,
bodyBackgroundColor: 'rgba( 255, 255, 255, 0.75)',
bodyBackgroundTransparency: 25,
bodyTextColor: 'rgba( 255, 0, 0, 0)',
bodyTextTransparency: 0,
bodyFontFamily: 'Verdana',
bodyFontSize: 7,
bodyFontBold: !0,
bodyFontItalic: !1,
quantityBorderColor: 'rgba( 255, 0, 0, 0)',
quantityBorderTransparency: 0,
quantityBackgroundColor: 'rgba( 255, 0, 0, 0.75)',
quantityBackgroundTransparency: 25,
quantityTextColor: 'rgba( 255, 255, 255, 1)',
quantityTextTransparency: 0,
quantityFontFamily: 'Verdana',
quantityFontSize: 7,
quantityFontBold: !0,
quantityFontItalic: !1,
cancelButtonBorderColor: 'rgba( 255, 0, 0, 1)',
cancelButtonBorderTransparency: 0,
cancelButtonBackgroundColor: 'rgba( 255, 255, 255, 0.75)',
cancelButtonBackgroundTransparency: 25,
cancelButtonIconColor: 'rgba( 255, 0, 0, 1)',
cancelButtonIconTransparency: 0,
tooltip: '',
},
linetoolposition: {
singleChartOnly: !0,
extendLeft: 'inherit',
lineLength: 'inherit',
lineColor: 'rgba( 0, 113, 224, 1)',
lineTransparency: 0,
lineStyle: 'inherit',
lineWidth: 'inherit',
bodyBorderColor: 'rgba( 0, 113, 224, 1)',
bodyBorderTransparency: 0,
bodyBackgroundColor: 'rgba( 255, 255, 255, 0.75)',
bodyBackgroundTransparency: 25,
bodyTextColor: 'rgba( 0, 113, 224, 1)',
bodyTextTransparency: 0,
bodyFontFamily: 'Verdana',
bodyFontSize: 7,
bodyFontBold: !0,
bodyFontItalic: !1,
quantityBorderColor: 'rgba( 0, 113, 224, 1)',
quantityBorderTransparency: 0,
quantityBackgroundColor: 'rgba( 0, 113, 224, 0.75)',
quantityBackgroundTransparency: 25,
quantityTextColor: 'rgba( 255, 255, 255, 1)',
quantityTextTransparency: 0,
quantityFontFamily: 'Verdana',
quantityFontSize: 7,
quantityFontBold: !0,
quantityFontItalic: !1,
reverseButtonBorderColor: 'rgba( 0, 113, 224, 1)',
reverseButtonBorderTransparency: 0,
reverseButtonBackgroundColor: 'rgba( 255, 255, 255, 0.75)',
reverseButtonBackgroundTransparency: 25,
reverseButtonIconColor: 'rgba( 0, 113, 224, 1)',
reverseButtonIconTransparency: 0,
closeButtonBorderColor: 'rgba( 0, 113, 224, 1)',
closeButtonBorderTransparency: 0,
closeButtonBackgroundColor: 'rgba( 255, 255, 255, 0.75)',
closeButtonBackgroundTransparency: 25,
closeButtonIconColor: 'rgba( 0, 113, 224, 1)',
closeButtonIconTransparency: 0,
tooltip: '',
},
linetoolexecution: {
singleChartOnly: !0,
direction: 'buy',
arrowHeight: 8,
arrowSpacing: 1,
arrowColor: 'rgba( 0, 0, 255, 1)',
arrowTransparency: 0,
text: '',
textColor: 'rgba( 0, 0, 0, 1)',
textTransparency: 0,
fontFamily: 'Verdana',
fontSize: 8,
fontBold: !1,
fontItalic: !1,
tooltip: '',
},
linetoolicon: {
singleChartOnly: !0,
clonable: !0,
color: 'rgba( 61, 133, 198, 1)',
size: 40,
icon: 61536,
angle: 0.5 * Math.PI,
scale: 1,
},
linetoolbezierquadro: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
fillBackground: !1,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
transparency: 50,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
},
linetoolbeziercubic: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
fillBackground: !1,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
transparency: 50,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
},
linetooltrendline: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
snapTo45Degrees: !0,
alwaysShowStats: !1,
showMiddlePoint: !1,
showPriceRange: !1,
showBarsRange: !1,
showDateTimeRange: !1,
showDistance: !1,
showAngle: !1,
statsPosition: m.Right,
},
linetoolinfoline: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
snapTo45Degrees: !0,
alwaysShowStats: !0,
showMiddlePoint: !1,
showPriceRange: !0,
showBarsRange: !0,
showDateTimeRange: !0,
showDistance: !0,
showAngle: !0,
statsPosition: m.Center,
},
linetooltimecycles: {
clonable: !0,
linecolor: 'rgba(21, 153, 128, 1)',
linewidth: 1,
fillBackground: !0,
backgroundColor: 'rgba(106, 168, 79, 0.5)',
transparency: 50,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
linetoolsineline: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
linetooltrendangle: {
singleChartOnly: !0,
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
snapTo45Degrees: !0,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !0,
italic: !1,
alwaysShowStats: !1,
showMiddlePoint: !1,
showPriceRange: !1,
showBarsRange: !1,
extendRight: !1,
extendLeft: !1,
statsPosition: m.Right,
},
linetooldisjointangle: {
clonable: !0,
linecolor: 'rgba( 18, 159, 92, 1)',
linewidth: 2,
linestyle: CanvasEx.LINESTYLE_SOLID,
fillBackground: !0,
backgroundColor: 'rgba( 106, 168, 79, 0.5)',
transparency: 50,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 18, 159, 92, 1)',
fontsize: 12,
bold: !1,
italic: !1,
showPrices: !1,
showPriceRange: !1,
showDateTimeRange: !1,
showBarsRange: !1,
},
linetoolflatbottom: {
clonable: !0,
linecolor: 'rgba( 73, 133, 231, 1)',
linewidth: 2,
linestyle: CanvasEx.LINESTYLE_SOLID,
fillBackground: !0,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
transparency: 50,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 73, 133, 231, 1)',
fontsize: 12,
bold: !1,
italic: !1,
showPrices: !1,
showPriceRange: !1,
showDateTimeRange: !1,
showBarsRange: !1,
},
linetoolfibspiral: {
counterclockwise: !1,
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
linetooldaterange: {
clonable: !0,
linecolor: 'rgba( 88, 88, 88, 1)',
linewidth: 1,
font: 'Verdana',
textcolor: 'rgba( 255, 255, 255, 1)',
fontsize: 12,
fillLabelBackground: !0,
labelBackgroundColor: 'rgba( 91, 133, 191, 0.9)',
labelBackgroundTransparency: 30,
fillBackground: !0,
backgroundColor: 'rgba( 186, 218, 255, 0.4)',
backgroundTransparency: 60,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
extendTop: !1,
extendBottom: !1,
},
linetoolpricerange: {
clonable: !0,
linecolor: 'rgba( 88, 88, 88, 1)',
linewidth: 1,
font: 'Verdana',
textcolor: 'rgba( 255, 255, 255, 1)',
fontsize: 12,
fillLabelBackground: !0,
labelBackgroundColor: 'rgba( 91, 133, 191, 0.9)',
labelBackgroundTransparency: 30,
fillBackground: !0,
backgroundColor: 'rgba( 186, 218, 255, 0.4)',
backgroundTransparency: 60,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
extendLeft: !1,
extendRight: !1,
},
linetooldateandpricerange: {
clonable: !0,
linecolor: 'rgba( 88, 88, 88, 1)',
linewidth: 1,
font: 'Verdana',
textcolor: 'rgba( 255, 255, 255, 1)',
fontsize: 12,
fillLabelBackground: !0,
labelBackgroundColor: 'rgba( 91, 133, 191, 0.9)',
labelBackgroundTransparency: 30,
fillBackground: !0,
backgroundColor: 'rgba( 186, 218, 255, 0.4)',
backgroundTransparency: 60,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
},
linetoolriskrewardshort: {
clonable: !0,
linecolor: 'rgba( 88, 88, 88, 1)',
linewidth: 1,
font: 'Verdana',
textcolor: 'rgba(255, 255, 255, 1)',
fontsize: 12,
fillLabelBackground: !0,
labelBackgroundColor: 'rgba( 88, 88, 88, 1)',
labelBackgroundTransparency: 0,
fillBackground: !0,
stopBackground: 'rgba( 255, 0, 0, 0.2)',
profitBackground: 'rgba( 0, 160, 0, 0.2)',
stopBackgroundTransparency: 80,
profitBackgroundTransparency: 80,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
compact: !1,
riskDisplayMode: 'percents',
accountSize: 1e3,
risk: 25,
},
linetoolriskrewardlong: {
clonable: !0,
linecolor: 'rgba( 88, 88, 88, 1)',
linewidth: 1,
font: 'Verdana',
textcolor: 'rgba(255, 255, 255, 1)',
fontsize: 12,
fillLabelBackground: !0,
labelBackgroundColor: 'rgba( 88, 88, 88, 1)',
labelBackgroundTransparency: 0,
fillBackground: !0,
stopBackground: 'rgba( 255, 0, 0, 0.2)',
profitBackground: 'rgba( 0, 160, 0, 0.2)',
stopBackgroundTransparency: 80,
profitBackgroundTransparency: 80,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
compact: !1,
riskDisplayMode: 'percents',
accountSize: 1e3,
risk: 25,
},
linetoolarrow: {
clonable: !0,
linecolor: 'rgba( 111, 136, 198, 1)',
linewidth: 2,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
leftEnd: f.Normal,
rightEnd: f.Arrow,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
alwaysShowStats: !1,
showMiddlePoint: !1,
showPriceRange: !1,
showBarsRange: !1,
showDateTimeRange: !1,
showDistance: !1,
showAngle: !1,
statsPosition: m.Right,
},
linetoolray: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !0,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
alwaysShowStats: !1,
showMiddlePoint: !1,
showPriceRange: !1,
showBarsRange: !1,
showDateTimeRange: !1,
showDistance: !1,
showAngle: !1,
statsPosition: m.Right,
},
linetoolextended: {
clonable: !0,
linecolor: 'rgba( 21, 153, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !0,
extendRight: !0,
leftEnd: f.Normal,
rightEnd: f.Normal,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
alwaysShowStats: !1,
showMiddlePoint: !1,
showPriceRange: !1,
showBarsRange: !1,
showDateTimeRange: !1,
showDistance: !1,
showAngle: !1,
statsPosition: m.Right,
},
linetoolhorzline: {
clonable: !0,
linecolor: 'rgba( 128, 204, 219, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
showPrice: !0,
showLabel: !1,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
horzLabelsAlign: 'center',
vertLabelsAlign: 'top',
},
linetoolhorzray: {
clonable: !0,
linecolor: 'rgba( 128, 204, 219, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
showPrice: !0,
showLabel: !1,
font: 'Verdana',
textcolor: 'rgba( 21, 119, 96, 1)',
fontsize: 12,
bold: !1,
italic: !1,
horzLabelsAlign: 'center',
vertLabelsAlign: 'top',
},
linetoolvertline: {
clonable: !0,
linecolor: 'rgba( 128, 204, 219, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
showTime: !0,
},
linetoolcrossline: {
clonable: !0,
linecolor: 'rgba(6, 160, 227, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
showPrice: !0,
showTime: !0,
},
linetoolcirclelines: {
clonable: !0,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
linecolor: 'rgba( 128, 204, 219, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
linetoolfibtimezone: {
horzLabelsAlign: 'right',
vertLabelsAlign: 'bottom',
clonable: !0,
baselinecolor: 'rgba( 128, 128, 128, 1)',
linecolor: 'rgba( 0, 85, 219, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
showLabels: !0,
font: 'Verdana',
fillBackground: !1,
transparency: 80,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
level1: g.c(0, 'rgba( 128, 128, 128, 1)', !0),
level2: g.c(1, 'rgba( 0, 85, 219, 1)', !0),
level3: g.c(2, 'rgba( 0, 85, 219, 1)', !0),
level4: g.c(3, 'rgba( 0, 85, 219, 1)', !0),
level5: g.c(5, 'rgba( 0, 85, 219, 1)', !0),
level6: g.c(8, 'rgba( 0, 85, 219, 1)', !0),
level7: g.c(13, 'rgba( 0, 85, 219, 1)', !0),
level8: g.c(21, 'rgba( 0, 85, 219, 1)', !0),
level9: g.c(34, 'rgba( 0, 85, 219, 1)', !0),
level10: g.c(55, 'rgba( 0, 85, 219, 1)', !0),
level11: g.c(89, 'rgba( 0, 85, 219, 1)', !0),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetooltext: {
clonable: !0,
color: 'rgba( 102, 123, 139, 1)',
font: 'Verdana',
fontsize: 20,
fillBackground: !1,
backgroundColor: 'rgba( 91, 133, 191, 0.9)',
backgroundTransparency: 70,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
bold: !1,
italic: !1,
locked: !1,
fixedSize: !0,
wordWrap: !1,
wordWrapWidth: 400,
},
linetooltextabsolute: {
singleChartOnly: !0,
clonable: !0,
color: 'rgba( 102, 123, 139, 1)',
font: 'Verdana',
fontsize: 20,
fillBackground: !1,
backgroundColor: 'rgba( 155, 190, 213, 0.3)',
backgroundTransparency: 70,
drawBorder: !1,
borderColor: 'rgba( 102, 123, 139, 1)',
bold: !1,
italic: !1,
locked: !0,
wordWrap: !1,
wordWrapWidth: 400,
},
linetoolballoon: {
clonable: !0,
color: 'rgba( 102, 123, 139, 1)',
backgroundColor: 'rgba( 255, 254, 206, 0.7)',
borderColor: 'rgba( 140, 140, 140, 1)',
fontWeight: 'bold',
fontsize: 12,
font: 'Arial',
transparency: 30,
},
linetoolbrush: {
clonable: !0,
linecolor: 'rgba( 53, 53, 53, 1)',
linewidth: 2,
linestyle: CanvasEx.LINESTYLE_SOLID,
smooth: 5,
fillBackground: !1,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
transparency: 50,
leftEnd: f.Normal,
rightEnd: f.Normal,
},
linetoolpolyline: {
clonable: !0,
linecolor: 'rgba( 53, 53, 53, 1)',
linewidth: 2,
linestyle: CanvasEx.LINESTYLE_SOLID,
fillBackground: !0,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
transparency: 50,
filled: !1,
},
linetoolarrowmark: {
clonable: !0,
color: 'rgba( 120, 120, 120, 1)',
fontsize: 20,
font: 'Verdana',
},
linetoolarrowmarkleft: {
clonable: !0,
color: 'rgba( 120, 120, 120, 1)',
fontsize: 20,
font: 'Verdana',
},
linetoolarrowmarkup: {
clonable: !0,
color: 'rgba( 120, 120, 120, 1)',
fontsize: 20,
font: 'Verdana',
},
linetoolarrowmarkright: {
clonable: !0,
color: 'rgba( 120, 120, 120, 1)',
fontsize: 20,
font: 'Verdana',
},
linetoolarrowmarkdown: {
clonable: !0,
color: 'rgba( 120, 120, 120, 1)',
fontsize: 20,
font: 'Verdana',
},
linetoolflagmark: { clonable: !0, color: 'rgba( 255, 0, 0, 1)' },
linetoolnote: {
clonable: !0,
markerColor: 'rgba( 46, 102, 255, 1)',
textColor: 'rgba( 0, 0, 0, 1)',
backgroundColor: 'rgba( 255, 255, 255, 1)',
backgroundTransparency: 0,
font: 'Arial',
fontSize: 12,
bold: !1,
italic: !1,
locked: !1,
fixedSize: !0,
},
linetoolnoteabsolute: {
singleChartOnly: !0,
clonable: !0,
markerColor: 'rgba( 46, 102, 255, 1)',
textColor: 'rgba( 0, 0, 0, 1)',
backgroundColor: 'rgba( 255, 255, 255, 1)',
backgroundTransparency: 0,
font: 'Arial',
fontSize: 12,
bold: !1,
italic: !1,
locked: !0,
fixedSize: !0,
},
linetoolthumbup: { clonable: !0, color: 'rgba( 0, 128, 0, 1)' },
linetoolthumbdown: { clonable: !0, color: 'rgba( 255, 0, 0, 1)' },
linetoolpricelabel: {
clonable: !0,
color: 'rgba( 102, 123, 139, 1)',
backgroundColor: 'rgba( 255, 255, 255, 0.7)',
borderColor: 'rgba( 140, 140, 140, 1)',
fontWeight: 'bold',
fontsize: 11,
font: 'Arial',
transparency: 30,
},
linetoolrectangle: {
clonable: !0,
color: 'rgba( 21, 56, 153, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 21, 56, 153, 0.5)',
linewidth: 1,
snapTo45Degrees: !0,
transparency: 50,
},
linetoolrotatedrectangle: {
clonable: !0,
color: 'rgba( 152, 0, 255, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 142, 124, 195, 0.5)',
transparency: 50,
linewidth: 1,
snapTo45Degrees: !0,
},
linetoolellipse: {
clonable: !0,
color: 'rgba( 153, 153, 21, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 153, 153, 21, 0.5)',
transparency: 50,
linewidth: 1,
},
linetoolarc: {
clonable: !0,
color: 'rgba( 153, 153, 21, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 153, 153, 21, 0.5)',
transparency: 50,
linewidth: 1,
},
linetoolprediction: {
singleChartOnly: !0,
linecolor: 'rgba( 28, 115, 219, 1)',
linewidth: 2,
sourceBackColor: 'rgba( 241, 241, 241, 1)',
sourceTextColor: 'rgba( 110, 110, 110, 1)',
sourceStrokeColor: 'rgba( 110, 110, 110, 1)',
targetStrokeColor: 'rgba( 47, 168, 255, 1)',
targetBackColor: 'rgba( 11, 111, 222, 1)',
targetTextColor: 'rgba( 255, 255, 255, 1)',
successBackground: 'rgba( 54, 160, 42, 0.9)',
successTextColor: 'rgba( 255, 255, 255, 1)',
failureBackground: 'rgba( 231, 69, 69, 0.5)',
failureTextColor: 'rgba( 255, 255, 255, 1)',
intermediateBackColor: 'rgba( 234, 210, 137, 1)',
intermediateTextColor: 'rgba( 109, 77, 34, 1)',
transparency: 10,
centersColor: 'rgba( 32, 32, 32, 1)',
},
linetooltriangle: {
clonable: !0,
color: 'rgba( 153, 21, 21, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 153, 21, 21, 0.5)',
transparency: 50,
linewidth: 1,
},
linetoolcallout: {
clonable: !0,
color: 'rgba( 255, 255, 255, 1)',
backgroundColor: 'rgba( 153, 21, 21, 0.5)',
transparency: 50,
linewidth: 2,
fontsize: 12,
font: 'Verdana',
bordercolor: 'rgba( 153, 21, 21, 1)',
bold: !1,
italic: !1,
wordWrap: !1,
wordWrapWidth: 400,
},
linetoolparallelchannel: {
clonable: !0,
linecolor: 'rgba( 119, 52, 153, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
extendLeft: !1,
extendRight: !1,
fillBackground: !0,
backgroundColor: 'rgba( 180, 167, 214, 0.5)',
transparency: 50,
showMidline: !1,
midlinecolor: 'rgba( 119, 52, 153, 1)',
midlinewidth: 1,
midlinestyle: CanvasEx.LINESTYLE_DASHED,
},
linetoolelliottimpulse: {
degree: 7,
clonable: !0,
showWave: !0,
color: 'rgba( 61, 133, 198, 1)',
linewidth: 1,
},
linetoolelliotttriangle: {
degree: 7,
clonable: !0,
showWave: !0,
color: 'rgba( 255, 152, 0, 1)',
linewidth: 1,
},
linetoolelliotttriplecombo: {
degree: 7,
clonable: !0,
showWave: !0,
color: 'rgba( 106, 168, 79, 1)',
linewidth: 1,
},
linetoolelliottcorrection: {
degree: 7,
clonable: !0,
showWave: !0,
color: 'rgba( 61, 133, 198, 1)',
linewidth: 1,
},
linetoolelliottdoublecombo: {
degree: 7,
clonable: !0,
showWave: !0,
color: 'rgba( 106, 168, 79, 1)',
linewidth: 1,
},
linetoolbarspattern: {
singleChartOnly: !0,
color: 'rgba( 80, 145, 204, 1)',
clonable: !0,
mode: d.Bars,
mirrored: !1,
flipped: !1,
},
linetoolghostfeed: {
singleChartOnly: !0,
clonable: !0,
averageHL: 20,
variance: 50,
candleStyle: {
upColor: '#6ba583',
downColor: '#d75442',
drawWick: !0,
drawBorder: !0,
borderColor: '#378658',
borderUpColor: '#225437',
borderDownColor: '#5b1a13',
wickColor: '#737375',
},
transparency: 50,
},
study: {
inputs: {},
styles: {},
palettes: {},
bands: {},
area: {},
graphics: {},
showInDataWindow: !0,
visible: !0,
showStudyArguments: !0,
precision: 'default',
},
linetoolpitchfork: {
clonable: !0,
fillBackground: !0,
transparency: 80,
style: u.Original,
median: {
visible: !0,
color: 'rgba( 165, 0, 0, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level0: g.c(0.25, 'rgba( 160, 107, 0, 1)', !1),
level1: g.c(0.382, 'rgba( 105, 158, 0, 1)', !1),
level2: g.c(0.5, 'rgba( 0, 155, 0, 1)', !0),
level3: g.c(0.618, 'rgba( 0, 153, 101, 1)', !1),
level4: g.c(0.75, 'rgba( 0, 101, 153, 1)', !1),
level5: g.c(1, 'rgba( 0, 0, 153, 1)', !0),
level6: g.c(1.5, 'rgba( 102, 0, 153, 1)', !1),
level7: g.c(1.75, 'rgba( 153, 0, 102, 1)', !1),
level8: g.c(2, 'rgba( 165, 0, 0, 1)', !1),
__collectibleLines: [
'median',
'level0',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
],
},
linetoolpitchfan: {
clonable: !0,
fillBackground: !0,
transparency: 80,
median: {
visible: !0,
color: 'rgba( 165, 0, 0, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level0: g.c(0.25, 'rgba( 160, 107, 0, 1)', !1),
level1: g.c(0.382, 'rgba( 105, 158, 0, 1)', !1),
level2: g.c(0.5, 'rgba( 0, 155, 0, 1)', !0),
level3: g.c(0.618, 'rgba( 0, 153, 101, 1)', !1),
level4: g.c(0.75, 'rgba( 0, 101, 153, 1)', !1),
level5: g.c(1, 'rgba( 0, 0, 153, 1)', !0),
level6: g.c(1.5, 'rgba( 102, 0, 153, 1)', !1),
level7: g.c(1.75, 'rgba( 153, 0, 102, 1)', !1),
level8: g.c(2, 'rgba( 165, 0, 0, 1)', !1),
__collectibleLines: [
'median',
'level0',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
],
},
linetoolgannfan: {
clonable: !0,
showLabels: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
level1: g.f(1, 8, 'rgba( 160, 107, 0, 1)', !0),
level2: g.f(1, 4, 'rgba( 105, 158, 0, 1)', !0),
level3: g.f(1, 3, 'rgba( 0, 155, 0, 1)', !0),
level4: g.f(1, 2, 'rgba( 0, 153, 101, 1)', !0),
level5: g.f(1, 1, 'rgba( 128, 128, 128, 1)', !0),
level6: g.f(2, 1, 'rgba( 0, 101, 153, 1)', !0),
level7: g.f(3, 1, 'rgba( 0, 0, 153, 1)', !0),
level8: g.f(4, 1, 'rgba( 102, 0, 153, 1)', !0),
level9: g.f(8, 1, 'rgba( 165, 0, 0, 1)', !0),
__collectibleLines: [
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetoolganncomplex: {
clonable: !0,
fillBackground: !1,
arcsBackground: { fillBackground: !0, transparency: 80 },
reverse: !1,
scaleRatio: '',
showLabels: !0,
labelsStyle: { font: 'Verdana', fontSize: 12, bold: !1, italic: !1 },
levels: [
g.d('rgba( 128, 128, 128, 1)', !0, 1),
g.d('rgba( 160, 107, 0, 1)', !0, 1),
g.d('rgba( 105, 158, 0, 1)', !0, 1),
g.d('rgba( 0, 155, 0, 1)', !0, 1),
g.d('rgba( 0, 153, 101, 1)', !0, 1),
g.d('rgba( 128, 128, 128, 1)', !0, 1),
],
fanlines: [
g.e('rgba( 165, 0, 255, 1)', !1, 1, 8, 1),
g.e('rgba( 165, 0, 0, 1)', !1, 1, 5, 1),
g.e('rgba( 128, 128, 128, 1)', !1, 1, 4, 1),
g.e('rgba( 160, 107, 0, 1)', !1, 1, 3, 1),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 1),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 1, 1),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 1, 2),
g.e('rgba( 0, 153, 101, 1)', !1, 1, 1, 3),
g.e('rgba( 0, 0, 153, 1)', !1, 1, 1, 4),
g.e('rgba( 102, 0, 153, 1)', !1, 1, 1, 5),
g.e('rgba( 165, 0, 255, 1)', !1, 1, 1, 8),
],
arcs: [
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1, 0),
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1, 1),
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1.5, 0),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 0),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 1),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 3, 0),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 3, 1),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 4, 0),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 4, 1),
g.e('rgba( 0, 0, 153, 1)', !0, 1, 5, 0),
g.e('rgba( 0, 0, 153, 1)', !0, 1, 5, 1),
],
__collectibleLines: [
'trendline',
'levels.0',
'levels.1',
'levels.2',
'levels.3',
'levels.4',
'levels.5',
'fanlines.0',
'fanlines.1',
'fanlines.2',
'fanlines.3',
'fanlines.4',
'fanlines.5',
'fanlines.6',
'fanlines.7',
'fanlines.8',
'fanlines.9',
'fanlines.10',
'arcs.0',
'arcs.1',
'arcs.2',
'arcs.3',
'arcs.4',
'arcs.5',
'arcs.6',
'arcs.7',
'arcs.8',
'arcs.9',
'arcs.10',
],
},
linetoolgannfixed: {
clonable: !0,
fillBackground: !1,
arcsBackground: {
fillBackground: !0,
transparency: 80,
},
reverse: !1,
levels: [
g.d('rgba( 128, 128, 128, 1)', !0, 1),
g.d('rgba( 160, 107, 0, 1)', !0, 1),
g.d('rgba( 105, 158, 0, 1)', !0, 1),
g.d('rgba( 0, 155, 0, 1)', !0, 1),
g.d('rgba( 0, 153, 101, 1)', !0, 1),
g.d('rgba( 128, 128, 128, 1)', !0, 1),
],
fanlines: [
g.e('rgba( 165, 0, 255, 1)', !1, 1, 8, 1),
g.e('rgba( 165, 0, 0, 1)', !1, 1, 5, 1),
g.e('rgba( 128, 128, 128, 1)', !1, 1, 4, 1),
g.e('rgba( 160, 107, 0, 1)', !1, 1, 3, 1),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 1),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 1, 1),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 1, 2),
g.e('rgba( 0, 153, 101, 1)', !1, 1, 1, 3),
g.e('rgba( 0, 0, 153, 1)', !1, 1, 1, 4),
g.e('rgba( 102, 0, 153, 1)', !1, 1, 1, 5),
g.e('rgba( 165, 0, 255, 1)', !1, 1, 1, 8),
],
arcs: [
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1, 0),
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1, 1),
g.e('rgba( 160, 107, 0, 1)', !0, 1, 1.5, 0),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 0),
g.e('rgba( 105, 158, 0, 1)', !0, 1, 2, 1),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 3, 0),
g.e('rgba( 0, 155, 0, 1)', !0, 1, 3, 1),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 4, 0),
g.e('rgba( 0, 153, 101, 1)', !0, 1, 4, 1),
g.e('rgba( 0, 0, 153, 1)', !0, 1, 5, 0),
g.e('rgba( 0, 0, 153, 1)', !0, 1, 5, 1),
],
__collectibleLines: [
'trendline',
'levels.0',
'levels.1',
'levels.2',
'levels.3',
'levels.4',
'levels.5',
'fanlines.0',
'fanlines.1',
'fanlines.2',
'fanlines.3',
'fanlines.4',
'fanlines.5',
'fanlines.6',
'fanlines.7',
'fanlines.8',
'fanlines.9',
'fanlines.10',
'arcs.0',
'arcs.1',
'arcs.2',
'arcs.3',
'arcs.4',
'arcs.5',
'arcs.6',
'arcs.7',
'arcs.8',
'arcs.9',
'arcs.10',
],
},
linetoolgannsquare: {
clonable: !0,
color: 'rgba( 21, 56, 153, 0.8)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
font: 'Verdana',
showTopLabels: !0,
showBottomLabels: !0,
showLeftLabels: !0,
showRightLabels: !0,
fillHorzBackground: !0,
horzTransparency: 80,
fillVertBackground: !0,
vertTransparency: 80,
reverse: !1,
fans: g.a('rgba( 128, 128, 128, 1)', !1),
hlevel1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
hlevel2: g.b(0.25, 'rgba( 160, 107, 0, 1)', !0),
hlevel3: g.b(0.382, 'rgba( 105, 158, 0, 1)', !0),
hlevel4: g.b(0.5, 'rgba( 0, 155, 0, 1)', !0),
hlevel5: g.b(0.618, 'rgba( 0, 153, 101, 1)', !0),
hlevel6: g.b(0.75, 'rgba( 0, 101, 153, 1)', !0),
hlevel7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
vlevel1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
vlevel2: g.b(0.25, 'rgba( 160, 107, 0, 1)', !0),
vlevel3: g.b(0.382, 'rgba( 105, 158, 0, 1)', !0),
vlevel4: g.b(0.5, 'rgba( 0, 155, 0, 1)', !0),
vlevel5: g.b(0.618, 'rgba( 0, 153, 101, 1)', !0),
vlevel6: g.b(0.75, 'rgba( 0, 101, 153, 1)', !0),
vlevel7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
__collectibleLines: [
'fans',
'hlevel1',
'hlevel2',
'hlevel3',
'hlevel4',
'hlevel5',
'hlevel6',
'hlevel7',
'vlevel1',
'vlevel2',
'vlevel3',
'vlevel4',
'vlevel5',
'vlevel6',
'vlevel7',
],
},
linetoolfibspeedresistancefan: {
clonable: !0,
fillBackground: !0,
transparency: 80,
grid: {
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
visible: !0,
},
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
font: 'Verdana',
showTopLabels: !0,
showBottomLabels: !0,
showLeftLabels: !0,
showRightLabels: !0,
snapTo45Degrees: !0,
hlevel1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
hlevel2: g.b(0.25, 'rgba( 160, 107, 0, 1)', !0),
hlevel3: g.b(0.382, 'rgba( 105, 158, 0, 1)', !0),
hlevel4: g.b(0.5, 'rgba( 0, 155, 0, 1)', !0),
hlevel5: g.b(0.618, 'rgba( 0, 153, 101, 1)', !0),
hlevel6: g.b(0.75, 'rgba( 0, 101, 153, 1)', !0),
hlevel7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
vlevel1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
vlevel2: g.b(0.25, 'rgba( 160, 107, 0, 1)', !0),
vlevel3: g.b(0.382, 'rgba( 105, 158, 0, 1)', !0),
vlevel4: g.b(0.5, 'rgba( 0, 155, 0, 1)', !0),
vlevel5: g.b(0.618, 'rgba( 0, 153, 101, 1)', !0),
vlevel6: g.b(0.75, 'rgba( 0, 101, 153, 1)', !0),
vlevel7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
__collectibleLines: [
'trendline',
'hlevel1',
'hlevel2',
'hlevel3',
'hlevel4',
'hlevel5',
'hlevel6',
'hlevel7',
'vlevel1',
'vlevel2',
'vlevel3',
'vlevel4',
'vlevel5',
'vlevel6',
'vlevel7',
],
},
linetoolfibretracement: {
clonable: !0,
showCoeffs: !0,
showPrices: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
extendLines: !1,
horzLabelsAlign: 'left',
vertLabelsAlign: 'middle',
reverse: !1,
coeffsAsPercents: !1,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
level1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
level2: g.b(0.236, 'rgba( 204, 40, 40, 1)', !0),
level3: g.b(0.382, 'rgba( 149, 204, 40, 1)', !0),
level4: g.b(0.5, 'rgba( 40, 204, 40, 1)', !0),
level5: g.b(0.618, 'rgba( 40, 204, 149, 1)', !0),
level6: g.b(0.786, 'rgba( 40, 149, 204, 1)', !0),
level7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
level8: g.b(1.618, 'rgba( 40, 40, 204, 1)', !0),
level9: g.b(2.618, 'rgba( 204, 40, 40, 1)', !0),
level10: g.b(3.618, 'rgba( 149, 40, 204, 1)', !0),
level11: g.b(4.236, 'rgba( 204, 40, 149, 1)', !0),
level12: g.b(1.272, 'rgba( 149, 204, 40, 1)', !1),
level13: g.b(1.414, 'rgba( 204, 40, 40, 1)', !1),
level16: g.b(2, 'rgba( 40, 204, 149, 1)', !1),
level14: g.b(2.272, 'rgba( 149, 204, 40, 1)', !1),
level15: g.b(2.414, 'rgba( 40, 204, 40, 1)', !1),
level17: g.b(3, 'rgba( 40, 149, 204, 1)', !1),
level18: g.b(3.272, 'rgba( 128, 128, 128, 1)', !1),
level19: g.b(3.414, 'rgba( 40, 40, 204, 1)', !1),
level20: g.b(4, 'rgba( 204, 40, 40, 1)', !1),
level21: g.b(4.272, 'rgba( 149, 40, 204, 1)', !1),
level22: g.b(4.414, 'rgba( 204, 40, 149, 1)', !1),
level23: g.b(4.618, 'rgba( 149, 204, 40, 1)', !1),
level24: g.b(4.764, 'rgba( 40, 204, 149, 1)', !1),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
'level12',
'level13',
'level14',
'level15',
'level16',
'level17',
'level18',
'level19',
'level20',
'level21',
'level22',
'level23',
'level24',
],
},
linetoolfibchannel: {
clonable: !0,
showCoeffs: !0,
showPrices: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
extendLeft: !1,
extendRight: !1,
horzLabelsAlign: 'left',
vertLabelsAlign: 'middle',
coeffsAsPercents: !1,
levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
level1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
level2: g.b(0.236, 'rgba( 204, 40, 40, 1)', !0),
level3: g.b(0.382, 'rgba( 149, 204, 40, 1)', !0),
level4: g.b(0.5, 'rgba( 40, 204, 40, 1)', !0),
level5: g.b(0.618, 'rgba( 40, 204, 149, 1)', !0),
level6: g.b(0.786, 'rgba( 40, 149, 204, 1)', !0),
level7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
level8: g.b(1.618, 'rgba( 40, 40, 204, 1)', !0),
level9: g.b(2.618, 'rgba( 204, 40, 40, 1)', !0),
level10: g.b(3.618, 'rgba( 149, 40, 204, 1)', !0),
level11: g.b(4.236, 'rgba( 204, 40, 149, 1)', !0),
level12: g.b(1.272, 'rgba( 149, 204, 40, 1)', !1),
level13: g.b(1.414, 'rgba( 204, 40, 40, 1)', !1),
level16: g.b(2, 'rgba( 40, 204, 149, 1)', !1),
level14: g.b(2.272, 'rgba( 149, 204, 40, 1)', !1),
level15: g.b(2.414, 'rgba( 40, 204, 40, 1)', !1),
level17: g.b(3, 'rgba( 40, 149, 204, 1)', !1),
level18: g.b(3.272, 'rgba( 128, 128, 128, 1)', !1),
level19: g.b(3.414, 'rgba( 40, 40, 204, 1)', !1),
level20: g.b(4, 'rgba( 204, 40, 40, 1)', !1),
level21: g.b(4.272, 'rgba( 149, 40, 204, 1)', !1),
level22: g.b(4.414, 'rgba( 204, 40, 149, 1)', !1),
level23: g.b(4.618, 'rgba( 149, 204, 40, 1)', !1),
level24: g.b(4.764, 'rgba( 40, 204, 149, 1)', !1),
__collectibleLines: [
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
'level12',
'level13',
'level14',
'level15',
'level16',
'level17',
'level18',
'level19',
'level20',
'level21',
'level22',
'level23',
'level24',
],
},
linetoolprojection: {
clonable: !0,
showCoeffs: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
color1: 'rgba( 0, 128, 0, 0.2)',
color2: 'rgba( 255, 0, 0, 0.2)',
linewidth: 1,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level1: g.c(1, 'rgba( 128, 128, 128, 1)', !0),
},
linetool5pointspattern: {
clonable: !0,
color: 'rgba( 204, 40, 149, 1)',
textcolor: 'rgba( 255, 255, 255, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 204, 40, 149, 0.5)',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
transparency: 50,
linewidth: 1,
},
linetoolcypherpattern: {
clonable: !0,
color: '#CC2895',
textcolor: '#FFFFFF',
fillBackground: !0,
backgroundColor: '#CC2895',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
transparency: 50,
linewidth: 1,
},
linetooltrianglepattern: {
clonable: !0,
color: 'rgba( 149, 40, 255, 1)',
textcolor: 'rgba( 255, 255, 255, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 149, 40, 204, 0.5)',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
transparency: 50,
linewidth: 1,
},
linetoolabcd: {
clonable: !0,
color: 'rgba( 0, 155, 0, 1)',
textcolor: 'rgba( 255, 255, 255, 1)',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
linewidth: 2,
},
linetoolthreedrivers: {
clonable: !0,
color: 'rgba( 149, 40, 255, 1)',
textcolor: 'rgba( 255, 255, 255, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 149, 40, 204, 0.5)',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
transparency: 50,
linewidth: 2,
},
linetoolheadandshoulders: {
clonable: !0,
color: 'rgba( 69, 104, 47, 1)',
textcolor: 'rgba( 255, 255, 255, 1)',
fillBackground: !0,
backgroundColor: 'rgba( 69, 168, 47, 0.5)',
font: 'Verdana',
fontsize: 12,
bold: !1,
italic: !1,
transparency: 50,
linewidth: 2,
},
linetoolfibwedge: {
singleChartOnly: !0,
clonable: !0,
showCoeffs: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level1: g.c(0.236, 'rgba( 204, 40, 40, 1)', !0),
level2: g.c(0.382, 'rgba( 149, 204, 40, 1)', !0),
level3: g.c(0.5, 'rgba( 40, 204, 40, 1)', !0),
level4: g.c(0.618, 'rgba( 40, 204, 149, 1)', !0),
level5: g.c(0.786, 'rgba( 40, 149, 204, 1)', !0),
level6: g.c(1, 'rgba( 128, 128, 128, 1)', !0),
level7: g.c(1.618, 'rgba( 40, 40, 204, 1)', !1),
level8: g.c(2.618, 'rgba( 204, 40, 40, 1)', !1),
level9: g.c(3.618, 'rgba( 149, 40, 204, 1)', !1),
level10: g.c(4.236, 'rgba( 204, 40, 149, 1)', !1),
level11: g.c(4.618, 'rgba( 204, 40, 149, 1)', !1),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetoolfibcircles: {
clonable: !0,
showCoeffs: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
snapTo45Degrees: !0,
coeffsAsPercents: !1,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
level1: g.c(0.236, 'rgba( 204, 40, 40, 1)', !0),
level2: g.c(0.382, 'rgba( 149, 204, 40, 1)', !0),
level3: g.c(0.5, 'rgba( 40, 204, 40, 1)', !0),
level4: g.c(0.618, 'rgba( 40, 204, 149, 1)', !0),
level5: g.c(0.786, 'rgba( 40, 149, 204, 1)', !0),
level6: g.c(1, 'rgba( 128, 128, 128, 1)', !0),
level7: g.c(1.618, 'rgba( 40, 40, 204, 1)', !0),
level8: g.c(2.618, 'rgba( 204, 40, 40, 1)', !0),
level9: g.c(3.618, 'rgba( 149, 40, 204, 1)', !0),
level10: g.c(4.236, 'rgba( 204, 40, 149, 1)', !0),
level11: g.c(4.618, 'rgba( 204, 40, 149, 1)', !0),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetoolfibspeedresistancearcs: {
clonable: !0,
showCoeffs: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
fullCircles: !1,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
level1: g.c(0.236, 'rgba( 204, 40, 40, 1)', !0),
level2: g.c(0.382, 'rgba( 149, 204, 40, 1)', !0),
level3: g.c(0.5, 'rgba( 40, 204, 40, 1)', !0),
level4: g.c(0.618, 'rgba( 40, 204, 149, 1)', !0),
level5: g.c(0.786, 'rgba( 40, 149, 204, 1)', !0),
level6: g.c(1, 'rgba( 128, 128, 128, 1)', !0),
level7: g.c(1.618, 'rgba( 40, 40, 204, 1)', !0),
level8: g.c(2.618, 'rgba( 204, 40, 40, 1)', !0),
level9: g.c(3.618, 'rgba( 149, 40, 204, 1)', !0),
level10: g.c(4.236, 'rgba( 204, 40, 149, 1)', !0),
level11: g.c(4.618, 'rgba( 204, 40, 149, 1)', !0),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetooltrendbasedfibextension: {
clonable: !0,
showCoeffs: !0,
showPrices: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
extendLines: !1,
horzLabelsAlign: 'left',
vertLabelsAlign: 'middle',
reverse: !1,
coeffsAsPercents: !1,
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
levelsStyle: { linewidth: 1, linestyle: CanvasEx.LINESTYLE_SOLID },
level1: g.b(0, 'rgba( 128, 128, 128, 1)', !0),
level2: g.b(0.236, 'rgba( 204, 40, 40, 1)', !0),
level3: g.b(0.382, 'rgba( 149, 204, 40, 1)', !0),
level4: g.b(0.5, 'rgba( 40, 204, 40, 1)', !0),
level5: g.b(0.618, 'rgba( 40, 204, 149, 1)', !0),
level6: g.b(0.786, 'rgba( 40, 149, 204, 1)', !0),
level7: g.b(1, 'rgba( 128, 128, 128, 1)', !0),
level8: g.b(1.618, 'rgba( 40, 40, 204, 1)', !0),
level9: g.b(2.618, 'rgba( 204, 40, 40, 1)', !0),
level10: g.b(3.618, 'rgba( 149, 40, 204, 1)', !0),
level11: g.b(4.236, 'rgba( 204, 40, 149, 1)', !0),
level12: g.b(1.272, 'rgba( 149, 204, 40, 1)', !1),
level13: g.b(1.414, 'rgba( 204, 40, 40, 1)', !1),
level16: g.b(2, 'rgba( 40, 204, 149, 1)', !1),
level14: g.b(2.272, 'rgba( 149, 204, 40, 1)', !1),
level15: g.b(2.414, 'rgba( 40, 204, 40, 1)', !1),
level17: g.b(3, 'rgba( 40, 149, 204, 1)', !1),
level18: g.b(3.272, 'rgba( 128, 128, 128, 1)', !1),
level19: g.b(3.414, 'rgba( 40, 40, 204, 1)', !1),
level20: g.b(4, 'rgba( 204, 40, 40, 1)', !1),
level21: g.b(4.272, 'rgba( 149, 40, 204, 1)', !1),
level22: g.b(4.414, 'rgba( 204, 40, 149, 1)', !1),
level23: g.b(4.618, 'rgba( 149, 204, 40, 1)', !1),
level24: g.b(4.764, 'rgba( 40, 204, 149, 1)', !1),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
'level12',
'level13',
'level14',
'level15',
'level16',
'level17',
'level18',
'level19',
'level20',
'level21',
'level22',
'level23',
'level24',
],
},
linetooltrendbasedfibtime: {
clonable: !0,
showCoeffs: !0,
font: 'Verdana',
fillBackground: !0,
transparency: 80,
horzLabelsAlign: 'right',
vertLabelsAlign: 'bottom',
trendline: {
visible: !0,
color: 'rgba( 128, 128, 128, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_DASHED,
},
level1: g.c(0, 'rgba( 128, 128, 128, 1)', !0),
level2: g.c(0.382, 'rgba( 204, 40, 40, 1)', !0),
level3: g.c(0.5, 'rgba( 149, 204, 40, 1)', !1),
level4: g.c(0.618, 'rgba( 40, 204, 40, 1)', !0),
level5: g.c(1, 'rgba( 40, 204, 149, 1)', !0),
level6: g.c(1.382, 'rgba( 40, 149, 204, 1)', !0),
level7: g.c(1.618, 'rgba( 128, 128, 128, 1)', !0),
level8: g.c(2, 'rgba( 40, 40, 204, 1)', !0),
level9: g.c(2.382, 'rgba( 204, 40, 40, 1)', !0),
level10: g.c(2.618, 'rgba( 149, 40, 204, 1)', !0),
level11: g.c(3, 'rgba( 204, 40, 149, 1)', !0),
__collectibleLines: [
'trendline',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
'level9',
'level10',
'level11',
],
},
linetoolschiffpitchfork: {
clonable: !0,
fillBackground: !0,
transparency: 80,
style: u.Schiff,
median: {
visible: !0,
color: 'rgba( 165, 0, 0, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level0: g.c(0.25, 'rgba( 160, 107, 0, 1)', !1),
level1: g.c(0.382, 'rgba( 105, 158, 0, 1)', !1),
level2: g.c(0.5, 'rgba( 0, 155, 0, 1)', !0),
level3: g.c(0.618, 'rgba( 0, 153, 101, 1)', !1),
level4: g.c(0.75, 'rgba( 0, 101, 153, 1)', !1),
level5: g.c(1, 'rgba( 0, 0, 153, 1)', !0),
level6: g.c(1.5, 'rgba( 102, 0, 153, 1)', !1),
level7: g.c(1.75, 'rgba( 153, 0, 102, 1)', !1),
level8: g.c(2, 'rgba( 165, 0, 0, 1)', !1),
__collectibleLines: [
'median',
'level0',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
],
},
linetoolschiffpitchfork2: {
clonable: !0,
fillBackground: !0,
transparency: 80,
style: u.Schiff2,
median: {
visible: !0,
color: 'rgba( 165, 0, 0, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level0: g.c(0.25, 'rgba( 160, 107, 0, 1)', !1),
level1: g.c(0.382, 'rgba( 105, 158, 0, 1)', !1),
level2: g.c(0.5, 'rgba( 0, 155, 0, 1)', !0),
level3: g.c(0.618, 'rgba( 0, 153, 101, 1)', !1),
level4: g.c(0.75, 'rgba( 0, 101, 153, 1)', !1),
level5: g.c(1, 'rgba( 0, 0, 153, 1)', !0),
level6: g.c(1.5, 'rgba( 102, 0, 153, 1)', !1),
level7: g.c(1.75, 'rgba( 153, 0, 102, 1)', !1),
level8: g.c(2, 'rgba( 165, 0, 0, 1)', !1),
__collectibleLines: [
'median',
'level0',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
],
},
linetoolinsidepitchfork: {
clonable: !0,
fillBackground: !0,
transparency: 80,
style: u.Inside,
median: {
visible: !0,
color: 'rgba( 165, 0, 0, 1)',
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
},
level0: g.c(0.25, 'rgba( 160, 107, 0, 1)', !1),
level1: g.c(0.382, 'rgba( 105, 158, 0, 1)', !1),
level2: g.c(0.5, 'rgba( 0, 155, 0, 1)', !0),
level3: g.c(0.618, 'rgba( 0, 153, 101, 1)', !1),
level4: g.c(0.75, 'rgba( 0, 101, 153, 1)', !1),
level5: g.c(1, 'rgba( 0, 0, 153, 1)', !0),
level6: g.c(1.5, 'rgba( 102, 0, 153, 1)', !1),
level7: g.c(1.75, 'rgba( 153, 0, 102, 1)', !1),
level8: g.c(2, 'rgba( 165, 0, 0, 1)', !1),
__collectibleLines: [
'median',
'level0',
'level1',
'level2',
'level3',
'level4',
'level5',
'level6',
'level7',
'level8',
],
},
linetool: { frozen: !1, visible: !0 },
linetoolvisibilities: {
intervalsVisibilities: {
seconds: !0,
secondsFrom: 1,
secondsTo: 59,
minutes: !0,
minutesFrom: 1,
minutesTo: 59,
hours: !0,
hoursFrom: 1,
hoursTo: 24,
days: !0,
daysFrom: 1,
daysTo: 366,
weeks: !0,
months: !0,
ranges: !0,
},
},
}),
o(TradingView.defaultProperties.chartproperties),
r();
}
for (
void 0 === TradingView.defaultProperties['study_MA@tv-basicstudies'] &&
(TradingView.defaultProperties['study_MA@tv-basicstudies'] = {
description: 'Moving Average',
shortDescription: 'MA',
inputs: { length: 9, source: 'close' },
styles: {
MovAvg: {
visible: !0,
color: 'rgba( 4, 150, 255, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
plottype: p.Line,
histogramBase: 0,
title: 'MA',
},
},
}),
void 0 ===
TradingView.defaultProperties['study_PivotPointsHighLow@tv-basicstudies'] &&
(TradingView.defaultProperties['study_PivotPointsHighLow@tv-basicstudies'] = {
font: 'Arial',
fontsize: 10,
borderColor: 'rgba( 83, 143, 31, 1)',
backColor: 'rgba( 240, 255, 204, 1)',
textColor: 'rgba( 0, 0, 0, 1)',
}),
void 0 ===
TradingView.defaultProperties['study_PivotPointsStandard@tv-basicstudies'] &&
((i = 'rgba( 212, 121, 40, 1)'),
(n = !0),
(s = 1),
(TradingView.defaultProperties['study_PivotPointsStandard@tv-basicstudies'] = {
_hardCodedDefaultsVersion: 1,
font: 'Arial',
fontsize: 11,
levelsStyle: {
showLabels: !0,
visibility: {
P: n,
'S1/R1': n,
'S2/R2': n,
'S3/R3': n,
'S4/R4': n,
'S5/R5': n,
},
colors: { P: i, 'S1/R1': i, 'S2/R2': i, 'S3/R3': i, 'S4/R4': i, 'S5/R5': i },
widths: { P: s, 'S1/R1': s, 'S2/R2': s, 'S3/R3': s, 'S4/R4': s, 'S5/R5': s },
},
})),
void 0 === TradingView.defaultProperties['study_ZigZag@tv-basicstudies'] &&
(TradingView.defaultProperties['study_ZigZag@tv-basicstudies'] = {
color: 'rgba( 86, 135, 29, 1)',
linewidth: 2,
}),
void 0 === TradingView.defaultProperties['study_ElliottWave@tv-basicstudies'] &&
(TradingView.defaultProperties['study_ElliottWave@tv-basicstudies'] = {
inputs: {},
level0: g.a('rgba( 255, 0, 0, 1)', !1),
level1: g.a('rgba( 0, 128, 0, 1)', !1),
level2: g.a('rgba( 0, 0, 255, 1)', !1),
level3: g.a('rgba( 255, 0, 255, 1)', !1),
level4: g.a('rgba( 0, 128, 255, 1)', !0),
level5: g.a('rgba( 255, 0, 0, 1)', !0),
level6: g.a('rgba( 0, 128, 0, 1)', !0),
level7: g.a('rgba( 0, 0, 255, 1)', !0),
level8: g.a('rgba( 255, 0, 255, 1)', !0),
}),
void 0 === TradingView.defaultProperties['study_LinearRegression@tv-basicstudies'] &&
(TradingView.defaultProperties['study_LinearRegression@tv-basicstudies'] = {
styles: {
upLine: {
visible: !0,
color: 'rgba( 0, 0, 255, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
downLine: {
visible: !0,
color: 'rgba( 0, 0, 255, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
baseLine: {
visible: !0,
color: 'rgba( 255, 0, 0, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
extendLines: !0,
showPearsons: !0,
backgroundColor: 'rgba( 153, 21, 21, 0.3)',
transparency: 70,
},
}),
void 0 === TradingView.defaultProperties['study_RegressionTrend@tv-basicstudies'] &&
(TradingView.defaultProperties['study_RegressionTrend@tv-basicstudies'] = {
linewidth: 1,
linestyle: CanvasEx.LINESTYLE_SOLID,
styles: {
upLine: {
visible: !0,
color: 'rgba( 0, 0, 255, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
downLine: {
visible: !0,
color: 'rgba( 0, 0, 255, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
baseLine: {
visible: !0,
color: 'rgba( 255, 0, 0, 0.3)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
},
extendLines: !1,
showPearsons: !0,
transparency: 70,
},
}),
void 0 === TradingView.defaultProperties['study_Compare@tv-basicstudies'] &&
(TradingView.defaultProperties['study_Compare@tv-basicstudies'] = {
minTick: 'default',
}),
void 0 === TradingView.defaultProperties['study_Overlay@tv-basicstudies'] &&
((a = 'study_Overlay@tv-basicstudies'),
(TradingView.defaultProperties[a] = {
style: h.STYLE_BARS,
showPriceLine: !1,
minTick: 'default',
candleStyle: {
upColor: 'rgba( 107, 165, 131, 1)',
downColor: 'rgba( 215, 84, 66, 1)',
drawWick: !0,
drawBorder: !0,
borderColor: 'rgba( 55, 134, 88, 1)',
borderUpColor: 'rgba( 34, 84, 55, 1)',
borderDownColor: 'rgba( 91, 26, 19, 1)',
wickColor: 'rgba( 115, 115, 117, 1)',
wickUpColor: 'rgba( 115, 115, 117, 1)',
wickDownColor: 'rgba( 115, 115, 117, 1)',
barColorsOnPrevClose: !1,
},
hollowCandleStyle: {
upColor: 'rgba( 107, 165, 131, 1)',
downColor: 'rgba( 215, 84, 66, 1)',
drawWick: !0,
drawBorder: !0,
borderColor: 'rgba( 55, 134, 88, 1)',
borderUpColor: 'rgba( 34, 84, 55, 1)',
borderDownColor: 'rgba( 91, 26, 19, 1)',
wickColor: 'rgba( 115, 115, 117, 1)',
wickUpColor: 'rgba( 115, 115, 117, 1)',
wickDownColor: 'rgba( 115, 115, 117, 1)',
barColorsOnPrevClose: !1,
},
barStyle: {
upColor: 'rgba( 107, 165, 131, 1)',
downColor: 'rgba( 215, 84, 66, 1)',
barColorsOnPrevClose: !1,
dontDrawOpen: !1,
},
lineStyle: {
color: 'rgba( 3, 3, 247, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
priceSource: 'close',
styleType: h.STYLE_LINE_TYPE_SIMPLE,
},
areaStyle: {
color1: 'rgba( 96, 96, 144, 0.5)',
color2: 'rgba( 1, 246, 245, 0.5)',
linecolor: 'rgba( 0, 148, 255, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
priceSource: 'close',
transparency: 50,
},
baselineStyle: {
baselineColor: 'rgba( 117, 134, 150, 1)',
topFillColor1: 'rgba( 83, 185, 135, 0.1)',
topFillColor2: 'rgba( 83, 185, 135, 0.1)',
bottomFillColor1: 'rgba( 235, 77, 92, 0.1)',
bottomFillColor2: 'rgba( 235, 77, 92, 0.1)',
topLineColor: 'rgba( 83, 185, 135, 1)',
bottomLineColor: 'rgba( 235, 77, 92, 1)',
topLineWidth: 1,
bottomLineWidth: 1,
priceSource: 'close',
transparency: 50,
baseLevelPercentage: 50,
},
styles: {
open: {
visible: !0,
color: 'rgba( 255, 0, 0, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
plottype: p.Line,
histogramBase: 0,
},
high: {
visible: !0,
color: 'rgba( 255, 0, 0, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
plottype: p.Line,
histogramBase: 0,
},
low: {
visible: !0,
color: 'rgba( 255, 0, 0, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
plottype: p.Line,
histogramBase: 0,
},
close: {
visible: !0,
color: 'rgba( 255, 0, 0, 1)',
linestyle: CanvasEx.LINESTYLE_SOLID,
linewidth: 1,
plottype: p.Line,
histogramBase: 0,
},
},
})),
l = e.split('.'),
c = TradingView.defaultProperties,
y = 0;
y < l.length;
y++
)
c && (c = c[l[y]]);
return c ? TradingView.clone(c) : {};
};
(s.create = function(e, t) {
if (t) {
var i = g(e);
TradingView.defaultProperties[e] = $.extend(t, i);
}
}),
(s.remove = function(e) {
TradingView.defaultProperties[e] = void 0;
}),
(TradingView.saveDefaults = function(e, t) {
TVSettings.setJSON(e, t);
}),
(TradingView.factoryDefaults = g),
(window.applyDefaultOverridesToLinetools = r),
(window.applyDefaultsOverrides = o),
(window.applyPropertiesOverrides = n),
(window.defaults = s),
(t.applyDefaultOverridesToLinetools = r),
(t.applyDefaultsOverrides = o),
(t.applyPropertiesOverrides = n),
(t.defaults = s),
(t.factoryDefaults = g),
(t.saveDefaults = TradingView.saveDefaults);
},
function(e, t, i) {
'use strict';
function n(e, t) {
var i,
n = Promise.reject();
for (i = 0; i < t; ++i) n = n.catch(e);
return n;
}
Object.defineProperty(t, '__esModule', { value: !0 }), (t.retries = n);
},
function(e, t, i) {
'use strict';
function n(e) {
return void 0 === e && (e = 'full'), c[e] || o(e, new l.a(e)), c[e];
}
function o(e, t) {
void 0 === e && (e = 'full'), (c[e] = t);
}
function r(e) {
return void 0 === e && (e = 'full'), c[e];
}
function s() {
var e, t;
for (e in c) c.hasOwnProperty(e) && ((t = c[e]), void 0 !== t && t.destroy(), delete c[e]);
}
var a, l, c;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.getQuoteSessionInstance = n),
(t.setQuoteSessionInstance = o),
(t.getQuoteSessionNoEnsure = r),
(t.destroyQuoteSessions = s),
(a = i(501)),
(l = i.n(a)),
(c = {});
},
function(e, t, i) {
'use strict';
function n(e) {
(this.items = e.items),
(this._simpleMode = e.simpleMode),
(this.barSpacing = e.barSpacing),
(this.lineColor = e.lineColor),
(this.lineWidth = e.lineWidth),
(this.lineStyle = e.lineStyle),
(this.withMarkers = e.withMarkers),
(this.withSteps = e.withSteps),
(this.hittest = e.hittest),
(this.ignorePaletteLineWidth = e.ignorePaletteLineWidth),
(this.forceLineColor = !!e.forceLineColor);
}
var o = i(6).Point,
r = i(30).distanceToSegment,
s = i(27),
a = i(9).HitTestResult;
(n.prototype.draw = function(e) {
(e.lineCap = 'square'),
(e.lineJoin = this.withMarkers ? 'round' : 'miter'),
(e.strokeStyle = this.lineColor),
(e.fillStyle = this.lineColor),
(e.lineWidth = this.lineWidth),
(e.lineStyle = this.lineStyle),
s.setValidLineStyle(e, this.lineStyle),
this._simpleMode ? this._drawSimpleMode(e) : this._drawLines(e);
}),
(n.prototype._drawSimpleMode = function(e) {
var t, i, n, o;
if ((e.beginPath(), this.walkLine(e, this.items), e.stroke(), this.withMarkers)) {
for (
t = this.lineWidth + 2, i = 2 * Math.PI, e.beginPath(), o = this.items.length;
o--;
)
(n = this.items[o]) && (e.moveTo(n.x, n.y), e.arc(n.x, n.y, t, 0, i));
e.fill();
}
}),
(n.prototype.walkLine = function(e, t, i, n) {
var o, r, a, l, c, h, u, d, p, _, f;
if (t) {
for (
o = 0.25 * this.barSpacing, u = s.coordinateIsValid, d = 0, p = t.length;
d < p;
d++
)
if (((_ = t[d]), u(_.y))) {
(a = _), (r = d);
break;
}
if (void 0 !== r && a)
for (
f = this.withSteps && this.lineWidth && this.lineWidth % 2 == 0 ? 0.5 : 0,
d = r,
p = t.length;
d < p;
d++
) {
if (((c = t[d]), (h = t[d + 1] || {}), u(c.y)))
if (l && u(l.y))
this.withSteps && e.lineTo(l.x + f, c.y + f),
e.lineTo(c.x + f, c.y + f),
i && !u(h.y) && e.lineTo(c.x + f, n);
else if (h && u(h.y))
i
? (d !== r && e.lineTo(c.x + f, n), e.lineTo(c.x + f, c.y + f))
: e.moveTo(c.x + f, c.y + f);
else if (i) {
if (0 === d) continue;
d !== r && e.lineTo(c.x - o + f, n),
e.lineTo(c.x - o + f, c.y + f),
e.lineTo(c.x + o + f, c.y + f),
e.lineTo(c.x + o + f, n);
} else e.moveTo(c.x - o + f, c.y + f), e.lineTo(c.x + o + f, c.y + f);
l = c;
}
}
}),
(n.prototype._drawLines = function(e) {
function t(t, i, n) {
a(i.y) &&
(a(t.y)
? e.lineTo(i.x, i.y)
: n && a(n.y)
? e.moveTo(i.x, i.y)
: (e.moveTo(i.x - r, i.y), e.lineTo(i.x + r, i.y)));
}
var i, n, o, r, a, l, c, h, u, d, p, _, f, m;
if (this.items.length) {
for (
r = 0.25 * this.barSpacing,
a = s.coordinateIsValid,
e.beginPath(),
l = this.items[0],
l && e.moveTo(l.x, l.y),
c = e.strokeStyle,
h = e.lineWidth,
u = e.lineStyle,
d = 1;
d < this.items.length;
++d
)
(i = this.items[d - 1]),
(n = this.items[d]),
(o = this.items[d + 1]),
n.style && !this.forceLineColor
? ((p = n.style.color), (_ = n.style.width), (f = n.style.style))
: ((p = this.lineColor), (_ = this.lineWidth), (f = this.lineStyle)),
this.ignorePaletteLineWidth && (_ = this.lineWidth),
(m = p !== c || _ !== h || f !== u),
m &&
((c = p),
(h = _),
(u = f),
e.stroke(),
e.beginPath(),
(e.strokeStyle = p),
(e.lineWidth = _),
s.setValidLineStyle(e, f),
e.moveTo(i.x, i.y)),
t(i, n, o);
e.stroke();
}
}),
(n.prototype.hitTest = function(e) {
for (
var t,
i,
n,
l,
c,
h,
u,
d,
p = s.selectionTolerance(this.lineWidth),
_ = 0,
f = this.items.length - 1;
f - _ > 2;
)
(h = Math.round((f + _) / 2)), (u = this.items[h]), u.x <= e.x ? (_ = h) : (f = h);
for (
_ = Math.max(1, _ - 1), f = Math.min(this.items.length - 1, f + 1), d = _;
d <= f;
++d
)
if (
((t = this.items[d - 1]),
(i = this.items[d]),
(n = t.x),
(l = i.x),
(c = r(new o(n, t.y), new o(l, i.y), new o(e.x, e.y))),
c.distance <= p)
)
return this.hittest ? this.hittest : new a(a.REGULAR);
return null;
}),
(t.PaneRendererLine = TradingView.PaneRendererLine = n);
},
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
function(e, t, i) {
'use strict';
var n,
o = function() {
try {
(this.isAvailable = !0),
(this.localStorage = window.localStorage),
this.localStorage.setItem('tvlocalstorage.available', 'true');
} catch (e) {
delete this.isAvailable, delete this.localStorage;
}
this._updateLength();
};
(o.prototype.length = 0),
(o.prototype.isAvailable = !1),
(o.prototype.localStorage = { 'tvlocalstorage.available': 'false' }),
(o.prototype._updateLength = function() {
var e, t;
if (this.isAvailable) this.length = this.localStorage.length;
else {
e = 0;
for (t in this.localStorage) this.localStorage.hasOwnProperty(t) && e++;
this.length = e;
}
}),
(o.prototype.key = function(e) {
return this.isAvailable ? this.localStorage.key(e) : Object.keys(this.localStorage)[e];
}),
(o.prototype.getItem = function(e) {
return this.isAvailable ? this.localStorage.getItem(e) : this.localStorage[e];
}),
(o.prototype.setItem = function(e, t) {
this.isAvailable ? this.localStorage.setItem(e, t) : (this.localStorage[e] = t),
this._updateLength();
}),
(o.prototype.removeItem = function(e) {
this.isAvailable ? this.localStorage.removeItem(e) : delete this.localStorage[e],
this._updateLength();
}),
(o.prototype.clear = function() {
this.isAvailable ? this.localStorage.clear() : (this.localStorage = {}),
this._updateLength();
}),
(n = function(e) {
this.storage = e;
}),
(n.prototype.getItem = function(e) {
return Promise.resolve(this.storage.getItem(e));
}),
(n.prototype.setItem = function(e, t) {
return Promise.resolve(this.storage.setItem(e, t));
}),
(window.TVLocalStorage = new o()),
(window.TVLocalStorageAsync = new n(window.TVLocalStorage)),
(e.exports = {
TVLocalStorage: window.TVLocalStorage,
TVLocalStorageAsync: window.TVLocalStorageAsync,
});
},
function(e, t, i) {
(function(e) {
(TradingView.cleanButAmpersand = function(e, t) {
var i = t ? ['&'] : ['&'];
return TradingView.clean(e, t, i);
}),
(TradingView.strip_tags = function(e) {
return e && e.replace ? e.replace(/(<([^>]+)>)/gi, '') : e;
}),
(TradingView.encodeSpread = function(e) {
return encodeURIComponent(e);
}),
(TradingView.clean = function(e, t, i) {
var n,
o,
r,
s = [
['&', '&'],
['<', '<'],
['>', '>'],
['"', '"'],
["'", '''],
["'", '''],
],
a = e;
if (!e || !e.replace) return a;
for (n = 0; n < s.length; n++)
(o = s[n][0]),
(r = s[n][1]),
(i && i.indexOf && -1 !== i.indexOf(t ? r : o)) ||
(a = t ? a.replace(RegExp(r, 'g'), o) : a.replace(RegExp(o, 'g'), r));
return a;
}),
void 0 !== e &&
e &&
e.exports &&
(e.exports = {
clean: TradingView.clean,
cleanButAmpersand: TradingView.cleanButAmpersand,
stripTags: TradingView.strip_tags,
});
}.call(t, i(51)(e)));
},
function(e, t, i) {
'use strict';
var n, o, r, s, a, l, c;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'MINUTE_SPAN', function() {
return n;
}),
i.d(t, 'HOUR_SPAN', function() {
return o;
}),
i.d(t, 'DAY_SPAN', function() {
return r;
}),
i.d(t, 'WEEK_SPAN', function() {
return s;
}),
i.d(t, 'MONTH_SPAN', function() {
return a;
}),
i.d(t, 'YEAR_SPAN', function() {
return l;
}),
i.d(t, 'DEFAULT_BAR_SPACING', function() {
return c;
}),
(n = 20),
(o = 30),
(r = 40),
(s = 50),
(a = 60),
(l = 70),
(c = 6);
},
function(e, t, i) {
'use strict';
function n(e) {
var t = e.split(':');
return { name: t[0], type: 2 === t.length ? t[1] : null };
}
function o(e, t, i, o) {
var r,
s,
a,
l,
c,
p,
_,
f,
m,
y,
g,
v,
S,
b,
w,
P = i.split('.');
if (0 !== P.length && 0 !== P[0].length) {
if (
((r = n(P[0])),
(s = r.name),
(a = r.type),
(l = null !== a),
(c = !l || 'plot' === a),
(p = !l || 'band' === a),
(_ = !l || 'area' === a),
(f = !l || 'input' === a),
(m = c ? d.getPlotIdByTitle(e, s) : null),
(y = p ? d.getBandIndexByName(e, s) : null),
(g = _ ? d.getFilledAreaIdByTitle(e, s) : null),
(v = f ? d.getInputByName(e, s) : null),
(S = t.hasOwnProperty(s)),
(null !== m ? 1 : 0) +
(null !== y ? 1 : 0) +
(null !== g ? 1 : 0) +
(null !== v ? 1 : 0) +
(S ? 1 : 0) >
1)
)
return void h.logWarn(
"Study '" + e.description + "' has ambiguous identifier '" + s + "'",
);
if (((b = P[1]), null !== m)) {
if (1 === P.length)
return void h.logWarn(
"Path of sub-property of '" +
s +
"' plot for study '" +
e.description +
"' must be not empty",
);
(w = P.slice(1)), u.applyPlotProperty(e, t, m, w, o);
} else if (null !== v) u.applyInputValue(t, v, o);
else if (null !== y) {
if (void 0 === b)
return void h.logWarn(
"Property name of '" + s + "' band for study '" + e.description + "' must be set",
);
u.applyBandProperty(t, y, b, o);
} else if (null !== g) {
if (void 0 === b)
return void h.logWarn(
"Property name of '" + s + "' area for study '" + e.description + "' must be set",
);
u.applyFilledAreaProperty(t, g, b, o);
} else
S
? u.setRootProperty(t, P, o)
: h.logWarn("Study '" + e.description + "' has no plot or input '" + s + "'");
}
}
function r(e, t) {
var i,
n = e.properties(),
r = n.state();
for (i in t) t.hasOwnProperty(i) && o(e.metaInfo(), r, i, t[i]);
n.mergeAndFire(r);
}
function s(e, t, i) {
var n, r, s, a, l;
for (n in e)
e.hasOwnProperty(n) &&
-1 !== (r = n.indexOf('.')) &&
((s = n.substr(0, r)),
(a = d.getMetaInfoByDescription(t, s)),
null !== a
? ((l = i(a.id)),
null !== l
? o(a, l, n.substr(r + 1), e[n])
: h.logWarn('Cannot apply overrides for study ' + s))
: h.logWarn('There is no such study ' + s));
}
var a, l, c, h, u, d;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.applyOverridesToStudy = r),
(t.applyOverridesToStudyDefaults = s),
(a = i(7)),
i.n(a),
(l = i(86)),
(c = i(4)),
(h = Object(c.getLogger)('Chart.Model.StudyPropertiesOverrider')),
(function(e) {
function t(e, t, i) {
var n, o, r, s;
if (void 0 === e.plots) return null;
for (n = 0, o = e.plots; n < o.length; n++)
if (
((r = o[n]),
Object(l.isColorerPlot)(r) &&
void 0 !== t.palettes &&
((s = t.palettes[r.palette]), r.target === i && void 0 !== s))
)
return s;
return null;
}
function i(e, t, i, n, o) {
if (void 0 === e.styles) return void h.logWarn('Study does not have styles');
if (null === t && !isNaN(n) && n > 0)
return void h.logWarn('Study plot does not have color #' + n);
if (0 === n || isNaN(n)) {
(Object(a.ensureDefined)(e.styles[i]).color = o + ''), (n = 0);
}
null !== t && (Object(a.ensureDefined)(t.colors[n]).color = o + '');
}
function n(e, n, o, r, s) {
var a, l, c, d, p;
if (void 0 === n.styles) return void h.logWarn('Study does not have styles');
if ('color' === (a = r[0]))
return (
(l = t(e, n, o)), (c = r.length > 1 ? parseInt(r[1]) : NaN), void i(n, l, o, c, s)
);
if (void 0 === (d = n.styles[o]) || !d.hasOwnProperty(a))
return void h.logWarn("Study plot does not have property '" + a + "'");
if ('plottype' === a) {
if (void 0 === (p = u[s + '']))
return void h.logWarn('Unsupported plot type for plot: ' + s);
s = p;
}
d[a] = s;
}
function o(e, t, i, n) {
var o, r;
if (void 0 === e.bands) return void h.logWarn('Study does not have bands');
if (void 0 === (o = e.bands[t]) || !o.hasOwnProperty(i))
return void h.logWarn("Study band does not have property '" + i + "'");
if ('plottype' === i) {
if (void 0 === (r = u[n + '']))
return void h.logWarn('Unsupported plot type for band: ' + n);
n = r;
}
o[i] = n;
}
function r(e, t, i, n) {
if (void 0 === e.filledAreasStyle) return void h.logWarn('Study does not have areas');
var o = e.filledAreasStyle[t];
if (void 0 === o || !o.hasOwnProperty(i))
return void h.logWarn("Study area does not have property '" + i + "'");
o[i] = n;
}
function s(e, t, i) {
if (void 0 === e.inputs || !e.inputs.hasOwnProperty(t))
return void h.logWarn("Study does not have input '" + t + "'");
e.inputs[t] = i;
}
function c(e, t, i) {
var n, o, r, s, a;
if (0 !== t.length) {
for (
n = e, o = 0, r = t.slice(0, -1);
o < r.length && ((s = r[o]), null != n && e.hasOwnProperty(s));
o++
)
n = e[s];
if (((a = t[t.length - 1]), null == n || !n.hasOwnProperty(a)))
return void h.logWarn('Study does not have property ' + t.join('.'));
n[a] = i;
}
}
var u = {
line: l.PlotType.Line,
histogram: l.PlotType.Histogram,
cross: l.PlotType.Cross,
area: l.PlotType.Area,
columns: l.PlotType.Columns,
circles: l.PlotType.Circles,
line_with_breaks: l.PlotType.LineWithBreaks,
area_with_breaks: l.PlotType.AreaWithBreaks,
};
(e.applyPlotProperty = n),
(e.applyBandProperty = o),
(e.applyFilledAreaProperty = r),
(e.applyInputValue = s),
(e.setRootProperty = c);
})(u || (u = {})),
(function(e) {
function t(e, t) {
var i, n, o;
if (void 0 === e.inputs) return null;
for (t = t.toLowerCase(), i = 0, n = e.inputs; i < n.length; i++)
if (((o = n[i]), o.name.toLowerCase() === t)) return o.id;
return null;
}
function i(e, t) {
var i, n, o;
if (void 0 === e.styles) return null;
t = t.toLowerCase();
for (i in e.styles)
if (
((n = e.styles[i]),
(o = void 0 !== n && void 0 !== n.title ? n.title : i),
o.toLowerCase() === t)
)
return i;
return null;
}
function n(e, t) {
var i, n, o;
if (void 0 === e.filledAreas) return null;
for (t = t.toLowerCase(), i = 0, n = e.filledAreas; i < n.length; i++)
if (((o = n[i]), o.title.toLowerCase() === t)) return o.id;
return null;
}
function o(e, t) {
if (void 0 === e.bands) return null;
t = t.toLowerCase();
for (var i = 0; i < e.bands.length; ++i)
if (e.bands[i].name.toLowerCase() === t) return i;
return null;
}
function r(e, t) {
var i, n, o;
for (t = t.toLowerCase(), i = 0, n = e; i < n.length; i++)
if (
((o = n[i]),
o.description.toLowerCase() === t || o.shortDescription.toLowerCase() === t)
)
return o;
return null;
}
(e.getInputByName = t),
(e.getPlotIdByTitle = i),
(e.getFilledAreaIdByTitle = n),
(e.getBandIndexByName = o),
(e.getMetaInfoByDescription = r);
})(d || (d = {}));
},
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'Version', function() {
return o;
}),
(n = i(7)),
i.n(n),
(o = (function() {
function e(e, t) {
(this._major = e), (this._minor = t);
}
return (
(e.prototype.major = function() {
return this._major;
}),
(e.prototype.minor = function() {
return this._minor;
}),
(e.prototype.isZero = function() {
return 0 === this._major && 0 === this._minor;
}),
(e.prototype.toString = function() {
return this._major + '.' + this._minor;
}),
(e.prototype.compareTo = function(e) {
return this._major < e._major
? -1
: this._major > e._major
? 1
: this._minor < e._minor
? -1
: this._minor > e._minor
? 1
: 0;
}),
(e.prototype.isLess = function(e) {
return this.compareTo(e) < 0;
}),
(e.prototype.isLessOrEqual = function(e) {
return this.compareTo(e) <= 0;
}),
(e.prototype.isEqual = function(e) {
return 0 === this.compareTo(e);
}),
(e.prototype.isGreater = function(e) {
return this.compareTo(e) > 0;
}),
(e.prototype.isGreaterOrEqual = function(e) {
return this.compareTo(e) >= 0;
}),
(e.parse = function(t) {
var i, o, r;
if (t instanceof e) return new e(t.major(), t.minor());
if ('number' == typeof t)
return (
Object(n.assert)(Math.floor(t) === t, 'Version should not be a float number'),
new e(t, 0)
);
if ('string' == typeof t) {
if (((i = t.split('.')), 1 === i.length))
return (
(o = parseInt(i[0], 10)),
Object(n.assert)(!isNaN(o), 'Bad version string: ' + t),
new e(o, 0)
);
if (2 === i.length)
return (
(o = parseInt(i[0], 10)),
Object(n.assert)(!isNaN(o), 'Bad version string: ' + t),
(r = parseInt(i[1], 10)),
Object(n.assert)(!isNaN(r), 'Bad version string: ' + t),
new e(o, r)
);
throw Error('Bad version string (one dot expected): ' + t);
}
throw Error('Bad version: ' + t);
}),
(e.ZERO = new e(0, 0)),
e
);
})());
},
function(e, t, i) {
'use strict';
var n, o, r, s, a;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'ResizerDetacherState', function() {
return a;
}),
(n = i(7)),
i.n(n),
(o = i(16)),
(r = i.n(o)),
(s = i(14)),
i.n(s),
(a = (function() {
function e(e) {
var t = this;
(this._alive = new r.a()),
(this._body = new r.a()),
(this._width = new r.a()),
(this._height = new r.a()),
(this._fullscreen = new r.a()),
(this._detachable = new r.a()),
(this._fullscreenable = new r.a()),
(this._visible = new r.a()),
(this._availWidth = new r.a()),
(this._availHeight = new r.a()),
(this._owner = new r.a()),
(this._ownersStack = []),
(this.owner = this._owner.readonly()),
(this._bridge = {
alive: this._alive.readonly(),
body: this._body.readonly(),
width: this._width.readonly(),
height: this._height.readonly(),
fullscreen: this._fullscreen.readonly(),
detachable: this._detachable.readonly(),
fullscreenable: this._fullscreenable.readonly(),
visible: this._visible.readonly(),
availWidth: this._availWidth.readonly(),
availHeight: this._availHeight.readonly(),
remove: function() {
var e = t._owner.value();
e && e.remove && e.remove();
},
negotiateWidth: function(e) {
var i = t._owner.value();
i && i.negotiateWidth && i.negotiateWidth(e);
},
negotiateHeight: function(e) {
var i = t._owner.value();
i && i.negotiateHeight && i.negotiateHeight(e);
},
requestFullscreen: function() {
var e = t._owner.value();
e && e.requestFullscreen && e.requestFullscreen();
},
exitFullscreen: function() {
var e = t._owner.value();
e && e.exitFullscreen && e.exitFullscreen();
},
detach: function(e) {
var i = t._owner.value();
i && i.detach && i.detach(e);
},
attach: function() {
var e = t._owner.value();
e && e.attach && e.attach();
},
}),
e && this.pushOwner(e);
}
return (
(e.prototype.bridge = function() {
return this._bridge;
}),
(e.prototype.pushOwner = function(e) {
var t, i, n, o;
if (e.alive.value()) {
for (t = 0, i = this._ownersStack; t < i.length; t++)
(n = i[t]), this._unsubscribeOwner(n);
(o = { owner: e }), this._ownersStack.push(o), this._subscribeOwner(o);
}
}),
(e.prototype._subscribeOwner = function(e) {
var t,
i,
n = this,
o = e.owner;
e.deathWatcher ||
(this._alive.setValue(!0),
(e.deathWatcher = o.alive.spawn()),
e.deathWatcher.subscribe(function(t) {
t || n._deadHandler(e);
})),
this._owner.setValue(o),
e.subscriptions ||
((t = e.subscriptions = []),
this._visible.setValue(!1),
(i = function(e, i) {
if (e) {
var n = e.spawn();
t.push(n),
n.subscribe(
function(e) {
i.setValue(e);
},
{ callWithLast: !0 },
);
} else i.deleteValue();
}),
i(o.body, this._body),
i(o.width, this._width),
i(o.height, this._height),
i(o.fullscreen, this._fullscreen),
i(o.detachable, this._detachable),
i(o.fullscreenable, this._fullscreenable),
i(o.availWidth, this._availWidth),
i(o.availHeight, this._availHeight),
i(o.visible, this._visible));
}),
(e.prototype._unsubscribeOwner = function(e, t) {
var i, n, o;
if (e.subscriptions) {
for (i = 0, n = e.subscriptions; i < n.length; i++) (o = n[i]), o.unsubscribe();
e.subscriptions = null;
}
t && e.deathWatcher && (e.deathWatcher.unsubscribe(), (e.deathWatcher = null));
}),
(e.prototype._deadHandler = function(e) {
var t,
i = this._ownersStack.indexOf(e);
for (
Object(n.assert)(-1 !== i, 'sanitized owner should be in stack'),
t = this._ownersStack.length - 1;
t >= i;
t--
)
this._unsubscribeOwner(this._ownersStack[t], !0);
(this._ownersStack.length = i),
i > 0
? this._subscribeOwner(this._ownersStack[i - 1])
: (this._alive.setValue(!1), this._owner.deleteValue());
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e) {
return !d.some(function(t) {
return e[t]().size > 0;
});
}
function o(e, t, i, n) {
var o, r, s, a;
if (void 0 !== t) {
o = function(t) {
var o,
r = t.styleId;
void 0 !== i &&
Object(c.assert)(
r in i,
'Every style used by graphics primitive should be declared in study metainfo',
),
(o = null),
e.forEach(function(e, t) {
t === r && (o = e[0]);
}),
null === o && ((o = { indexes: n, items: [] }), e.set(r, [o])),
(o.items = o.items.concat(t.data));
};
for (r = 0, s = t; r < s.length; r++) (a = s[r]), o(a);
}
}
function r(e, t, i) {
var n,
o,
r,
s = null;
for (n = 0, o = e; n < o.length; n++) (r = o[n]), r.styleId === i && (s = r);
null === s && ((s = { styleId: i, data: [] }), e.push(s)), s.data.push(t);
}
function s(e) {
var t,
i = e.hhistsByTimePointIndex();
i.clear(), (t = a(e.hhists())), i.set('histBars', t);
}
function a(e) {
var t = new Map();
return (
e.forEach(function(e, i) {
var n,
o,
r,
s,
a,
c,
h = e[0],
d = h.indexes;
for (n = 0, o = h.items; n < o.length; n++)
(r = o[n]),
r.firstBarTime < 0 || r.firstBarTime >= d.length
? u.logError(
'Cannot find index ' + r.firstBarTime + ' in study timescale indexes',
)
: ((s = l.a({}, r, { styleId: i })),
(a = d[r.firstBarTime]),
(c = t.get(a)),
void 0 === c ? t.set(a, { indexes: d, items: [s] }) : c.items.push(s));
}),
t
);
}
var l, c, h, u, d;
i.d(t, 'd', function() {
return d;
}),
(t.c = n),
(t.b = o),
(t.a = r),
(t.e = s),
(l = i(1)),
(c = i(7)),
i.n(c),
(h = i(4)),
(u = Object(h.getLogger)('Chart.StudyGraphics')),
(d = [
'horizlines',
'vertlines',
'lines',
'hlines',
'textmarks',
'shapemarks',
'backgrounds',
'polygons',
'trendchannels',
'hhists',
]);
},
function(e, t, i) {
'use strict';
function n() {
this.backColorers = [];
}
function o(e) {
n.call(this), (this._series = e);
}
function r(e, t) {
n.call(this), (this._study = e), (this._plotIndex = t);
}
var s = i(17).PlotRowSearchMode;
(n.prototype.barStyle = function(e, t, i) {
var n,
o = {};
for (n = this.backColorers.length - 1; n >= 0; n--)
this.backColorers[n].applyBarStyle(e, t, o, i);
return this.applyBarStyle(e, t, o, i), o;
}),
(n.prototype.pushBackBarColorer = function(e) {
this.backColorers.push(e);
}),
(n.prototype.applyBarStyle = function(e, t, i) {
throw Error('This function is supposed to be reimplemented in a subclass');
}),
inherit(o, n),
(o.prototype.applyBarStyle = function(e, t, i, n) {
var o, r, s, a, l, c, h, u, d, p, _, f, m, y, g;
switch (
(i || (i = {}),
(i.barColor = null),
(i.barBorderColor = null),
(i.barWickColor = null),
(i.isBarHollow = null),
(i.isBarUp = null),
(i.upColor = null),
(i.downColor = null),
(i.isTwoColorBar = null),
(o = this._series.properties()),
o.style.value())
) {
case TradingView.Series.STYLE_LINE:
i.barColor = o.lineStyle.color.value();
break;
case TradingView.Series.STYLE_AREA:
i.barColor = o.areaStyle.linecolor.value();
break;
case TradingView.Series.STYLE_BARS:
(r = o.barStyle.upColor.value()),
(s = o.barStyle.downColor.value()),
(a = r),
(l = s),
(c = this.findBar(e, !1, n)),
o.barStyle.barColorsOnPrevClose.value()
? ((h = this.findPrevBar(e, !1, n)),
(i.barColor = h[TradingView.CLOSE_PLOT] <= c[TradingView.CLOSE_PLOT] ? r : s),
(i.barBorderColor =
h[TradingView.CLOSE_PLOT] <= c[TradingView.CLOSE_PLOT] ? a : l))
: ((i.barColor = c[TradingView.OPEN_PLOT] <= c[TradingView.CLOSE_PLOT] ? r : s),
(i.barBorderColor =
c[TradingView.OPEN_PLOT] <= c[TradingView.CLOSE_PLOT] ? a : l));
break;
case TradingView.Series.STYLE_CANDLES:
(r = o.candleStyle.upColor.value()),
(s = o.candleStyle.downColor.value()),
(a = o.candleStyle.borderUpColor
? o.candleStyle.borderUpColor.value()
: o.candleStyle.borderColor.value()),
(l = o.candleStyle.borderDownColor
? o.candleStyle.borderDownColor.value()
: o.candleStyle.borderColor.value()),
(u = o.candleStyle.wickUpColor
? o.candleStyle.wickUpColor.value()
: o.candleStyle.wickColor.value()),
(d = o.candleStyle.wickDownColor
? o.candleStyle.wickDownColor.value()
: o.candleStyle.wickColor.value()),
(c = this.findBar(e, !1, n)),
o.candleStyle.barColorsOnPrevClose.value()
? ((h = this.findPrevBar(e, !1, n)),
(p = h[TradingView.CLOSE_PLOT] <= c[TradingView.CLOSE_PLOT]))
: (p = c[TradingView.OPEN_PLOT] <= c[TradingView.CLOSE_PLOT]),
(i.barColor = p ? r : s),
(i.barBorderColor = p ? a : l),
(i.barWickColor = p ? u : d);
break;
case TradingView.Series.STYLE_HOLLOW_CANDLES:
(r = o.hollowCandleStyle.upColor.value()),
(s = o.hollowCandleStyle.downColor.value()),
(a = o.hollowCandleStyle.borderUpColor
? o.hollowCandleStyle.borderUpColor.value()
: o.hollowCandleStyle.borderColor.value()),
(l = o.hollowCandleStyle.borderDownColor
? o.hollowCandleStyle.borderDownColor.value()
: o.hollowCandleStyle.borderColor.value()),
(u = o.hollowCandleStyle.wickUpColor
? o.hollowCandleStyle.wickUpColor.value()
: o.hollowCandleStyle.wickColor.value()),
(d = o.hollowCandleStyle.wickDownColor
? o.hollowCandleStyle.wickDownColor.value()
: o.hollowCandleStyle.wickColor.value()),
(c = this.findBar(e, !1, n)),
(h = this.findPrevBar(e, !1, n)),
h[TradingView.CLOSE_PLOT] <= c[TradingView.CLOSE_PLOT]
? ((i.barColor = r), (i.barBorderColor = a), (i.barWickColor = u))
: ((i.barColor = s), (i.barBorderColor = l), (i.barWickColor = d)),
c[TradingView.OPEN_PLOT] <= c[TradingView.CLOSE_PLOT]
? (i.isBarHollow = !0)
: (i.isBarHollow = !1);
break;
case TradingView.Series.STYLE_HEIKEN_ASHI:
(r = o.haStyle.upColor.value()),
(s = o.haStyle.downColor.value()),
(a = o.haStyle.borderUpColor.value()),
(l = o.haStyle.borderDownColor.value()),
(u = o.haStyle.wickUpColor.value()),
(d = o.haStyle.wickDownColor.value()),
(c = this.findBar(e, t, n)),
o.haStyle.barColorsOnPrevClose.value()
? ((h = this.findPrevBar(e, t, n)),
(p = h[TradingView.CLOSE_PLOT] <= c[TradingView.CLOSE_PLOT]))
: (p = c[TradingView.OPEN_PLOT] <= c[TradingView.CLOSE_PLOT]),
(i.barColor = p ? r : s),
(i.barBorderColor = p ? a : l),
(i.barWickColor = p ? u : d);
break;
case TradingView.Series.STYLE_BASELINE:
(c = this.findBar(e, t, n)),
(_ = o.baselineStyle),
(f = this._series.priceScale()),
(m = Math.round(
f.height() * (Math.abs(100 - _.baseLevelPercentage.value()) / 100),
)),
(y = this._series.firstValue()),
(g = f.coordinateToPrice(m, y)),
c[TradingView.CLOSE_PLOT] > g
? (i.barColor = o.baselineStyle.topLineColor.value())
: (i.barColor = o.baselineStyle.bottomLineColor.value());
}
return i;
}),
(o.prototype.getSeriesBars = function(e) {
return e ? this._series.nsBars() : this._series.bars();
}),
(o.prototype._findBarFieldValue = function(e, t, i) {
var n = this.getSeriesBars(i).valueAt(e);
if (null !== n) return n[t];
}),
(o.prototype.findBar = function(e, t, i) {
return i ? i.value : this.getSeriesBars(t).valueAt(e) || [];
}),
(o.prototype.findPrevBar = function(e, t, i) {
var n, o;
return i && i.previousValue
? i.previousValue
: ((n = this._series.bars()),
(o = n._search(e, s.Exact)),
null !== o && o > 0 ? this._series.bars()._valueAt(o - 1) : []);
}),
inherit(r, n),
(r.prototype.applyBarStyle = function(e, t, i) {
var n, o, r, s, a, l, c, h, u, d, p, _, f;
return (
i || (i = {}),
t
? i
: ((n = this._study.properties()),
n.visible.value()
? ((o = this._study.metaInfo()),
(r = this._study.data()) && 0 !== r.size()
? ((s = o.plots[this._plotIndex]),
this._study.getMinFirstBarIndexForPlot(s.id) > e
? i
: ((a = n.styles[s.id]),
a.visible && !a.visible.value()
? i
: ((l = this._study.offset(s.id)),
null === (c = r.valueAt(e - l))
? i
: null == (h = c[this._plotIndex + 1])
? i
: ((h = Math.round(h)),
(u = o.plots[this._plotIndex].palette),
(d = n.palettes),
(p = d[u]),
(_ = o.palettes[u].valToIndex
? o.palettes[u].valToIndex[h]
: h),
(f = p.colors[_].color.value()),
(i.barColor = f),
(i.upColor = f.color),
(i.downColor = f.color),
i))))
: i)
: i)
);
}),
(t.SeriesBarColorer = o),
(t.StudyBarColorer = r);
},
function(e, t, i) {
'use strict';
function n(e) {
(this.items = e.items),
(this.barSpacing = e.barSpacing),
(this.colorUp = e.colorup),
(this.colorDn = e.colordown),
(this.colorBorderUp = e.colorBorderUp),
(this.colorBorderDown = e.colorBorderDown),
(this.width = this._calculateWidth(e.barSpacing)),
(this.minHeight = e.minHeight),
(this.vertOffset = this._calculateVerticalOffset(e.barSpacing));
}
function o(e, t, i, n) {
(this.x = e), (this.y = t), (this.height = i), (this.isUp = n);
}
var r = i(6).Point,
s = i(9).HitTestResult;
(n.prototype._calculateVerticalOffset = function(e) {
return Math.round((e || 0) / 4);
}),
(n.prototype._calculateMinHeight = function(e) {
return this.width || this._calculateWidth(e);
}),
(n.prototype._calculateWidth = function(e) {
var e = e || this.barSpacing;
return Math.round(e / 2);
}),
(n.prototype.draw = function(e) {
var t,
i,
n,
o,
r,
s,
a,
l = this.width,
c = l < 4,
h = Math.max(parseInt(l / 2), 1),
u = Math.round(this.width / 2),
d = Math.round(this.width);
for (e.translate(1, 1), t = 0, i = this.items.length; t < i; t++)
(n = this.items[t]),
(o = n.isUp ? -1 : 1),
(r = Math.abs(n.height)),
(s = n.y - o * this.vertOffset),
e.beginPath(),
e.translate(n.x, s),
c
? (e.moveTo(0, 0),
e.lineTo(-u, -u * o),
e.moveTo(0, 0),
e.lineTo(u, -u * o),
e.moveTo(0, 0),
e.lineTo(0, -r * o),
e.moveTo(-u, -r * o),
e.lineTo(u, -r * o),
(e.lineWidth = h),
(e.strokeStyle = n.isUp ? this.colorUp : this.colorDn),
e.stroke())
: (e.moveTo(0, 0),
r < d
? (e.lineTo(l, -r * o), e.lineTo(-l, -r * o))
: (e.lineTo(l, -d * o),
e.lineTo(u, -d * o),
e.lineTo(u, -r * o),
e.lineTo(-u, -r * o),
e.lineTo(-u, -d * o),
e.lineTo(-l, -d * o)),
e.lineTo(0, 0),
(a = n.isUp ? this.colorBorderUp : this.colorBorderDown),
(e.strokeStyle = a),
e.stroke(),
(e.fillStyle = n.isUp ? this.colorUp : this.colorDn),
e.fill()),
e.translate(-n.x, -s);
e.translate(-1, -1);
}),
(n.prototype.hitTest = function(e) {
var t,
i,
n,
o,
r,
a,
l,
c,
h,
u = Math.round(this.width / 2),
d = Math.round(this.width);
for (t = 0; t < this.items.length; ++t)
if (
(i = this.items[t]) &&
void 0 !== i.x &&
null !== i.x &&
!TradingView.isNaN(i.x) &&
void 0 !== i.y &&
null !== i.y &&
!TradingView.isNaN(i.y) &&
((n = Math.abs(i.height)),
(o = i.isUp ? -1 : 1),
(r = n + d),
(a = i.y - o * this.vertOffset),
(l = a - o * r),
(c = i.x - u),
(h = i.x + u),
c < e.x && e.x < h && (i.isUp ? a < e.y && e.y < l : l < e.y && e.y < a))
)
return new s(s.REGULAR);
return null;
}),
inherit(o, r),
(t.PaneRendererArrowsUpDown = TradingView.PaneRendererArrowsUpDown = n),
(t.PaneRendererArrowsUpDownItem = TradingView.PaneRendererArrowsUpDownItem = o);
},
function(e, t, i) {
'use strict';
function n(e, t) {
var n, o, r, a, l, c, h, u, d;
if (!e) throw Error('No studies metainfo');
if (((n = i(532)), (this._studiesMetainfo = e), !t)) throw Error('No studies migrations');
for (
this._studiesMigrations = t, this._migrations = {}, o = 0;
o < this._studiesMigrations.length;
o++
)
for (
r = this._studiesMigrations[o], a = r.versFrom, l = r.versTo, c = 0;
c < r.studyMigrations.length;
c++
)
(h = r.studyMigrations[c]),
(u = h.studyId),
0 !== h.rules.length
? ((d = u in this._migrations ? this._migrations[u] : new n(u)),
d.addMigration(a, l, h.rules),
(this._migrations[u] = d))
: s.logError('Study Migration should have at least one convertion rule');
this._clientMigrations = [
function(e, t) {
var i, n, o, r, s;
if (0 === this._studiesMetainfo.length || !e.isTVScript || e.version >= 22) return t;
for (i = {}, n = 0, o = 0; void 0 !== (r = t[o]); )
(s = t[r.id]), r.isFake && (r.id = 'in_' + n++), (i[o] = r), (i[r.id] = s), o++;
return i;
},
];
}
var o = i(7).assert,
r = i(163).Version,
s = i(4).getLogger('Chart.Study.Versioning'),
a = i(348),
l = i(26);
(n.prototype.updateMetaInfo = function(e) {
var t, i, n;
if (!e) return e;
for (
o(
!e.isTVScript,
'This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync',
),
t = null,
i = this._studiesMetainfo,
n = 0;
n < i.length;
n++
)
if (i[n].id === e.id) {
t = i[n];
break;
}
return TradingView.clone(t);
}),
(n.prototype.updateMetaInfoAsync = function(e, t) {
var i,
n,
o,
r,
s,
a = $.Deferred(),
c = a.promise();
if (!e) return a.reject('No old metaInfo was given'), c;
if (t) return a.resolve(null), c;
if (
((i =
e.isTVScript &&
e.scriptIdPart &&
TVScript.pineType(e.scriptIdPart) === TVScript.PineType.Addon),
(n = l.versionOf(e)),
e.isTVScript && !e.pine && !i && n < l.VERSION_PINE_PROTECT_TV_4164)
);
else if ((e.isTVScript || e.isTVScriptStubToCompile) && e.pine && !i);
else {
for (o = null, r = this._studiesMetainfo, s = 0; s < r.length; s++)
if (r[s].id === e.id) {
o = r[s];
break;
}
o ? a.resolve(TradingView.clone(o)) : a.resolve(null);
}
return c;
}),
(n.prototype.lastVersionOfStudy = function(e) {
return l.findStudyMetaInfo(this._studiesMetainfo, e).version;
}),
(n.prototype.updateStudyInputs = function(e, t, i, n, o) {
var a,
l,
c,
h,
u,
d,
p,
_ = TradingView.clone(n);
if (
(e in this._migrations &&
((a = r.parse(t)),
'last' === i
? ((c = this.lastVersionOfStudy(e)), (l = r.parse(c)))
: (l = r.parse(i)),
(h = this._migrations[e]),
(u = h.updateInputs(a, l, _)),
(_ = u)),
null == o)
)
return _;
for (d in o) d in _ || (_[d] = o[d]);
for (d in _)
d in o ||
((p = _[d]),
s.logWarn(
'Extra input detected, studyId=' +
e +
', versionFrom=' +
t +
', inputId=' +
d +
', inputValue=' +
p +
', removing it and continue...',
),
delete _[d]);
return _;
}),
(n.prototype.updateStudyState = function(e, t, i) {
var n, o, r, a, c, h, u, d, p, _, f, m, y, g;
if (null == e || null == t || null == i) return e;
for (
e = TradingView.clone(e),
n = t.isTVScript || !!t.pine,
n ||
t.version === i.version ||
((o = i && i.defaults.inputs),
(r = this.updateStudyInputs(t.id, t.version, i.version, e.inputs, o)),
(e.inputs = r)),
a = 0;
a < this._clientMigrations.length;
++a
)
(r = this._clientMigrations[a].call(this, t, e.inputs)),
Object.keys(r).length === Object.keys(e.inputs).length
? (e.inputs = r)
: s.logWarn(
'StudyVersioning._clientMigrations application returned bad result. Skipping it...',
);
if (((c = l.versionOf(t)), t.isTVScript && t.TVScriptSourceCode && c >= 12 && c <= 26)) {
for (h = {}, a = 0; a < t.plots.length; ++a)
(u = t.plots[a]), (d = i.plots[a]), (h[u.id] = d.id);
for (p = Object.keys(e.styles), a = 0; a < p.length; ++a)
(_ = p[a]), (f = e.styles[_]), delete e.styles[_], (m = h[_]), (e.styles[m] = f);
for (y = Object.keys(e.plots), a = 0; a < y.length; ++a)
(g = y[a]), (_ = e.plots[g].id), (e.plots[g].id = h[_]);
}
return e;
}),
(n.prototype.patchPointsBasedStudyState = function(e) {
return n._fixInputsMaxValue(e.state, e.metaInfo), e;
}),
(n.prototype.patchPointsBasedStudyData = function(e, t) {
if (!a.isProd()) return t;
if (!e || !t) return t;
var i = TradingView.clone(t);
return (
'VbPFixed@tv-volumebyprice' === e.id &&
e.version &&
e.version <= 4 &&
n._patchOldVolumeProfiles(0, i),
i
);
}),
(n.prototype.patchStudyData = function(e, t, i, o) {
var r, s, c, h, u, d, p;
if (!a.isProd()) return { data: t, nsData: i, indexes: o };
if (
((r = TradingView.clone(t)),
(s = TradingView.clone(i)),
(c = TradingView.clone(o)),
'VbPVisible@tv-volumebyprice' === e.id &&
e.version &&
e.version <= 4 &&
n._patchOldVolumeProfiles(0, r.graphics),
'VbPSessions@tv-volumebyprice' === e.id &&
e.version &&
e.version <= 4 &&
n._patchOldVolumeProfiles(0, r.graphics),
(h = l.versionOf(e)),
e.isTVScript && e.TVScriptSourceCode && h >= 12 && h <= 26)
)
for (u = r.columns, r.columns = [], d = 0; d < u.length; ++d)
(p = 'plot_' + d), r.columns.push(p);
return { data: r, nsData: s, indexes: c };
}),
(n._patchOldVolumeProfiles = function(e, t) {
var i,
n = t.hhists[e].data,
o = [];
for (i in n) o = o.concat(n[i]);
t.hhists[0].data = o;
}),
(n._fixInputsOrder = function(e, t) {
var i,
o,
r,
s,
a = l.getOrderedInputIds(t),
c = n.splitInputs(e.inputs),
h = c.arr,
u = c.obj,
d = TradingView.merge({}, u);
for (i = 0; i < a.length; ++i)
(o = a[i]), null !== (r = n.findInputKeyById(h, o)) && ((s = h[r]), (d[i] = s));
e.inputs = d;
}),
(n.INPUT_MAX_VALUE = 1e12),
(n._verifyInputsMaxValue = function(e) {
var t,
i,
o = n.INPUT_MAX_VALUE;
if (e.inputs)
for (t = 0; t < e.inputs.length; t++)
(i = e.inputs[t]),
'integer' === i.type &&
i.max &&
i.max > o &&
s.logWarn(
'Bad integer input max value in metaInfo id=' +
e.id +
' title=' +
e.description,
);
}),
(n._fixInputsMaxValue = function(e, t) {
var i, o, r, s, a, l;
if (!TradingView.isAbsent(t)) {
if (((i = n.INPUT_MAX_VALUE), t.inputs))
for (o = 0; o < t.inputs.length; o++)
(r = t.inputs[o]), 'integer' === r.type && r.max && r.max > i && (r.max = i);
if (e && e.inputs) {
(s = n.splitInputs(e.inputs)), (a = s.arr);
for (l in a) (r = a[l]), 'integer' === r.type && r.max && r.max > i && (r.max = i);
e.inputs = TradingView.merge(s.obj, s.arr);
}
}
}),
(n.prototype.patchPropsStateAndMetaInfo = function(e, t, i) {
var o, r, s, a, c, h, u, d, p, _, f, m, y, g, v, S, b, w;
if (
('Script$BOOKER' !== t.productId || t.alerts || delete e.alerts,
n._fixInputsOrder(e, t),
n._fixInputsMaxValue(e, t),
(o = n.splitInputs(e.inputs)),
(e.inputs = o.obj),
l.versionOf(t) < l.METAINFO_FORMAT_VERSION_SOS_V2 &&
t.isChildStudy &&
(e.isChildStudy = t.isChildStudy),
(r = 60),
t.isTVScript &&
t.version < r &&
(('Script$TV_EARNINGS@tv-scripting' !== t.id &&
'Script$TV_DIVIDENDS@tv-scripting' !== t.id &&
'Script$TV_SPLITS@tv-scripting' !== t.id) ||
delete t.TVScriptSourceCode),
('Volume' !== t.id && 'Volume@tv-basicstudies' !== t.id) ||
0 !== t.inputs.length ||
((t.inputs = [{ id: 'length', type: 'integer', defval: 20, min: 1, max: 1e3 }]),
t.plots.push({ id: 'vol_ma', type: 'line' })),
'Volume@tv-basicstudies' === t.id &&
t.version &&
t.version <= 46 &&
(e.styles.vol.transparency = e.transparency || 87),
'PivotPointsStandard@tv-basicstudies' === t.id &&
(0 === t.inputs.length
? ((e.inputs = { kind: 'Traditional', showHistoricalPivots: !0 }),
(t.inputs = [
{
defval: 'Traditional',
id: 'kind',
type: 'text',
options: [
'Traditional',
'Fibonacci',
'Woodie',
'Classic',
'DeMark',
'Camarilla',
],
},
{ id: 'showHistoricalPivots', type: 'bool', defval: !0 },
]))
: 1 === t.inputs.length &&
((e.inputs = { kind: 'Traditional' }),
(t.inputs = [
{
defval: 'Traditional',
id: 'kind',
type: 'text',
options: [
'Traditional',
'Fibonacci',
'Woodie',
'Classic',
'DeMark',
'Camarilla',
],
},
{ id: 'showHistoricalPivots', type: 'bool', defval: !0 },
])),
void 0 === e._hardCodedDefaultsVersion &&
((e._hardCodedDefaultsVersion = 1),
(s = e.color),
delete e.color,
(e.levelsStyle = {
colors: { P: s, 'S1/R1': s, 'S2/R2': s, 'S3/R3': s, 'S4/R4': s, 'S5/R5': s },
}))),
'CMF' === t.shortId &&
2 === t.inputs.length &&
((e.inputs = { length: e.inputs['length fast'] }),
(t.inputs = t.inputs.splice(0, 1)),
(t.inputs[0].id = 'length')),
t.defaults &&
void 0 === t.defaults.precision &&
(-1 !==
[
'Volume@tv-basicstudies',
'VbPVisible@tv-volumebyprice',
'VbPSessions@tv-volumebyprice',
].indexOf(t.id)
? (t.defaults.precision = 0)
: (t.defaults.precision = 4)),
(a = 60),
t.version < a)
)
for (c = ['TV_DIVIDENDS', 'TV_SPLITS', 'TV_EARNINGS'], h = 6, u = 0; u < c.length; u++)
t.id.startsWith('Script$' + c[u] + '@tv-scripting') &&
((t.fullId = 'ESD' + t.fullId.substring(h)),
(t.id = 'ESD' + t.id.substring(h)),
(t.name = 'ESD' + t.name.substring(h)),
(t.shortId = 'ESD' + t.shortId.substring(h)),
(t.productId = 'ESD' + t.productId.substring(h)));
if (
(l.versionOf(t) < l.VERSION_PINE_PROTECT_TV_4164 &&
((d = {
'StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy': {
pineId: 'STD;Consecutive%1Ups%1Downs%1Strategy',
className: 'StrategyScript',
},
Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2: {
pineId: 'Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2',
className: 'Script',
},
}),
t.shortId in d &&
((p = d[t.shortId].className + '$' + d[t.shortId].pineId),
(_ = {
scriptIdPart: d[t.shortId].pineId,
fullId: t.fullId.replace(t.shortId, p),
id: t.id.replace(t.shortId, p),
name: t.name.replace(t.shortId, p),
shortId: p,
}),
TradingView.merge(t, _),
TradingView.merge(e, _)),
(f = TradingView.StudyMetaInfo.cutScriptIdPart(t.fullId)),
(m = f.match(/^(USER)(_\d+)(;)(.*)$/)) &&
((y = m[0]),
(g = m[1] + m[3] + m[2] + m[4]),
(_ = {
scriptIdPart: g,
fullId: t.fullId.replace(y, g),
id: t.id.replace(y, g),
name: t.name.replace(y, g),
shortId: t.shortId.replace(y, g),
}),
TradingView.merge(t, _),
TradingView.merge(e, _))),
'MA' === t.id)
) {
switch (
((v = new l({
id: 'MAExp',
properties: [{ id: 'is_price_study', type: 'bool', value: 'true' }],
inputs: [
{ id: 'length', type: 'integer', defval: 20, min: 1, max: 500 },
{
id: 'source',
type: 'text',
defval: 'close',
options: ['open', 'high', 'low', 'close'],
},
],
plots: [{ id: 'MovAvgExp', type: 'line' }],
palettes: {},
})),
(S = new l({
id: 'MASimple',
properties: [{ id: 'is_price_study', type: 'bool', value: 'true' }],
inputs: [
{ id: 'length', type: 'integer', defval: 20, min: 1, max: 500 },
{
id: 'source',
type: 'text',
defval: 'close',
options: ['open', 'high', 'low', 'close'],
},
],
plots: [{ id: 'MovAvgSimple', type: 'line' }],
palettes: {},
})),
(b = new l({
id: 'MAVolumeWeighted',
properties: [{ id: 'is_price_study', type: 'bool', value: 'true' }],
inputs: [
{ id: 'length', type: 'integer', defval: 20, min: 1, max: 500 },
{
id: 'source',
type: 'text',
defval: 'close',
options: ['open', 'high', 'low', 'close'],
},
],
plots: [{ id: 'MovAvgVolumeWeighted', type: 'line' }],
palettes: {},
})),
(w = new l({
id: 'MAWeighted',
properties: [{ id: 'is_price_study', type: 'bool', value: 'true' }],
inputs: [
{ id: 'length', type: 'integer', defval: 20, min: 1, max: 500 },
{
id: 'source',
type: 'text',
defval: 'close',
options: ['open', 'high', 'low', 'close'],
},
],
plots: [{ id: 'MovAvgWeighted', type: 'line' }],
palettes: {},
})),
e.inputs.type)
) {
case 'exp':
t = v;
break;
case 'simple':
t = S;
break;
case 'weighted':
t = w;
break;
case 'volume weighted':
t = b;
}
(e.styles[t.plots[0].id] = e.styles.MovAvg),
delete e.styles.MovAvg,
delete e.inputs.type;
}
return (
i.oldShowStudyLastValueProperty && (e.oldShowLastValue = e.showLastValue),
delete e.showLastValue,
delete e.showStudyArguments,
{ propsState: e, metaInfo: t }
);
}),
(n.mergeInputs = function(e, t) {
n.mergeInputsArrPart(e, t), n.mergeInputsObjPart(e, t);
}),
(n.mergeInputsArrPart = function(e, t) {
var i,
o,
r = n.splitInputs(t);
for (i in r.arr)
(o = n.findInputKeyById(e, r.arr[i].id)),
o ? TradingView.merge(e[o], r.arr[i]) : n.appendInputInfoToArr(e, r.arr[i]);
}),
(n.mergeInputsObjPart = function(e, t) {
var i = n.splitInputs(t);
TradingView.merge(e, i.obj);
}),
(n.appendInputInfoToArr = function(e, t) {
var i,
n,
o = -1;
for (i in e) (n = parseInt(i, 10)), isNumber(n) && n > o && (o = n);
e[o + 1] = t;
}),
(n.splitInputs = function(e) {
var t,
i = {},
n = {};
for (t in e) isNumber(parseInt(t, 10)) ? (i[t] = e[t]) : (n[t] = e[t]);
return { arr: i, obj: n };
}),
(n.findInputKeyById = function(e, t) {
var i,
n = null;
for (i in e)
if (isNumber(parseInt(i, 10)) && e[i].id === t) {
n = i;
break;
}
return n;
}),
(n.getInputKeyById = function(e, t) {
var i = n.findInputKeyById(e, t);
if (!i) throw Error('Cannot find input with id: ' + t);
return i;
}),
(e.exports = n);
},
function(e, t, i) {
'use strict';
var n, o, r, s;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'LineToolPriceAxisView', function() {
return s;
}),
(n = i(1)),
(o = i(7)),
i.n(o),
(r = i(58)),
(s = (function(e) {
function t(t, i) {
var n = e.call(this) || this;
return (
(n._activeBackground = '#0F6DBF'),
(n._background = '#5592C9'),
(n._active = !1),
(n._source = t),
(n._data = i),
n
);
}
return (
n.c(t, e),
(t.prototype.setActive = function(e) {
this._active = e;
}),
(t.prototype.setBackground = function(e) {
this._background = e;
}),
(t.prototype._updateRendererData = function(e) {
var t, i, n, o, r, s, a, l;
(e.visible = !1),
(t = this._source.model()),
t.timeScale() &&
!t.timeScale().isEmpty() &&
(null === (i = this._source.priceScale()) ||
i.isEmpty() ||
((t.selectedSource() === this._source ||
this._source.isForcedDrawPriceAxisLabel()) &&
null !== t.timeScale().visibleBars() &&
((n = this._source.axisPoints()),
(o = this._data.pointIndex),
n.length <= o ||
((r = n[o]),
isFinite(r.price) &&
((s = this._source.ownerSource()),
null != (a = null !== s ? s.firstValue() : null) &&
((l = this._active ? this._activeBackground : this._background),
this._data.backgroundProperty &&
(l = this._data.backgroundProperty.value()),
(e.background = l),
(e.borderColor = '#2E84A6'),
(e.color = this.generateTextColor(l)),
(e.coordinate = i.priceToCoordinate(r.price, a)),
(e.text = this._formatPrice(r.price, a)),
(e.visible = !0)))))));
}),
(t.prototype._formatPrice = function(e, t) {
return Object(o.ensureNotNull)(this._source.priceScale()).formatPrice(e, t);
}),
t
);
})(r.a));
},
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'TimeAxisView', function() {
return o;
}),
(n = i(24)),
i.n(n),
(o = (function() {
function e() {
(this._text = ''), (this._background = '#585858'), (this._coordinate = 0);
}
return (
(e.prototype.text = function() {
return this._text;
}),
(e.prototype.background = function() {
return this._background;
}),
(e.prototype.color = function() {
return 'black' ===
Object(n.rgbToBlackWhiteString)(Object(n.parseRgb)(this._background), 150)
? 'white'
: 'black';
}),
(e.prototype.coordinate = function() {
return this._coordinate;
}),
e
);
})());
},
function(e, t, i) {
'use strict';
var n, o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'TimeAxisViewRenderer', function() {
return r;
}),
(n = i(46)),
i.n(n),
(o = /[1-9]/g),
(r = (function() {
function e() {
this._data = null;
}
return (
(e.prototype.setData = function(e) {
this._data = e;
}),
(e.prototype.draw = function(e, t) {
var i, r, s, a, l, c, h, u, d, p, _, f, m, y;
null !== this._data &&
!1 !== this._data.visible &&
0 !== this._data.text.length &&
((e.font = t.font),
(i = Math.round(t.widthCache.measureText(e, this._data.text, o))) <= 0 ||
((r = t.paddingHorizontal),
(s = i + 2 * r),
(a = s / 2),
(l = this._data.width),
(c = this._data.coordinate),
(h = Math.floor(c - a) + 0.5),
h < 0
? ((c += Math.abs(0 - h)), (h = Math.floor(c - a) + 0.5))
: h + s > l && ((c -= Math.abs(l - (h + s))), (h = Math.floor(c - a) + 0.5)),
(u = h + s),
(d = 0.5),
(p = d + t.borderSize + t.paddingTop + t.fontSize + t.paddingBottom),
(e.fillStyle = this._data.background),
(e.lineWidth = 1),
Object(n.drawRoundRect)(e, h, d, u - h, p - d, 1),
e.fill(),
(_ = Math.round(this._data.coordinate + 1)),
(f = d),
(m = f + t.borderSize + t.tickLength),
(e.strokeStyle = this._data.color),
e.beginPath(),
e.moveTo(_, f),
e.lineTo(_, m),
e.stroke(),
(y = p - t.baselineOffset - t.paddingBottom),
(e.textAlign = 'left'),
(e.fillStyle = this._data.color),
e.fillText(this._data.text, h + r, y)));
}),
e
);
})());
},
function(e, t, i) {
'use strict';
var n, o, r, s;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'AbbreviatedDateTimeFormatter', function() {
return s;
}),
(n = i(130)),
(o = i(21)),
(r = {
1: window.t('Jan'),
2: window.t('Feb'),
3: window.t('Mar'),
4: window.t('Apr'),
5: window.t('May'),
6: window.t('Jun'),
7: window.t('Jul'),
8: window.t('Aug'),
9: window.t('Sep'),
10: window.t('Oct'),
11: window.t('Nov'),
12: window.t('Dec'),
}),
(s = (function() {
function e(e) {
void 0 === e && (e = !1), (this._dwm = e);
}
return (
(e.prototype.format = function(e) {
var t = this._formatDate(e);
return this._dwm || (t += ' · ' + new n.TimeFormatter('%h:%m').format(e)), t;
}),
(e.prototype.formatLocal = function(e) {
var t = this._formatDateLocal(e);
return this._dwm || (t += ' · ' + new n.TimeFormatter('%h:%m').formatLocal(e)), t;
}),
(e.prototype._formatDate = function(e) {
var t, i, n;
return o.customFormatters && o.customFormatters.dateFormatter
? o.customFormatters.dateFormatter.format(e)
: ((t = Object(o.numberToStringWithLeadingZero)(e.getUTCDate(), 2)),
(i = r[e.getUTCMonth() + 1]),
(n = ('' + e.getUTCFullYear()).substring(2)),
t + ' ' + i + " '" + n);
}),
(e.prototype._formatDateLocal = function(e) {
var t, i, n;
return o.customFormatters.dateFormatter
? o.customFormatters.dateFormatter.formatLocal
? o.customFormatters.dateFormatter.formatLocal(e)
: o.customFormatters.dateFormatter.format(e)
: ((t = Object(o.numberToStringWithLeadingZero)(e.getDate(), 2)),
(i = r[e.getMonth() + 1]),
(n = ('' + e.getFullYear()).substring(2)),
t + ' ' + i + " '" + n);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t) {
(this.customization = {
forcePriceAxisLabel: !0,
disableSelection: !0,
disableErasing: !0,
}),
o.call(this, e, t);
}
var o = i(0).LineDataSource;
inherit(n, o),
(n.POINTS_COUNT = 1),
(n.prototype.pointsCount = function() {
return n.POINTS_COUNT;
}),
(n.prototype.hasContextMenu = function() {
return !1;
}),
(n.prototype.state = function() {
return null;
}),
(n.prototype.startMoving = function() {
o.prototype.startMoving.apply(this, arguments), (this._cursorMoved = !1);
}),
(n.prototype.endMoving = function() {
o.prototype.endMoving.apply(this, arguments), (this._cursorMoved = !1);
}),
(n.prototype.correctPoints = function(e) {
var t, i, n, o, r;
for (
this._currentMovingPoint && this._startMovingPoint
? this._currentMovingPoint.price - this._startMovingPoint.price &&
(this._cursorMoved = !0)
: (this._cursorMoved = !1),
t = this.priceScale(),
i = t.mainSource().base(),
n = 1 / i,
o = 0;
o < e.length;
o++
)
(r = e[o]),
this._cursorMoved && (r.price = this._currentMovingPoint.price),
(r.price = n * Math.round(r.price / n)),
(e[o] = r);
}),
(n.prototype.userEditEnabled = function() {
return !0;
}),
(n.prototype.canBeHidden = function() {
return !1;
}),
(n.prototype.isUserDeletable = function() {
return !1;
}),
(n.prototype.showInObjectTree = function() {
return !1;
}),
(n.prototype.getInputsPropertyPage = function() {
return null;
}),
(n.prototype.doesMovingAffectsUndo = function() {
return !1;
}),
(e.exports = n);
},
function(e, t, i) {
'use strict';
var n, o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'LineToolHorzLinePriceAxisView', function() {
return r;
}),
(n = i(1)),
(o = i(58)),
(r = (function(e) {
function t(t) {
var i = e.call(this) || this;
return (i._source = t), i;
}
return (
n.c(t, e),
(t.prototype._updateRendererData = function(e) {
var t, i, n, o, r, s;
(e.visible = !1),
(t = this._source.points()),
(i = this._source.priceScale()),
0 === t.length ||
null === i ||
i.isEmpty() ||
((n = t[0]),
isFinite(n.price) &&
((o = this._source.ownerSource()),
null != (r = null !== o ? o.firstValue() : null) &&
((s = this._source.properties().linecolor.value()),
(e.background = s),
(e.color = this.generateTextColor(s)),
(e.coordinate = i.priceToCoordinate(n.price, r)),
(e.text = i.formatPrice(n.price, r)),
(e.visible = !0))));
}),
t
);
})(o.a));
},
function(e, t, i) {
'use strict';
(function(e) {
function n(t, o) {
var r,
s,
c,
d,
p,
_,
f,
m,
y,
g = o || new h('linetoolriskreward');
a.call(this, t, g),
this._properties.addExclusion &&
(this._properties.addExclusion('stopLevel'),
this._properties.addExclusion('profitLevel')),
o.stopLevel ||
o.profitLevel ||
((r = t.timeScale().visibleBars()),
(s = r.firstBar()),
(c = r.lastBar()),
(d = t.mainSeries().priceRange(s, c)),
(p = t.mainSeries().priceScale()),
p.isLog() &&
((_ = p.logicalToPrice(d.minValue())),
(f = p.logicalToPrice(d.maxValue())),
(d = new e(_, f))),
d &&
!d.isEmpty() &&
((m = Math.round(0.2 * d.length() * t.mainSeries().base())),
g.merge({ stopLevel: m, profitLevel: m }))),
(y = this),
g.stopLevel.listeners().subscribe(this, this.recalculate),
g.stopLevel.listeners().subscribe(null, function() {
y.properties().stopPrice._listeners.fire(y.properties().stopPrice);
}),
g.profitLevel.listeners().subscribe(this, this.recalculate),
g.profitLevel.listeners().subscribe(null, function() {
y.properties().targetPrice._listeners.fire(y.properties().targetPrice);
}),
g.addChild('entryPrice', new n.PriceProperty(this, 0)),
g.addChild('stopPrice', new n.StopPriceProperty(this)),
g.addChild('targetPrice', new n.TargetPriceProperty(this)),
g.addProperty('riskSize', 250),
g.addProperty('qty', 0),
g.addProperty('amountTarget', g.accountSize.value()),
g.addProperty('amountStop', g.accountSize.value()),
(this._riskInPercentsFormatter = new u(2)),
(this._riskInMoneyFormatter = new u()),
g.risk.subscribe(this, this._recalculateRiskSize),
g.accountSize.subscribe(this, this._recalculateRiskSize),
g.riskDisplayMode.subscribe(this, this._recalculateRisk),
g.riskDisplayMode.subscribe(this, this._recalculateRiskSize),
g.entryPrice.subscribe(this, this._recalculateRiskSize),
g.stopPrice.subscribe(this, this._recalculateRiskSize),
g.profitLevel.subscribe(this, this._recalculateRiskSize),
g.stopLevel.subscribe(this, this._recalculateRiskSize),
g.qty.subscribe(this, this._recalculateRiskSize),
'percents' === g.riskDisplayMode.value() &&
g.risk.value() > 100 &&
g.riskDisplayMode.setValueSilently('money'),
(this._syncStateExclusions = [
'entryPrice',
'stopPrice',
'targetPrice',
'riskSize',
'qty',
'amountTarget',
'amountStop',
'risk',
'accountSize',
]),
(this.version = n.version),
(this._entryPriceAxisView = new l(this, {
colorProperty: g.linecolor,
priceProperty: g.entryPrice,
})),
(this._stopPriceAxisView = new l(this, {
colorProperty: g.stopBackground,
priceProperty: g.stopPrice,
})),
(this._profitPriceAxisView = new l(this, {
colorProperty: g.profitBackground,
priceProperty: g.targetPrice,
})),
i
.e(0)
.then(
function(e) {
var t = i(789).RiskRewardPaneView;
this._setPaneViews([new t(this, this._model)]);
}
.bind(this)
.bind(null, i),
)
.catch(i.oe);
}
function o(e, t) {
var i, o;
(this._constructor = 'LineToolRiskRewardShort'),
(i = t || new h('linetoolriskrewardshort')),
n.call(this, e, i),
(o = this.properties()),
o.entryPrice.subscribe(this, this._recalculateQty),
o.stopPrice.subscribe(this, this._recalculateQty),
o.riskSize.subscribe(this, this._recalculateQty),
o.entryPrice.subscribe(this, this._recalculateAmount),
o.profitLevel.subscribe(this, this._recalculateAmount),
o.stopLevel.subscribe(this, this._recalculateAmount),
o.accountSize.subscribe(this, this._recalculateAmount),
o.riskSize.subscribe(this, this._recalculateAmount),
o.qty.subscribe(this, this._recalculateAmount);
}
function r(e, t) {
var i, o;
(this._constructor = 'LineToolRiskRewardLong'),
(i = t || new h('linetoolriskrewardlong')),
n.call(this, e, i),
(o = this.properties()),
o.entryPrice.subscribe(this, this._recalculateQty),
o.stopPrice.subscribe(this, this._recalculateQty),
o.riskSize.subscribe(this, this._recalculateQty),
o.entryPrice.subscribe(this, this._recalculateAmount),
o.profitLevel.subscribe(this, this._recalculateAmount),
o.stopLevel.subscribe(this, this._recalculateAmount),
o.accountSize.subscribe(this, this._recalculateAmount),
o.riskSize.subscribe(this, this._recalculateAmount),
o.qty.subscribe(this, this._recalculateAmount);
}
var s = i(7).ensureNotNull,
a = i(0).LineDataSource,
l = i(570).LineToolRiskRewardPriceAxisView,
c = i(32),
h = i(3).DefaultProperty,
u = i(105).NumericFormatter,
d = i(2).propertyPages,
p = i(352).RiskRewardPointIndex;
inherit(n, a),
(n.prototype.riskFormatter = function(e) {
return 'percents' === e ? this._riskInPercentsFormatter : this._riskInMoneyFormatter;
}),
(n.prototype.getRiskStep = function(e) {
return 'percents' === e ? 0.01 : 1;
}),
(n.prototype._roundValue = function(e) {
return parseFloat(e.toFixed(2));
}),
(n.prototype._recalculateRisk = function() {
var e = this.properties(),
t = e.riskDisplayMode.value(),
i = e.riskSize.value(),
n = e.accountSize.value(),
o = e.risk.value();
(o =
'percents' === t ? this._roundValue((i / n) * 100) : this._roundValue((n / 100) * o)),
(this._riskInChange = !0),
e.risk.setValue(this.riskFormatter(t).format(o)),
(this._riskInChange = !1);
}),
(n.prototype._recalculateRiskSize = function() {
var e, t, i, n;
this._riskInChange ||
((e = this.properties()),
(t = e.risk.value()),
(i = e.riskDisplayMode.value()),
(n = e.accountSize.value()),
'percents' === i
? e.riskSize.setValue((t / 100) * n)
: t > n
? (e.risk.setValue(n), e.riskSize.setValue(n))
: e.riskSize.setValue(t));
}),
(n.version = 2),
(n.prototype.i18nCache = { title: $.t('Risk/Reward') }),
(n.prototype.lastBarData = function() {
var e,
t,
i,
n,
o,
r = this._model
.mainSeries()
.bars()
.firstIndex(),
a = this._model
.mainSeries()
.bars()
.lastIndex();
return null === r || null === a || isNaN(r) || isNaN(a)
? null
: ((e = this.points()),
4 === e.length
? ((t = e[p.ActualClose]),
t.index < r ? null : { closePrice: t.price, index: Math.min(a, t.index) })
: ((i = e[p.Close]),
i.index < r
? null
: ((n = Math.min(a, i.index)),
(o = s(
this._model
.mainSeries()
.bars()
.valueAt(n),
)),
{ closePrice: o[TradingView.CLOSE_PLOT], index: n })));
}),
(n.prototype.migrateVersion = function(e, t, i) {
var n, o, r, s;
1 === e &&
this._points.length >= 1 &&
((n = []),
n.push(this._points[0]),
(o = this._points[0]),
(o = { price: o.price, index: o.index + 50 }),
n.push(o),
this._points[1] && n.push(this._points[1]),
this._points[2] && n.push(this._points[2]),
(this._points = n),
this._timePoint.length >= 1 &&
((r = []),
(o = this._timePoint[0]),
r.push(o),
(s = { price: o.price, time_t: o.time_t, offset: o.offset + 50 }),
r.push(s),
this._timePoint[1] && n.push(this._points[1]),
this._timePoint[2] && n.push(this._points[2]),
(this._timePoint = r)));
}),
(n.prototype.checkAlert = function() {
this.recalculate();
}),
(n.prototype.priceAxisViews = function(e, t) {
return this.isSourceHidden()
? null
: t !== this.priceScale() || this._model.paneForSource(this) !== e
? null
: [this._entryPriceAxisView, this._stopPriceAxisView, this._profitPriceAxisView];
}),
(n.prototype.updateAllViews = function() {
this.isActualSymbol() &&
this._properties.visible.value() &&
((c.hideAllDrawings().value() && this.userEditEnabled()) ||
(a.prototype.updateAllViews.call(this),
this._entryPriceAxisView.update(),
this._stopPriceAxisView.update(),
this._profitPriceAxisView.update()));
}),
(n.prototype.setPoint = function(e, t) {
switch (e) {
case 0:
(t.price = this._roundPrice(t.price)),
a.prototype.setPoint.call(this, e, t),
this.recalculate();
break;
case 1:
this.isActualSymbol() &&
this.properties().stopPrice.setValue(this.preparseStopPrice(t.price));
break;
case 2:
this.isActualSymbol() &&
this.properties().targetPrice.setValue(this.preparseProfitPrice(t.price));
break;
case 3:
(t.price = this._roundPrice(t.price)),
a.prototype.setPoint.call(this, 1, t),
this.recalculate();
}
}),
(n.PriceProperty = function(e, t) {
a.PointPriceProperty.call(this, e, t);
}),
inherit(n.PriceProperty, a.PointPriceProperty),
(n.PriceProperty.prototype.setValue = function(e) {
var t = this._lineSource.points()[this._pointIndex];
(t.price = parseFloat(e)),
this._lineSource.setPoint(this._pointIndex, t),
this._lineSource.recalculate(),
this._lineSource._model.updateSource(this._lineSource),
this._listeners.fire(this),
this._lineSource.endChanging(),
this._lineSource._syncMultichartState();
}),
(n.StopPriceProperty = function(e) {
n.PriceProperty.call(this, e, 1);
}),
inherit(n.StopPriceProperty, n.PriceProperty),
(n.StopPriceProperty.prototype.value = function() {
var e = this._lineSource.stopPrice(),
t = this._lineSource.ownerSource().formatter(),
i = t.parse(t.format(e));
return i.price ? i.price : i.value;
}),
(n.StopPriceProperty.prototype.setValue = function(e) {
var t = Math.round(
Math.abs(e - this._lineSource.entryPrice()) *
this._lineSource._model.mainSeries().base(),
);
this._lineSource.properties().stopLevel.setValue(t),
this._lineSource
.properties()
.stopLevel.listeners()
.fire(this._lineSource.properties().stopLevel);
}),
(n.TargetPriceProperty = function(e) {
n.PriceProperty.call(this, e, 2);
}),
inherit(n.TargetPriceProperty, n.PriceProperty),
(n.TargetPriceProperty.prototype.value = function() {
var e = this._lineSource.profitPrice(),
t = this._lineSource.ownerSource().formatter(),
i = t.parse(t.format(e));
return i.price ? i.price : i.value;
}),
(n.TargetPriceProperty.prototype.setValue = function(e) {
var t = Math.round(
Math.abs(e - this._lineSource.entryPrice()) *
this._lineSource._model.mainSeries().base(),
);
this._lineSource.properties().profitLevel.setValue(t),
this._lineSource
.properties()
.profitLevel.listeners()
.fire(this._lineSource.properties().profitLevel);
}),
(n.prototype.pointsCount = function() {
return 1;
}),
(n.prototype.title = function() {
return this.i18nCache.title;
}),
(n.prototype.name = function() {
return 'Risk/Reward';
}),
(n.prototype.addPoint = function(e) {
var t, i;
return (
(e.price = this._roundPrice(e.price)),
a.prototype.addPoint.call(this, e, null, !0),
(t = { price: e.price, index: e.index + 50 }),
a.prototype._addPointIntenal.call(this, t, null, !0),
(i = this.calculateActualEntry(e, t)),
i &&
(a.prototype._addPointIntenal.call(this, i, null, !0),
(t = this.findClosePoint(i, t)) &&
a.prototype._addPointIntenal.call(this, t, null, !0)),
(this._lastPoint = null),
this.normalizePoints(),
this.createServerPoints(),
!0
);
}),
(n.prototype._roundPrice = function(e) {
var t = this._model.mainSeries().base();
return Math.round(e * t) / t;
}),
(n.prototype.recalculate = function() {
var e, t, i, n, o;
this.properties().interval.value() === this._model.mainSeries().interval() &&
0 !== this.points().length &&
((e = this.properties().targetPrice.value()),
(t = this.properties().stopPrice.value()),
(i = [this._points[0], this._points[1]]),
(n = this.calculateActualEntry(this.points()[0], this.points()[1])),
n && (i.push(n), (o = this.findClosePoint(n, this.points()[1])) && i.push(o)),
(this._points = i),
e !== this.properties().targetPrice.value() &&
this.properties().targetPrice._listeners.fire(this.properties().targetPrice),
t !== this.properties().stopPrice.value() &&
this.properties().stopPrice._listeners.fire(this.properties().stopPrice));
}),
(n.prototype.start = function() {
a.prototype.start.call(this), this.recalculate();
}),
(n.prototype.startMoving = function(e) {
(e.price = this._roundPrice(e.price)), a.prototype.startMoving.call(this, e);
}),
(n.prototype.move = function(e) {
(e.price = this._roundPrice(e.price)),
a.prototype.move.call(this, e),
this.recalculate(),
this._entryPriceAxisView.update();
}),
(n.prototype.correctPoints = function(e) {
return !!this.isActualSymbol() && a.prototype.correctPoints.call(this, [e[0], e[1]]);
}),
(n.prototype.entryPrice = function() {
return this.points()[0].price;
}),
(n.prototype.findClosePoint = function(e, t) {
var i,
n,
o,
r = this._model.mainSeries().bars(),
a = s(r.firstIndex()),
l = Math.max(e.index, a),
c = s(r.lastIndex());
for (i = l; i <= Math.min(c, t.index); i++)
if (((n = s(r.valueAt(i))), null != (o = this.checkStopPrice(n))))
return { index: i, price: o };
return null;
}),
(n.prototype.calculateActualEntry = function(e, t) {
var i,
n,
o = this._model.mainSeries().bars(),
r = s(o.firstIndex()),
a = Math.max(e.index, r),
l = e.price,
c = s(o.lastIndex());
for (i = a; i <= Math.min(c, t.index); i++)
if (
((n = s(o.valueAt(i))),
n[TradingView.HIGH_PLOT] >= l && n[TradingView.LOW_PLOT] <= l)
)
return { index: i, price: l };
return null;
}),
(n.prototype.axisPoints = function() {
var e, t, i;
if (!this._points[p.ActualEntry]) return [];
if (((e = this._points[p.ActualEntry]), (t = null), 4 === this._points.length))
t = this._points[p.ActualClose];
else {
if (!(i = this.lastBarData())) return [];
t = { index: i.index, price: i.closePrice };
}
return [e, t];
}),
(n.prototype.getInputsPropertyPage = function() {
return d.LineToolRiskRewardInputsPropertyPage;
}),
(n.prototype.getStylesPropertyPage = function() {
return d.LineToolRiskRewardStylesPropertyPage;
}),
inherit(o, n),
(o.prototype.i18nCache = { title: $.t('Risk/Reward short') }),
(o.prototype._recalculateQty = function() {
var e, t, i, n, o;
0 !== this.points().length &&
((e = this.properties()),
(t = e.entryPrice.value()),
(i = e.stopPrice.value()),
(n = e.riskSize.value()),
(o = Math.floor(n / Math.abs(i - t))),
e.qty.setValue(o));
}),
(o.prototype._recalculateAmount = function() {
var e, t, i, n, o, r, s, a;
0 !== this.points().length &&
((e = this.properties()),
(t = e.accountSize.value()),
(i = e.entryPrice.value()),
(n = e.qty.value()),
(o = e.stopPrice.value()),
(r = e.targetPrice.value()),
(s = this._roundValue(t + (i - r) * n)),
(a = this._roundValue(t - (o - i) * n)),
e.amountTarget.setValue(s),
e.amountStop.setValue(a));
}),
(o.prototype.title = function() {
return this.i18nCache.title;
}),
(o.prototype.name = function() {
return 'Risk/Reward short';
}),
(o.prototype.stopPrice = function() {
return (
this.entryPrice() +
this.properties().stopLevel.value() / this._model.mainSeries().base()
);
}),
(o.prototype.profitPrice = function() {
return (
this.entryPrice() -
this.properties().profitLevel.value() / this._model.mainSeries().base()
);
}),
(o.prototype.calculatePL = function(e) {
return this.entryPrice() - e;
}),
(o.prototype.preparseStopPrice = function(e) {
e = this._roundPrice(e);
var t = this.entryPrice() + 1 / this._model.mainSeries().base();
return Math.max(e, t);
}),
(o.prototype.preparseProfitPrice = function(e) {
e = this._roundPrice(e);
var t = this.entryPrice() - 1 / this._model.mainSeries().base();
return Math.min(e, t);
}),
(o.prototype.checkStopPrice = function(e) {
var t = this.stopPrice(),
i = this.profitPrice();
return e[TradingView.HIGH_PLOT] >= t
? this.stopPrice()
: e[TradingView.LOW_PLOT] <= i
? this.profitPrice()
: null;
}),
(r.prototype.i18nCache = { title: $.t('Risk/Reward long') }),
inherit(r, n),
(r.prototype._recalculateQty = function() {
var e, t, i, n, o;
0 !== this.points().length &&
((e = this.properties()),
(t = e.entryPrice.value()),
(i = e.stopPrice.value()),
(n = e.riskSize.value()),
(o = Math.floor(n / Math.abs(t - i))),
e.qty.setValue(o));
}),
(r.prototype._recalculateAmount = function() {
var e, t, i, n, o, r, s, a;
0 !== this.points().length &&
((e = this.properties()),
(t = e.accountSize.value()),
(i = e.entryPrice.value()),
(n = e.qty.value()),
(o = e.stopPrice.value()),
(r = e.targetPrice.value()),
(s = this._roundValue(t + (r - i) * n)),
(a = this._roundValue(t - (i - o) * n)),
e.amountTarget.setValue(s),
e.amountStop.setValue(a));
}),
(r.prototype.stopPrice = function() {
return (
this.entryPrice() -
this.properties().stopLevel.value() / this._model.mainSeries().base()
);
}),
(r.prototype.profitPrice = function() {
return (
this.entryPrice() +
this.properties().profitLevel.value() / this._model.mainSeries().base()
);
}),
(r.prototype.calculatePL = function(e) {
return e - this.entryPrice();
}),
(r.prototype.preparseStopPrice = function(e) {
e = this._roundPrice(e);
var t = this.entryPrice() - 1 / this._model.mainSeries().base();
return Math.min(e, t);
}),
(r.prototype.preparseProfitPrice = function(e) {
e = this._roundPrice(e);
var t = this.entryPrice() + 1 / this._model.mainSeries().base();
return Math.max(e, t);
}),
(r.prototype.checkStopPrice = function(e) {
var t = this.stopPrice(),
i = this.profitPrice();
return e[TradingView.LOW_PLOT] <= t
? this.stopPrice()
: e[TradingView.HIGH_PLOT] >= i
? this.profitPrice()
: null;
}),
(r.prototype.title = function() {
return this.i18nCache.title;
}),
(r.prototype.name = function() {
return 'Risk/Reward long';
}),
(t.LineToolRiskReward = n),
(t.LineToolRiskRewardLong = r),
(t.LineToolRiskRewardShort = o);
}.call(t, i(48).PriceRange));
},
function(e, t, i) {
'use strict';
(function(e) {
function n(t, i, o) {
var r, s;
(this.m_timeScale = t),
(r = i.rightAxisProperties.state()),
(r.autoScale = !0),
(this.m_rightPriceScale = new c(o.properties().scalesProperties, r)),
this.m_rightPriceScale
.modeChanged()
.subscribe(this, this._onPriceScaleModeChanged.bind(this, this.m_rightPriceScale)),
(s = i.leftAxisProperties.state()),
(s.autoScale = !0),
(this.m_leftPriceScale = new c(o.properties().scalesProperties, s)),
this.m_leftPriceScale
.modeChanged()
.subscribe(this, this._onPriceScaleModeChanged.bind(this, this.m_leftPriceScale)),
(this.m_dataSources = []),
(this.m_height = 0),
(this.m_width = 0),
(this.m_mainDataSource = null),
(this._properties = i),
(this._model = o),
(this._tagsChanged = new e()),
(this._destroyed = new e()),
(this._leftPriceScaleRatioChanged = new e()),
(this._rightPriceScaleRatioChanged = new e()),
this._leftPriceScaleRatioChanged.subscribe(
this,
this._mainSeriesPaneScaleRatioOnChange,
),
this._rightPriceScaleRatioChanged.subscribe(
this,
this._mainSeriesPaneScaleRatioOnChange,
),
this.m_timeScale
.barSpacingChanged()
.subscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_leftPriceScale
.internalHeightChanged()
.subscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_rightPriceScale
.internalHeightChanged()
.subscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_leftPriceScale
.priceRangeChanged()
.subscribe(this, this._recalculateTimeScaleByLeftScaleRatio),
this.m_rightPriceScale
.priceRangeChanged()
.subscribe(this, this._recalculateTimeScaleByRightScaleRatio),
this.m_leftPriceScale
.priceRangeChanged()
.subscribe(this, this._onLeftPriceScaleSetMinMaxPriceRange),
this.m_rightPriceScale
.priceRangeChanged()
.subscribe(this, this._onRightPriceScaleSetMinMaxPriceRange),
(this._lastLeftPriceScaleRatio = h(this.m_timeScale, this.m_leftPriceScale)),
(this._lastRightPriceScaleRatio = h(this.m_timeScale, this.m_rightPriceScale)),
i.topMargin.listeners().subscribe(this, n.prototype._updateMargins),
i.bottomMargin.listeners().subscribe(this, n.prototype._updateMargins),
this._updateMargins(),
(this._stretchFactor = n.DEFAULT_STRETCH_FACTOR),
(this._isInInsertManyDataSourcesState = !1),
(this._lastLineDataSourceZOrder = null),
(this._maximized = !1),
(this._isMainPane = !1);
}
var o = i(272).ExecutionsPositionController,
r = i(0).LineDataSource,
s = i(48).PriceRange,
a = i(28).PriceDataSource,
l = i(4).getLogger('Chart.Pane'),
c = i(177).PriceScale,
h = i(121).scaleRatio,
u = i(121).priceRangeByScaleRatio,
d = i(121).barSpacingByScaleRatio;
(n.DEFAULT_STRETCH_FACTOR = 1e3),
(n.PANE_ANIMATION_DURATION = 500),
(n.sortSourcesPreOrdered = {
'Volume@tv-basicstudies': 0,
ChartEventsSource: 1,
'ESD$TV_DIVIDENDS@tv-scripting': 2,
'ESD$TV_SPLITS@tv-scripting': 3,
'ESD$TV_EARNINGS@tv-scripting': 4,
LineToolOrder: 5,
LineToolPosition: 6,
LineToolExecution: 7,
}),
(n.prototype.destroy = function() {
var e, t;
for (
this._leftPriceScaleRatioChanged.unsubscribe(
this,
this._mainSeriesPaneScaleRatioOnChange,
),
this._rightPriceScaleRatioChanged.unsubscribe(
this,
this._mainSeriesPaneScaleRatioOnChange,
),
this.m_rightPriceScale
.priceRangeChanged()
.unsubscribe(this, this._recalculateTimeScaleByRightScaleRatio),
this.m_leftPriceScale
.priceRangeChanged()
.unsubscribe(this, this._recalculateTimeScaleByLeftScaleRatio),
this.m_timeScale
.barSpacingChanged()
.unsubscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_leftPriceScale
.internalHeightChanged()
.unsubscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_rightPriceScale
.internalHeightChanged()
.unsubscribe(this, this._recalculatePriceScaleByScaleRatio),
this.m_leftPriceScale
.priceRangeChanged()
.unsubscribe(this, this._onLeftPriceScaleSetMinMaxPriceRange),
this.m_rightPriceScale
.priceRangeChanged()
.unsubscribe(this, this._onRightPriceScaleSetMinMaxPriceRange),
this.m_leftPriceScale.modeChanged().unsubscribeAll(this),
this.m_rightPriceScale.modeChanged().unsubscribeAll(this),
this._properties.topMargin
.listeners()
.unsubscribe(this, n.prototype._updateMargins),
this._properties.bottomMargin
.listeners()
.unsubscribe(this, n.prototype._updateMargins),
e = 0;
e < this.m_dataSources.length;
e++
)
(t = this.m_dataSources[e]), t.destroy && t.destroy();
this._destroyed.fire();
}),
(n.prototype.setPaneSize = function(e) {
var t = { large: 1, medium: 0.6, small: 0.3, tiny: 0.15 };
if (!t[e]) throw Error('Unknown size enum value: ' + e);
this._stretchFactor = t[e] * n.DEFAULT_STRETCH_FACTOR;
}),
(n.sortSources = function(e) {
return e
.map(function(e) {
var t,
i,
o = e._constructor;
return (
isFunction(e.metaInfo) && (o = e.metaInfo().id),
(i = n.sortSourcesPreOrdered[o] || 0),
(t = i > 0 ? 1 / 0 : i < 0 ? -1 / 0 : e.zorder()),
[e, i, t]
);
})
.sort(function(e, t) {
return e[1] - t[1] || e[2] - t[2];
})
.map(function(e) {
return e[0];
});
}),
(n.prototype._updateMargins = function() {
var e,
t,
i = 0.01 * this._properties.topMargin.value(),
n = 0.01 * this._properties.bottomMargin.value();
for (
this.m_leftPriceScale.setTopMargin(i),
this.m_leftPriceScale.setBottomMargin(n),
this.m_rightPriceScale.setTopMargin(i),
this.m_rightPriceScale.setBottomMargin(n),
e = 0;
e < this.m_dataSources.length;
e++
)
(t = this.m_dataSources[e]) instanceof TradingView.Study &&
this.isOverlay(t) &&
'Volume' !== t.metaInfo().shortId &&
t.priceScale() &&
t.priceScale() !== this.m_leftPriceScale &&
t.priceScale() === this.m_rightPriceScale &&
(t.priceScale().setTopMargin(i),
t.priceScale().setBottomMargin(n),
this.recalculatePriceScale(t.priceScale()));
this.recalculatePriceScale(this.m_leftPriceScale),
this.recalculatePriceScale(this.m_rightPriceScale),
this.updateAllViews();
}),
(n.prototype.model = function() {
return this._model;
}),
(n.prototype.width = function() {
return this.m_width;
}),
(n.prototype.height = function() {
return this.m_height;
}),
(n.prototype.setWidth = function(e) {
(this.m_width = e), this.updateAllViews();
}),
(n.prototype.setHeight = function(e) {
var t, i;
for (
this.m_height = e,
this.m_leftPriceScale.setHeight(e),
this.m_rightPriceScale.setHeight(e),
t = 0;
t < this.m_dataSources.length;
t++
)
(i = this.m_dataSources[t]),
this.isOverlay(i) && i.priceScale() && i.priceScale().setHeight(e);
this.updateAllViews();
}),
(n.prototype.leftPriceScale = function() {
return this.m_leftPriceScale;
}),
(n.prototype.rightPriceScale = function() {
return this.m_rightPriceScale;
}),
(n.prototype.timeScale = function() {
return this.m_timeScale;
}),
(n.prototype.dataSources = function() {
return this.m_dataSources;
}),
(n.prototype.isOverlay = function(e) {
return e._isOverlay;
}),
(n.prototype._processMainSourceChange = function() {
var e, t, i, o, s, l, c;
if (null === this.m_mainDataSource)
for (t = 0; t < this.m_dataSources.length; t++)
if (
((i = this.m_dataSources[t]),
TradingView.isInherited(i.constructor, a) &&
!this.isOverlay(i) &&
(!i.properties().linkedToSeries || !i.properties().linkedToSeries.value()))
) {
(this.m_mainDataSource = i), (e = !0);
break;
}
if (this.m_mainDataSource && e) {
for (o = [], t = 0; t < this.m_dataSources.length; t++)
(i = this.m_dataSources[t]), TradingView.isInherited(i.constructor, r) && o.push(i);
for (o = n.sortSources(o), t = 0; t < o.length; t++)
this.move(o[t], this.m_mainDataSource.priceScale(), !0);
} else if (
!this.m_mainDataSource ||
(this.isOverlay(this.m_mainDataSource) && 0 === this.nonOverlayPricesSourcesCount())
)
for (t = 0; t < this.m_dataSources.length; t++)
if (
((i = this.m_dataSources[t]),
TradingView.isInherited(i.constructor, a) &&
this.isOverlay(i) &&
i.showInObjectTree())
) {
for (
this.m_mainDataSource = i,
this.m_rightPriceScale.addDataSource(i),
i.setPriceScale(this.m_rightPriceScale),
s = this._model.children(i),
c = 0;
c < s.length;
c++
)
(l = s[c]),
this.m_rightPriceScale.addDataSource(l),
l.setPriceScale(this.m_rightPriceScale),
(l._isOverlay = !1);
this.recalculatePriceScale(this.m_rightPriceScale), (i._isOverlay = !1);
break;
}
}),
(n.prototype._newZOrderForLineTool = function() {
var e,
t,
i,
n = null;
for (e = 0; e < this.m_dataSources.length; ++e)
(t = this.m_dataSources[e]) instanceof r &&
((i = t.zorder()), (null === n || i > n) && (n = i));
return (
null === n && (n = this.getZOrderMinMax().minZOrder - 1),
this.m_dataSources.forEach(function(e) {
e.zorder() > n && e.setZorder(e.zorder() + 1);
}),
n + 1
);
}),
(n.prototype.beginInsertManyLineDataSources = function() {
(this._isInInsertManyDataSourcesState = !0), (this._lastLineDataSourceZOrder = null);
}),
(n.prototype.endInsertManyLineDataSources = function() {
(this._isInInsertManyDataSourcesState = !1), (this._lastLineDataSourceZOrder = null);
}),
(n.prototype.addDataSource = function(e, t, i) {
var n;
e instanceof r && !i
? ((n =
null !== this._lastLineDataSourceZOrder
? this._lastLineDataSourceZOrder
: this._newZOrderForLineTool()),
this._isInInsertManyDataSourcesState && (this._lastLineDataSourceZOrder = n))
: (n = this.getZOrderMinMax().minZOrder - 1),
this.insertDataSource(e, t, n);
}),
(n.prototype.insertDataSource = function(e, t, i) {
var o, r, s;
this.m_dataSources.push(e),
(o = !1),
e === this._model.mainSeries()
? ((this.m_mainDataSource = e), (o = !0))
: null === this.m_mainDataSource && ((this.m_mainDataSource = e), (o = !0)),
(e._isOverlay = !1),
null !== t ||
e.preferNoScale() ||
this.canHaveMoreNoScaleSources() ||
(t = this.rightPriceScale()),
null === t &&
((r = this.m_rightPriceScale.topMargin()),
(s = this.m_rightPriceScale.bottomMargin()),
e.metaInfo && 'Volume@tv-basicstudies' === e.metaInfo().id && ((r = 0.75), (s = 0)),
(t = new c(this._model.properties().scalesProperties)),
t.setHeight(this.m_height),
t.setTopMargin(r),
t.setBottomMargin(s),
(e._isOverlay = !0)),
t.addDataSource(e, this._isInInsertManyDataSourcesState),
e.setPriceScale(t),
e.onTagsChanged && e.onTagsChanged().subscribe(this, n.prototype.onSourceTagsChanged),
e.setZorder(i),
o && this._processMainSourceChange(),
this._tagsChanged.fire(),
TradingView.isInherited(e.constructor, a) && this.recalculatePriceScale(t),
this.invalidateSourcesCache();
}),
(n.prototype.removeDataSource = function(e, t) {
var i,
o = this.m_dataSources.indexOf(e);
if (-1 === o) return void l.logDebug('removeDataSource: invalid data source');
(e._isOverlay = !1),
this.m_dataSources.splice(o, 1),
e !== this.m_mainDataSource || t || (this.m_mainDataSource = null),
(i = null),
-1 !== this.m_leftPriceScale.dataSources().indexOf(e)
? (this.m_leftPriceScale.removeDataSource(e), (i = this.m_leftPriceScale))
: -1 !== this.m_rightPriceScale.dataSources().indexOf(e) &&
(this.m_rightPriceScale.removeDataSource(e), (i = this.m_rightPriceScale)),
e.onTagsChanged &&
e.onTagsChanged().unsubscribe(this, n.prototype.onSourceTagsChanged),
TradingView.isInherited(e.constructor, a) && this._processMainSourceChange(),
this._tagsChanged.fire(),
i && TradingView.isInherited(e.constructor, a) && this.recalculatePriceScale(i),
this.invalidateSourcesCache();
}),
(n.prototype.startScalePrice = function(e, t) {
e.startScale(t);
}),
(n.prototype.scalePriceTo = function(e, t) {
e.scaleTo(t), this.updateAllViews();
}),
(n.prototype.endScalePrice = function(e) {
e.endScale();
}),
(n.prototype.startScrollPrice = function(e, t) {
e.startScroll(t);
}),
(n.prototype.scrollPriceTo = function(e, t) {
e.scrollTo(t), this.updateAllViews();
}),
(n.prototype.endScrollPrice = function(e) {
e.endScroll();
}),
(n.prototype.setPriceAutoScale = function(e, t) {
if ((e.setMode({ autoScale: t }), this.timeScale().isEmpty()))
return void e.setPriceRange(null);
this.recalculatePriceScale(e);
}),
(n.prototype.restorePriceScaleState = function(e, t) {
e.restoreState(t), this.updateAllViews();
}),
(n.prototype.updateAllViews = function() {
for (var e = 0; e < this.m_dataSources.length; e++)
this.m_dataSources[e].updateAllViews();
}),
(n.prototype.defaultPriceScale = function() {
var e = this.m_mainDataSource
? this.m_mainDataSource.priceScale()
: this.rightPriceScale();
return void 0 === e && (e = new c(this._model.properties().scalesProperties)), e;
}),
(n.prototype._priceScaleIsPrice = function(e) {
var t = e.mainSource();
return (
!!t &&
(!!TradingView.isInherited(t.constructor, TradingView.Series) ||
(!!TradingView.isInherited(t.constructor, TradingView.Study) &&
t.metaInfo().is_price_study))
);
}),
(n.prototype.findSuitableScale = function(e) {
if (
TradingView.isInherited(e.constructor, TradingView.Study) &&
'Volume@tv-basicstudies' === e.metaInfo().id
)
return this.m_rightPriceScale.mainSource() || this.m_leftPriceScale.mainSource()
? null
: this.m_rightPriceScale;
var t = !1;
if (
(TradingView.isInherited(e.constructor, TradingView.Study)
? (t = e.metaInfo().is_price_study)
: TradingView.isInherited(e.constructor, TradingView.Series) && (t = !0),
t)
) {
if (this._priceScaleIsPrice(this.m_rightPriceScale)) return this.m_rightPriceScale;
if (this._priceScaleIsPrice(this.m_leftPriceScale)) return this.m_leftPriceScale;
}
return this.m_rightPriceScale.mainSource()
? this.m_leftPriceScale.mainSource()
? null
: this.m_leftPriceScale
: this.m_rightPriceScale;
}),
(n.prototype.mainDataSource = function() {
return this.m_mainDataSource;
}),
(n.prototype.recalculatePriceScale = function(e) {
var t, i;
e &&
((t = e.sourcesForAutoscale()),
e.isAutoScale() &&
t &&
t.length > 0 &&
!this.timeScale().isEmpty() &&
((i = this.timeScale().visibleBars()), e.recalculatePriceRange(i)),
e.updatePaneViews());
}),
(n.prototype.resetPriceScale = function(e) {
var t = this.timeScale().visibleBars();
e.isLockScale() || e.setMode({ autoScale: !0 }),
e.recalculatePriceRange(t),
this.updateAllViews();
}),
(n.prototype.recalculate = function() {
var e, t;
for (
this.recalculatePriceScale(this.m_rightPriceScale),
this.recalculatePriceScale(this.m_leftPriceScale),
e = 0;
e < this.m_dataSources.length;
e++
)
(t = this.m_dataSources[e]),
!this.isOverlay(t) || t instanceof r || this.recalculatePriceScale(t.priceScale());
this.updateAllViews(), this._model.updatePane(this);
}),
(n.prototype.isEmpty = function() {
return null === this.m_mainDataSource;
}),
(n.prototype.move = function(e, t, i) {
var n = this.m_dataSources.slice(),
o = null !== t;
this.removeDataSource(e, o),
this.addDataSource(e, t, i),
(this.m_dataSources = n),
this.invalidateSourcesCache();
}),
(n.prototype.dataSourceForId = function(e) {
for (var t = 0; t < this.m_dataSources.length; t++)
if (this.m_dataSources[t].id() === e) return this.m_dataSources[t];
return null;
}),
(n.prototype.priceScaleForSource = function(e) {
return -1 !==
this.rightPriceScale()
.dataSources()
.indexOf(e)
? this.rightPriceScale()
: -1 !==
this.leftPriceScale()
.dataSources()
.indexOf(e)
? this.leftPriceScale()
: null;
}),
(n.prototype.sourceById = function(e) {
for (var t = 0; t < this.m_dataSources.length; t++)
if (this.m_dataSources[t].id() === e) return this.m_dataSources[t];
return null;
}),
(n.prototype.containsMainSeries = function() {
return -1 !== this.m_dataSources.indexOf(this._model.mainSeries());
}),
(n.prototype.priceScaleByName = function(e) {
return 'left' === e
? this.m_leftPriceScale
: 'right' === e
? this.m_rightPriceScale
: null;
}),
(n.prototype.priceScaleName = function(e) {
return e === this.m_leftPriceScale
? 'left'
: e === this.m_rightPriceScale
? 'right'
: '';
}),
(n.prototype.hitTestSources = function() {
var e, t, i, n, o;
if (this._cachedHitTestSources) return this._cachedHitTestSources;
for (
e = this.orderedSources(), t = [], i = [this._model.crossHairSource()], n = 0;
n < e.length;
n++
)
(o = e[n]), TradingView.isInherited(o.constructor, r) ? t.push(o) : i.push(o);
return (this._cachedHitTestSources = i.concat(t)), this._cachedHitTestSources;
}),
(n.prototype.orderedSources = function() {
var e, t, i, o;
if (this._cachedOrderedSoruces) return this._cachedOrderedSoruces;
for (e = [], t = 0, i = this.m_dataSources.length; t < i; t++)
(o = this.m_dataSources[t]),
(TradingView.isInherited(o.constructor, r) && !o.isActualSymbol()) || e.push(o);
return (e = n.sortSources(e)), (this._cachedOrderedSoruces = e), e;
}),
(n.prototype.createDrawingsCaches = function() {
o.recreateOrderedByBarsSourcesCache(this);
}),
(n.prototype.clearDrawingCaches = function() {
o.clearOrderedByBarsSourcesCache();
}),
(n.prototype.invalidateSourcesCache = function() {
(this._cachedOrderedSoruces = null),
(this._cachedHitTestSources = null),
this.m_leftPriceScale.invalidateSourcesCache(),
this.m_rightPriceScale.invalidateSourcesCache();
}),
(n.prototype.getZOrderMinMax = function() {
var e,
t,
i,
n,
o = this.orderedSources();
if (0 === o.length) return { minZOrder: 0, maxZOrder: 0 };
for (e = o[0].zorder(), t = o[0].zorder(), i = 1; i < o.length; i++)
(n = o[i]), n.zorder() < e && (e = n.zorder()), n.zorder() > t && (t = n.zorder());
return { minZOrder: e, maxZOrder: t };
}),
(n.prototype.isZOrderAvailable = function(e) {
var t, i;
for (t = 0; t < this.m_dataSources.length; t++)
if (((i = this.m_dataSources[t]), i.zorder() === e)) return !1;
return !0;
}),
(n.prototype.sendToBack = function(e) {
var t,
i = this.getZOrderMinMax().minZOrder,
n = Math.abs(e.zorder() - i);
for (t = 0; t < n; t++) this.changeZOrder(e, -1);
}),
(n.prototype.bringToFront = function(e) {
var t,
i = this.getZOrderMinMax().maxZOrder,
n = Math.abs(e.zorder() - i);
for (t = 0; t < n; t++) this.changeZOrder(e, 1);
}),
(n.prototype.changeZOrder = function(e, t) {
var i,
n,
o,
r,
s,
a = this.orderedSources().filter(function(e) {
return e.showInObjectTree();
}),
l = 0;
for (i = 0, n = a.length; i < n; i++)
if (a[i] === e) {
l = i;
break;
}
l > 0 && t < 0
? ((o = a[l - 1].zorder()), (r = e.zorder()), a[l - 1].setZorder(r), e.setZorder(o))
: l < a.length - 1 &&
t > 0 &&
((s = a[l + 1].zorder()), (r = e.zorder()), a[l + 1].setZorder(r), e.setZorder(s)),
this.invalidateSourcesCache();
}),
(n.prototype.onSourceTagsChanged = function() {
this._tagsChanged.fire();
}),
(n.prototype.onTagsChanged = function() {
return this._tagsChanged;
}),
(n.prototype.onDestroyed = function() {
return this._destroyed;
}),
(n.prototype.dumpPriceScale = function(e) {
var t,
i,
n,
o = e.dataSources(),
r = [];
for (t = 0; t < o.length; t++)
if ((i = o[t].priceAxisViews(this, e)))
for (n = 0; n < i.length; n++) r.push(i[n].dump());
return r;
}),
(n.prototype.dumpViews = function() {
var e,
t,
i,
n,
o,
r = {};
for (r.paneViews = {}, e = this.orderedSources(), t = 0; t < e.length; t++)
if (((i = e[t]), (r.paneViews[t] = []), (n = i.paneViews())))
for (o = 0; o < n.size(); o++) r.paneViews[t].push(n.item(t).dump());
return (
(r.leftAxis = this.dumpPriceScale(this.m_leftPriceScale)),
(r.rightAxis = this.dumpPriceScale(this.m_rightPriceScale)),
r
);
}),
(n.prototype.clearSeries = function() {
for (var e = this.m_dataSources.length - 1; e >= 0; e--)
TradingView.isInherited(this.m_dataSources[e].constructor, TradingView.Series) &&
this.m_dataSources.splice(e, 1);
}),
(n.prototype.nonOverlayPricesSourcesCount = function() {
return this.m_dataSources.filter(function(e) {
return (
(!e.properties().linkedToSeries || !e.properties().linkedToSeries.value()) &&
TradingView.isInherited(e.constructor, a) &&
e.showInObjectTree() &&
!e.isNoScale()
);
}).length;
}),
(n.prototype.canHaveMoreNoScaleSources = function() {
return this.nonOverlayPricesSourcesCount() > 1;
}),
(n.prototype.actionNoScaleIsEnabled = function(e) {
return (
!(!this.isOverlay(e) && TradingView.isInherited(e.constructor, a)) ||
this.canHaveMoreNoScaleSources()
);
}),
(n.prototype.executionsPositionController = function() {
return (
this._executionsPositionController ||
(this._executionsPositionController = new o(this, this._model.timeScale())),
this._executionsPositionController
);
}),
(n.prototype.isLast = function() {
var e = this._model.panes();
return e[e.length - 1] === this;
}),
(n.prototype.setMaximized = function(e) {
this._maximized = e;
}),
(n.prototype.isMaximized = function() {
return this._maximized;
}),
(n.prototype.isMainPane = function() {
var e = this._model.mainSeries(),
t = !1;
return (
this.m_dataSources.forEach(function(i) {
t || (t = i === e);
}),
(this._isMainPane = t),
t
);
}),
(n.prototype.properties = function() {
return this._properties;
}),
(n.prototype._mainSourceVisiblePriceRange = function(e) {
var t = this.m_timeScale.visibleBars();
return null !== t
? e.mainSource().priceRange(t.firstBar(), t.lastBar())
: new s(-0.5, 0.5);
}),
(n.prototype.applyLeftPriceScaleRatio = function(e) {
this._lastLeftPriceScaleRatio !== e &&
(this._setNewPriceRangeByScaleRatio(
this.m_leftPriceScale,
e,
this._mainSourceVisiblePriceRange(this.m_leftPriceScale),
!0,
!0,
),
this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale, this.m_leftPriceScale)));
}),
(n.prototype.applyRightPriceScaleRatio = function(e) {
this._lastRightPriceScaleRatio !== e &&
(this._setNewPriceRangeByScaleRatio(
this.m_rightPriceScale,
e,
this._mainSourceVisiblePriceRange(this.m_rightPriceScale),
!0,
!0,
),
this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale, this.m_rightPriceScale)));
}),
(n.prototype.isLeftPriceScaleLocked = function() {
return !this.m_leftPriceScale.isLog() && this.m_leftPriceScale.isLockScale();
}),
(n.prototype.isRightPriceScaleLocked = function() {
return !this.m_rightPriceScale.isLog() && this.m_rightPriceScale.isLockScale();
}),
(n.prototype.leftPriceScaleRatio = function() {
return (
null === this._lastLeftPriceScaleRatio &&
(this._lastLeftPriceScaleRatio = h(this.m_timeScale, this.m_leftPriceScale)),
this._lastLeftPriceScaleRatio
);
}),
(n.prototype.rightPriceScaleRatio = function() {
return (
null === this._lastRightPriceScaleRatio &&
(this._lastRightPriceScaleRatio = h(this.m_timeScale, this.m_rightPriceScale)),
this._lastRightPriceScaleRatio
);
}),
(n.prototype._mainSeriesPaneScaleRatioOnChange = function() {
this.isMainPane() &&
((this._lastLeftPriceScaleRatio = null),
(this._lastRightPriceScaleRatio = null),
this._model.mainSeriesScaleRatioPropertyOnChanged());
}),
(n.prototype._applyOldScaleRatioToPriceScale = function(e, t) {
if (this._isRecalculatingScales || null === t || void 0 === t) return !1;
(this._isRecalculatingScales = !0),
this._setNewPriceRangeByScaleRatio(e, t, this._mainSourceVisiblePriceRange(e)),
(this._isRecalculatingScales = !1);
}),
(n.prototype._applyOldScaleRatioToTimeScale = function(e, t) {
if (this._isRecalculatingScales || null === t || void 0 === t) return !1;
(this._isRecalculatingScales = !0),
this._setNewBarSpacingByScaleRatio(e, t),
(this._isRecalculatingScales = !1);
}),
(n.prototype._tryToApplyNewLeftPriceScaleRatio = function(e) {
if (this._lastLeftPriceScaleRatio === e || this.m_leftPriceScale.isLog()) return !1;
this._leftPriceScaleRatioChanged.fire(this._lastLeftPriceScaleRatio, e),
(this._lastLeftPriceScaleRatio = e);
}),
(n.prototype._tryToApplyNewRightPriceScaleRatio = function(e) {
if (this._lastRightPriceScaleRatio === e || this.m_rightPriceScale.isLog()) return !1;
this._rightPriceScaleRatioChanged.fire(this._lastRightPriceScaleRatio, e),
(this._lastRightPriceScaleRatio = e);
}),
(n.prototype._recalculatePriceScaleByScaleRatio = function() {
this.isMainPane() &&
(this.m_leftPriceScale.mainSource() &&
(this.isLeftPriceScaleLocked() && null !== this._lastLeftPriceScaleRatio
? this._applyOldScaleRatioToPriceScale(
this.m_leftPriceScale,
this._lastLeftPriceScaleRatio,
)
: this._tryToApplyNewLeftPriceScaleRatio(
h(this.m_timeScale, this.m_leftPriceScale),
)),
this.m_rightPriceScale.mainSource() &&
(this.isRightPriceScaleLocked() && null !== this._lastRightPriceScaleRatio
? this._applyOldScaleRatioToPriceScale(
this.m_rightPriceScale,
this._lastRightPriceScaleRatio,
)
: this._tryToApplyNewRightPriceScaleRatio(
h(this.m_timeScale, this.m_rightPriceScale),
)));
}),
(n.prototype._recalculateTimeScaleByLeftScaleRatio = function() {
this.isLeftPriceScaleLocked() && null !== this._lastLeftPriceScaleRatio
? this._applyOldScaleRatioToTimeScale(
this.m_leftPriceScale,
this._lastLeftPriceScaleRatio,
)
: this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale, this.m_leftPriceScale));
}),
(n.prototype._recalculateTimeScaleByRightScaleRatio = function() {
this.isRightPriceScaleLocked() && null !== this._lastRightPriceScaleRatio
? this._applyOldScaleRatioToTimeScale(
this.m_rightPriceScale,
this._lastRightPriceScaleRatio,
)
: this._tryToApplyNewRightPriceScaleRatio(
h(this.m_timeScale, this.m_rightPriceScale),
);
}),
(n.prototype._setNewPriceRangeByScaleRatio = function(e, t, i, n, o) {
var r = u(e, this.m_timeScale.barSpacing(), t);
e.setPriceRange(null !== r ? r : i, n, o);
}),
(n.prototype._setMinMaxPriceRange = function(e, t) {
var i = u(e, this.m_timeScale.maxBarSpacing(), t),
n = u(e, this.m_timeScale.minBarSpacing(), t);
null !== i && e.setMaxPriceRange(i), null !== n && e.setMinPriceRange(n);
}),
(n.prototype._onLeftPriceScaleSetMinMaxPriceRange = function() {
this._setMinMaxPriceRange(this.m_leftPriceScale, this._lastLeftPriceScaleRatio);
}),
(n.prototype._onRightPriceScaleSetMinMaxPriceRange = function() {
this._setMinMaxPriceRange(this.m_rightPriceScale, this._lastRightPriceScaleRatio);
}),
(n.prototype._setNewBarSpacingByScaleRatio = function(e, t) {
var i = this.m_timeScale.getValidBarSpacing(d(e, t));
this.m_timeScale.isValidBarSpacing(i) && this.m_timeScale.setBarSpacing(i);
}),
(n.prototype._onPriceScaleModeChanged = function(e, t, i) {
if (t.percentage !== i.percentage || t.indexedTo100 !== i.indexedTo100) {
var n = this.timeScale().visibleBars();
null !== n && (e.recalculatePriceRange(n), e.updatePaneViews());
}
}),
(t.Pane = n);
}.call(t, i(8)));
},
function(e, t, i) {
'use strict';
(function(e, n) {
function o(e, t) {
return t < 0 && (e = -e), (e / 100) * t + t;
}
function r(e, t) {
var i = (100 * (e - t)) / t;
return t < 0 ? -i : i;
}
function s(e, t) {
var i = r(e.minValue(), t),
n = r(e.maxValue(), t);
return new S(i, n);
}
function a(e, t) {
return (e -= 100), t < 0 && (e = -e), (e / 100) * t + t;
}
function l(e, t) {
var i = (100 * (e - t)) / t + 100;
return t < 0 ? -i : i;
}
function c(e, t) {
var i = l(e.minValue(), t),
n = l(e.maxValue(), t);
return new S(i, n);
}
function h(e, t) {
if (
((this.m_base = e),
(this.m_integralDividers = t),
(this.m_fractionalDividers = []),
_.isBaseDecimal(this.m_base))
)
this.m_fractionalDividers = [2, 2.5, 2];
else
for (var i = this.m_base; 1 !== i; ) {
if (i % 2 == 0) this.m_fractionalDividers.push(2), (i /= 2);
else {
if (i % 5 != 0) throw new RangeError('unexpected base');
this.m_fractionalDividers.push(2), this.m_fractionalDividers.push(2.5), (i /= 5);
}
if (this.m_fractionalDividers.length > 100) throw Error('something wrong with base');
}
}
function u(e, t, i, n) {
(this.m_marks = []),
(this.m_base = t),
(this.m_priceScale = e),
(this._currentFormatBase = 0),
(this._coordinateToLogicalFunc = i),
(this._logicalToCoordinateFunc = n);
}
function d(t, i) {
var o;
(i = Object.assign({}, p, i)),
(this._properties = new e(i)),
(this._scalesProperties = t),
(this.m_height = 0),
(this._internalHeightCache = null),
(this._internalHeightChanged = new n()),
(this.m_priceRange = null),
(this._priceRangeChanged = new n()),
(this.m_dataSources = []),
(this.m_topMargin = 0),
(this.m_bottomMargin = 0),
(this._studyTopMargin = 0),
(this._studyBottomMargin = 0),
(this.m_scrollStartPoint = null),
(this.m_scaleStartPoint = null),
(this.m_maxPriceRange = null),
(this.m_minPriceRange = null),
(this.m_priceRangeSnapshot = null),
(this._invalidatedForRange = { isValid: !0 }),
(this.onMarksChanged = new n()),
(o = this),
(this._coordinateToLogicalFunc = function(e, t) {
return o._coordinateToLogical(e, t);
}),
(this._logicalToCoordinateFunc = function(e, t, i) {
return o._logicalToCoordinate(e, t, i);
}),
(this.m_markBuilder = new u(
this,
100,
this._coordinateToLogicalFunc,
this._logicalToCoordinateFunc,
)),
(this._modeChanged = new n()),
(this._sourcesForAutoscale = null),
(this._sourcesToUpdateViews = null),
(this._hasSeries = !1),
(o = this),
this._properties.listeners().subscribe(null, function() {
o.mainSource() &&
o.mainSource().model() &&
o
.mainSource()
.model()
.fullUpdate();
}),
this._scalesProperties.listeners().subscribe(this, function() {
this._marksCache = null;
});
}
var p,
_ = i(50),
f = i(0).LineDataSource,
m = i(28).PriceDataSource,
y = i(63).Series,
g = i(21).PriceFormatter,
v = i(70).PercentageFormatter,
S = i(48).PriceRange;
(h.prototype.TICK_SPAN_EPSILON = 1e-9),
(h.prototype.tickSpan = function(e, t, i) {
var n,
o = 0 === this.m_base ? 0 : 1 / this.m_base,
r = this.TICK_SPAN_EPSILON,
s = Math.pow(10, Math.max(0, Math.ceil(_.log10(e - t)))),
a = 0;
for (
a = 0, n = this.m_integralDividers[0];
s > o + r &&
_.greaterOrEqual(s, o, r) &&
_.greaterOrEqual(s, i * n, r) &&
_.greaterOrEqual(s, 1, r);
++a, n = this.m_integralDividers[a % this.m_integralDividers.length]
)
s /= n;
if (
(s <= o + r && (s = o),
(s = Math.max(1, s)),
this.m_fractionalDividers.length > 0 && _.equal(s, 1, r))
)
for (
a = 0, n = this.m_fractionalDividers[0];
s > o + r && _.greaterOrEqual(s, i * n, r);
++a, n = this.m_fractionalDividers[a % this.m_fractionalDividers.length]
)
s /= n;
return s;
}),
(u.prototype.TICK_DENSITY = 2.5),
(u.prototype.base = function() {
return this.m_base;
}),
(u.prototype.setBase = function(e) {
if (e < 0) throw new RangeError('base < 0');
this.m_base = e;
}),
(u.prototype.fontHeight = function() {
return this.m_priceScale.fontSize();
}),
(u.prototype.tickSpan = function(e, t) {
var i, n, o, r, s, a, l;
if (e < t) throw new RangeError('high < low');
return (
(i = this.m_priceScale.height()),
(n = this.tickMarkHeight()),
(o = ((e - t) * n) / i),
(r = new h(this.m_base, [2, 2.5, 2])),
(s = new h(this.m_base, [2, 2, 2.5])),
(a = new h(this.m_base, [2.5, 2, 2])),
(l = []),
l.push(r.tickSpan(e, t, o)),
l.push(s.tickSpan(e, t, o)),
l.push(a.tickSpan(e, t, o)),
_.min(l)
);
}),
(u.prototype.tickMarkHeight = function() {
return Math.ceil(this.fontHeight() * this.TICK_DENSITY);
}),
(u.prototype.rebuildTickMarks = function() {
var e,
t,
i,
n,
o,
r,
s,
a,
l,
c,
h,
u,
d = this.m_priceScale;
if (null === d) throw new TypeError('scale is null');
if (d.isEmpty()) return void (this.m_marks = []);
if (null === (e = d.mainSource())) return void (this.m_marks = []);
if (
((t = e.firstValue()),
(i = d.height()),
(n = this._coordinateToLogicalFunc(i - 1, t)),
(o = this._coordinateToLogicalFunc(0, t)),
(o = Math.max(o, n)),
(n = Math.min(o, n)),
o !== n)
)
for (
r = this.tickSpan(o, n),
s = o % r,
s += s < 0 ? r : 0,
this.m_marks = [],
a = o >= n ? 1 : -1,
l = null,
c = d.formatter(),
h = o - s;
h > n;
h -= r
)
(u = this._logicalToCoordinateFunc(h, t, !0)),
(null !== l && Math.abs(u - l) < this.tickMarkHeight()) ||
(this.m_marks.push({ coord: Math.round(u), label: c.format(h) }),
(l = u),
d.isLog() && (r = this.tickSpan(h * a, n)));
}),
(u.prototype.marks = function() {
return this.m_marks;
}),
(p = {
autoScale: !0,
autoScaleDisabled: !1,
lockScale: !1,
percentage: !1,
percentageDisabled: !1,
log: !1,
logDisabled: !1,
alignLabels: !0,
indexedTo100: !1,
}),
(d.prototype.initScaleProperties = function() {
var e = this.isLockScale();
e &&
(this.properties().percentage.setValue(!1),
this.properties().indexedTo100.setValue(!1),
this.properties().log.setValue(!1),
this.properties().autoScale.setValue(!1)),
this.properties().percentageDisabled.setValue(e),
this.properties().logDisabled.setValue(e),
this.properties().autoScaleDisabled.setValue(
this.properties().percentage.value() || this.properties().indexedTo100.value(),
),
this.properties().percentage.value() &&
(this.properties().log.setValue(!1), this.properties().indexedTo100.setValue(!1)),
this.properties().indexedTo100.value() &&
(this.properties().log.setValue(!1), this.properties().percentage.setValue(!1));
}),
(d.prototype.isAutoScale = function() {
return this._properties.autoScale.value() && !this.isLockScale();
}),
(d.prototype.isLockScale = function() {
return this._properties.lockScale.value();
}),
(d.prototype.isLog = function() {
return this._properties.log.value();
}),
(d.prototype.isPercentage = function() {
return this._properties.percentage.value();
}),
(d.prototype.isIndexedTo100 = function() {
return this._properties.indexedTo100.value();
}),
(d.prototype._convertPriceRangeFromLog = function(e) {
var t, i;
return null === e
? null
: ((t = this._fromLog(e.minValue())), (i = this._fromLog(e.maxValue())), new S(t, i));
}),
(d.prototype._convertPriceRangeToLog = function(e) {
var t, i;
return null === e
? null
: ((t = this._toLog(e.minValue())), (i = this._toLog(e.maxValue())), new S(t, i));
}),
(d.prototype._canConvertPriceRangeFromLog = function(e) {
var t, i;
return (
null !== e &&
((t = this._fromLog(e.minValue())),
(i = this._fromLog(e.maxValue())),
isFinite(t) && isFinite(i))
);
}),
(d.prototype._setAutoScaleValueWithDependentProperties = function(e) {
!e &&
this._properties.autoScale.value() &&
this._properties.percentage.value() &&
(this._properties.percentage.setValueSilently(e),
this._properties.indexedTo100.setValueSilently(e)),
this._properties.autoScale.setValueSilently(e),
this._properties.lockScale.value() &&
e &&
(this._properties.lockScale.setValueSilently(!1),
this._properties.percentageDisabled.setValueSilently(!1),
this._properties.logDisabled.setValueSilently(!1));
}),
(d.prototype._setLockScaleValueWithDependentProperties = function(e) {
this._properties.lockScale.setValueSilently(e),
e &&
(this._properties.autoScale.setValueSilently(!1),
this._properties.percentage.setValueSilently(!1),
this._properties.indexedTo100.setValueSilently(!1),
this._properties.log.setValueSilently(!1),
this._properties.autoScaleDisabled.setValueSilently(!e)),
this._properties.percentageDisabled.setValueSilently(e),
this._properties.logDisabled.setValueSilently(e);
}),
(d.prototype._setPercentageValueWithDependentProperties = function(e) {
this._properties.percentage.setValueSilently(e),
this._properties.autoScaleDisabled.setValueSilently(e),
e && this._properties.autoScale.setValueSilently(!0),
this._properties.log.value() && e && this._properties.log.setValueSilently(!1),
this._properties.lockScale.value() &&
e &&
this._properties.lockScale.setValueSilently(!1),
this._properties.indexedTo100.value() &&
e &&
this._properties.indexedTo100.setValueSilently(!1);
}),
(d.prototype._setIndexedTo100ValueWithDependentProperties = function(e) {
this._properties.indexedTo100.setValueSilently(e),
this._properties.autoScaleDisabled.setValueSilently(e),
e && this._properties.autoScale.setValueSilently(!0),
this._properties.log.value() && e && this._properties.log.setValueSilently(!1),
this._properties.lockScale.value() &&
e &&
this._properties.lockScale.setValueSilently(!1),
this._properties.percentage.value() &&
e &&
this._properties.percentage.setValueSilently(!1);
}),
(d.prototype._setLogValueWithDependentProperties = function(e) {
this._properties.log.setValueSilently(e),
this._properties.percentage.value() &&
e &&
(this._properties.percentage.setValueSilently(!1),
this._properties.autoScaleDisabled.setValueSilently(!1)),
this._properties.lockScale.value() &&
e &&
this._properties.lockScale.setValueSilently(!1),
this._properties.indexedTo100.value() &&
e &&
this._properties.indexedTo100.setValueSilently(!1);
}),
(d.prototype.mode = function() {
return {
autoScale: this._properties.autoScale.value(),
lockScale: this._properties.lockScale.value(),
percentage: this._properties.percentage.value(),
indexedTo100: this._properties.indexedTo100.value(),
log: this._properties.log.value(),
};
}),
(d.prototype.setMode = function(e) {
var t = {},
i = this.mode(),
n = null;
void 0 !== e.autoScale &&
e.autoScale !== i.autoScale &&
((t.autoScale = e.autoScale),
this._setAutoScaleValueWithDependentProperties(e.autoScale)),
void 0 !== e.lockScale &&
e.lockScale !== i.lockScale &&
((t.lockScale = e.lockScale),
this._setLockScaleValueWithDependentProperties(e.lockScale)),
void 0 !== e.percentage &&
e.percentage !== i.percentage &&
((t.percentage = e.percentage),
this._setPercentageValueWithDependentProperties(e.percentage)),
void 0 !== e.indexedTo100 &&
e.indexedTo100 !== i.indexedTo100 &&
((t.indexedTo100 = e.indexedTo100),
this._setIndexedTo100ValueWithDependentProperties(e.indexedTo100)),
void 0 !== e.log &&
e.log !== i.log &&
((t.log = e.log), this._setLogValueWithDependentProperties(e.log)),
i.log &&
!this._properties.log.value() &&
(this._canConvertPriceRangeFromLog(this.m_priceRange)
? null !== (n = this._convertPriceRangeFromLog(this.m_priceRange)) &&
this.setPriceRange(n)
: this.properties().autoScale.setValue(!0)),
!i.log &&
this._properties.log.value() &&
null !== (n = this._convertPriceRangeToLog(this.m_priceRange)) &&
this.setPriceRange(n),
i.autoScale !== this._properties.autoScale.value() &&
this._properties.autoScale.listeners().fire(this._properties.autoScale),
i.autoScaleDisabled !== this._properties.autoScaleDisabled.value() &&
this._properties.autoScaleDisabled
.listeners()
.fire(this._properties.autoScaleDisabled),
i.lockScale !== this._properties.lockScale.value() &&
this._properties.lockScale.listeners().fire(this._properties.lockScale),
i.percentage !== this._properties.percentage.value() &&
(this._properties.percentage.listeners().fire(this._properties.percentage),
this.updateFormatter()),
i.indexedTo100 !== this._properties.indexedTo100.value() &&
(this._properties.indexedTo100.listeners().fire(this._properties.indexedTo100),
this.updateFormatter()),
i.percentageDisabled !== this._properties.percentageDisabled.value() &&
this._properties.percentageDisabled
.listeners()
.fire(this._properties.percentageDisabled),
i.log !== this._properties.log.value() &&
this._properties.log.listeners().fire(this._properties.log),
i.logDisabled !== this._properties.logDisabled.value() &&
this._properties.logDisabled.listeners().fire(this._properties.logDisabled),
(void 0 === t.log &&
void 0 === t.percentage &&
void 0 === t.lockScale &&
void 0 === t.autoScale &&
void 0 === t.percentage) ||
this._modeChanged.fire(i, this.mode());
}),
(d.prototype.modeChanged = function() {
return this._modeChanged;
}),
(d.prototype.properties = function() {
return this._properties;
}),
(d.prototype.fontSize = function() {
return this._scalesProperties.fontSize.value();
}),
(d.prototype.height = function() {
return this.m_height;
}),
(d.prototype.setHeight = function(e) {
this.m_height !== e &&
((this.m_height = e),
this._invalidateInternalHeightCache(),
(this._marksCache = null));
}),
(d.prototype.topMargin = function() {
return Math.max(this.m_topMargin, this._studyTopMargin);
}),
(d.prototype.setTopMargin = function(e) {
if (!isNumber(e)) throw new TypeError('invalid margin');
if (e < 0 || e > 30) throw new RangeError('invalid margin');
this.m_topMargin !== e &&
((this.m_topMargin = e),
this._invalidateInternalHeightCache(),
(this._marksCache = null));
}),
(d.prototype.bottomMargin = function() {
return Math.max(this.m_bottomMargin, this._studyBottomMargin);
}),
(d.prototype.setBottomMargin = function(e) {
if (!isNumber(e)) throw new TypeError('invalid margin');
if (e < 0 || e > 30) throw new RangeError('invalid margin');
this.m_bottomMargin !== e &&
((this.m_bottomMargin = e),
this._invalidateInternalHeightCache(),
(this._marksCache = null));
}),
(d.prototype.internalHeight = function() {
if (this._internalHeightCache) return this._internalHeightCache;
var e = this.height() * (1 - this.topMargin() - this.bottomMargin());
return (this._internalHeightCache = e), e;
}),
(d.prototype._invalidateInternalHeightCache = function() {
(this._internalHeightCache = null), this._internalHeightChanged.fire();
}),
(d.prototype.internalHeightChanged = function() {
return this._internalHeightChanged;
}),
(d.prototype.priceRange = function() {
return this.makeSureItIsValid(), this.m_priceRange;
}),
(d.prototype.priceRangeChanged = function() {
return this._priceRangeChanged;
}),
(d.prototype.setPriceRange = function(e, t, i) {
var n, o, r;
if (!(e instanceof S)) throw new TypeError('incorrect price range');
return (
(n = this.m_priceRange),
!!(t || (null === n && null !== e) || (null !== n && !n.equals(e))) &&
((o = null !== this.m_maxPriceRange && this.m_maxPriceRange.containsStrictly(e)),
(r = null !== this.m_minPriceRange && e.containsStrictly(this.m_minPriceRange)),
!(this.isLockScale() && !t && (o || r)) &&
((this._marksCache = null),
(this.m_priceRange = e),
void (i || this._priceRangeChanged.fire(n, e))))
);
}),
(d.prototype.isEmpty = function() {
return (
this.makeSureItIsValid(),
0 === this.m_height || !this.m_priceRange || this.m_priceRange.isEmpty()
);
}),
(d.prototype.invertedCoordinate = function(e) {
return this.height() - 1 - e;
}),
(d._logicalOffset = 4),
(d._coordOffset = 1e-4),
(d.prototype._toLog = function(e) {
var t,
i = Math.abs(e);
return i < 1e-8
? 0
: ((t = _.log10(i + d._coordOffset) + d._logicalOffset), e < 0 ? -t : t);
}),
(d.prototype.priceToLogical = function(e) {
return this.isLog() && e ? this._toLog(e) : e;
}),
(d.prototype._fromLog = function(e) {
var t,
i = Math.abs(e);
return i < 1e-8
? 0
: ((t = Math.pow(10, i - d._logicalOffset) - d._coordOffset), e < 0 ? -t : t);
}),
(d.prototype.logicalToPrice = function(e) {
return this.isLog() ? this._fromLog(e) : e;
}),
(d.prototype._logicalToCoordinate = function(e, t, i) {
var n, o;
return (
this.makeSureItIsValid(),
this.isEmpty()
? 0
: ((e = this.priceToLogical(e)),
(n =
this.bottomMargin() * this.height() +
((this.internalHeight() - 1) * (e - this.priceRange().minValue())) /
(this.priceRange().maxValue() - this.priceRange().minValue())),
(o = this.invertedCoordinate(n)),
i ? o : Math.round(o))
);
}),
(d.prototype.priceToCoordinate = function(e, t, i) {
return (
this.isPercentage() ? (e = r(e, t)) : this.isIndexedTo100() && (e = l(e, t)),
this._logicalToCoordinate(e, t, i)
);
}),
(d.prototype.pointsArrayToCoordinates = function(e, t) {
var i, n, o, s, a, c, h, u, d;
if (
(this.makeSureItIsValid(),
(i = this.bottomMargin() * this.height()),
(n = this.priceRange().minValue()),
(o = this.priceRange().maxValue()),
(s = this.internalHeight() - 1),
(a = s / (o - n)),
this.isPercentage())
)
for (c = 0; c < e.length; c++) e[c].y = r(e[c].y, t);
if (this.isIndexedTo100()) for (c = 0; c < e.length; c++) e[c].y = l(e[c].y, t);
if (this.isLog()) for (c = 0; c < e.length; c++) e[c].y = this.priceToLogical(e[c].y);
for (c = 0; c < e.length; c++)
(h = e[c].y),
TradingView.isNaN(h) ||
void 0 === h ||
null === h ||
((u = i + a * (h - n)), (d = this.m_height - 1 - u), (e[c].y = Math.round(d)));
}),
(d.prototype.pricesArrayToCoordinates = function(e, t) {
var i, n, o, s, a, c, h, u, d;
if (
(this.makeSureItIsValid(),
(i = this.bottomMargin() * this.height()),
(n = this.priceRange().minValue()),
(o = this.priceRange().maxValue()),
(s = this.internalHeight() - 1),
(a = s / (o - n)),
this.isPercentage())
)
for (c = 0; c < e.length; c++) e[c] = r(e[c], t);
if (this.isIndexedTo100()) for (c = 0; c < e.length; c++) e[c] = l(e[c], t);
if (this.isLog()) for (c = 0; c < e.length; c++) e[c] = this.priceToLogical(e[c]);
for (c = 0; c < e.length; c++)
void 0 !== (h = e[c]) &&
null !== h &&
((u = i + a * (h - n)), (d = this.m_height - 1 - u), (e[c] = Math.round(d)));
}),
(d.prototype.barPricesToCoordinates = function(e, t) {
var i, n, o, s, a, c, h, u, d, p, _, f;
if (
(this.makeSureItIsValid(),
(i = e),
(n = this.bottomMargin() * this.height()),
(o = this.priceRange().minValue()),
(s = this.priceRange().maxValue()),
(a = this.internalHeight() - 1),
(c = null),
this.isPercentage()
? (c = r)
: this.isIndexedTo100()
? (c = l)
: this.isLog() &&
(c = function(e) {
return e ? this._toLog(e) : e;
}.bind(this)),
null !== c)
)
for (h = 0; h < i.length; h++)
i[h] &&
((i[h].open = c(i[h].open, t)),
(i[h].high = c(i[h].high, t)),
(i[h].low = c(i[h].low, t)),
(i[h].close = c(i[h].close, t)),
i[h].additionalPrice && (i[h].additionalPrice = c(i[h].additionalPrice, t)));
for (u = a / (s - o), h = 0; h < i.length; h++)
(d = i[h]) &&
((p = d.open),
(_ = n + u * (p - o)),
(f = this.m_height - 1 - _),
(d.open = Math.round(f)),
(p = d.high),
(_ = n + u * (p - o)),
(f = this.m_height - 1 - _),
(d.high = Math.round(f)),
(p = d.low),
(_ = n + u * (p - o)),
(f = this.m_height - 1 - _),
(d.low = Math.round(f)),
(p = d.close),
(_ = n + u * (p - o)),
(f = this.m_height - 1 - _),
(d.close = Math.round(f)),
d.additionalPrice &&
((p = d.additionalPrice),
(_ = n + u * (p - o)),
(f = this.m_height - 1 - _),
(d.additionalPrice = Math.round(f))));
}),
(d.prototype._coordinateToLogical = function(e, t) {
var i, n;
return (
this.makeSureItIsValid(),
this.isEmpty()
? 0
: ((i = this.invertedCoordinate(e)),
(n =
this.priceRange().minValue() +
(this.priceRange().maxValue() - this.priceRange().minValue()) *
((i - this.bottomMargin() * this.height()) / (this.internalHeight() - 1))),
this.logicalToPrice(n))
);
}),
(d.prototype.coordinateToPrice = function(e, t) {
var i = this._coordinateToLogical(e, t);
return this.isPercentage() ? (i = o(i, t)) : this.isIndexedTo100() && (i = a(i, t)), i;
}),
(d.prototype.dataSources = function() {
return this.m_dataSources;
}),
(d.prototype.orderedSources = function() {
var e, t, n, o;
if (this._cachedOrderedSoruces) return this._cachedOrderedSoruces;
for (e = [], t = 0; t < this.m_dataSources.length; t++)
(n = this.m_dataSources[t]), null == n.zorder() && n.setZorder(t + 1), e.push(n);
return (
(o = i(176).Pane),
(e = o.sortSources(e)),
(this._cachedOrderedSoruces = e),
this._cachedOrderedSoruces
);
}),
(d.prototype.invalidateSourcesCache = function() {
this._cachedOrderedSoruces = null;
}),
(d.prototype.hasSeries = function() {
return this._hasSeries;
}),
(d.prototype.addDataSource = function(e, t) {
var i, n;
(t || -1 === this.m_dataSources.indexOf(e)) &&
(TradingView.isInherited(e.constructor, y) &&
((i = e.properties()),
!0 !== this._hasSeries &&
(i.lockScale &&
(this.setMode({ lockScale: i.lockScale.value() }),
i.removeProperty('lockScale')),
i.pnfStyle.lockScale && i.pnfStyle.removeProperty('lockScale')),
(this._hasSeries = !0)),
(n = this),
e
.properties()
.visible.listeners()
.subscribe(null, function() {
n._sourcesForAutoscale = null;
}),
this.m_dataSources.push(e),
(this._mainSource = void 0),
(this._sourcesForAutoscale = null),
(this._sourcesToUpdateViews = null),
this.updateFormatter(),
this.initScaleProperties(),
this.invalidateSourcesCache());
}),
(d.prototype.removeDataSource = function(e) {
var t = this.m_dataSources.indexOf(e);
if (-1 === t) throw Error('source is not attached to scale');
this.m_dataSources.splice(t, 1),
TradingView.isInherited(e.constructor, y) && (this._hasSeries = !1),
this.mainSource() || this.setMode({ autoScale: !0 }),
(this._mainSource = void 0),
(this._sourcesForAutoscale = null),
(this._sourcesToUpdateViews = null),
this.updateFormatter(),
this.invalidateSourcesCache();
}),
(d.prototype.isScaled = function() {
return 'number' == typeof this.m_scaleStartPoint;
}),
(d.prototype.startScale = function(e) {
this.isPercentage() ||
this.isIndexedTo100() ||
(null === this.m_scaleStartPoint &&
null === this.m_priceRangeSnapshot &&
(this.isEmpty() ||
((this.m_scaleStartPoint = this.m_height - e),
(this.m_priceRangeSnapshot = this.priceRange().clone()))));
}),
(d.prototype.marks = function() {
return this._marksCache
? this._marksCache
: (this.m_markBuilder.rebuildTickMarks(),
(this._marksCache = this.m_markBuilder.marks()),
this.onMarksChanged.fire(),
this._marksCache);
}),
(d.prototype.setMaxPriceRange = function(e) {
this.m_maxPriceRange = e;
}),
(d.prototype.setMinPriceRange = function(e) {
this.m_minPriceRange = e;
}),
(d.prototype.scaleTo = function(e) {
var t, i;
this.isPercentage() ||
this.isIndexedTo100() ||
(null !== this.m_scaleStartPoint &&
(this.setMode({ autoScale: !1 }),
(e = this.m_height - e),
e < 0 && (e = 0),
(t =
(this.m_scaleStartPoint + 0.2 * (this.m_height - 1)) /
(e + 0.2 * (this.m_height - 1))),
(i = this.m_priceRangeSnapshot.clone()),
(t = Math.max(t, 0.1)),
i.scaleAroundCenter(t),
this.setPriceRange(i)));
}),
(d.prototype.endScale = function() {
this.isPercentage() ||
this.isIndexedTo100() ||
(null !== this.m_scaleStartPoint &&
((this.m_scaleStartPoint = null), (this.m_priceRangeSnapshot = null)));
}),
(d.prototype.startScroll = function(e) {
this.isAutoScale() ||
(null === this.m_scrollStartPoint &&
null === this.m_priceRangeSnapshot &&
(this.isEmpty() ||
((this.m_scrollStartPoint = e),
(this.m_priceRangeSnapshot = this.priceRange().clone()))));
}),
(d.prototype.scrollTo = function(e) {
var t, i, n, o;
this.isAutoScale() ||
(null !== this.m_scrollStartPoint &&
((t = this.priceRange().length() / (this.height() - 1)),
(i = e - this.m_scrollStartPoint),
(n = i * t),
(o = this.m_priceRangeSnapshot.clone()),
o.shift(n),
this.setPriceRange(o, !0),
(this._marksCache = null)));
}),
(d.prototype.endScroll = function() {
this.isAutoScale() ||
(null !== this.m_scrollStartPoint &&
((this.m_scrollStartPoint = null), (this.m_priceRangeSnapshot = null)));
}),
(d.prototype.state = function() {
var e = {};
return (
(e.m_priceRange =
!this.priceRange() || this.isPercentage() || this.isIndexedTo100()
? null
: this.priceRange().serialize()),
(e.m_isAutoScale = this.isAutoScale()),
(e.m_isPercentage = this._properties.percentage.value()),
(e.m_isIndexedTo100 = this._properties.indexedTo100.value()),
(e.m_isLog = this._properties.log.value()),
(e.m_isLockScale = this.isLockScale()),
(e.m_height = this.m_height),
(e.m_topMargin = this.m_topMargin),
(e.m_bottomMargin = this.m_bottomMargin),
e
);
}),
(d.prototype.restoreState = function(e) {
var t,
i = e.m_priceRange;
if (void 0 === i) throw new TypeError('invalid state');
if (void 0 === e.m_isAutoScale) throw new TypeError('invalid state');
(t = { autoScale: e.m_isAutoScale }),
void 0 !== e.m_isPercentage && (t.percentage = e.m_isPercentage),
void 0 !== e.m_isIndexedTo100 && (t.indexedTo100 = e.m_isIndexedTo100),
void 0 !== e.m_isLog && (t.log = e.m_isLog),
void 0 !== e.m_isLockScale && (t.lockScale = e.m_isLockScale),
i
? (i instanceof S || (i = new S(i)), this.setPriceRange(i, !0))
: (this.m_priceRange = null),
void 0 !== e.m_height && this.setHeight(Math.max(0, e.m_height)),
this.setMode(t),
void 0 !== e.m_topMargin && (this.m_topMargin = e.m_topMargin),
void 0 !== e.m_bottomMargin && (this.m_bottomMargin = e.m_bottomMargin),
(this._mainSource = void 0),
(this._scaleSeriesOnly = !1);
}),
(d.prototype.mainSource = function() {
var e, t;
if (void 0 !== this._mainSource) return this._mainSource;
for (e = void 0, t = 0; t < this.m_dataSources.length; t++) {
if (TradingView.isInherited(this.m_dataSources[t].constructor, y)) {
e = this.m_dataSources[t];
break;
}
!e &&
TradingView.isInherited(this.m_dataSources[t].constructor, m) &&
(e = this.m_dataSources[t]);
}
return (this._mainSource = e), this._mainSource || null;
}),
(d.prototype.formatter = function() {
return this._formatter || this.updateFormatter(), this._formatter;
}),
(d.prototype.formatPrice = function(e, t) {
return (
this.isPercentage() ? (e = r(e, t)) : this.isIndexedTo100() && (e = l(e, t)),
this.formatter().format(e)
);
}),
(d.prototype.updateFormatter = function() {
var e, t;
(this._marksCache = null),
(e = this.mainSource()),
(t = 100),
e && (t = e.base()),
(this._formatter = null),
this.isPercentage()
? ((this._formatter = new v()), (t = 100))
: this.isIndexedTo100()
? ((this._formatter = new g(100, 1)), (t = 100))
: (this._formatter = e ? e.formatter() : new g(100, 1)),
(this.m_markBuilder = new u(
this,
t,
this._coordinateToLogicalFunc,
this._logicalToCoordinateFunc,
)),
this.m_markBuilder.rebuildTickMarks();
}),
(d.prototype._recalculateSourcesForAutoscale = function() {
var e, t;
this._mainSource &&
(this._scaleSeriesOnly = this._scalesProperties.scaleSeriesOnly.value()),
(e = this._scaleSeriesOnly && this._hasSeries),
(t = function(t) {
return (
!!(t.properties().visible.value() || t instanceof y) &&
(e
? TradingView.isInherited(t.constructor, y)
: TradingView.isInherited(t.constructor, m))
);
}),
(this._sourcesForAutoscale = this.m_dataSources.filter(t));
}),
(d.prototype.sourcesForAutoscale = function() {
return (
this._mainSource &&
this._scaleSeriesOnly !== this._scalesProperties.scaleSeriesOnly.value() &&
(this._sourcesForAutoscale = null),
this._sourcesForAutoscale || this._recalculateSourcesForAutoscale(),
this._sourcesForAutoscale
);
}),
(d.prototype.recalculatePriceRange = function(e) {
this._invalidatedForRange = { visibleBars: e, isValid: !1 };
}),
(d.prototype.makeSureItIsValid = function() {
this._invalidatedForRange.isValid ||
((this._invalidatedForRange.isValid = !0), this.recalculatePriceRangeImpl());
}),
(d.prototype.recalculatePriceRangeImpl = function() {
var e,
t,
i,
n,
o,
r,
a,
l,
h,
u,
d,
p,
_ = this._invalidatedForRange.visibleBars;
if (null !== _) {
for (
e = null,
t = this.sourcesForAutoscale(),
i = 0,
n = 0,
o = this.isPercentage(),
r = this.isIndexedTo100(),
a = 0;
a < t.length;
a++
)
(l = t[a]),
l.properties().visible.value() &&
((h = _.firstBar()),
(u = _.lastBar()),
(d = l.priceRange(h, u)),
d &&
(o ? (d = s(d, l.firstValue())) : r && (d = c(d, l.firstValue())),
(e = null === e ? d : e.merge(d))),
l.margins &&
((p = l.margins()), (i = Math.max(p[0], i)), (n = Math.max(p[1], n))));
(Math.abs(n - this._studyBottomMargin) > 0.01 ||
Math.abs(i - this._studyTopMargin) > 0.01) &&
((this._studyBottomMargin = n),
(this._studyTopMargin = i),
(this._marksCache = null),
this._invalidateInternalHeightCache()),
e
? (e.minValue() === e.maxValue() &&
(e = new S(e.minValue() - 0.5, e.maxValue() + 0.5)),
this.setPriceRange(e))
: this.m_priceRange || this.setPriceRange(new S(-0.5, 0.5)),
(this._invalidatedForRange.isValid = !0);
}
}),
(d.prototype.sourcesToUpdateViews = function() {
var e, t;
if (!this._sourcesToUpdateViews)
for (this._sourcesToUpdateViews = [], e = 0; e < this.m_dataSources.length; e++)
(t = this.m_dataSources[e]),
(TradingView.isInherited(t.constructor, f) && !t.isActualSymbol()) ||
this._sourcesToUpdateViews.push(t);
return this._sourcesToUpdateViews;
}),
(d.prototype.updatePaneViews = function() {
var e,
t = this.sourcesToUpdateViews();
for (e = 0; e < t.length; e++) t[e].updateAllViews();
}),
(d.prototype.priceRangeInPrice = function() {
var e, t, i, n, o;
return this.isEmpty()
? null
: null === (e = this.mainSource())
? null
: ((t = e.firstValue()),
(i = this.height()),
(n = this.coordinateToPrice(i - 1, t)),
(o = this.coordinateToPrice(0, t)),
{ from: n, to: o });
}),
(t.PriceScale = d);
}.call(t, i(13), i(8)));
},
function(e, t, i) {
'use strict';
var n, o, r, s;
i.d(t, 'a', function() {
return s;
}),
(n = i(6)),
i.n(n),
(o = i(109)),
(r = i(84)),
(s = (function() {
function e(e) {
(this._lineRendererData = {
width: 0,
height: 0,
points: [new n.Point(0, 0)],
color: 'rgba(0, 0, 0, 0)',
linewidth: 1,
linestyle: r.LINESTYLE_SOLID,
visible: !1,
}),
(this._lineRenderer = new o.HorizontalLineRenderer()),
(this._invalidated = !0),
(this._series = e),
(this._model = e.model()),
this._lineRenderer.setData(this._lineRendererData);
}
return (
(e.prototype.update = function() {
this._invalidated = !0;
}),
(e.prototype.renderer = function() {
return (
this._invalidated && (this._updateImpl(), (this._invalidated = !1)),
this._lineRenderer
);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t, i) {
(this.source = e), (this.pane = t), (this._rendererFactory = i);
}
function o(e, t) {
(this._barWidth = e.barWidth),
(this._plates = e.plates),
(this._tooltip = e.tooltip),
(this._model = t);
}
function r() {
(this._layout = []), (this._currentId = void 0), (this.tooltipHovered = !1);
}
var s = i(6).Point,
a = i(60).pointInCircle,
l = i(9).HitTestResult;
(n.prototype.update = function() {}),
(n.prototype.renderer = function() {
return this._rendererFactory(this.source);
}),
(o.prototype.draw = function(e) {
e.save();
for (var t = 0; t < this._plates.length; t++)
if (this._plates[t].highlightByAuthor) {
this._highlightByAuthor = !0;
break;
}
this._plates.forEach(this._drawItem.bind(this, e)),
this._tooltip.draw(
this._plates.map(
function(e) {
return this._plateTransform(e);
}.bind(this),
),
e,
),
this._tooltip.endDraw(),
e.restore();
}),
(o.prototype._drawItem = function(e, t) {
e.save(), this._highlightByAuthor && !t.highlightByAuthor && (e.globalAlpha = 0.4);
var i = this._dotTransform(t);
i.mine ? this._drawTriangle(e, i) : this._drawDot(e, i), e.restore();
}),
(o.prototype._commonTransform = function(e) {
var t = Math.max(1.4 * e.minSize, this._barWidth + 4),
i = e.y + { up: -1, down: 1 }[e.direction] * (t * (e.order + 0.6) + 0.25 * t),
n = TradingView.clone(e.overridedTheme || this.themes[e.theme]);
return (
(n.dotBorderWidth = e.hovered || e.highlightByAuthor ? 4 : 2),
{
id: e.id,
theme: n,
themeName: e.theme,
x: Math.round(e.x + 1),
y: Math.round(i),
pinned: e.pinned,
hovered: e.hovered,
}
);
}),
(o.prototype._dotTransform = function(e) {
var t = this._commonTransform(e);
return (
(t.radius = Math.max(e.minSize / 2, 0.4 * this._barWidth)),
(t.label = e.label),
(t.labelFontColor = e.labelFontColor),
(t.labelFontSize = Math.ceil(Math.max(10, Math.min(t.radius, 20)))),
this._model.updateDotData(e, t)
);
}),
(o.prototype._plateTransform = function(e) {
var t = this._commonTransform(e);
return this._model.updatePlateData(e, t);
}),
(o.THEMES = ['green', 'red', 'neutral', 'yellow', 'blue']),
(o.prototype.themes = {
green: { border: '#78C143', background: '#8DDD54' },
red: { border: '#CC4545', background: '#ED5A5A' },
neutral: { border: '#EAC300', background: '#FFD400' },
yellow: { border: '#EAC300', background: '#FFD400' },
blue: { border: '#047ACE', background: '#0496FF' },
}),
(o.prototype._drawTriangle = function(e, t) {
var i, n, o, r;
(e.strokeStyle = t.theme.border),
(e.fillStyle = t.theme.background),
(e.lineWidth = t.theme.dotBorderWidth),
(i = t),
(n = t.radius),
(o = Math.cos(Math.PI / 6) * n),
(r = Math.sin(Math.PI / 6) * n),
e.translate(i.x, i.y),
'up' === t.direction && e.rotate(Math.PI),
t.public || (e.lineWidth /= 2),
e.beginPath(),
e.moveTo(0, -n),
e.lineTo(o, r),
e.lineTo(-o, r),
e.lineTo(0, -n),
e.closePath(),
e.stroke(),
t.public && e.fill();
}),
(o.prototype._drawDot = function(e, t) {
(e.strokeStyle = t.theme.border),
(e.fillStyle = t.theme.background),
(e.lineWidth = t.theme.dotBorderWidth),
e.beginPath(),
e.arc(t.x, t.y, t.radius, 0, 2 * Math.PI, !0),
e.closePath(),
e.stroke(),
e.fill(),
t.label &&
t.radius > 6 &&
((e.textAlign = 'center'),
(e.textBaseline = 'middle'),
(e.font = 'bold ' + t.labelFontSize + 'px Arial'),
(e.fillStyle = t.labelFontColor),
e.fillText(t.label, t.x, t.y));
}),
(o.prototype.hitTest = function(e) {
var t, i;
for (i = this._plates.length - 1; i >= 0; --i)
if ((t = this._hitTestDot(this._plates[i], e))) return t;
return null;
}),
(o.prototype._hitTestDot = function(e, t) {
var i = this._dotTransform(e),
n = new s(i.x, i.y);
return a(t, n, Math.max(i.radius, 8)) ? new l(l.REGULAR, e) : null;
}),
(r.prototype._createLayout = function() {
throw Error('Child class must override this member');
}),
(r.prototype._updatePlate = function(e) {
throw Error('Child class must override this member');
}),
(r.prototype._getContainer = function(e) {
return (
(this._container && this._context === e) ||
((this._context = e), (this._container = $(e.canvas).parent())),
this._container
);
}),
(r.prototype._plateArrowSize = 14),
(r.prototype.showPlate = function(e, t) {
var i, n, o, r, s, a, l, c;
(this._currentId === e.id &&
this._layout &&
0 !== this._layout.length &&
null != this._layout[0].parentNode) ||
((this._currentId = e.id),
this._createLayout(),
this._getContainer(t).append(this._layout),
(i = this),
this._layout.hover(
function() {
(i.tooltipHovered = !0),
$(this)
.stop(!0)
.fadeTo(0, 1);
},
function() {
i.tooltipHovered = !1;
},
)),
(n = Math.round(e.barWidth / 2)),
n > 15 && (n = 15),
n < 10 && (n = 10),
this._updatePlate(e),
(o = t.canvas.getBoundingClientRect()),
(r = e.x - this._layout.outerWidth() < this._plateArrowSize),
(s = o.width - e.x + Math.round(e.barWidth / 2 + n)),
r && (s -= this._layout.outerWidth() + 2 * this._plateArrowSize),
(a = o.height),
(l = 20),
(c = 10),
this._layout.toggleClass('right', r),
this._layout.css({
top: Math.min(Math.max(e.y, l), a - this._layout.outerHeight() - c),
right: s,
fontSize: n + 'px',
display: 'block',
});
}),
(r.prototype._removeLayout = function() {
this.tooltipHovered || (this._layout.stop(!0), this._layout.remove());
}),
(r.prototype._toggleLayout = function(e) {
this._layout.toggle(e);
}),
(r.prototype.hide = function(e) {
this.tooltipHovered
? this._layout.stop(!0).fadeTo(0, 1)
: this._layout.fadeOut(400, function() {
$(this).remove(), e();
});
}),
(r.prototype.setSource = function(e) {
this.source = e;
}),
(t.BarsMarksContainerPaneView = n),
(t.BarsMarksContainerRenderer = o),
(t.BarMarkTooltip = r);
},
function(e, t, i) {
'use strict';
var n, o, r, s, a, l;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'NonSeriesStudy', function() {
return l;
}),
(n = i(1)),
(o = i(7)),
i.n(o),
(r = i(34)),
i.n(r),
(s = i(18)),
(a = i.n(s)),
(l = (function(e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
n.c(t, e),
(t.prototype.clearData = function() {
(this._customData = null), (this._indexes = null);
}),
(t.prototype.restoreData = function(e, t, i) {
r.Study.prototype.restoreData.call(this, e),
(this._customData = t),
(this._indexes = i);
}),
(t.prototype.state = function(t) {
var i = e.prototype.state.call(this, t);
return t && ((i.nonSeriesData = this._customData), (i.indexes = this._indexes)), i;
}),
(t.prototype.customData = function() {
return this._customData;
}),
(t.prototype._setPaneViews = function(e) {
(this._paneViews = e), this.model().invalidate(new a.a(a.a.LIGHT_UPDATE));
}),
(t.prototype._onDataUpdated = function(t, i, n) {
null !== i &&
(i.indexes_replace
? (Object(o.assert)('nochange' !== n), (this._indexes = n))
: ((this._customData = i.data), 'nochange' !== n && (this._indexes = n))),
e.prototype._onDataUpdated.call(this, t, i, n);
}),
t
);
})(r.Study)),
(l.prototype.superclass = r.Study);
},
function(e, t, i) {
function n(e, t, i, s, a) {
if (!i) return void r.logDebug('Missed undo model');
o.call(this, e, t, !0, i, s),
a
? e.callbacks().subscribe(this, a)
: e.callbacks().subscribe(this, n.prototype.onActionCallback);
}
var o = i(317).Binding,
r = i(4).getLogger('Chart.PropertyPage.ActionBinder');
inherit(n, o),
(n.prototype.onActionCallback = function(e) {
this._undoModel.setProperty(this._property, this.value(), this._undoText);
}),
(n.prototype.value = function() {
return this.control().checked;
}),
(n.prototype.setValue = function(e) {
return (this.control().checked = !!e);
}),
(t.ActionBinder = n);
},
function(e, t, i) {
'use strict';
var n = (function() {
function e(e) {
switch (e) {
case 'c67':
case 'm67':
case 'c45':
return 'copy';
case 'c86':
case 'm86':
case 's45':
return 'paste';
case 'c88':
case 'm88':
case 's46':
return 'cut';
}
}
function t(e) {
var t = [];
return (
e.shiftKey && t.push('s'),
e.ctrlKey && t.push('c'),
e.metaKey && t.push('m'),
e.altKey && t.push('a'),
t.push(e.keyCode),
t.join('')
);
}
function i(e) {
var t = $.Event(u + ':' + e);
return $(window).trigger(t, { AppClipboard: _ }), t;
}
function n(n) {
var o, r, s;
if (
(document.activeElement === document.body ||
document.activeElement === document.documentElement) &&
((o = t(n)), (r = e(o)))
) {
if ('keydown' === n.type) d[o] = !0;
else if (d[o]) return;
if (document.getSelection) {
if (!document.getSelection().isCollapsed) return;
} else if (document.selection && 'None' !== document.selection.type) return;
n.isDefaultPrevented() || ((s = i(r)), s.isDefaultPrevented() && n.preventDefault());
}
}
function o(e) {
(e = e.originalEvent || e), e.key === h && i('change');
}
function r() {
p || ($(document).on('keypress keydown', n), $(window).on('storage', o), (p = !0));
}
function s() {
$(document).off('keypress keydown', n),
$(window).off('storage', o),
$(window).off(u + ':copy'),
$(window).off(u + ':paste'),
$(window).off(u + ':cut'),
$(window).off(u + ':change'),
(p = !1);
}
function a() {
try {
return JSON.parse(TVLocalStorage.getItem(h));
} catch (e) {
return null;
}
}
function l(e) {
if (null == e) return c();
var t = JSON.stringify(e);
t !== TVLocalStorage.getItem(h) && (TVLocalStorage.setItem(h, t), i('change'));
}
function c() {
TVLocalStorage.getItem(h) && (TVLocalStorage.removeItem(h), i('change'));
}
var h = 'application-clipboard',
u = 'appclip',
d = {},
p = !1,
_ = { init: r, set: l, get: a, clear: c, destroy: s };
return _;
})();
e.exports = n;
},
function(e, t, i) {
'use strict';
var n = i(25);
JSServer.studyLibrary = [
{
name: 'Accumulation/Distribution',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#808000',
},
},
precision: 4,
inputs: {},
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Accumulation/Distribution',
shortDescription: 'Accum/Dist',
is_price_study: !1,
inputs: [],
id: 'Accumulation/Distribution@tv-basicstudies-1',
scriptIdPart: '',
name: 'Accumulation/Distribution',
},
constructor: function() {
(this.f_0 = function(e, t, i, o) {
return n.Std.or(n.Std.and(n.Std.eq(e, t), n.Std.eq(e, i)), n.Std.eq(t, i))
? 0
: ((2 * e - i - t) / (t - i)) * o;
}),
(this.main = function(e, t) {
var i, o, r;
return (
(this._context = e),
(this._input = t),
(i = this.f_0(
n.Std.close(this._context),
n.Std.high(this._context),
n.Std.low(this._context),
n.Std.volume(this._context),
)),
(o = n.Std.cum(i, this._context)),
(r = o),
[r]
);
});
},
},
{
name: 'Accumulative Swing Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#3C78D8',
},
},
precision: 4,
inputs: { in_0: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'ASI', histogramBase: 0, joinPoints: !1 } },
description: 'Accumulative Swing Index',
shortDescription: 'ASI',
is_price_study: !1,
inputs: [
{
id: 'in_0',
name: 'Limit Move Value',
defval: 10,
type: 'float',
min: 0.1,
max: 1e5,
},
],
id: 'Accumulative Swing Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Accumulative Swing Index',
},
constructor: function() {
(this.f_0 = function(e, t) {
var i = t.new_var(n.Std.open(t)),
o = t.new_var(n.Std.high(t)),
r = t.new_var(n.Std.low(t)),
s = t.new_var(n.Std.close(t)),
a = n.Std.abs(o - s.get(1)),
l = n.Std.abs(r - s.get(1)),
c = n.Std.abs(o - r),
h = n.Std.abs(s.get(1) - i.get(1)),
u = n.Std.max(a, l),
d = n.Std.iff(
a >= n.Std.max(l, c),
a - 0.5 * l + 0.25 * h,
n.Std.iff(l >= n.Std.max(a, c), l - 0.5 * a + 0.25 * h, c + 0.25 * h),
);
return n.Std.iff(
0 === d,
0,
((((s - s.get(1) + 0.5 * (s - i) + 0.25 * (s.get(1) - i.get(1))) / d) * u) / e) *
50,
);
}),
(this.f_1 = function(e, t) {
var i = this.f_0(e, t);
return n.Std.cum(i, t);
}),
(this.main = function(e, t) {
var i, n;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(n = this.f_1(i, this._context)),
[n]
);
});
},
},
{
name: 'Advance/Decline',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Advance/Decline',
shortDescription: 'AD',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'length', defval: 10, type: 'integer', min: 1, max: 2e3 }],
id: 'Advance/Decline@tv-basicstudies-1',
scriptIdPart: '',
name: 'Advance/Decline',
},
constructor: function() {
(this.f_0 = function(e, t) {
return n.Std.gt(e, t);
}),
(this.f_1 = function(e, t) {
return n.Std.lt(e, t);
}),
(this.f_2 = function(e, t) {
return 0 === t ? e : e / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this.f_0(n.Std.close(this._context), n.Std.open(this._context))),
(r = this._context.new_var(o)),
(s = n.Std.sum(r, i, this._context)),
(a = this.f_1(n.Std.close(this._context), n.Std.open(this._context))),
(l = this._context.new_var(a)),
(c = n.Std.sum(l, i, this._context)),
(h = this.f_2(s, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Arnaud Legoux Moving Average',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 0.85, in_2: 6 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Arnaud Legoux Moving Average',
shortDescription: 'ALMA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Window Size', defval: 9, type: 'integer', min: 0, max: 5e3 },
{ id: 'in_1', name: 'Offset', defval: 0.85, type: 'float', min: -1e12, max: 1e12 },
{ id: 'in_2', name: 'Sigma', defval: 6, type: 'float', min: -1e12, max: 1e12 },
],
id: 'Arnaud Legoux Moving Average@tv-basicstudies-1',
scriptIdPart: '',
name: 'Arnaud Legoux Moving Average',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._input(2)),
(a = this._context.new_var(i)),
(l = n.Std.alma(a, o, r, s)),
[l]
);
};
},
},
{
name: 'Aroon',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF6A00',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0094FF',
},
},
precision: 4,
inputs: { in_0: 14 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
},
description: 'Aroon',
shortDescription: 'Aroon',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Aroon@tv-basicstudies-1',
scriptIdPart: '',
name: 'Aroon',
},
constructor: function() {
(this.f_0 = function(e, t) {
return (100 * (e + t)) / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.high(this._context)),
(r = i + 1),
(s = this._context.new_var(o)),
(a = n.Std.highestbars(s, r, this._context)),
(l = this.f_0(a, i)),
(c = n.Std.low(this._context)),
(h = this._context.new_var(c)),
(u = n.Std.lowestbars(h, r, this._context)),
(d = this.f_0(u, i)),
(p = l),
(_ = d),
[p, _]
);
});
},
},
{
name: 'Average Directional Index',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 14, in_1: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'ADX', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Average Directional Index',
shortDescription: 'ADX',
is_price_study: !1,
inputs: [
{
id: 'in_0',
name: 'ADX Smoothing',
defval: 14,
type: 'integer',
min: -1e12,
max: 1e12,
},
{ id: 'in_1', name: 'DI Length', defval: 14, type: 'integer', min: -1e12, max: 1e12 },
],
id: 'average_directional_Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Average Directional Index',
},
constructor: function() {
(this.f_0 = function(e) {
var t = this._context.new_var(n.Std.high(this._context)),
i = n.Std.change(t),
o = this._context.new_var(n.Std.low(this._context)),
r = -n.Std.change(o),
s = this._context.new_var(n.Std.tr(void 0, this._context)),
a = n.Std.rma(s, e, this._context),
l = this._context.new_var(n.Std.and(n.Std.gt(i, r), n.Std.gt(i, 0)) ? i : 0),
c = n.Std.fixnan((100 * n.Std.rma(l, e, this._context)) / a, this._context),
h = this._context.new_var(n.Std.and(n.Std.gt(r, i), n.Std.gt(r, 0)) ? r : 0);
return [c, n.Std.fixnan((100 * n.Std.rma(h, e, this._context)) / a, this._context)];
}),
(this.f_1 = function(e, t) {
var i = this.f_0(e),
o = i[0],
r = i[1],
s = o + r,
a = this._context.new_var(n.Std.abs(o - r) / (n.Std.eq(s, 0) ? 1 : s));
return [100 * n.Std.rma(a, t, this._context)];
}),
(this.main = function(e, t) {
return (
(this._context = e), (this._input = t), this.f_1(this._input(0), this._input(1))
);
});
},
},
{
name: 'Average True Range',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Average True Range',
shortDescription: 'ATR',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Average True Range@tv-basicstudies-1',
scriptIdPart: '',
name: 'Average True Range',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.tr(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.rma(r, i, this._context)),
[s]
);
};
},
},
{
name: 'Awesome Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 1,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
palettes: {
palette_0: {
colors: {
0: { color: '#FF0000', width: 1, style: 0 },
1: { color: '#008000', width: 1, style: 0 },
},
},
},
inputs: {},
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', palette: 'palette_0', target: 'plot_0', type: 'colorer' },
],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Awesome Oscillator',
shortDescription: 'AO',
is_price_study: !1,
palettes: { palette_0: { colors: { 0: { name: 'Color 0' }, 1: { name: 'Color 1' } } } },
inputs: [],
id: 'Awesome Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Awesome Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.f_1 = function(e) {
return n.Std.le(e, 0) ? 0 : 1;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d;
return (
(this._context = e),
(this._input = t),
(i = n.Std.hl2(this._context)),
(o = this._context.new_var(i)),
(r = n.Std.sma(o, 5, this._context)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, 34, this._context)),
(l = this.f_0(r, a)),
(c = l),
(h = this._context.new_var(l)),
(u = n.Std.change(h)),
(d = this.f_1(u)),
[c, d]
);
});
},
},
{
name: 'Balance of Power',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: {},
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Balance of Power',
shortDescription: 'Balance of Power',
is_price_study: !1,
inputs: [],
id: 'Balance of Power@tv-basicstudies-1',
scriptIdPart: '',
name: 'Balance of Power',
},
constructor: function() {
(this.f_0 = function(e, t, i, n) {
return (e - t) / (i - n);
}),
(this.main = function(e, t) {
return (
(this._context = e),
(this._input = t),
[
this.f_0(
n.Std.close(this._context),
n.Std.open(this._context),
n.Std.high(this._context),
n.Std.low(this._context),
),
]
);
});
},
},
{
name: 'Bollinger Bands',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
filledAreasStyle: { fill_0: { color: '#000080', transparency: 90, visible: !0 } },
inputs: { in_0: 20, in_1: 2 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Median', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
},
description: 'Bollinger Bands',
shortDescription: 'BB',
is_price_study: !0,
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_1',
objBId: 'plot_2',
type: 'plot_plot',
title: 'Plots Background',
},
],
inputs: [
{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'mult', defval: 2, type: 'float', min: 0.001, max: 50 },
],
id: 'Bollinger Bands@tv-basicstudies-1',
scriptIdPart: '',
name: 'Bollinger Bands',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e * t;
}),
(this.f_1 = function(e, t) {
return e + t;
}),
(this.f_2 = function(e, t) {
return e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, o, this._context)),
(l = this._context.new_var(i)),
(c = n.Std.stdev(l, o, this._context)),
(h = this.f_0(r, c)),
(u = this.f_1(a, h)),
(d = this.f_2(a, h)),
(p = a),
(_ = u),
(f = d),
[p, _, f]
);
});
},
},
{
name: 'Bollinger Bands %B',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008080',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 1 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 },
],
filledAreasStyle: { fill_0: { color: '#008080', transparency: 90, visible: !0 } },
inputs: { in_0: 20, in_1: 2 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Bollinger Bands %B',
shortDescription: 'BB %B',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [
{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'mult', defval: 2, type: 'float', min: 0.001, max: 50 },
],
id: 'Bollinger Bands %B@tv-basicstudies-1',
scriptIdPart: '',
name: 'Bollinger Bands %B',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e * t;
}),
(this.f_1 = function(e, t) {
return e + t;
}),
(this.f_2 = function(e, t) {
return e - t;
}),
(this.f_3 = function(e, t, i) {
return (e - t) / (i - t);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, o, this._context)),
(l = this._context.new_var(i)),
(c = n.Std.stdev(l, o, this._context)),
(h = this.f_0(r, c)),
(u = this.f_1(a, h)),
(d = this.f_2(a, h)),
(p = this.f_3(i, d, u)),
(_ = p),
[_]
);
});
},
},
{
name: 'Bollinger Bands Width',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 20, in_1: 2 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Bollinger Bands Width',
shortDescription: 'BBW',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'mult', defval: 2, type: 'float', min: 0.001, max: 50 },
],
id: 'Bollinger Bands Width@tv-basicstudies-1',
scriptIdPart: '',
name: 'Bollinger Bands Width',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e * t;
}),
(this.f_1 = function(e, t) {
return e + t;
}),
(this.f_2 = function(e, t) {
return e - t;
}),
(this.f_3 = function(e, t, i) {
return (e - t) / i;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, o, this._context)),
(l = this._context.new_var(i)),
(c = n.Std.stdev(l, o, this._context)),
(h = this.f_0(r, c)),
(u = this.f_1(a, h)),
(d = this.f_2(a, h)),
(p = this.f_3(u, d, a)),
(_ = p),
[_]
);
});
},
},
{
name: 'Chaikin Money Flow',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 20 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Chaikin Money Flow',
shortDescription: 'CMF',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 2e3 }],
id: 'Chaikin Money Flow@tv-basicstudies-1',
scriptIdPart: '',
name: 'Chaikin Money Flow',
},
constructor: function() {
(this.f_0 = function(e, t, i, o) {
return n.Std.or(n.Std.and(n.Std.eq(e, t), n.Std.eq(e, i)), n.Std.eq(t, i))
? 0
: ((2 * e - i - t) / (t - i)) * o;
}),
(this.f_1 = function(e, t) {
return e / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this.f_0(
n.Std.close(this._context),
n.Std.high(this._context),
n.Std.low(this._context),
n.Std.volume(this._context),
)),
(r = this._context.new_var(o)),
(s = n.Std.sum(r, i, this._context)),
(a = n.Std.volume(this._context)),
(l = this._context.new_var(a)),
(c = n.Std.sum(l, i, this._context)),
(h = this.f_1(s, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Chaikin Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 3, in_1: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Chaikin Oscillator',
shortDescription: 'Chaikin Osc',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [
{ id: 'in_0', name: 'short', defval: 3, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'long', defval: 10, type: 'integer', min: 1, max: 2e3 },
],
id: 'Chaikin Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Chaikin Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.accdist(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.ema(s, i, this._context)),
(l = this._context.new_var(r)),
(c = n.Std.ema(l, o, this._context)),
(h = this.f_0(a, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Chande Kroll Stop',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 10, in_1: 1, in_2: 9 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Long', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Short', histogramBase: 0, joinPoints: !1 },
},
description: 'Chande Kroll Stop',
shortDescription: 'Chande Kroll Stop',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'p', defval: 10, type: 'integer', min: 1, max: 4999 },
{ id: 'in_1', name: 'x', defval: 1, type: 'integer', min: 1, max: 1e12 },
{ id: 'in_2', name: 'q', defval: 9, type: 'integer', min: 1, max: 1e12 },
],
id: 'Chande Kroll Stop@tv-basicstudies-1',
scriptIdPart: '',
name: 'Chande Kroll Stop',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return e - t * i;
}),
(this.f_1 = function(e, t, i) {
return e + t * i;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y, g, v;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.high(this._context)),
(a = this._context.new_var(s)),
(l = n.Std.highest(a, i, this._context)),
(c = n.Std.atr(i, this._context)),
(h = this.f_0(l, o, c)),
(u = this._context.new_var(s)),
(d = n.Std.lowest(u, i, this._context)),
(p = this.f_1(d, o, c)),
(_ = this._context.new_var(h)),
(f = n.Std.highest(_, r, this._context)),
(m = this._context.new_var(p)),
(y = n.Std.lowest(m, r, this._context)),
(g = y),
(v = f),
[g, v]
);
});
},
},
{
name: 'Chande Momentum Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008080',
},
},
precision: 4,
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Chande Momentum Oscillator',
shortDescription: 'ChandeMO',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'length', defval: 9, type: 'integer', min: 1, max: 2e3 }],
id: 'Chande Momentum Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Chande Momentum Oscillator',
},
constructor: function() {
(this.f_0 = function(e) {
return n.Std.ge(e, 0) ? e : 0;
}),
(this.f_1 = function(e) {
return n.Std.ge(e, 0) ? 0 : -e;
}),
(this.f_2 = function(e, t) {
return (100 * e) / t;
}),
(this.f_3 = function(e, t) {
return this.f_2(e - t, e + t);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.close(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.change(r)),
(a = this.f_0(s)),
(l = this.f_1(s)),
(c = this._context.new_var(a)),
(h = n.Std.sum(c, i, this._context)),
(u = this._context.new_var(l)),
(d = n.Std.sum(u, i, this._context)),
(p = this.f_3(h, d)),
(_ = p),
[_]
);
});
},
},
{
name: 'Chop Zone',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 5,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
palettes: {
palette_0: {
colors: {
0: { color: '#34dddd', width: 1, style: 0 },
1: { color: '#006400', width: 1, style: 0 },
2: { color: '#98fb98', width: 1, style: 0 },
3: { color: '#00FF00', width: 1, style: 0 },
4: { color: '#8B0000', width: 1, style: 0 },
5: { color: '#FF0000', width: 1, style: 0 },
6: { color: '#FF7F00', width: 1, style: 0 },
7: { color: '#ffc04c', width: 1, style: 0 },
8: { color: '#FFFF00', width: 1, style: 0 },
},
},
},
inputs: {},
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', palette: 'palette_0', target: 'plot_0', type: 'colorer' },
],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Chop Zone',
shortDescription: 'Chop Zone',
is_price_study: !1,
palettes: {
palette_0: {
colors: {
0: { name: 'Color 0' },
1: { name: 'Color 1' },
2: { name: 'Color 2' },
3: { name: 'Color 3' },
4: { name: 'Color 4' },
5: { name: 'Color 5' },
6: { name: 'Color 6' },
7: { name: 'Color 7' },
8: { name: 'Color 8' },
},
valToIndex: { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8 },
},
},
inputs: [],
id: 'chop_zone@tv-basicstudies-1',
scriptIdPart: '',
name: 'Chop Zone',
},
constructor: function() {
(this.f_0 = function() {
var e = n.Std.close(this._context),
t = n.Std.hlc3(this._context),
i = this._context.new_var(n.Std.high(this._context)),
o = n.Std.highest(i, 30, this._context),
r = n.Std.lowest(i, 30, this._context),
s = (25 / (o - r)) * r,
a = this._context.new_var(e),
l = this._context.new_var(n.Std.ema(a, 34, this._context)),
c = ((l.get(1) - l.get(0)) / t) * s,
h = n.Std.sqrt(1 + c * c),
u = n.Std.round((180 * n.Std.acos(1 / h)) / 3.141592653589793),
d = n.Std.iff(n.Std.gt(c, 0), -u, u),
p = n.Std.and(n.Std.gt(d, -2.14), n.Std.le(d, -0.71)) ? 7 : 8,
_ = n.Std.and(n.Std.gt(d, -3.57), n.Std.le(d, -2.14)) ? 6 : p,
f = n.Std.and(n.Std.gt(d, -5), n.Std.le(d, -3.57)) ? 5 : _,
m = n.Std.le(d, -5) ? 4 : f,
y = n.Std.and(n.Std.lt(d, 2.14), n.Std.ge(d, 0.71)) ? 3 : m,
g = n.Std.and(n.Std.lt(d, 3.57), n.Std.ge(d, 2.14)) ? 2 : y,
v = n.Std.and(n.Std.lt(d, 5), n.Std.ge(d, 3.57)) ? 1 : g;
return [1, n.Std.ge(d, 5) ? 0 : v];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_0();
});
},
},
{
name: 'Choppiness Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 61.8 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 38.2 },
],
filledAreasStyle: { fill_0: { color: '#008000', transparency: 90, visible: !0 } },
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Choppiness Index',
shortDescription: 'CHOP',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Choppiness Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Choppiness Index',
},
constructor: function() {
(this.f_0 = function(e, t, i, o) {
return (100 * n.Std.log10(e / (t - i))) / o;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.atr(1, this._context)),
(r = this._context.new_var(o)),
(s = n.Std.sum(r, i, this._context)),
(a = n.Std.high(this._context)),
(l = this._context.new_var(a)),
(c = n.Std.highest(l, i, this._context)),
(h = n.Std.low(this._context)),
(u = this._context.new_var(h)),
(d = n.Std.lowest(u, i, this._context)),
(p = n.Std.log10(i)),
(_ = this.f_0(s, c, d, p)),
(f = _),
[f]
);
});
},
},
{
name: 'Commodity Channel Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#808000',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 100 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: -100 },
],
filledAreasStyle: { fill_0: { color: '#808000', transparency: 90, visible: !0 } },
inputs: { in_0: 20 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Commodity Channel Index',
shortDescription: 'CCI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 2e3 }],
id: 'Commodity Channel Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Commodity Channel Index',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return (e - t) / (0.015 * i);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h;
return (
(this._context = e),
(this._input = t),
(i = n.Std.hlc3(this._context)),
(o = this._input(0)),
(r = this._context.new_var(i)),
(s = n.Std.sma(r, o, this._context)),
(a = this._context.new_var(i)),
(l = n.Std.dev(a, o, this._context)),
(c = this.f_0(i, s, l)),
(h = c),
[h]
);
});
},
},
{
name: 'Connors RSI',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#800080',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 70 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 30 },
],
filledAreasStyle: { fill_0: { color: '#800080', transparency: 90, visible: !0 } },
inputs: { in_0: 3, in_1: 2, in_2: 100 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'CRSI', histogramBase: 0, joinPoints: !1 } },
description: 'Connors RSI',
shortDescription: 'CRSI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [
{ id: 'in_0', name: 'RSI Length', defval: 3, type: 'integer', min: 1 },
{ id: 'in_1', name: 'UpDown Length', defval: 2, type: 'integer', min: 1 },
{ id: 'in_2', name: 'ROC Length', defval: 100, type: 'integer', min: 1 },
],
id: 'Connors RSI@tv-basicstudies-1',
scriptIdPart: '',
name: 'Connors RSI',
},
constructor: function() {
(this.f_1 = function(e, t, i) {
var o = i.new_var(n.Std.max(n.Std.change(e), 0));
return n.Std.rma(o, t, i);
}),
(this.f_2 = function(e, t, i) {
var o = i.new_var(-n.Std.min(n.Std.change(e), 0));
return n.Std.rma(o, t, i);
}),
(this.f_3 = (function() {
var e = 0;
return function(t) {
var i = t.get(0),
o = t.get(1);
return (
(e =
i === o
? 0
: i > o
? n.Std.nz(e) <= 0
? 1
: n.Std.nz(e) + 1
: n.Std.nz(e) >= 0
? -1
: n.Std.nz(e) - 1),
this._context.new_var(e)
);
};
})()),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._context.new_var(i)),
(r = this._input(0)),
(s = this._input(1)),
(a = this._input(2)),
(l = n.Std.rsi(this.f_1(o, r, this._context), this.f_2(o, r, this._context))),
(c = this.f_3(o)),
(h = n.Std.rsi(this.f_1(c, s, this._context), this.f_2(c, s, this._context))),
(u = this._context.new_var(n.Std.roc(o, 1))),
(d = n.Std.percentrank(u, a)),
(p = n.Std.avg(l, h, d)),
[p]
);
});
},
},
{
name: 'Coppock Curve',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 10, in_1: 14, in_2: 11 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Coppock Curve',
shortDescription: 'Coppock Curve',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'WMA Length', defval: 10, type: 'integer', min: -1e12, max: 5e3 },
{
id: 'in_1',
name: 'Long RoC Length',
defval: 14,
type: 'integer',
min: 1,
max: 4999,
},
{
id: 'in_2',
name: 'Short RoC Length',
defval: 11,
type: 'integer',
min: 1,
max: 4999,
},
],
id: 'Coppock Curve@tv-basicstudies-1',
scriptIdPart: '',
name: 'Coppock Curve',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e + t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.close(this._context)),
(a = this._context.new_var(s)),
(l = n.Std.roc(a, o)),
(c = this._context.new_var(s)),
(h = n.Std.roc(c, r)),
(u = this.f_0(l, h)),
(d = this._context.new_var(u)),
(p = n.Std.wma(d, i, this._context)),
(_ = p),
[_]
);
});
},
},
{
name: 'Correlation Coeff',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 4,
trackPrice: !1,
transparency: 40,
visible: !0,
color: '#800080',
},
},
precision: 4,
inputs: { in_0: 'AAPL', in_1: 20 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Correlation Coefficient',
shortDescription: 'CC',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'sym', defval: 'AAPL', type: 'symbol' },
{ id: 'in_1', name: 'length', defval: 20, type: 'integer', min: 1, max: 2e3 },
],
id: 'Correlation Coeff@tv-basicstudies-1',
scriptIdPart: '',
name: 'Correlation Coeff',
},
constructor: function() {
(this.init = function(e, t) {
(this._context = e),
(this._input = t),
this._context.new_sym(
this._input(0),
n.Std.period(this._context),
n.Std.period(this._context),
);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d;
return (
(this._context = e),
(this._input = t),
(i = this._context.new_unlimited_var(this._context.symbol.time)),
this._input(0),
n.Std.period(this._context),
(o = n.Std.close(this._context)),
(r = this._input(1)),
this._context.select_sym(1),
(s = this._context.new_unlimited_var(this._context.symbol.time)),
(a = n.Std.close(this._context)),
(l = this._context.new_unlimited_var(a)),
this._context.select_sym(0),
(c = l.adopt(s, i, 0)),
(h = this._context.new_var(o)),
(u = this._context.new_var(c)),
(d = n.Std.correlation(h, u, r, this._context)),
[d]
);
});
},
},
{
name: 'Detrended Price Oscillator',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#808000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 21, in_1: !1 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'DPO', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Detrended Price Oscillator',
shortDescription: 'DPO',
is_price_study: !1,
is_hidden_study: !1,
id: 'detrended_price_oscillator@tv-basicstudies-1',
bands: [{ id: 'hline_0', name: 'Zero', isHidden: !1 }],
inputs: [
{ id: 'in_0', name: 'Period', defval: 21, type: 'integer', min: 1, max: 1e12 },
{ id: 'in_1', name: 'isCentered', defval: !1, type: 'bool' },
],
scriptIdPart: '',
name: 'Detrended Price Oscillator',
},
constructor: function() {
(this.f_0 = function() {
var e = this._input(0),
t = this._input(1),
i = Math.floor(e / 2 + 1),
o = this._context.new_var(n.Std.close(this._context)),
r = this._context.new_var(n.Std.sma(o, e, this._context)),
s = this._context.new_var(n.Std.close(this._context)),
a = s.get(i) - r,
l = n.Std.close(this._context) - r.get(i),
c = t ? a : l,
h = -i;
return [c, t ? h : 0];
}),
(this.main = function(e, t) {
(this._context = e), (this._input = t);
var i = this.f_0();
return [{ value: i[0], offset: i[1] }];
});
},
},
{
name: 'Directional Movement Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF7F00',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 14, in_1: 14 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: '+DI', histogramBase: 0, joinPoints: !1 },
plot_1: { title: '-DI', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'ADX', histogramBase: 0, joinPoints: !1 },
},
description: 'Directional Movement',
shortDescription: 'DMI',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'DI Length', defval: 14, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'ADX Smoothing', defval: 14, type: 'integer', min: 1, max: 50 },
],
id: 'Directional Movement Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Directional Movement Index',
},
constructor: function() {
(this.f_0 = function(e) {
return -e;
}),
(this.f_1 = function(e, t) {
return n.Std.and(n.Std.gt(e, t), n.Std.gt(e, 0)) ? e : 0;
}),
(this.f_2 = function(e, t) {
return (100 * e) / t;
}),
(this.f_3 = function(e, t) {
return e + t;
}),
(this.f_4 = function(e, t, i) {
return n.Std.abs(e - t) / (n.Std.eq(i, 0) ? 1 : i);
}),
(this.f_5 = function(e) {
return 100 * e;
}),
(this.main = function(e, t) {
var i,
o,
r,
s,
a,
l,
c,
h,
u,
d,
p,
_,
f,
m,
y,
g,
v,
S,
b,
w,
P,
T,
x,
C,
L,
I,
A,
k,
E,
M;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.high(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.change(s)),
(l = n.Std.low(this._context)),
(c = this._context.new_var(l)),
(h = n.Std.change(c)),
(u = this.f_0(h)),
(d = n.Std.tr(this._context)),
(p = this._context.new_var(d)),
(_ = n.Std.rma(p, i, this._context)),
(f = this.f_1(a, u)),
(m = this._context.new_var(f)),
(y = n.Std.rma(m, i, this._context)),
(g = this.f_2(y, _)),
(v = n.Std.fixnan(g, this._context)),
(S = this.f_1(u, a)),
(b = this._context.new_var(S)),
(w = n.Std.rma(b, i, this._context)),
(P = this.f_2(w, _)),
(T = n.Std.fixnan(P, this._context)),
(x = this.f_3(v, T)),
(C = this.f_4(v, T, x)),
(L = this._context.new_var(C)),
(I = n.Std.rma(L, o, this._context)),
(A = this.f_5(I)),
(k = v),
(E = T),
(M = A),
[k, E, M]
);
});
},
},
{
name: 'Donchian Channels',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF7F00',
},
},
precision: 4,
filledAreasStyle: { fill_0: { color: '#0000FF', transparency: 90, visible: !0 } },
inputs: { in_0: 20 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Basis', histogramBase: 0, joinPoints: !1 },
},
description: 'Donchian Channels',
shortDescription: 'DC',
is_price_study: !0,
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_1',
objBId: 'plot_0',
type: 'plot_plot',
title: 'Plots Background',
},
],
inputs: [{ id: 'in_0', name: 'length', defval: 20, type: 'integer', min: 1, max: 2e3 }],
id: 'Donchian Channels@tv-basicstudies-1',
scriptIdPart: '',
name: 'Donchian Channels',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.low(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.lowest(r, i, this._context)),
(a = n.Std.high(this._context)),
(l = this._context.new_var(a)),
(c = n.Std.highest(l, i, this._context)),
(h = n.Std.avg(c, s)),
(u = s),
(d = c),
(p = h),
[u, d, p]
);
};
},
},
{
name: 'Double Exponential Moving Average',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
},
precision: 4,
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Double EMA',
shortDescription: 'DEMA',
is_price_study: !0,
inputs: [{ id: 'in_0', name: 'length', defval: 9, type: 'integer', min: 1, max: 1e4 }],
id: 'Double Exponential Moving Average@tv-basicstudies-1',
scriptIdPart: '',
name: 'Double Exponential Moving Average',
},
constructor: function() {
(this.f_0 = function(e, t) {
return 2 * e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.close(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.ema(r, i, this._context)),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, i, this._context)),
(c = this.f_0(s, l)),
(h = c),
[h]
);
});
},
},
{
name: 'Ease of Movement',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#808000',
},
},
precision: 4,
inputs: { in_0: 1e4, in_1: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Ease Of Movement',
shortDescription: 'EOM',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'Divisor', defval: 1e4, type: 'integer', min: 1, max: 1e9 },
{ id: 'in_1', name: 'length', defval: 14, type: 'integer', min: 1, max: 2e3 },
],
id: 'Ease of Movement@tv-basicstudies-1',
scriptIdPart: '',
name: 'Ease of Movement',
},
constructor: function() {
(this.f_0 = function(e, t, i, n, o) {
return (e * t * (i - n)) / o;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.hl2(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.change(s)),
(l = this.f_0(
i,
a,
n.Std.high(this._context),
n.Std.low(this._context),
n.Std.volume(this._context),
)),
(c = this._context.new_var(l)),
(h = n.Std.sma(c, o, this._context)),
(u = h),
[u]
);
});
},
},
{
name: 'Elders Force Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#800000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 13 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: "Elder's Force Index",
shortDescription: 'EFI',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [{ id: 'in_0', name: 'length', defval: 13, type: 'integer', min: 1, max: 2e3 }],
id: 'Elders Force Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Elders Force Index',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e * t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.close(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.change(r)),
(a = this.f_0(s, n.Std.volume(this._context))),
(l = this._context.new_var(a)),
(c = n.Std.ema(l, i, this._context)),
(h = c),
[h]
);
});
},
},
{
name: 'EMA Cross',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_2: {
linestyle: 0,
linewidth: 4,
plottype: 3,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 26 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Short', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Long', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Crosses', histogramBase: 0, joinPoints: !1 },
},
description: 'EMA Cross',
shortDescription: 'EMA Cross',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Short', defval: 9, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'Long', defval: 26, type: 'integer', min: 1, max: 2e3 },
],
id: 'EMA Cross@tv-basicstudies-1',
scriptIdPart: '',
name: 'EMA Cross',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e ? t : n.Std.na();
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.close(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.ema(s, i, this._context)),
(l = this._context.new_var(r)),
(c = n.Std.ema(l, o, this._context)),
(h = a),
(u = c),
(d = n.Std.cross(a, c, this._context)),
(p = this.f_0(d, a)),
[h, u, p]
);
});
},
},
{
name: 'Envelope',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF7F00',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
filledAreasStyle: { fill_0: { color: '#0000FF', transparency: 90, visible: !0 } },
inputs: { in_0: 20, in_1: 10, in_2: !1 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Median', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
},
description: 'Envelope',
shortDescription: 'Env',
is_price_study: !0,
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_1',
objBId: 'plot_2',
type: 'plot_plot',
title: 'Plots Background',
},
],
inputs: [
{ id: 'in_0', name: 'Length', defval: 20, type: 'integer', min: 1, max: 2e3 },
{
id: 'in_1',
name: 'percent',
defval: 10,
type: 'float',
min: -1e12,
max: 1e12,
},
{ id: 'in_2', name: 'exponential', defval: !1, type: 'bool' },
],
id: 'Envelope@tv-basicstudies-1',
scriptIdPart: '',
name: 'Envelope',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return e ? t : i;
}),
(this.f_1 = function(e, t) {
return e * (1 + t);
}),
(this.f_2 = function(e, t) {
return e * (1 - t);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._input(2)),
(a = this._context.new_var(i)),
(l = n.Std.ema(a, o, this._context)),
(c = this._context.new_var(i)),
(h = n.Std.sma(c, o, this._context)),
(u = this.f_0(s, l, h)),
(d = r / 100),
(p = this.f_1(u, d)),
(_ = this.f_2(u, d)),
(f = u),
(m = p),
(y = _),
[f, m, y]
);
});
},
},
{
name: 'Fisher Transform',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF7F00',
},
},
precision: 4,
bands: [
{ color: '#FF7F00', linestyle: 2, linewidth: 1, visible: !0, value: 1.5 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0.75 },
{ color: '#FF7F00', linestyle: 2, linewidth: 1, visible: !0, value: 0 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: -0.75 },
{ color: '#FF7F00', linestyle: 2, linewidth: 1, visible: !0, value: -1.5 },
],
inputs: { in_0: 9 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Fisher', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_1: { title: 'Trigger', histogramBase: 0, joinPoints: !1, isHidden: !1 },
},
description: 'Fisher Transform',
shortDescription: 'Fisher',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'Level', isHidden: !1 },
{ id: 'hline_1', name: 'Level', isHidden: !1 },
{ id: 'hline_2', name: 'Level', isHidden: !1 },
{ id: 'hline_3', name: 'Level', isHidden: !1 },
{ id: 'hline_4', name: 'Level', isHidden: !1 },
],
inputs: [{ id: 'in_0', name: 'Length', defval: 9, type: 'integer', min: 1, max: 1e12 }],
id: 'fisher_transform@tv-basicstudies-1',
scriptIdPart: '',
name: 'Fisher Transform',
},
constructor: function() {
(this.f_0 = function(e) {
var t = n.Std.lt(e, -0.99) ? -0.999 : e;
return [n.Std.gt(e, 0.99) ? 0.999 : t];
}),
(this.f_1 = function() {
var e,
t,
i,
o = this._input(0),
r = this._context.new_var(n.Std.hl2(this._context)),
s = n.Std.highest(r, o, this._context),
a = this._context.new_var(n.Std.hl2(this._context)),
l = n.Std.lowest(a, o, this._context),
c = this._context.new_var(),
h = this.f_0(
0.66 * ((n.Std.hl2(this._context) - l) / n.Std.max(s - l, 0.001) - 0.5) +
0.67 * n.Std.nz(c.get(1)),
);
return (
c.set(h[0]),
(e = this._context.new_var()),
e.set(
0.5 * n.Std.log((1 + c.get(0)) / n.Std.max(1 - c.get(0), 0.001)) +
0.5 * n.Std.nz(e.get(1)),
),
(t = e.get(1)),
(i = e.get(0)),
[i, t]
);
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_1();
});
},
},
{
name: 'Historical Volatility',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Historical Volatility',
shortDescription: 'HV',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'length', defval: 10, type: 'integer', min: 1, max: 1e12 },
],
id: 'historical_volatility@tv-basicstudies-1',
scriptIdPart: '',
name: 'Historical Volatility',
},
constructor: function() {
(this.f_0 = function() {
var e = this._input(0),
t = n.Std.or(
n.Std.isintraday(this._context),
n.Std.and(
n.Std.isdaily(this._context),
n.Std.eq(n.Std.interval(this._context), 1),
),
)
? 1
: 7,
i = this._context.new_var(n.Std.close(this._context)),
o = this._context.new_var(n.Std.log(n.Std.close(this._context) / i.get(1)));
return [100 * n.Std.stdev(o, e, this._context) * n.Std.sqrt(365 / t)];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_0();
});
},
},
{
name: 'Hull MA',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Hull Moving Average',
shortDescription: 'HMA',
is_price_study: !0,
inputs: [{ id: 'in_0', name: 'length', defval: 9, type: 'integer', min: 1, max: 1e4 }],
id: 'Hull MA@tv-basicstudies-1',
scriptIdPart: '',
name: 'Hull MA',
},
constructor: function() {
(this.f_0 = function(e, t) {
return 2 * e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = o / 2),
(s = this._context.new_var(i)),
(a = n.Std.wma(s, r, this._context)),
(l = this._context.new_var(i)),
(c = n.Std.wma(l, o, this._context)),
(h = this.f_0(a, c)),
(u = n.Std.sqrt(o)),
(d = n.Std.round(u)),
(p = this._context.new_var(h)),
(_ = n.Std.wma(p, d, this._context)),
(f = _),
[f]
);
});
},
},
{
name: 'Ichimoku Cloud',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0496ff',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#991515',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#459915',
},
plot_3: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_4: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
palettes: {
palette_0: {
colors: {
0: { color: '#008000', width: 1, style: 0 },
1: { color: '#FF0000', width: 1, style: 0 },
},
},
},
filledAreasStyle: { fill_0: { color: '#000080', transparency: 90, visible: !0 } },
inputs: { in_0: 9, in_1: 26, in_2: 52, in_3: 26 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
{ id: 'plot_3', type: 'line' },
{ id: 'plot_4', type: 'line' },
{ id: 'plot_5', palette: 'palette_0', target: 'fill_0', type: 'colorer' },
],
styles: {
plot_0: { title: 'Conversion Line', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_1: { title: 'Base Line', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_2: { title: 'Lagging Span', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_3: { title: 'Lead 1', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_4: { title: 'Lead 2', histogramBase: 0, joinPoints: !1, isHidden: !1 },
},
description: 'Ichimoku Cloud',
shortDescription: 'Ichimoku',
is_price_study: !0,
is_hidden_study: !1,
id: 'Ichimoku Cloud@tv-basicstudies-1',
palettes: {
palette_0: {
colors: { 0: { name: 'Color 0' }, 1: { name: 'Color 1' } },
valToIndex: { 0: 0, 1: 1 },
},
},
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_3',
objBId: 'plot_4',
type: 'plot_plot',
title: 'Plots Background',
isHidden: !1,
palette: 'palette_0',
},
],
inputs: [
{
id: 'in_0',
name: 'Conversion Line Periods',
defval: 9,
type: 'integer',
min: 1,
max: 1e12,
},
{
id: 'in_1',
name: 'Base Line Periods',
defval: 26,
type: 'integer',
min: 1,
max: 1e12,
},
{
id: 'in_2',
name: 'Lagging Span 2 Periods',
defval: 52,
type: 'integer',
min: 1,
max: 1e12,
},
{ id: 'in_3', name: 'Displacement', defval: 26, type: 'integer', min: 1, max: 1e12 },
],
scriptIdPart: '',
name: 'Ichimoku Cloud',
},
constructor: function() {
(this.donchian = function(e) {
var t = this._context.new_var(n.Std.low(this._context)),
i = this._context.new_var(n.Std.high(this._context));
return n.Std.avg(
n.Std.lowest(t, e, this._context),
n.Std.highest(i, e, this._context),
);
}),
(this.f_1 = function() {
var e = this._input(0),
t = this._input(1),
i = this._input(2),
o = this._input(3),
r = this.donchian(e),
s = this.donchian(t),
a = n.Std.avg(r, s),
l = this.donchian(i);
return [r, s, n.Std.close(this._context), a, l, -o, o, o, n.Std.gt(a, l) ? 0 : 1];
}),
(this.main = function(e, t) {
(this._context = e), (this._input = t);
var i = this.f_1();
return [
i[0],
i[1],
{ value: i[2], offset: i[5] },
{ value: i[3], offset: i[6] },
{ value: i[4], offset: i[7] },
i[8],
];
});
},
},
{
name: 'Keltner Channels',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
filledAreasStyle: { fill_0: { color: '#0000FF', transparency: 90, visible: !0 } },
inputs: { in_0: !0, in_1: 20, in_2: 1 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Middle', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
},
description: 'Keltner Channels',
shortDescription: 'KC',
is_price_study: !0,
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_0',
objBId: 'plot_2',
type: 'plot_plot',
title: 'Plots Background',
},
],
inputs: [
{ id: 'in_0', name: 'useTrueRange', defval: !0, type: 'bool' },
{ id: 'in_1', name: 'length', defval: 20, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_2', name: 'mult', defval: 1, type: 'float', min: -1e12, max: 1e12 },
],
id: 'Keltner Channels@tv-basicstudies-1',
scriptIdPart: '',
name: 'Keltner Channels',
},
constructor: function() {
(this.f_0 = function(e, t, i, n) {
return e ? t : i - n;
}),
(this.f_1 = function(e, t, i) {
return e + t * i;
}),
(this.f_2 = function(e, t, i) {
return e - t * i;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._input(2)),
(a = this._context.new_var(i)),
(l = n.Std.ema(a, r, this._context)),
(c = this.f_0(
o,
n.Std.tr(this._context),
n.Std.high(this._context),
n.Std.low(this._context),
)),
(h = this._context.new_var(c)),
(u = n.Std.ema(h, r, this._context)),
(d = this.f_1(l, u, s)),
(p = this.f_2(l, u, s)),
(_ = d),
(f = l),
(m = p),
[_, f, m]
);
});
},
},
{
name: 'Klinger Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
},
precision: 4,
inputs: {},
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Signal', histogramBase: 0, joinPoints: !1 },
},
description: 'Klinger Oscillator',
shortDescription: 'Klinger Oscillator',
is_price_study: !1,
inputs: [],
id: 'Klinger Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Klinger Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return n.Std.ge(e, 0) ? t : -t;
}),
(this.f_1 = function(e, t) {
return e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f;
return (
(this._context = e),
(this._input = t),
(i = n.Std.hlc3(this._context)),
(o = this._context.new_var(i)),
(r = n.Std.change(o)),
(s = this.f_0(r, n.Std.volume(this._context))),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, 34, this._context)),
(c = this._context.new_var(s)),
(h = n.Std.ema(c, 55, this._context)),
(u = this.f_1(l, h)),
(d = this._context.new_var(u)),
(p = n.Std.ema(d, 13, this._context)),
(_ = u),
(f = p),
[_, f]
);
});
},
},
{
name: 'Know Sure Thing',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: {
in_0: 10,
in_1: 15,
in_2: 20,
in_3: 30,
in_4: 10,
in_5: 10,
in_6: 10,
in_7: 15,
in_8: 9,
},
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'KST', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Signal', histogramBase: 0, joinPoints: !1 },
},
description: 'Know Sure Thing',
shortDescription: 'KST',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [
{ id: 'in_0', name: 'roclen1', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'roclen2', defval: 15, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_2', name: 'roclen3', defval: 20, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_3', name: 'roclen4', defval: 30, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_4', name: 'smalen1', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_5', name: 'smalen2', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_6', name: 'smalen3', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_7', name: 'smalen4', defval: 15, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_8', name: 'siglen', defval: 9, type: 'integer', min: 1, max: 2e3 },
],
id: 'Know Sure Thing@tv-basicstudies-1',
scriptIdPart: '',
name: 'Know Sure Thing',
},
constructor: function() {
(this.f_0 = function(e, t, i, n) {
return e + 2 * t + 3 * i + 4 * n;
}),
(this.main = function(e, t) {
var i,
o,
r,
s,
a,
l,
c,
h,
u,
d,
p,
_,
f,
m,
y,
g,
v,
S,
b,
w,
P,
T,
x,
C,
L,
I,
A,
k,
E,
M,
V,
D,
O,
R,
B,
N,
F,
W,
H;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = this._input(3)),
(a = this._input(4)),
(l = this._input(5)),
(c = this._input(6)),
(h = this._input(7)),
(u = this._input(8)),
(d = n.Std.close(this._context)),
(p = i),
(_ = this._context.new_var(d)),
(f = n.Std.roc(_, p)),
(m = a),
(y = this._context.new_var(f)),
(g = n.Std.sma(y, m, this._context)),
(v = o),
(S = this._context.new_var(d)),
(b = n.Std.roc(S, v)),
(w = l),
(P = this._context.new_var(b)),
(T = n.Std.sma(P, w, this._context)),
(x = r),
(C = this._context.new_var(d)),
(L = n.Std.roc(C, x)),
(I = c),
(A = this._context.new_var(L)),
(k = n.Std.sma(A, I, this._context)),
(E = s),
(M = this._context.new_var(d)),
(V = n.Std.roc(M, E)),
(D = h),
(O = this._context.new_var(V)),
(R = n.Std.sma(O, D, this._context)),
(B = this.f_0(g, T, k, R)),
(N = this._context.new_var(B)),
(F = n.Std.sma(N, u, this._context)),
(W = B),
(H = F),
[W, H]
);
});
},
},
{
name: 'Least Squares Moving Average',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 25, in_1: 0 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Least Squares Moving Average',
shortDescription: 'LSMA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length', defval: 25, type: 'integer', min: 1, max: 1e12 },
{ id: 'in_1', name: 'Offset', defval: 0, type: 'integer', min: -1e12, max: 1e12 },
],
id: 'Least Squares Moving Average@tv-basicstudies-1',
scriptIdPart: '',
name: 'Least Squares Moving Average',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.close(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.linreg(s, i, o)),
(l = a),
[l]
);
};
},
},
{
name: 'Linear Regression Curve',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Linear Regression Curve',
shortDescription: 'LRC',
is_price_study: !0,
inputs: [{ id: 'in_0', name: 'Length', defval: 9, type: 'integer', min: 1, max: 2e3 }],
id: 'Linear Regression Curve@tv-basicstudies-1',
scriptIdPart: '',
name: 'Linear Regression Curve',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._context.new_var(i)),
(s = n.Std.linreg(r, o, 0)),
(a = s),
[a]
);
};
},
},
{
name: 'MA Cross',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_2: {
linestyle: 0,
linewidth: 4,
plottype: 3,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 26 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Short', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Long', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Crosses', histogramBase: 0, joinPoints: !1 },
},
description: 'MA Cross',
shortDescription: 'MA Cross',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Short', defval: 9, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'Long', defval: 26, type: 'integer', min: 1, max: 2e3 },
],
id: 'MA Cross@tv-basicstudies-1',
scriptIdPart: '',
name: 'MA Cross',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e ? t : n.Std.na();
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.close(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.sma(s, i, this._context)),
(l = this._context.new_var(r)),
(c = n.Std.sma(l, o, this._context)),
(h = a),
(u = c),
(d = n.Std.cross(a, c, this._context)),
(p = this.f_0(d, a)),
[h, u, p]
);
});
},
},
{
name: 'MA with EMA Cross',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_2: {
linestyle: 0,
linewidth: 4,
plottype: 3,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 10, in_1: 10 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'MA', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'EMA', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Crosses', histogramBase: 0, joinPoints: !1 },
},
description: 'MA with EMA Cross',
shortDescription: 'MA/EMA Cross',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length MA', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'Length EMA', defval: 10, type: 'integer', min: 1, max: 2e3 },
],
id: 'MA with EMA Cross@tv-basicstudies-1',
scriptIdPart: '',
name: 'MA with EMA Cross',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e ? t : n.Std.na();
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.close(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.sma(s, i, this._context)),
(l = this._context.new_var(r)),
(c = n.Std.ema(l, o, this._context)),
(h = a),
(u = c),
(d = n.Std.cross(a, c, this._context)),
(p = this.f_0(d, a)),
[h, u, p]
);
});
},
},
{
name: 'Mass Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Mass Index',
shortDescription: 'Mass Index',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'length', defval: 10, type: 'integer', min: 1, max: 2e3 }],
id: 'Mass Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Mass Index',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.f_1 = function(e, t) {
return e / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this.f_0(n.Std.high(this._context), n.Std.low(this._context))),
(r = this._context.new_var(o)),
(s = n.Std.ema(r, 9, this._context)),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, 9, this._context)),
(c = this.f_1(s, l)),
(h = this._context.new_var(c)),
(u = n.Std.sum(h, i, this._context)),
(d = u),
[d]
);
});
},
},
{
name: 'McGinley Dynamic',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'McGinley Dynamic',
shortDescription: 'McGinley Dynamic',
is_price_study: !0,
is_hidden_study: !1,
id: 'mcginley_dynamic@tv-basicstudies-1',
inputs: [
{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 1e12 },
],
scriptIdPart: '',
name: 'McGinley Dynamic',
},
constructor: function() {
(this.f_0 = function() {
var e,
t = this._input(0),
i = n.Std.close(this._context),
o = this._context.new_var(i),
r = n.Std.ema(o, t, this._context),
s = this._context.new_var(),
a = s.get(1) + (i - s.get(1)) / (t * n.Std.pow(i / s.get(1), 4));
return s.set(n.Std.na(s.get(1)) ? r : a), (e = s.get(0)), [e];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_0();
});
},
},
{
name: 'Momentum',
metainfo: {
_metainfoVersion: 30,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#808000',
},
},
precision: 4,
inputs: { in_0: 10, in_1: 'close' },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Mom', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Momentum',
shortDescription: 'Mom',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'Length', defval: 10, type: 'integer', min: 1, max: 2e3 },
{
id: 'in_1',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
],
id: 'Momentum@tv-basicstudies-1',
scriptIdPart: '',
name: 'Momentum',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std[this._input(1)](this._context)),
(r = this._context.new_var(o)),
(s = r.get(i)),
(a = s ? o - s : null),
[a]
);
};
},
},
{
name: 'Money Flow',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#459915',
},
},
precision: 4,
bands: [
{ color: '#c0c0c0', linestyle: 2, linewidth: 1, visible: !0, value: 80 },
{ color: '#c0c0c0', linestyle: 2, linewidth: 1, visible: !0, value: 20 },
],
filledAreasStyle: { fill_0: { color: '#9915ff', transparency: 90, visible: !0 } },
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Money Flow',
shortDescription: 'MFI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'Length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Money Flow@tv-basicstudies-1',
scriptIdPart: '',
name: 'Money Flow',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return e * (n.Std.le(t, 0) ? 0 : i);
}),
(this.f_1 = function(e, t, i) {
return e * (n.Std.ge(t, 0) ? 0 : i);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.hlc3(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.change(r)),
(a = this.f_0(n.Std.volume(this._context), s, o)),
(l = this._context.new_var(a)),
(c = n.Std.sum(l, i, this._context)),
(h = this.f_1(n.Std.volume(this._context), s, o)),
(u = this._context.new_var(h)),
(d = n.Std.sum(u, i, this._context)),
(p = n.Std.rsi(c, d)),
(_ = p),
[_]
);
});
},
},
{
name: 'Moving Average',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 'close', in_2: 0 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Moving Average',
shortDescription: 'MA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length', defval: 9, type: 'integer', min: 1, max: 1e4 },
{
id: 'in_1',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
{ id: 'in_2', name: 'Offset', defval: 0, type: 'integer', min: -1e4, max: 1e4 },
],
id: 'Moving Average@tv-basicstudies-1',
scriptIdPart: '',
name: 'Moving Average',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = n.Std[this._input(1)](this._context)),
(o = this._input(0)),
(r = this._input(2)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, o, this._context)),
(l = a),
[{ value: l, offset: r }]
);
};
},
},
{
name: 'Moving Average Channel',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#CC0000',
},
},
precision: 4,
filledAreasStyle: { fill_0: { color: '#A2C4C9', transparency: 90, visible: !0 } },
inputs: { in_0: 20, in_1: 20, in_2: 0, in_3: 0 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Upper', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Lower', histogramBase: 0, joinPoints: !1 },
},
filledAreas: [
{
id: 'fill_0',
objAId: 'plot_0',
objBId: 'plot_1',
type: 'plot_plot',
title: 'Plots Background',
},
],
description: 'Moving Average Channel',
shortDescription: 'MAC',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Upper Length', defval: 20, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'Lower Length', defval: 20, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_2', name: 'Upper Offset', defval: 0, type: 'integer', min: -1e4, max: 1e4 },
{ id: 'in_3', name: 'Lower Offset', defval: 0, type: 'integer', min: -1e4, max: 1e4 },
],
id: 'Moving Average Channel@tv-basicstudies-1',
scriptIdPart: '',
name: 'Moving Average Channel',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d;
return (
(this._context = e),
(this._input = t),
(i = n.Std.high(this._context)),
(o = n.Std.low(this._context)),
(r = this._input(0)),
(s = this._input(1)),
(a = this._input(2)),
(l = this._input(3)),
(c = this._context.new_var(i)),
(h = this._context.new_var(o)),
(u = n.Std.sma(c, r, this._context)),
(d = n.Std.sma(h, s, this._context)),
[
{ value: u, offset: a },
{ value: d, offset: l },
]
);
};
},
},
{
name: 'Moving Average Convergence/Divergence',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 1,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 12, in_1: 26, in_3: 'close', in_2: 9 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Histogram', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'MACD', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Signal', histogramBase: 0, joinPoints: !1 },
},
description: 'MACD',
shortDescription: 'MACD',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'fastLength', defval: 12, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'slowLength', defval: 26, type: 'integer', min: 1, max: 2e3 },
{
id: 'in_3',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
{ id: 'in_2', name: 'signalLength', defval: 9, type: 'integer', min: 1, max: 50 },
],
id: 'Moving Average Convergence/Divergence@tv-basicstudies-1',
scriptIdPart: '',
name: 'MACD',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y;
return (
(this._context = e),
(this._input = t),
(i = n.Std[this._input(2)](this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._input(3)),
(a = this._context.new_var(i)),
(l = n.Std.ema(a, o, this._context)),
(c = this._context.new_var(i)),
(h = n.Std.ema(c, r, this._context)),
(u = this.f_0(l, h)),
(d = this._context.new_var(u)),
(p = n.Std.ema(d, s, this._context)),
(_ = this.f_0(u, p)),
(f = _),
(m = u),
(y = p),
[f, m, y]
);
});
},
},
{
name: 'Moving Average Exponential',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 'close', in_2: 0 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Moving Average Exponential',
shortDescription: 'EMA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length', defval: 9, type: 'integer', min: 1, max: 1e4 },
{
id: 'in_1',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
{ id: 'in_2', name: 'Offset', defval: 0, type: 'integer', min: -1e4, max: 1e4 },
],
id: 'Moving Average Exponential@tv-basicstudies-1',
scriptIdPart: '',
name: 'Moving Average Exponential',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = n.Std[this._input(1)](this._context)),
(o = this._input(0)),
(r = this._input(2)),
(s = this._context.new_var(i)),
(a = n.Std.ema(s, o, this._context)),
(l = a),
[{ value: l, offset: r }]
);
};
},
},
{
name: 'Moving Average Weighted',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 9, in_1: 'close', in_2: 0 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Moving Average Weighted',
shortDescription: 'WMA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length', defval: 9, type: 'integer', min: 1, max: 2e3 },
{
id: 'in_1',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
{ id: 'in_2', name: 'Offset', defval: 0, type: 'integer', min: -1e4, max: 1e4 },
],
id: 'Moving Average Weighted@tv-basicstudies-1',
scriptIdPart: '',
name: 'Moving Average Weighted',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = n.Std[this._input(1)](this._context)),
(o = this._input(0)),
(r = this._input(2)),
(s = this._context.new_var(i)),
(a = n.Std.wma(s, o, this._context)),
(l = a),
[{ value: l, offset: r }]
);
};
},
},
{
name: 'Net Volume',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: {},
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Net Volume',
shortDescription: 'Net Volume',
is_price_study: !1,
inputs: [],
id: 'Net Volume@tv-basicstudies-1',
scriptIdPart: '',
name: 'Net Volume',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return n.Std.gt(e, 0) ? t : n.Std.lt(i, 0) ? -t : 0 * t;
}),
(this.main = function(e, t) {
var i, o, r, s, a;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._context.new_var(i)),
(r = n.Std.change(o)),
(s = this.f_0(r, n.Std.volume(this._context), r)),
(a = s),
[a]
);
});
},
},
{
name: 'On Balance Volume',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: {},
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'On Balance Volume',
shortDescription: 'OBV',
is_price_study: !1,
inputs: [],
id: 'On Balance Volume@tv-basicstudies-1',
scriptIdPart: '',
name: 'On Balance Volume',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return n.Std.gt(e, 0) ? t : n.Std.lt(i, 0) ? -t : 0 * t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._context.new_var(i)),
(r = n.Std.change(o)),
(s = this.f_0(r, n.Std.volume(this._context), r)),
(a = n.Std.cum(s, this._context)),
(l = a),
[l]
);
});
},
},
{
name: 'Parabolic SAR',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 3,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 0.02, in_1: 0.02, in_2: 0.2 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Parabolic SAR',
shortDescription: 'SAR',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'start', defval: 0.02, type: 'float', min: -1e12, max: 1e12 },
{ id: 'in_1', name: 'increment', defval: 0.02, type: 'float', min: -1e12, max: 1e12 },
{ id: 'in_2', name: 'maximum', defval: 0.2, type: 'float', min: -1e12, max: 1e12 },
],
id: 'Parabolic SAR@tv-basicstudies-1',
scriptIdPart: '',
name: 'Parabolic SAR',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.sar(i, o, r, this._context)),
(a = s),
[a]
);
};
},
},
{
name: 'Price Channel',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0080',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0080',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0496FF',
},
},
precision: 4,
inputs: { in_0: 20, in_1: 0 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Highprice Line', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Lowprice Line', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Centerprice Line', histogramBase: 0, joinPoints: !1 },
},
description: 'Price Channel',
shortDescription: 'PC',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'Length', defval: 20, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'Offset Length', defval: 0, type: 'integer', min: 1, max: 2e3 },
],
id: 'Price Channel@tv-basicstudies-1',
scriptIdPart: '',
name: 'Price Channel',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = n.Std.high(this._context)),
(o = this._context.new_var(i)),
(r = n.Std.low(this._context)),
(s = this._context.new_var(r)),
(a = this._input(0)),
(l = this._input(1)),
(c = n.Std.highest(o, a, this._context)),
(h = n.Std.lowest(s, a, this._context)),
(u = n.Std.avg(c, h)),
[
{ value: c, offset: l },
{ value: h, offset: l },
{ value: u, offset: l },
]
);
};
},
},
{
name: 'Price Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 10, in_1: 21 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Price Oscillator',
shortDescription: 'PPO',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'shortlen', defval: 10, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'longlen', defval: 21, type: 'integer', min: 1, max: 2e3 },
],
id: 'Price Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Price Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return ((e - t) / t) * 100;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._context.new_var(i)),
(a = n.Std.sma(s, o, this._context)),
(l = this._context.new_var(i)),
(c = n.Std.sma(l, r, this._context)),
(h = this.f_0(a, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Price Volume Trend',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: {},
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'PVT', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Price Volume Trend',
shortDescription: 'PVT',
is_price_study: !1,
is_hidden_study: !1,
id: 'price_volume_trend@tv-basicstudies-1',
inputs: [],
scriptIdPart: '',
name: 'Price Volume Trend',
},
constructor: function() {
(this.f_0 = function() {
var e = this._context.new_var(n.Std.close(this._context));
return [
n.Std.cum(
(n.Std.change(e) / e.get(1)) * n.Std.volume(this._context),
this._context,
),
];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), [this.f_0()[0]];
});
},
},
{
name: 'Rate Of Change',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'ROC', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Rate Of Change',
shortDescription: 'ROC',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero Line', isHidden: !1 }],
inputs: [{ id: 'in_0', name: 'length', defval: 9, type: 'integer', min: 1, max: 1e12 }],
id: 'rate_of_change@tv-basicstudies-1',
scriptIdPart: '',
name: 'Rate Of Change',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r;
return (
(this._context = e),
(this._input = t),
(i = this._context.new_var(n.Std.close(this._context))),
(o = this._input(0)),
(r = (100 * (i.get(0) - i.get(o))) / i.get(o)),
[r]
);
};
},
},
{
name: 'Relative Strength Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#800080',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 70 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 30 },
],
filledAreasStyle: { fill_0: { color: '#800080', transparency: 90, visible: !0 } },
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Relative Strength Index',
shortDescription: 'RSI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'Length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Relative Strength Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Relative Strength Index',
},
constructor: function() {
(this.f_0 = function(e) {
return n.Std.max(e, 0);
}),
(this.f_1 = function(e) {
return -n.Std.min(e, 0);
}),
(this.f_2 = function(e, t) {
return n.Std.eq(e, 0) ? 100 : n.Std.eq(t, 0) ? 0 : 100 - 100 / (1 + t / e);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._context.new_var(i)),
(s = n.Std.change(r)),
(a = this.f_0(s)),
(l = this._context.new_var(a)),
(c = n.Std.rma(l, o, this._context)),
(h = this.f_1(s)),
(u = this._context.new_var(h)),
(d = n.Std.rma(u, o, this._context)),
(p = this.f_2(d, c)),
(_ = p),
[_]
);
});
},
},
{
name: 'Relative Vigor Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 10 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'RVGI', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Signal', histogramBase: 0, joinPoints: !1 },
},
description: 'Relative Vigor Index',
shortDescription: 'RVGI',
is_price_study: !1,
inputs: [{ id: 'in_0', name: 'Length', defval: 10, type: 'integer', min: 1, max: 2e3 }],
id: 'Relative Vigor Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Relative Vigor Index',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.f_1 = function(e, t) {
return e / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y, g;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this.f_0(n.Std.close(this._context), n.Std.open(this._context))),
(r = this._context.new_var(o)),
(s = n.Std.swma(r, this._context)),
(a = this._context.new_var(s)),
(l = n.Std.sum(a, i, this._context)),
(c = this.f_0(n.Std.high(this._context), n.Std.low(this._context))),
(h = this._context.new_var(c)),
(u = n.Std.swma(h, this._context)),
(d = this._context.new_var(u)),
(p = n.Std.sum(d, i, this._context)),
(_ = this.f_1(l, p)),
(f = this._context.new_var(_)),
(m = n.Std.swma(f, this._context)),
(y = _),
(g = m),
[y, g]
);
});
},
},
{
name: 'Relative Volatility Index',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 80 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 20 },
],
filledAreasStyle: { fill_0: { color: '#808000', transparency: 90, visible: !0 } },
inputs: { in_0: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Relative Volatility Index',
shortDescription: 'RVI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'length', defval: 10, type: 'integer', min: 1, max: 2e3 }],
id: 'Relative Volatility Index@tv-basicstudies-1',
scriptIdPart: '',
name: 'Relative Volatility Index',
},
constructor: function() {
(this.f_0 = function(e, t) {
return n.Std.le(e, 0) ? 0 : t;
}),
(this.f_1 = function(e, t) {
return n.Std.gt(e, 0) ? 0 : t;
}),
(this.f_2 = function(e, t) {
return (e / (e + t)) * 100;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.close(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.stdev(r, i, this._context)),
(a = this._context.new_var(o)),
(l = n.Std.change(a)),
(c = this.f_0(l, s)),
(h = this._context.new_var(c)),
(u = n.Std.ema(h, 14, this._context)),
(d = this.f_1(l, s)),
(p = this._context.new_var(d)),
(_ = n.Std.ema(p, 14, this._context)),
(f = this.f_2(u, _)),
(m = f),
[m]
);
});
},
},
{
name: 'SMI Ergodic Indicator/Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF7F00',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 1,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 5, in_1: 20, in_2: 5 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Indicator', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Signal', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Oscillator', histogramBase: 0, joinPoints: !1 },
},
description: 'SMI Ergodic Indicator/Oscillator',
shortDescription: 'SMIIO',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'shortlen', defval: 5, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'longlen', defval: 20, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_2', name: 'siglen', defval: 5, type: 'integer', min: 1, max: 2e3 },
],
id: 'SMI Ergodic Indicator/Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'SMI Ergodic Indicator/Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return e - t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.close(this._context)),
(a = this._context.new_var(s)),
(l = n.Std.tsi(a, i, o, this._context)),
(c = this._context.new_var(l)),
(h = n.Std.ema(c, r, this._context)),
(u = this.f_0(l, h)),
(d = l),
(p = h),
(_ = u),
[d, p, _]
);
});
},
},
{
name: 'Smoothed Moving Average',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 7, in_1: 'close' },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Smoothed Moving Average',
shortDescription: 'SMMA',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'Length', defval: 7, type: 'integer', min: 1, max: 1e12 },
{
id: 'in_1',
name: 'Source',
defval: 'close',
type: 'source',
options: ['open', 'high', 'low', 'close', 'hl2', 'hlc3', 'ohlc4'],
},
],
id: 'smoothed_moving_average@tv-basicstudies-1',
scriptIdPart: '',
name: 'Smoothed Moving Average',
},
constructor: function() {
(this.f_0 = function() {
var e,
t = this._input(0),
i = n.Std[this._input(1)](this._context),
o = this._context.new_var(i),
r = n.Std.sma(o, t, this._context),
s = this._context.new_var(),
a = (s.get(1) * (t - 1) + i) / t;
return s.set(n.Std.na(s.get(1)) ? r : a), (e = s.get(0)), [e];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_0();
});
},
},
{
name: 'Stochastic',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 80 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 20 },
],
filledAreasStyle: { fill_0: { color: '#800080', transparency: 75, visible: !0 } },
inputs: { in_0: 14, in_1: 1, in_2: 3 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: '%K', histogramBase: 0, joinPoints: !1 },
plot_1: { title: '%D', histogramBase: 0, joinPoints: !1 },
},
description: 'Stochastic',
shortDescription: 'Stoch',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [
{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'smoothK', defval: 1, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_2', name: 'smoothD', defval: 3, type: 'integer', min: 1, max: 1e4 },
],
id: 'Stochastic@tv-basicstudies-1',
scriptIdPart: '',
name: 'Stochastic',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y, g;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.close(this._context)),
(a = n.Std.high(this._context)),
(l = n.Std.low(this._context)),
(c = this._context.new_var(s)),
(h = this._context.new_var(a)),
(u = this._context.new_var(l)),
(d = n.Std.stoch(c, h, u, i, this._context)),
(p = this._context.new_var(d)),
(_ = n.Std.sma(p, o, this._context)),
(f = this._context.new_var(_)),
(m = n.Std.sma(f, r, this._context)),
(y = _),
(g = m),
[y, g]
);
};
},
},
{
name: 'Stochastic RSI',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 80 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 20 },
],
filledAreasStyle: { fill_0: { color: '#800080', transparency: 80, visible: !0 } },
inputs: { in_0: 14, in_1: 14, in_2: 3, in_3: 3 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: '%K', histogramBase: 0, joinPoints: !1 },
plot_1: { title: '%D', histogramBase: 0, joinPoints: !1 },
},
description: 'Stochastic RSI',
shortDescription: 'Stoch RSI',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [
{ id: 'in_0', name: 'lengthRSI', defval: 14, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_1', name: 'lengthStoch', defval: 14, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_2', name: 'smoothK', defval: 3, type: 'integer', min: 1, max: 1e4 },
{ id: 'in_3', name: 'smoothD', defval: 3, type: 'integer', min: 1, max: 1e4 },
],
id: 'Stochastic RSI@tv-basicstudies-1',
scriptIdPart: '',
name: 'Stochastic RSI',
},
constructor: function() {
(this.f_1 = function(e, t, i) {
var o = i.new_var(n.Std.max(n.Std.change(e), 0));
return n.Std.rma(o, t, i);
}),
(this.f_2 = function(e, t, i) {
var o = i.new_var(-n.Std.min(n.Std.change(e), 0));
return n.Std.rma(o, t, i);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f, m, y, g, v;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._input(1)),
(s = this._input(2)),
(a = this._input(3)),
(l = this._context.new_var(i)),
(c = n.Std.rsi(this.f_1(l, o, this._context), this.f_2(l, o, this._context))),
(h = this._context.new_var(c)),
(u = this._context.new_var(c)),
(d = this._context.new_var(c)),
(p = n.Std.stoch(h, u, d, r, this._context)),
(_ = this._context.new_var(p)),
(f = n.Std.sma(_, s, this._context)),
(m = this._context.new_var(f)),
(y = n.Std.sma(m, a, this._context)),
(g = f),
(v = y),
[g, v]
);
});
},
},
{
name: 'TRIX',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#800000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 18 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'TRIX', histogramBase: 0, joinPoints: !1 } },
description: 'TRIX',
shortDescription: 'TRIX',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [{ id: 'in_0', name: 'length', defval: 18, type: 'integer', min: 1, max: 2e3 }],
id: 'TRIX@tv-basicstudies-1',
scriptIdPart: '',
name: 'TRIX',
},
constructor: function() {
(this.f_0 = function(e) {
return n.Std.log(e);
}),
(this.f_1 = function(e) {
return 1e4 * e;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this.f_0(n.Std.close(this._context))),
(r = this._context.new_var(o)),
(s = n.Std.ema(r, i, this._context)),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, i, this._context)),
(c = this._context.new_var(l)),
(h = n.Std.ema(c, i, this._context)),
(u = this._context.new_var(h)),
(d = n.Std.change(u)),
(p = this.f_1(d)),
(_ = p),
[_]
);
});
},
},
{
name: 'Triple EMA',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
},
precision: 4,
inputs: { in_0: 9 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Triple EMA',
shortDescription: 'TEMA',
is_price_study: !0,
inputs: [{ id: 'in_0', name: 'length', defval: 9, type: 'integer', min: 1, max: 1e4 }],
id: 'Triple EMA@tv-basicstudies-1',
scriptIdPart: '',
name: 'Triple EMA',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return 3 * (e - t) + i;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.close(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.ema(r, i, this._context)),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, i, this._context)),
(c = this._context.new_var(l)),
(h = n.Std.ema(c, i, this._context)),
(u = this.f_0(s, l, h)),
(d = u),
[d]
);
});
},
},
{
name: 'True Strength Indicator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 25, in_1: 13, in_2: 13 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Plot', histogramBase: 0, joinPoints: !1 },
},
description: 'True Strength Indicator',
shortDescription: 'True Strength Indicator',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [
{ id: 'in_0', name: 'long', defval: 25, type: 'integer', min: 1, max: 4999 },
{ id: 'in_1', name: 'short', defval: 13, type: 'integer', min: 1, max: 4999 },
{ id: 'in_2', name: 'siglen', defval: 13, type: 'integer', min: 1, max: 4999 },
],
id: 'True Strength Indicator@tv-basicstudies-1',
scriptIdPart: '',
name: 'True Strength Indicator',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.close(this._context)),
(a = this._context.new_var(s)),
(l = n.Std.tsi(a, o, i, this._context)),
(c = l),
(h = this._context.new_var(c)),
[c, n.Std.ema(h, r, this._context)]
);
};
},
},
{
name: 'Ultimate Oscillator',
metainfo: {
_metainfoVersion: 41,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 7, in_1: 14, in_2: 28 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'UO', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'Ultimate Oscillator',
shortDescription: 'UO',
is_price_study: !1,
inputs: [
{ id: 'in_0', name: 'length7', defval: 7, type: 'integer', min: 1, max: 1e12 },
{ id: 'in_1', name: 'length14', defval: 14, type: 'integer', min: 1, max: 1e12 },
{ id: 'in_2', name: 'length28', defval: 28, type: 'integer', min: 1, max: 1e12 },
],
id: 'ultimate_oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Ultimate Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
var o = this._context.new_var(e),
r = this._context.new_var(t);
return [n.Std.sum(o, i, this._context) / n.Std.sum(r, i, this._context)];
}),
(this.f_1 = function() {
var e = this._input(0),
t = this._input(1),
i = this._input(2),
o = this._context.new_var(n.Std.close(this._context)),
r = n.Std.max(n.Std.high(this._context), o.get(1)),
s = this._context.new_var(n.Std.close(this._context)),
a = n.Std.min(n.Std.low(this._context), s.get(1)),
l = n.Std.close(this._context) - a,
c = r - a,
h = this.f_0(l, c, e),
u = this.f_0(l, c, t),
d = this.f_0(l, c, i);
return [(100 * (4 * h[0] + 2 * u[0] + d[0])) / 7];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_1();
});
},
},
{
name: 'VWAP',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: 0,
transparency: 0,
visible: !0,
color: '#3A6CA8',
},
},
precision: 4,
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'VWAP', histogramBase: 0, joinPoints: !1, isHidden: !1 } },
description: 'VWAP',
shortDescription: 'VWAP',
is_price_study: !0,
inputs: [],
id: 'VWAP@tv-basicstudies-1',
scriptIdPart: '',
name: 'VWAP',
},
constructor: function() {
(this.f_1 = function(e) {
(e.hist = null), e.add_hist();
}),
(this.init = function(e, t) {
this._isNewSession = n.Std.createNewSessionCheck(e);
}),
(this.main = function(e, t) {
var i, o, r, s;
return (
(this._context = e),
(this._input = t),
(i = e.new_var()),
(o = e.new_var()),
this._context.symbol.time &&
((r = this._context.symbol.time),
this._isNewSession(r) && (this.f_1(i), this.f_1(o))),
i.set(
n.Std.nz(i.get(1)) + n.Std.hlc3(this._context) * n.Std.volume(this._context),
),
o.set(n.Std.nz(o.get(1)) + n.Std.volume(this._context)),
(s = i.get(0) / o.get(0)),
[s]
);
});
},
},
{
name: 'VWMA',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
},
precision: 4,
inputs: { in_0: 20 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'VWMA',
shortDescription: 'VWMA',
is_price_study: !0,
inputs: [{ id: 'in_0', name: 'len', defval: 20, type: 'integer', min: 1, max: 1e4 }],
id: 'VWMA@tv-basicstudies-1',
scriptIdPart: '',
name: 'VWMA',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a;
return (
(this._context = e),
(this._input = t),
(i = n.Std.close(this._context)),
(o = this._input(0)),
(r = this._context.new_var(i)),
(s = n.Std.vwma(r, o, this._context)),
(a = s),
[a]
);
};
},
},
{
name: 'Volume Oscillator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
bands: [{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: 0 }],
inputs: { in_0: 5, in_1: 10 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Volume Oscillator',
shortDescription: 'Volume Osc',
is_price_study: !1,
bands: [{ id: 'hline_0', name: 'Zero' }],
inputs: [
{ id: 'in_0', name: 'shortlen', defval: 5, type: 'integer', min: 1, max: 4999 },
{ id: 'in_1', name: 'longlen', defval: 10, type: 'integer', min: 1, max: 4999 },
],
id: 'Volume Oscillator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Volume Oscillator',
},
constructor: function() {
(this.f_0 = function(e, t) {
return (100 * (e - t)) / t;
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = n.Std.volume(this._context)),
(s = this._context.new_var(r)),
(a = n.Std.ema(s, i, this._context)),
(l = this._context.new_var(r)),
(c = n.Std.ema(l, o, this._context)),
(h = this.f_0(a, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Vortex Indicator',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
},
precision: 4,
inputs: { in_0: 14 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
],
styles: {
plot_0: { title: 'VI +', histogramBase: 0, joinPoints: !1, isHidden: !1 },
plot_1: { title: 'VI -', histogramBase: 0, joinPoints: !1, isHidden: !1 },
},
description: 'Vortex Indicator',
shortDescription: 'VI',
is_price_study: !1,
is_hidden_study: !1,
id: 'vortex_indicator@tv-basicstudies-1',
inputs: [
{ id: 'in_0', name: 'Period', defval: 14, type: 'integer', min: 2, max: 1e12 },
],
scriptIdPart: '',
name: 'Vortex Indicator',
},
constructor: function() {
(this.f_0 = function() {
var e = this._input(0),
t = this._context.new_var(n.Std.low(this._context)),
i = this._context.new_var(n.Std.abs(n.Std.high(this._context) - t.get(1))),
o = n.Std.sum(i, e, this._context),
r = this._context.new_var(n.Std.high(this._context)),
s = this._context.new_var(n.Std.abs(n.Std.low(this._context) - r.get(1))),
a = n.Std.sum(s, e, this._context),
l = this._context.new_var(n.Std.atr(1, this._context)),
c = n.Std.sum(l, e, this._context);
return [o / c, a / c];
}),
(this.main = function(e, t) {
return (this._context = e), (this._input = t), this.f_0();
});
},
},
{
name: 'Willams %R',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#000080',
},
},
precision: 4,
bands: [
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: -20 },
{ color: '#808080', linestyle: 2, linewidth: 1, visible: !0, value: -80 },
],
filledAreasStyle: { fill_0: { color: '#000080', transparency: 90, visible: !0 } },
inputs: { in_0: 14 },
},
plots: [{ id: 'plot_0', type: 'line' }],
styles: { plot_0: { title: 'Plot', histogramBase: 0, joinPoints: !1 } },
description: 'Williams %R',
shortDescription: '%R',
is_price_study: !1,
bands: [
{ id: 'hline_0', name: 'UpperLimit' },
{ id: 'hline_1', name: 'LowerLimit' },
],
filledAreas: [
{
id: 'fill_0',
objAId: 'hline_0',
objBId: 'hline_1',
type: 'hline_hline',
title: 'Hlines Background',
},
],
inputs: [{ id: 'in_0', name: 'length', defval: 14, type: 'integer', min: 1, max: 2e3 }],
id: 'Willams %R@tv-basicstudies-1',
scriptIdPart: '',
name: 'Willams %R',
},
constructor: function() {
(this.f_0 = function(e, t, i) {
return (100 * (e - t)) / (t - i);
}),
(this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = n.Std.high(this._context)),
(r = this._context.new_var(o)),
(s = n.Std.highest(r, i, this._context)),
(a = n.Std.low(this._context)),
(l = this._context.new_var(a)),
(c = n.Std.lowest(l, i, this._context)),
(h = this.f_0(n.Std.close(this._context), s, c)),
(u = h),
[u]
);
});
},
},
{
name: 'Williams Alligator',
metainfo: {
_metainfoVersion: 27,
isTVScript: !1,
isTVScriptStub: !1,
is_hidden_study: !1,
defaults: {
styles: {
plot_0: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#0000FF',
},
plot_1: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#FF0000',
},
plot_2: {
linestyle: 0,
linewidth: 1,
plottype: 0,
trackPrice: !1,
transparency: 35,
visible: !0,
color: '#008000',
},
},
precision: 4,
inputs: { in_0: 21, in_1: 13, in_2: 8 },
},
plots: [
{ id: 'plot_0', type: 'line' },
{ id: 'plot_1', type: 'line' },
{ id: 'plot_2', type: 'line' },
],
styles: {
plot_0: { title: 'Jaw', histogramBase: 0, joinPoints: !1 },
plot_1: { title: 'Teeth', histogramBase: 0, joinPoints: !1 },
plot_2: { title: 'Lips', histogramBase: 0, joinPoints: !1 },
},
description: 'Williams Alligator',
shortDescription: 'Alligator',
is_price_study: !0,
inputs: [
{ id: 'in_0', name: 'jawLength', defval: 21, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_1', name: 'teethLength', defval: 13, type: 'integer', min: 1, max: 2e3 },
{ id: 'in_2', name: 'lipsLength', defval: 8, type: 'integer', min: 1, max: 2e3 },
],
id: 'Williams Alligator@tv-basicstudies-1',
scriptIdPart: '',
name: 'Williams Alligator',
},
constructor: function() {
this.main = function(e, t) {
var i, o, r, s, a, l, c, h, u, d, p, _, f;
return (
(this._context = e),
(this._input = t),
(i = this._input(0)),
(o = this._input(1)),
(r = this._input(2)),
(s = n.Std.hl2(this._context)),
(a = this._context.new_var(s)),
(l = n.Std.ema(a, i, this._context)),
(c = this._context.new_var(s)),
(h = n.Std.ema(c, o, this._context)),
(u = this._context.new_var(s)),
(d = n.Std.ema(u, r, this._context)),
(p = l),
(_ = h),
(f = d),
[
{ value: p, offset: 8 },
{ value: _, offset: 5 },
{ value: f, offset: 3 },
]
);
};
},
},
{
name: 'Williams Fractals',
metainfo: {
_metainfoVersion: 42,
isTVScript: !1,
isTVScriptStub: !1,
defaults: {
styles: {
plot_0: {
plottype: 'shape_triangle_down',
visible: !0,
location: 'BelowBar',
transparency: 0,
color: '#800000',
},
plot_1: {
plottype: 'shape_triangle_up',
visible: !0,
location: 'AboveBar',
transparency: 0,
color: '#808000',
},
},
precision: 4,
inputs: { in_0: 2 },
},
plots: [
{ id: 'plot_0', type: 'shapes' },
{ id: 'plot_1', type: 'shapes' },
],
styles: {
plot_0: { title: 'Down fractals', isHidden: !1 },
plot_1: { title: 'Up fractals', isHidden: !1 },
},
description: 'Williams Fractal',
shortDescription: 'Fractals',
is_price_study: !0,
is_hidden_study: !1,
id: 'Williams Fractals@tv-basicstudies-1',
inputs: [
{ id: 'in_0', name: 'Periods', defval: 2, type: 'integer', min: 2, max: 1e12 },
],
scriptIdPart: '',
name: 'Williams Fractals',
isCustomIndicator: !0,
},
constructor: function() {
(this.f_0 = function() {
var e = this._input(0),
t = this._context.new_var(n.Std.high(this._context)),
i = n.Std.or(
n.Std.and(
n.Std.and(n.Std.lt(t.get(e + 2), t.get(e)), n.Std.lt(t.get(e + 1), t.get(e))),
n.Std.and(n.Std.lt(t.get(e - 1), t.get(e)), n.Std.lt(t.get(e - 2), t.get(e))),
),
n.Std.or(
n.Std.or(
n.Std.and(
n.Std.lt(t.get(e + 3), t.get(e)),
n.Std.and(
n.Std.and(
n.Std.lt(t.get(e + 2), t.get(e)),
n.Std.eq(t.get(e + 1), t.get(e)),
),
n.Std.and(
n.Std.lt(t.get(e - 1), t.get(e)),
n.Std.lt(t.get(e - 2), t.get(e)),
),
),
),
n.Std.and(
n.Std.and(
n.Std.lt(t.get(e + 4), t.get(e)),
n.Std.lt(t.get(e + 3), t.get(e)),
),
n.Std.and(
n.Std.and(
n.Std.eq(t.get(e + 2), t.get(e)),
n.Std.le(t.get(e + 1), t.get(e)),
),
n.Std.and(
n.Std.lt(t.get(e - 1), t.get(e)),
n.Std.lt(t.get(e - 2), t.get(e)),
),
),
),
),
n.Std.or(
n.Std.and(
n.Std.and(
n.Std.lt(t.get(e + 5), t.get(e)),
n.Std.and(
n.Std.lt(t.get(e + 4), t.get(e)),
n.Std.eq(t.get(e + 3), t.get(e)),
),
),
n.Std.and(
n.Std.and(
n.Std.eq(t.get(e + 2), t.get(e)),
n.Std.le(t.get(e + 1), t.get(e)),
),
n.Std.and(
n.Std.lt(t.get(e - 1), t.get(e)),
n.Std.lt(t.get(e - 2), t.get(e)),
),
),
),
n.Std.and(
n.Std.and(
n.Std.and(
n.Std.lt(t.get(e + 6), t.get(e)),
n.Std.lt(t.get(e + 5), t.get(e)),
),
n.Std.and(
n.Std.eq(t.get(e + 4), t.get(e)),
n.Std.le(t.get(e + 3), t.get(e)),
),
),
n.Std.and(
n.Std.and(
n.Std.eq(t.get(e + 2), t.get(e)),
n.Std.le(t.get(e + 1), t.get(e)),
),
n.Std.and(
n.Std.lt(t.get(e - 1), t.get(e)),
n.Std.lt(t.get(e - 2), t.get(e)),
),
),
),
),
),
),
o = this._context.new_var(n.Std.low(this._context));
return [
n.Std.or(
n.Std.and(
n.Std.and(n.Std.gt(o.get(e + 2), o.get(e)), n.Std.gt(o.get(e + 1), o.get(e))),
n.Std.and(n.Std.gt(o.get(e - 1), o.get(e)), n.Std.gt(o.get(e - 2), o.get(e))),
),
n.Std.or(
n.Std.or(
n.Std.and(
n.Std.gt(o.get(e + 3), o.get(e)),
n.Std.and(
n.Std.and(
n.Std.gt(o.get(e + 2), o.get(e)),
n.Std.eq(o.get(e + 1), o.get(e)),
),
n.Std.and(
n.Std.gt(o.get(e - 1), o.get(e)),
n.Std.gt(o.get(e - 2), o.get(e)),
),
),
),
n.Std.and(
n.Std.and(
n.Std.gt(o.get(e + 4), o.get(e)),
n.Std.gt(o.get(e + 3), o.get(e)),
),
n.Std.and(
n.Std.and(
n.Std.eq(o.get(e + 2), o.get(e)),
n.Std.ge(o.get(e + 1), o.get(e)),
),
n.Std.and(
n.Std.gt(o.get(e - 1), o.get(e)),
n.Std.gt(o.get(e - 2), o.get(e)),
),
),
),
),
n.Std.or(
n.Std.and(
n.Std.and(
n.Std.gt(o.get(e + 5), o.get(e)),
n.Std.and(
n.Std.gt(o.get(e + 4), o.get(e)),
n.Std.eq(o.get(e + 3), o.get(e)),
),
),
n.Std.and(
n.Std.and(
n.Std.eq(o.get(e + 2), o.get(e)),
n.Std.ge(o.get(e + 1), o.get(e)),
),
n.Std.and(
n.Std.gt(o.get(e - 1), o.get(e)),
n.Std.gt(o.get(e - 2), o.get(e)),
),
),
),
n.Std.and(
n.Std.and(
n.Std.and(
n.Std.gt(o.get(e + 6), o.get(e)),
n.Std.gt(o.get(e + 5), o.get(e)),
),
n.Std.and(
n.Std.eq(o.get(e + 4), o.get(e)),
n.Std.ge(o.get(e + 3), o.get(e)),
),
),
n.Std.and(
n.Std.and(
n.Std.eq(o.get(e + 2), o.get(e)),
n.Std.ge(o.get(e + 1), o.get(e)),
),
n.Std.and(
n.Std.gt(o.get(e - 1), o.get(e)),
n.Std.gt(o.get(e - 2), o.get(e)),
),
),
),
),
),
),
i,
];
}),
(this.main = function(e, t) {
(this._context = e), (this._input = t);
var i = this.f_0();
return [
{ value: i[0], offset: -2 },
{ value: i[1], offset: -2 },
];
});
},
},
];
},
function(e, t, i) {
'use strict';
var n, o, r, s;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'dur', function() {
return n;
}),
i.d(t, 'easingFunc', function() {
return o;
}),
i.d(t, 'CubicBezier', function() {
return r;
}),
i.d(t, 'color', function() {
return s;
}),
(n = 350),
(o = {
linear: function(e) {
return e;
},
easeInQuad: function(e) {
return e * e;
},
easeOutQuad: function(e) {
return e * (2 - e);
},
easeInOutQuad: function(e) {
return e < 0.5 ? 2 * e * e : (4 - 2 * e) * e - 1;
},
easeInCubic: function(e) {
return e * e * e;
},
easeOutCubic: function(e) {
return --e * e * e + 1;
},
easeInOutCubic: function(e) {
return e < 0.5 ? 4 * e * e * e : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1;
},
easeInQuart: function(e) {
return e * e * e * e;
},
easeOutQuart: function(e) {
return 1 - --e * e * e * e;
},
easeInOutQuart: function(e) {
return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e;
},
easeInQuint: function(e) {
return e * e * e * e * e;
},
easeOutQuint: function(e) {
return 1 + --e * e * e * e * e;
},
easeInOutQuint: function(e) {
return e < 0.5 ? 16 * e * e * e * e * e : 1 + 16 * --e * e * e * e * e;
},
}),
(r = (function() {
function e(e, t, i, n) {
(this._mX1 = e), (this._mY1 = t), (this._mX2 = i), (this._mY2 = n);
}
return (
(e.prototype.easingFunc = function(e) {
return this._mX1 === this._mY1 && this._mX2 === this._mY2
? e
: this._calcBezier(this._getTForX(e));
}),
(e.prototype._a = function(e, t) {
return 1 - 3 * t + 3 * e;
}),
(e.prototype._b = function(e, t) {
return 3 * t - 6 * e;
}),
(e.prototype._c = function(e) {
return 3 * e;
}),
(e.prototype._calcBezier = function(e) {
return (
((this._a(this._mY1, this._mY2) * e + this._b(this._mY1, this._mY2)) * e +
this._c(this._mY1)) *
e
);
}),
(e.prototype._getSlope = function(e) {
return (
3 * this._a(this._mX1, this._mX2) * e * e +
2 * this._b(this._mX1, this._mX2) * e +
this._c(this._mX1)
);
}),
(e.prototype._getTForX = function(e) {
var t,
i,
n,
o = e;
for (t = 0; t < 4; ++t) {
if (0 === (i = this._getSlope(o))) return o;
(n = this._calcBezier(o) - e), (o -= n / i);
}
return o;
}),
e
);
})()),
(s = {
black0: '#000',
black20: '#2b2d36',
black25: '#2b2e37',
black27: '#2f3241',
black30: '#212121',
black70: '#4A4A4A',
black80: '#535353',
black100: '#646464',
black110: '#757575',
black140: '#8A8A8A',
black170: '#ADAEB0',
black180: '#b4b4b4',
black200: '#C8C8C8',
black220: '#DADDE0',
black230: '#ECECEC',
black240: '#F2F2F2',
black248: '#F8F8F8',
black255: '#FFF',
brand: '#3BB3E4',
brandHover: '#3BABD8',
brandActive: '#3898C2',
brandDown: '#049DDC',
brand220: '#3BB3E0',
brand255: '#3BB3FF',
brandNew: '#37A6EF',
spinner: '#00A2E2',
brandMedium80: '#3C4650',
brandMedium90: '#465a6e',
brandMedium100: '#627384',
brandMedium120: '#758696',
brandMedium150: '#94959C',
brandMedium190: '#9DB2BD',
brandMedium220: '#E9EFF2',
brandMedium230: '#EAECEF',
brandMedium240: '#F1F3F6',
brandDark: '#2A2C39',
brandDark50: '#252733',
brandDark45: '#20222D',
brandDarkText: '#6A6B74',
danger: '#FF4A68',
dangerHover: '#F24965',
dangerDown: '#FF173E',
success: '#3CBC98',
success55: '#37BC9B',
success250: '#00FFC0',
successHover: '#38B395',
successDown: '#00A97F',
attention: '#FFC84A',
attention50: '#F89E30',
growing: '#37bc9b',
falling: '#ff4a68',
});
},
function(e, t, i) {
function n() {
(this._data = null), (this._hittest = new o(o.MOVEPOINT));
}
var o, r, s, a;
i(71),
(o = i(9).HitTestResult),
(r = i(103).LineEnd),
(s = i(30).distanceToSegment),
(a = i(27).extendAndClipLineSegment),
(n.prototype.setData = function(e) {
this._data = e;
}),
(n.prototype.setHitTest = function(e) {
this._hittest = e;
}),
(n.prototype.drawArrow = function(e, t, i, n) {
var o, r, s, a, l, c, h, u, d;
t.subtract(e).length() < 1 ||
((o = t.subtract(e).normalized()),
(r = 5 * n),
(s = o.scaled(r)),
(a = t.subtract(s)),
(l = o.transposed()),
(c = 3 * n),
(h = l.scaled(c)),
(u = a.add(h)),
(d = a.subtract(h)),
CanvasEx.drawLine(i, Math.round(u.x), Math.round(u.y), t.x, t.y),
CanvasEx.drawLine(i, Math.round(d.x), Math.round(d.y), t.x, t.y));
}),
(n.prototype.extendAndClipLineSegment = function(e, t) {
return a(
e,
t,
this._data.width,
this._data.height,
this._data.extendleft,
this._data.extendright,
);
}),
(n.prototype.drawCircle = function(e, t, i, n) {
(n = $.extend({ fillStyle: '#000000' }, n)),
t.save(),
(t.fillStyle = n.fillStyle),
t.beginPath(),
t.arc(e.x, e.y, i, 0, 2 * Math.PI, !1),
t.fill(),
n.strokeWidth && ((t.lineWidth = n.strokeWidth), t.stroke()),
t.restore();
}),
(n.prototype.draw = function(e) {
var t, i, n, o, r;
null === this._data ||
(this._data.points && this._data.points.length < 2) ||
(this._data.floatPoints && this._data.floatPoints.length < 2) ||
((e.lineCap = 'butt'),
(e.strokeStyle = this._data.color),
(e.lineWidth = this._data.linewidth),
(e.lineStyle = this._data.linestyle),
(t = this._data.floatPoints || this._data.points),
(i = t[0]),
(n = t[1]),
this._data.overlayLineEndings
? (o = [$.extend(!0, {}, i), $.extend(!0, {}, n)])
: this.drawEnds(e, [i, n]),
(r = this.extendAndClipLineSegment(i, n)),
null !== r &&
this._data.linewidth > 0 &&
CanvasEx.drawLine(e, r[0].x, r[0].y, r[1].x, r[1].y),
this._data.overlayLineEndings && this.drawEnds(e, o));
}),
(n.prototype.drawEnds = function(e, t) {
var i = t[0],
n = t[1];
switch (this._data.leftend) {
case r.Arrow:
this.drawArrow(n, i, e, e.lineWidth);
break;
case r.Circle:
this.drawCircle(i, e, e.lineWidth, this._data.endstyle);
}
switch (this._data.rightend) {
case r.Arrow:
this.drawArrow(i, n, e, e.lineWidth);
break;
case r.Circle:
this.drawCircle(n, e, e.lineWidth, this._data.endstyle);
}
}),
(n.prototype.hitTest = function(e) {
var t, i, n, o, r, a;
return null === this._data || (this._data.points && this._data.points.length < 2)
? null
: this._data.floatPoints && this._data.floatPoints.length < 2
? null
: ((t = TradingView.isMobile.any() ? 24 : 3),
(i = this._data.floatPoints || this._data.points),
(n = i[0]),
(o = i[1]),
(r = this.extendAndClipLineSegment(n, o)),
null !== r && ((a = s(r[0], r[1], e)), a.distance <= t) ? this._hittest : null);
}),
(t.TrendLineRenderer = n);
},
function(e, t, i) {
function n(e, t) {
(this._linesMaxWidth = null),
(this._hittest = t || new o(o.MOVEPOINT)),
(this._data = {}),
(this._fontSize = 0),
this.setData(e);
}
var o = i(9).HitTestResult,
r = i(81).calcTextHorizontalShift,
s = i(46).drawRoundRect;
(n.prototype.setData = function(e) {
var t,
i,
n,
o = this._data,
r = this.fontStyle();
(this._data = e),
(this._fontSize = e.fontsize || e.fontSize || 30),
(t = e.text === o.text),
(i = e.wordWrapWidth === o.wordWrapWidth),
(n = r === this.fontStyle()),
t && i && n
? ((this._data.lines = o.lines), (this._lines = o.lines))
: ((this._linesMaxWidth = null),
(e.lines = this.wordWrap(e.text, e.wordWrapWidth)),
(this._lines = e.lines));
}),
(function() {
function e() {
var e = document.createElement('canvas');
(e.width = 0), (e.height = 0), (t = e.getContext('2d')), (e = null);
}
var t;
(n.prototype.setPoints = function(e, t) {
(this._data.points = e), (this._hittest = t || new o(o.MOVEPOINT));
}),
(n.prototype._getLinesMaxWidth = function() {
var i, n;
if (null !== this._linesMaxWidth) return this._linesMaxWidth;
if (
(t || e(),
(t.textBaseline = 'alphabetic'),
(t.font = this.fontStyle()),
this._data.wordWrapWidth)
)
return this._data.wordWrapWidth;
for (i = 0, n = 0; n < this._lines.length; n++)
i = Math.max(i, t.measureText(this._lines[n]).width);
return (this._linesMaxWidth = i), i;
}),
(n.prototype.measure = function() {
var e = this._fontSize,
t = this._getLinesMaxWidth(),
i = e * this._lines.length,
n = ~~(e / 6);
return (
this._data.backgroundHorzInflate && (t += 2 * this._data.backgroundHorzInflate),
this._data.backgroundVertInflate && (i += 2 * this._data.backgroundVertInflate),
(t = Math.ceil(t + 2 * n)),
(i = Math.ceil(i + 2 * n)),
t % 2 != 0 && t++,
this._data.padding && (i += this._data.padding),
{ width: t, height: i, textBgPadding: n }
);
}),
(n.prototype.wordWrap = function(i, n, o) {
var r, s, a, l, c, h, u, d, p;
if (
(t || e(),
(n = +n),
(i += ''),
(r = i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/)),
r[r.length - 1] || r.pop(),
!isFinite(n) || n <= 0)
)
return r;
for (t.font = o || this.fontStyle(), s = [], a = 0; a < r.length; a++)
if (((l = r[a]), (c = t.measureText(l).width) <= n)) s.push(l);
else
for (h = l.split(/([-\)\]\},.!?:;])|(\s+)/); h.length; ) {
if (
(u = ~~(((n / c) * (h.length + 2)) / 3)) <= 0 ||
t.measureText(h.slice(0, 3 * u - 1).join('')).width <= n
)
for (; t.measureText(h.slice(0, 3 * (u + 1) - 1).join('')).width <= n; ) u++;
else
for (; u > 0 && t.measureText(h.slice(0, 3 * --u - 1).join('')).width > n; );
if (u > 0) s.push(h.slice(0, 3 * u - 1).join('')), h.splice(0, 3 * u);
else {
if (
((d = h[0] + (h[1] || '')),
(p = 1 === p ? 1 : ~~((n / t.measureText(d)) * d.length)),
t.measureText(d.substr(0, p)).width <= n)
)
for (; t.measureText(d.substr(0, p + 1)).width <= n; ) p++;
else for (; p > 1 && t.measureText(d.substr(0, --p)).width > n; );
p < 1 && (p = 1), s.push(d.substr(0, p)), (h[0] = d.substr(p)), (h[1] = '');
}
if ((c = t.measureText(h.join('')).width) <= n) {
s.push(h.join(''));
break;
}
}
return s;
});
})(),
(n.prototype._x = function() {
return this._data.points[0].x + this._data.offsetX;
}),
(n.prototype._y = function() {
var e,
t = this._fontSize * this._lines.length;
switch (
(this._data.scaleY && (t *= this._data.scaleY),
(e = this._data.points[0].y + this._data.offsetY + t),
this._data.vertAlign)
) {
case 'top':
break;
case 'bottom':
e -= t;
break;
case 'middle':
e -= t / 2;
}
return e;
}),
(n.prototype.fontStyle = function() {
return (
(this._data.bold ? 'bold ' : '') +
(this._data.italic ? 'italic ' : '') +
this._fontSize +
'px ' +
this._data.font
);
}),
(n.prototype.draw = function(e) {
var t, i, n, o, a, l, c, h, u, d, p, _, f, m, y, g;
if (0 !== this._data.points.length) {
switch (
((t = this._x()),
(i = this._y()),
(n = this._fontSize),
this._data.scaleY && (n *= this._data.scaleY),
(i -= n * (this._lines.length - 1)),
(e.textBaseline = 'alphabetic'),
(e.font = this.fontStyle()),
this._data.horzAlign)
) {
case 'left':
e.textAlign = 'start';
break;
case 'right':
e.textAlign = 'end';
break;
case 'center':
e.textAlign = 'center';
}
if (
(e.translate(t + 0.5, i + 0.5),
(t = 0),
(i = 0),
(n = this._fontSize),
this._data.scaleX &&
this._data.scaleY &&
((o = Math.min(this._data.scaleX, this._data.scaleY)), e.scale(o, o)),
(a = this._getLinesMaxWidth()),
(l = r(e, a)),
(c = 0),
this._data.backgroundColor ||
this._data.borderColor ||
(this._data.highlightBorder && this._data.wordWrapWidth))
) {
switch (((h = t), this._data.horzAlign)) {
case 'left':
break;
case 'right':
h -= a;
break;
case 'center':
h -= a / 2;
}
(u = n * this._lines.length),
(d = ~~(n / 6)),
this._data.backgroundHorzInflate &&
((a += 2 * this._data.backgroundHorzInflate),
(h -= this._data.backgroundHorzInflate)),
this._data.backgroundVertInflate &&
((u += 2 * this._data.backgroundVertInflate),
(i += this._data.backgroundVertInflate)),
(p = {
x: Math.floor(h - d),
y: Math.floor(i - n),
w: Math.ceil(a + 2 * d),
h: Math.ceil(u + 2 * d),
}),
p.w % 2 != 0 && p.w++,
this._data.padding && ((p.h += this._data.padding), (c = this._data.padding)),
this._data.backgroundVertInflate && (i += this._data.backgroundVertInflate),
this._data.backgroundRoundRect
? (s(e, p.x, p.y, p.w, p.h, this._data.backgroundRoundRect),
this._data.backgroundColor &&
((e.fillStyle = this._data.backgroundColor), e.fill()),
this._data.borderColor &&
((_ = ~~Math.max(n / 12, 1)),
(e.strokeStyle = this._data.borderColor),
(e.lineWidth = _),
e.stroke()))
: (this._data.backgroundColor &&
((e.fillStyle = this._data.backgroundColor), e.fillRect(p.x, p.y, p.w, p.h)),
this._data.borderColor
? ((_ = ~~Math.max(n / 12, 1)),
(e.strokeStyle = this._data.borderColor),
(e.lineWidth = _),
e.strokeRect(p.x - _ / 2, p.y - _ / 2, p.w + _, p.h + _))
: this._data.highlightBorder &&
((e.strokeStyle = this._data.color),
(e.lineWidth = 1),
e.beginPath(),
(y = [3, 1]),
e.dashedLineTo(p.x - 0.5, (m = p.y - 0.5), (f = p.x + p.w + 0.5), m, y),
e.dashedLineTo(f, m, f, (m = p.y + p.h + 0.5), y),
e.dashedLineTo((f = p.x - 0.5), m, p.x + p.w + 0.5, m, y),
e.dashedLineTo(f, p.y - 0.5, f, m, y),
e.stroke()));
}
for (
this._data.backgroundVertInflate &&
!this._data.backgroundColor &&
(i += 2 * this._data.backgroundVertInflate),
e.fillStyle = this._data.color,
this._data.forceTextAlign &&
(e.textAlign = this._data.horzAlign ? this._data.horzAlign : 'left'),
this._data.forceTextAlign || (t += l),
g = 0;
g < this._lines.length;
g++
)
e.fillText(this._lines[g], t, i), (i += n + c);
}
}),
(n.prototype.hitTest = function(e) {
var t, i, n, o, r, s;
return 0 === this._data.points.length
? null
: ((t = this._fontSize),
this._data.scaleY && (t *= this._data.scaleY),
(i = this._getLinesMaxWidth()),
this._data.scaleX && (i *= this._data.scaleX),
(n = this._data.points[0].x + this._data.offsetX),
(o = this._data.points[0].y + this._data.offsetY),
'bottom' === this._data.vertAlign && (o -= this._lines.length * this._fontSize),
'middle' === this._data.vertAlign && (o -= (this._lines.length * this._fontSize) / 2),
'right' === this._data.horzAlign
? (n -= i)
: 'center' === this._data.horzAlign && (n -= i / 2),
(r = this._data.backgroundColor || this._data.borderColor ? ~~(t / 6) : 0),
(s = this._data.borderColor ? ~~Math.max(t / 12, 1) : 0),
e.x >= n - r - s &&
e.x <= n + i + r + s &&
e.y >= o - s &&
e.y <= o + this._lines.length * this._fontSize + 2 * r + s
? this._hittest
: null);
}),
(t.TextRenderer = n);
},
,
,
function(e, t, i) {
'use strict';
function n(e) {
return '.' + e.replace(/\+/g, '');
}
function o(e, t, i, o) {
var r, s;
void 0 === i && (i = 'keydown'),
(r = n(e)),
(s = o ? $(o) : u),
s.unbind(i + r).bind(i + r, e, function(e) {
$(e.target).is('input[type=password]') ||
d ||
t.apply(null, Array.prototype.slice.call(arguments));
}),
(h[e] = t);
}
function r(e, t, i) {
void 0 === t && (t = 'keydown'), (i ? $(i) : u).unbind(t + n(e)), delete h[e];
}
function s() {
return d ? null : (d = Object(c.randomHashN)(4));
}
function a(e) {
if (e !== d) throw Error('Lock id is outdated');
d = null;
}
var l, c, h, u, d;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.bind = o),
(t.unbind = r),
(t.disable = s),
(t.enable = a),
(l = i(14)),
i.n(l),
(c = i(33)),
(h = {}),
(u = $(document)),
(d = null);
},
function(e, t, i) {
'use strict';
function n(e) {
this._data = e;
}
function o(e, t) {
(this._data = e), (this._model = t), (this.radius = this._data.radius || o.OUTER_RADIUS);
}
function r(e) {
n.call(this, e);
}
var s = i(9).HitTestResult,
a = i(167).PaneRendererArrowsUpDown;
i(71),
(n.RADIUS = 3.5),
(n.prototype.tolerance = 2),
(n.prototype.draw = function(e) {
function t(e) {
return (
void 0 === e.x ||
TradingView.isNaN(e.x) ||
null === e.x ||
void 0 === e.y ||
TradingView.isNaN(e.y) ||
null === e.y
);
}
var i, n, o;
if (this._data)
for (
e.strokeStyle = '#6B6B6B',
e.fillStyle = '#D6D6D6',
i = this._data.vertOffset || 0,
n = 0;
n < this._data.points.length;
n++
)
(o = this._data.points[n]), t(o) || this._drawMarker(e, o, i);
}),
(n.prototype._drawMarker = function(e, t, i) {
e.beginPath(),
e.arc(t.x + 0.5, t.y + 0.5 + i, n.RADIUS, 0, 2 * Math.PI, !0),
e.closePath(),
e.fill(),
e.stroke();
}),
(n.prototype.hitTest = function(e) {
var t, i;
if (!this._data) return null;
for (t = 0; t < this._data.points.length; t++)
if (((i = this._data.points[t]), i.subtract(e).length() <= n.RADIUS + this.tolerance))
return new s(this._data.hittestResult, i.data);
return null;
}),
(o.OUTER_RADIUS = TradingView.isMobile.any() ? 16 : 8),
(o.prototype.tolerance = 2),
(o.prototype.draw = function(e) {
var t,
i,
n,
o,
r,
s,
a,
l,
c,
h = this._data.currentPoint,
u = this._data.outerStrokeWidth || 1;
for (t = 0; t < this._data.points.length; t++)
(i = this._data.points[t]),
(n = i.subtract(h).length()),
(o = TradingView.isInteger(i.data) && this._data.linePointBeingEdited === i.data),
(r = this.radius),
(s = this._data.strokeWidth || 2),
(a = n <= r + this.tolerance),
(l = a ? 1 : 0),
(r += l),
(s += l),
o ||
(i.square
? ((e.fillStyle = this._data.backgroundColor),
e.fillRect(i.x - r, i.y - r, 2 * r, 2 * r),
(e.fillStyle = this._data.color),
(c = r - u),
e.fillRect(i.x - c, i.y - c, 2 * c, 2 * c),
(c = r - u - s),
(e.fillStyle = this._data.backgroundColor),
e.fillRect(i.x - c, i.y - c, 2 * c, 2 * c))
: (e.beginPath(),
e.arc(i.x, i.y, r, 0, 2 * Math.PI, !0),
e.closePath(),
(e.fillStyle = this._data.backgroundColor),
e.fill(),
e.beginPath(),
e.arc(i.x, i.y, r - u, 0, 2 * Math.PI, !0),
e.closePath(),
(e.fillStyle = this._data.color),
e.fill(),
e.beginPath(),
e.arc(i.x, i.y, r - u - s, 0, 2 * Math.PI, !0),
e.closePath(),
(e.fillStyle = this._data.backgroundColor),
e.fill()));
}),
(o.prototype.hitTest = function(e) {
var t, i, n;
for (t = 0; t < this._data.points.length; t++)
if (
((i = this._data.points[t]),
(n = i.subtract(e).length()),
n <= this.radius + this.tolerance)
)
return new s(this._data.hittestResult, i.data);
return null;
}),
inherit(r, n),
(r.prototype._drawMarker = function(e, t, i) {
var o = t.isUp ? 1 : -1,
r = a.prototype._calculateVerticalOffset(this._data.barSpacing),
s = a.prototype._calculateMinHeight(this._data.barSpacing),
l = i + o * r + o * s;
e.beginPath(),
e.arc(t.x + 0.5, t.y + 0.5 + l, n.RADIUS, 0, 2 * Math.PI, !0),
e.closePath(),
e.fill(),
e.stroke();
}),
(t.SelectionRenderer = n),
(t.LineAnchor = o),
(t.SelectionRendererArrowsUpDown = r);
},
,
,
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'LimitedPrecisionNumericFormatter', function() {
return o;
}),
(n = i(12)),
i.n(n),
(o = (function() {
function e(e) {
void 0 === e && (e = 1), (this._precision = e);
}
return (
(e.prototype.format = function(e) {
var t, i;
return (
Object(n.isNumber)(e) || (e = parseFloat(e)),
(t = e.toFixed(this._precision)),
(i = Math.pow(10, -this._precision)),
Math.max(parseFloat(t), i) + ''
);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t, i) {
return e * (1 - i) + t * i;
}
function o(e) {
return new l(e);
}
var r, s, a, l;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.doAnimate = o),
(r = i(1)),
(s = i(184)),
(a = { from: 0, duration: 250, easing: s.easingFunc.easeOutCubic }),
(l = (function() {
function e(e) {
var t,
i = this;
(this._doing = !0),
(this._options = r.a({}, a, e)),
(t = performance.now()),
window.requestAnimationFrame(function(e) {
i._animation(t, i._options.from, e);
});
}
return (
(e.prototype.stop = function() {
this._doing = !1;
}),
(e.prototype._animation = function(e, t, i) {
var o,
r,
s,
a,
l,
c = this;
return this._doing
? ((i = !i || i < 1e12 ? performance.now() : i),
(o = i - e),
(r = o >= this._options.duration || t === this._options.to),
(s = n(
this._options.from,
this._options.to,
this._options.easing(o / this._options.duration),
)),
(a = r ? this._options.to : s),
(l = a - t),
this._options.onStep(l, a),
r
? void this._finishAnimation()
: void window.requestAnimationFrame(function(t) {
c._animation(e, a, t);
}))
: void this._finishAnimation();
}),
(e.prototype._finishAnimation = function() {
this._options.onComplete && this._options.onComplete();
}),
e
);
})());
},
function(e, t) {
e.exports =
'
';
},
function(e, t, i) {
'use strict';
var n, o, r, s, a;
Object.defineProperty(t, '__esModule', { value: !0 }),
(n = i(488)),
Object.defineProperty(t, 'AutocompleteField', {
enumerable: !0,
get: function() {
return n.AutocompleteField;
},
}),
(o = i(492)),
Object.defineProperty(t, 'CheckboxField', {
enumerable: !0,
get: function() {
return o.CheckboxField;
},
}),
(r = i(254)),
Object.defineProperty(t, 'InputField', {
enumerable: !0,
get: function() {
return r.InputField;
},
}),
(s = i(493)),
Object.defineProperty(t, 'InputFieldRegExp', {
enumerable: !0,
get: function() {
return s.InputFieldRegExp;
},
}),
(a = i(253)),
Object.defineProperty(t, 'SaveRenameDialog', {
enumerable: !0,
get: function() {
return a.SaveRenameDialog;
},
});
},
function(e, t, i) {
'use strict';
function n(e, t, n, s) {
var a = Object(o.loadPropertyPages)(),
l = function(o, r) {
i.e(17)
.then(
function(r) {
a.then(function() {
var r = i(357),
a = new r(e, t, s);
a.show(n), o(a);
});
}.bind(null, i),
)
.catch(r);
};
return Object(r.retries)(function(e) {
return new Promise(l);
}, 2);
}
var o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.showEditObjectDialog = n),
(o = i(2)),
i.n(o),
(r = i(134));
},
function(e, t, i) {
'use strict';
var n, o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'HEADER_TOOLBAR_HEIGHT_EXPANDED', function() {
return o;
}),
i.d(t, 'HEADER_TOOLBAR_HEIGHT_COLLAPSED', function() {
return r;
}),
(n = i(477)),
i.n(n),
(o = parseInt(n['css-value-header-toolbar-height'])),
(r = 3);
},
function(e, t, i) {
'use strict';
var n, o, r, s, a;
i.d(t, 'a', function() {
return s;
}),
i.d(t, 'b', function() {
return a;
}),
(n = i(1)),
(o = i(8)),
(r = i.n(o)),
(s = (function() {
function e(e, t, i, n, o) {
var s = this;
(this._onChange = new r.a()),
(this._handleChange = function() {
s._onChange.fire(s.get());
}),
(this._crossTabEvents = e),
(this._jsonKeyValueStore = t),
(this.CROSSTAB_EVENT_NAME = i),
(this.JSON_STORE_KEY = n),
(this.defaultStoreValue = this._serialize(o)),
this._subscribe();
}
return (
(e.prototype.get = function() {
var e = this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY, this.defaultStoreValue);
return this._deserialize(e);
}),
(e.prototype.set = function(e, t) {
var i = this._serialize(e);
this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY, i, t),
this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),
this._onChange.fire(e);
}),
(e.prototype.getOnChange = function() {
return this._onChange;
}),
(e.prototype.destroy = function() {
this._unsubscribe(), this._onChange.destroy(), delete this._onChange;
}),
(e.prototype._subscribe = function() {
this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME, this._handleChange),
this._jsonKeyValueStore.onSync.subscribe(this, this._handleChange);
}),
(e.prototype._unsubscribe = function() {
this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME, this._handleChange),
this._jsonKeyValueStore.onSync.unsubscribe(this, this._handleChange);
}),
e
);
})()),
(a = (function(e) {
function t() {
return (null !== e && e.apply(this, arguments)) || this;
}
return (
n.c(t, e),
(t.prototype._serialize = function(e) {
return e;
}),
(t.prototype._deserialize = function(e) {
return e;
}),
t
);
})(s));
},
function(e, t, i) {
'use strict';
function n(e) {
for (var t = 0; t < u.length; t++) if (e === u[t].id) return !0;
return !1;
}
var o, r, s, a, l, c, h, u;
for (
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'availableTimezones', function() {
return u;
}),
t.timezoneIsAvailable = n,
i(11),
o = i(340),
r = [
{ id: 'Etc/UTC', title: $.t('UTC') },
{ id: 'exchange', title: $.t('Exchange') },
],
s = [
{ id: 'Africa/Cairo', title: $.t('Cairo'), offset: 0 },
{ id: 'Africa/Johannesburg', title: $.t('Johannesburg'), offset: 0 },
{ id: 'Africa/Lagos', title: $.t('Lagos'), offset: 0 },
{ id: 'America/Argentina/Buenos_Aires', title: $.t('Buenos Aires'), offset: 0 },
{ id: 'America/Bogota', title: $.t('Bogota'), offset: 0 },
{ id: 'America/Caracas', title: $.t('Caracas'), offset: 0 },
{ id: 'America/Chicago', title: $.t('Chicago'), offset: 0 },
{ id: 'America/El_Salvador', title: $.t('San Salvador'), offset: 0 },
{ id: 'America/Juneau', title: $.t('Juneau'), offset: 0 },
{ id: 'America/Lima', title: $.t('Lima'), offset: 0 },
{ id: 'America/Los_Angeles', title: $.t('Los Angeles'), offset: 0 },
{ id: 'America/Mexico_City', title: $.t('Mexico City'), offset: 0 },
{ id: 'America/New_York', title: $.t('New York'), offset: 0 },
{ id: 'America/Phoenix', title: $.t('Phoenix'), offset: 0 },
{ id: 'America/Santiago', title: $.t('Santiago'), offset: 0 },
{ id: 'America/Sao_Paulo', title: $.t('Sao Paulo'), offset: 0 },
{ id: 'America/Toronto', title: $.t('Toronto'), offset: 0 },
{ id: 'America/Vancouver', title: $.t('Vancouver'), offset: 0 },
{ id: 'Asia/Almaty', title: $.t('Almaty'), offset: 0 },
{ id: 'Asia/Ashkhabad', title: $.t('Ashkhabad'), offset: 0 },
{ id: 'Asia/Bahrain', title: $.t('Bahrain'), offset: 0 },
{ id: 'Asia/Bangkok', title: $.t('Bangkok'), offset: 0 },
{ id: 'Asia/Chongqing', title: $.t('Chongqing'), offset: 0 },
{ id: 'Asia/Dubai', title: $.t('Dubai'), offset: 0 },
{ id: 'Asia/Ho_Chi_Minh', title: $.t('Ho Chi Minh'), offset: 0 },
{ id: 'Asia/Hong_Kong', title: $.t('Hong Kong'), offset: 0 },
{ id: 'Asia/Jakarta', title: $.t('Jakarta'), offset: 0 },
{ id: 'Asia/Jerusalem', title: $.t('Jerusalem'), offset: 0 },
{ id: 'Asia/Kolkata', title: $.t('Kolkata'), offset: 0 },
{ id: 'Asia/Kuwait', title: $.t('Kuwait'), offset: 0 },
{ id: 'Asia/Muscat', title: $.t('Muscat'), offset: 0 },
{ id: 'Asia/Qatar', title: $.t('Qatar'), offset: 0 },
{ id: 'Asia/Riyadh', title: $.t('Riyadh'), offset: 0 },
{ id: 'Asia/Seoul', title: $.t('Seoul'), offset: 0 },
{ id: 'Asia/Shanghai', title: $.t('Shanghai'), offset: 0 },
{ id: 'Asia/Singapore', title: $.t('Singapore'), offset: 0 },
{ id: 'Asia/Taipei', title: $.t('Taipei'), offset: 0 },
{ id: 'Asia/Tehran', title: $.t('Tehran'), offset: 0 },
{ id: 'Asia/Tokyo', title: $.t('Tokyo'), offset: 0 },
{ id: 'Atlantic/Reykjavik', title: $.t('Reykjavik'), offset: 0 },
{ id: 'Australia/Adelaide', title: $.t('Adelaide'), offset: 0 },
{ id: 'Australia/Brisbane', title: $.t('Brisbane'), offset: 0 },
{ id: 'Australia/Perth', title: $.t('Perth'), offset: 0 },
{ id: 'Australia/Sydney', title: $.t('Sydney'), offset: 0 },
{ id: 'Europe/Athens', title: $.t('Athens'), offset: 0 },
{ id: 'Europe/Belgrade', title: $.t('Belgrade'), offset: 0 },
{ id: 'Europe/Berlin', title: $.t('Berlin'), offset: 0 },
{ id: 'Europe/Copenhagen', title: $.t('Copenhagen'), offset: 0 },
{ id: 'Europe/Helsinki', title: $.t('Helsinki'), offset: 0 },
{ id: 'Europe/Istanbul', title: $.t('Istanbul'), offset: 0 },
{ id: 'Europe/London', title: $.t('London'), offset: 0 },
{ id: 'Europe/Luxembourg', title: $.t('Luxembourg'), offset: 0 },
{ id: 'Europe/Madrid', title: $.t('Madrid'), offset: 0 },
{ id: 'Europe/Moscow', title: $.t('Moscow'), offset: 0 },
{ id: 'Europe/Oslo', title: $.t('Oslo'), offset: 0 },
{ id: 'Europe/Paris', title: $.t('Paris'), offset: 0 },
{ id: 'Europe/Riga', title: $.t('Riga'), offset: 0 },
{ id: 'Europe/Rome', title: $.t('Rome'), offset: 0 },
{ id: 'Europe/Stockholm', title: $.t('Stockholm'), offset: 0 },
{ id: 'Europe/Tallinn', title: $.t('Tallinn'), offset: 0 },
{ id: 'Europe/Vilnius', title: $.t('Vilnius'), offset: 0 },
{ id: 'Europe/Warsaw', title: $.t('Warsaw'), offset: 0 },
{ id: 'Europe/Zurich', title: $.t('Zurich'), offset: 0 },
{ id: 'Pacific/Auckland', title: $.t('New Zealand'), offset: 0 },
{ id: 'Pacific/Chatham', title: $.t('Chatham Islands'), offset: 0 },
{ id: 'Pacific/Fakaofo', title: $.t('Tokelau'), offset: 0 },
{ id: 'Pacific/Honolulu', title: $.t('Honolulu'), offset: 0 },
{ id: 'Pacific/Norfolk', title: $.t('Norfolk Island'), offset: 0 },
],
a = 0,
l = s;
a < l.length;
a++
)
(c = l[a]),
(h = Object(o.a)(c.id)),
(c.title = '(' + h.string + ') ' + c.title),
(c.offset = h.offset);
s.sort(function(e, t) {
var i = e.offset - t.offset;
return 0 !== i ? i : e.title.localeCompare(t.title);
}),
(u = r.concat(s));
},
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'DateFormatter', function() {
return o;
}),
(n = i(21)),
(o = (function() {
function e() {}
return (
(e.prototype.format = function(e) {
return n.customFormatters && n.customFormatters.dateFormatter
? n.customFormatters.dateFormatter.format(e)
: Object(n.numberToStringWithLeadingZero)(e.getUTCFullYear(), 4) +
'-' +
Object(n.numberToStringWithLeadingZero)(e.getUTCMonth() + 1, 2) +
'-' +
Object(n.numberToStringWithLeadingZero)(e.getUTCDate(), 2);
}),
(e.prototype.formatLocal = function(e) {
return n.customFormatters.dateFormatter
? n.customFormatters.dateFormatter.formatLocal
? n.customFormatters.dateFormatter.formatLocal(e)
: n.customFormatters.dateFormatter.format(e)
: Object(n.numberToStringWithLeadingZero)(e.getFullYear(), 4) +
'-' +
Object(n.numberToStringWithLeadingZero)(e.getMonth() + 1, 2) +
'-' +
Object(n.numberToStringWithLeadingZero)(e.getDate(), 2);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t) {
var i, n;
return (
(i = null == t ? document.documentElement : 9 === t.nodeType ? t.documentElement : t),
r && (n = r.get(i)),
n || ((n = i.ownerDocument.createRange()), n.selectNodeContents(i), r && r.set(i, n)),
n.createContextualFragment(e)
);
}
function o(e, t) {
var i,
o,
r,
s = n(e, t);
if ('firstElementChild' in s) i = s.firstElementChild;
else
for (i = null, o = 0; o < s.childNodes.length; o++)
if (((r = s.childNodes[o]), 1 === r.nodeType)) {
i = r;
break;
}
return null !== i && s.removeChild(i), i;
}
(t.a = n), (t.b = o);
var r;
'WeakMap' in window && (r = new WeakMap());
},
function(e, t, i) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'LineToolBarsPatternMode', function() {
return n;
});
var n;
!(function(e) {
(e[(e.Bars = 0)] = 'Bars'),
(e[(e.Line = 1)] = 'Line'),
(e[(e.OpenClose = 2)] = 'OpenClose'),
(e[(e.LineOpen = 3)] = 'LineOpen'),
(e[(e.LineHigh = 4)] = 'LineHigh'),
(e[(e.LineLow = 5)] = 'LineLow'),
(e[(e.LineHL2 = 6)] = 'LineHL2');
})(n || (n = {}));
},
function(e, t, i) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = function(e) {
return e.reduce(function(e, t, i) {
return ~e.indexOf(t) || e.push(t), e;
}, []);
}),
(e.exports = t.default);
},
function(e, t, i) {
'use strict';
function n(e, t, i) {
var n,
o,
r,
s,
a = null,
l = 0;
return (
(i = i || {}),
(s = function() {
(l = !1 === i.leading ? 0 : Date.now()),
(a = null),
(r = e.apply(n, o)),
a || (n = o = null);
}),
function() {
var c,
h = Date.now();
return (
l || !1 !== i.leading || (l = h),
(c = t - (h - l)),
(n = this),
(o = arguments),
c <= 0 || c > t
? (a && (clearTimeout(a), (a = null)),
(l = h),
(r = e.apply(n, o)),
a || (n = o = null))
: a || !1 === i.trailing || (a = setTimeout(s, c)),
r
);
}
);
}
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.default = n),
(e.exports = t.default);
},
function(e, t, i) {
'use strict';
var n, o, r, s, a, l, c;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'isDrawingToolbarVisible', function() {
return c;
}),
(n = i(49)),
i.n(n),
(o = i(5)),
i.n(o),
(r = i(16)),
(s = i.n(r)),
(a = !o.enabled('hide_left_toolbar_by_default')),
(l = n.getBool('ChartDrawingToolbarWidget.visible', a)),
(c = new s.a(l));
},
function(e, t) {
e.exports = {
inputWrapper: 'inputWrapper-6bNZbTW4-',
textInput: 'textInput-3WRWEmm7-',
error: 'error-v0663AtN-',
success: 'success-7iP8kTY5-',
textInputLeftDirection: 'textInputLeftDirection-mlAXPh8V-',
xsmall: 'xsmall-3Ah_Or2--',
small: 'small-2bmxiJCE-',
large: 'large-1JDowW2I-',
iconed: 'iconed-3ZQvxTot-',
inputIcon: 'inputIcon-W_Bse-a1-',
clearable: 'clearable-2tabt_rj-',
clearIcon: 'clearIcon-389FR5J4-',
grouped: 'grouped-34HX1lDr-',
};
},
function(e, t, i) {
'use strict';
i(496),
(function(e) {
function t(e, t, i) {
for (var n = 0; n < a.length; n++)
a[n] || (t = t.toLowerCase()), e.addEventListener(a[n] + t, i, !1);
}
function i(t) {
var i = t.data(h).complete;
n(t), i && e.isFunction(i) && i();
}
function n(e) {
e.stop(!0), e.css('background-color', ''), e.removeData(c), e.removeData(h);
}
function o(e) {
var t = e.data(c);
t && (!0 !== t ? (t--, t ? (r(e), e.data(c, t)) : i(e)) : r(e));
}
function r(e) {
var t = e.css('background-color'),
i = e.data(h),
n = i.highlightColor || u,
r = i.duration || d,
s = i.easing || p;
e.animate({ 'background-color': n }, r, s).animate(
{ 'background-color': t },
r,
s,
o.bind(e, e),
);
}
var s,
a,
l,
c,
h,
u,
d,
p,
_ = !1,
f = document.body || document.documentElement,
m = 'animation',
y = 'Webkit Moz O ms Khtml'.split(' '),
g = '';
if ((void 0 !== f.style.animationName && (_ = !0), !1 === _))
for (s = 0; s < y.length; s++)
if (void 0 !== f.style[y[s] + 'AnimationName']) {
(g = y[s]), (m = g + 'Animation'), '-' + g.toLowerCase() + '-', (_ = !0);
break;
}
(a = ['webkit', 'moz', 'MS', 'o', '']),
(l = 'flicker-'),
(c = l + 'enable'),
(h = l + 'options'),
(u = '#fbf8e9'),
(d = 400),
(p = 'swing'),
(e.fn.highlight = function(i, o) {
switch (i) {
default:
return (
(i = void 0 === i || i),
this.each(function() {
var n, s;
_
? ((i = !0 === i ? 'infinite' : i),
t(this, 'AnimationEnd', function() {
this.style[m] = '';
}),
(n = document.getElementsByTagName('html')[0].classList),
n.contains('theme-dark')
? (this.style[m] =
'highlight-animation-theme-dark 0.4s ease-in-out ' +
i +
' alternate')
: (this.style[m] =
'highlight-animation 0.4s ease-in-out ' + i + ' alternate'))
: ((s = e(this)),
s.data(c, i),
s.data(h, e.extend({}, o || {})),
s.is(':animated') || r(s));
})
);
case !1:
return this.each(function() {
_ ? (this.style[m] = '') : n(e(this));
});
}
});
})(jQuery);
},
function(e, t, i) {
'use strict';
function n(e) {
return new Promise(function(t) {
i.e(2)
.then(
function(n) {
var o = i(188).createDialog;
t(o(r.a({}, a, e)));
}.bind(null, i),
)
.catch(i.oe);
});
}
function o(e) {
n(e).then(function(e) {
return e.open();
});
}
var r, s, a;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.createNoticeDialog = n),
(t.showNoticeDialog = o),
(r = i(1)),
(s = i(14)),
i.n(s),
i(11),
(a = {
width: 400,
destroyOnClose: !0,
title: window.t('Notification'),
content: window.t('You are notified'),
contentWrapTemplate:
'
',
actionsWrapTemplate:
'
',
actions: [
{ name: 'ok', type: 'primary', text: window.t('Ok'), method: 'close', key: [13, 32] },
],
});
},
function(e, t, i) {
'use strict';
function n(e) {
(this._data = e),
(this.bars = e.bars),
(this._barWidth = o.optimalBarWidth(e.barSpacing)),
(this._barBorderWidth = 1);
}
var o = i(27),
r = i(9).HitTestResult;
(n.prototype.draw = function(e) {
var t,
i,
n,
o,
r,
s,
a,
l,
c,
h,
u,
d,
p,
_,
f = this.bars,
m = this._data.barSpacing,
y = this._data.drawWick,
g = this._data.drawBorder,
v = this._data.wickColor,
S = this._barBorderWidth,
b = this._barWidth;
if (((e.lineCap = 'square'), (e.lineStyle = this._data.lineStyle), m < 1)) {
if (y) {
for (e.strokeStyle = v, e.lineWidth = 1, e.beginPath(), h = f.length; h-- > 0; )
(u = f[h]), e.moveTo(u.time, u.low), e.lineTo(u.time, u.high);
e.stroke();
}
for (e.lineWidth = 1, d = '', p = !1, e.beginPath(), h = f.length; h-- > 0; )
(u = f[h]),
(c = u.time),
d !== u.color &&
(p && (e.stroke(), e.beginPath(), (p = !1)),
(e.strokeStyle = u.color),
(d = u.color)),
e.moveTo(u.time, u.open),
e.lineTo(u.time, u.close),
(p = !0);
p && e.stroke();
} else {
if (
((f = f.slice().sort(function(e, t) {
return e.color > t.color ? -1 : e.color < t.color ? 1 : 0;
})),
e.translate(-0.5, -0.5),
(e.lineWidth = S),
y)
)
for (_ = v, e.fillStyle = v, h = f.length; h--; )
(u = f[h]),
(c = u.time),
(t = u.open),
(i = u.high),
(n = u.low),
(o = u.close),
u.wickColor &&
u.wickColor !== _ &&
((e.fillStyle = u.wickColor), (_ = u.wickColor)),
(a = Math.min(t, o)),
(l = Math.max(t, o)),
u.hollow
? (e.fillRect(c, i, 1, a - i), e.fillRect(c, l, 1, n - l))
: e.fillRect(c, i, 1, n - i);
if (g)
for (h = f.length; h--; )
(u = f[h]),
(f[h + 1] && u.borderColor === f[h + 1].borderColor) ||
(e.fillStyle = u.borderColor),
u.hollow ||
((c = u.time),
(t = u.open),
(o = u.close),
(r = Math.round(c - b)),
(s = Math.round(c + b)),
(a = Math.min(t, o)),
(l = Math.max(t, o)),
e.fillRect(r, a, s - r + 1, l - a + 1));
for (h = f.length; h--; )
(u = f[h]),
(c = u.time),
(t = u.open),
(i = u.high),
(n = u.low),
(o = u.close),
(r = Math.round(c - b)),
(s = Math.round(c + b)),
(a = Math.min(t, o)),
(l = Math.max(t, o)),
(f[h + 1] && u.color === f[h + 1].color) || (e.strokeStyle = u.color),
(e.fillStyle = u.color),
Math.abs(a - l) <= 1 && (e.fillStyle = u.borderColor),
u.hollow
? (e.translate(-0.5, -0.5),
e.strokeRect(r + 1, a + 1, s - r, l - a),
e.translate(0.5, 0.5))
: (g && ((r += 1), (a += 1), (s -= 1), (l -= 1)),
e.fillRect(r, a, s - r + 1, l - a + 1));
}
}),
(n.prototype.hitTest = function(e) {
var t,
i,
n,
s,
a = this.bars,
l = 0.5 * this._data.barSpacing;
if (0 === a.length) return null;
if (e.x < a[0].time - l) return null;
if (e.x > a[a.length - 1].time + l) return null;
for (t = null, i = 0; i < a.length; ++i)
if (((n = a[i]), e.x <= n.time + l)) {
t = n;
break;
}
return (
(s = o.selectionTolerance(this._barBorderWidth)),
t && t.high - s <= e.y && e.y <= t.low + s
? this._data.hittest || new r(r.REGULAR)
: null
);
}),
(t.PaneRendererCandles = TradingView.PaneRendererCandles = n);
},
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'ScaleType', function() {
return n;
}),
i.d(t, 'plotShapesData', function() {
return o;
}),
i(11),
(function(e) {
(e[(e.Right = 0)] = 'Right'), (e[(e.Left = 1)] = 'Left'), (e[(e.None = 2)] = 'None');
})(n || (n = {})),
(o = {
shape_arrow_down: {
guiName: $.t('Arrow Down'),
id: 'shape_arrow_down',
paneRendererClass: 'PaneRendererArrowDown',
pineName: 'shape.arrowdown',
},
shape_arrow_up: {
guiName: $.t('Arrow Up'),
id: 'shape_arrow_up',
paneRendererClass: 'PaneRendererArrowUp',
pineName: 'shape.arrowup',
},
shape_circle: {
guiName: $.t('Circle'),
id: 'shape_circle',
paneRendererClass: 'PaneRendererCircleShape',
pineName: 'shape.circle',
},
shape_cross: {
guiName: $.t('Cross'),
id: 'shape_cross',
paneRendererClass: 'PaneRendererCrossShape',
pineName: 'shape.cross',
},
shape_diamond: {
guiName: $.t('Diamond'),
id: 'shape_diamond',
paneRendererClass: 'PaneRendererDiamond',
pineName: 'shape.diamond',
},
shape_flag: {
guiName: $.t('Flag'),
id: 'shape_flag',
paneRendererClass: 'PaneRendererFlagShape',
pineName: 'shape.flag',
},
shape_label_down: {
guiName: $.t('Label Down'),
id: 'shape_label_down',
paneRendererClass: 'PaneRendererLabelDown',
pineName: 'shape.labeldown',
},
shape_label_up: {
guiName: $.t('Label Up'),
id: 'shape_label_up',
paneRendererClass: 'PaneRendererLabelUp',
pineName: 'shape.labelup',
},
shape_square: {
guiName: $.t('Square'),
id: 'shape_square',
paneRendererClass: 'PaneRendererSquare',
pineName: 'shape.square',
},
shape_triangle_down: {
guiName: $.t('Triangle Down'),
id: 'shape_triangle_down',
paneRendererClass: 'PaneRendererTriangleApexDown',
pineName: 'shape.triangledown',
},
shape_triangle_up: {
guiName: $.t('Triangle Up'),
id: 'shape_triangle_up',
paneRendererClass: 'PaneRendererTriangleApexUp',
pineName: 'shape.triangleup',
},
shape_xcross: {
guiName: $.t('X Cross'),
id: 'shape_xcross',
paneRendererClass: 'PaneRendererXCross',
pineName: 'shape.xcross',
},
});
},
function(e, t, i) {
'use strict';
var n, o, r, s;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'MarkLocation', function() {
return n;
}),
i.d(t, 'HAlign', function() {
return o;
}),
i.d(t, 'VAlign', function() {
return r;
}),
i.d(t, 'LineStyle', function() {
return s;
}),
(function(e) {
(e.AboveBar = 'AboveBar'),
(e.BelowBar = 'BelowBar'),
(e.Top = 'Top'),
(e.Bottom = 'Bottom'),
(e.Right = 'Right'),
(e.Left = 'Left'),
(e.Absolute = 'Absolute'),
(e.AbsoluteUp = 'AbsoluteUp'),
(e.AbsoluteDown = 'AbsoluteDown');
})(n || (n = {})),
(function(e) {
(e.Left = 'left'), (e.Center = 'center'), (e.Right = 'right');
})(o || (o = {})),
(function(e) {
(e.Top = 'top'), (e.Middle = 'middle'), (e.Bottom = 'bottom');
})(r || (r = {})),
(function(e) {
(e[(e.Solid = 0)] = 'Solid'),
(e[(e.Dotted = 1)] = 'Dotted'),
(e[(e.Dashed = 2)] = 'Dashed');
})(s || (s = {}));
},
,
function(e, t, i) {
'use strict';
var n, o;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'BarsRange', function() {
return o;
}),
(n = i(7)),
i.n(n),
(o = (function() {
function e(e, t) {
Object(n.assert)(
e <= t,
'The last bar in the bars range should be greater than or equal to the first bar',
),
(this._firstBar = e),
(this._lastBar = t);
}
return (
(e.prototype.firstBar = function() {
return this._firstBar;
}),
(e.prototype.lastBar = function() {
return this._lastBar;
}),
(e.prototype.count = function() {
return this._lastBar - this._firstBar + 1;
}),
(e.prototype.contains = function(e) {
return this._firstBar <= e && e <= this._lastBar;
}),
(e.prototype.equals = function(e) {
return this._firstBar === e.firstBar() && this._lastBar === e.lastBar();
}),
e
);
})());
},
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
function(e, t, i) {
'use strict';
!(function(e) {
if (document.createElement('canvas') && document.createElement('canvas').getContext) {
var t = (function(t) {
var i =
t.backingStorePixelRatio ||
t.webkitBackingStorePixelRatio ||
t.mozBackingStorePixelRatio ||
t.msBackingStorePixelRatio ||
t.oBackingStorePixelRatio ||
t.backingStorePixelRatio ||
1;
return (e.devicePixelRatio || 1) / i;
})(document.createElement('canvas').getContext('2d'));
t <= 1 ||
((e.hidpiCanvasRatio = t),
(function(e) {
var i,
n,
o = function(e, t) {
for (var i in e) e.hasOwnProperty(i) && t(e[i], i);
},
r = {
fillRect: 'all',
clearRect: 'all',
strokeRect: 'all',
moveTo: 'all',
lineTo: 'all',
arc: [0, 1, 2],
arcTo: 'all',
bezierCurveTo: 'all',
isPointinPath: 'all',
isPointinStroke: 'all',
quadraticCurveTo: 'all',
rect: 'all',
translate: 'all',
createRadialGradient: 'all',
createLinearGradient: 'all',
drawImagePatchedSource: [1, 2, 3, 4],
};
(e.drawImagePatchedSource = e.drawImage),
(i = e.drawImage),
(e.drawImagePatchedSourceAndDest = function(e) {
var n,
o = Array.prototype.slice.call(arguments);
for (n = 1; n < o.length; ++n) o[n] && (o[n] *= t);
return (
o.length > 5 &&
('width' in e && (o[3] = Math.min(e.width, Math.max(1, o[3]))),
'height' in e && (o[4] = Math.min(e.height, Math.max(1, o[4])))),
i.apply(this, o)
);
}),
o(r, function(i, n) {
var o = e[n];
e[n] = function() {
var e, n;
if ('all' === i)
for (n = [], e = arguments.length; 0 < e--; ) n[e] = arguments[e] * t;
else
for (n = Array.prototype.slice.call(arguments), e = i.length; 0 < e--; )
n[i[e]] && (n[i[e]] = n[i[e]] * t);
return o.apply(this, n);
};
}),
(e.drawImage = (function(e) {
return function() {
return arguments[0] instanceof HTMLCanvasElement
? e.drawImagePatchedSourceAndDest.apply(this, arguments)
: e.drawImagePatchedSource.apply(this, arguments);
};
})(e)),
(n = /(\d+(?:\.\d+)?)(px|em|rem|pt)/g),
(e.fillText = (function(e) {
return function() {
var i = Array.prototype.slice.call(arguments);
(i[1] *= t),
(i[2] *= t),
(this.font = this.font.replace(n, function(e, i, n) {
return i * t + n;
})),
e.apply(this, i),
(this.font = this.font.replace(n, function(e, i, n) {
return i / t + n;
}));
};
})(e.fillText)),
(e.strokeText = (function(e) {
return function() {
var i = Array.prototype.slice.call(arguments);
(i[1] *= t),
(i[2] *= t),
(this.font = this.font.replace(n, function(e, i, n) {
return i * t + n;
})),
e.apply(this, i),
(this.font = this.font.replace(n, function(e, i, n) {
return i / t + n;
}));
};
})(e.strokeText));
})(CanvasRenderingContext2D.prototype),
(function(e) {
e.getContext = (function(e) {
return function(i) {
var n = e.call(this, i);
return (
'2d' === i &&
this.width !== Math.floor(parseInt(this.style.width) * t) &&
((this.style.height = this.height + 'px'),
(this.style.width = this.width + 'px'),
(this.width *= t),
(this.height *= t)),
n
);
};
})(e.getContext);
})(HTMLCanvasElement.prototype));
}
})(window);
},
function(e, t, i) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'LineToolPitchforkStyle', function() {
return n;
});
var n;
!(function(e) {
(e[(e.Original = 0)] = 'Original'),
(e[(e.Schiff = 1)] = 'Schiff'),
(e[(e.Inside = 2)] = 'Inside'),
(e[(e.Schiff2 = 3)] = 'Schiff2');
})(n || (n = {}));
},
function(e, t) {},
function(e, t, i) {
'use strict';
function n(e, t) {
i.e(21)
.then(i.bind(null, 699))
.then(function(i) {
new i.ChangeIntervalDialog(e).show(t);
});
}
Object.defineProperty(t, '__esModule', { value: !0 }), (t.showChangeIntervalDialog = n);
},
function(e, t, i) {
'use strict';
function n(e, t) {
var i, n;
return (
void 0 === e && (e = []),
void 0 === t && (t = []),
(i = document.createElement('div')),
(n = document.createElement('div')),
i.appendChild(n),
i.classList.add(o.container),
n.classList.add(o.inner),
e.forEach(function(e) {
i.classList.add(o[e]);
}),
t.forEach(function(e) {
i.classList.add(o[e]);
}),
i
);
}
var o;
(t.a = n), (o = i(478)), i.n(o);
},
function(e, t, i) {
'use strict';
function n(e) {
return Object(U.fetch)('/theme/?themeName=' + encodeURIComponent(e), {
credentials: 'include',
method: 'GET',
})
.then(function(e) {
return e.json();
})
.then(function(e) {
var t = {};
return e.content && (t.content = JSON.parse(e.content)), t;
});
}
function o() {
return (
Y ||
Object(U.fetch)('/themes/', { credentials: 'include', method: 'GET' }).then(function(e) {
return (Y = e.json());
})
);
}
function r(e, t) {
var i = new FormData();
return (
i.append('content', JSON.stringify(t)),
i.append('name', e),
(Y = null),
Object(U.fetch)('/save-theme/', { credentials: 'include', method: 'POST', body: i }).then(
function(e) {
return e.json();
},
function(e) {
return $.logError(e);
},
)
);
}
function s(e) {
var t = new FormData();
return (
t.append('name', e),
(Y = null),
Object(U.fetch)('/remove-theme/', {
credentials: 'include',
method: 'POST',
body: t,
}).then(
function(e) {
return e.json();
},
function(e) {
return $.logError(e);
},
)
);
}
function a(e) {
return n(e).then(function(e) {
return !!e.content;
});
}
function l() {
return (
J ||
(J = new Promise(function(e) {
i.e(22)
.then(
function(t) {
var n,
o = i(1245),
r = i(1246);
e(((n = {}), (n[Z.Light] = r), (n[Z.Dark] = o), n));
}.bind(null, i),
)
.catch(i.oe);
})),
J
);
}
function c() {
return [Z.Light, Z.Dark];
}
function h() {
return l().then(function(e) {
var t;
return (
(t = {}), (t[Z.Light] = JSON.parse(e[Z.Light])), (t[Z.Dark] = JSON.parse(e[Z.Dark])), t
);
});
}
function u(e) {
return h().then(function(t) {
return t[e];
});
}
function d(e) {
return X[e] || e;
}
function p(e) {
return h().then(function(t) {
return c().some(function(i) {
return _(t[i], e);
});
});
}
function _(e, t) {
var i = e.content === t.content;
return (
m(e.content, function(e, n) {
var o = g(e, t.content);
return !(i = f(n, o));
}),
i
);
}
function f(e, t) {
if ('string' == typeof e && 'string' == typeof t)
try {
return Object(G.areEqualRgb)(Object(G.parseRgb)(e), Object(G.parseRgb)(t));
} catch (i) {
return e === t;
}
return e === t;
}
function m(e, t) {
void 0 === e && (e = {});
try {
y(e, [], t);
} catch (e) {
return;
}
}
function y(e, t, i) {
var n, o;
for (n in e)
if (e.hasOwnProperty(n))
if (((o = t.concat(n)), 'object' == typeof e[n])) y(e[n], o, i);
else if (i(o, e[n])) throw Error('exit');
}
function g(e, t) {
var i, n;
for (void 0 === t && (t = {}), i = t, n = 0; n < e.length; n++) {
if (!i || 'object' != typeof i) return;
i = i[e[n]];
}
if ('string' == typeof i || 'number' == typeof i) return i;
}
function v(e, t) {
var i, n;
return (
void 0 === t && (t = []),
(i = ee[e])
? oe.test(i)
? i
: ((n = i),
t.push(e),
-1 !== t.indexOf(n)
? (console.warn('Colors definitions cycled'), i)
: t.length > ne
? (console.warn('Too many variables-link in HEX-color search: ' + t[0]), null)
: v(n, t))
: null
);
}
function S(e, t) {
var i = re[e];
if (!i) throw Error('No such color ' + e);
return i;
}
function b(e, t) {
var i, n;
t || (t = window), (i = t.document.documentElement);
for (n in ae) ae[n].className && i.classList.toggle(ae[n].className, n === e);
}
function w(e) {
return !e.isPrivate;
}
function P() {
return ae[ce.value()] || ae[le];
}
function T(e) {
return P().getThemedColor(e);
}
function x(e) {
ce.setValue(e);
}
function C() {
x(Object(z.getValue)(he) || le);
}
function L() {
return Object(z.getValue)(he) || null;
}
function I() {
Object(z.setValue)(he, P().name, { forceFlush: !0 });
}
function A(e) {
return n(e);
}
function k() {
return o();
}
function E() {
return c();
}
function M(e) {
return u(e).then(function(e) {
return e || { content: void 0 };
});
}
function V() {
return h();
}
function D(e, t) {
return r(e, t);
}
function O(e) {
return s(e);
}
function R(e) {
return a(e);
}
function B(e) {
return d(e);
}
function N(e) {
return p(e);
}
function F(e) {
return {
content: {
chartProperties: {
paneProperties: e.m_model.properties().paneProperties.state(),
scalesProperties: e.m_model.properties().scalesProperties.state(),
},
mainSourceProperties: e.m_model.m_mainSeries.properties().state(),
},
};
}
var W, H, j, z, U, q, $, Y, G, K, Z, J, X, Q, ee, te, ie, ne, oe, re, se, ae, le, ce, he;
Object.defineProperty(t, '__esModule', { value: !0 }),
(W = i(248)),
i(11),
(H = i(16)),
(j = i.n(H)),
(z = i(49)),
(U = i(336)),
(q = i(4)),
($ = Object(q.getLogger)('Themes.Provider')),
(Y = null),
(G = i(24)),
(function(e) {
(e.Light = 'light'), (e.Dark = 'dark');
})(Z || (Z = {})),
(J = null),
(K = {}),
(K[Z.Light] = window.t('Light', { context: 'colorThemeName' })),
(K[Z.Dark] = window.t('Dark', { context: 'colorThemeName' })),
(K.Black = window.t('Black', { context: 'colorThemeName' })),
(K.Blue = window.t('Blue', { context: 'colorThemeName' })),
(K.Grey = window.t('Grey', { context: 'colorThemeName' })),
(K.White = window.t('White', { context: 'colorThemeName' })),
(X = K),
(Q = i(480)),
(ee = i(481)),
(te = i(7)),
(ie = {}),
(ne = Object.keys(ee).length),
(oe = /^#[0-9A-F]{6}$/i),
Object.keys(ee).forEach(function(e) {
var t = v(e);
ie[e] = Object(te.ensureNotNull)(t);
}),
(re = ie),
i.d(t, 'themes', function() {
return ae;
}),
i.d(t, 'DEFAULT_THEME', function() {
return le;
}),
i.d(t, 'watchedTheme', function() {
return ce;
}),
(t.applyTheme = b),
(t.isPublicTheme = w),
(t.getCurrentTheme = P),
(t.setThemedColor = T),
(t.setTheme = x),
(t.restoreTheme = C),
(t.savedThemeName = L),
(t.syncTheme = I),
(t.getTheme = A),
(t.getThemeNames = k),
(t.getStdThemeNames = E),
(t.getStdTheme = M),
(t.getStdThemes = V),
(t.saveTheme = D),
(t.removeTheme = O),
(t.isThemeExist = R),
(t.translateStdThemeName = B),
(t.isStdTheme = N),
(t.extractThemeFromModel = F),
(se = {}),
(se[Z.Light] = {
name: Z.Light,
label: window.t('Light', { context: 'colorThemeName' }),
className: 'theme-light',
order: 2,
getThemedColor: function(e) {
return S(e);
},
}),
(se[Z.Dark] = {
name: Z.Dark,
label: window.t('Dark', { context: 'colorThemeName' }),
className: 'theme-dark',
order: 1,
getThemedColor: function(e) {
return S(Q[e]);
},
}),
(ae = se),
(le = 'light'),
(ce = new j.a()),
ce.subscribe(function(e) {
b(e, window);
}),
(he = 'current_theme.name');
},
function(e, t, i) {
'use strict';
var n = i(31),
o = i(12).parseJSONorNot,
r = i(4).getLogger('Chart.SaveloadAdapter.Library'),
s = (function() {
var e,
t,
i,
s,
a = {},
l = null;
return (
(a.setCustomAdapter = function(e) {
(l = e), r.logNormal('Use custom save-load adapter');
}),
(a.initialize = function(n, o, r, a) {
(e = n), (t = o), (i = r), (s = a);
}),
(a.updateUser = function(e) {
t = e;
}),
(a.getCharts = function(n, a) {
function c(e) {
(e = e.map(function(e) {
return {
id: e.id,
name: e.name,
image_url: e.id,
modified_iso: e.timestamp,
short_symbol: e.symbol,
interval: e.resolution,
};
})),
n(e);
}
return l
? void l
.getAllCharts()
.then(c)
.catch(a)
: $.ajax({
url: '{0}/{1}/charts?client={2}&user={3}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
),
type: 'GET',
crossDomain: !0,
})
.done(function(e) {
var t = o(e);
if ('ok' !== t.status)
return r.logWarn('Charts list request failed: ' + t.message), void a();
c(t.data);
})
.fail(a);
}),
(a.removeChart = function(n, a) {
if (l) return void l.removeChart(n).then(a);
$.ajax({
url: '{0}/{1}/charts?client={2}&user={3}&chart={4}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
encodeURIComponent(n),
),
type: 'DELETE',
crossDomain: !0,
}).done(function(e) {
var t = o(e);
'ok' !== t.status && r.logWarn('Chart delete request failed: ' + t.message), a();
});
}),
(a.saveChart = function(n, a, c, h, u, d, p) {
var _,
f = u.id.value(),
m = { name: n, content: JSON.stringify(h), symbol: a, resolution: c };
if (l)
return (
(m.id = f),
void l
.saveChart(m)
.then(d)
.catch(p)
);
(_ = '{0}/{1}/charts?client={2}&user={3}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
)),
void 0 !== f && null !== f && (_ += '&chart=' + encodeURIComponent(f)),
$.ajax({ url: _, data: m, type: 'POST', crossDomain: !0 })
.done(function(e) {
var t = o(e);
if ('ok' !== t.status)
return r.logWarn('Chart save request failed: ' + t.message), void p();
d(t.id);
})
.fail(function() {
p();
});
}),
(a.getChartContent = function(n, a, c) {
function h(e) {
var t = JSON.parse(e);
return (t.uid = n.id), t;
}
if (l)
return void l
.getChartContent(n.id)
.then(function(e) {
var t = h(e);
a(t);
})
.catch(c);
$.ajax({
url: '{0}/{1}/charts?client={2}&user={3}&chart={4}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
encodeURIComponent(n.id),
),
type: 'GET',
crossDomain: !0,
})
.done(function(e) {
var t,
i = o(e);
if ('ok' !== i.status)
return void r.logWarn('Chart load request failed: ' + i.message);
(t = h(i.data.content)), a(t);
})
.fail(function() {
c && c();
});
}),
(a.loadChart = function(e) {
a.getChartContent(
e,
function(e) {
n.emit('chart_load_requested', e);
},
function() {
r.logWarn('Error loading chart');
},
);
}),
(a.removeStudyTemplate = function(n, a) {
if (l) return void l.removeStudyTemplate({ name: n }).then(a);
$.ajax({
url: '{0}/{1}/study_templates?client={2}&user={3}&template={4}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
encodeURIComponent(n),
),
type: 'DELETE',
crossDomain: !0,
}).done(function(e) {
var t = o(e);
'ok' !== t.status && r.logWarn('Chart delete request failed: ' + t.message), a();
});
}),
(a.getStudyTemplateContent = function(n, r) {
if (l)
return void l.getStudyTemplateContent({ name: n }).then(function(e) {
r({ content: e });
});
$.ajax({
url: '{0}/{1}/study_templates?client={2}&user={3}&template={4}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
encodeURIComponent(n),
),
type: 'GET',
crossDomain: !0,
}).done(function(e) {
r(o(e).data);
});
}),
(a.saveStudyTemplate = function(n, a) {
var c = { name: n.name, content: n.content };
if (l)
return void l
.saveStudyTemplate(c)
.then(a.bind(null, { error: '' }))
.catch(function(e) {
a({ error: null != e ? '' + e : 'error' });
});
$.ajax({
url: '{0}/{1}/study_templates?client={2}&user={3}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
),
type: 'POST',
crossDomain: !0,
data: c,
}).done(function(e) {
var t = o(e);
'ok' !== t.status && r.logWarn('Template save request failed: ' + t.message),
a({ error: 'ok' === t.status ? '' : t.status });
});
}),
(a._templatesCache = null),
(a.getStudyTemplatesList = function(n) {
function c(e) {
(e = e.map(function(e) {
return { is_default: !1, name: e.name };
})),
(a._templatesCache = e),
n(e);
}
return a._templatesCache
? void n(a._templatesCache)
: ((a._templatesCache = []),
l
? void l.getAllStudyTemplates().then(c)
: void $.ajax({
url: '{0}/{1}/study_templates?client={2}&user={3}'.format(
i,
encodeURIComponent(s),
encodeURIComponent(e),
encodeURIComponent(t),
),
type: 'GET',
crossDomain: !0,
}).done(function(e) {
if (null !== a._templatesCache) {
var t = o(e);
if ('ok' !== t.status)
return void r.logWarn('Templates list request failed: ' + t.message);
c(t.data);
}
}));
}),
(a.invalidateStudyTemplatesList = function() {
a._templatesCache = null;
}),
a
);
})();
e.exports = s;
},
function(e, t, i) {
'use strict';
function n(e, t) {
if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function');
}
var o, r, s, a;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.SaveRenameDialog = void 0),
(o = (function() {
function e(e, t) {
var i, n;
for (i = 0; i < t.length; i++)
(n = t[i]),
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
return function(t, i, n) {
return i && e(t.prototype, i), n && e(t, n), t;
};
})()),
i(484),
(r = i(82)),
(s = { YES: 'yes', CLOSE: 'close' }),
(a = 0),
(t.SaveRenameDialog = (function() {
function e() {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
i = t.fields,
o = t.confirm,
r = t.title,
s = void 0 === r ? '' : r,
a = t.destroyOnClose,
l = void 0 === a || a,
c = t.modal,
h = void 0 !== c && c;
n(this, e),
(this._$form = $('
')),
(this._fields = i),
this._appendFieldsToForm(),
(this._title = s),
(this._destroyOnClose = l),
(this._modal = h),
(this._isConfirmDialogOpened = !1),
o &&
((this._needCheckConfirm = !0),
(this._shouldShowConfirm = o.shouldShowDialog),
(this._getConfirmMessage = o.getMessage));
}
return (
o(e, [
{
key: 'setField',
value: function(e, t) {
this._fields.find(function(t) {
return t.name === e;
}).value = t;
},
},
{
key: 'show',
value: function() {
var e = this,
t = this._createDialog();
return new Promise(function(i) {
t.then(function(t) {
t.on('action:submit', function(t) {
return e._onSubmit(t, i);
}),
t.open(),
t.on('beforeClose', e._unmountFields.bind(e)),
e._fields[a].select();
});
});
},
},
{
key: '_appendFieldsToForm',
value: function() {
var e = this;
this._fields.forEach(function(t) {
t.appendTo(e._$form);
});
},
},
{
key: '_createDialog',
value: function() {
var e = this;
return new Promise(function(t) {
i.e(2)
.then(
function(n) {
var o = i(188).createDialog;
t(
o({
type: e._modal ? 'modal' : 'popup',
title: e._title,
content: e._$form,
actionsWrapTemplate:
'
',
width: 470,
destroyOnClose: e._destroyOnClose,
isClickOutFn: function() {
if (e._isConfirmDialogOpened) return !1;
},
actions: [
{
name: 'submit',
type: 'primary',
text: $.t('Save'),
key: 13,
addClass: 'js-submit-button',
},
{
name: 'cancel',
type: 'default',
text: $.t('Cancel'),
method: 'close',
addClass: 'js-cancel-button',
},
],
}),
);
}.bind(null, i),
)
.catch(i.oe);
});
},
},
{
key: '_onSubmit',
value: function(e, t) {
var i = this,
n = this._validate();
if (n) e.error(n.error), n.focus();
else {
if (!this._needCheckConfirm) return t(this._collectValues(), e), void e.close();
Promise.resolve(this._shouldShowConfirm(this._collectValues())).then(function(
n,
) {
if (!n) return t(i._collectValues(), e), void e.close();
i._showConfirmDialog().then(function(n) {
n === s.CLOSE && (e.focus(), i._fields[a].focus()),
n === s.YES && (t(i._collectValues(), e), e.close());
});
});
}
},
},
{
key: '_showConfirmDialog',
value: function() {
var e = this;
return new Promise(function(t) {
Promise.resolve(e._getConfirmMessage(e._collectValues())).then(function(i) {
(e._isConfirmDialogOpened = !0),
(0, r.createConfirmDialog)({ type: 'modal', content: i }).then(function(i) {
i.on('action:yes', function(e) {
t(s.YES), e.close();
}),
i.on('afterClose', function() {
t(s.CLOSE), (e._isConfirmDialogOpened = !1);
}),
i.open();
});
});
});
},
},
{
key: '_validate',
value: function() {
return this._fields.find(function(e) {
return !e.valid;
});
},
},
{
key: '_collectValues',
value: function() {
return this._fields.reduce(function(e, t) {
return (e[t.name] = t.value), e;
}, {});
},
},
{
key: '_unmountFields',
value: function() {
this._fields.forEach(function(e) {
e.unmount && e.unmount();
});
},
},
]),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t) {
if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function');
}
var o;
Object.defineProperty(t, '__esModule', { value: !0 }),
(o = (function() {
function e(e, t) {
var i, n;
for (i = 0; i < t.length; i++)
(n = t[i]),
(n.enumerable = n.enumerable || !1),
(n.configurable = !0),
'value' in n && (n.writable = !0),
Object.defineProperty(e, n.key, n);
}
return function(t, i, n) {
return i && e(t.prototype, i), n && e(t, n), t;
};
})()),
(t.InputField = (function() {
function e(t) {
var i = t.label,
o = t.name,
r = t.maxLength,
s = t.error,
a = void 0 === s ? '' : s;
n(this, e),
(this._name = o),
(this._$field = $(
'
',
)),
(this._$input = this._$field.find('input')),
(this._error = a);
}
return (
o(e, [
{
key: 'appendTo',
value: function(e) {
e.append(this._$field);
},
},
{
key: 'focus',
value: function() {
return this._$input.focus();
},
},
{
key: 'select',
value: function() {
return this.focus().select();
},
},
{
key: 'value',
set: function(e) {
this._$input.val(e);
},
get: function() {
return this._$input.val();
},
},
{
key: 'name',
get: function() {
return this._name;
},
},
{
key: 'valid',
get: function() {
return !!this._$input.val().trim();
},
},
{
key: 'error',
set: function(e) {
this._error = e;
},
get: function() {
return this._error;
},
},
]),
e
);
})());
},
function(e, t, i) {
'use strict';
var n, o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'ChartChangesWatcher', function() {
return r;
}),
(n = i(8)),
(o = i.n(n)),
(r = (function() {
function e(e, t, i) {
(this._hasChanges = !1),
(this._undoHistory = e),
(this._chartSaver = t),
(this._globalEvents = i),
(this._onValueChanged = new o.a()),
this._subscribe();
}
return (
(e.prototype.destroy = function() {
this._unsubscribe(), this._onValueChanged.destroy();
}),
(e.prototype.hasChanges = function() {
return this._hasChanges;
}),
(e.prototype.getOnChange = function() {
return this._onValueChanged;
}),
(e.prototype._subscribe = function() {
this._globalEvents.subscribe('chart_loaded', this._handleChartLoaded, this),
this._undoHistory
.undoStack()
.onChange()
.subscribe(this, this._handleChangeUndoStack),
this._chartSaver.chartSaved().subscribe(this, this._handleChartSaved);
}),
(e.prototype._unsubscribe = function() {
this._globalEvents.unsubscribe('chart_loaded', this._handleChartLoaded, this),
this._undoHistory
.undoStack()
.onChange()
.unsubscribe(this, this._handleChangeUndoStack),
this._chartSaver.chartSaved().unsubscribe(this, this._handleChartSaved);
}),
(e.prototype._setChanges = function(e) {
(this._hasChanges = e), this._onValueChanged.fire(e);
}),
(e.prototype._handleChartLoaded = function() {
this._setChanges(!1);
}),
(e.prototype._handleChangeUndoStack = function() {
var e = this._undoHistory.undoStack().head();
e && !e.customFlag('doesnt_affect_save') && this._setChanges(!0);
}),
(e.prototype._handleChartSaved = function(e) {
e && this._setChanges(!1);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e, t) {
o.enabled('saveload_requires_authentication') ? window.runOrSignIn(e, t) : e();
}
var o;
(t.a = n), (o = i(5)), i.n(o);
},
function(e, t, i) {
'use strict';
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'debounce', function() {
return n;
});
var n = function(e, t) {
function i() {
e.apply(o, n);
}
var n,
o,
r = 0;
return function() {
(o = this), (n = arguments), clearTimeout(r), (r = setTimeout(i, t));
};
};
},
function(e, t, i) {
'use strict';
var n, o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
i.d(t, 'UndoMacroCommand', function() {
return r;
}),
(n = i(1)),
(o = i(43)),
(r = (function(e) {
function t(t) {
var i = e.call(this, t, !1) || this;
return (i._subcommands = []), i;
}
return (
n.c(t, e),
(t.prototype.addCommand = function(e) {
this._subcommands.push(e);
}),
(t.prototype.isEmpty = function() {
return 0 === this._subcommands.length;
}),
(t.prototype.redo = function() {
for (var e = 0; e < this._subcommands.length; e++) this._subcommands[e].redo();
}),
(t.prototype.undo = function() {
for (var e = this._subcommands.length - 1; e >= 0; e--) this._subcommands[e].undo();
}),
t
);
})(o.UndoCommand));
},
function(e, t, i) {
'use strict';
function n(e) {
var t, i;
if ('' === e) return Promise.resolve(null);
if (((t = JSON.parse(e)), !Object(o.isObject)(t) || 'function' == typeof t))
return Promise.reject(Error('Non-object content in the non-series envelope'));
if (Object(o.hasProperty)(t, 'indexes_replace'))
return Promise.resolve({ indexes_replace: !0 });
if (
((i = { indexes_replace: !1 }),
Object(o.hasProperty)(t, 'offsets') && (i.offsets = t.offsets),
Object(o.hasProperty)(t, 'isUpdate'))
) {
if ('boolean' != typeof t.isUpdate)
return Promise.reject(Error('Invalid type of "isUpdate" field'));
i.isUpdate = t.isUpdate;
}
return (
Object(o.hasProperty)(t, 'data') && (i.data = t.data),
Object(o.hasProperty)(t, 'graphicsCmds') &&
(i.graphicsCmds = Object(r.b)(t.graphicsCmds)),
Promise.resolve(i)
);
}
var o, r;
Object.defineProperty(t, '__esModule', { value: !0 }),
(t.unpackNonSeriesData = n),
i(1),
(o = i(260)),
i.n(o),
(r = i(261));
},
function(e, t, i) {
'use strict';
function n(e) {
var t = typeof e;
return null !== e && ('object' === t || 'function' === t);
}
function o(e, t) {
return t in e;
}
Object.defineProperty(t, '__esModule', { value: !0 }), (t.isObject = n), (t.hasProperty = o);
},
function(e, t, i) {
'use strict';
function n(e) {
var t, i, n, o;
if ((Object(a.hasProperty)(e, 'create'), Object(a.hasProperty)(e, 'erase')))
for (
t = e.erase,
Object(s.assert)(Array.isArray(t), 'Collection of erase commands should be array'),
i = 0,
n = t;
i < n.length;
i++
)
(o = n[i]),
Object(s.assert)(
'all' === o.action || 'one' === o.action,
"Erase command action should be 'all' or 'one'",
);
return e;
}
function o(e, t) {
e.forEach(function(e) {
var i, n, o;
for (i = 0, n = e; i < n.length; i++) (o = n[i]), (o.indexes = t);
});
}
function r(e, t) {
for (var i = 0; i < e.length; ++i) if (e[i].id === t) return i;
return -1;
}
var s, a, l, c, h;
(t.b = n),
i.d(t, 'a', function() {
return h;
}),
(s = i(7)),
i.n(s),
(a = i(260)),
i.n(a),
(l = i(165)),
(c = i(262)),
(h = (function() {
function e() {
(this.indexes = []),
(this._horizlines = new Map()),
(this._vertlines = new Map()),
(this._lines = new Map()),
(this._hlines = new Map()),
(this._textmarks = new Map()),
(this._shapemarks = new Map()),
(this._backgrounds = new Map()),
(this._polygons = new Map()),
(this._trendchannels = new Map()),
(this._hhists = new Map()),
(this._hhistsByTimePointIndex = new Map());
}
return (
(e.prototype.horizlines = function() {
return this._horizlines;
}),
(e.prototype.vertlines = function() {
return this._vertlines;
}),
(e.prototype.lines = function() {
return this._lines;
}),
(e.prototype.hlines = function() {
return this._hlines;
}),
(e.prototype.textmarks = function() {
return this._textmarks;
}),
(e.prototype.shapemarks = function() {
return this._shapemarks;
}),
(e.prototype.backgrounds = function() {
return this._backgrounds;
}),
(e.prototype.polygons = function() {
return this._polygons;
}),
(e.prototype.trendchannels = function() {
return this._trendchannels;
}),
(e.prototype.hhists = function() {
return this._hhists;
}),
(e.prototype.hhistsByTimePointIndex = function() {
return this._hhistsByTimePointIndex;
}),
(e.prototype.clear = function() {
(this.indexes = []), this._clearPrimitives();
}),
(e.prototype.extract = function() {
var e = {
indexes: this.indexes,
horizlines: this._horizlines,
vertlines: this._vertlines,
lines: this._lines,
hlines: this._hlines,
textmarks: this._textmarks,
shapemarks: this._shapemarks,
backgrounds: this._backgrounds,
polygons: this._polygons,
trendchannels: this._trendchannels,
hhists: this._hhists,
};
return (
(this.indexes = []),
(this._horizlines = new Map()),
(this._vertlines = new Map()),
(this._lines = new Map()),
(this._hlines = new Map()),
(this._textmarks = new Map()),
(this._shapemarks = new Map()),
(this._backgrounds = new Map()),
(this._polygons = new Map()),
(this._trendchannels = new Map()),
(this._hhists = new Map()),
this._hhistsByTimePointIndex.clear(),
new c.a('data', e)
);
}),
(e.prototype.replaceIndexesTo = function(e) {
(this.indexes = e),
o(this._horizlines, e),
o(this._vertlines, e),
o(this._lines, e),
o(this._hlines, e),
o(this._textmarks, e),
o(this._shapemarks, e),
o(this._backgrounds, e),
o(this._polygons, e),
o(this._trendchannels, e),
o(this._hhists, e),
this._postProcess();
}),
(e.prototype.processCommands = function(e, t) {
void 0 !== e.erase && this._processEraseCommands(e.erase),
void 0 !== e.create && this._processCreateCommands(e.create, t);
}),
(e.prototype._processCreateCommands = function(e, t) {
var i, n;
for (i in e)
if (e.hasOwnProperty(i))
switch (
((n = i),
Object(s.assert)(
n in t,
"There is a '" +
n +
"' in study response, but it doesn't present in graphics info!",
),
n)
) {
case 'horizlines':
Object(l.b)(this._horizlines, e[n], t[n], this.indexes);
break;
case 'vertlines':
Object(l.b)(this._vertlines, e[n], t[n], this.indexes);
break;
case 'lines':
Object(l.b)(this._lines, e[n], t[n], this.indexes);
break;
case 'hlines':
Object(l.b)(this._hlines, e[n], t[n], this.indexes);
break;
case 'textmarks':
Object(l.b)(this._textmarks, e[n], t[n], this.indexes);
break;
case 'shapemarks':
Object(l.b)(this._shapemarks, e[n], t[n], this.indexes);
break;
case 'backgrounds':
Object(l.b)(this._backgrounds, e[n], t[n], this.indexes);
break;
case 'polygons':
Object(l.b)(this._polygons, e[n], t[n], this.indexes);
break;
case 'trendchannels':
Object(l.b)(this._trendchannels, e[n], t[n], this.indexes);
break;
case 'hhists':
Object(l.b)(this._hhists, e[n], t[n], this.indexes);
}
this._postProcess();
}),
(e.prototype._processEraseCommands = function(e) {
var t,
i,
n,
o = function(e) {
if ('all' === e.action) s._clearPrimitives();
else {
({
horizlines: s._horizlines,
vertlines: s._vertlines,
lines: s._lines,
hlines: s._hlines,
textmarks: s._textmarks,
shapemarks: s._shapemarks,
backgrounds: s._backgrounds,
polygons: s._polygons,
trendchannels: s._trendchannels,
hhists: s._hhists,
}[e.type].forEach(function(t) {
var i = r(t[0].items, e.id);
i >= 0 && t[0].items.splice(i, 1);
}));
}
},
s = this;
for (t = 0, i = e; t < i.length; t++) (n = i[t]), o(n);
}),
(e.prototype._postProcess = function() {
this._hhists.size > 0 && Object(l.e)(this);
}),
(e.prototype._clearPrimitives = function() {
(this._horizlines = new Map()),
(this._vertlines = new Map()),
(this._lines = new Map()),
(this._hlines = new Map()),
(this._textmarks = new Map()),
(this._shapemarks = new Map()),
(this._backgrounds = new Map()),
(this._polygons = new Map()),
(this._trendchannels = new Map()),
(this._hhists = new Map()),
this._hhistsByTimePointIndex.clear();
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n() {
return new c();
}
function o(e) {
return new c('state', e);
}
function r(e) {
var t,
i,
n,
o,
r,
c = new Set();
for (t = 0, i = l.d; t < i.length; t++) (n = i[t]), s(c, e[n]());
return (
(o = []),
c.forEach(function(e) {
return o.push(e);
}),
o.sort(function(e, t) {
return e - t;
}),
(r = { indexes: o }),
e.horizlines().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.horizlines = r.horizlines || []),
Object(l.a)(
r.horizlines,
a.a({}, d, {
startIndex: o.indexOf(c[d.startIndex]),
endIndex: o.indexOf(c[d.endIndex]),
}),
t,
);
}),
e.vertlines().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.vertlines = r.vertlines || []),
Object(l.a)(r.vertlines, a.a({}, d, { index: o.indexOf(c[d.index]) }), t);
}),
e.lines().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.lines = r.lines || []),
Object(l.a)(
r.lines,
a.a({}, d, {
startIndex: o.indexOf(c[d.startIndex]),
endIndex: o.indexOf(c[d.endIndex]),
}),
t,
);
}),
e.hlines().forEach(function(e, t) {
var i, n, o, s, a, c;
for (i = 0, n = e; i < n.length; i++)
for (o = n[i], s = 0, a = o.items; s < a.length; s++)
(c = a[s]), (r.hlines = r.hlines || []), Object(l.a)(r.hlines, c, t);
}),
e.textmarks().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.textmarks = r.textmarks || []),
Object(l.a)(r.textmarks, a.a({}, d, { time: o.indexOf(c[d.time]) }), t);
}),
e.shapemarks().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.shapemarks = r.shapemarks || []),
Object(l.a)(r.shapemarks, a.a({}, d, { time: o.indexOf(c[d.time]) }), t);
}),
e.backgrounds().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.backgrounds = r.backgrounds || []),
Object(l.a)(
r.backgrounds,
a.a({}, d, { start: o.indexOf(c[d.start]), stop: o.indexOf(c[d.stop]) }),
t,
);
}),
e.polygons().forEach(function(e, t) {
var i,
n,
s,
c = function(e) {
var i,
n,
s,
c,
h = e.indexes;
for (i = 0, n = e.items; i < n.length; i++)
(s = n[i]),
(c = s.points.map(function(e) {
return a.a({}, e, { index: o.indexOf(h[e.index]) });
})),
(r.polygons = r.polygons || []),
Object(l.a)(r.polygons, a.a({}, s, { points: c }), t);
};
for (i = 0, n = e; i < n.length; i++) (s = n[i]), c(s);
}),
e.trendchannels().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.trendchannels = r.trendchannels || []),
Object(l.a)(
r.trendchannels,
a.a({}, d, {
startIndex: o.indexOf(c[d.startIndex]),
endIndex: o.indexOf(c[d.endIndex]),
}),
t,
);
}),
e.hhists().forEach(function(e, t) {
var i, n, s, c, h, u, d;
for (i = 0, n = e; i < n.length; i++)
for (s = n[i], c = s.indexes, h = 0, u = s.items; h < u.length; h++)
(d = u[h]),
(r.hhists = r.hhists || []),
Object(l.a)(
r.hhists,
a.a({}, d, {
firstBarTime: o.indexOf(c[d.firstBarTime]),
lastBarTime: o.indexOf(c[d.lastBarTime]),
}),
t,
);
}),
r
);
}
function s(e, t) {
t.forEach(function(t, i) {
var n, o, r, s, a, l;
for (n = 0, o = t; n < o.length; n++)
for (r = o[n], s = 0, a = r.indexes; s < a.length; s++) (l = a[s]), e.add(l);
});
}
var a, l, c;
i.d(t, 'a', function() {
return c;
}),
(t.b = n),
(t.c = o),
(t.d = r),
(a = i(1)),
(l = i(165)),
(c = (function() {
function e(e, t) {
var i, n;
(this.indexes = []),
(this._horizlines = new Map()),
(this._vertlines = new Map()),
(this._lines = new Map()),
(this._hlines = new Map()),
(this._textmarks = new Map()),
(this._shapemarks = new Map()),
(this._backgrounds = new Map()),
(this._polygons = new Map()),
(this._trendchannels = new Map()),
(this._hhists = new Map()),
(this._hhistsByTimePointIndex = new Map()),
'data' === e
? ((i = t),
(this.indexes = i.indexes),
(this._horizlines = i.horizlines),
(this._vertlines = i.vertlines),
(this._lines = i.lines),
(this._hlines = i.hlines),
(this._textmarks = i.textmarks),
(this._shapemarks = i.shapemarks),
(this._backgrounds = i.backgrounds),
(this._polygons = i.polygons),
(this._trendchannels = i.trendchannels),
(this._hhists = i.hhists),
this._postProcess())
: 'state' === e &&
((n = t),
(this.indexes = n.indexes || []),
Object(l.b)(this._horizlines, n.horizlines, void 0, this.indexes),
Object(l.b)(this._vertlines, n.vertlines, void 0, this.indexes),
Object(l.b)(this._lines, n.lines, void 0, this.indexes),
Object(l.b)(this._hlines, n.hlines, void 0, this.indexes),
Object(l.b)(this._textmarks, n.textmarks, void 0, this.indexes),
Object(l.b)(this._shapemarks, n.shapemarks, void 0, this.indexes),
Object(l.b)(this._backgrounds, n.backgrounds, void 0, this.indexes),
Object(l.b)(this._polygons, n.polygons, void 0, this.indexes),
Object(l.b)(this._trendchannels, n.trendchannels, void 0, this.indexes),
Object(l.b)(this._hhists, n.hhists, void 0, this.indexes),
this._postProcess());
}
return (
(e.prototype.horizlines = function() {
return this._horizlines;
}),
(e.prototype.vertlines = function() {
return this._vertlines;
}),
(e.prototype.lines = function() {
return this._lines;
}),
(e.prototype.hlines = function() {
return this._hlines;
}),
(e.prototype.textmarks = function() {
return this._textmarks;
}),
(e.prototype.shapemarks = function() {
return this._shapemarks;
}),
(e.prototype.backgrounds = function() {
return this._backgrounds;
}),
(e.prototype.polygons = function() {
return this._polygons;
}),
(e.prototype.trendchannels = function() {
return this._trendchannels;
}),
(e.prototype.hhists = function() {
return this._hhists;
}),
(e.prototype.hhistsByTimePointIndex = function() {
return this._hhistsByTimePointIndex;
}),
(e.prototype._postProcess = function() {
this._hhists.size > 0 && Object(l.e)(this);
}),
e
);
})());
},
function(e, t, i) {
'use strict';
function n(e) {
(this.bars = e.bars),
(this.barSpacing = e.barSpacing),
(this.barWidth = o.optimalBarWidth(e.barSpacing)),
(this.barLineWidth = Math.max(1, Math.round(this.barWidth))),
(this.dontDrawOpen = e.dontDrawOpen);
}
var o = i(27),
r = i(9).HitTestResult;
(n.prototype.draw = function(e) {
var t, i, n;
for (e.save(), e.translate(0.5, 0.5), i = 0; i < this.bars.length; ++i)
(n = this.bars[i]),
t !== n.color && ((e.fillStyle = n.color), (t = n.color)),
e.fillRect(
Math.round(n.time - this.barLineWidth / 2),
Math.round(n.high - this.barWidth / 2),
Math.round(this.barLineWidth),
Math.round(n.low - n.high + this.barWidth),
),
this.barLineWidth < this.barSpacing - 1 &&
(this.dontDrawOpen ||
e.fillRect(
Math.round(n.time - 1.5 * this.barWidth),
Math.round(n.open - this.barWidth / 2),
Math.round(1.5 * this.barWidth),
Math.round(this.barWidth),
),
e.fillRect(
Math.round(n.time),
Math.round(n.close - this.barWidth / 2),
Math.round(1.5 * this.barWidth),
Math.round(this.barWidth),
));
e.restore();
}),
(n.prototype.hitTest = function(e) {
var t,
i,
n,
s,
a = this.bars,
l = 0.5 * this.barSpacing;
if (0 === a.length) return null;
if (e.x < a[0].time - l) return null;
if (e.x > a[a.length - 1].time + l) return null;
for (t = null, i = 0; i < a.length; ++i)
if (((n = a[i]), e.x <= n.time + l)) {
t = n;
break;
}
return (
(s = o.selectionTolerance(this.barLineWidth)),
t && t.high - s <= e.y && e.y <= t.low + s ? new r(r.REGULAR) : null
);
}),
(t.PaneRendererBars = TradingView.PaneRendererBars = n);
},
function(e, t, i) {
'use strict';
function n(e) {
(e.forceLineColor = !1),
r.call(this, e),
(this.color1 = e.color1),
(this.color2 = e.color2),
(this.bottom = e.bottom),
(this.isSeries = !!e.isSeries),
(this._simpleMode = e.simpleMode);
}
var o = i(27).coordinateIsValid,
r = i(136).PaneRendererLine;
inherit(n, r),
(n.prototype.draw = function(e) {
var t, i, n, s, a, l, c, h, u, d, p, _;
if (0 !== this.items.length) {
for (
e.lineCap = 'square',
e.strokeStyle = this.lineColor,
e.lineWidth = this.lineWidth,
e.lineStyle = this.lineStyle,
e.lineWidth = 1,
t = 0;
t < this.items.length && !o(this.items[t].y);
)
t++;
for (i = this.items.length - 1; i >= 0 && !o(this.items[i].y); ) i--;
if (!(t >= i)) {
for (e.translate(0.5, 0.5), n = {}, s = this.items, a = t; a <= i; a++)
(l = s[a]),
(c = l.style ? l.style.color : this.lineColor),
a < i &&
s[a + 1].style &&
((h = s[a + 1].style.color),
c !== h && ((u = n[h] || []), u.push(l), (n[h] = u))),
(d = n[c] || []),
d.push(l),
(n[c] = d);
for (c in n) {
for (d = n[c], e.beginPath(), p = 0, a = 0; a < d.length; a++)
d[a].style &&
d[a].style.color !== c &&
(e.moveTo(d[p].x, this.bottom),
this.walkLine(e, d.slice(p, a), !0, this.bottom),
(p = a));
e.moveTo(d[p].x, this.bottom),
this.walkLine(e, d.slice(p, d.length), !0, this.bottom),
e.closePath(),
this.isSeries
? ((_ = e.createLinearGradient(0, 0, 0, this.bottom)),
_.addColorStop(0, this.color1),
_.addColorStop(1, this.color2),
(e.fillStyle = _),
(this._simpleMode = !0))
: (e.fillStyle = c),
e.fill();
}
(e.lineWidth = this.lineWidth), r.prototype.draw.call(this, e);
}
}
}),
(t.PaneRendererArea = TradingView.PaneRendererArea = n);
},
function(e, t, i) {
'use strict';
function n(e, t, i, n, o) {
var r, s, a, l, c;
for (
this._canvasesMap = {},
this._lines = e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),
this._font = this._fontStyle(t, i, n, o),
this._fontSize = o,
r = $('