From e3327b4c77eff4a54581b7a7b99d3f8eeb5070e2 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Wed, 20 Nov 2019 13:12:22 +0300 Subject: [PATCH] commit 2019-11-20 10:12:19.883597 ConfirmDialog does not close after YES is clicked #3981 Side DOM chart does not render in certain conditions #3975 --- charting_library/charting_library.min.js | 2 +- ... => ar-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ...680.js => library.6193a35b840b0cd54108.js} | 138 +++++++++--------- ...rary.d4fe80eabeda1f68dfb3cc3f3939c03a.css} | 11 -- ....d4fe80eabeda1f68dfb3cc3f3939c03a.rtl.css} | 11 -- ...5d6.js => vendors.760e5af2bd4c4eac24b4.js} | 2 +- ... => cs-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... da_DK-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => de-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => el-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => en-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => es-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... et_EE-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => fa-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => fr-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... he_IL-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... hu_HU-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... id_ID-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => it-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => ja-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => ko-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... ms_MY-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... nl_NL-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => no-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => pl-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => pt-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => ro-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => ru-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... sk_SK-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => sv-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => th-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => tr-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => vi-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... => zh-tv-chart.9a97ec3c5cba51244359.html} | 2 +- ... zh_TW-tv-chart.9a97ec3c5cba51244359.html} | 2 +- 35 files changed, 101 insertions(+), 123 deletions(-) rename charting_library/static/{ar-tv-chart.c50161b112a0634ca34f.html => ar-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/bundles/{library.05d97551e2b48003a680.js => library.6193a35b840b0cd54108.js} (97%) rename charting_library/static/bundles/{library.27b95a80e070d64c99f2bd8232f0cbbb.css => library.d4fe80eabeda1f68dfb3cc3f3939c03a.css} (99%) rename charting_library/static/bundles/{library.27b95a80e070d64c99f2bd8232f0cbbb.rtl.css => library.d4fe80eabeda1f68dfb3cc3f3939c03a.rtl.css} (99%) rename charting_library/static/bundles/{vendors.fc2cf9bcb629569ed5d6.js => vendors.760e5af2bd4c4eac24b4.js} (99%) rename charting_library/static/{cs-tv-chart.c50161b112a0634ca34f.html => cs-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{da_DK-tv-chart.c50161b112a0634ca34f.html => da_DK-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{de-tv-chart.c50161b112a0634ca34f.html => de-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{el-tv-chart.c50161b112a0634ca34f.html => el-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{en-tv-chart.c50161b112a0634ca34f.html => en-tv-chart.9a97ec3c5cba51244359.html} (98%) rename charting_library/static/{es-tv-chart.c50161b112a0634ca34f.html => es-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{et_EE-tv-chart.c50161b112a0634ca34f.html => et_EE-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{fa-tv-chart.c50161b112a0634ca34f.html => fa-tv-chart.9a97ec3c5cba51244359.html} (98%) rename charting_library/static/{fr-tv-chart.c50161b112a0634ca34f.html => fr-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{he_IL-tv-chart.c50161b112a0634ca34f.html => he_IL-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{hu_HU-tv-chart.c50161b112a0634ca34f.html => hu_HU-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{id_ID-tv-chart.c50161b112a0634ca34f.html => id_ID-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{it-tv-chart.c50161b112a0634ca34f.html => it-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{ja-tv-chart.c50161b112a0634ca34f.html => ja-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{ko-tv-chart.c50161b112a0634ca34f.html => ko-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{ms_MY-tv-chart.c50161b112a0634ca34f.html => ms_MY-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{nl_NL-tv-chart.c50161b112a0634ca34f.html => nl_NL-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{no-tv-chart.c50161b112a0634ca34f.html => no-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{pl-tv-chart.c50161b112a0634ca34f.html => pl-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{pt-tv-chart.c50161b112a0634ca34f.html => pt-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{ro-tv-chart.c50161b112a0634ca34f.html => ro-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{ru-tv-chart.c50161b112a0634ca34f.html => ru-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{sk_SK-tv-chart.c50161b112a0634ca34f.html => sk_SK-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{sv-tv-chart.c50161b112a0634ca34f.html => sv-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{th-tv-chart.c50161b112a0634ca34f.html => th-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{tr-tv-chart.c50161b112a0634ca34f.html => tr-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{vi-tv-chart.c50161b112a0634ca34f.html => vi-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{zh-tv-chart.c50161b112a0634ca34f.html => zh-tv-chart.9a97ec3c5cba51244359.html} (99%) rename charting_library/static/{zh_TW-tv-chart.c50161b112a0634ca34f.html => zh_TW-tv-chart.9a97ec3c5cba51244359.html} (99%) diff --git a/charting_library/charting_library.min.js b/charting_library/charting_library.min.js index 4f97fb70..54d2763f 100644 --- a/charting_library/charting_library.min.js +++ b/charting_library/charting_library.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TradingView={})}(this,function(t){"use strict";var e=Object.assign||function(t){for(var e,o=arguments,i=1,n=arguments.length;i'},t}();window.TradingView=window.TradingView||{},window.TradingView.version=s,t.version=s,t.widget=r,Object.defineProperty(t,"__esModule",{value:!0})}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TradingView={})}(this,function(t){"use strict";var e=Object.assign||function(t){for(var e,o=arguments,i=1,n=arguments.length;i'},t}();window.TradingView=window.TradingView||{},window.TradingView.version=s,t.version=s,t.widget=r,Object.defineProperty(t,"__esModule",{value:!0})}); diff --git a/charting_library/static/ar-tv-chart.c50161b112a0634ca34f.html b/charting_library/static/ar-tv-chart.9a97ec3c5cba51244359.html similarity index 99% rename from charting_library/static/ar-tv-chart.c50161b112a0634ca34f.html rename to charting_library/static/ar-tv-chart.9a97ec3c5cba51244359.html index e1ef8230..d592d088 100644 --- a/charting_library/static/ar-tv-chart.c50161b112a0634ca34f.html +++ b/charting_library/static/ar-tv-chart.9a97ec3c5cba51244359.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/charting_library/static/bundles/library.05d97551e2b48003a680.js b/charting_library/static/bundles/library.6193a35b840b0cd54108.js similarity index 97% rename from charting_library/static/bundles/library.05d97551e2b48003a680.js rename to charting_library/static/bundles/library.6193a35b840b0cd54108.js index c809ec4a..89817e0b 100644 --- a/charting_library/static/bundles/library.05d97551e2b48003a680.js +++ b/charting_library/static/bundles/library.6193a35b840b0cd54108.js @@ -35,17 +35,17 @@ i=o>=0?e.substr(o):"",t+i)},n.cutScriptIdPart=function(e){var t=e.indexOf("$"),i var t="study_"+e.id;return e.pine&&e.pine.version&&(t+="_"+e.pine.version.replace(".","_")),t},n.addOrReplaceStudyMetaInfo=function(e,t){var i,o,s,l,c=new n(t),h=n._findStudyMetaInfo(e,c.id),u=h[0],d=h[1];if(d){if(i=d.pine&&d.pine.version&&a.parse(d.pine.version),null!=(o=c.pine&&c.pine.version&&a.parse(c.pine.version))&&null!=i&&!o.isGreaterOrEqual(i))return c;n.removeStudyMetaInfo(e,c,u)}else n.removeStudyMetaInfo(e,c,u)&&r.logDebug("Study with id="+c.id+" already exists in the model!");return e.push(c),c.defaults&&(s=TradingView.clone(c.defaults),s.precision="default",l=n.getStudyPropertyRootName(c),defaults.create(l,s)),c},n.overrideDefaults=function(e){null!==l&&0!==e.length&&s(l,e,function(e){return TradingView.defaultProperties["study_"+e]||null})},n.setDefaultsOverrides=function(e){l=e},n.createMetaInfoStub=function(e,t){var i,n,r;return o(TradingView.isExistent(e.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(e)),i=e.extra&&"strategy"===e.extra.kind||!0===e.isTVScriptStrategy,n=TVScript.createScriptStudyId(e.scriptIdPart,t,i),r={isTVScriptStubToCompile:!0,id:n,scriptIdPart:e.scriptIdPart,description:e.scriptName,TVScriptSourceCode:e.scriptSource,is_hidden_study:e.extra&&e.extra.is_hidden_study,extra:e.extra,version:t},r.pine={},r.pine.version=TradingView.isExistent(e.version)?e.version:-1,r.pine.access=TVScript.Access.MAP_ID_TO_NAME[e.access],r.pine.userHaveAccess=e.userHaveAccess,!0===i&&(r.isTVScriptStrategy=!0),r},n.isScriptStrategy=function(e){if(e.extra&&e.extra.kind)return e.extra.kind===TVScript.Kinds.STRATEGY;if(!0===e.isTVScriptStrategy)return!0;var t=e.TVScriptSourceCode||e.scriptSource;return!!t&&TVScript.isStrategy(t)},n.replaceWithFullStudyMetaInfoAsync=function(e,t){var i=$.Deferred();return t.isTVScriptStubToCompile||i.resolve(t),i.promise()},n.getOrderedInputIds=function(e){var t,i,n=[],o=e.inputs;for(t=0;t100)throw Error("invalid transparency");return n=Object(a.parseRgb)(e),o=n[0],r=n[1],l=n[2],c=Object(a.normalizeAlphaComponent)(1-t/100),Object(a.rgbaToString)([o,r,l,c])}function o(e){return s(e)?e:Object(a.rgbaToString)(Object(a.rgba)(Object(a.parseRgb)(e),Object(a.normalizeAlphaComponent)(1)))}function r(e){var t=Object(a.parseRgb)(e).map(function(e){return e/=255,e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return+(.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3)}function s(e){return 0===e.indexOf("#")}var a;Object.defineProperty(t,"__esModule",{value:!0}),t.generateColor=n,t.resetTransparency=o,t.getLuminance=r,t.isHexColor=s,a=i(24),i.n(a)},function(e,t,i){"use strict";function n(e,t,i){var n=t.subtract(e),o=i.subtract(e),r=o.dotProduct(n)/n.dotProduct(n);return{coeff:r,distance:e.addScaled(n,r).subtract(i).length()}}function o(e,t,i){var o,r,s=n(e,t,i);return 0<=s.coeff&&s.coeff<=1?s:(o=e.subtract(i).length(),r=t.subtract(i).length(),o0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new oe(o,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new oe(o,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c= 1");return s=TradingView.clone(defaults("study")),_(s,e),a=pe.getStudyPropertyRootName(e),l=TradingView.clone(defaults(a,r)),e.isTVScript&&e.TVScriptSourceCode!==l.TVScriptSourceCode&&(l=TradingView.clone(TradingView.factoryDefaults(a,r))),TradingView.merge(s,l),n&&(S(!(n instanceof t),"propsState should not be an instance of Property"),TradingView.merge(s,n)),c=TradingView.clone(e),h={},y.mergeInputsObjPart(h,c.defaults.inputs),y.mergeInputsObjPart(h,s.inputs),s.inputs=h,delete c.inputs,delete c.defaults.inputs,u={},TradingView.merge(u,c.defaults),TradingView.merge(u,TradingView.factoryDefaults("study_"+c.id)),TradingView.merge(u,s),TradingView.merge(u,c),delete u.defaults,s=u,d=null!==o?o.model().getStudyShiftColorStartOffset():void 0,p=f(o,e),TradingView.merge(s,m(s,p,d)),n&&TradingView.merge(s.styles,n.styles),s}function p(e,t,n,o,r){var s,a,l,c,h,u,d=i(168);return e.version&&n.version&&e.version!==n.version&&ve.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+n.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults("study_"+e.id)),_(s,e),TradingView.merge(s,n),s=r.updateStudyState(s,e,t),a=TradingView.clone(t||e),a&&pe.versionOf(a)>=1&&(l={},d.mergeInputsObjPart(l,a.defaults.inputs),d.mergeInputsObjPart(l,s.inputs),s.inputs=l,delete a.inputs,delete a.defaults.inputs,c={},TradingView.merge(c,a.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+a.id)),TradingView.merge(c,s),delete a.defaults,TradingView.merge(c,a),s=c),h=null!==o?o.model().getStudyShiftColorStartOffset():void 0,u=f(o,a),TradingView.merge(s,m(s,u,h)),s}function _(e,t){var i,n,o,r;if(t.plots)for(i=0;im+1?(P=_[m+1],void 0!==P&&null!==P?(T=y.valToIndex?y.valToIndex[P]:P, +var v=i(7),S=v.assert,b=v.ensureNotNull,w=i(259).unpackNonSeriesData,P=i(166).StudyBarColorer,T=i(110).HorizontalLineRenderer,x=i(508),C=x.BandPaneView,L=x.BandBackgroundPaneView,I=x.HlineFillPaneView,A=i(509).StudyPriceAxisView,k=i(510),E=k.StudyPaneView,M=k.StudyBackgroundPaneView,V=k.StudyPlotShapesPaneView,D=k.StudyPlotCharsPaneView,O=k.StudyPlotArrowsPaneView,R=k.StudyPlotBarsPaneView,B=k.StudyPlotCandlesPaneView,F=i(527),N=F.PlotFillPaneView,W=F.AreaBackgroundPaneView,H=i(28).PriceDataSource,j=i(100),z=i(117).StudyDataWindowView,U=i(528).StudyLegendView,q=i(119),Y=i(529),G=Y.emptyStudyGraphics,K=Y.loadStudyGraphics,Z=Y.saveStudyGraphics,J=Y.LiveStudyGraphics,X=Y.createGraphicsPaneViews,Q=Y.createGraphicsPriceAxisViews,ee=i(18),te=i(268).ChartApiInterface,ie=i(6).Point,ne=i(24).shiftColor,oe=i(3).DefaultProperty,re=i(21).PriceFormatter,se=i(530).VolumeFormatter,ae=i(106).NumericFormatter,le=i(17),ce=le.PlotList,he=le.PlotRowSearchMode,ue=le.mergeMinMax,de=i(212).MarkLocation,pe=i(26),_e=i(31),fe=i(87),me=fe.PlotType,ye=i(2).propertyPages,ge=i(269).studyPlotFunctionMap,ve=i(4).getLogger("Chart.Study");s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){this._visible=!1;var e=this._study.lastValueData(this._plotName,!0);e.noData||(this._visible=!0,this._points=[new ie(0,e.coordinate)],this._color=e.color)},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var e={};return e.width=this.m_model.timeScale().width(),e.height=this._study.priceScale().height(),e.points=this._points,e.color=this._color,e.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(y,H),TradingView.Study=y,y.prototype.lastValueData=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return x;if(null===(n=this._model.timeScale().visibleBars()))return x;if(!this.properties().visible.value())return x;if(o=this.properties().styles,r=this.properties().ohlcPlots,o&&o[e]&&(s=o[e]),r&&r[e]&&(s=r[e]),!s||!s.visible.value())return x;if(a=this.offset(e),null==(l=this.nearestIndex(n.lastBar()-a,he.NearestLeft))||void 0===l)return x;for(h=this.metaInfo().plots,c=0;cm+1?(P=_[m+1],void 0!==P&&null!==P?(T=y.valToIndex?y.valToIndex[P]:P, f.color=g.colors[T].color.value()):f.color=w):f.color=w,f.floatCoordinate=this.priceScale().priceToCoordinate(S,b,!0),f.coordinate=Math.round(f.floatCoordinate),f.item=_,f):x},y.prototype.isFailed=function(){return this._failed},y.prototype.series=function(){return this._series},y.prototype.model=function(){return this._model},y.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},y.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.clear(),this._graphics.clear&&this._graphics.clear(),this._plotOffsets={}},y.prototype.onTagsChanged=function(){return this._tagsChanged},y.prototype.properties=function(){return this._properties},y.prototype.state=function(e){var t,i,n,o,r=TradingView.className(this.constructor),s={type:r,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof pe?s.metaInfo=TradingView.clone(this.metaInfo().state()):(s.metaInfo=TradingView.clone(this.metaInfo()),s.metaInfo.id=pe.parseIdString(s.metaInfo.id+(s.metaInfo.version?"-"+s.metaInfo.version:"")).fullId),e&&(s.data=this.data().state(),s.data.symbols=this._resolvedSymbols,s.data.graphics=Z(this.graphics()),s.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(s.ownerSource=this.ownerSource().id()),t=0;t=0?o:0));return this._isChildStudy&&pe.patchChildStudyMetaInfoState(s),s},y.prototype._plotsForAlert=function(){var e=this,t=this._metaInfo,i=[fe.isLinePlot,fe.isShapesPlot,fe.isCharsPlot,fe.isArrowsPlot,fe.isOhlcPlot];return t.plots.map(function(e,t){return e.pinePlotIndex=t,e}).filter(function(e){return i.some(function(t){return t(e)})}).map(function(i){var n={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:e.offset(i.id)};return t.styles&&void 0!==t.styles[i.id]&&(n.title=t.styles[i.id].title||""),i.target&&t.ohlcPlots&&t.ohlcPlots[i.target]&&(n.ohlcTitle=t.ohlcPlots[i.target].title),n})},y.prototype.isSavedInStudyTemplates=function(){for(var e=0;e0?$.when.apply($,r).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),o.resolve("All symbols are resolved now"),this._symbolsResolved.fire()}.bind(this)).fail(function(e){this._status=window.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),o.reject("Invalid symbol, "+e)}.bind(this)):o.resolve("There are no symbols to resolve"),o.promise()},y.prototype._allInputsAreValid=function(){var e,t,i;for(e=0;e0)return!0;for(e in this._metaInfo.graphics)for(t in this._metaInfo.graphics[e])if(i=this.properties().graphics[e][t],!i.visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},y.prototype.start=function(e,t){var i,n=this._model.mainSeries();if(!n.isStarted())return void n.dataEvents().completed().subscribe(this,function(){this.start(e,t)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==t||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(e,t)}.bind(this)).fail(function(e){ve.logError("ERROR: "+this._debugId()+" start failed, "+e),delete this._restarting}.bind(this))},y.prototype._getStudyIdWithLatestVersion=function(){var e=pe.cutDollarHash(this._metaInfo.id),t=e;return e.indexOf("@tv-scripting")>=0?t+="-101!":t+="-"+this._metaInfo.version,t},y.prototype._startAfterSymbolsResolved=function(e,t){var i,n;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);pe.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=y.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._getStudyIdWithLatestVersion(),this._incrementTurnaround(),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),this.onStart.fire(this._studyId),!0===e&&this._children))for(n=0;n=e&&(t=b(this._series.bars().lastIndex())-e,b(this._series.bars().valueAt(t))[TradingView.TIME_PLOT]),null},y.prototype.getSymbolString=function(e){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:e,session:"extended"}):e},y.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},y.prototype.inputsForAlert=function(){var e=this.offset(),t=this.inputs();return e&&t.push(e),t},y.prototype.inputs=function(e){var t={symbolsForDisplay:!1,symbolsForChartApi:!0, skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(t,e),this._buildInputs(t)},y.prototype._buildInputs=function(e){var t,i;S(!!e,"options not set"),t={};try{t=this._prepareInputs(e)}catch(e){ve.logWarn("Failed to prepare study inputs: "+e)}return e.asObject?(i={},Object.keys(t).forEach(function(e){null!=t[e]&&(i[e]=t[e])}),i):(i=[],Object.keys(t).forEach(function(e){null!=t[e]&&i.push(t[e])}),i)},y.prototype._prepareInputs=function(e){var t,i,n,r;for(S(!!e,"options not set"),t={},i=0;i=0?r:o),o):this._metaInfo.isTVScript||this._metaInfo.pine?"text"===s?this._metaInfo.defaults.inputs.text:"pineId"===s?this._metaInfo.scriptIdPart:"pineVersion"===s?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[s].value():this._properties.inputs[s].value()},y.prototype._rebindToSource=function(e,t){var i,n,o,r,s,a,l,c,h,u,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,n=null,e===this._model.mainSeries()){for(o=this._model.studiesMetaData(),s=0;s0)){if(r={},this._isChildStudy)for(s=0;s=0&&this._source&&(h=this._source.metaInfo(),u=this._source.title(e,null,!0),1===h.plots.length?r[c]=u:(d=c.split("$")[1],p=h.plots[d].id,_=h.styles&&h.styles[p]&&h.styles[p].title||p,r[c]=u+": "+_));break}f=this,o=o.map(function(e){var i=isNumber(e)?f._numericFormatter.format(e):r&&r[e]||e;return t[i]&&(i=t[i]),i}),n+=" ("+o.join(", ")+")"}return n},y.prototype.invalidateTitleCache=function(e){if(this._titleCache={},!0===e&&this._children)for(var t=0;t0)){if(r={},this._isChildStudy)for(s=0;s=0&&this._source&&(h=this._source.metaInfo(),u=this._source.title(e,null,!0),1===h.plots.length?r[c]=u:(d=c.split("$")[1],p=h.plots[d].id,_=h.styles&&h.styles[p]&&h.styles[p].title||p,r[c]=u+": "+_));break}f=this,o=o.map(function(e){var i=isNumber(e)?f._numericFormatter.format(e):r&&r[e]||e;return t[i]&&(i=t[i]),i}),n+=" ("+o.join(", ")+")"}return n},y.prototype.invalidateTitleCache=function(e){if(this._titleCache={},!0===e&&this._children)for(var t=0;t0&&(this._status=$.t(i))),this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(e.params[1]))return;n="chartSession:"+s._chartApi._sessionid,o=(new Date).getTime()-this._loadingStartTime,ve.logDebug(n+", Study "+this._metaInfo.description+" loading took "+o+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),r=this._model.paneForSource(this),this._model.recalculatePane(r),this._updateSources(),this._model.invalidate(new ee(ee.FULL_UPDATE));break;case"study_deleted":break;case"data_update":if(e.params.customId!==this.sourceId()||!this._checkTurnaround(e.params.turnaround))return;S(!!e.params.nonseries,"data.params.nonseries is missing"),this._onDataUpdate(e.params.plots,e.params.nonseries)}},y.prototype._onDataUpdate=function(e,t){this._studyModified&&(this.clearData(),this._studyModified=!1),w(t.d).then(function(i){"nochange"!==t.indexes&&this._processPlotOffsets(i),this.transformData(e),this._mergeData(e),null!==i&&(i.indexes_replace?(S("nochange"!==t.indexes),this._graphics.replaceIndexesTo(t.indexes)):("nochange"!==t.indexes&&this._graphics.replaceIndexesTo(t.indexes),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds,this._metaInfo.graphics))),this._onDataUpdated(e,i,t.indexes)}.bind(this))},y.prototype._onDataUpdated=function(e,t,i){this.hasBarColorer()&&e.length>0&&this._model.mainSeries().invalidateBarStylesCache(e[0].index),null!==t&&this._postProcessGraphics();var n=this._model.paneForSource(this);this._model.recalculatePane(n),this._updateSources()},y.prototype.transformData=function(e){},y.prototype.moveData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(e)},y.prototype.replaceData=function(e,t,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(e+1),this.m_data.addTail(i,t)},y.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},y.processPlotOffsets=function(e,t){t&&t.indexes_replace||(e._plotOffsets=t&&t.offsets||{})},y.prototype._processPlotOffsets=function(e){y.processPlotOffsets(this,e)},y.prototype._mergeData=function(e){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(e)},y.prototype._postProcessGraphics=function(){this._priceAxisViews=[].concat(this._priceAxisViewsBase,Q(this))},y.prototype._getNonPriceParent=function(){var e,t;if(this._nonPriceParent)return this._nonPriceParent;for(e=this.source();e instanceof y;){if(t=e.metaInfo(),!t.is_price_study||"Compare@tv-basicstudies"===t.id)return this._nonPriceParent=e,e;e=e.source()}},y.prototype.firstValue=function(e){var t,i,n,o,r,s;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?null===(t=this._model.timeScale().visibleBars())?null:(i=t.firstBar(),n=t.lastBar(),0===this.data().size()?null:(r=this,this.data().range(i,n).each(function(t,i){var n,s,a ;for(n=1;n=0){if(g=n.properties().styles[u].histogramBase.value(),!isNumber(g))continue;c=ue(c,{min:g,max:g})}a.push(m)}if(v=n.m_data.minMaxOnRangeCached(e,t,a),v=ue(c,v),s&&(a=[{name:"low",offset:0},{name:"high",offset:0}],S=n.series().data().bars().minMaxOnRangeCached(e,t,a),v=ue(v,S)),null!==v&&(i=new r(v.min,v.max)),o.bands)for(h=0;h").prop("width",c).prop("height",l),o=n.get(0).getContext("2d"),r=Math.min(c,t),s=Math.min(l,i),r&&s&&o.drawImage(e.get(0),0,0,r,s,0,0,r,s),e.prop("height",i).prop("width",t),a=e.get(0).getContext("2d"),r&&s&&a.drawImage(n.get(0),0,0,r,s,0,0,r,s),n.remove())},s.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,o){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.lineStyle===s.LINESTYLE_DASHED||e.lineStyle===s.LINESTYLE_DOTTED||e.lineStyle===s.LINESTYLE_SPARSE_DOTTED?e.drawDashedLine(e,t,i,n,o):s.drawSolidLine(e,t,i,n,o))},s.drawArrow=function(e,t,i,n,o){ isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(o)&&(e.beginPath(),e.moveTo(n,o),e.lineTo(t,i),e.moveTo(t+2,i+2),e.lineTo(t-2,i+2),e.moveTo(t-1,i+1),e.lineTo(t+1,i+1),e.stroke())},s.drawSolidLine=function(e,t,i,n,o){e.beginPath(),e.moveTo(t,i),e.lineTo(n,o),e.stroke()},s.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(e)),"function"==typeof e.setLineDash?e.setLineDash(i):void 0!==e.mozDash?e.mozDash=i:void 0!==e.webkitLineDash&&(e.webkitLineDash=i)},s.drawPoly=function(e,t,i){var n,o;for(e.beginPath(),e.moveTo(t[0].x,t[0].y),n=0;n0&&(this.lineStyle=s.lineStyles.pop(),s.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(e,t,i,n,o){e.save();var r=s.computeDashPattern(e);if(e.beginPath(),"function"==typeof e.setLineDash)e.setLineDash(r);else if(void 0!==e.mozDash)e.mozDash=r;else{if(void 0===e.webkitLineDash)return e.dashedLineTo(t,i,n,o,r),e.stroke(),void e.restore();e.webkitLineDash=r}e.moveTo(t,i),e.lineTo(n,o),e.stroke(),e.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(e,t,i,n,s){var a,l,c,h,u,d,p={thereYet:o,cap:Math.min},_={thereYet:o,cap:Math.min};for(t-n>0&&(_.thereYet=r,_.cap=Math.max),e-i>0&&(p.thereYet=r,p.cap=Math.max),this.moveTo(e,t),a=e,l=t,c=0,h=!0;!p.thereYet(a,i)||!_.thereYet(l,n);)u=Math.atan2(n-t,i-e),d=s[c],a=p.cap(i,a+Math.cos(u)*d),l=_.cap(n,l+Math.sin(u)*d),h?this.lineTo(a,l):this.moveTo(a,l),c=(c+1)%s.length,h=!h}),e.exports=s},,function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PriceRange",function(){return s}),n=i(12),i.n(n),o=i(4),r=Object(o.getLogger)("Chart.PriceRange"),s=function(){function e(e,t){var i,n;null!==e&&"object"==typeof e?(i=e, this._minValue=i.m_minValue,this._maxValue=i.m_maxValue):(n=e,this._minValue=n,void 0!==t&&(this._maxValue=t))}return e.prototype.equals=function(e){return this._minValue===e._minValue&&this._maxValue===e._maxValue},e.prototype.clone=function(){return new e(this._minValue,this._maxValue)},e.prototype.minValue=function(){return this._minValue},e.prototype.setMinValue=function(e){this._minValue=e},e.prototype.maxValue=function(){return this._maxValue},e.prototype.setMaxValue=function(e){this._maxValue=e},e.prototype.length=function(){return this._maxValue-this._minValue},e.prototype.isEmpty=function(){return this._maxValue===this._minValue||this._maxValue!==this._maxValue||this._minValue!==this._minValue},e.prototype.serialize=function(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}},e.prototype.state=function(){return{max:this._maxValue,min:this._minValue}},e.prototype.merge=function(t){return new e(Math.min(this.minValue(),t.minValue()),Math.max(this.maxValue(),t.maxValue()))},e.prototype.apply=function(e,t){this._minValue=Math.min(this._minValue,e),this._maxValue=Math.max(this._maxValue,t)},e.prototype.set=function(e,t){this._minValue=e,this._maxValue=t},e.prototype.scaleAroundCenter=function(e){var t,i,o,s;if(!Object(n.isNumber)(e))return void r.logDebug("PriceRange.scaleAroundCenter: invalid coeff");0!==(t=this._maxValue-this._minValue)&&(i=.5*(this._maxValue+this._minValue),o=this._maxValue-i,s=this._minValue-i,o*=e,s*=e,this._maxValue=i+o,this._minValue=i+s)},e.prototype.shift=function(e){if(!Object(n.isNumber)(e))return void r.logDebug("PriceRange.shift: invalid coeff");this._maxValue+=e,this._minValue+=e},e.prototype.containsStrictly=function(e){return e.minValue()>this._minValue&&e.maxValue()=0;i--)e.test(o[i])&&r.push(o[i]),e.lastIndex=0;return r}function b(e){for(var t=0;t=0;i--)e.test(o[i])&&r.push(o[i]),e.lastIndex=0;return r}function b(e){for(var t=0;t=t}function r(e,t,i){return Math.min(Math.max(e,t),i)}function s(e){return e<0?-1:e>0?1:0}function a(e){if(e<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function l(e,t,i){return t-e<=i}function c(e,t,i){return Math.abs(e-t)t?1:0}function d(e,t){var i,n;if(void 0===t&&(t=u),e.length<1)throw Error("array is empty");for(i=e[0],n=0;n0&&(i=e[n]);return i}var _,f;Object.defineProperty(t,"__esModule",{value:!0}),t.lessThan=n,t.greaterThan=o,t.clamp=r,t.sign=s,t.isBaseDecimal=a,t.greaterOrEqual=l,t.equal=c,t.log10=h,t.defComparator=u,t.min=d,t.max=p,_=i(4),f=Object(_.getLogger)("Common.MathEx")},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},,,,,,,function(e,t,i){"use strict";var n,o=i(24),r=i(1),s=i(29),a=i(38),l=function(){function e(e){this.setData(e)}return e.prototype.setData=function(e){this._data=r.a({},e)},e.prototype.draw=function(e,t){var i,n,o,r,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P;this._data.visible&&(i=t.fontSize,e.font=t.font,n=t.tickLength,o=t.borderSize,r=t.paddingTop,l=t.paddingBottom,c=t.paddingInner,h=t.paddingOuter,u=Math.ceil(t.widthCache.measureText(e,this._data.text)),d=t.baselineOffset,p=t.fontSize+r+l,_=o+u+c+h+n,f=this._data.coordinate,this._data.fixedCoordinate&&(f=this._data.fixedCoordinate),m=f-Math.floor(i/2)-r-.5,y=m+p,g=t.isLeft?t.width-o-.5:.5,v=g,e.fillStyle=Object(s.resetTransparency)(this._data.background),e.lineWidth=1,this._data.text&&(t.isLeft?(v=g-_,S=g-n,b=v+h):(v=g+_,S=g+n,b=g+o+n+c),e.beginPath(),e.moveTo(g,m),e.lineTo(v,m),e.lineTo(v,y),e.lineTo(g,y),e.fill(),e.beginPath(),e.strokeStyle=this._data.color,e.moveTo(g,f),e.lineTo(S,f),e.stroke(),e.textAlign="left",e.fillStyle=this._data.color,e.fillText(Object(a.startWithLTR)(this._data.text),b,y-l-d)),this._data.secondLine&&(w=Math.ceil(t.widthCache.measureText(e,this._data.secondLine)),P=w+c+h,e.fillStyle=Object(s.resetTransparency)(this._data.background),this._data.text&&(m+=p+1,y+=p+1),t.isLeft?(v=Math.min(v,t.width-n),g=v+P,b=v+h):(g=Math.max(v-P,o),v=g+P,b=g+c),e.beginPath(),e.moveTo(g,m),e.lineTo(v,m),e.lineTo(v,y),e.lineTo(g,y),e.fill(),e.textAlign="left",e.fillStyle=this._data.color,e.fillText(Object(a.startWithLTR)(this._data.secondLine),b,y-l-d)))},e.prototype.height=function(e,t){var i=e.fontSize+e.paddingTop+e.paddingBottom;return this._data.secondLine&&t?2*i+1:i},e}();i.d(t,"a",function(){return n}),n=function(){function e(){this._rendererData={text:"",coordinate:0, fixedCoordinate:0,color:"#FFF",background:"#000",visible:!1},this._renderer=new l(this._rendererData),this._invalidated=!0}return e.prototype.text=function(){return this._rendererData.text},e.prototype.background=function(){return this._rendererData.background},e.prototype.color=function(){return this.generateTextColor(this.background())},e.prototype.generateTextColor=function(e){return"black"===Object(o.rgbToBlackWhiteString)(Object(o.parseRgb)(e),160)?"white":"black"},e.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.coordinate},e.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.floatCoordinate||this._rendererData.coordinate},e.prototype.update=function(){this._invalidated=!0},e.prototype.height=function(e,t){return void 0===t&&(t=!1),this._renderer.height(e,t)},e.prototype.getFixedCoordinate=function(){return this._rendererData.fixedCoordinate||0},e.prototype.setFixedCoordinate=function(e){this._rendererData.fixedCoordinate=e},e.prototype.isVisible=function(){return this._rendererData.visible},e.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._renderer.setData(this._rendererData),this._renderer},e.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._rendererData),this._invalidated=!1)},e}()},,function(e,t,i){"use strict";function n(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive}function o(e,t,i,n){var o=t.add(i).scaled(.5),r=o.add(n).scaled(.5),s=l.intersectLineSegments(t,i,r,e);return null===s&&(null===(s=l.intersectLineSegments(i,n,r,e))&&null===(s=l.intersectLineSegments(n,t,r,e)))}function r(e,t,i){return e.x>=t.x&&e.x<=i.x&&e.y>=t.y&&e.y<=i.y}function s(e,t){var i,n,o,r=t.length-1,s=!1,a=e.x,l=e.y;for(i=0;i=l||o.y=l)&&n.x+(l-n.y)/(o.y-n.y)*(o.x-n.x)0?t[0]:"100R")}function a(e){var t,i=I.getValue("chart.lastUsedTimeBasedResolution");return void 0!==i&&C.Interval.isTimeBased(i)?i:(t=e.filter(function(e){return C.Interval.isTimeBased(e)}),t.includes("1D")?"1D":t.length>0?t[0]:"1D")} function l(e){return e?"100R":"1D"}function c(e,t,i){var n=L.isRangeStyle(e),o=C.Interval.isRange(t);return!n&&o?a(i):n&&!o?s(i):t}function h(e){return C.Interval.isRange(e)?"1":e}function u(e){var t=C.Interval.parse(e),i=d(t.kind()),n=t.multiplier();return void 0!==n&&n<=i}function d(e){var t=D[e];return Number.isNaN(t)?1:t}function p(e){return d(C.Interval.kind(e))}function _(e){var t=f(I.getJSON(e,[]));return E()(t.filter(u).map(n))}function f(e){return Array.isArray(e)?e:Object.keys(e)}function m(){var e,t,i,o=[];for(e=0;e=60&&!(e%60)}var x,C,L,I,A,k,E,M,V,D,O;Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeIntervalString=n,t.isAvailable=o,t.setLastUsedResolution=r,t.getRangeResolution=s,t.getTimeBasedResolution=a,t.getDefaultResolution=l,t.getResolutionByChartStyle=c,t.getServerInterval=h,t.isResolutionMultiplierValid=u,t.getMaxResolutionValue=p,t.getResolutionsFromSettings=_,t.convertResolutionsFromSettings=f,t.mergeResolutions=m,t.sortResolutions=y,t.getCustomResolutions=S,t.getTranslatedResolution=b,t.getTranslatedResolutionModel=w,t.isHour=T,x=i(248),i.n(x),i(11),C=i(15),L=i(42),I=i(49),i.n(I),A=i(62), k=i(204),E=i.n(k),M={},M[C.ResolutionKind.Seconds]=60,M[C.ResolutionKind.Minutes]=1440,M[C.ResolutionKind.Hours]=24,M[C.ResolutionKind.Days]=365,M[C.ResolutionKind.Weeks]=52,M[C.ResolutionKind.Months]=12,M[C.ResolutionKind.Range]=1e3,M[C.ResolutionKind.Invalid]=NaN,D=M,V={},V[C.ResolutionKind.Seconds]=1,V[C.ResolutionKind.Minutes]=2,V[C.ResolutionKind.Hours]=3,V[C.ResolutionKind.Days]=4,V[C.ResolutionKind.Weeks]=5,V[C.ResolutionKind.Months]=6,V[C.ResolutionKind.Range]=7,V[C.ResolutionKind.Invalid]=8,O=V},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"Linking",function(){return a}),i.d(t,"linking",function(){return l}),n=i(16),o=i.n(n),r=i(5),i.n(r),function(e){e[e.NotBound=0]="NotBound",e[e.BoundToWidget=1]="BoundToWidget",e[e.BoundToModel=2]="BoundToModel"}(s||(s={})),a=function(){function e(){this._watchedSymbol=new o.a,this._seriesShortSymbol=new o.a,this._proSymbol=new o.a,this._watchedInterval=new o.a,this._watchedIntraday=new o.a,this._watchedSupportedResolutions=new o.a,this._symbolNamesList=new o.a,this._chartWidgetBindingState=s.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1,this._preventFeedBySymbol=!1}return Object.defineProperty(e.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"preventFeedBySymbol",{get:function(){return this._preventFeedBySymbol},enumerable:!0,configurable:!0}),e.prototype.bindToChartWidget=function(e){var t,i;if(this.unbindFromChartWidget(),this._activeChartWidget=e,t=e.model())return void this._onChartModelCreated(t);e.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=s.BoundToWidget,i=e.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},e.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){case s.BoundToWidget:if(!this._activeChartWidget)throw Error("ChartWidget is undefined") ;this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case s.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().dataEvents().symbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().dataEvents().symbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=s.NotBound},e.prototype.getChartWidget=function(){return this._activeChartWidget},e.prototype.bindToChartWidgetCollection=function(e){var t=this;this._chartWidgetCollection=e,this.unbindFromChartWidget(),e.activeChartWidget.subscribe(function(e){t.unbindFromChartWidget(),t.bindToChartWidget(e)},{callWithLast:!0})},e.prototype.bindToSearchCharts=function(e){this.unbindFromSearchCharts(),this._searchCharts=e,e.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),this._watchedSymbol.subscribe(this._onSymbolLinkBound)},e.prototype.unbindFromSearchCharts=function(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)},e.prototype.setPreventFeedBySymbol=function(e){this._preventFeedBySymbol=e},e.prototype._onSearchBySymbol=function(e){if(!e.resolved_symbol)throw Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(e.resolved_symbol),this._selfEmit=!1},e.prototype._onSymbolLink=function(e){if(!this._selfEmit){if(!this._searchCharts)throw Error("No search charts defined");this._preventFeedBySymbol||this._searchCharts.feedBySymbol(e)}},e.prototype._mainSeries=function(){if(!this._activeChartWidget)throw Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()},e.prototype._properties=function(){return this._mainSeries().properties()},e.prototype._symbolProperty=function(){return this._properties().symbol},e.prototype._intervalProperty=function(){return this._properties().interval},e.prototype._watchedSymbolListener=function(e){(r.enabled("same_data_requery")||this._symbolProperty().value()!==e)&&this._chartWidgetCollection.setSymbol(e)},e.prototype._onSymbolPropertyChange=function(){this._watchedSymbol.setValue(this._symbolProperty().value())},e.prototype._onSymbolResolved=function(e){var t=this._mainSeries().symbolInfo();t&&this._applyValuesFromSymbolInfo(t)},e.prototype._applyValuesFromSymbolInfo=function(e){var t=e.pro_name||r.enabled("trading_terminal")&&(e.full_name||e.name)||"";this._proSymbol.setValue(t),e.aliases&&this._symbolNamesList.setValue(e.aliases)},e.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var e=this._mainSeries().symbolInfo();e?(this._applyValuesFromSymbolInfo(e), e.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(e.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!e.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},e.prototype._watchedIntervalListener=function(e){(r.enabled("same_data_requery")||this._intervalProperty().value()!==e)&&this._chartWidgetCollection.setResolution(e)},e.prototype._onIntervalPropertyChange=function(){this._watchedInterval.setValue(this._intervalProperty().value())},e.prototype._onChartModelCreated=function(e){var t,i,n;if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._chartWidgetBindingState=s.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated),t=this._symbolProperty(),t.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(t.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound),i=this._mainSeries(),i.dataEvents().symbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(e){return i.symbolSameAsCurrent(e)&&(e=i.symbol()),e},i.dataEvents().symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolError().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().symbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.dataEvents().extendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),n=this._intervalProperty(),n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},e}(),window.TradingView=window.TradingView||{},l=new a,window.TradingView.Linking=l},function(e,t,i){"use strict";(function(e,n,o,r){function s(){return{count:TradingView.DEFAULT_BAR_COUNT}}function a(t,o,r){var l,_=i(120);L.call(this,t),this._dataEvents=new oe,this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this.chartWidgetInitialized=new e,this._onStyleChanged=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this._priceScaleChanged=new e,this._onInReplayStateChanged=new e,this._requestOptions=r||s(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new A,this.setProperties(o),this._prevChartStyle=o.style.value(),this.createPaneView(),this._dataWindowView=new d(this,t),this._legendView=new p(this,t),this._statusView=new c(this,t.properties()),this._priceAxisViews=[new u(this,{model:t}),new h(this,{model:t})],this._symbolInfo=null,this._status=a.STATUS_OFFLINE,this._syncModel=null,this._replaySubscriber=null,l=this,this._turnaroundCounter=1, -this._turnaround="s"+this._turnaroundCounter,this._handler=function(e){l.onData(e)},this._haStyle={studyId:Z.chartStyleStudyId(a.STYLE_HEIKEN_ASHI,!0)},this._renkoStyle={studyId:Z.chartStyleStudyId(a.STYLE_RENKO,!0)},this._pbStyle={studyId:Z.chartStyleStudyId(a.STYLE_PB,!0)},this._kagiStyle={studyId:Z.chartStyleStudyId(a.STYLE_KAGI,!0)},this._pnfStyle={studyId:Z.chartStyleStudyId(a.STYLE_PNF,!0)},this._rangeStyle={studyId:Z.chartStyleStudyId(a.STYLE_RANGE,!0)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new D(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new n,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,a.prototype._recreateFormatter),l=this,this.properties().minTick.listeners().subscribe(null,function(){l.m_model.invalidate(new M(M.FULL_UPDATE))}),this._priceLineView=new ne(this),this._baseHorizontalLineView=new ie(this),this._gotoDateResultCleared=!1,this._gotoDateView=null,this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsPrevClosePriceAvailableProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(e){this._extendedHoursChanged.fire(e),this.restart()}),this._dataEvents.extendedHoursNotPermitted().subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==a.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,a.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null,this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var 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,j,z,U,q,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,l=i(7).ensureNotNull,c=i(604),h=i(606).ProjectionSeriesPriceAxisView,u=i(279).SeriesPriceAxisView,d=i(280).SeriesDataWindowView,p=i(607).SeriesLegendView,_=i(282),f=_.SeriesAreaPaneView,m=_.SeriesLinePaneView,y=_.SeriesHollowCandlesPaneView,g=_.SeriesCandlesPaneView,v=_.SeriesBarsPaneView,S=_.SeriesHeikenAshiPaneView,b=_.SeriesBaselinePaneView,w=i(283).SeriesWaterlinePaneView,P=i(5),T=i(2).propertyPages,x=i(214).BarsRange,C=i(166).SeriesBarColorer,L=i(28).PriceDataSource,I=i(100),A=i(72).SeriesData,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(18),V=i(609),D=i(21).PriceFormatter,O=i(17),R=O.PlotList, -B=O.PlotRowSearchMode,N=O.mergeMinMax,F=i(26),W=i(259).unpackNonSeriesData,H=i(610).SyncModel,j=i(39).trackEvent,z=i(123).translatedIntervalString,U=i(33),q=i(4),Y=q.getLogger("Chart.Series"),G=q.getLogger("Chart.Series.Updates",{highRate:!0}),K=i(40),Z=i(42),J=i(61),X=J.getServerInterval,Q=J.getResolutionByChartStyle,ee=i(15).Interval,te=i(135),ie=i(611).SeriesHorizontalBaseLinePaneView,ne=i(612).SeriesPriceLinePaneView,oe=i(613).SeriesDataEvents,re=te.getQuoteSessionInstance,se=!P.enabled("hide_series_legend_item"),inherit(a,L),a.prototype.styleStudyInfos=function(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle}},a.prototype.styleStudyInfo=function(e){return this.styleStudyInfos()[e]},a.prototype.priceLineColor=function(e){return this.properties().priceLineColor.value()||e},a.prototype.endOfData=function(){return this._endOfData},a.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},a.prototype._onChangeShowCountdown=function(e){var t=this;e.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){t.isDWM()||(t._priceAxisViews[0].update(),t.m_model.invalidate(new M(M.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},a.prototype.lastValueData=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return p;if(null===(n=this.m_model.timeScale().visibleBars()))return p;if(t){if(null===(s=this.data().bars().last()))return p;o=s.value,r=s.index}else{if(null===(a=this.data().bars().search(n.lastBar(),B.NearestLeft)))return p;o=this.data().bars().valueAt(a.index),r=a.index}return l={noData:!1},c=void 0!==e?o[e]:this._barFunction(o),i&&(l.price=c),h=this.firstValue(),l.text=this.priceScale().formatPrice(c,h),u=this.barColorer(),d=u.barStyle(r,!1),l.color=d.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(c,h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=r,l},a.prototype.prevClose=function(){var e,t;return this.priceScale().isEmpty()||this.data().isEmpty()||!this.quoteData?null:null==(e=this.quoteData.prev_close_price)?null:(t=this.firstValue(),{coordinate:this.priceScale().priceToCoordinate(e,t),floatCoordinate:this.priceScale().priceToCoordinate(e,t,!0),text:this.priceScale().formatPrice(e,t)})},a.prototype._createIsPrevClosePriceAvailableProperty=function(){this._isPrevClosePriceAvailable=new o(!this.isDWM()),this._onRestarted.subscribe(this,function(){this._isPrevClosePriceAvailable.setValue(!this.isDWM())})},a.prototype.isPrevClosePriceAvailable=function(){return this._isPrevClosePriceAvailable},a.prototype._prepareChartApiParams=function(){ +this._turnaround="s"+this._turnaroundCounter,this._handler=function(e){l.onData(e)},this._haStyle={studyId:Z.chartStyleStudyId(a.STYLE_HEIKEN_ASHI,!0)},this._renkoStyle={studyId:Z.chartStyleStudyId(a.STYLE_RENKO,!0)},this._pbStyle={studyId:Z.chartStyleStudyId(a.STYLE_PB,!0)},this._kagiStyle={studyId:Z.chartStyleStudyId(a.STYLE_KAGI,!0)},this._pnfStyle={studyId:Z.chartStyleStudyId(a.STYLE_PNF,!0)},this._rangeStyle={studyId:Z.chartStyleStudyId(a.STYLE_RANGE,!0)},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new D(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new n,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,a.prototype._recreateFormatter),l=this,this.properties().minTick.listeners().subscribe(null,function(){l.m_model.invalidate(new M(M.FULL_UPDATE))}),this._priceLineView=new ne(this),this._baseHorizontalLineView=new ie(this),this._gotoDateResultCleared=!1,this._gotoDateView=null,this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsPrevClosePriceAvailableProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(e){this._extendedHoursChanged.fire(e),this.restart()}),this._dataEvents.extendedHoursNotPermitted().subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==a.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,a.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null,this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var 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,F,N,W,H,j,z,U,q,Y,G,K,Z,J,X,Q,ee,te,ie,ne,oe,re,se;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,l=i(7).ensureNotNull,c=i(604),h=i(606).ProjectionSeriesPriceAxisView,u=i(279).SeriesPriceAxisView,d=i(280).SeriesDataWindowView,p=i(607).SeriesLegendView,_=i(282),f=_.SeriesAreaPaneView,m=_.SeriesLinePaneView,y=_.SeriesHollowCandlesPaneView,g=_.SeriesCandlesPaneView,v=_.SeriesBarsPaneView,S=_.SeriesHeikenAshiPaneView,b=_.SeriesBaselinePaneView,w=i(283).SeriesWaterlinePaneView,P=i(5),T=i(2).propertyPages,x=i(214).BarsRange,C=i(166).SeriesBarColorer,L=i(28).PriceDataSource,I=i(100),A=i(72).SeriesData,k=i(72).barFunction,E=i(72).seriesPlotFunctionMap,M=i(18),V=i(609),D=i(21).PriceFormatter,O=i(17),R=O.PlotList, +B=O.PlotRowSearchMode,F=O.mergeMinMax,N=i(26),W=i(259).unpackNonSeriesData,H=i(610).SyncModel,j=i(39).trackEvent,z=i(123).translatedIntervalString,U=i(33),q=i(4),Y=q.getLogger("Chart.Series"),G=q.getLogger("Chart.Series.Updates",{highRate:!0}),K=i(40),Z=i(42),J=i(61),X=J.getServerInterval,Q=J.getResolutionByChartStyle,ee=i(15).Interval,te=i(135),ie=i(611).SeriesHorizontalBaseLinePaneView,ne=i(612).SeriesPriceLinePaneView,oe=i(613).SeriesDataEvents,re=te.getQuoteSessionInstance,se=!P.enabled("hide_series_legend_item"),inherit(a,L),a.prototype.styleStudyInfos=function(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle}},a.prototype.styleStudyInfo=function(e){return this.styleStudyInfos()[e]},a.prototype.priceLineColor=function(e){return this.properties().priceLineColor.value()||e},a.prototype.endOfData=function(){return this._endOfData},a.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},a.prototype._onChangeShowCountdown=function(e){var t=this;e.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){t.isDWM()||(t._priceAxisViews[0].update(),t.m_model.invalidate(new M(M.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},a.prototype.lastValueData=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return p;if(null===(n=this.m_model.timeScale().visibleBars()))return p;if(t){if(null===(s=this.data().bars().last()))return p;o=s.value,r=s.index}else{if(null===(a=this.data().bars().search(n.lastBar(),B.NearestLeft)))return p;o=this.data().bars().valueAt(a.index),r=a.index}return l={noData:!1},c=void 0!==e?o[e]:this._barFunction(o),i&&(l.price=c),h=this.firstValue(),l.text=this.priceScale().formatPrice(c,h),u=this.barColorer(),d=u.barStyle(r,!1),l.color=d.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(c,h,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=r,l},a.prototype.prevClose=function(){var e,t;return this.priceScale().isEmpty()||this.data().isEmpty()||!this.quoteData?null:null==(e=this.quoteData.prev_close_price)?null:(t=this.firstValue(),{coordinate:this.priceScale().priceToCoordinate(e,t),floatCoordinate:this.priceScale().priceToCoordinate(e,t,!0),text:this.priceScale().formatPrice(e,t)})},a.prototype._createIsPrevClosePriceAvailableProperty=function(){this._isPrevClosePriceAvailable=new o(!this.isDWM()),this._onRestarted.subscribe(this,function(){this._isPrevClosePriceAvailable.setValue(!this.isDWM())})},a.prototype.isPrevClosePriceAvailable=function(){return this._isPrevClosePriceAvailable},a.prototype._prepareChartApiParams=function(){ return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},a.prototype._nextSymbolId=1,a.prototype._nextSeriesId=1,Object.assign(a,K),a.PERMISSION_DENIED="permission denied",a.PD_REASON_SYMBOL="symbol",a.PD_REASON_EXTENDED_HOURS="extended_hours",a.PD_REASON_GROUP_PERMISSION="group",a.STUDY_NOT_AUTH="study_not_auth",a.prototype.model=function(){return this.m_model},a.prototype.fixLastBar=function(e){},a.prototype.clearData=function(){this.data().clear()},a.prototype.data=function(){return this.m_data},a.prototype.symbolId=function(){return this._symbolId},a.prototype.seriesId=function(){return this._seriesId},a.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},a.prototype.onTagsChanged=function(){return this._tagsChanged},a.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},a.prototype.onIntervalChanged=function(){return this._intervalChanged},a.prototype.onStatusChanged=function(){return this._onStatusChanged},a.prototype.onStyleChanged=function(){return this._onStyleChanged},a.prototype.onRestarted=function(){return this._onRestarted},a.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},a.prototype.status=function(){return this._status},a.prototype.isDWM=function(){var e,t;return null!==this._isDWMCached?this._isDWMCached:(e=new ee(this._properties.interval.value()),e.isDWM()?this._isDWMCached=!0:(t=e.isSeconds()?e.multiplier():60*e.multiplier(),this._isDWMCached=!(t<216e3)),this._isDWMCached)},a.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},a.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._symbolLabelView=new I(this.m_model,this,void 0,"firstShortName","showSymbolLabels");var e=this._properties.style.value();switch(e){case a.STYLE_BARS:this._paneView=new v(this,this.m_model);break;case a.STYLE_CANDLES:this._paneView=new g(this,this.m_model);break;case a.STYLE_LINE:this._paneView=new m(this,this.m_model);break;case a.STYLE_AREA:this._paneView=new f(this,this.m_model);break;case a.STYLE_HEIKEN_ASHI:this._paneView=new S(this,this.m_model);break;case a.STYLE_HOLLOW_CANDLES:this._paneView=new y(this,this.m_model);break;case a.STYLE_BASELINE:this._paneView=new b(this,this.m_model),this._waterlineView=new w(this);break;default:throw Error("Unknown chart style assigned: "+e)}},a.prototype._clearStylePlot=function(e,t){var i,n;0!==e.size()&&(i=t||l(e.firstIndex()),n=l(e.lastIndex())+1,e.range(i,n).each(function(e,t){t[TradingView.STYLE_PLOT]=null}))},a.prototype.invalidateBarStylesCache=function(e){ Y.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.m_data.m_bars,e),this._clearStylePlot(this.m_data.m_nsBars)},a.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},a.prototype.barColorer=function(){var e,t,i,n;if(this._barColorerCache)return this._barColorerCache;for(e=null,t=this.m_model.dataSources().length-1;t>=0;t--)i=this.m_model.dataSources()[t],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(n=i.barColorer(),null===e?e=n:e.pushBackBarColorer(n));return null===e?e=new C(this):e.pushBackBarColorer(new C(this)),this._barColorerCache=e,this._barColorerCache},a.prototype.properties=function(){return this._properties},a.prototype._barsState=function(e){var t=e.state();return t.data.forEach(function(e){e.value.splice(7,1)}),t},a.prototype.state=function(e,t){var i=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),n={type:i,id:this.id(),state:this.properties().state(t),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(n.state.symbol=this._symbolInfo.ticker),e&&(n.bars=this._barsState(this.m_data.m_bars),n.nsBars=this._barsState(this.m_data.m_nsBars),n.symbolInfo=this._symbolInfo,n.rtPrice=this.data().lastProjectionPrice),n.boxSize=this.data().boxSize,n.reversalAmount=this.data().reversalAmount,n},a.prototype.restoreData=function(e,t,i,n,o,r){this._status=a.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(e),this.m_data.m_nsBars.restoreState(t),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=n,this.m_data.boxSize=o,o||(this.properties().style.value()===a.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===a.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=r,r||this.properties().style.value()===a.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},a.prototype.setProperties=function(e){e.timeframe||e.merge({timeframe:""}),e.shortName||e.merge({shortName:""}),this._properties=e,this._properties.symbol.listeners().subscribe(this,a.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,a.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,a.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,a.prototype.changeProperties)},a.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},a.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},a.prototype.changeTimeFrame=function(){j("GUI","Change timeframe")},a.prototype.title=function(){return this.properties().symbol.value()+", "+z(this.properties().interval.value())}, a.prototype.changeProperties=function(e){e!==this._properties.symbol&&e!==this._properties.interval&&e!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},a.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},a.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},a.prototype.onData=function(e){var t,i,n,o,r,s,c,h,u,d,p,_,f,m,y,g,v=this;switch(e.method){case"symbol_resolved":if(e.params[0]!==this._symbolId){Y.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+e.params[0]);break}this.updateSymbolInfo(e.params[1]),this.m_model.updateSource(this),this._dataEvents.fireSymbolResolved(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||j("Symbol",e.params[1].listed_exchange,e.params[1].name),t=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===a.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0);this._canvas.get(0).getContext("2d").font="12px Verdana"}return this._canvas},n.ROW_HEIGHT=14,n.prototype.points=function(e){ return[e.points()[0],e.points()[1]]},n.prototype.startPoint=function(e,t){return t?e.points()[0]:e.points()[1]},n.prototype.priceRange=function(e,t){var i=this.points(e),n=i[0],o=i[1];return t?o.price-n.price:n.price-o.price},n.prototype.sourceIsReady=function(e){return e.points().length>=2},n.prototype._calculateWidth=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P;if(!this.sourceIsReady(e))return null;if(t=this.canvas().get(0).getContext("2d"),t.font="12px Verdana",i=!!e.properties().showPrices&&e.properties().showPrices.value(),n=!!e.properties().coeffsAsPercents&&e.properties().coeffsAsPercents.value(),o=e.properties().showCoeffs.value(),r=e.priceScale(),s=this.points(e),a=s[0],l=s[1],!a||!l)return null;if(c=!1,h=e.properties(),h.reverse&&h.reverse.value()&&(c=h.reverse.value()),u=this.priceRange(e,c),d=this.startPoint(e,c).price,null===(p=e.ownerSource().firstValue()))return 0;for(_=0,f=[],m=1;m<=this.levelsCount();m++)y="level"+m,g=h[y],v=g.coeff.value(),S=d+v*u,b="",o&&(b+=n?this._percentageFormatter.format(Math.round(1e4*v)/100):this._numericFormatter.format(v)),i&&(b+="("+r.formatPrice(S,p)+")"),w=t.measureText(b).width,P={text:b,left:_,width:w+4},f.push(P),_+=P.width;return{totalWidth:_,cells:f}},n.prototype._effectiveState=function(e){var t,i,n,o,r,s,a={},l=e.properties();for(l.showPrices&&(a.showPrices=l.showPrices.value()),l.coeffsAsPercents&&(a.coeffsAsPercents=l.coeffsAsPercents.value()),a.showCoeffs=l.showCoeffs.value(),e.priceScale()&&e.priceScale().formatter().state&&(a.formatter=e.priceScale().formatter().state()),l.reverse&&(a.reverse=l.reverse.value()),a.p1=e.points()[0],a.p2=e.points()[1],3===e.points().length&&(a.p3=e.points()[2]),a.items=[],t=1;t<=this.levelsCount();t++)i="level"+t,n=l[i],o=n.coeff.value(),r=n.color.value(),s={coeff:o,color:r},a.items.push(s);return a},n.prototype._findEmptyRow=function(e){for(var t,i=0;this._rowsToSources[i];)i++;return this._rowsToSources[i]=e,i>=this._actualCapacity&&(this._actualCapacity++,t=this.canvas(),TradingView.resizeCanvas(t,this._actualWidth,n.ROW_HEIGHT*this._actualCapacity)),i},n.prototype._repaintSource=function(e,t,i){var o,r,s=n.ROW_HEIGHT*i.row,a=this.canvas().get(0).getContext("2d");for(a.clearRect(0,s,this._actualWidth,n.ROW_HEIGHT),a.textBaseline="bottom",a.font="12px Verdana",s+=n.ROW_HEIGHT,o=0;othis._actualWidth&&(TradingView.resizeCanvas(this.canvas(),r.totalWidth,n.ROW_HEIGHT*this._actualCapacity),this._actualWidth=r.totalWidth),t=this._sourcesToRow[e.id()],this._repaintSource(r,o,t),this._sourcesToRow[e.id()].effectiveState=o,this._sourcesToRow[e.id()].preparedCells=r):this._sourcesToRow[e.id()].effectiveState=null),this._sourcesToRow[e.id()]},e.exports=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"CompositeRenderer",function(){return n});var n=function(){function e(){this._renderers=[],this._globalAlpha=1}return e.prototype.setGlobalAlpha=function(e){this._globalAlpha=e},e.prototype.append=function(e){this._renderers.push(e)},e.prototype.insert=function(e,t){this._renderers.splice(t,0,e)},e.prototype.draw=function(e){for(var t=0;t=0;t--)null!==(i=this._renderers[t].hitTest(e))&&(null===n||i.result()>n.result())&&(n=i);return n},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PercentageFormatter",function(){return r}),n=i(1),o=i(21),r=function(e){function t(t){void 0===t&&(t=100);var i=e.call(this,t)||this;return i.type="percentage",i}return n.c(t,e),t.prototype.state=function(){var e=o.PriceFormatter.prototype.state.call(this);return e.percent=!0,e},t.prototype.format=function(t,i,n,o){return e.prototype.format.call(this,t,i,n,o)+"%"},t.serialize=function(e){return e.state()},t.deserialize=function(e){return new t(e.priceScale)},t}(o.PriceFormatter)},function(e,t,i){"use strict";(function(t){function i(){return/on-features-page=1/i.test(window.location.search)}var n=window.TradingView=window.TradingView||{};n.className=function(e){for(var t in this)if(n[t]===e)return t;return null}, @@ -102,9 +102,9 @@ void 0===t&&(t=(new Date).valueOf()),t!==TVLocalStorage.getItem(r+e)&&TVLocalSto c&&!Modernizr.touch||(this._processEvent(e,this._handler.mouseMoveEvent),this._preventDefaultIfNeeded(e))},e.prototype._mouseMoveWithDownHandler=function(e){var t,i,n,o,r,s,c;void 0===e.button&&(e.button=0),t=!1,this._fixMouseTouchEvent(e,e.originalEvent),i=Modernizr.touch||e.originalEvent.touches,i&&(this._verticalTouchScroll&&(n=Math.abs(.5*(e.pageX-this._lastTouchPosition.x)),o=Math.abs(e.pageY-this._lastTouchPosition.y),n<=o?(t=!0,this._preventDefault=!1):this._preventDefault=this._originalPreventDefault),this._lastTouchPosition.x=e.pageX,this._lastTouchPosition.y=e.pageY),r=Object(a.ensure)(this._mouseMoveStartPosition),s=Math.abs(r.x-e.pageX),c=Math.abs(r.y-e.pageY),this._moveExceededManhattanDistance=this._moveExceededManhattanDistance||s+c>5,this._moveExceededManhattanDistance?(this._cancelClick=!0,i&&this._clearContextMenuTimeout()):i&&(t=!0),e.button===l||t||this._processEvent(e,this._handler.pressedMouseMoveEvent),this._preventDefaultIfNeeded(e)},e.prototype._mouseUpHandler=function(e){void 0===e.button&&(e.button=0),this._fixMouseTouchEvent(e,e.originalEvent),Modernizr.touch&&this._clearContextMenuTimeout(),this._mouseMoveStartPosition=null,c=!1;var t=e.target.ownerDocument.documentElement;$(t).off("mousemove.chartgui"),$(t).off("mouseup.chartgui"),Modernizr.touch||e.originalEvent.touches?($(t).off("touchmove.chartgui"),$(t).off("touchend.chartgui"),this._mouseLeaveHandler(e)):($(t).off("mousemove.chartgui touchmove.chartgui"),$(t).off("mouseup.chartgui touchend.chartgui")),e.button!==l&&(this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent)),this._preventDefaultIfNeeded(e),Modernizr.touch&&this._mouseLeaveHandler(e)},e.prototype._clearContextMenuTimeout=function(){null!==this._touchContextMenuTimeout&&(clearTimeout(this._touchContextMenuTimeout),this._touchContextMenuTimeout=null)},e.prototype._mouseDownHandler=function(e){void 0===e.button&&(e.button=0),this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._fixMouseTouchEvent(e,e.originalEvent),Modernizr.touch&&(this._lastTouchPosition.x=e.pageX,this._lastTouchPosition.y=e.pageY,this._mouseEnterHandler(e)),this._mouseMoveStartPosition={x:e.pageX,y:e.pageY};var t=e.target.ownerDocument.documentElement;if(Modernizr.touch?($(t).off("touchmove.chartgui"),$(t).off("touchend.chartgui"),$(t).on("touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(t).on("touchend.chartgui",this._mouseUpHandler.bind(this)),this._clearContextMenuTimeout(),this._touchContextMenuTimeout=setTimeout(this._contextMenuHandler.bind(this,e),500)):($(t).off("mousemove.chartgui touchmove.chartgui"),$(t).off("mouseup.chartgui touchend.chartgui"),$(t).on("mousemove.chartgui touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(t).on("mouseup.chartgui touchend.chartgui",this._mouseUpHandler.bind(this))),c=!0, e.button!==l&&(this._processEvent(e,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))),this._preventDefaultIfNeeded(e),this._preventDefault)try{window.focus()}catch(e){}},e.prototype._init=function(){var e=this;this._$target.mouseenter(this._mouseEnterHandler.bind(this)),this._$target.on("touchcancel",this._clearContextMenuTimeout.bind(this)),this._$target.on("touchstartoutside mousedownoutside",function(t){e._handler.mouseDownOutsideEvent&&e._handler.mouseDownOutsideEvent(t,e._$target)}),this._$target.mouseleave(this._mouseLeaveHandler.bind(this)),this._$target.contextMenu&&this._$target.contextMenu(this._contextMenuHandler.bind(this)),Modernizr.touch?(this._$target.on("touchstart.chartgui",this._mouseDownHandler.bind(this)),this._initGestureEvents()):this._$target.on("mousedown.chartgui touchstart.chartgui",this._mouseDownHandler.bind(this))},e.prototype._mouseLeaveHandler=function(e){this._$target.off("mousemove.chartgui touchmove.chartgui"),this._processEvent(e,this._handler.mouseLeaveEvent),this._preventDefaultIfNeeded(e)},e.prototype._contextMenuHandler=function(e){this._processEvent(e,this._handler.contextMenuEvent),this._preventDefaultIfNeeded(e),this._cancelClick=!0},e.prototype._processEvent=function(e,t){t&&(n(this._$target,e),t.call(this._handler,e,this._$target))},e.prototype._preventDefaultIfNeeded=function(e){this._preventDefault&&e.preventDefault()},e.prototype._initGestureEvents=function(){var e,t=this;[this._handler.gestureStartEvent,this._handler.gestureChangeEvent,this._handler.gestureEndEvent].some(Boolean)&&(e=new s.a,e.load().then(function(e){t._isDestroyed||(t._hammerManager=new e(t._$target.get(0)),t._hammerManager.get("pinch").set({enable:!0}),t._hammerManager.on("pinchstart",function(e){t._handler.gestureStartEvent&&t._handler.gestureStartEvent(e,t._$target),t._clearContextMenuTimeout()}),t._hammerManager.on("pinchmove",function(e){t._handler.gestureChangeEvent&&t._handler.gestureChangeEvent(e,t._$target)}),t._hammerManager.on("pinchend pinchcancel",function(e){t._handler.gestureEndEvent&&t._handler.gestureEndEvent(e,t._$target)}))}))},e.prototype._fixMouseTouchEvent=function(e,t){var i;if(t.touches&&0!==t.touches.length)i=t.touches[0];else{if(!t.changedTouches||0===t.changedTouches.length)return;i=t.changedTouches[0]}e.pageX=i.pageX,e.pageY=i.pageY,e.localX=i.pageX,e.localY=i.pageY,e.clientX=i.clientX,e.clientY=i.clientY},e}()},,,,function(e,t,i){"use strict";var n,o;i.d(t,"a",function(){return o}),n=3e3,o=function(){function e(){var e=this;this._cache=null,this._tryLoad=function(t){e._startLoading().then(t,function(){return setTimeout(function(){return e._tryLoad(t)},n)})}}return e.prototype.load=function(){return this._cache||(this._cache=new Promise(this._tryLoad)),this._cache},e}()},function(e,t,i){"use strict";function n(e){this._maxSize=e||50,this.reset()}var o=/[2-9]/g;n.prototype.measureText=function(e,t,i){var n,r,s=i||o,a=(t+"").replace(s,"0") ;return this._cache[a]?this._cache[a].width:(this._actualSize===this._maxSize&&(n=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[n],this._oldestTick++,this._actualSize--),0===(r=e.measureText(a).width)&&t.length?0:(this._cache[a]={width:r,tick:this._usageTick},this._tick2Labels[this._usageTick]=a,this._actualSize++,this._usageTick++,r))},n.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}},e.exports=n},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StudyDataWindowView",function(){return d}),n=i(1),o=i(84),i.n(o),r=i(118),s=i(5),i.n(s),a=i(17),l=i(87),c=window.t("n/a"),h=s.enabled("hide_last_na_study_output"),u=function(e){function t(t,i,n,o){var r=e.call(this,t,i)||this;return r.plotId=n,r.plotIndex=o,r}return n.c(t,e),t}(r.DataWindowItem),d=function(e){function t(t,i){var n,o,r,s,a=e.call(this)||this;if(a._invalidated=!0,a._study=t,a._model=i,!(n=t.metaInfo().plots))return a;for(o=0;ox||(L=this._study.data().last(),null!==(I=this._study.data().valueAt(x)||(null!==L?L.value:null))&&(A=I[P+1],Object(o.isNumber)(A)&&(n.setValue(y.format(A)),k=this._study.properties().styles[w].color.value(),p=r[P],Object(l.isOhlcPlot)(p)&&(w=p.target||w,k=this._study.properties().ohlcPlots[w].color.value()),E=k,s[w]&&I.length>s[w].index+1&&(M=I[s[w].index+1],V=s[w].palette,void 0!==M&&null!==M&&void 0!==V&&(D=s[w].paletterProps,O=V.valToIndex?V.valToIndex[M]:M, -E=D.colors[void 0!==O?O:M].color.value())),n.setColor(E)))))}},t}(r.DataWindowView)},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DataWindowItem",function(){return n}),i.d(t,"DataWindowView",function(){return o}),n=function(){function e(e,t){this._visible=!0,this._title=e,this._value=t}return e.prototype.title=function(){return this._title},e.prototype.setTitle=function(e){this._title=e},e.prototype.text=function(){return this._value},e.prototype.value=function(){return this._value},e.prototype.setValue=function(e){this._value=e},e.prototype.visible=function(){return this._visible},e.prototype.setVisible=function(e){this._visible=e},e.prototype.color=function(){return this._color},e.prototype.setColor=function(e){this._color=e},e}(),o=function(){function e(){this._items=[],this._header="",this._title=""}return e.prototype.header=function(){return this._header},e.prototype.title=function(){return this._title},e.prototype.items=function(){return this._items},e.prototype.update=function(){},e}()},function(e,t,i){"use strict";function n(e,t){o.call(this,t),this._study=e,this._inputValueReplacements={NONE:"Default"}}var o=i(267);inherit(n,o),n.prototype.color=function(){return this._study.isFailed()||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":o.prototype.color.call(this)},n.prototype.update=function(){this._study.isFailed()?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},e.exports=n},function(e,t,i){"use strict";var n,o=i(7).assert,r=i(24),s=r.rgba,a=r.rgbaToString,l=r.parseRgb,c=i(533),h=i(177).PriceScale,u=i(124),d=i(73),p=d.createLineTool,_=d.isLineToolName,f=d.isStudyLineToolName,m=i(0).LineDataSource,y=i(45).LineToolBarsPattern,g=i(45).LineToolCallout,v=i(635),S=i(34),b=S.Study,w=S.prepareStudyPropsStateForLoadChart,P=S.prepareStudyPropertiesForLoadChart,T=i(285).createStudy,x=i(63).Series,C=i(40),L=i(42),I=i(3).DefaultProperty,A=i(26),k=i(5),E=i(4).getLogger("Chart.Serialization"),M=i(45).LineToolParallelChannel,V=i(45).LineToolTrendAngle,D=i(45).LineToolGhostFeed,O=i(45).LineToolElliott,R=i(28).PriceDataSource,B=i(176).Pane,N=i(18),F=i(29);E=i(4).getLogger("Chart.Serialization"),c.version=2,c.prototype.state=function(e,t){var i,n,o,r={};for(r.panes=[],i=0;in&&o.push(l)),s=(s+1)%c.length;return o},c.prototype.restoreState=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;if(new n(this).reset(),i={},!e.panes)return void E.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(e.panes))return void E.logDebug("ChartModel.restoreState: invalid state");if(e.panes.length<1)return void E.logDebug("ChartModel.restoreState: invalid state");if(e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties&&(o=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(o,e.chartProperties.scalesProperties),!("showLastValue"in o)||"showSeriesLastValue"in o||"showStudyLastValue"in o||(o.showSeriesLastValueProperty=o.showLastValue,o.showStudyLastValueProperty=o.showLastValue),"showSeriesLastValue"in o&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in o&&(i.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(e.chartProperties.paneProperties),this._properties.scalesProperties.merge(o),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(e.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(e.timeScale,t)),e.timeScale&&this.m_timeScale.restoreState(e.timeScale,t),!this.readOnly()&&(r=this._getExceedingChildStudies(e.panes),r.length))for(s=e.panes.length-1;s>=0;--s){for(a=e.panes[s],l=a.sources.length-1;l>=0;--l)c=a.sources[l],~r.indexOf(c)&&a.sources.splice(l,1);a.sources.length||e.panes.splice(s,1)}for(h=e.panes,this.panes()[0].restoreState(h[0],t,e.version,i),s=1;s_&&d%100==0?{lines_limit_exceeded:!0,line_tools_count:d}:{}},B.prototype.state=function(e,t,i,n){function o(e){return i&&!e.isSavedInStudyTemplates()||!e.state||!e.state()||!e.isSavedInChart(t)||n&&e.isActualSymbol&&!e.isActualSymbol()}var r,s,a={};if(e)for(a.sources=[],r=0;rn&&o.push(l)),s=(s+1)%c.length;return o},c.prototype.restoreState=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;if(new n(this).reset(),i={},!e.panes)return void E.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(e.panes))return void E.logDebug("ChartModel.restoreState: invalid state");if(e.panes.length<1)return void E.logDebug("ChartModel.restoreState: invalid state");if(e.chartProperties&&!e.chartProperties.timezone&&(e.chartProperties.timezone=e.timezone),e.chartProperties&&(o=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(o,e.chartProperties.scalesProperties),!("showLastValue"in o)||"showSeriesLastValue"in o||"showStudyLastValue"in o||(o.showSeriesLastValueProperty=o.showLastValue,o.showStudyLastValueProperty=o.showLastValue),"showSeriesLastValue"in o&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in o&&(i.showStudyLastValueProperty=!0),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||TradingView.clone(e.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(e.chartProperties.paneProperties),this._properties.scalesProperties.merge(o),e.chartProperties.timezone&&this._properties.timezone.setValue(e.chartProperties.timezone),e.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(e.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(e.timeScale,t)),e.timeScale&&this.m_timeScale.restoreState(e.timeScale,t),!this.readOnly()&&(r=this._getExceedingChildStudies(e.panes),r.length))for(s=e.panes.length-1;s>=0;--s){for(a=e.panes[s],l=a.sources.length-1;l>=0;--l)c=a.sources[l],~r.indexOf(c)&&a.sources.splice(l,1);a.sources.length||e.panes.splice(s,1)}for(h=e.panes,this.panes()[0].restoreState(h[0],t,e.version,i),s=1;s_&&d%100==0?{lines_limit_exceeded:!0,line_tools_count:d}:{}},B.prototype.state=function(e,t,i,n){function o(e){return i&&!e.isSavedInStudyTemplates()||!e.state||!e.state()||!e.isSavedInChart(t)||n&&e.isActualSymbol&&!e.isActualSymbol()}var r,s,a={};if(e)for(a.sources=[],r=0;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=3?l:null}function _(e,t){var i,n,o,r,s,a=e;for(i=0;i0&&t.setValue(s.family),s.size.length>0&&i.setValue(s.size),n.setValue(s.bold),o.setValue(s.italic))},s.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]},s.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())},s.repaint=function(e){var t=new n(n.LIGHT_UPDATE);t.force=!0,e.invalidate(t)},s.roundToMinTick=function(e,t){var i=e.mainSource().base(),n=1/i;return n*Math.round(t/n)},e.exports=s},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'+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\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\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(87).PlotType,_=i(161),f=i(104).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){ +e.style.bottom=v(o-S.y),e.style.left=v(_),u=p'+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=F.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\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\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(87).PlotType,_=i(161),f=i(104).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:9,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:9,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", @@ -191,7 +191,7 @@ linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,colo 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(.66*((n.Std.hl2(this._context)-l)/n.Std.max(s-l,.001)-.5)+.67*n.Std.nz(c.get(1)));return c.set(h[0]),e=this._context.new_var(),e.set(.5*n.Std.log((1+c.get(0))/n.Std.max(1-c.get(0),.001))+.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:"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,F,N,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),F=this._context.new_var(B),N=n.Std.sma(F,u,this._context),W=B,H=N,[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", @@ -220,8 +220,8 @@ for(var n=0;nt.color?-1:e.colora[a.length-1].time+l)return null;for(t=null,i=0;i5&&("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;0ne?(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) +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;nne?(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 F(e){return p(e)}function N(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=F,t.extractThemeFromModel=N,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;i0&&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\n\t\t\t\t'+i+'\n\t\t\t\t\n\t\t\t'),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(){ @@ -268,10 +268,10 @@ data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, "right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(P="center"===this._data.horzAlign?e-S.w/2:e-S.w-(S.x-e),T=P-S.x,t+=T,S.x=P,!0!==this._data.doNotAlignText&&("right"===this._data.horzAlign?(r.textAlign="end",t+=d):(r.textAlign="center",t+=d/2))),S.w%2!=0&&S.w++,S.x+=.5,S.y+=.5,this._boundingRect=[new s(S.x,S.y),new s(S.x+S.w,S.y+S.h)],this._rect=S,this._padding=f,this._defaultPadding=v}else"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(n-=Math.round(h*("middle"===this._data.vertAlign?.5:1))),x=t,"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(x-=Math.round(d*("center"===this._data.horzAlign?.5:1))),this._boundingRect=[new s(x,n),new s(x+d,n+h)];this._textPoint={x:t,y:n},this._textSizeCache&&(this._textSizeCache.widths=u),this._preRendered=!0,this._maxWidth=d}},n.prototype._drawIcon=function(e,t,i,n){var o,r,s,a;if(u.hasOwnProperty(n)){if(o=u[n],!o.src){for(o.src=document.createElement("canvas"),o.src.width=o.width,o.src.height=o.height,r=o.src.getContext("2d"),s=r.createImageData(o.width,o.height),a=0;an?1:-1},e}(),p=function(){function e(e){void 0===e&&(e="0000-0000");var t=this;this._entries=[],this._firstDayOfWeek=s.MONDAY,this._weekEndsCount=null,"24x7"===e.toLowerCase()?u.forEach(function(e){t.addSessionEntry(e,0,0)}):this._parseSpec(e),this._entries.sort(n)}return e.prototype.entries=function(){return this._entries},e.prototype.firstDayOfWeek=function(){return this._firstDayOfWeek}, e.prototype.addSessionEntry=function(e,t,i){i<=t&&0!==t&&(t-=s.minutesPerDay);var n=i===t?s.minutesPerDay:i-t;this._entries.push(new d(e,t,n))},e.prototype.isWeekEnd=function(e){var t=Object(a.lowerbound)(this._entries,new d(e,0,0),function(e,t){return e.dayOfWeek()this._entries.length-1||this._entries[t].dayOfWeek()!==e},e.prototype.weekEndsCount=function(){if(null===this._weekEndsCount){var e={};this._entries.forEach(function(t){e[t.dayOfWeek()]=1}),this._weekEndsCount=7-Object.keys(e).reduce(function(t,i){return t+(e[+i]||0)},0)}return this._weekEndsCount},e.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},e.prototype.indexOfSessionEntry=function(e,t){var i=Object(a.lowerbound)(this._entries,new d(e,t,0),function(e,t){return e.compareTo(t)<0});return i>this._entries.length-1?0:i},e.prototype.findSessionEntry=function(e,t){return this._entries[this.indexOfSessionEntry(e,t)]},e.prototype.correctTradingDay=function(e,t){var i=s.get_day_of_week(e),n=60*s.get_hours(e)+s.get_minutes(e),o=this.findSessionEntry(i,n),r=o.dayOfWeek(),a=(r-i+7)%7;return 0!==a&&s.add_date(e,a),e},e.prototype.alignToSessionStart=function(e,t){var i=s.get_day_of_week(e),n=s.get_minutes_from_midnight(e),o=this.findSessionEntry(i,n),a=o.alignedStart(),l=o.dayOfWeek(),c=o.isOvernight(),h=(l-i+7)%7-(c?1:0);return 0!==h&&s.add_date(e,h),s.set_hms(e,a/60|0,a%60,0,0,t),r(o.length(),e,t)},e.prototype._parseSpec=function(e){var t=this,i={},n=!1;e=this._parseFirstDayOfWeek(e),e.split("|").forEach(function(e){var t,r,s=e.split(":");if(1!==s.length&&2!==s.length)return void c.logError("Bad session section: "+e);if(t=1===s.length){if(n)return void c.logError("Duplicated default section: "+e);n=!0}r=t?h:o(s[1]),r.forEach(function(e){t&&i[e]||(i[e]=s[0])})}),u.forEach(function(n){var o=i[n];void 0!==o&&o.split(",").forEach(function(i){var o,r,a=i.split("-");2!==a.length&&(c.logError("Bad sessions spec: "+e),a=["0000","0000"]),o=a[0],r=a[1],t.addSessionEntry(n,s.get_minutes_from_hhmm(o),s.get_minutes_from_hhmm(r))})})},e.prototype._parseFirstDayOfWeek=function(e){var t,i,n,o=e.split(";");return o.length>2?(c.logError("Only one `first day` specification expected @ session "+e),e):1===o.length?e:(t=o[0].indexOf("-")>=0,i=t?NaN:parseInt(o[0]),n=1,isNaN(i)&&(n=0,i=parseInt(o[1])),is.SATURDAY?(c.logError("Unexpected day index @ session: "+e+"; day index "+i),e):(this._firstDayOfWeek=i,o[n]))},e}()},function(e,t,i){"use strict";var n,o,r;i.d(t,"a",function(){return r}),n=i(1),o=i(115),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._startLoading=function(){return i.e(28).then(i.bind(null,812))},t}(o.a)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";(function(e){function t(){var t=window.parent[window.urlParams.uid].settingsAdapter;null!=t?(TVSettings.setSettingsAdapter(t),TVSettings.sync()):e.enabled("use_localstorage_for_settings")&&TVSettings.sync()}function n(){ -var e,t,i,n,o=urlParams.theme;return o?(e=f.savedThemeName(),t=o.toLowerCase(),(i=f.themes[t])?(f.setTheme(i.name),f.syncTheme(),o===e?$.Deferred().resolve():(n=$.Deferred(),f.getStdTheme(i.name).then(function(e){n.resolve(e.content)}).catch(function(e){console.warn("Cannot load theme {0}, reason: {1}".format(i.name,e)),n.resolve()}),n.promise())):$.Deferred().resolve()):$.Deferred().resolve()}function o(e){var t=/(\d+)(\w+)/;return e.map(function(e){var i=t.exec(e.text),n=i[2].toLowerCase(),o=parseInt(i[1]),r="y"===n?12*o+"m":o+n,s=q.Symbol.parsePeriod(e.resolution);return{text:window.t(e.title)||o+window.t(n,{context:"dates",count:o}),description:e.description||"",value:r,targetResolution:e.resolution,requiresIntraday:s.isIntraday}})}function r(){JSON.parse(urlParams.disabledFeatures).forEach(function(t){e.setEnabled(t,!1)}),JSON.parse(urlParams.enabledFeatures).forEach(function(t){e.setEnabled(t,!0)})}function s(){e.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?m.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?m.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(e.setEnabled("saveload_storage_customization",!1),e.setEnabled("header_saveload",!1)))}function a(){ee.resolve()}function l(t){var n,o,r,s,a,l;return e.enabled("header_widget")?(n=B.allocate({areaName:"top"}),o=i(255).ChartChangesWatcher,r=new o(t.chartWidgetCollection.undoHistory,window.saver,T),s=JSON.parse(urlParams.favorites),s.intervals=s.intervals.map(function(e){var t=""+e;return t.match(/1[DWMYdwmy]/)&&(t=t.slice(1)),t}),a=null,e.enabled("study_templates")&&(a=new w(A,TVSettings),window.studyTemplates=new b({chartWidgetCollection:t.chartWidgetCollection,favoriteStudyTemplatesService:a})),l=Modernizr.touch?["full"]:e.enabled("caption_buttons_text_if_possible")?void 0:["medium"],new d(new u,{chartSaver:window.saver,chartApiInstance:ChartApiInstance,chartWidgetCollection:t.chartWidgetCollection,defaultIntervals:Object.keys(ChartApiInstance.defaultResolutions()),defaultFavoriteStyles:s.chartTypes,defaultFavoriteIntervals:s.intervals,hideStudyTemplates:!0,resizerBridge:n,studyMarket:window.studyMarket,studyTemplates:window.studyTemplates,favoriteStudyTemplatesService:a,allowedModes:l,saveChartService:t.saveChartService,loadChartService:t.loadChartService,chartChangesWatcher:r})):null}function c(e){if(Z){var t=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?urlParams.toolbarbg+"":void 0;return t&&$("