Release v19.035 (from 635db441)
Fixes tradingview/charting_library#5871
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -608,7 +608,7 @@ for(var i=Math.min(this._points.length,e.points.length),n=0;n<i;n++)this._points
|
||||
e.isMonths()&&this.properties().intervalsVisibilities.months.setValue(!0)},t.prototype.updateLastUpdateTime=function(){this.properties().lastUpdateTime.setValue((new Date).valueOf())},t.prototype.clonePositionOffset=function(){return this.isFixed()?{barOffset:0,xCoordOffset:20,yCoordOffset:20}:{barOffset:0,xCoordOffset:0,yCoordOffset:-40}},t.prototype.normalizePoint=function(e){return Object(n.a)(Object(n.a)({},this._model.timeScale().normalizeBarIndex(e.index)),{price:e.price})},t.prototype.normalizePoints=function(){this._timePoint=[];for(var e=0;e<this._points.length;e++)if(void 0!==this._points[e].index){var t=this.normalizePoint(this._points[e]);if(!t.time_t){this._timePoint=[];break}this._timePoint.push(t)}this._normalizedPointsChanged.fire()},t.prototype._setPaneViews=function(e,t,i){var n=this;this._paneViews.set(t,e),void 0!==t&&i&&t.onDestroyed().subscribe(this,(function(){return n._destroyPanePaneViews(t)})),this._model.lightUpdate()},t.prototype._getPaneViews=function(e){return this._paneViews.get(e)||null},t.prototype._updateAllPaneViews=function(){this._paneViews.forEach((function(e){for(var t=0,i=e;t<i.length;t++){i[t].update()}}))},t.prototype._alignPointHorizontallyOrVertically=function(e){var t=this.pointToScreenPoint(e)[1],i=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._startMovingPoint).logical),n=this.pointToScreenPoint(i)[1],r=Math.abs(n.x-t.x),s=Math.abs(n.y-t.y);return r<10&&s<10?e:{index:r<s?i.index:e.index,price:r<s?e.price:i.price}},t.prototype._alignScreenPointHorizontallyOrVertically=function(e){var t=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._startMovingPoint).screen),i=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return i<10&&n<10?e:i<n?new r.Point(t.x,e.y):new r.Point(e.x,t.y)},t.prototype._correctPoints=function(e){var t=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._currentMovingPoint).logical),i=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._startMovingPoint).logical),n=t.index-i.index,r=t.price-i.price;if(0===n&&0===r)return!1;for(var s=0;s<e.length;s++){var a=e[s];a.index=a.index+n,a.price+=r,e[s]=a}return!0},t.prototype._correctFixedPoints=function(e){for(var t=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._currentMovingPoint).screen),i=Object(o.ensureDefined)(Object(o.ensureNotNull)(this._startMovingPoint).screen),n=t.subtract(i),r=0;r<e.length;r++)e[r]=e[r].add(n)},t.prototype._currentPointsetIdWithPrefix=function(){return"pointset_"+this._currentPointsetId},t.prototype._clearServerPoints=function(){null!==this._currentPointsetId&&this._model.chartApi().isConnected().value()&&this._model.chartApi().removePointset(this._currentPointsetIdWithPrefix()),this._currentPointsetId=null},t.prototype._createPointProperty=function(e){var t=this._pointsProperty.childs().points;t.addProperty(""+e,{});var i=t[e];i.addChild("price",new f.LineDataSourcePointPriceProperty(this,e)),i.addChild("bar",new _.a(this,e))},t.prototype._createPointsProperties=function(){this._pointsProperty=new d.a,this._pointsProperty.addChild("points",new d.a)
|
||||
;for(var e=0;e<this.pointsCount();e++)this._createPointProperty(e)},t._addCollectedProperties=function(e){e.hasChild("linewidth")&&e.addChild("linesWidths",new p.LineToolWidthsProperty([Object(o.ensureDefined)(e.child("linewidth"))])),e.hasChild("linecolor")&&e.addChild("linesColors",new p.LineToolColorsProperty([Object(o.ensureDefined)(e.child("linecolor"))])),e.hasChild("backgroundColor")&&e.addChild("backgroundsColors",new p.LineToolColorsProperty([Object(o.ensureDefined)(e.child("backgroundColor"))])),e.hasChild("textColor")&&e.addChild("textsColors",new p.LineToolColorsProperty([Object(o.ensureDefined)(e.child("textColor"))])),e instanceof y.DefaultProperty&&(e.addExclusion("linesWidths"),e.addExclusion("linesColors"),e.addExclusion("backgroundsColors"),e.addExclusion("textsColors"))},t.prototype._destroyPanePaneViews=function(e){var t=this._paneViews.get(e);if(void 0!==t)for(var i=0,n=t;i<n.length;i++){var r=n[i];r.destroy&&r.destroy()}void 0!==e&&e.onDestroyed().unsubscribeAll(this),this._paneViews.delete(e)},t.prototype._copyPricesWithoutNormalization=function(){for(var e=Math.min(this._points.length,this._timePoint.length),t=0;t<e;t++)this._timePoint[t].price=this._points[t].price},t}(a.DataSource)},o2pV:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionIndexes",(function(){return r}));var n=i("Eyy1"),r=function(){function e(e){this._baseIndex=null,this._offsetInBar=null,this._offsetInTime=null,this._barsBetweenPoints=null,this._timescale=e}return e.prototype.indexes=function(e,t){if(null===this._offsetInTime||null===this._barsBetweenPoints){var i=this._timescale.barSpacing();this._barsBetweenPoints=Math.floor(120/i),this._offsetInBar=t%this._barsBetweenPoints,this._offsetInTime=this._timescale.indexToTimePoint(this._offsetInBar),this._baseIndex=this._timescale.baseIndex()}var r=this._timescale.baseIndex();this._baseIndex!==r&&(this._baseIndex=r,this._offsetInBar=Object(n.ensureNotNull)(this._timescale.timePointToIndex(this._offsetInTime)));for(var o=Object(n.ensureNotNull)(this._offsetInBar),s=[],a=Math.floor((e-o)/this._barsBetweenPoints),l=Math.floor((t-o)/this._barsBetweenPoints);a<=l;a++)s.push(o+a*this._barsBetweenPoints);return s},e.prototype.clear=function(){this._offsetInBar=null,this._offsetInTime=null,this._baseIndex=null,this._barsBetweenPoints=null},e}()},oIoN:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty;function o(e,t){var r=t||o.createProperties();n.call(this,e,r),this.version=o.version,i.e("lt-pane-views").then(function(e){var t=i("pBAL").DisjointChannelPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.name=function(){return"Disjoint Channel"},o.prototype.hasEditableCoordinates=function(){return!1},o.prototype.addPoint=function(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,e)},o.prototype.setLastPoint=function(e,t){
|
||||
return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),n.prototype.setLastPoint.call(this,e)},o.prototype.setPoint=function(e,t,i){var r=.5*(this._points[1].price+this._points[2].price);if(i&&i.shift()&&1===e){this._snapPoint45Degree(t,this.points()[0])}if(e<3&&n.prototype.setPoint.call(this,e,t),0!==e&&2!==e){if(1===e){var o=this._points[1].price-r;this._points[2].price=this._points[1].price-2*o}else if(3===e){o=t.price-this._points[2].price;this._points[0].price=this._points[1].price-o,this._points[0].index=t.index}this.normalizePoints()}},o.prototype.getPoint=function(e){if(e<3)return n.prototype.getPoint.call(this,e);var t=this._points[0].price-this._points[2].price;return{index:this._points[0].index,price:this._points[1].price-t}},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));var n=this._points[2];n.time=t.time,n.index=t.index;var r,o,s,a,l={price:n.price+(t.price-e.price),time:e.time,index:e.index},c=[];n.index<=l.index?(c.push(n),c.push(l)):(c.push(l),c.push(n)),i[0].price>c[0].price?(r=i,o=c):c[0].price>i[0].price||c[1].price>i[1].price?(r=c,o=i):(r=i,o=c);var u=this.properties().extendLeft.value(),h=this.properties().extendRight.value();return e.index<=t.index?(s=u,a=h):(s=h,a=u),[this._linePointsToAlertPlot(r,"Upper",s,a),this._linePointsToAlertPlot(o,"Lower",s,a)]},o.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(24),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("vm8R").GeneralTrendFiguresDefinitionsViewModel}.bind(null,i)).catch(i.oe)},o.createProperties=function(e){var t=new r("linetooldisjointangle",e);return o._configureProperties(t),t},o._configureProperties=function(e){n._configureProperties(e)},t.LineToolDisjointChannel=o},oNDq:function(e,t,i){"use strict";i.r(t),i.d(t,"createConfirmDialog",(function(){return o}));var n=i("mrSG"),r=i("YFKU");function o(e){var t={actions:[{key:13,name:"yes",text:r.t("Yes"),type:"success"},{method:"close",name:"no",text:r.t("No"),type:"default"}],actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',content:r.t("Are you sure?"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',destroyOnClose:!0,title:r.t("Confirmation"),width:400,dataset:{"dialog-type":"confirm-dialog"}};return new Promise((function(r){Promise.all([i.e("dialogs-core"),i.e(57),i.e(0),i.e(18),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;r(s(Object(n.a)(Object(n.a)({},t),e)))}.bind(null,i)).catch(void 0)}))}},oV8k:function(e,t,i){"use strict";i.r(t),i.d(t,"CustomSourceBase",(function(){return n}));var n=function(){function e(e,t){this._id=e,this._model=t}return e.prototype.id=function(){return this._id},e.prototype.isHoveredEnabled=function(){return!0},e.prototype.isSelectionEnabled=function(){
|
||||
return!1},e.prototype.priceScale=function(){return null},e.prototype.paneViews=function(e){return[]},e.prototype.labelPaneViews=function(e){return[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateViewsForPane=function(e){e.containsMainSeries()&&this.updateAllViews()},e}()},oWyD:function(e,t,i){},oXaB:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"PriceAxisLastValueMode",(function(){return n})),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(n||(n={}))},ocLq:function(e,t,i){"use strict";(function(t){var n=i("5B3K").StudyError,r=i("Y7w9"),o=i("ogJP").inherit,s=i("E6p6").SessionStage,a=i("LxhU").Interval,l=i("OLhd").createDwmAligner,c=i("5fI3").decodeExtendedSymbol,u=i("5fI3").encodeExtendedSymbolOrGetSimpleSymbolString,h=function(){var e,h="undefined"!=typeof window?window:t,d=h.PineJsCalendar?h.PineJsCalendar:i("jCNj"),p=i("IiTo"),f=i("IDnv").extrapolateBarsFrontToTime,_={};function m(e,t,i,n,r){var o=r,s=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(var a=0;a<t;++a)n(e.get(a),o)&&(s=a,o=e.get(a));return{index:s,value:o}}function v(e,t,i,n,r){this._areaRight=e,this._areaLeft=t,this._pivotType=i,this._series=n,this._currentIndex=r.new_var(0),this._currentValue=r.new_var(NaN),this._pivotIndex=r.new_var(-1),this._index=_.n(r),this._isNewBar=r.symbol.isNewBar;var o=this._currentIndex.get(1),s=this._currentValue.get(1),a=this._pivotIndex.get(1);this._index>1&&(this._currentIndex.set(o),this._currentValue.set(s),this._pivotIndex.set(a))}function y(e,t,i){this._deviation=e;var n=i.new_var(_.high(i)),r=i.new_var(_.low(i));n.get(2*t+1),r.get(2*t+1),this._pivotHigh=new v(t,t,v.HIGH,n,i),this._pivotLow=new v(t,t,v.LOW,r,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=_.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed;var o=this._lastIndex.get(1),s=this._lastVal.get(1),a=this._lastType.get(1);this._index>1&&this.addPivot(o,s,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function g(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0,this.varsAffectAdditionalDepth=!0}function b(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function S(e){b.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function w(e,t,i,n,r){var o=c(e);const s="string"==typeof o.symbol?o:o.symbol;this.ticker=s.symbol,this.currencyCode=i||s["currency-id"];var l=s["currency-id"]!==this.currencyCode;s["currency-id"]=this.currencyCode,l&&(e=u(o)),this.tickerid=e,this.period=t,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new p.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=n;var h=a.parse(t);this.resolution=h.letter(),this.interval=h.multiplier(),this.bb_cache={},r&&this.set_symbolinfo(r)}function P(e,t,i,n,r,o,s,a,l){this.body=r,
|
||||
return!1},e.prototype.priceScale=function(){return null},e.prototype.paneViews=function(e){return[]},e.prototype.labelPaneViews=function(e){return[]},e.prototype.priceAxisViews=function(e,t){return[]},e.prototype.updateViewsForPane=function(e){e.containsMainSeries()&&this.updateAllViews()},e}()},oWyD:function(e,t,i){},oXaB:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"PriceAxisLastValueMode",(function(){return n})),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(n||(n={}))},ocLq:function(e,t,i){"use strict";(function(t){var n=i("5B3K").StudyError,r=i("Y7w9"),o=i("ogJP").inherit,s=i("E6p6").SessionStage,a=i("LxhU").Interval,l=i("OLhd").createDwmAligner,c=i("5fI3").decodeExtendedSymbol,u=i("5fI3").encodeExtendedSymbolOrGetSimpleSymbolString,h=function(){var e,h="undefined"!=typeof window?window:t,d=h.PineJsCalendar?h.PineJsCalendar:i("jCNj"),p=i("IiTo"),f=i("IDnv").extrapolateBarsFrontToTime,_={};function m(e,t,i,n,r){var o=r,s=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(var a=0;a<t;++a)n(e.get(a),o)&&(s=a,o=e.get(a));return{index:s,value:o}}function v(e,t,i,n,r){this._areaRight=e,this._areaLeft=t,this._pivotType=i,this._series=n,this._currentIndex=r.new_var(0),this._currentValue=r.new_var(NaN),this._pivotIndex=r.new_var(-1),this._index=_.n(r),this._isNewBar=r.symbol.isNewBar;var o=this._currentIndex.get(1),s=this._currentValue.get(1),a=this._pivotIndex.get(1);this._index>1&&(this._currentIndex.set(o),this._currentValue.set(s),this._pivotIndex.set(a))}function y(e,t,i){this._deviation=e;var n=i.new_var(_.high(i)),r=i.new_var(_.low(i));n.get(2*t+1),r.get(2*t+1),this._pivotHigh=new v(t,t,v.HIGH,n,i),this._pivotLow=new v(t,t,v.LOW,r,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=_.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed;var o=this._lastIndex.get(1),s=this._lastVal.get(1),a=this._lastType.get(1);this._index>1&&this.addPivot(o,s,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function g(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0,this.varsAffectAdditionalDepth=!0}function b(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function S(e){b.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function w(e,t,i,n,r){var o=c(e);const s="string"==typeof o.symbol?o:o.symbol;this.ticker=s.symbol,this.currencyCode=i||s["currency-id"];var l=s["currency-id"]!==this.currencyCode;s["currency-id"]=this.currencyCode,l&&(e=u(o)),this.tickerid=e;var h=a.parse(t);this.resolution=h.letter(),this.interval=h.multiplier(),this.period=h.value(),this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new p.SessionInfo("Etc/UTC","24x7"),this.other_sessions={},this.script=n,this.bb_cache={},r&&this.set_symbolinfo(r)}function P(e,t,i,n,r,o,s,a,l){this.body=r,
|
||||
this.symbols=[],this.runner=n,this.inputCallback=s,this.out=o,this.nonseriesOut=a,this.ctx=new g(this.add_sym(e,t,i,l)),this.init()}function C(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function T(e){this.runner=new C(e)}function x(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTime=0!==this.bars.length?this.bars[0].time:1/0}function I(e,t){this.period=e,this.generateEmptyBars=!!t}function L(){}return _.max_series_default_size=10001,_.n=function(e){return e.symbol.index+1},_.nz=function(e,t){return t=t||0,isFinite(e)?e:t},_.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},_.isZero=function(e){return Math.abs(e)<=1e-10},_.toBool=function(e){return isFinite(e)&&!_.isZero(e)},_.eq=function(e,t){return _.isZero(e-t)},_.neq=function(e,t){return!_.eq(e,t)},_.ge=function(e,t){return _.isZero(e-t)||e>t},_.gt=function(e,t){return!_.isZero(e-t)&&e>t},_.lt=function(e,t){return!_.isZero(e-t)&&e<t},_.le=function(e,t){return _.isZero(e-t)||e<t},_.and=function(e,t){return isNaN(e)||isNaN(t)?NaN:_.isZero(e)||_.isZero(t)?0:1},_.or=function(e,t){return isNaN(e)||isNaN(t)?NaN:_.isZero(e)&&_.isZero(t)?0:1},_.not=function(e){return isNaN(e)?NaN:_.isZero(e)?1:0},_.eps=function(){return 1e-10},_.greaterOrEqual=function(e,t,i){return t-e<(i||1e-10)},_.lessOrEqual=function(e,t,i){return e-t<(i||1e-10)},_.equal=function(e,t,i){return Math.abs(e-t)<(i||1e-10)},_.greater=function(e,t,i){return e-t>(i||1e-10)},_.less=function(e,t,i){return t-e>(i||1e-10)},_.compare=function(e,t,i){return _.equal(e,t,i)?0:_.greater(e,t,i)?1:-1},_.max=Math.max,_.min=Math.min,_.pow=Math.pow,_.abs=Math.abs,_.log=Math.log,_.log10=function(e){return Math.log(e)/Math.LN10},_.sqrt=Math.sqrt,_.sign=function(e){return isNaN(e)?NaN:_.isZero(e)?0:e>0?1:-1},_.exp=Math.exp,_.sin=Math.sin,_.cos=Math.cos,_.tan=Math.tan,_.asin=Math.asin,_.acos=Math.acos,_.atan=Math.atan,_.floor=Math.floor,_.ceil=Math.ceil,_.round=Math.round,_.avg=function(e,t,i,n,r,o){if(2===arguments.length)return(e+t)/2;for(var s=0,a=0;a<arguments.length;a++)s+=arguments[a];return s/arguments.length},_.open=function(e){return e.symbol.open},_.high=function(e){return e.symbol.high},_.low=function(e){return e.symbol.low},_.close=function(e){return e.symbol.close},_.hl2=function(e){return(e.symbol.high+e.symbol.low)/2},_.hlc3=function(e){return(e.symbol.high+e.symbol.low+e.symbol.close)/3},_.ohlc4=function(e){return(e.symbol.open+e.symbol.high+e.symbol.low+e.symbol.close)/4},_.volume=function(e){return e.symbol.volume},_.updatetime=function(e){return e.symbol.updatetime},_.time=function(e,t,i){return e.symbol.bartime(t,i)},_.period=function(e){return e.symbol.period},_.tickerid=function(e){return e.symbol.tickerid},_.currencyCode=function(e){return e.symbol.currencyCode},_.ticker=function(e){return e.symbol.ticker},_.interval=function(e){return e.symbol.interval},_.isdwm=function(e){return e.symbol.isdwm()},_.isintraday=function(e){return!e.symbol.isdwm()},_.isdaily=function(e){return"D"===e.symbol.resolution},
|
||||
_.isweekly=function(e){return"W"===e.symbol.resolution},_.ismonthly=function(e){return"M"===e.symbol.resolution},_.year=function(e){return _.timepart(e.symbol,d.YEAR,arguments[1])},_.month=function(e){return _.timepart(e.symbol,d.MONTH,arguments[1])},_.weekofyear=function(e){return _.timepart(e.symbol,d.WEEK_OF_YEAR,arguments[1])},_.dayofmonth=function(e){return _.timepart(e.symbol,d.DAY_OF_MONTH,arguments[1])},_.dayofweek=function(e){return _.timepart(e.symbol,d.DAY_OF_WEEK,arguments[1])},_.hour=function(e){return _.timepart(e.symbol,d.HOUR_OF_DAY,arguments[1])},_.minute=function(e){return _.timepart(e.symbol,d.MINUTE,arguments[1])},_.second=function(e){return _.timepart(e.symbol,d.SECOND,arguments[1])},_.add_days_considering_dst=function(e,t,i){return d.add_days_considering_dst(d.get_timezone(e),t,i)},_.selectSessionBreaks=function(e,t){if(_.isdwm(e)||void 0===e.symbol.session.timezone)return[];var i=p.newBarBuilder(e.symbol.period,e.symbol.session),n=[],r=t.length;if(i.moveTo(t[r-1]),1===r&&i.startOfBar(0)===t[0])n.push(t[0]);else{for(var o=r-2;o>=0;--o){var s=t[o];if(!(s>=i.startOfBar(0))){i.moveTo(s);var a=t[o+1];n.push(a)}}n.reverse()}return n},_.iff=function(e,t,i){return _.not(e)?i:t},_.rising=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)>e.get(0))return 0;return 1},_.falling=function(e,t){for(var i=1;i<t+1;++i)if(e.get(i)<e.get(0))return 0;return 1},_.timepart=function(e,t,i){var n=d.utc_to_cal(e.timezone,i||e.bartime());return d.get_part(n,t)},_.rsi=function(e,t){return _.isZero(t)?100:_.isZero(e)?0:100-100/(1+e/t)},_.sum=function(e,t,i){var n=i.new_var(),r=_.nz(e.get())+_.nz(n.get(1))-_.nz(e.get(t));return n.set(r),r},_.sma=function(e,t,i){var n=_.sum(e,t,i);return _.na(e.get(t-1))?NaN:n/t},_.rma=function(e,t,i){var n=_.sum(e,t,i),r=t-1,o=e.get(r),s=i.new_var(),a=s.get(1),l=e.get(),c=_.na(o)?NaN:_.na(a)?n/t:(l+a*r)/t;return s.set(c),c},_.fixnan=function(e,t){var i=t.new_var();return isNaN(e)?i.get(1):(i.set(e),e)},_.tr=function(e,t){1===arguments.length&&(t=e,e=void 0);var i=void 0!==e&&!!e,n=t.new_var(_.close(t)),r=n.get(1);return i&&isNaN(r)&&(r=_.close(t)),_.max(_.max(_.high(t)-_.low(t),_.abs(_.high(t)-r)),_.abs(_.low(t)-r))},_.atr=function(e,t){var i=t.new_var(_.tr(t));return _.sma(i,e,t)},_.ema=function(e,t,i){var n=_.sum(e,t,i),r=i.new_var(),o=e.get(0),s=e.get(t-1),a=r.get(1),l=_.na(s)?NaN:_.na(a)?n/t:2*(o-a)/(t+1)+a;return r.set(l),l},_.wma=function(e,t,i){for(var n=0,r=t=Math.round(t);r>=0;r--){n+=(t-r)*e.get(r)}return 2*n/(t*(t+1))},_.vwma=function(e,t,i){var n=i.new_var(_.volume(i)),r=i.new_var(e.get(0)*_.volume(i));return _.sma(r,t,i)/_.sma(n,t,i)},_.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},_.lowestbars=function(e,t,i){return-m(e,t,0,(function(e,t){return _.lt(e,t)}),Number.MAX_VALUE).index},_.lowest=function(e,t,i){return m(e,t,0,(function(e,t){return _.lt(e,t)}),Number.MAX_VALUE).value},_.highestbars=function(e,t,i){return-m(e,t,0,(function(e,t){return _.gt(e,t)}),Number.MIN_VALUE).index},_.highest=function(e,t,i){return m(e,t,0,(function(e,t){return _.gt(e,t)
|
||||
}),Number.MIN_VALUE).value},_.cum=function(e,t){var i=t.new_var(),n=_.nz(i.get(1))+e;return i.set(n),n},_.accdist=function(e){var t=_.high(e),i=_.low(e),n=_.close(e),r=_.volume(e);return _.cum(n===t&&n===i||t===i?0:r*(2*n-i-t)/(t-i),e)},_.correlation=function(e,t,i,n){var r=_.sma(e,i,n),o=_.sma(t,i,n),s=n.new_var(e.get()*t.get());return(_.sma(s,i,n)-r*o)/Math.sqrt(_.variance2(e,r,i)*_.variance2(t,o,i))},_.stoch=function(e,t,i,n,r){var o=_.highest(t,n),s=_.lowest(i,n);return _.fixnan(100*(e.get()-s)/(o-s),r)},_.tsi=function(e,t,i,n){var r=n.new_var(_.change(e)),o=n.new_var(_.abs(_.change(e))),s=n.new_var(_.ema(r,i,n)),a=n.new_var(_.ema(o,i,n));return _.ema(s,t,n)/_.ema(a,t,n)},_.cross=function(e,t,i){if(isNaN(e)||isNaN(t))return!1;var n,r=i.new_var((n=e-t)<0?-1:0===n?0:1);return!isNaN(r.get(1))&&r.get(1)!==r.get()},_.linreg=function(e,t,i){for(var n=0,r=0,o=0,s=0,a=0;a<t;++a){var l=e.get(a),c=t-1-a+1;n+=c,r+=l,o+=c*c,s+=l*c}var u=(t*s-n*r)/(t*o-n*n);return r/t-u*n/t+u+u*(t-1-i)},_.sar=function(e,t,i,n){var r=n.new_var(),o=n.new_var(),s=n.new_var(),a=_.high(n),l=_.low(n),c=_.close(n),u=n.new_var(a),h=n.new_var(l),d=n.new_var(c),p=n.new_var(),f=p.get(1),m=o.get(1),v=s.get(1);o.set(m),s.set(v);var y=!1,g=h.get(1),b=h.get(2),S=u.get(1),w=u.get(2),P=d.get(),C=d.get(1);2===_.n(n)&&(_.greater(P,C)?(r.set(1),s.set(u.get()),f=g,v=u.get()):(r.set(-1),s.set(h.get()),f=S,v=h.get()),y=!0,o.set(e),m=e);var T=f+m*(v-f);return 1===r.get()?_.greater(T,h.get())&&(y=!0,r.set(-1),T=Math.max(u.get(),s.get()),s.set(h.get()),o.set(e)):_.less(T,u.get())&&(y=!0,r.set(1),T=Math.min(h.get(),s.get()),s.set(u.get()),o.set(e)),y||(1===r.get()?_.greater(u.get(),s.get())&&(s.set(u.get()),o.set(Math.min(o.get()+t,i))):_.less(h.get(),s.get())&&(s.set(h.get()),o.set(Math.min(o.get()+t,i)))),1===r.get()?(T=Math.min(T,g),_.n(n)>2&&(T=Math.min(T,b))):(T=Math.max(T,S),_.n(n)>2&&(T=Math.max(T,w))),p.set(T),T},_.alma=function(e,t,i,n){for(var r=Math.floor(i*(t-1)),o=t/n*(t/n),s=[],a=0,l=0;l<t;++l){var c=Math.exp(-1*Math.pow(l-r,2)/(2*o));a+=c,s.push(c)}for(l=0;l<t;++l)s[l]/=a;var u=0;for(l=0;l<t;++l)u+=s[l]*e.get(t-l-1);return u},_.wvap=function(e,t){return e.get()-e.get(1)},_.change=function(e){return e.get()-e.get(1)},_.roc=function(e,t){var i=e.get(t);return 100*(e.get()-i)/i},_.dev=function(e,t,i){var n=_.sma(e,t,i);return _.dev2(e,t,n)},_.dev2=function(e,t,i){for(var n=0,r=0;r<t;r++){var o=e.get(r);n+=_.abs(o-i)}return n/t},_.stdev=function(e,t,i){var n=_.variance(e,t,i);return _.sqrt(n)},_.variance=function(e,t,i){var n=_.sma(e,t,i);return _.variance2(e,n,t)},_.variance2=function(e,t,i){for(var n=0,r=0;r<i;r++){var o=e.get(r),s=_.abs(o-t);n+=s*s}return n/i},_.percentrank=function(e,t){if(_.na(e.get(t-1)))return NaN;for(var i=0,n=e.get(),r=1;r<t;r++){var o=e.get(r);_.ge(n,o)&&i++}return 100*i/t},_.createNewSessionCheck=function(e){if(void 0===e.symbol.session.timezone)return function(){return!1};var t=p.newBarBuilder(e.symbol.period,e.symbol.session);return function(e){return t.indexOfBar(e)===s.POST_SESSION&&(t.moveTo(e),!0)}},_.error=function(e){
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"description": "CL v19.034 (internal id 71af24cd @ 2021-07-05T08:46:56.445Z)",
|
||||
"description": "CL v19.035 (internal id 635db441 @ 2021-07-05T09:22:43.310Z)",
|
||||
"type": "module",
|
||||
"main": "charting_library.cjs.js",
|
||||
"module": "charting_library.esm.js",
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user