webpackJsonp([29],[function(e,t,i){"use strict";(function(e){function n(e,t){a.call(this),this._linetool=e,this._pointindex=t,this._model=e._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0,this._renderer=new l}function o(e,t){var i,r,s;if(c.call(this),this._model=e,this._properties=t,this._pointAdded=new v,this._pointChanged=new v,this._onRestoringFactoryDefaults=new v,this._onTemplateApplying=new v,this._onTemplateApplied=new v,t.visible&&t.frozen||this._properties.merge(defaults("linetool")),i=defaults("linetoolvisibilities"),t.intervalsVisibilities)for(r in i.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,i.intervalsVisibilities[r]);else this._properties.merge(i);if(this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.symbol||this._properties.merge({symbol:e.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:e.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,o.prototype.calcIsActualSymbol),this._properties.listeners().subscribe(this,this.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(s=0;s=i.multiplier()&&(t=e.key)}),t},o.prototype.calcIsActualSymbol=function(){var e,t=this._properties.symbol,i=this._model.mainSeries(),n=t.value();this._isActualSymbol=i.symbolSameAsCurrent(n),this._isActualSymbol&&(e=i.symbol(),n!==e&&(g.logWarn('Possible drawing "migrating" detected from "'+n+'" to "'+e+'"'),g.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),g.logWarn(Error().stack)),t.setValue(e)),this.calcIsActualInterval()},o.prototype.calcIsActualInterval=function(){var e,t,i,n,o,r=this._properties,s=this._model.mainSeries(),a=d.parse(s.interval()),l=r.intervalsVisibilities;this._isActualInterval=!1,a.isSeconds()&&a.multiplier()<60&&(e=l.seconds.value(),t=l.secondsFrom.value(),i=l.secondsTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isSeconds()&&a.multiplier()>=60&&(n=Math.floor(a.multiplier()/60),e=l.minutes.value(),t=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=e&&n>=t&&n<=i),a.isMinutes()&&a.multiplier()<60&&(e=l.minutes.value(),t=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isMinutes()&&a.multiplier()>=60&&(o=Math.floor(a.multiplier()/60),e=l.hours.value(),t=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=e&&o>=t&&o<=i),a.isHours()&&(e=l.hours.value(),t=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isDays()&&(e=l.days.value(),t=l.daysFrom.value(),i=l.daysTo.value(),this._isActualInterval=e&&a.multiplier()>=t&&a.multiplier()<=i),a.isWeeks()&&(this._isActualInterval=l.weeks.value()),a.isMonths()&&(this._isActualInterval=l.months.value()),a.isRange()&&(this._isActualInterval=l.ranges.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},o.PointPriceProperty.prototype.value=function(){var e=this._lineSource.points()[this._pointIndex].price,t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},o.PointPriceProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0), this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},o.PointIndexProperty=function(t,i){e.call(this),this._lineSource=t,this._pointIndex=i},inherit(o.PointIndexProperty,e),o.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},o.PointIndexProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.index=e,this._lineSource.setPoint(this._pointIndex,t),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._syncMultichartState=function(){var e={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&h.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:e})},o.prototype._createPointProperty=function(e){var t,i=this._properties.points;i.addProperty(e),t=i[e],t.addChild("price",new o.PointPriceProperty(this,e)),t.addChild("bar",new o.PointIndexProperty(this,e))},o.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var e=0;e0&&(this._points=i)},o.prototype.restorePoints=function(e,t,i){this._timePoint=e,this._points=t,i||this.denormalizeTimePoints()},o.prototype.restoreExternalPoints=function(e){if(this.properties().interval.setValue(e.interval),this._timePoint=e.points,this.denormalizeTimePoints(),!this.isActualSymbol())return void this.clearServerPoints();this.createServerPoints()},o.prototype.restorePositionPercents=function(e){this._positionPercents=e},o.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},o.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var e=this.properties().state(this._syncStateExclusions);delete e.interval,h.changeLineStyle({linkKey:this.linkKey,state:e,model:this._model})}},o.prototype.points=function(){var e,t,i=[];for(e=0;e=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i},o.prototype.addPoint=function(e,t,i){var n=this._preparePoint(e,t);return this._addPointIntenal(n,t,i)},o.prototype._addPointIntenal=function(e,t,i){ this._points.push(e);var n=this._points.length===this.pointsCount();return n?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),n},o.prototype.addFixedPoint=function(e){this._fixedPoints.push(e);var t=this._fixedPoints.length===this.pointsCount();return t&&this.calcPositionPercents(),t},o.prototype.calcPositionPercents=function(){var e,t,i,n;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],e=0;e=0;--i)t.push(this._paneViews[i]);return t},o.prototype._setPaneViews=function(e){this._paneViews=e,this._model.invalidate(new y(y.LIGHT_UPDATE))},o.prototype.dataWindowView=function(){return null},o.prototype.statusView=function(){return null},o.prototype.isSourceHidden=function(){return!this._properties.visible.value()||h.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol},o.prototype.priceAxisViews=function(e,t){var i,n,o;return this.isSourceHidden()?null:-1!==e.dataSources().indexOf(this)&&t===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i"+e.title+": "+e.value}).join("
")},o.prototype.pointToScreenPoint=function(e){var t,i,n,o,s,a=this._model.timeScale(),l=this.priceScale(),c=this.ownerSource().firstValue();return!l||l.isEmpty()||a.isEmpty()||null==c?[new r(0,0),new r(0,0)]:(t=a.indexToCoordinate(e.index,!0),i=e.price,n=l.priceToCoordinate(i,c,!0),o=new r(t,n),t=a.indexToCoordinate(e.index,!1),n=l.priceToCoordinate(i,c,!1),s=new r(t,n),[o,s])},o.prototype.screenPointToPoint=function(e){var t,i=this._model.timeScale(),n=this.priceScale(),o=i.coordinateToIndex(e.x),r=this.ownerSource().firstValue();if(null!==r&&isFinite(r))return t=n.coordinateToPrice(e.y,r),{price:t,index:o}},o.prototype.tags=function(){return[this._constructor]},o.prototype._snapPoint45Degree=function(e,t,i){var n,o,r,s,a,l,c,h,u,d=this._model.timeScale(),p=d.indexToCoordinate(t.index),_=d.indexToCoordinate(e.index)-p,f=this.m_priceScale,m=t.price,y=e.price,g=this.ownerSource().firstValue(),v=f.priceToCoordinate(m,g),S=f.priceToCoordinate(y,g)-v,b=Math.round(Math.atan2(_,S)/Math.PI*4);2===Math.abs(b)?i||(e.price=m):0===Math.abs(b)||4===Math.abs(b)?i||(e.index=t.index):0===Math.abs(b)||4===Math.abs(b)?i||(e.index=t.index):(n=Math.sqrt(_*_+S*S),o=_<0?-1:1,r=S<0?-1:1,s=Math.max(Math.abs(S),Math.abs(_)),a=s*Math.sqrt(2),l=a/n,s/=l,c=Math.round(d.coordinateToIndex(p+s*o)),h=Math.abs(d.indexToCoordinate(c)-p),u=f.coordinateToPrice(v+h*r,g),e.index=c,e.price=u)},o.prototype.createPriceAxisView=function(e){return new s(this,{pointIndex:e})},o.prototype.version=1,o.prototype.alertId=function(){return this._alertId},o.prototype.setAlert=function(e,t){},o.prototype.flushAlert=function(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)}, o.prototype._processAlertHanders=function(e){var t,i,n,o=this;("unsubscribe"!==(e="subscribe"===e?"subscribe":"unsubscribe")||o._alertCallbacks)&&(i="subscribe"===e?"on":"off",t=o.properties(),n=o._alertCallbacks||{flush:o.flushAlert.bind(o),hovered:function(e,t){t?o._model.setHoveredSource(o):o._model.hoveredSource()===o&&o._model.setHoveredSource(null)},selected:function(e,t){t&&o._model.setSelectedSource(o)},synchronizeSilently:function(e){o.synchronizeAlert(!1)}},o._alertCallbacks||(o._alertCallbacks=n),o.getAlert().done(function(r){r&&(r[i]("destroy",n.flush),r[i]("change:hovered",n.hovered),r[i]("change:selected",n.selected),t.extendLeft&&t.extendLeft[e](o,n.synchronizeSilently),t.extendRight&&t.extendRight[e](o,n.synchronizeSilently))}))},o.prototype.editAlert=function(){},o.prototype.getAlert=function(e){var t,i=this;return e=e||{},t=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:t.resolve.bind(t),error:t.reject.bind(t),fromCache:e.fromCache}):g.logError("[Alerts] Can't get alert without alerts dispatcher"),t.promise()},o.prototype.synchronizeAlert=function(e){var t=this;t.hasAlert.value()&&setTimeout(function(){function i(){t._alertUndoMode=!0,s.undoToCheckpoint(t._undoCheckpointAlert),setTimeout(function(){t._alertUndoMode=!1,t.localAndServerAlersMismatch=!1},0)}function n(e){var i=e.get("description")!==e.defaultDescription(),n=e.get("extra"),o=n.alertSeries(),r=t._model.mainSeries().stateForAlert();"MainSeries"===o.type&&r.actualSymbol===o.actualSymbol&&(n.mainSeries(r),n.alertSeries(r)),e.set("resolution",t.stateForAlert().interval),n.drawing(t),i||e.setDefaultDescription(),t.localAndServerAlersMismatch=!0}function o(e){TradingView.alertsDispatcher.restartAlert(e,{success:function(){t.localAndServerAlersMismatch=!1},error:i,complete:function(){delete t._undoCheckpointAlert}})}var r,s=t._getUndoHistory();t._undoCheckpointAlert||t._alertUndoMode||(r=s.undoStack().pop(),t._undoCheckpointAlert=s.createUndoCheckpoint(),r&&s.undoStack().push(r)),t.getAlert().done(function(t){n(t),e&&o(t)}).fail(i)},0)},o.prototype._getUndoHistory=function(){return this._model._undoModel.undoHistory},o.prototype.stateForAlert=function(){var e,t;if(this.canHasAlert())return e=this.state(),e.id=this.idForAlert(),e.uniqueId=this.idForAlert(),e.title=this.title(),e.interval=this._model.mainSeries().interval(),t=this._getAlertPlots(),t&&(e.plots=t),e},o.prototype._getAlertPlots=function(){return null},o.prototype._linePointsToAlertPlot=function(e,t,i,n){if(2!==e.length)return g.logError("[Drawing Alert] Wrong points"),null;var o=this._model.timeScale();return!o||o.isEmpty()?null:{type:"LinePlot",title:t||this.title(),timestamp:o.indexToTimePoint(0),offset1:e[0].index,offset2:e[1].index,price1:e[0].price,price2:e[1].price,extendBackward:i||!1,extendForward:n||!1}},o.prototype.getAlertIsActive=function(e){this.getAlert({fromCache:!0}).done(function(t){e(!!t&&t.get("active"))}).fail(function(){e(!1)})},o.prototype.geometry=function(){var e=this,t=function(t){ var i=t.x/e._model.timeScale().width(),n=t.y/e.priceScale().height();return new r(i,n)};return this.points().map(function(i){var n=e.pointToScreenPoint(i)[0];return t(n)})},o.prototype.onlyYMoving=function(){return!1},o.prototype.model=function(){return this._model},o.prototype.isForcedDrawPriceAxisLabel=function(){return this.customization.forcePriceAxisLabel},o.prototype.getInputsPropertyPage=function(){return S.LineToolInputsPropertyPage},o.prototype.getVisibilitiesPropertyPage=function(){return S.LineToolVisibilitiesPropertyPage},o.prototype.getSourceIcon=function(){return{type:"loadSvg",svgId:"linetool."+this.getType()}},o.prototype.destroy=function(){this.stop()},t.LineToolPriceAxisView=s,t.LineDataSource=o}).call(t,i(13))},function(e,t,i){"use strict";function n(e,t){function i(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function o(e,t){var i,n,o={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(n=0,i=Object.getOwnPropertySymbols(e);n0&&s[s.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]=1&&(n+=8*(1+encodeURIComponent(e[i]).length),!(i-1>0&&(o=8*(1+encodeURIComponent(e[i-1]).length),n+o>t)));i--);return e.slice(i)}function a(e,t,i,n,o){var r={id:y,message:t+"",subSystemId:n,timestamp:+e};y+=1,i.push(r),void 0!==o&&i.length>o&&i.splice(0,1)}function l(e){var t,i=b.reduce(function(e,t){return e.concat(t)},[]);return i.sort(function(e,t){return e.id-t.id}), "number"==typeof e&&(i=i.slice(-e)),t=i.map(function(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}),s(t,g)}function c(e,t,i,n){var r,s;if((t!==P||n.id!==T)&&(r=new Date,e<=m.NORMAL&&a(r,t,i,n.id,n.maxCount),e<=C&&(!n.highRate||o())&&(!w||n.id.match(w)))){switch(s=r.toISOString()+":"+n.id+":"+t,e){case m.DEBUG:console.debug(s);break;case m.INFO:case m.NORMAL:n.color?console.log("%c"+s,"color: "+n.color):console.log(s);break;case m.WARNING:console.warn(s);break;case m.ERROR:console.error(s)}P=t,T=n.id,x&&clearTimeout(x),x=setTimeout(function(){P=null,T=null,x=NaN},1e3)}}function h(e,t){function i(e){return function(t){return c(e,t,n,o)}}var n,o;return void 0===t&&(t={}),n=[],b.push(n),o=Object.assign(t,{id:e}),{logDebug:i(m.DEBUG),logError:i(m.ERROR),logInfo:i(m.INFO),logNormal:i(m.NORMAL),logWarn:i(m.WARNING)}}function u(){L=!!f&&"true"===localStorage.getItem(S);var e=parseInt(f?localStorage.getItem(v)||"":"");Number.isNaN(e)&&(e=m.WARNING),r(e),I.logNormal("Init with settings - level: "+C+", high-rate: "+L)}function d(){try{f&&(localStorage.setItem(S,L+""),localStorage.setItem(v,C+""))}catch(e){I.logWarn("Cannot save logger state (level: "+C+", high-rate: "+L+") to localStorage: "+e.message)}}function p(){_.performance&&_.performance.now?I.logNormal("Sync logger and perf times, now is "+_.performance.now()):I.logWarn("Perf time is not available")}var _,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LOGLEVEL",function(){return m}),t.getLogLevel=n,t.isHighRateEnabled=o,t.setLogLevel=r,t.getLogHistory=l,t.getLogger=h,i.d(t,"loggingOn",function(){return A}),i.d(t,"loggingOff",function(){return k}),_="undefined"!=typeof window?window:{},f=!1;try{localStorage.getItem(""),f=!0}catch(e){}!function(e){e[e.ERROR=1]="ERROR",e[e.WARNING=2]="WARNING",e[e.INFO=3]="INFO",e[e.NORMAL=4]="NORMAL",e[e.DEBUG=5]="DEBUG"}(m||(m={})),y=0,g=75497472,v="tv.logger.loglevel",S="tv.logger.logHighRate",b=[],w=null,P=null,T=null,x=NaN,C=m.WARNING,L=!1,I=h("logger"),A=_.lon=function(e,t){r(m.DEBUG),I.logNormal("Debug logging enabled"),L=!!e,w=t||null,d()},k=_.loff=function(){r(m.INFO),I.logInfo("Debug logging disabled")},u(),p()},function(e,t,i){var n=i(463),o={},r={},s={},a={init:function(){var e,t,i,l;Object.keys(n).forEach(function(i){e=n[i],t=e.subsets,Array.isArray(t)?t.forEach(function(e){o[e]=1}):t&&Object.keys(t).forEach(function(e){o[e]=1}),o[i]=1}),i=Object.keys(o),i.forEach(function(e){i.forEach(function(i){if(void 0!==(l=n[i])){if(!(t=l.subsets))return;r.hasOwnProperty(e)||(r[e]=[]),Array.isArray(t)&&~t.indexOf(e)?r[e].push(i):e in t&&r[e].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(e){a.disable(e)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(e){a.enable(e)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:o,_setsReverseDependencies:r, _setsStates:s}},enabled:function(e){var t=function(e){var i,n,o=r.hasOwnProperty(e)?r[e]:[];if(!1===s[e])return!1;for(i=s[e],n=0;n0)}Object.defineProperty(t,"__esModule",{value:!0});var h=function(){function e(e,t){this.x=e,this.y=t}return e.prototype.add=function(t){return new e(this.x+t.x,this.y+t.y)},e.prototype.addScaled=function(t,i){return new e(this.x+i*t.x,this.y+i*t.y)},e.prototype.subtract=function(t){return new e(this.x-t.x,this.y-t.y)},e.prototype.dotProduct=function(e){return this.x*e.x+this.y*e.y},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.scaled=function(t){return new e(this.x*t,this.y*t)},e.prototype.normalized=function(){return this.scaled(1/this.length())},e.prototype.transposed=function(){return new e(-this.y,this.x)},e.prototype.clone=function(){return new e(this.x,this.y)},e}();t.Point=h,t.point=n,t.equalPoints=o,t.line=r,t.lineThroughPoints=s,t.lineSegment=a,t.halfplane=l,t.halfplaneThroughPoint=c},function(e,t,i){"use strict";function n(e,t){if(!e)throw Error("Assertion failed"+(t?": "+t:""))}function o(e){if(void 0===e)throw Error("Value is undefined");return e}function r(e){if(null===e)throw Error("Value is null");return e}function s(e){return r(o(e))}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=n,t.ensureDefined=o,t.ensureNotNull=r,t.ensure=s},function(e,t,i){"use strict";(function(e){function t(){this._listeners=[]}function n(e){return!e.singleshot}i(4).getLogger("Common.Delegate");t.prototype.subscribe=function(e,t,i){var n={object:e,member:t,singleshot:!!i};this._listeners.push(n)},t.prototype.unsubscribe=function(e,t){var i,n;for(i=0;i=0;--t)i=this._listeners[t],i.object===e&&this._listeners.splice(t,1)},t.prototype.destroy=function(){delete this._listeners},t.prototype.fire=function(){var e,t,i,o=this._listeners;for(this._listeners=this._listeners.filter(n),e=o.length,t=0;t0)},l.isAbsent=function(e){return null===e||void 0===e},l.isExistent=function(e){return null!==e&&void 0!==e},Number.isNaN=Number.isNaN||function(e){return e!=e},l.isSameType=function(e,t){return Number.isNaN(e)||Number.isNaN(t)?Number.isNaN(e)===Number.isNaN(t):{}.toString.call(e)==={}.toString.call(t)},l.isInteger=function(e){return"number"==typeof e&&e%1==0},l.parseBool=function(e){return!0===e||"true"===e},l.isBoolean=function(e){return!0===e||!1===e},l.isString=function(e){return null!==e&&void 0!==e&&e.constructor===String},l.isInherited=function(e,t){return e===t||!(!e||!e.prototype)&&(void 0!==e.prototype.superclass&&null!==e.prototype.superclass&&(e.prototype.superclass===t||l.isInherited(e.prototype.superclass,t)))},l.TypeValidator=function(e){this.m_type=e},l.TypeValidator.prototype.check=function(e){return e.constructor===this.m_type||l.isInherited(e.constructor,this.m_type)},l.PredicateValidator=function(e){this.m_predicate=e},l.PredicateValidator.prototype.check=function(e){return this.m_predicate(e)},l.clone=function(e){var t,i,n;if(!e||"object"!=typeof e)return e;t="function"==typeof e.pop?[]:{};for(i in e)e.hasOwnProperty(i)&&(n=e[i],t[i]=n&&"object"==typeof n?l.clone(n):n);return t},l.deepEquals=function(e,t,i){var o,r,s,a,h;if(i||(i=""),e===t)return[!0,i];if(n(e)&&(e=void 0),n(t)&&(t=void 0), void 0===e&&void 0!==t)return[!1,i];if(void 0===t&&void 0!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if("object"!=typeof e&&"object"!=typeof t)return[e===t,i];if(Array.isArray(e)&&Array.isArray(t)){if(o=e.length,r=t.length,o!==r)return[!1,i];for(s=0;sr&&(c=1*l),0===c);h++);return c}},void 0!==e&&e&&e.exports&&(e.exports={inherit:r,clone:l.clone,merge:l.merge,isNumber:t,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:h,isHashObject:u,isPromise:o,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:c,parseBool:l.parseBool,parseJSONorNot:i,deepEquals:l.deepEquals,declareClassAsPureInterface:s,requireFullInterfaceImplementation:a})}).call(t,i(51)(e))},function(e,t,i){"use strict";(function(t){function i(e){if(this._listeners=new t,this._childs=[],this._muteChildChanges=!1,void 0!==e&&null!==e)if(this.isPrimitiveType(e))this._value=e;else for(var i in e)this.addProperty(i,e[i])}i.prototype.merge=function(e,t){var i,n,o,r,s=null;if(t&&(s=[],i=s.length),null==e)return s;if(this.isPrimitiveType(e))return t&&this._value!==e&&s.push(this),this._value=e,s;if(Array.isArray(e))for(n=0;ni&&s.push(this),s},i.prototype.mergeAndFire=function(e){var t=this.merge(e,!0);this._muteChildChanges=!0,t.forEach(function(e){e._muteChildChanges=!0}),t.forEach(function(e){e._muteChildChanges=!1,e.listeners().fire(e)}),this._muteChildChanges=!1,t.length>0&&this.listeners().fire(this)},i.prototype.state=function(e){var t,i,n,o,r,s=this._value;for(void 0===s&&(s={}),t=0;t=0},i.prototype.addChild=function(e,t){this[e]=t,-1===$.inArray(e,this._childs)&&this._childs.push(e),t.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.childChanged=function(e,t){this._muteChildChanges||this.listeners().fire(this)},i.prototype.subscribe=function(e,t){this.listeners().subscribe(e,t,!1)},i.prototype.unsubscribe=function(e,t){this.listeners().unsubscribe(e,t)},i.prototype.unsubscribeAll=function(e){this.listeners().unsubscribeAll(e)},e.exports=i}).call(t,i(8))},,function(e,t,i){"use strict";function n(e){return 0===e.length?1:parseInt(e,10)}var o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ResolutionKind",function(){return s}),i.d(t,"Interval",function(){return c}),o=/^(\d*)([SHDWMR])$/,r=/^(\d+)$/,function(e){e.Seconds="seconds",e.Minutes="minutes",e.Hours="hours",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(s||(s={})),a={},a[s.Seconds]=1e3,a[s.Minutes]=60*a[s.Seconds],a[s.Hours]=60*a[s.Minutes],a[s.Days]=24*a[s.Hours],a[s.Weeks]=7*a[s.Days],l={S:s.Seconds,H:s.Hours,D:s.Days,W:s.Weeks,M:s.Months,R:s.Range},c=function(){function e(t,i){if(this._kind=s.Invalid,void 0===i&&t!==s.Invalid)return e.parse(t);this._kind=this._validateResolutionKind(t),this._multiplier=this._kind!==s.Invalid?i:void 0,0===this._multiplier&&(this._kind=s.Invalid,this._multiplier=void 0)}return e.prototype.kind=function(){return this._kind},e.prototype.multiplier=function(){return this._multiplier},e.prototype.isValid=function(){return this.kind()!==s.Invalid},e.prototype.isDWM=function(){return this.isValid()&&!this.isRange()&&!this.isIntraday()},e.prototype.isIntraday=function(){var e=-1!==[s.Seconds,s.Minutes,s.Hours].indexOf(this.kind());return this.isValid()&&!this.isRange()&&e},e.prototype.isSeconds=function(){return this.kind()===s.Seconds},e.prototype.isMinutes=function(){return this.kind()===s.Minutes},e.prototype.isHours=function(){return this.kind()===s.Hours},e.prototype.isDays=function(){return this.kind()===s.Days},e.prototype.isWeeks=function(){return this.kind()===s.Weeks},e.prototype.isMonths=function(){return this.kind()===s.Months}, e.prototype.isRange=function(){return this.kind()===s.Range},e.prototype.isTimeBased=function(){return!this.isRange()},e.prototype.letter=function(){return this.isValid()&&this.kind()!==s.Minutes?this.kind()[0].toUpperCase():""},e.prototype.value=function(){return this.isValid()?this.kind()===s.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""},e.prototype.isEqualTo=function(t){if(!(t instanceof e))throw Error("Argument is not an Interval");return!(!this.isValid()||!t.isValid())&&(this.kind()===t.kind()&&this.multiplier()===t.multiplier())},e.prototype.inMilliseconds=function(e){var t,i;return void 0===e&&(e=Date.now()),!this.isValid()||this.isRange()?NaN:this.isMonths()?(t=new Date(e),t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1)),+t-e):(i=this.multiplier(),void 0===i?NaN:a[this.kind()]*i)},e.isEqual=function(t,i){return e.parse(t).isEqualTo(e.parse(i))},e.parse=function(t){t=(t+"").toUpperCase().split(",")[0];var i=o.exec(t);return null!==i?new e(l[i[2]],n(i[1])):(i=r.exec(t),null!==i?new e(s.Minutes,n(i[1])):new e(s.Invalid))},e.kind=function(t){return e.parse(t).kind()},e.isValid=function(t){return e.parse(t).isValid()},e.isDWM=function(t){return e.parse(t).isDWM()},e.isIntraday=function(t){return e.parse(t).isIntraday()},e.isSeconds=function(t){return e.parse(t).isSeconds()},e.isMinutes=function(t){return e.parse(t).isMinutes()},e.isHours=function(t){return e.parse(t).isHours()},e.isDays=function(t){return e.parse(t).isDays()},e.isWeeks=function(t){return e.parse(t).isWeeks()},e.isMonths=function(t){return e.parse(t).isMonths()},e.isRange=function(t){return e.parse(t).isRange()},e.isTimeBased=function(t){return e.parse(t).isTimeBased()},e.normalize=function(t){var i=new e(t);return i.isValid()?i.value():null},e.prototype._validateResolutionKind=function(e){return e!==s.Seconds&&e!==s.Minutes&&e!==s.Hours&&e!==s.Days&&e!==s.Weeks&&e!==s.Months&&e!==s.Range&&e!==s.Invalid?s.Invalid:e},e}()},function(e,t,i){"use strict";(function(e){function t(){}function i(e){if(!(this instanceof i))return new i(e);arguments.length>0&&(this._value=e),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(e,t){var i,n,o,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(e=r.hook(e)),r.writeLock)return r._value;if(!t&&r._value===e&&r.hasOwnProperty("_value"))return e;for(r._value=e,i=r._listeners.slice(),n=0,o=0;ot[s].index?(n[c]=t[s],s++):(n[c]=t[s],o++,s++),c++;for(;ot[s].index?s++:(r++,s++,o--);return o}var s,a,l,c,h,u,d,p;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PlotRowSearchMode",function(){return h}),i.d(t,"REMOVE_INDEX_MAGIC_NUMBER",function(){return d}),i.d(t,"PlotList",function(){return p}),t.mergeMinMax=n,t.mergePlotRows=o,s=i(7),i.n(s),a=i(78),l=i(4),c=Object(l.getLogger)("Chart.PlotList"),function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(h||(h={})),u=30,d=-2e6,p=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCache=new Map,this._rowSearchCacheWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}return e.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype.first=function(){return this.size()>0?this._items[this._start]:null},e.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},e.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},e.prototype.lastIndex=function(){ return this.size()>0?this._indexAt(this._end-1):null},e.prototype.size=function(){return this._end-this._start},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.contains=function(e){return null!==this._search(e,h.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){var i,n;return this._shareRead?(c.logDebug("add: readonly collection modification attempt"),!1):(i={index:e,value:t},n=this._search(e,h.Exact),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),null===n?(this._items.splice(this._lowerbound(e),0,i),this._start=0,this._end=this._items.length,!0):(this._items[n]=i,!1))},e.prototype.search=function(e,t,i){var n,o,r,s,a;return void 0===t&&(t=h.Exact),n=i?this._rowSearchCacheWithoutEmptyValues:this._rowSearchCache,void 0!==(o=n.get(e))&&void 0!==(r=o.get(t))?r:null===(s=this._search(e,t,i))?null:(a={index:this._indexAt(s),value:this._valueAt(s)},void 0===o&&(o=new Map,n.set(e,o)),o.set(t,a),a)},e.prototype.fold=function(e,t){var i,n,o,r=t;for(i=this._start;i=r;--i)if(n=this._indexAt(i),o=this._valueAt(i),e(n,o))return{index:n,value:o};return null},e.prototype.each=function(e){var t,i,n;for(t=this._start;tthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)},e.prototype.addTail=function(e,t){var i,n,o,r;for(void 0===t&&(t=!1),i=0,t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value),n=i;n0?i[0]:null)},e.prototype.state=function(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},e.prototype.restoreState=function(e){if(!e)return void this.clear();this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype._indexAt=function(e){return this._items[e].index},e.prototype._valueAt=function(e){return this._items[e].value},e.prototype._length=function(){return this._items.length},e.prototype._search=function(e,t,i){var n=this._bsearch(e);if(null===n&&t!==h.Exact)switch(t){case h.NearestLeft:return this._searchNearestLeft(e,i);case h.NearestRight:return this._searchNearestRight(e,i);default:throw new TypeError("Unknown search mode")}if(!i||null===n||t===h.Exact)return n;switch(t){case h.NearestLeft:return this._nonEmptyNearestLeft(n);case h.NearestRight:return this._nonEmptyNearestRight(n);default:throw new TypeError("Unknown search mode")}},e.prototype._nonEmptyNearestRight=function(e){for(var t=Object(s.ensureNotNull)(this._emptyValuePredicate);e=this._start&&t(this._valueAt(e));)e-=1;return ethis._start&&(n-=1),i=n!==this._end&&this._indexAt(n)e},this._start,this._end)},e.prototype._plotMinMax=function(e,t,i){var n,o,r,s=null,a=this._plotFunctions.get(i.name);if(void 0===a)throw Error('Plot "'+i.name+'" is not registered');for(n=e;ns.max&&(s.max=r)));return s},e.prototype._invalidateCacheForRow=function(e){var t=Math.floor(e.index/u);this._minMaxCache.forEach(function(e){return e.delete(t)})},e.prototype._prepend=function(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]},e.prototype._append=function(e){return Object(s.assert)(!this._shareRead,"collection should not be readonly"),Object(s.assert)(0!==e.length,"plotRows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]},e.prototype._updateLast=function(e){Object(s.assert)(!this.isEmpty(),"plot list should not be empty");var t=this._items[this._end-1];Object(s.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._rowSearchCache.delete(e.index),this._rowSearchCacheWithoutEmptyValues.delete(e.index),this._items[this._end-1]=e},e.prototype._merge=function(e){return Object(s.assert)(0!==e.length,"plot rows should not be empty"),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),this._minMaxCache.clear(),this._items=o(this._items,e),this._start=0,this._end=this._items.length,e[0]},e.prototype._minMaxOnRangeCachedImpl=function(e,t,i){var o,r,a,l,c,h,d,p,_,f,m,y,g,v,S,b;if(this.isEmpty())return null;for(o=null,r=Object(s.ensureNotNull)(this.firstIndex()),a=Object(s.ensureNotNull)(this.lastIndex()),l=e-i.offset,c=t-i.offset,l=Math.max(l,r),c=Math.min(c,a),h=Math.ceil(l/u)*u,d=Math.max(h,Math.floor(c/u)*u),p=this._lowerbound(l),_=this._upperbound(Math.min(c,h,t)),f=this._plotMinMax(p,_,i),o=n(o,f),m=this._minMaxCache.get(i.name),void 0===m&&(m=new Map,this._minMaxCache.set(i.name,m)),y=Math.max(h+1,l);yt-i.offset&&(o=n),this._plotMinMax(n,o,i)},e}()},function(e,t,i){"use strict" ;function n(e){this._invalidationLevel=e||n.UPDATE_CURSOR_ONLY,this._invalidatedPanes={}}n.UPDATE_CURSOR_ONLY=1,n.LIGHT_UPDATE=2,n.FULL_UPDATE=3,n.prototype.invalidatePane=function(e,t){this._invalidatedPanes[e]?this._invalidatedPanes[e]=Math.max(this._invalidatedPanes[e],t):this._invalidatedPanes[e]=t},n.prototype.invalidateAll=function(e){this._invalidationLevel=Math.max(this._invalidationLevel,e)},n.prototype.fullInvalidation=function(){return this._invalidationLevel},n.prototype.invalidateForPane=function(e){return this._invalidatedPanes[e]?Math.max(this._invalidatedPanes[e],this._invalidationLevel):this._invalidationLevel},n.prototype.merge=function(e){this.force=this.force||e.force,this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel);for(var t in e._invalidatedPanes)this._invalidatedPanes[t]?this._invalidatedPanes[t]=Math.max(this._invalidatedPanes[t],e._invalidatedPanes[t]):this._invalidatedPanes[t]=e._invalidatedPanes[t]},n.prototype.exclude=function(e){this._invalidationLevel<=e&&(this._invalidationLevel=0);for(var t in this._invalidatedPanes)this._invalidatedPanes[t]<=e&&(this._invalidatedPanes[t]=0)},e.exports=n},function(e,t,i){"use strict";(function(t){function n(e,t,i,n){this._map=$.extend({},this._map,n),t&&(t=this.unpackLevels(t)),r.call(this,e,t,i),this.updateCollectibleProperty()}var o=i(12).isSameType,r=i(3).DefaultProperty,s=i(536);inherit(n,r),n.prototype.state=function(e,i){e=e||[],e.push("__collectibleLines");var n=t.prototype.state.call(this,e);return i?n:this.packLevels(n)},n.prototype.clone=function(){var e=this.state();return this.__collectibleLines&&(e.__collectibleLines=this.__collectibleLines.state()),new n(this._defaultName,e)},n.prototype.merge=function(e,i){var n=t.prototype.merge.call(this,this.unpackLevels(e),i);return this.updateCollectibleProperty(),n},n.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},n.prototype._packLvlTpl=function(){return[]},n.prototype._unpackLvlTpl=function(){return{}},n.prototype._packLvlFill=function(e,t,i,n){return n.push(i[t]),n},n.prototype._unpackLvlFill=function(e,t,i,n){return n[t]=i[e],n},n.prototype._iterateLevels=function(e,t){var i,n,r,s,a;for(i in this._map.prefixes)for(n=(this._map.prefixes[i]||"")+"level",r=this._map.range[0];r<=this._map.range[1];r++)if(e[n+r]&&o(e[n+r],t.typecheck())){s=t.tpl();for(a in this._map.names)s=t.fill(a,this._map.names[a],e[n+r],s);e[n+r]=s}return e},n.prototype.packLevels=function(e){return this._iterateLevels(e,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},n.prototype.unpackLevels=function(e){return this._iterateLevels(e,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},n.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},n.prototype.updateCollectibleProperty=function(){var e,t;this.__collectibleLines&&(e=this,t=[], this.__collectibleLines._childs.forEach(function(i){var n,o=e.__collectibleLines[i].value(),r=o.split("."),s=e[r[0]];for(n=1;n16)throw new TypeError("invalid length");return 0===t?""+e:("0000000000000000"+e).slice(-t)}var o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"customFormatters",function(){return a}),i.d(t,"formatterOptions",function(){return l}),t.numberToStringWithLeadingZero=n,i.d(t,"PriceFormatter",function(){return h}),i(11),o=i(12),i.n(o),r=i(4),s=Object(r.getLogger)("Chart.PriceFormatter"),a={dateFormatter:null,timeFormatter:null},l={decimalSign:".",decimalSignFractional:"'"},c={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),secondFraction:$.t("Second fraction part is invalid.")},h=function(){function e(e,t,i,n){if(this.type="price",t||(t=1),Object(o.isNumber)(e)&&Object(o.isInteger)(e)||(e=100),e<0)throw new TypeError("invalid base");if(this._priceScale=e,this._minMove=t,this._minMove2=n,i&&void 0!==n&&n>0&&2!==n&&4!==n&&8!==n)return void s.logDebug("invalid minmove2");this._fractional=i,this.calculateDecimal()}return e.prototype.isFractional=function(){return!!this._fractional},e.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},e.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var e=this._priceScale;for(this._fractional&&this._minMove2&&(e/=this._minMove2);e>1;)e/=10,this._fractionalLength++}},e.prototype.format=function(e,t,i,n){void 0===n&&(n=!0);var o="";return e<0?(o=!0===t?"−":!1===n?"":"-",e=-e):e&&!0===t&&(o="+"),this._fractional?o+this._formatAsFractional(e,i):o+this._formatAsDecimal(e,i)},e.prototype.parse=function(e){return this._fractional?this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e):this._parseAsDecimal(e)},e.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},e.serialize=function(e){return e.state()},e.deserialize=function(t){return new e(t.priceScale,t.minMove,t.fractional,t.minMove2)},e.prototype._formatAsDecimal=function(e,t){var i,o,r,s,a;return t=t||0,i=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,t)*this._priceScale/this._minMove,o=Math.floor(e),r=+(Math.round(e*i)-o*i).toFixed(this._fractionalLength),r>=i&&(r-=i,o+=1),s="",1!==i&&(a=void 0!==this._fractionalLength?this._fractionalLength:NaN,s=l.decimalSign+n(+r.toFixed(this._fractionalLength)*this._minMove,a+t),s=this._removeEndingZeros(s,t)),""+o+s},e.prototype._formatAsFractional=function(e,t){ var i,o,r,s,a,c,h,u,d,p=this._priceScale/this._minMove,_=Math.floor(e),f=t?Math.floor(e*p)-_*p:Math.round(e*p)-_*p;if(f===p&&(f=0,_+=1),i="",t&&(o=(e-_-f/p)*p,o=Math.round(o*Math.pow(10,t)),i=n(o,t),i=this._removeEndingZeros(i,t)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return r="",this._minMove2?(s=["0","5"],a=["0","2","5","7"],c=["0","1","2","3","4","5","6","7"],h=f%this._minMove2,f=(f-h)/this._minMove2,u=n(f,this._fractionalLength),d=2===this._minMove2?s[h]:8===this._minMove2?c[h]:a[h],r=u+l.decimalSignFractional+d):r=n(f*this._minMove,this._fractionalLength),""+_+l.decimalSignFractional+r+i},e.prototype._removeEndingZeros=function(e,t){for(var i=0;i=r||s<0?{error:c.fraction,res:!1}:(t=o+s/r,n&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:c.custom,res:!1})},e.prototype._parseAsDoubleFractional=function(e){var t,i,n,o,r,s,a,h,u,d=RegExp(/^(\-?)[0-9]+$/),p=d.exec(e);return p?(t=parseFloat(e),{price:t,res:!0,suggest:this.format(t)}):(i=RegExp("^(-?)([0-9]+)\\"+l.decimalSignFractional+"([0-9]+)\\"+l.decimalSignFractional+"([0-9]+)$"),p=i.exec(e),p?(n=!!p[1],o=parseInt(p[2]),r=void 0!==this._minMove2?this._minMove2:NaN,s=this._priceScale/r,a=this._minMove2,h=this._patchFractPart(parseInt(p[3]),s),u=this._patchFractPart(parseInt(p[4]),a),h>=s||h<0?{error:c.fraction,res:!1}:void 0!==a&&u>=a||u<0?{error:c.secondFraction,res:!1}:(t=void 0!==a?o+h/s+u/(s*a):NaN,n&&(t=-t),{price:t,res:!0,suggest:this.format(t)})):{error:c.custom,res:!1})},e}()},,,,function(e,t,i){"use strict";(function(t){var n=i(669).StudyError,o=i(78),r=i(12).inherit,s=1e-10,a=function(){function e(e,t,i,n,o){var r,s=o,a=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(r=0;r1&&(this._currentIndex.set(r), this._currentValue.set(s),this._pivotIndex.set(a))}function c(e,t,i){var n,o,r,s,a;this._deviation=e,n=i.new_var(x.high(i)),o=i.new_var(x.low(i)),n.get(2*t+1),o.get(2*t+1),this._pivotHigh=new l(t,t,l.HIGH,n,i),this._pivotLow=new l(t,t,l.LOW,o,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=x.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),s=this._lastVal.get(1),a=this._lastType.get(1),this._index>1&&this.addPivot(r,s,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function h(e){this.symbol=e,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function u(e){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=e}function d(e){u.call(this,e),this.hist=new Float64Array(2e3),this.hist_pos=-1}function p(e,t){this.timezone=e||"America/New_York",this.session=t||"0000-0000"}function _(e,t,i,n,o,r){this.periodBase=i,this.tickerid=e,this.period=t,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new T.Session,this.other_sessions={},this.script=n,this.ticker=_.parseTicker(e);var s=_.parsePeriod(t);this.resolution=s.resolution,this.interval=s.interval,this.bb_cache={},this.minTick=o,this.periodForInitialRange=r}function f(e,t,i,n,o,r,s,a,l,c){this.body=r,this.symbols=[],this.runner=o,this.inputCallback=a,this.out=s,this.nonseriesOut=c,this.ctx=new h(this.add_sym(e,t,i,l,n)),this.init()}function m(e){this.symbols=[],this.barsets=[],this.subscription=[],this.host=e,this.isRecalculated=!1,this.start()}function y(e){m.feed=e}function g(e){this.runner=new m(e)}function v(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0}function S(e,t){this.period=e,this.generateEmptyBars=!!t}function b(){}var w="undefined"!=typeof window?window:t,P=w.PineJsCalendar?w.PineJsCalendar:i(35),T=i(37),x={};return x.max_series_default_size=10001,x.n=function(e){return e.symbol.index+1},x.nz=function(e,t){return t=t||0,isFinite(e)?e:t},x.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},x.isZero=function(e){return Math.abs(e)<=1e-10},x.toBool=function(e){return isFinite(e)&&!x.isZero(e)},x.eq=function(e,t){return x.isZero(e-t)},x.neq=function(e,t){return!x.eq(e,t)},x.ge=function(e,t){return x.isZero(e-t)||e>t},x.gt=function(e,t){return!x.isZero(e-t)&&e>t},x.lt=function(e,t){return!x.isZero(e-t)&&es},x.less=function(e,t){return t-e>s},x.max=Math.max,x.min=Math.min,x.pow=Math.pow,x.abs=Math.abs,x.log=Math.log,x.log10=function(e){return Math.log(e)/Math.LN10}, x.sqrt=Math.sqrt,x.sign=function(e){return isNaN(e)?NaN:x.isZero(e)?0:e>0?1:-1},x.exp=Math.exp,x.sin=Math.sin,x.cos=Math.cos,x.tan=Math.tan,x.asin=Math.asin,x.acos=Math.acos,x.atan=Math.atan,x.floor=Math.floor,x.ceil=Math.ceil,x.round=Math.round,x.avg=function(e,t,i,n,o,r){var s,a;if(2===arguments.length)return(e+t)/2;for(s=0,a=0;a=0;--r)(s=t[r])>=i.sessionStart||(i.moveTo(s),a=t[r+1],n.push(a));n.reverse()}return n},x.iff=function(e,t,i){return x.not(e)?i:t},x.rising=function(e,t){for(var i=1;ie.get(0))return 0;return 1},x.falling=function(e,t){for(var i=1;i=0;n--)o=t-n,r+=o*e.get(n);return 2*r/(t*(t+1))},x.vwma=function(e,t,i){var n=i.new_var(x.volume(i)),o=i.new_var(e.get(0)*x.volume(i));return x.sma(o,t,i)/x.sma(n,t,i)},x.swma=function(e,t){return(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6},x.lowestbars=function(t,i,n){return-e(t,i,n,function(e,t){return x.lt(e,t)},Number.MAX_VALUE).index},x.lowest=function(t,i,n){return e(t,i,n,function(e,t){return x.lt(e,t)},Number.MAX_VALUE).value},x.highestbars=function(t,i,n){return-e(t,i,n,function(e,t){return x.gt(e,t)},Number.MIN_VALUE).index},x.highest=function(t,i,n){return e(t,i,n,function(e,t){return x.gt(e,t)},Number.MIN_VALUE).value},x.cum=function(e,t){var i=t.new_var(),n=x.nz(i.get(1))+e;return i.set(n),n},x.accdist=function(e){var t=x.high(e),i=x.low(e),n=x.close(e),o=x.volume(e);return x.cum(n===t&&n===i||t===i?0:o*(2*n-i-t)/(t-i),e)},x.correlation=function(e,t,i,n){var o=x.sma(e,i,n),r=x.sma(t,i,n),s=n.new_var(e.get()*t.get());return(x.sma(s,i,n)-o*r)/Math.sqrt(x.variance2(e,o,i)*x.variance2(t,r,i))},x.stoch=function(e,t,i,n,o){var r=x.highest(t,n),s=x.lowest(i,n);return x.fixnan(a(e.get()-s,r-s),o)},x.tsi=function(e,t,i,n){var o=n.new_var(x.change(e)),r=n.new_var(x.abs(x.change(e))),s=n.new_var(x.ema(o,i,n)),a=n.new_var(x.ema(r,i,n));return x.ema(s,t,n)/x.ema(a,t,n)},x.cross=function(e,t,i){function n(e){return e<0?-1:0===e?0:1}if(isNaN(e)||isNaN(t))return!1;var o=i.new_var(n(e-t));return!isNaN(o.get(1))&&o.get(1)!==o.get()},x.linreg=function(e,t,i){var n,o,r,s,a,l,c=0,h=0,u=0,d=0;for(n=0;nthis._currentValue.get():ithis._areaRight},l.prototype.update=function(){var e,t;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(e=!0,t=0;tn:tthis._deviation&&this.addPivot(e,t,i)))},c.prototype.processPivot=function(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())},x.zigzag=function(e,t,i){return new c(e,t,i).lastPrice()},x.zigzagbars=function(e,t,i){var n=new c(e,t,i);return-1===n.lastIndex()?NaN:n.lastIndex()-x.n(i)},h.prototype.new_sym=function(e,t,i,n){return this.symbol.script.add_sym(e,t,i,void 0,n)},h.prototype.select_sym=function(e){this.symbol=this.symbol.script.get_sym(e)},h.prototype.new_var=function(e){var t,i=this.vars;return i.length<=this.vars_index&&i.push(new u(this.symbol)),t=i[this.vars_index++],arguments.length>0&&t.set(e),t},h.prototype.new_unlimited_var=function(e){var t,i=this.vars;return i.length<=this.vars_index&&i.push(new d(this.symbol)),t=i[this.vars_index++],arguments.length>0&&t.set(e),t},h.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new h(this.symbol)),this.ctx[this.ctx_index++]},h.prototype.prepare=function(e){var t,i;for(this.ctx_index=0,this.vars_index=0,t=0;ti&&(i=t);return i},h.prototype.stop=function(){this.symbol=null,this.vars=null},u.prototype.valueOf=function(){return this.get(0)},u.prototype.get=function(e){return isNaN(e)&&(e=0),e=e||0,this.hist?e>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(e):(this.mindepth=x.max(this.mindepth,e),NaN)},u.prototype._get=function(e){var t=this.hist_pos-e;return t<0&&(t+=this.hist.length),this.hist[t]},u.prototype.set=function(e){this.hist&&(this.hist[this.hist_pos]=e,this.modified=!0)},u.prototype.prepare=function(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},u.prototype.add_hist=function(){var e,t,i;if(!this.hist){for(e=x.na(this.mindepth)?x.max_series_default_size:x.max(this.mindepth+1,1),e=Math.round(e),t=Array(e),i=0;i=0,i&&(o=t.split(","),n=_.parsePeriod(o[1]),t=o[0]),r=!1,s=!1,a=t[t.length-1],-1==="DWM".indexOf(a)&&("S"===a?s=!0:(r=!0,a="")),l=parseInt(r?t:t.length>1?t.slice(0,t.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:r,isSeconds:s,range:n}},_.newBarBuilder=function(e,t,i){var n=_.parsePeriod(e);return T.newBarBuilder(n.interval+n.resolution,t,i)},_.newSession=function(e,t){var i=P.get_timezone(e);return(new T.Session).init(i,t)},_.prototype.set_symbolinfo=function(e){e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.timezone=P.get_timezone(e.timezone),this.session.init(this.timezone,e.session);for(var t in this.other_sessions)this.other_sessions.hasOwnProperty(t)&&this.other_sessions[t].init(this.timezone,t)},_.prototype.get_session=function(e){if(!e)return this.session;var t=this.other_sessions[e];return t||(t=new T.Session,this.other_sessions[e]=t),t},_.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},_.prototype.enable_dwm_aligning=function(e,t){this.dwm_aligner=_.newBarBuilder(this.period,e,t)},_.prototype.bartime=function(e,t){var i,n,o,r,s=this.time;return e&&(i=e,t&&(i+=t),n=this.bb_cache[i],n||(o=this.get_session(t),n=_.newBarBuilder(e,o),this.bb_cache[i]=n),s=n.alignTime(s)),!this.isdwm()||isNaN(s)?s:(r=P.utc_to_cal(this.timezone,s),this.session.spec.correctTradingDay(r,this.timezone),P.cal_to_utc(this.timezone,r))},_.prototype.lastbar=function(e){var t,i;isNaN(e.time)||(t=e.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0)),i=this.time!==t,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=e.volume,this.updatetime=e.updatetime,this.isNewBar=i,this.isBarClosed=e.isBarClosed,this.isLastBar=e.isLastBar,this.isNewBar&&this.index++,this.script.calc(this))},f.prototype.calc=function(e){var t,i,n=this.ctx,o=this.body;n.prepare(e),t=o.main(n,this.inputCallback),i=this,this.out&&t&&(!isNaN(n.symbol.time)||t.nonseries)&&(t.nonseries?("projection"===t.type&&(t.projectionTime=n.symbol.time),this.nonseriesOut(n.symbol,t)):t.bars?t.bars.forEach(function(e){i.out(n.symbol,e)}):this.out(n.symbol,t))},f.prototype.init=function(){var e=this.ctx,t=this.body;t.init&&t.init(e,this.inputCallback),t.main(e,this.inputCallback)},f.prototype.add_sym=function(e,t,i,n,o){var r=this.runner.add_sym(e,t,i,this,n,o);return this.symbols.push(r),r.isdwm()&&this.symbols.length>1&&r.enable_dwm_aligning(this.symbols[0].session,r.session),r},f.prototype.maxAdditionalDepth=function(){return this.ctx.maxAdditionalDepth()},f.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},f.prototype.get_sym=function(e){return this.symbols[e]}, m.prototype.add_sym=function(e,t,i,n,o,r){var s=new _(e,t,i,n,o,r);return this.symbols.push(s),s},m.prototype.get_sym=function(e){return this.symbols[e]},m.prototype.out=function(e,t){if(this.nonseriesUpdate){var i=$.extend({},this.nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)},m.prototype.start=function(){function e(e,n){var r=m.feed.subscribe(e.tickerid,e.period,e.periodBase,e.periodForInitialRange,function(i){"series"==(i.nonseries?"nonseries":"series")?t.update(n,i):i.lastBar?(t.nonseriesUpdate=i,i.lastBar.isLastBar=!0,t.symbols[0].lastbar(i.lastBar),t.nonseriesUpdate=null):s.nonseriesOut(e,i)},s.onErrorCallback,s.symbolInfo,s.sessionId,s.rangeExtension,o);i.push(r)}var t,i,n,o,r,s=this.host;for(this._script=new f(s.tickerid,s.period,s.periodBase||s.period,s.periodForInitialRange,this,s.body,this.out.bind(this),s.input,s.symbolInfo.minmov/s.symbolInfo.pricescale,s.nonseriesOut),t=this,i=[],n=this.symbols,o=(s.additionalBarsCount||0)+t._script.maxAdditionalDepth(),r=0;r=0;t--)for(i=a[t],n=this.barsets[t],o=n.count(),r=0;rn.CURRENT_METAINFO_FORMAT_VERSION&&r.logWarn("Client doesn't support this version of metainfo format: "+t),t},n.parseIdString=function(e){var t,i,n,o,r={};if(-1===e.indexOf("@"))r.shortId=e,r.packageId="tv-basicstudies",r.id=e+"@"+r.packageId,r.version=1;else if(t=e.split("@"),r.shortId=t[0],i=t[1].split("-"),3===i.length)r.packageId=i.slice(0,2).join("-"),r.id=r.shortId+"@"+r.packageId,r.version=i[2];else if(1===i.length&&"decisionbar"===i[0])r.packageId="les-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1;else{if(1!==i.length)throw Error("unexpected study id:"+e);r.packageId="tv-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1}return r.fullId=r.id+"-"+r.version,"tv-scripting"===r.packageId?(n=r.shortId,0===n.indexOf("Script$")||0===n.indexOf("StrategyScript$")?(o=n.indexOf("_"),r.productId=o>=0?n.substring(0,o):r.packageId):r.productId=r.packageId):r.productId=r.packageId,r},n.getPackageName=function(e){return(/^[^@]+@([^-]+-[^-]+)/.exec(e||"")||[0,"tv-basicstudies"])[1]},n.cutFullId=function(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")},n.cutDollarHash=function(e){var t,i,n=e.indexOf("$"),o=e.indexOf("@");return-1===n?e:(t=e.substr(0,n), i=o>=0?e.substr(o):"",t+i)},n.cutScriptIdPart=function(e){var t=e.indexOf("$"),i=e.indexOf("@");return t<0&&i>=0?"":e.substring(Math.max(t+1,0),i>=0?i:e.length)},n.hasUserIdSuffix=function(e){return/^USER;[\d\w]+;\d+$/.test(e)},n.isStandardPine=function(e){return/^(Strategy)?Script\$STD;.*@tv-scripting$/.test(e)},n.getSourceIdByInputs=function(e,t){var i,o,r;if(!Array.isArray(e)||!t)return null;for(i=0;i0&&(l=a.replace(/^[^\$]+/,i),o.inputs[s.id].setValue(l)))},n.patchChildStudyMetaInfoState=function(e){function t(e){if("object"==typeof e)for(var i in e)"string"==typeof e[i]&&/^[^\$]+\$\d+$/.test(e[i])?e[i]=e[i].replace(/^[^\$]+/,"{pid}"):t(e[i])}e.state&&t(e.state.inputs),e.state.isChildStudy=!0},n.prototype.parseValue=function(e,t){return"bool"===e?TradingView.parseBool(t):t},n.prototype.defaultInputs=function(){var e,t=[];for(e=0;e0?e[0].id:null},n.findStudyMetaInfoByDescription=function(e,t){if(e){for(var i=0;i100)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;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, 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&&(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=0&&(e="_v"+this._metaInfo.pine.version),{symbol:this.series().actualSymbol(),resolution:this.series().interval(),study:this._metaInfo.shortId+e}},y.prototype._sendTelemetryReport=function(e,t,i){void 0===i&&(i=this._getTelemetryAdditionalData());var n=Object.assign(t,{additional:i});telemetry.sendChartReport(e,n)},y.prototype._sendTelemetryCounter=function(e,t){ this._sendTelemetryReport(e,{count:1},t)},y.prototype._sendTelemetryTiming=function(e,t,i){this._sendTelemetryReport(e,{value:t},i)},y.prototype.destroy=function(){this._legendView&&this._legendView.destroy()},y.prototype.guiPlotName=function(e){var t=this.properties().styles;return t&&t[e]&&t[e].title?t[e].title.value():this.title()},e.exports={Study:y,prepareStudyProperties:l,prepareStudyPropertiesForLoadChart:h,prepareStudyPropsStateForLoadChart:p}}).call(t,i(13),i(8),i(5),i(48).PriceRange)},function(e,t,i){"use strict";function n(e){var t,i,n,o,r,s;if(this._name=e,t=p[e],t||(t={time:[],offset:[]},this._invalid=!0),t.time.length!==t.offset.length&&(t={time:[],offset:[]},this._invalid=!0),!t.time_utc){for(i=t.time,n=t.offset,o=i.length,r=Array(o),s=0;st){if((n=o-1)0&&(r=s[l-1],e-r<=n)?n:0)},n.prototype.is_valid=function(){return!this._invalid},n._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]},s=function(e){return 0|e},a=function(e){return 60*e*1e3},l=function(e){return 1e3*e},c=function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},h=function(e,t){return s(s(e/1e3)-s(t/1e3))},u={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},d={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*s(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=u[t];return t>1&&r(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,n=d.get_day_of_year(e),o=n-i;return Math.ceil(o/7)+1},get_minutes_from_midnight:function(e){return 60*d.get_hours(e)+d.get_minutes(e)},set_hms:function(e,t,i,n,o,r){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(o),d.correct_time(e,r)},correct_time:function(e,t){var i=e.getTime(),n=t.correction_loc(i) ;e.setTime(i+n)},add_days_considering_dst:function(e,t,i){var n,o=e.offset_utc(t),r=this.clone(t);return this.add_date(r,i),n=e.offset_utc(r),r.setTime(r.getTime()+o-n),r},add_date:function(e,t){e.setTime(e.getTime()+t*d.secondsPerDay)},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return e%4!=0||e%100==0&&e%400!=0?365:366},get_part:function(e,t){switch(t){case d.YEAR:return d.get_year(e);case d.MONTH:return d.get_month(e);case d.DAY_OF_MONTH:return d.get_day_of_month(e);case d.WEEK_OF_YEAR:return d.get_week_of_year(e);case d.DAY_OF_WEEK:return d.get_day_of_week(e);case d.HOUR_OF_DAY:return d.get_hours(e);case d.MINUTE:return d.get_minutes(e);case d.DAY_OF_YEAR:return d.get_day_of_year(e);case d.SECOND:return d.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:l,time_minutes_diff:c,time_seconds_diff:h,utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n){var o=new Date(Date.UTC(t,i,n)),r=e.offset_utc(+o);return new Date(o.valueOf()-r)},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new n(e)},shift_day:function(e,t){var i=e-1;return i+=t,i>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},e.exports=d},,function(e,t,i){"use strict";(function(t){var n=i(355).ExchangeSession,o=i(15).Interval,r=i(15).ResolutionKind,s=i(5),a=function(){function e(e,t,i){var n=o.parse(e);return n.kind()===r.Hours?new p(60*n.multiplier()*60,t):n.kind()===r.Minutes?new p(60*n.multiplier(),t):n.kind()===r.Seconds?new p(n.multiplier(),t):n.kind()===r.Range?new p(60*n.multiplier(),t):new _(t,i,n.multiplier(),a(n.kind(),t))}function a(e,t){switch(e){case r.Days:return new T(t);case r.Weeks:return new x(t);case r.Months:return new C(t)}return console.error("unknown dwm resolution: "+e),null}function l(e,t,i,n,o){var r,s,a,l,c,h,u,d=(new I).init("Etc/UTC",e),p=""!==t;return p?(s=i*B[t],r=B.D):(s=60*i*1e3,r=60*d.spec.findSessionEntry(0,0).length()*1e3),a=r/s,l=p?7:7-d.spec.weekEndsCount(),c=l*a,ni||n&&e.length>n})}function h(e,t,i){return u(e,t,function(e,t){return e.length>=i})}function u(e,t,i){var n,o,r,s,a,l=t;for(e.moveTo(l),n=[],o=0,r=0;!i(n,l);){if(o>5)throw console.trace(["0x10",new Date(t),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((s=e.indexOfBar(l))===V)l=e.startOfBar(0);else if(s===D)l=e.startOfBar(D);else{if((a=e.startOfBar(s))!==t){if(r&&r===a)throw console.trace(["0x11",new Date(t),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");r=a,o=0,n.push(a)}l=e.startOfBar(s+1)}e.moveTo(l),o++}return n}function d(e){if(isNaN(e))return NaN;var t=this.indexOfBar(e);return t===D&&(this.moveTo(e),t=this.indexOfBar(e)), t<0?NaN:this.startOfBar(t)}function p(e,t){this.period=e,this.session=t,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function _(e,t,i,n){this.period=i,this.sessionTgt=e,this.sessionSrc=t||e,this.builder=n,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function f(e,t,i){var n=R.clone(i);return t.alignToSessionStart(n,e),R.cal_to_utc(e,n)}function m(e,t){var i=R.get_day_of_week(t)-e.firstDayOfWeek();return i<0?i+7:i}function y(e,t){var i=t+e.firstDayOfWeek();return i>R.SATURDAY?i-R.SATURDAY:i}function g(e,t){var i=R.get_day_of_year(t)-1,n=m(e,t)-i%7;return 0===n?L(i/7):(n>=0&&(n-=7),L((n+i)/7))}function v(e,t,i){var n,o=0;for(n=t;n0){if((o=r-1)r.start()+r.length()&&n===r.dayOfWeek()-1&&(n++,o-=1440),n===r.dayOfWeek()&&o>=r.start()&&o=this.sessionEnd?D:L(R.time_seconds_diff(e,this.sessionStart)/this.period)},p.prototype.startOfBar=function(e){if(e===D)return this.sessionEnd;if(e<0)throw Error("Negative offset is not supported");return this.sessionStart+R.time_seconds(this.period*e)},p.prototype.isLastBar=function(e,t){return t>=this.sessionStart+R.time_seconds(this.period*(e+1)-1)},p.prototype.moveTo=function(e){var t=this.session.timezone,i=R.utc_to_cal(t,e),n=this.session.spec,o=n.alignToSessionStart(i,this.session.timezone);this.sessionStart=R.cal_to_utc(t,i),this.sessionEnd=this.sessionStart+R.time_minutes(o)},_.prototype.alignTime=d,_.prototype.alignTimeIfPossible=function(e){return this.tradingDayToSessionStart(e)},_.prototype.tradingDayToSessionStart=function(e){return this.moveTo(e),this.startOfBar(0)},_.prototype.indexOfBar=function(e){return e=this.periodEnd?D:0},_.prototype.startOfBar=function(e){if(e===D||e>0)return this.periodEnd ;if(e===V)throw Error("PRE_SESSION is not supported");return this.periodStart},_.prototype.isLastBar=function(e,t){return t>=this.periodLastBarStart},_.prototype.moveTo=function(e){var t,i,n,o,r,s,a,l,c=R.utc_to_cal(this.sessionSrc.timezone,e);c=this.sessionSrc.spec.correctTradingDay(c,this.sessionSrc.timezone),t=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(c,t),-1===i&&(i*=this.period),n=L(i/this.period)*this.period,o=R.get_year(c),r=this.sessionTgt.spec,s=this.builder.startOfPeriod(t,n,o),this.periodStart=f(t,r,s),a=n+this.period,l=this.builder.startOfPeriod(t,a,o),this.periodEnd=f(t,r,l),R.add_date(l,-1),this.moveToPrevWorkDay(r,l),this.periodLastBarStart=f(t,r,l),(this.periodLastBarStart=0;++i)n=s.sessionsSpec.isWeekEnd(y(s.sessionsSpec,i)),l+=n?1:0,d-=n?0:1;return o=e.weekEnds+l,r=L((t-e.businessDays)/(7-s.sessionsSpec.weekEndsCount())),a=o+s.sessionsSpec.weekEndsCount()*r,t+a}var s,a,l,c,h;return t>=S(this.sessionsSpec,i)&&(i++,t=0),s=this,n.prototype.isIncomplete=function(){return 7!==this.calendarDays},a=new Date(Date.UTC(i,R.JANUARY,1)),l=m(this.sessionsSpec,a),c=new n(this.sessionsSpec,l),h=tl?this.startOfPeriod(e,0,i+L(a/l)):(n=R.get_cal(e,i,R.JANUARY,1),o=R.add_days_considering_dst(e,n,a),R.utc_to_cal(e,+o))},C.prototype.indexOfPeriod=function(e){return R.get_month(e)},C.prototype.startOfPeriod=function(e,t,i){var n;return t<0?(n=L((11-t)/12),i-=n,t+=12*n):t>R.DECEMBER&&(i++,t=R.JANUARY),R.get_cal_utc(i,t,1) },I.prototype.init=function(e,t){return this.timezone="string"==typeof e?R.get_timezone(e):e,this.spec=new n(t),this},M=(new I).init("Etc/UTC","0000-0000:1234567"),{PRE_SESSION:V,POST_SESSION:D,LASTBAR_SESSION:-3,newBarBuilder:e,Session:I,alignPeriodsBack:l,extrapolateBarsFrontByCount:h,extrapolateBarsFrontToTime:c,lower_bound:k,isTradingNow:E,numberOfFullWeeks:g,numberOfWeekEndsSinceYearStart:b,BusinessDaysBuilder:P,alignExchangeTimeToSessionStartAndReturnUTC:f,createDWMAligner:A}}();e.exports=a}).call(t,i(98))},function(e,t,i){"use strict";function n(e){return""!==e&&h&&void 0!==e&&null!==e?u+e:e}function o(e){return""!==e&&h&&void 0!==e&&null!==e?d+e+_:e}function r(e){return""!==e&&h&&void 0!==e&&null!==e?p+e+_:e}function s(e){return Object(c.getNormalizedScrollLeft)(e,"rtl")}function a(e,t){var i=Object(c.detectScrollType)();if("indeterminate"===i)return 0;switch(i){case"negative":t=e.clientWidth-e.scrollWidth+t;break;case"reverse":t=e.scrollWidth-e.clientWidth-t}return t}function l(e){var t=f.exec(e);return t?m.test(t[0])?"rtl":"ltr":""}var c,h,u,d,p,_,f,m;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"IS_RTL",function(){return h}),t.startWithLTR=n,t.forceLTRStr=o,t.forceRTLStr=r,t.getLTRScrollLeft=s,t.getLTRScrollLeftOffset=a,t.detectAutoDirection=l,c=i(472),i.n(c),h="rtl"===document.dir,u="‎",d="‪",p="‫",_="‬",f=/[^\u0000-\u0040\u005B-\u0060\u007B-\u00BF\u00D7\u00F7\u02B9-\u02FF\u2000-\u200E\u2010-\u2029\u202C\u202F-\u2BFF]/,m=/[\u0590-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]/},function(e,t,i){"use strict";function n(e,t,i){var n,o,s;for(t=t||e||i||"",n="",o=0;o0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth, this._textImageHeight=this._textCache.textImageHeight)}var o=i(6).Point,r=i(9).HitTestResult;n.prototype.draw=function(e){this.drawShape(e),this.drawText(e)},n.prototype.drawShape=function(e){throw Error("Not implemented")},n.prototype.drawText=function(e){var t,i,n,o,r,s;if(this._textCache)for(t=0,i=this.items.length;t0?"top":"bottom")},n.prototype.hitTest=function(e,t){var i,n,s,a,l,c,h,u,d,p,_,f,m,y=Math.max(this.height,this.width),g=this._vertOffset,v=this._textVertOffset;for(t=t||r.REGULAR,n=0;n0?0:-this._textImageHeight,h=g>0?this._textImageHeight:0,u=e.x,d=e.y,p=s.x-a,_=l+c,f=s.x+a,m=l+h,u>p&&u_&&d").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=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(99),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(){ 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}, n.isOnFeaturePage=i(),n.wrapUrl=function(e){return t.enabled("charting_library_base")&&(e=e.replace("/static/","")),e},n.isMobile=function(){var e=/Android/i.test(navigator.userAgent),t=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),n=/Opera Mini/i.test(navigator.userAgent),o=e||t||i||n;return{Android:function(){return e},BlackBerry:function(){return t},iOS:function(){return i},Opera:function(){return n},any:function(){return o}}}(),n.supportTouch=function(){return Modernizr.touch||n.isMobile.any()},n.onWidget=function(){var e,t,i=["^widgetembed/?$","^cmewidgetembed/?$","^([0-9a-zA-Z-]+)/widgetembed/?$","^([0-9a-zA-Z-]+)/widgetstatic/?$","^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$","^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$","^embed(-static)?/([0-9a-zA-Z]{8})/?$","^widgetpopup/?$","^extension/?$","^chatwidgetembed/?$","^ideaswidgetembed/?$","^ideas-widget/?$","^view-idea-widget/([0-9a-zA-Z]{8})/?$","^user-info-widget/?$","^user-info-widget-get/(.+?)?/?$","^embed-quotes-provider/?$","^idea-popup/?$","^hotlistswidgetembed/?$","^([0-9a-zA-Z-]+)/hotlistswidgetembed/?$","^marketoverviewwidgetembed/?$","^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$","^eventswidgetembed/?$","^tickerswidgetembed/?$","^forexcrossrateswidgetembed/?$","^forexheatmapwidgetembed/?$","^marketquoteswidgetembed/?$","^screenerwidget/?$","^cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/marketquoteswidgetembed/?$","^technical-analysis-widget-embed/$","^singlequotewidgetembed/?$"],n=window.location.pathname.replace(/^\//,"");for(t=i.length-1;t>=0;t--)if(e=RegExp(i[t]),e.test(n))return!0;return!1},n.onOrder=function(){return"/order/"===window.location.pathname},e.exports.CheckMobile=n.isMobile,e.exports.isOnFeaturePage=i,e.exports.onWidget=n.onWidget,e.exports.supportTouch=n.supportTouch}).call(t,i(5))},function(e,t,i){"use strict";function n(){var e=new Map;return c.forEach(function(t,i){e.set(t,o(t))}),e}function o(e){return l[e]}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimePointIndexSearchMode",function(){return a}),t.seriesPlotFunctionMap=n,t.barFunction=o,i.d(t,"SeriesData",function(){return h}),r=i(7),i.n(r),s=i(17),function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(a||(a={})),l={open:function(e){return e[1]},high:function(e){return e[2]},low:function(e){return e[3]},close:function(e){return e[4]},hl2:function(e){return(e[2]+e[3])/2},hlc3:function(e){return(e[2]+e[3]+e[4])/3},ohlc4:function(e){return(e[1]+e[2]+e[3]+e[4])/4}},c=["open","high","low","close","hl2","hlc3","ohlc4"],h=function(){function e(){this.m_bars=new s.PlotList(n()),this.m_nsBars=new s.PlotList(n())}return e.prototype.bars=function(){return this.m_bars},e.prototype.nsBars=function(){return this.m_nsBars},e.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},e.prototype.each=function(e){this.m_bars.each(e),this.m_nsBars.each(e)},e.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0}, e.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},e.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},e.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},e.prototype.search=function(e,t){return this.nsBars().isEmpty()?this.bars().search(e,t):this.bars().isEmpty()?this.nsBars().search(e,t):Object(r.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t):this.bars().search(e,t)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.plotValueToTimePointIndex=function(e,t,i){var n,o,r,s;if(i===a.FromRight)return n=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e>=o},null!==(o=this.m_bars.findLast(n))?o.index:(r=this.m_nsBars.findLast(n),null!==r?r.index:this.m_bars.firstIndex());if(i===a.FromLeft)return s=function(i,n){var o=n[t];return void 0!==o&&null!==o&&e<=o},null!==(o=this.m_bars.findFirst(s))?o.index:(r=this.m_nsBars.findFirst(s),null!==r?r.index:this.m_bars.lastIndex());throw Error("plotValueToTimePointIndex: unsupported search mode")},e}()},function(e,t,i){"use strict";function n(e,t,i,n,r){Object(l.assert)(o(e),"Unknown line tool: "+e);var s=Object(l.ensureDefined)(h[e]);return"LineToolVbPFixed"===e?new s(t,i,n,r):"LineToolRegressionTrend"===e?new s(t,i,n):["LineStudyMtpAnalysis","LineStudyMtpDecisionPoint","LineStudyMtpRiskReward","LineStudyMtpElliotWaveMain","LineStudyMtpElliotWaveMajor","LineStudyMtpElliotWaveMinor","LineStudyMtpDownWave1OrA","LineStudyMtpDownWave2OrB","LineStudyMtpDownWave3","LineStudyMtpDownWave4","LineStudyMtpDownWave5","LineStudyMtpDownWaveC","LineStudyMtpUpWave1OrA","LineStudyMtpUpWave2OrB","LineStudyMtpUpWave3","LineStudyMtpUpWave4","LineStudyMtpUpWave5","LineStudyMtpUpWaveC"].indexOf(e)>=0?new s(t,i,n):new s(t,i)}function o(e){return e in h}function r(e){return e instanceof c.LineDataSource}function s(e){var t=!1;return t}function a(e){var t=!1;return t}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.createLineTool=n,t.isLineToolName=o,t.isLineTool=r,t.isStudyLineToolName=s,t.isStudyLineTool=a,l=i(7),i.n(l),c=i(0),i.n(c),h=i(45),i.n(h)},,,,,function(e,t,i){"use strict";function n(e,t){return e>1,a=n+s,i(e[a],t)?(n=a+1,r-=s+1):r=s;return n}function r(e,t,i,r){return void 0===i&&(i=0),void 0===r&&(r=e.length),o(e,t,n,i,r)}function s(e,t,i,n,o){var r,s,a;for(void 0===n&&(n=0),void 0===o&&(o=e.length),r=o-n;0>1,a=n+s,i(t,e[a])?r=s:(n=a+1,r-=s+1);return n}function a(e,t,i,o){return void 0===i&&(i=0),void 0===o&&(o=e.length),s(e,t,n,i,o)}Object.defineProperty(t,"__esModule",{value:!0}),t.lowerbound=o,t.lowerbound_int=r,t.upperbound=s,t.upperbound_int=a},function(e,t,i){"use strict";function n(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)]) }.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),this.version=o.version,i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function r(e,t){this._constructor="LineToolElliottImpulse";var i=t||new p("linetoolelliottimpulse");o.call(this,e,i)}function s(e,t){this._constructor="LineToolElliottTriangle";var i=t||new p("linetoolelliotttriangle");o.call(this,e,i)}function a(e,t){this._constructor="LineToolElliottTripleCombo";var i=t||new p("linetoolelliotttriplecombo");o.call(this,e,i)}function l(e,t){var n=t||new p("linetoolelliott");u.call(this,e,n),this.version=l.version,i.e(0).then(function(e){var t=i(213).ElliottLabelsPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function c(e,t){this._constructor="LineToolElliottCorrection";var i=t||new p("linetoolelliottcorrection");l.call(this,e,i)}function h(e,t){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=t||new p("linetoolelliottdoublecombo");l.call(this,e,i)}var u=i(0).LineDataSource,d=i(41).Action,p=i(3).DefaultProperty,_=i(2).propertyPages;inherit(n,u),n.migrateState=function(e){var t={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])},n.prototype.title=function(){return"Elliott Labels"},n.prototype.name=function(){return"Elliott Labels"},n.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor",{context:"wave"}),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],n.prototype.additionalActions=function(e){var t=new d({text:$.t("Degree")}),i=this;return t.subActions=n.degrees.map(function(t,n){var o=new d({text:t,checkable:!0,checked:i.properties().degree.value()===n});return o.callbacks().subscribe(null,function(){e.setProperty(i.properties().degree,n,"Change Elliott Degree")}),o}),[t]},n.prototype.label=function(e){var t=n.degrees.length-this.properties().degree.value()-1,i=Math.floor(t/3),o=t%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][o],label:this.labelsGroup()[i][e]}},n.prototype.getStylesPropertyPage=function(){return _.LineToolElliottStylesPropertyPage},n.prototype.getDegrees=function(){return n.degrees},inherit(o,n),o.version=3,o.prototype.pointsCount=function(){return 6},o.prototype.migrateVersion=function(e,t,i){if(1===e){ var n=$.extend({},this._timePoint[0]);this._timePoint.unshift(n),this._points.length>0&&(n=$.extend({},this._points[0]),this._points.unshift(n))}},inherit(r,o),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(s,o),s._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],s.prototype.labelsGroup=function(){return s._labelsGroups},inherit(a,o),a._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,n),l.version=3,l.prototype.pointsCount=function(){return 4},l.prototype.migrateVersion=function(e,t,i){if(1===e){var n=$.extend({},this._timePoint[0]);this._timePoint.insert(n,0),this._points.length>0&&(n=$.extend({},this._points[0]),this._points.insert(n,0))}},inherit(c,l),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(h,l),h._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],h.prototype.labelsGroup=function(){return h._labelsGroups},t.LineToolElliott=n,t.LineToolElliottImpulse=r,t.LineToolElliottTriangle=s,t.LineToolElliottTripleCombo=a,t.LineToolElliottCorrection=c,t.LineToolElliottDoubleCombo=h},,function(e,t,i){"use strict";function n(e,t){e.width=t.w,e.height=t.h;var i=e.getContext("2d");i&&i.translate(.5,.5)}function o(e,t){e.width=0,n(e,t)}function r(e,t,i,n,o,r){e.save(),e.translate(-.5,-.5),e.fillStyle=r,e.fillRect(t,i,n,o),e.restore()}function s(e,t){var i=document.createElement("canvas");return e.append(i),n(i,t),i}function a(e,t){return"center"===e.textAlign?0:c.IS_RTL?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"Size",function(){return h}),t.resizeCanvas=n,t.hardResizeCanvas=o,t.clearRect=r,t.addCanvasTo=s,t.calcTextHorizontalShift=a,l=i(14),i.n(l),c=i(38),h=function(){function e(e,t){this.w=e,this.h=t}return e.prototype.equals=function(e){return this.w===e.w&&this.h===e.h},e}()},function(e,t,i){"use strict";function n(e){return new Promise(function(t){i.e(2).then(function(n){var r=i(188).createDialog;t(r(o.a({},a,e)))}.bind(null,i)).catch(i.oe)})}var o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),t.createConfirmDialog=n,o=i(1),i(11),r={key:13,name:"yes",text:window.t("Yes"),type:"success"},s={method:"close",name:"no",text:window.t("No"),type:"default"},a={actions:[r,s],actionsWrapTemplate:'
',content:window.t("Are you sure?"), contentWrapTemplate:'

',destroyOnClose:!0,title:window.t("Confirmation"),width:400}},,function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LINESTYLE_SOLID",function(){return n}),i.d(t,"LINESTYLE_DOTTED",function(){return o}),i.d(t,"LINESTYLE_DASHED",function(){return r}),i.d(t,"LINESTYLE_LARGE_DASHED",function(){return s}),i.d(t,"LINESTYLE_SPARSE_DOTTED",function(){return a}),n=0,o=1,r=2,s=3,a=4},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),n=i(12),i.n(n),o=/{(\w+)}/g,r=/{(\d+)}/g,String.prototype.format=function(){var e,t,i,s,a=[];for(e=0;ethis.timeScale().points().firstIndex()&&e.firstBar()=t.start&&r<=t.end+i&&e.push(o)}),e},r.prototype.getPublishedPlates=function(){var e={},t=this;return is_authenticated?($.each(this.getVisibleRangePlates(),function(i,n){n.is_public&&(t.pinnedTooltips[n.id]||n.user__id===user.id)&&(e[n.id]=n)}),e):e},r.prototype._maxPlatesPerBar=10,r.prototype.filterDisplayedPlates=function(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var n=e[i];return n=n.sort(function(e,t){return t.views_count-e.views_count}),n=n.slice(0,this._maxPlatesPerBar),t.concat(n)}.bind(this),[])},r.prototype._layout=function(e){ switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},r.prototype._theme=function(e){switch(e){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},r.prototype._offset=function(e,t){var i;switch(e){default:case"up":i=t[TradingView.HIGH_PLOT];break;case"down":i=t[TradingView.LOW_PLOT]}return this.priceScale().priceToCoordinate(i,this.ownerSource().firstValue())},r.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},r.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},r.prototype.barWidth=function(){return this.timeScale().barSpacing()},r.prototype.getPlatesViewData=function(){var e,t,i,n,o,r;if(this._model.mainSeries().data().isEmpty())return[];e=this.filterDisplayedPlates(this.getVisibleRangePlates()),t=this,i={},n=this._model.lastHittestData(),e=e.map(function(e){var o,r,s,a,l,c,h=this._getIndex(e.tickmark),u=this._getBar(h);return null!==u&&(o=this._layout(e.direction),r=this._theme(e.direction),s=n&&n.id===e.id,a=this.timeScale().indexToCoordinate(h),l=this._offset(o,u),c=0,h in i||(i[h]={up:0,down:0}),c=i[h][o]++,TradingView.merge({id:e.id,x:a,y:l,order:c,direction:o,theme:r,hovered:s,pinned:!0===t.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e)))}.bind(this)),e=e.filter(function(e){return!!e}),o=e.filter(function(e){return!0===e.hovered});for(r=0;rthis._loadedRange.end&&(e.start=this._loadedRange.end)),e},r.prototype._rangeUnion=function(e,t){return e=$.extend({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e},r.prototype._pushGetDataStack=function(e){if(!a(e.start)||!a(e.end))return void d.logError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)},r.prototype.roundRange=function(e){return{ start:Math.round(e.start),end:Math.round(e.end)}},r.prototype.refreshData=function(){this.getData(this._lastRange)},r.prototype.getData=function(e){if(!a(e.start)||!a(e.end))return void d.logError("Wrong range");this._lastRange=e;var e=$.extend({},e);e.end=this._maxDate,this._pushGetDataStack(e)},r.prototype._abortAllRequests=function(){this._requests.forEach(function(e){e.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},r.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=r}).call(t,i(5),i(13),i(8))},function(e,t,i){"use strict";var n=i(288),o={instances:[],createMenu:function(e,t,i){var o=new n(e,t,i);return this.instances.push(o),o},hideAll:function(){for(var e in this.instances)this.instances[e].hide()}};e.exports=o},,,,,,,,,,,function(e,t,i){"use strict";(function(t){function n(e){this._data=e,this._textWidthCache=new l}function o(e,t,i,n,o){this._model=e,this._source=t,this._plotIndex=i,this._getterName=n||"symbol",this._propertyName=o,this._cache={},this._invalidated=!0,this._rendererData={}}var r=i(24),s=r.parseRgb,a=r.rgbToBlackWhiteString,l=i(115),c=i(69).CompositeRenderer,h=i(116).makeFont,u=i(29);n.prototype.hitTest=function(e){return null},n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),e.font=this._data.font,t=this._data.fontSize,i=Math.floor(t/4.5),n=Math.ceil(t/4.5),o=Math.ceil(t/3),r=Math.ceil(this._textWidthCache.measureText(e,this._data.text)),s=Math.round(t/10),a=t+i+n,l=r+2*o,c=this._data.x-.5,"right"===this._data.align&&(c-=l),h=this._data.y-Math.floor(t/2)-i-.5,e.fillStyle=u.resetTransparency(this._data.backColor),e.fillRect(c,h,l,a),e.fillStyle=this._data.color,e.textAlign="left",e.fillText(this._data.text,c+o,h+i+t-s))},o.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var e,i,n,o,r,l,u,d,p=this._rendererData;if(p.visible=!1,p.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(e=this._source.lastValueData(this._plotIndex,t.enabled("price_scale_always_last_bar_value")),!e.noData)){if(i=this._model.paneForSource(this._source),n="right",i.leftPriceScale()===this._source.priceScale()&&(n="left"),o=this._model.properties(),r=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),r&&o.scalesProperties.showLeftScale.value()&&!o.scalesProperties.showRightScale.value()&&(n="left"),!r){if("left"===n&&!o.scalesProperties.showLeftScale.value())return new c;if("right"===n&&!o.scalesProperties.showRightScale.value())return new c}l=e.coordinate,u=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI, this._source.lastPriceLabelFixedCoordinate&&!u&&"showSymbolLabels"===!this._propertyName&&(l=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||l),e.color!==p.backColor&&(p.backColor=this._source.priceLineColor(e.color),d=a(s(p.backColor),160),p.color="black"===d?"white":"black"),p.text=this._source[this._getterName](this._plotIndex),p.visible=""!==p.text,p.align=n,p.x="right"===n?this._model.timeScale().width():0,p.y=l,p.fontSize=this._model.properties().scalesProperties.fontSize.value(),p.font=h(p.fontSize,"Arial","")}},o.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new n(this._rendererData)),this._renderer},e.exports=o}).call(t,i(5))},function(e,t,i){"use strict";function n(){var e,t,i,n;this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=0,this._canvas=$(""),this._cache=this._canvas.get(0).getContext("2d"),this._currentWidth=400,this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0),this._ctx=this._canvas.get(0).getContext("2d"),this._ctx.font=u.fontSize+"px"+u.font,e=u.fontSize,t=u.lineSpacing,i=e+t,n=3,this._padding=8,this._rowHeight=i*n-t+2*this._padding+2}function o(e,t){this._constructor="LineToolTrendLine";var o=t||new a("linetooltrendline");s.call(this,e,o),e._trendLineStatsCache||(e._trendLineStatsCache=new n),i.e(0).then(function(e){var t=i(770).TrendLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(6).Point,s=i(0).LineDataSource,a=i(3).DefaultProperty,l=i(2).propertyPages,c=i(4).getLogger("Chart.LineToolTrendLine"),h=i(349).TrendLineStatsRenderer,u=i(327).LabelSettings;n.prototype.canvas=function(){return this._canvas},n.prototype.topByRow=function(e){return e*this._rowHeight},n.prototype.rowHeight=function(e){return this._rowHeight},n.prototype.rowWidth=function(e){var t=this._rowsToSources[e];return this._sourcesToRow[t].width},n.prototype.currentWidth=function(){return this._currentWidth},n.prototype._findEmptyRow=function(e){for(var t=0;this._rowsToSources[t];)t++;return this._rowsToSources[t]=e,t>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),c.logDebug("TrendLineCache. Expanging cache to "+this._actualCapacity+" items")),t},n.prototype._effectiveState=function(e){var t,i={};return i.p1=$.extend({},e.points()[0]),i.p2=$.extend({},e.points()[1]),t=e.properties(),i.showBars=t.showBarsRange.value(),i.showTimeRange=t.showDateTimeRange.value(),i.showDistance=t.showDistance.value(),i.showPriceRange=t.showPriceRange.value(),i.showAngle=t.showAngle.value(),i.color=t.textcolor.value(),i.showAngle&&(i.priceRange=e.priceScale().priceRange().state(),i.barSpacing=e._model.timeScale().barSpacing()),i},n.prototype._effectiveStatesEquals=function(e,t){ var i=function(e,t){return!(!e&&!t)&&(!(!e||t)||(!(e||!t)||(e.index!==t.index||e.price!==t.price)))};if(e&&!t)return!1;if(!e&&t)return!1;if(i(e.p1,t.p1))return!1;if(i(e.p2,t.p2))return!1;if(e.color!==t.color)return!1;if(e.showBars!==t.showBars)return!1;if(e.showTimeRange!==t.showTimeRange)return!1;if(e.showDistance!==t.showDistance)return!1;if(e.showPriceRange!==t.showPriceRange)return!1;if(e.showAngle!==t.showAngle)return!1;if(e.showAngle){if(e.priceRange.min!==t.priceRange.min)return!1;if(e.priceRange.max!==t.priceRange.max)return!1;if(e.barSpacing!==t.barSpacing)return!1}return!0},n.prototype.removeSource=function(e){if(this._sourcesToRow[e]){var t=this._sourcesToRow[e].row;this._ctx.save(),this._ctx.clearRect(0,this.topByRow(t),this._currentWidth,this.rowHeight(t)),this._ctx.restore(),delete this._sourcesToRow[e],delete this._rowsToSources[t]}},n.prototype._repaintSource=function(e,t,i){var n,o;this._ctx.save(),this._ctx.translate(0,this.topByRow(t)+.5),i.points[0]=new r(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(t)),n=new h(i,{}),o=n.draw(this._ctx),this._sourcesToRow[e].width=o.width,this._ctx.restore()},n.prototype.updateSource=function(e,t){var i,n,o,r,s,a=e.properties().symbol.value();return this._currentSymbol!==a&&(c.logDebug("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+a),this._currentSymbol=a,this._sourcesToRow={},this._rowsToSources={}),i=e.id(),this._sourcesToRow[i]||(n=this._findEmptyRow(i),this._sourcesToRow[i]={effectiveState:null,row:n}),o=this._sourcesToRow[e.id()].effectiveState,r=this._effectiveState(e),this._effectiveStatesEquals(o,r)||(n=this._sourcesToRow[e.id()],s=t(),this._repaintSource(i,n.row,s),this._sourcesToRow[i].effectiveState=r),this._sourcesToRow[i]},inherit(o,s),o.prototype.stop=function(){s.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Trend Line"},o.prototype.name=function(){return"Trend Line"},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},o.prototype.getStylesPropertyPage=function(){return l.LineToolTrendLineStylesPropertyPage},t.LineToolTrendLine=o},function(e,t,i){"use strict";function n(e,t){var n=t||new h("linetoolarrowmark");n.hasChild("text")||n.addChild("text",new c("")),n.addExclusion("text"),l.call(this,e,n),i.e(0).then(function(t){var n=i(350).TextPaneView,o=i(351).MarkPaneView,r=[new o(this,e,this.image,this.width,this.height,this.offsetX,this.offsetY)],s=this._createTextPaneView(n);null!==s&&r.push(s),this._setPaneViews(r)}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){this._constructor="LineToolArrowMarkLeft",n.call(this,e,t)}function r(e,t){this._constructor="LineToolArrowMarkUp",n.call(this,e,t)}function s(e,t){ this._constructor="LineToolArrowMarkRight",n.call(this,e,t)}function a(e,t){this._constructor="LineToolArrowMarkDown",n.call(this,e,t)}var l=i(0).LineDataSource,c=i(13),h=i(3).DefaultProperty,u=i(2).propertyPages;inherit(n,l),n.prototype.width=21,n.prototype.height=21,n.prototype.offsetX=0,n.prototype.offsetY=0,n.prototype.paneViews=function(e){var t=l.prototype.paneViews.call(this,e);return null!==t&&this._textPaneView&&t.push(this._textPaneView),t},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return"Arrow Mark"},n.prototype.name=function(){return"Arrow Mark"},n.prototype.getStylesPropertyPage=function(){return u.LineToolArrowMarkStylesPropertyPage},n.prototype._createTextPaneView=function(e){return null},inherit(o,n),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",o.prototype.offsetX=1,o.prototype.offsetY=-10,o.prototype.title=function(){return"Arrow Mark Left"},o.prototype.name=function(){return"Arrow Mark Left"},o.prototype._createTextPaneView=function(e){var t=new e(this,this._model,22,-3,"middle","left");return t.disableSelection(),t},inherit(r,n),r.prototype.image=new Image,r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",r.prototype.offsetX=-9,r.prototype.offsetY=0,r.prototype.title=function(){return"Arrow Mark Up"},r.prototype.name=function(){return"Arrow Mark Up"},r.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,18,"top","center");return t.disableSelection(),t},inherit(s,n),s.prototype.image=new Image, s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",s.prototype.offsetX=-19,s.prototype.offsetY=-10,s.prototype.title=function(){return"Arrow Mark Right"},s.prototype.name=function(){return"Arrow Mark Right"},s.prototype._createTextPaneView=function(e){var t=new e(this,this._model,-22,-3,"middle","right",!0);return t.disableSelection(),t},inherit(a,n),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},a.prototype.name=function(){return"Arrow Mark Down"},a.prototype._createTextPaneView=function(e){var t=new e(this,this._model,0,-23,"bottom","center");return t.disableSelection(),t},s.prototype.version=o.prototype.version=a.prototype.version=r.prototype.version=2,t.LineToolArrowMark=n,t.LineToolArrowMarkLeft=o,t.LineToolArrowMarkRight=s,t.LineToolArrowMarkUp=r,t.LineToolArrowMarkDown=a},,function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineEnd",function(){return n});var n;!function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(n||(n={}))},,function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"NumericFormatter",function(){return o}),n=i(21),o=function(){function e(e){this._precision=e}return e.prototype.format=function(t){return(void 0!==this._precision?t.toFixed(this._precision):e.formatNoE(t)).replace(".",n.formatterOptions.decimalSign)},e.prototype.parse=function(e){var t=e.replace(n.formatterOptions.decimalSign,"."),i=parseFloat(t) ;return this._precision&&(i=+i.toFixed(this._precision)),i},e.formatNoE=function(e){return e>=1e-15&&e<1?e.toFixed(15).replace(/\.?0+$/,""):e+""},e}()},function(e,t,i){"use strict";var n=i(159).TVLocalStorage;i(71),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(e){n.setItem(this.force_prefix+e,"true")},disableFeature:function(e){n.setItem(this.force_prefix+e,"false")},resetFeature:function(e){n.removeItem(this.force_prefix+e)}},TradingView.isFeatureEnabled=function(e){function t(t){var i=Math.random()<=e[t];return n.setItem(o+t,i),i}function i(e){return-1===["address-autocomplete-google-key","black_friday","black_friday_popup","black_friday_mainpage","coinbase_payments","ios_app_info","text_notes","multiple-sos","datawindow","broker_ALOR_dev"].indexOf(e)&&-1===e.indexOf("-maintenance")}var o="featuretoggle.";return function(r){var s,a;return!(!s&&"local"!==window.environment||!i(r))||(!e[r]||-1!==e[r])&&(!!("true"===n.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"true"===user.settings[TradingView.FeatureToggle.force_prefix+r])||!("false"===n.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"false"===user.settings[TradingView.FeatureToggle.force_prefix+r])&&(!!e[r]&&(1===e[r]||(a=n.getItem(o+r),void 0===a||null===a?t(r):"true"===a))))}}(window.featureToggleState||{}),t.FeatureToggle=TradingView.FeatureToggle,t.isFeatureEnabled=TradingView.isFeatureEnabled},function(e,t,i){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TVXWindowEvents",function(){return n}),i(85),function(e){function t(e,t){s[e]||(s[e]=[]),s[e].push(t)}function i(e,t){if(s[e]){var i=s[e].indexOf(t);-1!==i&&(1===s[e].length?delete s[e]:s[e].splice(i,1))}}function n(e){return TVLocalStorage.getItem(r+e)}function o(e,t){void 0===t&&(t=(new Date).valueOf()),t!==TVLocalStorage.getItem(r+e)&&TVLocalStorage.setItem(r+e,t)}var r="tvxwevents.",s={};window.addEventListener("storage",function(e){if(null!==e.newValue){var t=e.key;t&&t.startsWith(r)&&(t=t.substr(r.length),s[t]&&s[t].forEach(function(t){t.call(e.newValue,e.newValue)}))}}),e.on=t,e.off=i,e.current=n,e.emit=o}(n||(n={}))},function(e,t,i){"use strict";function n(e){return"s"===e}function o(e){return!n(e)}var r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"layouts",function(){return l}),t.isSingleLayout=n,t.isMultipleLayout=o,r=i(1),s={s:{title:"1 chart",count:1,sizer:function(e,t,i,n){return{width:t.width-n-n,height:t.height-n-n,top:n,left:n}}}},a={},l=r.a({},s,a)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HorizontalLineRenderer",function(){return r}),n=i(9),o=i(46),i.n(o),r=function(){function e(){this._data=null,this._hitTest=new n.HitTestResult(n.HitTestResult.REGULAR)}return e.prototype.setData=function(e){this._data=e},e.prototype.setHitTest=function(e){this._hitTest=e},e.prototype.draw=function(e){var t,i ;null!==this._data&&0!==this._data.points.length&&!1!==this._data.visible&&((t=this._data.points[0].y)<0||t>this._data.height||(i=this._data.width,e.lineCap="square",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&Object(o.setLineStyle)(e,this._data.linestyle),Object(o.drawLine)(e,0,t,i,t)))},e.prototype.hitTest=function(e){return null===this._data||!1===this._data.visible?null:0===this._data.points.length?null:Math.abs(e.y-this._data.points[0].y)<=5?this._hitTest:null},e}()},function(e,t,i){"use strict";function n(e,t){var i=e[0].getBoundingClientRect();t.localX=t.clientX-i.left,t.localY=t.clientY-i.top}var o,r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"MouseEventHandler",function(){return h}),o=i(14),i.n(o),r=i(127),i.n(r),s=i(356),a=i(7),i.n(a),l=2,c=!1,h=function(){function e(e,t,i,n){this._clickCount=0,this._clickTimeoutId=null,this._touchContextMenuTimeout=null,this._lastTouchPosition={x:0,y:0},this._mouseMoveStartPosition=null,this._moveExceededManhattanDistance=!1,this._cancelClick=!1,this._hammerManager=null,this._isDestroyed=!1,this._$target=e,this._handler=t,this._originalPreventDefault=i,this._preventDefault=!n&&i,this._verticalTouchScroll=n,this._init()}return e.prototype.destroy=function(){null!==this._hammerManager&&(this._hammerManager.destroy(),this._hammerManager=null),this._isDestroyed=!0},e.prototype._mouseEnterHandler=function(e){this._$target.off("mousemove.chartgui"),this._$target.on("mousemove.chartgui",this._mouseMoveHandler.bind(this)),Modernizr.touch&&this._mouseMoveHandler(e),this._processEvent(e,this._handler.mouseEnterEvent),this._preventDefaultIfNeeded(e)},e.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null},e.prototype._mouseMoveHandler=function(e){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";function n(e,t,i){return i&&(i+=" "),(i||"")+e+"px "+t}Object.defineProperty(t,"__esModule",{value:!0}),t.makeFont=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(83),i.n(o),r=i(118),s=i(5),i.n(s),a=i(17),l=i(86),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;r"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=y(this._dv,new g(16,16)),$(this.canvas).css("position","absolute"), $(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=y(this._dv,new g(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._textWidthCache=new s,this.restoreDefaultCursor(),this.update(),this._mouseEventHandler=new v(this.jqCell,this,!0),this.dialog=this.pane.chart().dialog,this.contextMenu=null,this.actions={},this._isVisible=!0,this.priceScale().onMarksChanged.subscribe(this,this.onMarksChanged)}function o(e){var t=new T(e);return function(e,i){return isNumber(i)&&!e.isLog()?t.format(i):""}}var r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C;i(636),r=i(0).LineDataSource,s=i(115),a=i(41),l=a.Action,c=a.ActionSeparator,h=i(88),u=i(639),d=i(18),p=i(81),_=p.resizeCanvas,f=p.hardResizeCanvas,m=p.clearRect,y=p.addCanvasTo,g=p.Size,v=i(110).MouseEventHandler,S=i(39).trackEvent,b=i(116).makeFont,w=i(181).ActionBinder,P=i(4).getLogger("Chart.PriceAxisWidget"),T=i(193).LimitedPrecisionNumericFormatter,x={contextMenuEnabled:!0},n.prototype._BORDER_SIZE=1,n.prototype._OFFSET_SIZE=1,n.prototype._TICK_LENGTH=3,n.LHS=1,n.RHS=2,n.isLeft=function(e){return e===n.LHS||e!==n.RHS&&(P.logDebug("PriceAxisWidget.isLeft: wrong side"),!1)},n.prototype.destroy=function(){this.actions.reset&&this.actions.reset.setActive(!1),this._mouseEventHandler.destroy()},n.prototype.backgroundColor=function(){return this.pane.chart().properties().paneProperties.background.value()},n.prototype.lineColor=function(){return this._properties.lineColor.value()},n.prototype.textColor=function(){return this._properties.textColor.value()},n.prototype.fontSize=function(){return this._properties.fontSize.value()},n.prototype.baseFont=function(){return b(this.fontSize(),"Arial","")},n.prototype.rendererOptions=function(){var e,t,i;return this._rendererOptions||(this._rendererOptions={isLeft:this._isLeft,width:0,height:0,borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s,_tickmarksCache:new u(11,"Arial","","#000"),color:""}),e=this._rendererOptions,t=!1,e.color!==this.textColor()&&(e.color=this.textColor(),t=!0),e.fontSize!==this.fontSize()&&(i=this.fontSize(),e.fontSize=i,e.font=b(this.fontSize(),"'Trebuchet MS', Tahoma, Arial, sans-serif",""),e.paddingTop=Math.floor(i/3.5),e.paddingBottom=e.paddingTop,e.paddingInner=Math.max(Math.ceil(i/3-e.tickLength/2),0),e.paddingOuter=Math.ceil(i/3),e.baselineOffset=Math.round(i/5),e.widthCache.reset(),t=!0),t&&e._tickmarksCache.reset(e.fontSize,"Arial","",e.color),this.size&&(e.width=this.size.w,e.height=this.size.h),this._rendererOptions},n.prototype.mouseDownEvent=function(e){var i,n;!this.priceScale().isEmpty()&&t.enabled("chart_zoom")&&(i=this.pane.chart().model(),n=this.pane.state(),this._mousedown=!0,this.setCursor("ns-resize"),i.startScalePrice(n,this.priceScale(),e.localY))}, n.prototype.pressedMouseMoveEvent=function(e){var t=this.pane.chart().model(),i=this.pane.state(),n=this.priceScale();t.scalePriceTo(i,n,e.localY)},n.prototype.mouseDownOutsideEvent=function(e){var t,i=this.pane.chart().model(),n=this.pane.state();n&&(t=this.priceScale(),this._mousedown&&(this._mousedown=!1,i.endScalePrice(n,t),this.restoreDefaultCursor()))},n.prototype.mouseUpEvent=function(e){var t=this.pane.chart().model(),i=this.pane.state(),n=this.priceScale();this._mousedown=!1,t.endScalePrice(i,n),this.restoreDefaultCursor()},n.prototype._initActions=function(e){var t,i,o,r,s,a,c,h;this.pane.state()&&(this.actions={},i=this,this.actions.reset=new l({text:$.t("Reset Scale"),shortcut:"Alt+R",statName:"ResetScale"}),this.actions.reset.callbacks().subscribe(this,n.prototype.reset),this.priceScale().mainSource()instanceof TradingView.Series&&(o=function(){t={lockScale:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},r=C(this.priceScale(),this.pane.chart().model().model().mainSeriesScaleRatio()),this.actions.setLockScale=new l({text:$.t("Lock Scale")+" "+r,checkable:!0,checked:this.priceScale().isLockScale(),statName:"ToggleLockScale"}),this._lockScaleBinding=new w(this.actions.setLockScale,this.priceScale().properties().lockScale,this.pane.chart().model(),"Lock Scale",o),this._lockScaleBinding.setValue(this.priceScale().isLockScale())),s=function(){t={autoScale:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setAutoScale=new l({text:$.t("Auto Scale"),checkable:!0,checked:!0,statName:"ToggleAutoScale"}),this._autoScaleBinding=new w(this.actions.setAutoScale,this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",s),this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),a=function(){t={percentage:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setPercentage=new l({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePercantage"}),this.actions.setPercentage.binding=new w(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",a),c=function(){t={indexedTo100:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setIndexedTo100=new l({text:$.t("Indexed to 100",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleIndexedTo100"}),this.actions.setIndexedTo100.binding=new w(this.actions.setIndexedTo100,this.priceScale().properties().indexedTo100,this.pane.chart().model(),"Undo Indexed to 100",c),h=function(){t={log:this.value()},this._undoModel.setPriceScaleMode(t,i.priceScale(),this._undoText)},this.actions.setLog=new l({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleLogScale"}),this.actions.setLog.binding=new w(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale",h),this.actions.alignLabels=new l({ text:$.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new w(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"No Overlapping Labels"),this._updateScalesActions())},n.prototype._updateScalesActions=function(){var e=this.priceScale(),t=e.mainSource()instanceof TradingView.Series,i=e.mainSource().properties();this.actions.setPercentage.setEnabled(!(e.isLog()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setIndexedTo100.setEnabled(!(e.isLog()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setLog.setEnabled(!(e.isPercentage()||e.isIndexedTo100()||t&&e.isLockScale()||t&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setAutoScale.setChecked(e.properties().autoScale.value()),this.actions.setAutoScale.setEnabled(!e.properties().autoScaleDisabled.value())},n.prototype.mouseClickEvent=function(e){},n.prototype.mouseDoubleClickEvent=function(e){this.reset(),S("GUI","Double click price scale")},n.prototype.contextMenuEvent=function(e,t){this._options.contextMenuEnabled&&this._createContextMenu().show(e)},n.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},n.prototype.getContextMenuActions=function(){var e,i;return this._initActions(),e=this.pane.chart().actions(),i=[],i.push(this.actions.reset,new c,e.showLeftAxis,e.showRightAxis,new c,this.actions.setAutoScale),this.actions.setLockScale&&i.push(this.actions.setLockScale),i.push(e.scaleSeriesOnly,new c,this.actions.setPercentage,this.actions.setIndexedTo100,this.actions.setLog,new c),t.enabled("fundamental_widget")||i.push(e.showSymbolLabelsAction,e.showSeriesLastValue),i.push(e.showStudyPlotNamesAction,e.showStudyLastValue),t.enabled("countdown")&&i.push(e.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&t.enabled("show_chart_property_page")&&t.enabled("chart_property_page_scales")&&e.scalesProperties&&i.push(new c,e.scalesProperties),i},n.prototype.backLabels=function(e){var t,i,n,o,r,s=[],a=this.priceScale().orderedSources().slice(),l=this.pane,c=l.chart().model(),h=l.state(),u=[],d=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated();if(d&&u.push(d),c.selectedSource()&&u.push(c.selectedSource()),c.hoveredSource()&&u.push(c.hoveredSource()),this.priceScale()===h.defaultPriceScale())for(t=this.pane.state().dataSources(),i=0;i0&&(e=Math.max(t.widthCache.measureText(i,n[0].label),t.widthCache.measureText(i,n[n.length-1].label))), o=this.backLabels(!0),r=o.length;r--;)(s=t.widthCache.measureText(i,o[r].text()))>e&&(e=s);return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.paddingInner+t.paddingOuter+e)},n.prototype.setSize=function(e){this.size&&this.size.equals(e)||(this.size=e,_(this.canvas,e),_(this.top_canvas,e),this.jqCell.css({width:e.w,"min-width":e.w,height:e.h}))},n.prototype.update=function(){},n.prototype._hightlightBackground=function(e,t,i){var n,o,r,s,a,l,c;if(i){for(n=t[0].price,o=t[0].price,r=1;r0&&(f=o[0].floatCoordinate())}for(a=m.filter(function(e){return e.floatCoordinate()<=f}),l=m.filter(function(e){return e.floatCoordinate()>f}),a.sort(function(e,t){return t.floatCoordinate()-e.floatCoordinate()}),a.length&&l.length&&l.push(a[0]),l.sort(function(e,t){return e.floatCoordinate()-t.floatCoordinate()}),c=m.length,t=0;t_-d&&s.setFixedCoordinate(_-d);for(r=1;ro&&(s|=2),tr&&(s|=8),s}for(var o,r,s,a=e[0].x,l=e[0].y,c=e[1].x,h=e[1].y,u=t.x,d=t.y,p=i.x,_=i.y,f=n(a,l,u,d,p,_),y=n(c,h,u,d,p,_),g=!1,v=0;;){if(v>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(v++,!(f|y)){g=!0;break}if(f&y)break;o=f||y,r=void 0,s=void 0,8&o?(r=a+(c-a)*(_-l)/(h-l),s=_):4&o?(r=a+(c-a)*(d-l)/(h-l),s=d):2&o?(s=l+(h-l)*(p-a)/(c-a),r=p):(s=l+(h-l)*(u-a)/(c-a),r=u),o===f?(a=r,l=s,f=n(a,l,u,d,p,_)):(c=r,h=s,y=n(c,h,u,d,p,_))}return g?m.equalPoints(m.point(a,l),m.point(c,h))?m.point(a,l):m.lineSegment(m.point(a,l),m.point(c,h)):null}function o(e,t){var i,n,o=e.A,r=t.A,s=e.B,a=t.B,l=e.C,c=t.C,h=o*a-r*s;return Math.abs(h)<1e-6?null:(i=(s*c-a*l)/h,n=(r*l-o*c)/h,new m.Point(i,n))}function r(e,t,i,n){var o,r=t.subtract(e),s=n.subtract(i),a=r.x*s.y-r.y*s.x;return Math.abs(a)<1e-6?null:(o=e.subtract(i),(o.y*s.x-o.x*s.y)/a)}function s(e,t,i,n){var o,s,a,l=r(e,t,i,n);return null===l?null:(o=t.subtract(e),s=o.scaled(l).add(e),a=y.distanceToSegment(i,n,s),Math.abs(a.distance)<1e-6?l:null)}function a(e,t){return-(e.C+e.B*t)/e.A}function l(e,t){return-(e.C+e.A*t)/e.B}function c(e,t){var i,n,o;for(i=0,n=e;i=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(r.family),r.size.length>0&&i.setValue(r.size),n.setValue(r.bold),o.setValue(r.italic)},o.fontHeight=function(e){var t,i;return this._fontHeightCache[e]||(t=document.createElement("span"),t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;",i=t.offsetHeight,document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)),this._fontHeightCache[e]},o.drawPolyHoverOrPress=function(e,t,i,n){n?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},o.repaint=function(e){var t=new n(n.LIGHT_UPDATE);t.force=!0,e.invalidate(t)},o.roundToMinTick=function(e,t){var i=e.mainSource().base(),n=1/i;return n*Math.round(t/n)},e.exports=o},function(e,t,i){"use strict";function n(){clearTimeout(W),clearTimeout(H),clearTimeout(j)}function o(e,t){j=setTimeout(e,t)}function r(e,t){H=setTimeout(e,t)}function s(e,t){W=setTimeout(e,t)}function a(){var e=document.getElementById(z);if(e)return void(U=e);U=document.createElement("div"),U.id=z,document.body.appendChild(U)}function l(){U.innerHTML=""}function c(e){return q.then(function(){l(),U.appendChild(e)})}function h(e,t){var i,n=G.includes(t)?Y[t]:"";(i=e.classList).remove.apply(i,G.map(function(e){return Y[e]}).filter(function(e){return!!e})),n&&!e.classList.contains(n)&&e.classList.add(n)}function u(e,t){var i=K.get(e);return i&&i[t]}function d(e,t,i){var n=K.get(e)||{};n[t]=i,K.set(e,n)}function p(e){var t=e.getAttribute("title");return t&&(d(e,"text",t),e.removeAttribute("title")),u(e,"text")||""}function _(e){var t=p(e),i=e.getBoundingClientRect(),n={h:i.height,w:i.width,x:i.left,y:i.top},o=e.getAttribute("data-color-theme")||"",r=e.classList.contains("common-tooltip-html"),s=parseInt(e.getAttribute("data-tooltip-delay")||""),a={type:"none"};return t&&(a={type:r?"html":"text",data:t}),{above:e.classList.contains("common-tooltip-above"),below:e.classList.contains("common-tooltip-below"),otl:e.classList.contains("common-tooltip-otl"),otr:e.classList.contains("common-tooltip-otr"),vertical:e.classList.contains("common-tooltip-vertical"),hotkey:e.getAttribute("data-tooltip-hotkey"),narrow:e.classList.contains("common-tooltip-narrow"),colorTheme:o, tooltipDelay:s,rect:n,content:a}}function f(e){var t,i,n,o,r,s,a=b(),l=x(a),c=e.content;switch(c.type){case"element":l.innerHTML="",l.appendChild(c.data);break;case"html":l.innerHTML=c.data;break;case"text":e.hotkey?(i=P(),i.innerText=c.data,l.appendChild(i)):l.innerText=c.data}return e.hotkey&&(n="none"!==c.type,o=w(),r=Object(Z.a)(e.hotkey),s=S(r.keys),o.innerHTML=(t=r.text).format.apply(t,s).replace(/\s\+\s/g,'+'),l.classList.add(Q["common-tooltip__body--with-hotkey"]),n&&o.classList.add(Q["common-tooltip__hotkey-block--divider"]),l.appendChild(o)),a}function m(e,t){var i,n,o,r,s,a,l,c,u,d,p,_,f,m,y,g,S=t.rect;S&&(h(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass),i=x(e),i.classList.toggle(Q["common-tooltip__body--width_wide"],!!t.wide),i.classList.toggle(Q["common-tooltip__body--width_narrow"],!!t.narrow),i.classList.toggle(Q["common-tooltip__body--no-buttons"],!0),e.classList.toggle(Q["common-tooltip--no-pointer-events"],!Modernizr.pointerevents),i.style.left=v(0),i.style.width=v(i.clientWidth+2),n=document.body.clientWidth,o=document.body.clientHeight,r=t.vertical,s=r&&S.w<20||!r&&S.h<20,e.classList.toggle(Q["common-tooltip--farther"],s),e.classList.toggle(Q["common-tooltip--vertical"],r),e.classList.toggle(Q["common-tooltip--horizontal"],!r),a=T(e),l="",r?(e.style.left=v(S.x+S.w),e.style.top=v(S.y-(e.offsetHeight-S.h)/2),c=(e.querySelector(":last-child")||i).getBoundingClientRect().right,u=c+ee>n,e.classList.toggle(Q["common-tooltip--direction_reversed"],u),e.classList.toggle(Q["common-tooltip--direction_normal"],!u),l=u?"after":"before",X.IS_RTL?(l=t.otr?"after":l,l=t.otl?"before":l):(l=t.otr?"before":l,l=t.otl?"after":l),a.classList.toggle(Q["common-tooltip__ear-holder--before"],"before"===l),a.classList.toggle(Q["common-tooltip__ear-holder--after"],"after"===l),"after"===l&&(e.style.left="auto",e.style.right=v(n-S.x))):(d=S.x-(i.offsetWidth-S.w)/2,p=n-ee-e.offsetWidth,_=Math.max(ee,Math.min(d,p)),e.style.bottom=v(o-S.y),e.style.left=v(_),u=p'+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(86).PlotType,_=i(161),f=i(103).LineEnd,m=i(323).StatsPosition,y=i(4).getLogger("Chart.Defaults"),g=function(e){var t,i,n,s,a,l,c,y,g={a:function(e,t){return{color:e,visible:t}},b:function(e,t,i){return{coeff:e,color:t,visible:i}},c:function(e,t,i,n,o){return{coeff:e,color:t,visible:i,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===o?1:o}},d:function(e,t,i){return{color:e,width:i,visible:t}},e:function(e,t,i,n,o){return{color:e,visible:t,width:i,x:n,y:o}},f:function(e,t,i,n,o,r){return{coeff1:e,coeff2:t,color:i,visible:n,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===r?1:r}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"ar_AE":t="Asia/Dubai";break;case"au":t="Australia/Sydney";break;case"br":t="America/Sao_Paulo";break;case"ca":t="America/Toronto";break;case"de_DE":case"it":t="Europe/Berlin";break;case"es":t="Europe/Madrid";break;case"fa_IR":t="Asia/Tehran";break;case"fr":case"sv_SE":t="Europe/Paris";break;case"he_IL":case"tr":t="Europe/Athens";break;case"hu_HU":case"pl":t="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":t="Asia/Bangkok" ;break;case"in":t="Asia/Kolkata";break;case"ja":case"kr":t="Asia/Tokyo";break;case"ms_MY":t="Asia/Singapore";break;case"ru":t="Europe/Moscow";break;case"uk":t="Europe/London";break;case"zh_CN":case"zh_TW":t="Asia/Shanghai";break;default:t="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:t,dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#758696",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0,showBarChange:!0,showOnlyPriceSource:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1,barSpacing:_.DEFAULT_BAR_SPACING},mainSeriesProperties:{style:h.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 235, 77, 92, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",baseLineColor:"#B2B5BE",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"#53b987",downColor:"#eb4d5c",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#53b987",borderDownColor:"#eb4d5c",wickColor:"#737375",wickUpColor:"#a9cdd3",wickDownColor:"#f5a6ae",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 169, 220, 195, 1)",wickDownColor:"rgba( 245, 166, 174, 1)"},haStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 83, 185, 135, 1)", wickDownColor:"rgba( 255, 77, 92, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{}},barStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:h.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},rangeStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)", downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{range:10,phantomBars:!1},inputInfo:{range:{name:"Range"},phantomBars:{name:"Phantom Bars"}}}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0)",transparency:100},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"#585858",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)", reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:61536,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolinfoline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!0,showMiddlePoint:!1,showPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,showDistance:!0,showAngle:!0,statsPosition:m.Center},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1,statsPosition:m.Right},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 106, 168, 79, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana", textcolor:"rgba( 18, 159, 92, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"rgba( 73, 133, 231, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 73, 133, 231, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{counterclockwise:!1,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendTop:!1,extendBottom:!1},linetoolpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardshort:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolriskrewardlong:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolarrow:{clonable:!0,linecolor:"rgba( 111, 136, 198, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1, leftEnd:f.Normal,rightEnd:f.Arrow,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolray:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolextended:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:f.Normal,rightEnd:f.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:m.Right},linetoolhorzline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcrossline:{clonable:!0,linecolor:"rgba(6, 160, 227, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(1,"rgba( 0, 85, 219, 1)",!0),level3:g.c(2,"rgba( 0, 85, 219, 1)",!0),level4:g.c(3,"rgba( 0, 85, 219, 1)",!0),level5:g.c(5,"rgba( 0, 85, 219, 1)",!0),level6:g.c(8,"rgba( 0, 85, 219, 1)",!0),level7:g.c(13,"rgba( 0, 85, 219, 1)",!0),level8:g.c(21,"rgba( 0, 85, 219, 1)",!0),level9:g.c(34,"rgba( 0, 85, 219, 1)",!0),level10:g.c(55,"rgba( 0, 85, 219, 1)",!0),level11:g.c(89,"rgba( 0, 85, 219, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltext:{clonable:!0, color:"rgba( 102, 123, 139, 1)",font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.9)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"rgba( 102, 123, 139, 1)",font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 254, 206, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30},linetoolbrush:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,leftEnd:f.Normal,rightEnd:f.Normal},linetoolpolyline:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"rgba( 120, 120, 120, 1)",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolnote:{clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"rgba( 0, 128, 0, 1)"},linetoolthumbdown:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolpricelabel:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 255, 255, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"rgba( 21, 56, 153, 1)",fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",linewidth:1,snapTo45Degrees:!0,transparency:50},linetoolrotatedrectangle:{clonable:!0,color:"rgba( 152, 0, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 142, 124, 195, 0.5)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolarc:{clonable:!0, color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"rgba( 28, 115, 219, 1)",linewidth:2,sourceBackColor:"rgba( 241, 241, 241, 1)",sourceTextColor:"rgba( 110, 110, 110, 1)",sourceStrokeColor:"rgba( 110, 110, 110, 1)",targetStrokeColor:"rgba( 47, 168, 255, 1)",targetBackColor:"rgba( 11, 111, 222, 1)",targetTextColor:"rgba( 255, 255, 255, 1)",successBackground:"rgba( 54, 160, 42, 0.9)",successTextColor:"rgba( 255, 255, 255, 1)",failureBackground:"rgba( 231, 69, 69, 0.5)",failureTextColor:"rgba( 255, 255, 255, 1)",intermediateBackColor:"rgba( 234, 210, 137, 1)",intermediateTextColor:"rgba( 109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{clonable:!0,color:"rgba( 153, 21, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"rgba( 255, 255, 255, 1)",backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:2,fontsize:12,font:"Verdana",bordercolor:"rgba( 153, 21, 21, 1)",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"rgba( 119, 52, 153, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba( 180, 167, 214, 0.5)",transparency:50,showMidline:!1,midlinecolor:"rgba( 119, 52, 153, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"rgba( 80, 145, 204, 1)",clonable:!0,mode:d.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{singleChartOnly:!0,clonable:!0,averageHL:20,variance:50,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Original,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1), level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:g.f(1,8,"rgba( 160, 107, 0, 1)",!0),level2:g.f(1,4,"rgba( 105, 158, 0, 1)",!0),level3:g.f(1,3,"rgba( 0, 155, 0, 1)",!0),level4:g.f(1,2,"rgba( 0, 153, 101, 1)",!0),level5:g.f(1,1,"rgba( 128, 128, 128, 1)",!0),level6:g.f(2,1,"rgba( 0, 101, 153, 1)",!0),level7:g.f(3,1,"rgba( 0, 0, 153, 1)",!0),level8:g.f(4,1,"rgba( 102, 0, 153, 1)",!0),level9:g.f(8,1,"rgba( 165, 0, 0, 1)",!0),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{font:"Verdana",fontSize:12,bold:!1,italic:!1},levels:[g.d("rgba( 128, 128, 128, 1)",!0,1),g.d("rgba( 160, 107, 0, 1)",!0,1),g.d("rgba( 105, 158, 0, 1)",!0,1),g.d("rgba( 0, 155, 0, 1)",!0,1),g.d("rgba( 0, 153, 101, 1)",!0,1),g.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[g.e("rgba( 165, 0, 255, 1)",!1,1,8,1),g.e("rgba( 165, 0, 0, 1)",!1,1,5,1),g.e("rgba( 128, 128, 128, 1)",!1,1,4,1),g.e("rgba( 160, 107, 0, 1)",!1,1,3,1),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,1,1),g.e("rgba( 0, 153, 101, 1)",!0,1,1,2),g.e("rgba( 0, 153, 101, 1)",!1,1,1,3),g.e("rgba( 0, 0, 153, 1)",!1,1,1,4),g.e("rgba( 102, 0, 153, 1)",!1,1,1,5),g.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[g.e("rgba( 160, 107, 0, 1)",!0,1,1,0),g.e("rgba( 160, 107, 0, 1)",!0,1,1,1),g.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,3,0),g.e("rgba( 0, 155, 0, 1)",!0,1,3,1),g.e("rgba( 0, 153, 101, 1)",!0,1,4,0),g.e("rgba( 0, 153, 101, 1)",!0,1,4,1),g.e("rgba( 0, 0, 153, 1)",!0,1,5,0),g.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannfixed:{clonable:!0,fillBackground:!1,arcsBackground:{ fillBackground:!0,transparency:80},reverse:!1,levels:[g.d("rgba( 128, 128, 128, 1)",!0,1),g.d("rgba( 160, 107, 0, 1)",!0,1),g.d("rgba( 105, 158, 0, 1)",!0,1),g.d("rgba( 0, 155, 0, 1)",!0,1),g.d("rgba( 0, 153, 101, 1)",!0,1),g.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[g.e("rgba( 165, 0, 255, 1)",!1,1,8,1),g.e("rgba( 165, 0, 0, 1)",!1,1,5,1),g.e("rgba( 128, 128, 128, 1)",!1,1,4,1),g.e("rgba( 160, 107, 0, 1)",!1,1,3,1),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,1,1),g.e("rgba( 0, 153, 101, 1)",!0,1,1,2),g.e("rgba( 0, 153, 101, 1)",!1,1,1,3),g.e("rgba( 0, 0, 153, 1)",!1,1,1,4),g.e("rgba( 102, 0, 153, 1)",!1,1,1,5),g.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[g.e("rgba( 160, 107, 0, 1)",!0,1,1,0),g.e("rgba( 160, 107, 0, 1)",!0,1,1,1),g.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,0),g.e("rgba( 105, 158, 0, 1)",!0,1,2,1),g.e("rgba( 0, 155, 0, 1)",!0,1,3,0),g.e("rgba( 0, 155, 0, 1)",!0,1,3,1),g.e("rgba( 0, 153, 101, 1)",!0,1,4,0),g.e("rgba( 0, 153, 101, 1)",!0,1,4,1),g.e("rgba( 0, 0, 153, 1)",!0,1,5,0),g.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannsquare:{clonable:!0,color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:g.a("rgba( 128, 128, 128, 1)",!1),hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["fans","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0), hlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:g.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:g.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:g.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:g.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:g.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:g.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:g.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["trendline","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0), level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba( 0, 128, 0, 0.2)",color2:"rgba( 255, 0, 0, 0.2)",linewidth:1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{clonable:!0,color:"rgba( 204, 40, 149, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 204, 40, 149, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolcypherpattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"rgba( 0, 155, 0, 1)",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"rgba( 69, 104, 47, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 69, 168, 47, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!1),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!1), level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!1),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!1),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:g.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:g.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:g.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:g.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:g.c(1,"rgba( 128, 128, 128, 1)",!0),level7:g.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:g.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:g.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:g.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:g.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltrendbasedfibextension:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:g.b(0,"rgba( 128, 128, 128, 1)",!0),level2:g.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:g.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:g.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:g.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:g.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:g.b(1,"rgba( 128, 128, 128, 1)",!0),level8:g.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:g.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:g.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:g.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:g.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:g.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:g.b(2,"rgba( 40, 204, 149, 1)",!1),level14:g.b(2.272,"rgba( 149, 204, 40, 1)",!1), level15:g.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:g.b(3,"rgba( 40, 149, 204, 1)",!1),level18:g.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:g.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:g.b(4,"rgba( 204, 40, 40, 1)",!1),level21:g.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:g.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:g.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:g.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:g.c(0,"rgba( 128, 128, 128, 1)",!0),level2:g.c(.382,"rgba( 204, 40, 40, 1)",!0),level3:g.c(.5,"rgba( 149, 204, 40, 1)",!1),level4:g.c(.618,"rgba( 40, 204, 40, 1)",!0),level5:g.c(1,"rgba( 40, 204, 149, 1)",!0),level6:g.c(1.382,"rgba( 40, 149, 204, 1)",!0),level7:g.c(1.618,"rgba( 128, 128, 128, 1)",!0),level8:g.c(2,"rgba( 40, 40, 204, 1)",!0),level9:g.c(2.382,"rgba( 204, 40, 40, 1)",!0),level10:g.c(2.618,"rgba( 149, 40, 204, 1)",!0),level11:g.c(3,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Schiff,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:u.Schiff2,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:u.Inside,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1, linestyle:CanvasEx.LINESTYLE_SOLID},level0:g.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:g.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:g.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:g.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:g.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:g.c(1,"rgba( 0, 0, 153, 1)",!0),level6:g.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:g.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:g.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetool:{frozen:!1,visible:!0},linetoolvisibilities:{intervalsVisibilities:{seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,months:!0,ranges:!0}}},o(TradingView.defaultProperties.chartproperties),r()}for(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"rgba( 4, 150, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"rgba( 83, 143, 31, 1)",backColor:"rgba( 240, 255, 204, 1)",textColor:"rgba( 0, 0, 0, 1)"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(i="rgba( 212, 121, 40, 1)",n=!0,s=1,TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:n,"S1/R1":n,"S2/R2":n,"S3/R3":n,"S4/R4":n,"S5/R5":n},colors:{P:i,"S1/R1":i,"S2/R2":i,"S3/R3":i,"S4/R4":i,"S5/R5":i},widths:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}}}),void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"rgba( 86, 135, 29, 1)",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:g.a("rgba( 255, 0, 0, 1)",!1),level1:g.a("rgba( 0, 128, 0, 1)",!1),level2:g.a("rgba( 0, 0, 255, 1)",!1),level3:g.a("rgba( 255, 0, 255, 1)",!1),level4:g.a("rgba( 0, 128, 255, 1)",!0),level5:g.a("rgba( 255, 0, 0, 1)",!0),level6:g.a("rgba( 0, 128, 0, 1)",!0),level7:g.a("rgba( 0, 0, 255, 1)",!0),level8:g.a("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)", linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(a="study_Overlay@tv-basicstudies",TradingView.defaultProperties[a]={style:h.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 3, 3, 247, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:h.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)", linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),l=e.split("."),c=TradingView.defaultProperties,y=0;y2;)h=Math.round((f+_)/2),u=this.items[h],u.x<=e.x?_=h:f=h;for(_=Math.max(1,_-1),f=Math.min(this.items.length-1,f+1),d=_;d<=f;++d)if(t=this.items[d-1],i=this.items[d],n=t.x,l=i.x,c=r(new o(n,t.y),new o(l,i.y),new o(e.x,e.y)),c.distance<=p)return this.hittest?this.hittest:new a(a.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=n},,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";var n,o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength()};o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){var e,t;if(this.isAvailable)this.length=this.localStorage.length;else{e=0;for(t in this.localStorage)this.localStorage.hasOwnProperty(t)&&e++;this.length=e}},o.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},n=function(e){this.storage=e},n.prototype.getItem=function(e){return Promise.resolve(this.storage.getItem(e))},n.prototype.setItem=function(e,t){return Promise.resolve(this.storage.setItem(e,t))},window.TVLocalStorage=new o,window.TVLocalStorageAsync=new n(window.TVLocalStorage),e.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},function(e,t,i){(function(e){TradingView.cleanButAmpersand=function(e,t){var i=t?["&"]:["&"];return TradingView.clean(e,t,i)},TradingView.strip_tags=function(e){return e&&e.replace?e.replace(/(<([^>]+)>)/gi,""):e}, TradingView.encodeSpread=function(e){return encodeURIComponent(e)},TradingView.clean=function(e,t,i){var n,o,r,s=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"],["'","'"]],a=e;if(!e||!e.replace)return a;for(n=0;n1)return void h.logWarn("Study '"+e.description+"' has ambiguous identifier '"+s+"'");if(b=P[1],null!==m){if(1===P.length)return void h.logWarn("Path of sub-property of '"+s+"' plot for study '"+e.description+"' must be not empty");w=P.slice(1),u.applyPlotProperty(e,t,m,w,o)}else if(null!==v)u.applyInputValue(t,v,o);else if(null!==y){if(void 0===b)return void h.logWarn("Property name of '"+s+"' band for study '"+e.description+"' must be set");u.applyBandProperty(t,y,b,o)}else if(null!==g){if(void 0===b)return void h.logWarn("Property name of '"+s+"' area for study '"+e.description+"' must be set");u.applyFilledAreaProperty(t,g,b,o)}else S?u.setRootProperty(t,P,o):h.logWarn("Study '"+e.description+"' has no plot or input '"+s+"'")}}function r(e,t){var i,n=e.properties(),r=n.state();for(i in t)t.hasOwnProperty(i)&&o(e.metaInfo(),r,i,t[i]);n.mergeAndFire(r)}function s(e,t,i){var n,r,s,a,l;for(n in e)e.hasOwnProperty(n)&&-1!==(r=n.indexOf("."))&&(s=n.substr(0,r),a=d.getMetaInfoByDescription(t,s),null!==a?(l=i(a.id),null!==l?o(a,l,n.substr(r+1),e[n]):h.logWarn("Cannot apply overrides for study "+s)):h.logWarn("There is no such study "+s))}var a,l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.applyOverridesToStudy=r,t.applyOverridesToStudyDefaults=s,a=i(7),i.n(a),l=i(86),c=i(4),h=Object(c.getLogger)("Chart.Model.StudyPropertiesOverrider"),function(e){function t(e,t,i){var n,o,r,s;if(void 0===e.plots)return null;for(n=0,o=e.plots;n0)return void h.logWarn("Study plot does not have color #"+n);if(0===n||isNaN(n)){Object(a.ensureDefined)(e.styles[i]).color=o+"",n=0}null!==t&&(Object(a.ensureDefined)(t.colors[n]).color=o+"")}function n(e,n,o,r,s){var a,l,c,d,p;if(void 0===n.styles)return void h.logWarn("Study does not have styles");if("color"===(a=r[0]))return l=t(e,n,o),c=r.length>1?parseInt(r[1]):NaN,void i(n,l,o,c,s);if(void 0===(d=n.styles[o])||!d.hasOwnProperty(a))return void h.logWarn("Study plot does not have property '"+a+"'");if("plottype"===a){if(void 0===(p=u[s+""]))return void h.logWarn("Unsupported plot type for plot: "+s);s=p}d[a]=s}function o(e,t,i,n){var o,r;if(void 0===e.bands)return void h.logWarn("Study does not have bands");if(void 0===(o=e.bands[t])||!o.hasOwnProperty(i))return void h.logWarn("Study band does not have property '"+i+"'");if("plottype"===i){if(void 0===(r=u[n+""]))return void h.logWarn("Unsupported plot type for band: "+n);n=r}o[i]=n}function r(e,t,i,n){if(void 0===e.filledAreasStyle)return void h.logWarn("Study does not have areas");var o=e.filledAreasStyle[t];if(void 0===o||!o.hasOwnProperty(i))return void h.logWarn("Study area does not have property '"+i+"'");o[i]=n}function s(e,t,i){if(void 0===e.inputs||!e.inputs.hasOwnProperty(t))return void h.logWarn("Study does not have input '"+t+"'");e.inputs[t]=i}function c(e,t,i){var n,o,r,s,a;if(0!==t.length){for(n=e,o=0,r=t.slice(0,-1);oe._major?1:this._minore._minor?1:0},e.prototype.isLess=function(e){return this.compareTo(e)<0},e.prototype.isLessOrEqual=function(e){return this.compareTo(e)<=0},e.prototype.isEqual=function(e){return 0===this.compareTo(e)},e.prototype.isGreater=function(e){return this.compareTo(e)>0},e.prototype.isGreaterOrEqual=function(e){return this.compareTo(e)>=0},e.parse=function(t){var i,o,r;if(t instanceof e)return new e(t.major(),t.minor());if("number"==typeof t)return Object(n.assert)(Math.floor(t)===t,"Version should not be a float number"),new e(t,0);if("string"==typeof t){if(i=t.split("."),1===i.length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),new e(o,0);if(2===i.length)return o=parseInt(i[0],10),Object(n.assert)(!isNaN(o),"Bad version string: "+t),r=parseInt(i[1],10),Object(n.assert)(!isNaN(r),"Bad version string: "+t),new e(o,r);throw Error("Bad version string (one dot expected): "+t)}throw Error("Bad version: "+t)},e.ZERO=new e(0,0),e}()},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"ResizerDetacherState",function(){return a}),n=i(7),i.n(n),o=i(16),r=i.n(o),s=i(14),i.n(s),a=function(){function e(e){var t=this;this._alive=new r.a,this._body=new r.a,this._width=new r.a,this._height=new r.a,this._fullscreen=new r.a,this._detachable=new r.a,this._fullscreenable=new r.a,this._visible=new r.a,this._availWidth=new r.a,this._availHeight=new r.a,this._owner=new r.a,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),body:this._body.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),fullscreenable:this._fullscreenable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var e=t._owner.value();e&&e.remove&&e.remove()},negotiateWidth:function(e){var i=t._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(e)},negotiateHeight:function(e){var i=t._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(e)},requestFullscreen:function(){var e=t._owner.value();e&&e.requestFullscreen&&e.requestFullscreen()},exitFullscreen:function(){var e=t._owner.value() ;e&&e.exitFullscreen&&e.exitFullscreen()},detach:function(e){var i=t._owner.value();i&&i.detach&&i.detach(e)},attach:function(){var e=t._owner.value();e&&e.attach&&e.attach()}},e&&this.pushOwner(e)}return e.prototype.bridge=function(){return this._bridge},e.prototype.pushOwner=function(e){var t,i,n,o;if(e.alive.value()){for(t=0,i=this._ownersStack;t=i;t--)this._unsubscribeOwner(this._ownersStack[t],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},e}()},function(e,t,i){"use strict";function n(e){return!d.some(function(t){return e[t]().size>0})}function o(e,t,i,n){var o,r,s,a;if(void 0!==t){o=function(t){var o,r=t.styleId;void 0!==i&&Object(c.assert)(r in i,"Every style used by graphics primitive should be declared in study metainfo"),o=null,e.forEach(function(e,t){t===r&&(o=e[0])}),null===o&&(o={indexes:n,items:[]},e.set(r,[o])),o.items=o.items.concat(t.data)};for(r=0,s=t;r=d.length?u.logError("Cannot find index "+r.firstBarTime+" in study timescale indexes"):(s=l.a({},r,{styleId:i}),a=d[r.firstBarTime],c=t.get(a),void 0===c?t.set(a,{indexes:d,items:[s]}):c.items.push(s))}),t}var l,c,h,u,d;i.d(t,"d",function(){return d}),t.c=n,t.b=o,t.a=r,t.e=s,l=i(1),c=i(7),i.n(c),h=i(4),u=Object(h.getLogger)("Chart.StudyGraphics"), d=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists"]},function(e,t,i){"use strict";function n(){this.backColorers=[]}function o(e){n.call(this),this._series=e}function r(e,t){n.call(this),this._study=e,this._plotIndex=t}var s=i(17).PlotRowSearchMode;n.prototype.barStyle=function(e,t,i){var n,o={};for(n=this.backColorers.length-1;n>=0;n--)this.backColorers[n].applyBarStyle(e,t,o,i);return this.applyBarStyle(e,t,o,i),o},n.prototype.pushBackBarColorer=function(e){this.backColorers.push(e)},n.prototype.applyBarStyle=function(e,t,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(o,n),o.prototype.applyBarStyle=function(e,t,i,n){var o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;switch(i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,o=this._series.properties(),o.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=o.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=o.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:r=o.barStyle.upColor.value(),s=o.barStyle.downColor.value(),a=r,l=s,c=this.findBar(e,!1,n),o.barStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,!1,n),i.barColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l):(i.barColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:r=o.candleStyle.upColor.value(),s=o.candleStyle.downColor.value(),a=o.candleStyle.borderUpColor?o.candleStyle.borderUpColor.value():o.candleStyle.borderColor.value(),l=o.candleStyle.borderDownColor?o.candleStyle.borderDownColor.value():o.candleStyle.borderColor.value(),u=o.candleStyle.wickUpColor?o.candleStyle.wickUpColor.value():o.candleStyle.wickColor.value(),d=o.candleStyle.wickDownColor?o.candleStyle.wickDownColor.value():o.candleStyle.wickColor.value(),c=this.findBar(e,!1,n),o.candleStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,!1,n),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:r=o.hollowCandleStyle.upColor.value(),s=o.hollowCandleStyle.downColor.value(),a=o.hollowCandleStyle.borderUpColor?o.hollowCandleStyle.borderUpColor.value():o.hollowCandleStyle.borderColor.value(),l=o.hollowCandleStyle.borderDownColor?o.hollowCandleStyle.borderDownColor.value():o.hollowCandleStyle.borderColor.value(),u=o.hollowCandleStyle.wickUpColor?o.hollowCandleStyle.wickUpColor.value():o.hollowCandleStyle.wickColor.value(),d=o.hollowCandleStyle.wickDownColor?o.hollowCandleStyle.wickDownColor.value():o.hollowCandleStyle.wickColor.value(),c=this.findBar(e,!1,n),h=this.findPrevBar(e,!1,n), h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?(i.barColor=r,i.barBorderColor=a,i.barWickColor=u):(i.barColor=s,i.barBorderColor=l,i.barWickColor=d),c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:r=o.haStyle.upColor.value(),s=o.haStyle.downColor.value(),a=o.haStyle.borderUpColor.value(),l=o.haStyle.borderDownColor.value(),u=o.haStyle.wickUpColor.value(),d=o.haStyle.wickDownColor.value(),c=this.findBar(e,t,n),o.haStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(e,t,n),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_BASELINE:c=this.findBar(e,t,n),_=o.baselineStyle,f=this._series.priceScale(),m=Math.round(f.height()*(Math.abs(100-_.baseLevelPercentage.value())/100)),y=this._series.firstValue(),g=f.coordinateToPrice(m,y),c[TradingView.CLOSE_PLOT]>g?i.barColor=o.baselineStyle.topLineColor.value():i.barColor=o.baselineStyle.bottomLineColor.value()}return i},o.prototype.getSeriesBars=function(e){return e?this._series.nsBars():this._series.bars()},o.prototype._findBarFieldValue=function(e,t,i){var n=this.getSeriesBars(i).valueAt(e);if(null!==n)return n[t]},o.prototype.findBar=function(e,t,i){return i?i.value:this.getSeriesBars(t).valueAt(e)||[]},o.prototype.findPrevBar=function(e,t,i){var n,o;return i&&i.previousValue?i.previousValue:(n=this._series.bars(),o=n._search(e,s.Exact),null!==o&&o>0?this._series.bars()._valueAt(o-1):[])},inherit(r,n),r.prototype.applyBarStyle=function(e,t,i){var n,o,r,s,a,l,c,h,u,d,p,_,f;return i||(i={}),t?i:(n=this._study.properties(),n.visible.value()?(o=this._study.metaInfo(),(r=this._study.data())&&0!==r.size()?(s=o.plots[this._plotIndex],this._study.getMinFirstBarIndexForPlot(s.id)>e?i:(a=n.styles[s.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(s.id),null===(c=r.valueAt(e-l))?i:null==(h=c[this._plotIndex+1])?i:(h=Math.round(h),u=o.plots[this._plotIndex].palette,d=n.palettes,p=d[u],_=o.palettes[u].valToIndex?o.palettes[u].valToIndex[h]:h,f=p.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i)))):i):i)},t.SeriesBarColorer=o,t.StudyBarColorer=r},function(e,t,i){"use strict";function n(e){this.items=e.items,this.barSpacing=e.barSpacing,this.colorUp=e.colorup,this.colorDn=e.colordown,this.colorBorderUp=e.colorBorderUp,this.colorBorderDown=e.colorBorderDown,this.width=this._calculateWidth(e.barSpacing),this.minHeight=e.minHeight,this.vertOffset=this._calculateVerticalOffset(e.barSpacing)}function o(e,t,i,n){this.x=e,this.y=t,this.height=i,this.isUp=n}var r=i(6).Point,s=i(9).HitTestResult;n.prototype._calculateVerticalOffset=function(e){return Math.round((e||0)/4)},n.prototype._calculateMinHeight=function(e){return this.width||this._calculateWidth(e)},n.prototype._calculateWidth=function(e){var e=e||this.barSpacing;return Math.round(e/2)},n.prototype.draw=function(e){ var t,i,n,o,r,s,a,l=this.width,c=l<4,h=Math.max(parseInt(l/2),1),u=Math.round(this.width/2),d=Math.round(this.width);for(e.translate(1,1),t=0,i=this.items.length;t=22)return t;for(i={},n=0,o=0;void 0!==(r=t[o]);)s=t[r.id],r.isFake&&(r.id="in_"+n++),i[o]=r,i[r.id]=s,o++;return i}]}var o=i(7).assert,r=i(163).Version,s=i(4).getLogger("Chart.Study.Versioning"),a=i(348),l=i(26);n.prototype.updateMetaInfo=function(e){var t,i,n;if(!e)return e;for(o(!e.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),t=null,i=this._studiesMetainfo,n=0;n=12&&c<=26){for(h={},a=0;a=12&&h<=26)for(u=r.columns,r.columns=[],d=0;do&&s.logWarn("Bad integer input max value in metaInfo id="+e.id+" title="+e.description)},n._fixInputsMaxValue=function(e,t){var i,o,r,s,a,l;if(!TradingView.isAbsent(t)){if(i=n.INPUT_MAX_VALUE,t.inputs)for(o=0;oi&&(r.max=i);if(e&&e.inputs){s=n.splitInputs(e.inputs),a=s.arr;for(l in a)r=a[l],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);e.inputs=TradingView.merge(s.obj,s.arr)}}},n.prototype.patchPropsStateAndMetaInfo=function(e,t,i){var o,r,s,a,c,h,u,d,p,_,f,m,y,g,v,S,b,w;if("Script$BOOKER"!==t.productId||t.alerts||delete e.alerts,n._fixInputsOrder(e,t),n._fixInputsMaxValue(e,t),o=n.splitInputs(e.inputs),e.inputs=o.obj,l.versionOf(t)o&&(o=n);e[o+1]=t},n.splitInputs=function(e){var t,i={},n={};for(t in e)isNumber(parseInt(t,10))?i[t]=e[t]:n[t]=e[t];return{arr:i,obj:n}},n.findInputKeyById=function(e,t){var i,n=null;for(i in e)if(isNumber(parseInt(i,10))&&e[i].id===t){n=i;break}return n},n.getInputKeyById=function(e,t){var i=n.findInputKeyById(e,t);if(!i)throw Error("Cannot find input with id: "+t);return i},e.exports=n},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LineToolPriceAxisView",function(){return s}),n=i(1),o=i(7),i.n(o),r=i(58),s=function(e){ function t(t,i){var n=e.call(this)||this;return n._activeBackground="#0F6DBF",n._background="#5592C9",n._active=!1,n._source=t,n._data=i,n}return n.c(t,e),t.prototype.setActive=function(e){this._active=e},t.prototype.setBackground=function(e){this._background=e},t.prototype._updateRendererData=function(e){var t,i,n,o,r,s,a,l;e.visible=!1,t=this._source.model(),t.timeScale()&&!t.timeScale().isEmpty()&&(null===(i=this._source.priceScale())||i.isEmpty()||(t.selectedSource()===this._source||this._source.isForcedDrawPriceAxisLabel())&&null!==t.timeScale().visibleBars()&&(n=this._source.axisPoints(),o=this._data.pointIndex,n.length<=o||(r=n[o],isFinite(r.price)&&(s=this._source.ownerSource(),null!=(a=null!==s?s.firstValue():null)&&(l=this._active?this._activeBackground:this._background,this._data.backgroundProperty&&(l=this._data.backgroundProperty.value()),e.background=l,e.borderColor="#2E84A6",e.color=this.generateTextColor(l),e.coordinate=i.priceToCoordinate(r.price,a),e.text=this._formatPrice(r.price,a),e.visible=!0)))))},t.prototype._formatPrice=function(e,t){return Object(o.ensureNotNull)(this._source.priceScale()).formatPrice(e,t)},t}(r.a)},function(e,t,i){"use strict";var n,o;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeAxisView",function(){return o}),n=i(24),i.n(n),o=function(){function e(){this._text="",this._background="#585858",this._coordinate=0}return e.prototype.text=function(){return this._text},e.prototype.background=function(){return this._background},e.prototype.color=function(){return"black"===Object(n.rgbToBlackWhiteString)(Object(n.parseRgb)(this._background),150)?"white":"black"},e.prototype.coordinate=function(){return this._coordinate},e}()},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeAxisViewRenderer",function(){return r}),n=i(46),i.n(n),o=/[1-9]/g,r=function(){function e(){this._data=null}return e.prototype.setData=function(e){this._data=e},e.prototype.draw=function(e,t){var i,r,s,a,l,c,h,u,d,p,_,f,m,y;null!==this._data&&!1!==this._data.visible&&0!==this._data.text.length&&(e.font=t.font,(i=Math.round(t.widthCache.measureText(e,this._data.text,o)))<=0||(r=t.paddingHorizontal,s=i+2*r,a=s/2,l=this._data.width,c=this._data.coordinate,h=Math.floor(c-a)+.5,h<0?(c+=Math.abs(0-h),h=Math.floor(c-a)+.5):h+s>l&&(c-=Math.abs(l-(h+s)),h=Math.floor(c-a)+.5),u=h+s,d=.5,p=d+t.borderSize+t.paddingTop+t.fontSize+t.paddingBottom,e.fillStyle=this._data.background,e.lineWidth=1,Object(n.drawRoundRect)(e,h,d,u-h,p-d,1),e.fill(),_=Math.round(this._data.coordinate+1),f=d,m=f+t.borderSize+t.tickLength,e.strokeStyle=this._data.color,e.beginPath(),e.moveTo(_,f),e.lineTo(_,m),e.stroke(),y=p-t.baselineOffset-t.paddingBottom,e.textAlign="left",e.fillStyle=this._data.color,e.fillText(this._data.text,h+r,y)))},e}()},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"AbbreviatedDateTimeFormatter",function(){return s}),n=i(130),o=i(21),r={1:window.t("Jan"),2:window.t("Feb"),3:window.t("Mar"),4:window.t("Apr"), 5:window.t("May"),6:window.t("Jun"),7:window.t("Jul"),8:window.t("Aug"),9:window.t("Sep"),10:window.t("Oct"),11:window.t("Nov"),12:window.t("Dec")},s=function(){function e(e){void 0===e&&(e=!1),this._dwm=e}return e.prototype.format=function(e){var t=this._formatDate(e);return this._dwm||(t+=" · "+new n.TimeFormatter("%h:%m").format(e)),t},e.prototype.formatLocal=function(e){var t=this._formatDateLocal(e);return this._dwm||(t+=" · "+new n.TimeFormatter("%h:%m").formatLocal(e)),t},e.prototype._formatDate=function(e){var t,i,n;return o.customFormatters&&o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.format(e):(t=Object(o.numberToStringWithLeadingZero)(e.getUTCDate(),2),i=r[e.getUTCMonth()+1],n=(""+e.getUTCFullYear()).substring(2),t+" "+i+" '"+n)},e.prototype._formatDateLocal=function(e){var t,i,n;return o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.formatLocal?o.customFormatters.dateFormatter.formatLocal(e):o.customFormatters.dateFormatter.format(e):(t=Object(o.numberToStringWithLeadingZero)(e.getDate(),2),i=r[e.getMonth()+1],n=(""+e.getFullYear()).substring(2),t+" "+i+" '"+n)},e}()},function(e,t,i){"use strict";function n(e,t){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},o.call(this,e,t)}var o=i(0).LineDataSource;inherit(n,o),n.POINTS_COUNT=1,n.prototype.pointsCount=function(){return n.POINTS_COUNT},n.prototype.hasContextMenu=function(){return!1},n.prototype.state=function(){return null},n.prototype.startMoving=function(){o.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},n.prototype.endMoving=function(){o.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},n.prototype.correctPoints=function(e){var t,i,n,o,r;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,t=this.priceScale(),i=t.mainSource().base(),n=1/i,o=0;o100&&g.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["entryPrice","stopPrice","targetPrice","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=n.version,this._entryPriceAxisView=new l(this,{colorProperty:g.linecolor,priceProperty:g.entryPrice}),this._stopPriceAxisView=new l(this,{colorProperty:g.stopBackground,priceProperty:g.stopPrice}),this._profitPriceAxisView=new l(this,{colorProperty:g.profitBackground,priceProperty:g.targetPrice}),i.e(0).then(function(e){var t=i(789).RiskRewardPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i,o;this._constructor="LineToolRiskRewardShort",i=t||new h("linetoolriskrewardshort"),n.call(this,e,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount), o.accountSize.subscribe(this,this._recalculateAmount),o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}function r(e,t){var i,o;this._constructor="LineToolRiskRewardLong",i=t||new h("linetoolriskrewardlong"),n.call(this,e,i),o=this.properties(),o.entryPrice.subscribe(this,this._recalculateQty),o.stopPrice.subscribe(this,this._recalculateQty),o.riskSize.subscribe(this,this._recalculateQty),o.entryPrice.subscribe(this,this._recalculateAmount),o.profitLevel.subscribe(this,this._recalculateAmount),o.stopLevel.subscribe(this,this._recalculateAmount),o.accountSize.subscribe(this,this._recalculateAmount),o.riskSize.subscribe(this,this._recalculateAmount),o.qty.subscribe(this,this._recalculateAmount)}var s=i(7).ensureNotNull,a=i(0).LineDataSource,l=i(570).LineToolRiskRewardPriceAxisView,c=i(32),h=i(3).DefaultProperty,u=i(105).NumericFormatter,d=i(2).propertyPages,p=i(352).RiskRewardPointIndex;inherit(n,a),n.prototype.riskFormatter=function(e){return"percents"===e?this._riskInPercentsFormatter:this._riskInMoneyFormatter},n.prototype.getRiskStep=function(e){return"percents"===e?.01:1},n.prototype._roundValue=function(e){return parseFloat(e.toFixed(2))},n.prototype._recalculateRisk=function(){var e=this.properties(),t=e.riskDisplayMode.value(),i=e.riskSize.value(),n=e.accountSize.value(),o=e.risk.value();o="percents"===t?this._roundValue(i/n*100):this._roundValue(n/100*o),this._riskInChange=!0,e.risk.setValue(this.riskFormatter(t).format(o)),this._riskInChange=!1},n.prototype._recalculateRiskSize=function(){var e,t,i,n;this._riskInChange||(e=this.properties(),t=e.risk.value(),i=e.riskDisplayMode.value(),n=e.accountSize.value(),"percents"===i?e.riskSize.setValue(t/100*n):t>n?(e.risk.setValue(n),e.riskSize.setValue(n)):e.riskSize.setValue(t))},n.version=2,n.prototype.i18nCache={title:$.t("Risk/Reward")},n.prototype.lastBarData=function(){var e,t,i,n,o,r=this._model.mainSeries().bars().firstIndex(),a=this._model.mainSeries().bars().lastIndex();return null===r||null===a||isNaN(r)||isNaN(a)?null:(e=this.points(),4===e.length?(t=e[p.ActualClose],t.index=1&&(n=[],n.push(this._points[0]),o=this._points[0],o={price:o.price,index:o.index+50},n.push(o),this._points[1]&&n.push(this._points[1]),this._points[2]&&n.push(this._points[2]),this._points=n,this._timePoint.length>=1&&(r=[],o=this._timePoint[0],r.push(o),s={price:o.price,time_t:o.time_t,offset:o.offset+50},r.push(s),this._timePoint[1]&&n.push(this._points[1]),this._timePoint[2]&&n.push(this._points[2]),this._timePoint=r))},n.prototype.checkAlert=function(){this.recalculate()},n.prototype.priceAxisViews=function(e,t){ return this.isSourceHidden()?null:t!==this.priceScale()||this._model.paneForSource(this)!==e?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]},n.prototype.updateAllViews=function(){this.isActualSymbol()&&this._properties.visible.value()&&(c.hideAllDrawings().value()&&this.userEditEnabled()||(a.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},n.prototype.setPoint=function(e,t){switch(e){case 0:t.price=this._roundPrice(t.price),a.prototype.setPoint.call(this,e,t),this.recalculate();break;case 1:this.isActualSymbol()&&this.properties().stopPrice.setValue(this.preparseStopPrice(t.price));break;case 2:this.isActualSymbol()&&this.properties().targetPrice.setValue(this.preparseProfitPrice(t.price));break;case 3:t.price=this._roundPrice(t.price),a.prototype.setPoint.call(this,1,t),this.recalculate()}},n.PriceProperty=function(e,t){a.PointPriceProperty.call(this,e,t)},inherit(n.PriceProperty,a.PointPriceProperty),n.PriceProperty.prototype.setValue=function(e){var t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},n.StopPriceProperty=function(e){n.PriceProperty.call(this,e,1)},inherit(n.StopPriceProperty,n.PriceProperty),n.StopPriceProperty.prototype.value=function(){var e=this._lineSource.stopPrice(),t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},n.StopPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(t),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},n.TargetPriceProperty=function(e){n.PriceProperty.call(this,e,2)},inherit(n.TargetPriceProperty,n.PriceProperty),n.TargetPriceProperty.prototype.value=function(){var e=this._lineSource.profitPrice(),t=this._lineSource.ownerSource().formatter(),i=t.parse(t.format(e));return i.price?i.price:i.value},n.TargetPriceProperty.prototype.setValue=function(e){var t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(t),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return this.i18nCache.title},n.prototype.name=function(){return"Risk/Reward"},n.prototype.addPoint=function(e){var t,i;return e.price=this._roundPrice(e.price),a.prototype.addPoint.call(this,e,null,!0),t={price:e.price,index:e.index+50},a.prototype._addPointIntenal.call(this,t,null,!0),i=this.calculateActualEntry(e,t),i&&(a.prototype._addPointIntenal.call(this,i,null,!0), (t=this.findClosePoint(i,t))&&a.prototype._addPointIntenal.call(this,t,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.prototype._roundPrice=function(e){var t=this._model.mainSeries().base();return Math.round(e*t)/t},n.prototype.recalculate=function(){var e,t,i,n,o;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(e=this.properties().targetPrice.value(),t=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],n=this.calculateActualEntry(this.points()[0],this.points()[1]),n&&(i.push(n),(o=this.findClosePoint(n,this.points()[1]))&&i.push(o)),this._points=i,e!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),t!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},n.prototype.start=function(){a.prototype.start.call(this),this.recalculate()},n.prototype.startMoving=function(e){e.price=this._roundPrice(e.price),a.prototype.startMoving.call(this,e)},n.prototype.move=function(e){e.price=this._roundPrice(e.price),a.prototype.move.call(this,e),this.recalculate(),this._entryPriceAxisView.update()},n.prototype.correctPoints=function(e){return!!this.isActualSymbol()&&a.prototype.correctPoints.call(this,[e[0],e[1]])},n.prototype.entryPrice=function(){return this.points()[0].price},n.prototype.findClosePoint=function(e,t){var i,n,o,r=this._model.mainSeries().bars(),a=s(r.firstIndex()),l=Math.max(e.index,a),c=s(r.lastIndex());for(i=l;i<=Math.min(c,t.index);i++)if(n=s(r.valueAt(i)),null!=(o=this.checkStopPrice(n)))return{index:i,price:o};return null},n.prototype.calculateActualEntry=function(e,t){var i,n,o=this._model.mainSeries().bars(),r=s(o.firstIndex()),a=Math.max(e.index,r),l=e.price,c=s(o.lastIndex());for(i=a;i<=Math.min(c,t.index);i++)if(n=s(o.valueAt(i)),n[TradingView.HIGH_PLOT]>=l&&n[TradingView.LOW_PLOT]<=l)return{index:i,price:l};return null},n.prototype.axisPoints=function(){var e,t,i;if(!this._points[p.ActualEntry])return[];if(e=this._points[p.ActualEntry],t=null,4===this._points.length)t=this._points[p.ActualClose];else{if(!(i=this.lastBarData()))return[];t={index:i.index,price:i.closePrice}}return[e,t]},n.prototype.getInputsPropertyPage=function(){return d.LineToolRiskRewardInputsPropertyPage},n.prototype.getStylesPropertyPage=function(){return d.LineToolRiskRewardStylesPropertyPage},inherit(o,n),o.prototype.i18nCache={title:$.t("Risk/Reward short")},o.prototype._recalculateQty=function(){var e,t,i,n,o;0!==this.points().length&&(e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),o=Math.floor(n/Math.abs(i-t)),e.qty.setValue(o))},o.prototype._recalculateAmount=function(){var e,t,i,n,o,r,s,a;0!==this.points().length&&(e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),o=e.stopPrice.value(),r=e.targetPrice.value(),s=this._roundValue(t+(i-r)*n),a=this._roundValue(t-(o-i)*n),e.amountTarget.setValue(s),e.amountStop.setValue(a))}, o.prototype.title=function(){return this.i18nCache.title},o.prototype.name=function(){return"Risk/Reward short"},o.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},o.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},o.prototype.calculatePL=function(e){return this.entryPrice()-e},o.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},o.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},o.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.HIGH_PLOT]>=t?this.stopPrice():e[TradingView.LOW_PLOT]<=i?this.profitPrice():null},r.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(r,n),r.prototype._recalculateQty=function(){var e,t,i,n,o;0!==this.points().length&&(e=this.properties(),t=e.entryPrice.value(),i=e.stopPrice.value(),n=e.riskSize.value(),o=Math.floor(n/Math.abs(t-i)),e.qty.setValue(o))},r.prototype._recalculateAmount=function(){var e,t,i,n,o,r,s,a;0!==this.points().length&&(e=this.properties(),t=e.accountSize.value(),i=e.entryPrice.value(),n=e.qty.value(),o=e.stopPrice.value(),r=e.targetPrice.value(),s=this._roundValue(t+(r-i)*n),a=this._roundValue(t-(i-o)*n),e.amountTarget.setValue(s),e.amountStop.setValue(a))},r.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(e){return e-this.entryPrice()},r.prototype.preparseStopPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(e,t)},r.prototype.preparseProfitPrice=function(e){e=this._roundPrice(e);var t=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(e,t)},r.prototype.checkStopPrice=function(e){var t=this.stopPrice(),i=this.profitPrice();return e[TradingView.LOW_PLOT]<=t?this.stopPrice():e[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},r.prototype.title=function(){return this.i18nCache.title},r.prototype.name=function(){return"Risk/Reward long"},t.LineToolRiskReward=n,t.LineToolRiskRewardLong=r,t.LineToolRiskRewardShort=o}).call(t,i(48).PriceRange)},function(e,t,i){"use strict";(function(e){function n(t,i,o){var r,s;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new c(o.properties().scalesProperties,r),this.m_rightPriceScale.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,this.m_rightPriceScale)),s=i.leftAxisProperties.state(),s.autoScale=!0,this.m_leftPriceScale=new c(o.properties().scalesProperties,s), this.m_leftPriceScale.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,this.m_leftPriceScale)),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=o,this._tagsChanged=new e,this._destroyed=new e,this._leftPriceScaleRatioChanged=new e,this._rightPriceScaleRatioChanged=new e,this._leftPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_timeScale.barSpacingChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale),this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale),i.topMargin.listeners().subscribe(this,n.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,n.prototype._updateMargins),this._updateMargins(),this._stretchFactor=n.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1}var o=i(272).ExecutionsPositionController,r=i(0).LineDataSource,s=i(48).PriceRange,a=i(28).PriceDataSource,l=i(4).getLogger("Chart.Pane"),c=i(177).PriceScale,h=i(121).scaleRatio,u=i(121).priceRangeByScaleRatio,d=i(121).barSpacingByScaleRatio;n.DEFAULT_STRETCH_FACTOR=1e3,n.PANE_ANIMATION_DURATION=500,n.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},n.prototype.destroy=function(){var e,t;for(this._leftPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_timeScale.barSpacingChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange), this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this.m_leftPriceScale.modeChanged().unsubscribeAll(this),this.m_rightPriceScale.modeChanged().unsubscribeAll(this),this._properties.topMargin.listeners().unsubscribe(this,n.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,n.prototype._updateMargins),e=0;e0?1/0:i<0?-1/0:e.zorder(),[e,i,t]}).sort(function(e,t){return e[1]-t[1]||e[2]-t[2]}).map(function(e){return e[0]})},n.prototype._updateMargins=function(){var e,t,i=.01*this._properties.topMargin.value(),n=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(n),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(n),e=0;en)&&(n=i));return null===n&&(n=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(e){e.zorder()>n&&e.setZorder(e.zorder()+1)}),n+1},n.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},n.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},n.prototype.addDataSource=function(e,t,i){var n;e instanceof r&&!i?(n=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=n)):n=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(e,t,n)},n.prototype.insertDataSource=function(e,t,i){var o,r,s;this.m_dataSources.push(e),o=!1,e===this._model.mainSeries()?(this.m_mainDataSource=e,o=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=e,o=!0),e._isOverlay=!1,null!==t||e.preferNoScale()||this.canHaveMoreNoScaleSources()||(t=this.rightPriceScale()),null===t&&(r=this.m_rightPriceScale.topMargin(),s=this.m_rightPriceScale.bottomMargin(),e.metaInfo&&"Volume@tv-basicstudies"===e.metaInfo().id&&(r=.75,s=0),t=new c(this._model.properties().scalesProperties),t.setHeight(this.m_height),t.setTopMargin(r),t.setBottomMargin(s),e._isOverlay=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),e.onTagsChanged&&e.onTagsChanged().subscribe(this,n.prototype.onSourceTagsChanged),e.setZorder(i),o&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(e.constructor,a)&&this.recalculatePriceScale(t),this.invalidateSourcesCache()},n.prototype.removeDataSource=function(e,t){var i,o=this.m_dataSources.indexOf(e);if(-1===o)return void l.logDebug("removeDataSource: invalid data source");e._isOverlay=!1,this.m_dataSources.splice(o,1),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(e)?(this.m_leftPriceScale.removeDataSource(e),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(e)&&(this.m_rightPriceScale.removeDataSource(e),i=this.m_rightPriceScale), e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,n.prototype.onSourceTagsChanged),TradingView.isInherited(e.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(e.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},n.prototype.startScalePrice=function(e,t){e.startScale(t)},n.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},n.prototype.endScalePrice=function(e){e.endScale()},n.prototype.startScrollPrice=function(e,t){e.startScroll(t)},n.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},n.prototype.endScrollPrice=function(e){e.endScroll()},n.prototype.setPriceAutoScale=function(e,t){if(e.setMode({autoScale:t}),this.timeScale().isEmpty())return void e.setPriceRange(null);this.recalculatePriceScale(e)},n.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},n.prototype.updateAllViews=function(){for(var e=0;e0&&!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),e.recalculatePriceRange(i)),e.updatePaneViews())},n.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBars();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},n.prototype.recalculate=function(){var e,t;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),e=0;et&&(t=n.zorder());return{minZOrder:e,maxZOrder:t}},n.prototype.isZOrderAvailable=function(e){var t,i;for(t=0;t0&&t<0?(o=a[l-1].zorder(),r=e.zorder(),a[l-1].setZorder(r), e.setZorder(o)):l0&&(s=a[l+1].zorder(),r=e.zorder(),a[l+1].setZorder(r),e.setZorder(s)),this.invalidateSourcesCache()},n.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},n.prototype.onTagsChanged=function(){return this._tagsChanged},n.prototype.onDestroyed=function(){return this._destroyed},n.prototype.dumpPriceScale=function(e){var t,i,n,o=e.dataSources(),r=[];for(t=0;t=0;e--)TradingView.isInherited(this.m_dataSources[e].constructor,TradingView.Series)&&this.m_dataSources.splice(e,1)},n.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,a)&&e.showInObjectTree()&&!e.isNoScale())}).length},n.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},n.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,a))||this.canHaveMoreNoScaleSources()},n.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new o(this,this._model.timeScale())),this._executionsPositionController},n.prototype.isLast=function(){var e=this._model.panes();return e[e.length-1]===this},n.prototype.setMaximized=function(e){this._maximized=e},n.prototype.isMaximized=function(){return this._maximized},n.prototype.isMainPane=function(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach(function(i){t||(t=i===e)}),this._isMainPane=t,t},n.prototype.properties=function(){return this._properties},n.prototype._mainSourceVisiblePriceRange=function(e){var t=this.m_timeScale.visibleBars();return null!==t?e.mainSource().priceRange(t.firstBar(),t.lastBar()):new s(-.5,.5)},n.prototype.applyLeftPriceScaleRatio=function(e){this._lastLeftPriceScaleRatio!==e&&(this._setNewPriceRangeByScaleRatio(this.m_leftPriceScale,e,this._mainSourceVisiblePriceRange(this.m_leftPriceScale),!0,!0),this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale)))},n.prototype.applyRightPriceScaleRatio=function(e){this._lastRightPriceScaleRatio!==e&&(this._setNewPriceRangeByScaleRatio(this.m_rightPriceScale,e,this._mainSourceVisiblePriceRange(this.m_rightPriceScale),!0,!0),this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale)))},n.prototype.isLeftPriceScaleLocked=function(){return!this.m_leftPriceScale.isLog()&&this.m_leftPriceScale.isLockScale()}, n.prototype.isRightPriceScaleLocked=function(){return!this.m_rightPriceScale.isLog()&&this.m_rightPriceScale.isLockScale()},n.prototype.leftPriceScaleRatio=function(){return null===this._lastLeftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale)),this._lastLeftPriceScaleRatio},n.prototype.rightPriceScaleRatio=function(){return null===this._lastRightPriceScaleRatio&&(this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale)),this._lastRightPriceScaleRatio},n.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&(this._lastLeftPriceScaleRatio=null,this._lastRightPriceScaleRatio=null,this._model.mainSeriesScaleRatioPropertyOnChanged())},n.prototype._applyOldScaleRatioToPriceScale=function(e,t){if(this._isRecalculatingScales||null===t||void 0===t)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e)),this._isRecalculatingScales=!1},n.prototype._applyOldScaleRatioToTimeScale=function(e,t){if(this._isRecalculatingScales||null===t||void 0===t)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(e,t),this._isRecalculatingScales=!1},n.prototype._tryToApplyNewLeftPriceScaleRatio=function(e){if(this._lastLeftPriceScaleRatio===e||this.m_leftPriceScale.isLog())return!1;this._leftPriceScaleRatioChanged.fire(this._lastLeftPriceScaleRatio,e),this._lastLeftPriceScaleRatio=e},n.prototype._tryToApplyNewRightPriceScaleRatio=function(e){if(this._lastRightPriceScaleRatio===e||this.m_rightPriceScale.isLog())return!1;this._rightPriceScaleRatioChanged.fire(this._lastRightPriceScaleRatio,e),this._lastRightPriceScaleRatio=e},n.prototype._recalculatePriceScaleByScaleRatio=function(){this.isMainPane()&&(this.m_leftPriceScale.mainSource()&&(this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))),this.m_rightPriceScale.mainSource()&&(this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))))},n.prototype._recalculateTimeScaleByLeftScaleRatio=function(){this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))},n.prototype._recalculateTimeScaleByRightScaleRatio=function(){this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))},n.prototype._setNewPriceRangeByScaleRatio=function(e,t,i,n,o){var r=u(e,this.m_timeScale.barSpacing(),t) ;e.setPriceRange(null!==r?r:i,n,o)},n.prototype._setMinMaxPriceRange=function(e,t){var i=u(e,this.m_timeScale.maxBarSpacing(),t),n=u(e,this.m_timeScale.minBarSpacing(),t);null!==i&&e.setMaxPriceRange(i),null!==n&&e.setMinPriceRange(n)},n.prototype._onLeftPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_leftPriceScale,this._lastLeftPriceScaleRatio)},n.prototype._onRightPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_rightPriceScale,this._lastRightPriceScaleRatio)},n.prototype._setNewBarSpacingByScaleRatio=function(e,t){var i=this.m_timeScale.getValidBarSpacing(d(e,t));this.m_timeScale.isValidBarSpacing(i)&&this.m_timeScale.setBarSpacing(i)},n.prototype._onPriceScaleModeChanged=function(e,t,i){if(t.percentage!==i.percentage||t.indexedTo100!==i.indexedTo100){var n=this.timeScale().visibleBars();null!==n&&(e.recalculatePriceRange(n),e.updatePaneViews())}},t.Pane=n}).call(t,i(8))},function(e,t,i){"use strict";(function(e,n){function o(e,t){return t<0&&(e=-e),e/100*t+t}function r(e,t){var i=100*(e-t)/t;return t<0?-i:i}function s(e,t){var i=r(e.minValue(),t),n=r(e.maxValue(),t);return new S(i,n)}function a(e,t){return e-=100,t<0&&(e=-e),e/100*t+t}function l(e,t){var i=100*(e-t)/t+100;return t<0?-i:i}function c(e,t){var i=l(e.minValue(),t),n=l(e.maxValue(),t);return new S(i,n)}function h(e,t){if(this.m_base=e,this.m_integralDividers=t,this.m_fractionalDividers=[],_.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function u(e,t,i,n){this.m_marks=[],this.m_base=t,this.m_priceScale=e,this._currentFormatBase=0,this._coordinateToLogicalFunc=i,this._logicalToCoordinateFunc=n}function d(t,i){var o;i=Object.assign({},p,i),this._properties=new e(i),this._scalesProperties=t,this.m_height=0,this._internalHeightCache=null,this._internalHeightChanged=new n,this.m_priceRange=null,this._priceRangeChanged=new n,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new n,o=this,this._coordinateToLogicalFunc=function(e,t){return o._coordinateToLogical(e,t)},this._logicalToCoordinateFunc=function(e,t,i){return o._logicalToCoordinate(e,t,i)},this.m_markBuilder=new u(this,100,this._coordinateToLogicalFunc,this._logicalToCoordinateFunc),this._modeChanged=new n,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,o=this,this._properties.listeners().subscribe(null,function(){o.mainSource()&&o.mainSource().model()&&o.mainSource().model().fullUpdate()}),this._scalesProperties.listeners().subscribe(this,function(){ this._marksCache=null})}var p,_=i(50),f=i(0).LineDataSource,m=i(28).PriceDataSource,y=i(63).Series,g=i(21).PriceFormatter,v=i(70).PercentageFormatter,S=i(48).PriceRange;h.prototype.TICK_SPAN_EPSILON=1e-9,h.prototype.tickSpan=function(e,t,i){var n,o=0===this.m_base?0:1/this.m_base,r=this.TICK_SPAN_EPSILON,s=Math.pow(10,Math.max(0,Math.ceil(_.log10(e-t)))),a=0;for(a=0,n=this.m_integralDividers[0];s>o+r&&_.greaterOrEqual(s,o,r)&&_.greaterOrEqual(s,i*n,r)&&_.greaterOrEqual(s,1,r);++a,n=this.m_integralDividers[a%this.m_integralDividers.length])s/=n;if(s<=o+r&&(s=o),s=Math.max(1,s),this.m_fractionalDividers.length>0&&_.equal(s,1,r))for(a=0,n=this.m_fractionalDividers[0];s>o+r&&_.greaterOrEqual(s,i*n,r);++a,n=this.m_fractionalDividers[a%this.m_fractionalDividers.length])s/=n;return s},u.prototype.TICK_DENSITY=2.5,u.prototype.base=function(){return this.m_base},u.prototype.setBase=function(e){if(e<0)throw new RangeError("base < 0");this.m_base=e},u.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},u.prototype.tickSpan=function(e,t){var i,n,o,r,s,a,l;if(e=n?1:-1,l=null,c=d.formatter(),h=o-s;h>n;h-=r)u=this._logicalToCoordinateFunc(h,t,!0),null!==l&&Math.abs(u-l)30)throw new RangeError("invalid margin");this.m_topMargin!==e&&(this.m_topMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},d.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},d.prototype.setBottomMargin=function(e){if(!isNumber(e))throw new TypeError("invalid margin");if(e<0||e>30)throw new RangeError("invalid margin");this.m_bottomMargin!==e&&(this.m_bottomMargin=e,this._invalidateInternalHeightCache(),this._marksCache=null)},d.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var e=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=e,e},d.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()},d.prototype.internalHeightChanged=function(){return this._internalHeightChanged},d.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},d.prototype.priceRangeChanged=function(){return this._priceRangeChanged},d.prototype.setPriceRange=function(e,t,i){var n,o,r;if(!(e instanceof S))throw new TypeError("incorrect price range");return n=this.m_priceRange,!!(t||null===n&&null!==e||null!==n&&!n.equals(e))&&(o=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(e),r=null!==this.m_minPriceRange&&e.containsStrictly(this.m_minPriceRange),!(this.isLockScale()&&!t&&(o||r))&&(this._marksCache=null,this.m_priceRange=e,void(i||this._priceRangeChanged.fire(n,e))))},d.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},d.prototype.invertedCoordinate=function(e){return this.height()-1-e},d._logicalOffset=4,d._coordOffset=1e-4,d.prototype._toLog=function(e){var t,i=Math.abs(e);return i<1e-8?0:(t=_.log10(i+d._coordOffset)+d._logicalOffset,e<0?-t:t)},d.prototype.priceToLogical=function(e){return this.isLog()&&e?this._toLog(e):e},d.prototype._fromLog=function(e){var t,i=Math.abs(e);return i<1e-8?0:(t=Math.pow(10,i-d._logicalOffset)-d._coordOffset,e<0?-t:t)},d.prototype.logicalToPrice=function(e){return this.isLog()?this._fromLog(e):e},d.prototype._logicalToCoordinate=function(e,t,i){var n,o;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.priceToLogical(e),n=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(e-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(n),i?o:Math.round(o))},d.prototype.priceToCoordinate=function(e,t,i){return this.isPercentage()?e=r(e,t):this.isIndexedTo100()&&(e=l(e,t)),this._logicalToCoordinate(e,t,i)},d.prototype.pointsArrayToCoordinates=function(e,t){var i,n,o,s,a,c,h,u,d;if(this.makeSureItIsValid(),i=this.bottomMargin()*this.height(), n=this.priceRange().minValue(),o=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(o-n),this.isPercentage())for(c=0;c.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=n,this._studyTopMargin=i,this._marksCache=null,this._invalidateInternalHeightCache()),e?(e.minValue()===e.maxValue()&&(e=new S(e.minValue()-.5,e.maxValue()+.5)),this.setPriceRange(e)):this.m_priceRange||this.setPriceRange(new S(-.5,.5)),this._invalidatedForRange.isValid=!0}},d.prototype.sourcesToUpdateViews=function(){var e,t;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],e=0;e6&&(e.textAlign="center",e.textBaseline="middle",e.font="bold "+t.labelFontSize+"px Arial",e.fillStyle=t.labelFontColor,e.fillText(t.label,t.x,t.y))},o.prototype.hitTest=function(e){var t,i;for(i=this._plates.length-1;i>=0;--i)if(t=this._hitTestDot(this._plates[i],e))return t;return null},o.prototype._hitTestDot=function(e,t){var i=this._dotTransform(e),n=new s(i.x,i.y);return a(t,n,Math.max(i.radius,8))?new l(l.REGULAR,e):null},r.prototype._createLayout=function(){throw Error("Child class must override this member")},r.prototype._updatePlate=function(e){throw Error("Child class must override this member")},r.prototype._getContainer=function(e){return this._container&&this._context===e||(this._context=e,this._container=$(e.canvas).parent()),this._container},r.prototype._plateArrowSize=14,r.prototype.showPlate=function(e,t){var i,n,o,r,s,a,l,c;this._currentId===e.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=e.id,this._createLayout(),this._getContainer(t).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),n=Math.round(e.barWidth/2),n>15&&(n=15),n<10&&(n=10),this._updatePlate(e),o=t.canvas.getBoundingClientRect(), r=e.x-this._layout.outerWidth()=n.Std.max(l,c),a-.5*l+.25*h,n.Std.iff(l>=n.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return n.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*u/e*50)},this.f_1=function(e,t){var i=this.f_0(e,t);return n.Std.cum(i,t)},this.main=function(e,t){var i,n;return this._context=e, this._input=t,i=this._input(0),n=this.f_1(i,this._context),[n]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(e,t){return n.Std.gt(e,t)},this.f_1=function(e,t){return n.Std.lt(e,t)},this.f_2=function(e,t){return 0===t?e:e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=this.f_1(n.Std.close(this._context),n.Std.open(this._context)),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_2(s,c),u=h,[u]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=n.Std.alma(a,o,r,s),[l]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(e,t){return 100*(e+t)/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t, i=this._input(0),o=n.Std.high(this._context),r=i+1,s=this._context.new_var(o),a=n.Std.highestbars(s,r,this._context),l=this.f_0(a,i),c=n.Std.low(this._context),h=this._context.new_var(c),u=n.Std.lowestbars(h,r,this._context),d=this.f_0(u,i),p=l,_=d,[p,_]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index"},constructor:function(){this.f_0=function(e){var t=this._context.new_var(n.Std.high(this._context)),i=n.Std.change(t),o=this._context.new_var(n.Std.low(this._context)),r=-n.Std.change(o),s=this._context.new_var(n.Std.tr(void 0,this._context)),a=n.Std.rma(s,e,this._context),l=this._context.new_var(n.Std.and(n.Std.gt(i,r),n.Std.gt(i,0))?i:0),c=n.Std.fixnan(100*n.Std.rma(l,e,this._context)/a,this._context),h=this._context.new_var(n.Std.and(n.Std.gt(r,i),n.Std.gt(r,0))?r:0);return[c,n.Std.fixnan(100*n.Std.rma(h,e,this._context)/a,this._context)]},this.f_1=function(e,t){var i=this.f_0(e),o=i[0],r=i[1],s=o+r,a=this._context.new_var(n.Std.abs(o-r)/(n.Std.eq(s,0)?1:s));return[100*n.Std.rma(a,t,this._context)]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(e,t){var i,o,r,s;return this._context=e,this._input=t,i=this._input(0),o=n.Std.tr(this._context),r=this._context.new_var(o),s=n.Std.rma(r,i,this._context),[s]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot", histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){return n.Std.le(e,0)?0:1},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=n.Std.hl2(this._context),o=this._context.new_var(i),r=n.Std.sma(o,5,this._context),s=this._context.new_var(i),a=n.Std.sma(s,34,this._context),l=this.f_0(r,a),c=l,h=this._context.new_var(l),u=n.Std.change(h),d=this.f_1(u),[c,d]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(e,t,i,n){return(e-t)/(i-n)},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0(n.Std.close(this._context),n.Std.open(this._context),n.Std.high(this._context),n.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h), d=this.f_2(a,h),p=a,_=u,f=d,[p,_,f]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/(i-t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(i,d,u),_=p,[_]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.stdev(l,o,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(u,d,a),_=p,[_]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1, visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(e,t,i,o){return n.Std.or(n.Std.and(n.Std.eq(e,t),n.Std.eq(e,i)),n.Std.eq(t,i))?0:(2*e-i-t)/(t-i)*o},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=n.Std.volume(this._context),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_1(s,c),u=h,[u]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.accdist(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(e,t,i){return e-t*i}, this.f_1=function(e,t,i){return e+t*i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.high(this._context),a=this._context.new_var(s),l=n.Std.highest(a,i,this._context),c=n.Std.atr(i,this._context),h=this.f_0(l,o,c),u=this._context.new_var(s),d=n.Std.lowest(u,i,this._context),p=this.f_1(d,o,c),_=this._context.new_var(h),f=n.Std.highest(_,r,this._context),m=this._context.new_var(p),y=n.Std.lowest(m,r,this._context),g=y,v=f,[g,v]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},constructor:function(){this.f_0=function(e){return n.Std.ge(e,0)?e:0},this.f_1=function(e){return n.Std.ge(e,0)?0:-e},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return this.f_2(e-t,e+t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),h=n.Std.sum(c,i,this._context),u=this._context.new_var(l),d=n.Std.sum(u,i,this._context),p=this.f_3(h,d),_=p,[_]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#34dddd",width:1,style:0},1:{color:"#006400",width:1,style:0},2:{color:"#98fb98",width:1,style:0},3:{color:"#00FF00",width:1,style:0},4:{color:"#8B0000",width:1,style:0},5:{color:"#FF0000",width:1,style:0},6:{color:"#FF7F00",width:1,style:0},7:{color:"#ffc04c",width:1,style:0},8:{color:"#FFFF00",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone"},constructor:function(){this.f_0=function(){ var e=n.Std.close(this._context),t=n.Std.hlc3(this._context),i=this._context.new_var(n.Std.high(this._context)),o=n.Std.highest(i,30,this._context),r=n.Std.lowest(i,30,this._context),s=25/(o-r)*r,a=this._context.new_var(e),l=this._context.new_var(n.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/t*s,h=n.Std.sqrt(1+c*c),u=n.Std.round(180*n.Std.acos(1/h)/3.141592653589793),d=n.Std.iff(n.Std.gt(c,0),-u,u),p=n.Std.and(n.Std.gt(d,-2.14),n.Std.le(d,-.71))?7:8,_=n.Std.and(n.Std.gt(d,-3.57),n.Std.le(d,-2.14))?6:p,f=n.Std.and(n.Std.gt(d,-5),n.Std.le(d,-3.57))?5:_,m=n.Std.le(d,-5)?4:f,y=n.Std.and(n.Std.lt(d,2.14),n.Std.ge(d,.71))?3:m,g=n.Std.and(n.Std.lt(d,3.57),n.Std.ge(d,2.14))?2:y,v=n.Std.and(n.Std.lt(d,5),n.Std.ge(d,3.57))?1:g;return[1,n.Std.ge(d,5)?0:v]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(e,t,i,o){return 100*n.Std.log10(e/(t-i))/o},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=this._input(0),o=n.Std.atr(1,this._context),r=this._context.new_var(o),s=n.Std.sum(r,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context),h=n.Std.low(this._context),u=this._context.new_var(h),d=n.Std.lowest(u,i,this._context),p=n.Std.log10(i),_=this.f_0(s,c,d,p),f=_,[f]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0", objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},constructor:function(){this.f_0=function(e,t,i){return(e-t)/(.015*i)},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=n.Std.hlc3(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.sma(r,o,this._context),a=this._context.new_var(i),l=n.Std.dev(a,o,this._context),c=this.f_0(i,s,l),h=c,[h]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI"},constructor:function(){this.f_1=function(e,t,i){var o=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_2=function(e,t,i){var o=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_3=function(){var e=0;return function(t){var i=t.get(0),o=t.get(1);return e=i===o?0:i>o?n.Std.nz(e)<=0?1:n.Std.nz(e)+1:n.Std.nz(e)>=0?-1:n.Std.nz(e)-1,this._context.new_var(e)}}(),this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=this._input(0),s=this._input(1),a=this._input(2),l=n.Std.rsi(this.f_1(o,r,this._context),this.f_2(o,r,this._context)),c=this.f_3(o),h=n.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),u=this._context.new_var(n.Std.roc(o,1)),d=n.Std.percentrank(u,a),p=n.Std.avg(l,h,d),[p]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14, type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(e,t){return e+t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.roc(a,o),c=this._context.new_var(s),h=n.Std.roc(c,r),u=this.f_0(l,h),d=this._context.new_var(u),p=n.Std.wma(d,i,this._context),_=p,[_]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff"},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.Std.period(this._context),n.Std.period(this._context))},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._context.new_unlimited_var(this._context.symbol.time),this._input(0),n.Std.period(this._context),o=n.Std.close(this._context),r=this._input(1),this._context.select_sym(1),s=this._context.new_unlimited_var(this._context.symbol.time),a=n.Std.close(this._context),l=this._context.new_unlimited_var(a),this._context.select_sym(0),c=l.adopt(s,i,0),h=this._context.new_var(o),u=this._context.new_var(c),d=n.Std.correlation(h,u,r,this._context),[d]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator"},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1),o=this._context.new_var(n.Std.close(this._context)),r=this._context.new_var(n.Std.sma(o,e,this._context)),s=this._context.new_var(n.Std.close(this._context)),a=s.get(i)-r,l=n.Std.close(this._context)-r.get(i),c=t?a:l,h=-i ;return[c,t?h:0]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index"},constructor:function(){this.f_0=function(e){return-e},this.f_1=function(e,t){return n.Std.and(n.Std.gt(e,t),n.Std.gt(e,0))?e:0},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return e+t},this.f_4=function(e,t,i){return n.Std.abs(e-t)/(n.Std.eq(i,0)?1:i)},this.f_5=function(e){return 100*e},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.high(this._context),s=this._context.new_var(r),a=n.Std.change(s),l=n.Std.low(this._context),c=this._context.new_var(l),h=n.Std.change(c),u=this.f_0(h),d=n.Std.tr(this._context),p=this._context.new_var(d),_=n.Std.rma(p,i,this._context),f=this.f_1(a,u),m=this._context.new_var(f),y=n.Std.rma(m,i,this._context),g=this.f_2(y,_),v=n.Std.fixnan(g,this._context),S=this.f_1(u,a),b=this._context.new_var(S),w=n.Std.rma(b,i,this._context),P=this.f_2(w,_),T=n.Std.fixnan(P,this._context),x=this.f_3(v,T),C=this.f_4(v,T,x),L=this._context.new_var(C),I=n.Std.rma(L,o,this._context),A=this.f_5(I),k=v,E=T,M=A,[k,E,M]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels", shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=n.Std.low(this._context),r=this._context.new_var(o),s=n.Std.lowest(r,i,this._context),a=n.Std.high(this._context),l=this._context.new_var(a),c=n.Std.highest(l,i,this._context),h=n.Std.avg(c,s),u=s,d=c,p=h,[u,d,p]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this.f_0(s,l),h=c,[h]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(e,t,i,n,o){return e*t*(i-n)/o},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.hl2(this._context),s=this._context.new_var(r),a=n.Std.change(s),l=this.f_0(i,a,n.Std.high(this._context),n.Std.low(this._context),n.Std.volume(this._context)),c=this._context.new_var(l),h=n.Std.sma(c,o,this._context),u=h,[u]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot", histogramBase:0,joinPoints:!1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(e,t){return e*t},this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(s,n.Std.volume(this._context)),l=this._context.new_var(a),c=n.Std.ema(l,i,this._context),h=c,[h]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{ id:"in_1",name:"percent",defval:10,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(e,t,i){return e?t:i},this.f_1=function(e,t){return e*(1+t)},this.f_2=function(e,t){return e*(1-t)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=n.Std.ema(a,o,this._context),c=this._context.new_var(i),h=n.Std.sma(c,o,this._context),u=this.f_0(s,l,h),d=r/100,p=this.f_1(u,d),_=this.f_2(u,d),f=u,m=p,y=_,[f,m,y]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,bands:[{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform"},constructor:function(){this.f_0=function(e){var t=n.Std.lt(e,-.99)?-.999:e;return[n.Std.gt(e,.99)?.999:t]},this.f_1=function(){var e,t,i,o=this._input(0),r=this._context.new_var(n.Std.hl2(this._context)),s=n.Std.highest(r,o,this._context),a=this._context.new_var(n.Std.hl2(this._context)),l=n.Std.lowest(a,o,this._context),c=this._context.new_var(),h=this.f_0(.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:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.linreg(r,o,0),a=s,[a]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short", histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.sma(s,i,this._context),l=this._context.new_var(r),c=n.Std.sma(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"MA with EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"MA",histogramBase:0,joinPoints:!1},plot_1:{title:"EMA",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA with EMA Cross",shortDescription:"MA/EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Length MA",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Length EMA",defval:10,type:"integer",min:1,max:2e3}],id:"MA with EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA with EMA Cross"},constructor:function(){this.f_0=function(e,t){return e?t:n.Std.na()},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.close(this._context),s=this._context.new_var(r),a=n.Std.sma(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=a,u=c,d=n.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.high(this._context),n.Std.low(this._context)), r=this._context.new_var(o),s=n.Std.ema(r,9,this._context),a=this._context.new_var(s),l=n.Std.ema(a,9,this._context),c=this.f_1(s,l),h=this._context.new_var(c),u=n.Std.sum(h,i,this._context),d=u,[d]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic"},constructor:function(){this.f_0=function(){var e,t=this._input(0),i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.ema(o,t,this._context),s=this._context.new_var(),a=s.get(1)+(i-s.get(1))/(t*n.Std.pow(i/s.get(1),4));return s.set(n.Std.na(s.get(1))?r:a),e=s.get(0),[e]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Momentum",metainfo:{_metainfoVersion:30,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=this._input(0),o=n.Std[this._input(1)](this._context),r=this._context.new_var(o),s=r.get(i),a=s?o-s:null,[a]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow"},constructor:function(){this.f_0=function(e,t,i){ return e*(n.Std.le(t,0)?0:i)},this.f_1=function(e,t,i){return e*(n.Std.ge(t,0)?0:i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=n.Std.hlc3(this._context),r=this._context.new_var(o),s=n.Std.change(r),a=this.f_0(n.Std.volume(this._context),s,o),l=this._context.new_var(a),c=n.Std.sum(l,i,this._context),h=this.f_1(n.Std.volume(this._context),s,o),u=this._context.new_var(h),d=n.Std.sum(u,i,this._context),p=n.Std.rsi(c,d),_=p,[_]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#CC0000"}},precision:4,filledAreasStyle:{fill_0:{color:"#A2C4C9",transparency:90,visible:!0}},inputs:{in_0:20,in_1:20,in_2:0,in_3:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_1",type:"plot_plot",title:"Plots Background"}],description:"Moving Average Channel",shortDescription:"MAC",is_price_study:!0,inputs:[{id:"in_0",name:"Upper Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"Lower Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_2",name:"Upper Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"in_3",name:"Lower Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Channel@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Channel"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=n.Std.high(this._context),o=n.Std.low(this._context),r=this._input(0),s=this._input(1),a=this._input(2),l=this._input(3),c=this._context.new_var(i),h=this._context.new_var(o),u=n.Std.sma(c,r,this._context),d=n.Std.sma(h,s,this._context), [{value:u,offset:a},{value:d,offset:l}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y;return this._context=e,this._input=t,i=n.Std[this._input(2)](this._context),o=this._input(0),r=this._input(1),s=this._input(3),a=this._context.new_var(i),l=n.Std.ema(a,o,this._context),c=this._context.new_var(i),h=n.Std.ema(c,r,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=n.Std.ema(d,s,this._context),_=this.f_0(u,p),f=_,m=u,y=p,[f,m,y]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.ema(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}}, precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std[this._input(1)](this._context),o=this._input(0),r=this._input(2),s=this._context.new_var(i),a=n.Std.wma(s,o,this._context),l=a,[{value:l,offset:r}]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.change(o),s=this.f_0(r,n.Std.volume(this._context),r),a=s,[a]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(e,t,i){return n.Std.gt(e,0)?t:n.Std.lt(i,0)?-t:0*t},this.main=function(e,t){var i,o,r,s,a,l;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._context.new_var(i),r=n.Std.change(o),s=this.f_0(r,n.Std.volume(this._context),r),a=n.Std.cum(s,this._context),l=a,[l]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum", defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.sar(i,o,r,this._context),a=s,[a]}}},{name:"Price Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496FF"}},precision:4,inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=n.Std.high(this._context),o=this._context.new_var(i),r=n.Std.low(this._context),s=this._context.new_var(r),a=this._input(0),l=this._input(1),c=n.Std.highest(o,a,this._context),h=n.Std.lowest(s,a,this._context),u=n.Std.avg(c,h),[{value:c,offset:l},{value:h,offset:l},{value:u,offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(e,t){return(e-t)/t*100},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._context.new_var(i),a=n.Std.sma(s,o,this._context),l=this._context.new_var(i),c=n.Std.sma(l,r,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0, joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend"},constructor:function(){this.f_0=function(){var e=this._context.new_var(n.Std.close(this._context));return[n.Std.cum(n.Std.change(e)/e.get(1)*n.Std.volume(this._context),this._context)]},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change"},constructor:function(){this.main=function(e,t){var i,o,r;return this._context=e,this._input=t,i=this._context.new_var(n.Std.close(this._context)),o=this._input(0),r=100*(i.get(0)-i.get(o))/i.get(o),[r]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(e){return n.Std.max(e,0)},this.f_1=function(e){return-n.Std.min(e,0)},this.f_2=function(e,t){return n.Std.eq(e,0)?100:n.Std.eq(t,0)?0:100-100/(1+t/e)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.change(r),a=this.f_0(s),l=this._context.new_var(a),c=n.Std.rma(l,o,this._context),h=this.f_1(s),u=this._context.new_var(h),d=n.Std.rma(u,o,this._context),p=this.f_2(d,c),_=p,[_]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0, linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e,t){return e/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context),n.Std.open(this._context)),r=this._context.new_var(o),s=n.Std.swma(r,this._context),a=this._context.new_var(s),l=n.Std.sum(a,i,this._context),c=this.f_0(n.Std.high(this._context),n.Std.low(this._context)),h=this._context.new_var(c),u=n.Std.swma(h,this._context),d=this._context.new_var(u),p=n.Std.sum(d,i,this._context),_=this.f_1(l,p),f=this._context.new_var(_),m=n.Std.swma(f,this._context),y=_,g=m,[y,g]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(e,t){return n.Std.le(e,0)?0:t},this.f_1=function(e,t){return n.Std.gt(e,0)?0:t},this.f_2=function(e,t){return e/(e+t)*100},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.stdev(r,i,this._context),a=this._context.new_var(o),l=n.Std.change(a),c=this.f_0(l,s),h=this._context.new_var(c),u=n.Std.ema(h,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),_=n.Std.ema(p,14,this._context),f=this.f_2(u,_),m=f,[m]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1, transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,i,o,this._context),c=this._context.new_var(l),h=n.Std.ema(c,r,this._context),u=this.f_0(l,h),d=l,p=h,_=u,[d,p,_]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average"},constructor:function(){this.f_0=function(){var e,t=this._input(0),i=n.Std[this._input(1)](this._context),o=this._context.new_var(i),r=n.Std.sma(o,t,this._context),s=this._context.new_var(),a=(s.get(1)*(t-1)+i)/t;return s.set(n.Std.na(s.get(1))?r:a),e=s.get(0),[e]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{ plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=n.Std.high(this._context),l=n.Std.low(this._context),c=this._context.new_var(s),h=this._context.new_var(a),u=this._context.new_var(l),d=n.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=n.Std.sma(p,o,this._context),f=this._context.new_var(_),m=n.Std.sma(f,r,this._context),y=_,g=m,[y,g]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI"},constructor:function(){this.f_1=function(e,t,i){var o=i.new_var(n.Std.max(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.f_2=function(e,t,i){var o=i.new_var(-n.Std.min(n.Std.change(e),0));return n.Std.rma(o,t,i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,y,g,v;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=n.Std.rsi(this.f_1(l,o,this._context),this.f_2(l,o,this._context)),h=this._context.new_var(c),u=this._context.new_var(c), d=this._context.new_var(c),p=n.Std.stoch(h,u,d,r,this._context),_=this._context.new_var(p),f=n.Std.sma(_,s,this._context),m=this._context.new_var(f),y=n.Std.sma(m,a,this._context),g=f,v=y,[g,v]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(e){return n.Std.log(e)},this.f_1=function(e){return 1e4*e},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_;return this._context=e,this._input=t,i=this._input(0),o=this.f_0(n.Std.close(this._context)),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),h=n.Std.ema(c,i,this._context),u=this._context.new_var(h),d=n.Std.change(u),p=this.f_1(d),_=p,[_]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA"},constructor:function(){this.f_0=function(e,t,i){return 3*(e-t)+i},this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d;return this._context=e,this._input=t,i=this._input(0),o=n.Std.close(this._context),r=this._context.new_var(o),s=n.Std.ema(r,i,this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(l),h=n.Std.ema(c,i,this._context),u=this.f_0(s,l,h),d=u,[d]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25, type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.close(this._context),a=this._context.new_var(s),l=n.Std.tsi(a,o,i,this._context),c=l,h=this._context.new_var(c),[c,n.Std.ema(h,r,this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator"},constructor:function(){this.f_0=function(e,t,i){var o=this._context.new_var(e),r=this._context.new_var(t);return[n.Std.sum(o,i,this._context)/n.Std.sum(r,i,this._context)]},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),o=this._context.new_var(n.Std.close(this._context)),r=n.Std.max(n.Std.high(this._context),o.get(1)),s=this._context.new_var(n.Std.close(this._context)),a=n.Std.min(n.Std.low(this._context),s.get(1)),l=n.Std.close(this._context)-a,c=r-a,h=this.f_0(l,c,e),u=this.f_0(l,c,t),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"VWAP",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#3A6CA8"}},precision:4},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP"},constructor:function(){this.f_1=function(e){e.hist=null,e.add_hist()},this.init=function(e,t){this._isNewSession=n.Std.createNewSessionCheck(e)},this.main=function(e,t){var i,o,r,s;return this._context=e,this._input=t,i=e.new_var(),o=e.new_var(),this._context.symbol.time&&(r=this._context.symbol.time,this._isNewSession(r)&&(this.f_1(i),this.f_1(o))),i.set(n.Std.nz(i.get(1))+n.Std.hlc3(this._context)*n.Std.volume(this._context)),o.set(n.Std.nz(o.get(1))+n.Std.volume(this._context)),s=i.get(0)/o.get(0),[s]}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{ linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(e,t){var i,o,r,s,a;return this._context=e,this._input=t,i=n.Std.close(this._context),o=this._input(0),r=this._context.new_var(i),s=n.Std.vwma(r,o,this._context),a=s,[a]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(e,t){return 100*(e-t)/t},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=n.Std.volume(this._context),s=this._context.new_var(r),a=n.Std.ema(s,i,this._context),l=this._context.new_var(r),c=n.Std.ema(l,o,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator"},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(n.Std.low(this._context)),i=this._context.new_var(n.Std.abs(n.Std.high(this._context)-t.get(1))),o=n.Std.sum(i,e,this._context),r=this._context.new_var(n.Std.high(this._context)),s=this._context.new_var(n.Std.abs(n.Std.low(this._context)-r.get(1))),a=n.Std.sum(s,e,this._context),l=this._context.new_var(n.Std.atr(1,this._context)),c=n.Std.sum(l,e,this._context);return[o/c,a/c]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{ name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(e,t,i){return 100*(e-t)/(t-i)},this.main=function(e,t){var i,o,r,s,a,l,c,h,u;return this._context=e,this._input=t,i=this._input(0),o=n.Std.high(this._context),r=this._context.new_var(o),s=n.Std.highest(r,i,this._context),a=n.Std.low(this._context),l=this._context.new_var(a),c=n.Std.lowest(l,i,this._context),h=this.f_0(n.Std.close(this._context),s,c),u=h,[u]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(e,t){var i,o,r,s,a,l,c,h,u,d,p,_,f;return this._context=e,this._input=t,i=this._input(0),o=this._input(1),r=this._input(2),s=n.Std.hl2(this._context),a=this._context.new_var(s),l=n.Std.ema(a,i,this._context),c=this._context.new_var(s),h=n.Std.ema(c,o,this._context),u=this._context.new_var(s),d=n.Std.ema(u,r,this._context),p=l,_=h,f=d,[{value:p,offset:8},{value:_,offset:5},{value:f,offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar", transparency:0,color:"#800000"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#808000"}},precision:4,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(n.Std.high(this._context)),i=n.Std.or(n.Std.and(n.Std.and(n.Std.lt(t.get(e+2),t.get(e)),n.Std.lt(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))),n.Std.or(n.Std.or(n.Std.and(n.Std.lt(t.get(e+3),t.get(e)),n.Std.and(n.Std.and(n.Std.lt(t.get(e+2),t.get(e)),n.Std.eq(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e))))),n.Std.and(n.Std.and(n.Std.lt(t.get(e+4),t.get(e)),n.Std.lt(t.get(e+3),t.get(e))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))))),n.Std.or(n.Std.and(n.Std.and(n.Std.lt(t.get(e+5),t.get(e)),n.Std.and(n.Std.lt(t.get(e+4),t.get(e)),n.Std.eq(t.get(e+3),t.get(e)))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e))))),n.Std.and(n.Std.and(n.Std.and(n.Std.lt(t.get(e+6),t.get(e)),n.Std.lt(t.get(e+5),t.get(e))),n.Std.and(n.Std.eq(t.get(e+4),t.get(e)),n.Std.le(t.get(e+3),t.get(e)))),n.Std.and(n.Std.and(n.Std.eq(t.get(e+2),t.get(e)),n.Std.le(t.get(e+1),t.get(e))),n.Std.and(n.Std.lt(t.get(e-1),t.get(e)),n.Std.lt(t.get(e-2),t.get(e)))))))),o=this._context.new_var(n.Std.low(this._context)) ;return[n.Std.or(n.Std.and(n.Std.and(n.Std.gt(o.get(e+2),o.get(e)),n.Std.gt(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))),n.Std.or(n.Std.or(n.Std.and(n.Std.gt(o.get(e+3),o.get(e)),n.Std.and(n.Std.and(n.Std.gt(o.get(e+2),o.get(e)),n.Std.eq(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e))))),n.Std.and(n.Std.and(n.Std.gt(o.get(e+4),o.get(e)),n.Std.gt(o.get(e+3),o.get(e))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))))),n.Std.or(n.Std.and(n.Std.and(n.Std.gt(o.get(e+5),o.get(e)),n.Std.and(n.Std.gt(o.get(e+4),o.get(e)),n.Std.eq(o.get(e+3),o.get(e)))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e))))),n.Std.and(n.Std.and(n.Std.and(n.Std.gt(o.get(e+6),o.get(e)),n.Std.gt(o.get(e+5),o.get(e))),n.Std.and(n.Std.eq(o.get(e+4),o.get(e)),n.Std.ge(o.get(e+3),o.get(e)))),n.Std.and(n.Std.and(n.Std.eq(o.get(e+2),o.get(e)),n.Std.ge(o.get(e+1),o.get(e))),n.Std.and(n.Std.gt(o.get(e-1),o.get(e)),n.Std.gt(o.get(e-2),o.get(e)))))))),i]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(e,t,i){"use strict";var n,o,r,s;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"dur",function(){return n}),i.d(t,"easingFunc",function(){return o}),i.d(t,"CubicBezier",function(){return r}),i.d(t,"color",function(){return s}),n=350,o={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return e*(2-e)},easeInOutQuad:function(e){return e<.5?2*e*e:(4-2*e)*e-1},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return--e*e*e+1},easeInOutCubic:function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return 1- --e*e*e*e},easeInOutQuart:function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return 1+--e*e*e*e*e},easeInOutQuint:function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e}},r=function(){function e(e,t,i,n){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=n}return e.prototype.easingFunc=function(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))},e.prototype._a=function(e,t){return 1-3*t+3*e},e.prototype._b=function(e,t){return 3*t-6*e},e.prototype._c=function(e){return 3*e},e.prototype._calcBezier=function(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e},e.prototype._getSlope=function(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)},e.prototype._getTForX=function(e){var t,i,n,o=e;for(t=0;t<4;++t){if(0===(i=this._getSlope(o)))return o;n=this._calcBezier(o)-e,o-=n/i}return o},e}(),s={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black27:"#2f3241", black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30",growing:"#37bc9b",falling:"#ff4a68"}},function(e,t,i){function n(){this._data=null,this._hittest=new o(o.MOVEPOINT)}var o,r,s,a;i(71),o=i(9).HitTestResult,r=i(103).LineEnd,s=i(30).distanceToSegment,a=i(27).extendAndClipLineSegment,n.prototype.setData=function(e){this._data=e},n.prototype.setHitTest=function(e){this._hittest=e},n.prototype.drawArrow=function(e,t,i,n){var o,r,s,a,l,c,h,u,d;t.subtract(e).length()<1||(o=t.subtract(e).normalized(),r=5*n,s=o.scaled(r),a=t.subtract(s),l=o.transposed(),c=3*n,h=l.scaled(c),u=a.add(h),d=a.subtract(h),CanvasEx.drawLine(i,Math.round(u.x),Math.round(u.y),t.x,t.y),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),t.x,t.y))},n.prototype.extendAndClipLineSegment=function(e,t){return a(e,t,this._data.width,this._data.height,this._data.extendleft,this._data.extendright)},n.prototype.drawCircle=function(e,t,i,n){n=$.extend({fillStyle:"#000000"},n),t.save(),t.fillStyle=n.fillStyle,t.beginPath(),t.arc(e.x,e.y,i,0,2*Math.PI,!1),t.fill(),n.strokeWidth&&(t.lineWidth=n.strokeWidth,t.stroke()),t.restore()},n.prototype.draw=function(e){var t,i,n,o,r;null===this._data||this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(e.lineCap="butt",e.strokeStyle=this._data.color,e.lineWidth=this._data.linewidth,e.lineStyle=this._data.linestyle,t=this._data.floatPoints||this._data.points,i=t[0],n=t[1],this._data.overlayLineEndings?o=[$.extend(!0,{},i),$.extend(!0,{},n)]:this.drawEnds(e,[i,n]),r=this.extendAndClipLineSegment(i,n),null!==r&&this._data.linewidth>0&&CanvasEx.drawLine(e,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(e,o))},n.prototype.drawEnds=function(e,t){var i=t[0],n=t[1];switch(this._data.leftend){case r.Arrow:this.drawArrow(n,i,e,e.lineWidth);break;case r.Circle:this.drawCircle(i,e,e.lineWidth,this._data.endstyle)}switch(this._data.rightend){case r.Arrow:this.drawArrow(i,n,e,e.lineWidth);break;case r.Circle:this.drawCircle(n,e,e.lineWidth,this._data.endstyle)}},n.prototype.hitTest=function(e){var t,i,n,o,r,a ;return null===this._data||this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(t=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,n=i[0],o=i[1],r=this.extendAndClipLineSegment(n,o),null!==r&&(a=s(r[0],r[1],e),a.distance<=t)?this._hittest:null)},t.TrendLineRenderer=n},function(e,t,i){function n(e,t){this._linesMaxWidth=null,this._hittest=t||new o(o.MOVEPOINT),this._data={},this._fontSize=0,this.setData(e)}var o=i(9).HitTestResult,r=i(81).calcTextHorizontalShift,s=i(46).drawRoundRect;n.prototype.setData=function(e){var t,i,n,o=this._data,r=this.fontStyle();this._data=e,this._fontSize=e.fontsize||e.fontSize||30,t=e.text===o.text,i=e.wordWrapWidth===o.wordWrapWidth,n=r===this.fontStyle(),t&&i&&n?(this._data.lines=o.lines,this._lines=o.lines):(this._linesMaxWidth=null,e.lines=this.wordWrap(e.text,e.wordWrapWidth),this._lines=e.lines)},function(){function e(){var e=document.createElement("canvas");e.width=0,e.height=0,t=e.getContext("2d"),e=null}var t;n.prototype.setPoints=function(e,t){this._data.points=e,this._hittest=t||new o(o.MOVEPOINT)},n.prototype._getLinesMaxWidth=function(){var i,n;if(null!==this._linesMaxWidth)return this._linesMaxWidth;if(t||e(),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.wordWrapWidth)return this._data.wordWrapWidth;for(i=0,n=0;n0&&t.measureText(h.slice(0,3*--u-1).join("")).width>n;);if(u>0)s.push(h.slice(0,3*u-1).join("")),h.splice(0,3*u);else{if(d=h[0]+(h[1]||""),p=1===p?1:~~(n/t.measureText(d)*d.length),t.measureText(d.substr(0,p)).width<=n)for(;t.measureText(d.substr(0,p+1)).width<=n;)p++;else for(;p>1&&t.measureText(d.substr(0,--p)).width>n;);p<1&&(p=1),s.push(d.substr(0,p)),h[0]=d.substr(p),h[1]=""}if((c=t.measureText(h.join("")).width)<=n){s.push(h.join(""));break}}return s}}(),n.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},n.prototype._y=function(){var e,t=this._fontSize*this._lines.length;switch(this._data.scaleY&&(t*=this._data.scaleY), e=this._data.points[0].y+this._data.offsetY+t,this._data.vertAlign){case"top":break;case"bottom":e-=t;break;case"middle":e-=t/2}return e},n.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},n.prototype.draw=function(e){var t,i,n,o,a,l,c,h,u,d,p,_,f,m,y,g;if(0!==this._data.points.length){switch(t=this._x(),i=this._y(),n=this._fontSize,this._data.scaleY&&(n*=this._data.scaleY),i-=n*(this._lines.length-1),e.textBaseline="alphabetic",e.font=this.fontStyle(),this._data.horzAlign){case"left":e.textAlign="start";break;case"right":e.textAlign="end";break;case"center":e.textAlign="center"}if(e.translate(t+.5,i+.5),t=0,i=0,n=this._fontSize,this._data.scaleX&&this._data.scaleY&&(o=Math.min(this._data.scaleX,this._data.scaleY),e.scale(o,o)),a=this._getLinesMaxWidth(),l=r(e,a),c=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(h=t,this._data.horzAlign){case"left":break;case"right":h-=a;break;case"center":h-=a/2}u=n*this._lines.length,d=~~(n/6),this._data.backgroundHorzInflate&&(a+=2*this._data.backgroundHorzInflate,h-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(u+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),p={x:Math.floor(h-d),y:Math.floor(i-n),w:Math.ceil(a+2*d),h:Math.ceil(u+2*d)},p.w%2!=0&&p.w++,this._data.padding&&(p.h+=this._data.padding,c=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(s(e,p.x,p.y,p.w,p.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fill()),this._data.borderColor&&(_=~~Math.max(n/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=_,e.stroke())):(this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fillRect(p.x,p.y,p.w,p.h)),this._data.borderColor?(_=~~Math.max(n/12,1),e.strokeStyle=this._data.borderColor,e.lineWidth=_,e.strokeRect(p.x-_/2,p.y-_/2,p.w+_,p.h+_)):this._data.highlightBorder&&(e.strokeStyle=this._data.color,e.lineWidth=1,e.beginPath(),y=[3,1],e.dashedLineTo(p.x-.5,m=p.y-.5,f=p.x+p.w+.5,m,y),e.dashedLineTo(f,m,f,m=p.y+p.h+.5,y),e.dashedLineTo(f=p.x-.5,m,p.x+p.w+.5,m,y),e.dashedLineTo(f,p.y-.5,f,m,y),e.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),e.fillStyle=this._data.color,this._data.forceTextAlign&&(e.textAlign=this._data.horzAlign?this._data.horzAlign:"left"),this._data.forceTextAlign||(t+=l),g=0;g=n-r-s&&e.x<=n+i+r+s&&e.y>=o-s&&e.y<=o+this._lines.length*this._fontSize+2*r+s?this._hittest:null)},t.TextRenderer=n},,,function(e,t,i){"use strict";function n(e){return"."+e.replace(/\+/g,"")}function o(e,t,i,o){var r,s;void 0===i&&(i="keydown"),r=n(e),s=o?$(o):u,s.unbind(i+r).bind(i+r,e,function(e){$(e.target).is("input[type=password]")||d||t.apply(null,Array.prototype.slice.call(arguments))}),h[e]=t}function r(e,t,i){void 0===t&&(t="keydown"),(i?$(i):u).unbind(t+n(e)),delete h[e]}function s(){return d?null:d=Object(c.randomHashN)(4)}function a(e){if(e!==d)throw Error("Lock id is outdated");d=null}var l,c,h,u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.bind=o,t.unbind=r,t.disable=s,t.enable=a,l=i(14),i.n(l),c=i(33),h={},u=$(document),d=null},function(e,t,i){"use strict";function n(e){this._data=e}function o(e,t){this._data=e,this._model=t,this.radius=this._data.radius||o.OUTER_RADIUS}function r(e){n.call(this,e)}var s=i(9).HitTestResult,a=i(167).PaneRendererArrowsUpDown;i(71),n.RADIUS=3.5,n.prototype.tolerance=2,n.prototype.draw=function(e){function t(e){return void 0===e.x||TradingView.isNaN(e.x)||null===e.x||void 0===e.y||TradingView.isNaN(e.y)||null===e.y}var i,n,o;if(this._data)for(e.strokeStyle="#6B6B6B",e.fillStyle="#D6D6D6",i=this._data.vertOffset||0,n=0;n=this._options.duration||t===this._options.to,s=n(this._options.from,this._options.to,this._options.easing(o/this._options.duration)),a=r?this._options.to:s,l=a-t,this._options.onStep(l,a),r?void this._finishAnimation():void window.requestAnimationFrame(function(t){c._animation(e,a,t)})):void this._finishAnimation()},e.prototype._finishAnimation=function(){this._options.onComplete&&this._options.onComplete()},e}()},function(e,t){e.exports=''},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),n=i(488),Object.defineProperty(t,"AutocompleteField",{enumerable:!0,get:function(){return n.AutocompleteField}}),o=i(492),Object.defineProperty(t,"CheckboxField",{enumerable:!0,get:function(){return o.CheckboxField}}),r=i(254),Object.defineProperty(t,"InputField",{enumerable:!0,get:function(){return r.InputField}}),s=i(493),Object.defineProperty(t,"InputFieldRegExp",{enumerable:!0,get:function(){return s.InputFieldRegExp}}),a=i(253),Object.defineProperty(t,"SaveRenameDialog",{enumerable:!0,get:function(){return a.SaveRenameDialog}})},function(e,t,i){"use strict";function n(e,t,n,s){var a=Object(o.loadPropertyPages)(),l=function(o,r){i.e(17).then(function(r){a.then(function(){var r=i(357),a=new r(e,t,s);a.show(n),o(a)})}.bind(null,i)).catch(r)};return Object(r.retries)(function(e){ return new Promise(l)},2)}var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.showEditObjectDialog=n,o=i(2),i.n(o),r=i(134)},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"HEADER_TOOLBAR_HEIGHT_EXPANDED",function(){return o}),i.d(t,"HEADER_TOOLBAR_HEIGHT_COLLAPSED",function(){return r}),n=i(477),i.n(n),o=parseInt(n["css-value-header-toolbar-height"]),r=3},function(e,t,i){"use strict";var n,o,r,s,a;i.d(t,"a",function(){return s}),i.d(t,"b",function(){return a}),n=i(1),o=i(8),r=i.n(o),s=function(){function e(e,t,i,n,o){var s=this;this._onChange=new r.a,this._handleChange=function(){s._onChange.fire(s.get())},this._crossTabEvents=e,this._jsonKeyValueStore=t,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=n,this.defaultStoreValue=this._serialize(o),this._subscribe()}return e.prototype.get=function(){var e=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(e)},e.prototype.set=function(e,t){var i=this._serialize(e);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,i,t),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(e)},e.prototype.getOnChange=function(){return this._onChange},e.prototype.destroy=function(){this._unsubscribe(),this._onChange.destroy(),delete this._onChange},e.prototype._subscribe=function(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)},e.prototype._unsubscribe=function(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)},e}(),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.c(t,e),t.prototype._serialize=function(e){return e},t.prototype._deserialize=function(e){return e},t}(s)},function(e,t,i){"use strict";function n(e){for(var t=0;tt?(a&&(clearTimeout(a),a=null),l=h,r=e.apply(n,o),a||(n=o=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,e.exports=t.default},function(e,t,i){"use strict";var n,o,r,s,a,l,c;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"isDrawingToolbarVisible",function(){return c}),n=i(49),i.n(n),o=i(5),i.n(o),r=i(16),s=i.n(r),a=!o.enabled("hide_left_toolbar_by_default"),l=n.getBool("ChartDrawingToolbarWidget.visible",a),c=new s.a(l)},function(e,t){e.exports={inputWrapper:"inputWrapper-6bNZbTW4-",textInput:"textInput-3WRWEmm7-",error:"error-v0663AtN-",success:"success-7iP8kTY5-",textInputLeftDirection:"textInputLeftDirection-mlAXPh8V-",xsmall:"xsmall-3Ah_Or2--",small:"small-2bmxiJCE-",large:"large-1JDowW2I-",iconed:"iconed-3ZQvxTot-",inputIcon:"inputIcon-W_Bse-a1-",clearable:"clearable-2tabt_rj-",clearIcon:"clearIcon-389FR5J4-",grouped:"grouped-34HX1lDr-"}},function(e,t,i){"use strict";i(496),function(e){function t(e,t,i){ for(var n=0;n

',actionsWrapTemplate:'
',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]}},function(e,t,i){"use strict";function n(e){this._data=e,this.bars=e.bars,this._barWidth=o.optimalBarWidth(e.barSpacing),this._barBorderWidth=1}var o=i(27),r=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n,o,r,s,a,l,c,h,u,d,p,_,f=this.bars,m=this._data.barSpacing,y=this._data.drawWick,g=this._data.drawBorder,v=this._data.wickColor,S=this._barBorderWidth,b=this._barWidth;if(e.lineCap="square",e.lineStyle=this._data.lineStyle,m<1){if(y){for(e.strokeStyle=v,e.lineWidth=1,e.beginPath(),h=f.length;h-- >0;)u=f[h],e.moveTo(u.time,u.low),e.lineTo(u.time,u.high);e.stroke()}for(e.lineWidth=1,d="",p=!1,e.beginPath(),h=f.length;h-- >0;)u=f[h],c=u.time,d!==u.color&&(p&&(e.stroke(),e.beginPath(),p=!1),e.strokeStyle=u.color,d=u.color),e.moveTo(u.time,u.open),e.lineTo(u.time,u.close),p=!0;p&&e.stroke()}else{ if(f=f.slice().sort(function(e,t){return e.color>t.color?-1:e.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) }).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(){ for(var e=0;e=0;e--)this._subcommands[e].undo()},t}(o.UndoCommand)},function(e,t,i){"use strict";function n(e){var t,i;if(""===e)return Promise.resolve(null);if(t=JSON.parse(e),!Object(o.isObject)(t)||"function"==typeof t)return Promise.reject(Error("Non-object content in the non-series envelope"));if(Object(o.hasProperty)(t,"indexes_replace"))return Promise.resolve({indexes_replace:!0});if(i={indexes_replace:!1},Object(o.hasProperty)(t,"offsets")&&(i.offsets=t.offsets),Object(o.hasProperty)(t,"isUpdate")){if("boolean"!=typeof t.isUpdate)return Promise.reject(Error('Invalid type of "isUpdate" field'));i.isUpdate=t.isUpdate}return Object(o.hasProperty)(t,"data")&&(i.data=t.data),Object(o.hasProperty)(t,"graphicsCmds")&&(i.graphicsCmds=Object(r.b)(t.graphicsCmds)),Promise.resolve(i)}var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.unpackNonSeriesData=n,i(1),o=i(260),i.n(o),r=i(261)},function(e,t,i){"use strict";function n(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function o(e,t){return t in e}Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=n,t.hasProperty=o},function(e,t,i){"use strict";function n(e){var t,i,n,o;if(Object(a.hasProperty)(e,"create"),Object(a.hasProperty)(e,"erase"))for(t=e.erase,Object(s.assert)(Array.isArray(t),"Collection of erase commands should be array"),i=0,n=t;i=0&&t[0].items.splice(i,1)})}},s=this;for(t=0,i=e;t0&&Object(l.e)(this)},e.prototype._clearPrimitives=function(){this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._hhistsByTimePointIndex.clear()},e}()},function(e,t,i){"use strict";function n(){return new c}function o(e){return new c("state",e)}function r(e){var t,i,n,o,r,c=new Set;for(t=0,i=l.d;t0&&Object(l.e)(this)},e}()},function(e,t,i){"use strict";function n(e){this.bars=e.bars,this.barSpacing=e.barSpacing,this.barWidth=o.optimalBarWidth(e.barSpacing),this.barLineWidth=Math.max(1,Math.round(this.barWidth)),this.dontDrawOpen=e.dontDrawOpen}var o=i(27),r=i(9).HitTestResult;n.prototype.draw=function(e){var t,i,n;for(e.save(),e.translate(.5,.5),i=0;ia[a.length-1].time+l)return null;for(t=null,i=0;i=0&&!o(this.items[i].y);)i--;if(!(t>=i)){for(e.translate(.5,.5),n={},s=this.items,a=t;a<=i;a++)l=s[a],c=l.style?l.style.color:this.lineColor,a"),s=r.get(0).getContext("2d"),s.font=this._font,a=0,l=0;l").attr("width",this.textImageWidth).attr("height",this.textImageHeight),i=t.get(0).getContext("2d"),i.textBaseline="top",i.font=this._font,i.textAlign="center",i.fillStyle=e,n=Math.round(this.textImageWidth/2),o=0,r=0;rh.lastBar()||i=0;--d)if((p=u[d])instanceof r&&p._adapter._index===i&&p._adapter.getDirection()===m){if(p===e._line)break;_=p._adapter._height(),f=y?f+_:f-_}return{x:t.indexToCoordinate(i),y:f}},o.prototype._height=function(){var e,t=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&a.fontHeight(this.getFont()),e=10,t+i+0+e},o.prototype.getIndex=function(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index},o.prototype.setIndex=function(e){var t,i=this._line._model.timeScale(),n=i.baseIndex(),o=n-Math.abs(e);return this._line.startMoving(this._line.points()[0]),t=TradingView.merge({},this._line.points()[0]),t.index=o,this._line.move(t),this._line.endMoving(),this},o.prototype.getTime=function(){ return this._unixtime},o.prototype.setTime=function(e){var t=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(e,t.interval(),t.symbolInfo()):e,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(e){return this._line.points().length>0&&(this._line.points()[0].price=e),this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this},o.prototype.getText=function(){return this._line.properties().text.value()},o.prototype.setText=function(e){return this._line.properties().text.setValue(e||""),this._line.updateAllViewsAndRedraw(),this},o.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},o.prototype.setArrowHeight=function(e){return this._line.properties().arrowHeight.setValue(e||5),this},o.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},o.prototype.setArrowSpacing=function(e){return this._line.properties().arrowSpacing.setValue(e||1),this},o.prototype.getDirection=function(){return this._line.properties().direction.value()},o.prototype.setDirection=function(e){return this._line.properties().direction.setValue(e||"buy"),this},o.prototype.getArrowColor=function(){return a.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},o.prototype.setArrowColor=function(e){return a.setColorToProperties(e,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},o.prototype.getTextColor=function(){return a.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},o.prototype.setTextColor=function(e){return a.setColorToProperties(e,this._line.properties().textColor,this._line.properties().textTransparency),this},o.prototype.getFont=function(){return a.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},o.prototype.setFont=function(e){return a.setFontToProperties(e,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},o.prototype.setTooltip=function(e){return null==e?e="":e+="",this._line.properties().tooltip.setValue(e),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(r,s),r.POINTS_COUNT=1,r.skipMagnetting=!0,r.prototype.pointsCount=function(){return r.POINTS_COUNT},r.prototype.title=function(){return"Execution"},r.prototype.name=function(){return"Execution"},r.prototype.hasContextMenu=function(){return!1},r.prototype.state=function(){return null}, r.prototype.updateAllViews=function(){return this._isVisible()?s.prototype.updateAllViews.call(this):null},r.prototype.priceAxisViews=function(e,t){return this._isVisible()?s.prototype.priceAxisViews.call(this,e,t):null},r.prototype._isVisible=function(){return this._model.properties().tradingProperties.showExecutions.value()},r.prototype.paneViews=function(t){return TradingView.printing&&!e.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?s.prototype.paneViews.call(this,t):null},r.prototype.userEditEnabled=function(){return!1},r.prototype.showInObjectTree=function(){return!1},r.prototype.getInputsPropertyPage=function(){return null},t.ExecutionsPositionController=n,t.LineToolExecution=r}).call(t,i(5))},function(e,t,i){"use strict";function n(e,t,i){return new l(e,t,i)}var o,r,s,a,l;t.a=n,o=i(1),r=i(12),i.n(r),s=i(19),a=i.n(s),l=function(e){function t(t,i,n){return e.call(this,t,i,n,{names:["width","color","visible"]})||this}return o.c(t,e),t.prototype._iterateLevels=function(e,t){var i,n,o;for(i in e.levels)if(e.levels[i]&&Object(r.isSameType)(e.levels[i],t.typecheck())){n=t.tpl();for(o in this._map.names)this._map.names.hasOwnProperty(o)&&(n=t.fill(o,this._map.names[o],e.levels[i],n));e.levels[i]=n}return e},t}(a.a)},function(e,t,i){"use strict";function n(e,t){this._constructor="LineTool5PointsPattern";var n=t||new r("linetool5pointspattern");o.call(this,e,n),i.e(0).then(function(e){var t=i(697).Pattern5PaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var o=i(0).LineDataSource,r=i(3).DefaultProperty,s=i(275).DateTimeFormatter,a=i(2).propertyPages;inherit(n,o),n.prototype.pointsCount=function(){return 5},n.prototype.title=function(){return"XABCD Pattern"},n.prototype.name=function(){return"XABCD Pattern"},n.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}},n.prototype._updateTooltip=function(){var e,t,i,n,o,r=this._tooltipFieldsHash,a=this.points().m_values;a[0]&&(t=this._model.timeScale().indexToUserTime(a[0].index),r.time0.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,r.price0.value=this._model.mainSeries()._formatter.format(a[0].price)),a[1]&&(e=this._model.timeScale().indexToUserTime(a[1].index),r.time1.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,r.price1.value=this._model.mainSeries()._formatter.format(a[1].price)),a[2]&&(i=this._model.timeScale().indexToUserTime(a[2].index),r.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,r.price2.value=this._model.mainSeries()._formatter.format(a[2].price)),a[3]&&(n=this._model.timeScale().indexToUserTime(a[3].index),r.time3.value=n?new s(this._model.mainSeries().isDWM()).format(n):0, r.price3.value=this._model.mainSeries()._formatter.format(a[3].price)),a[4]&&(o=this._model.timeScale().indexToUserTime(a[4].index),r.time4.value=e?new s(this._model.mainSeries().isDWM()).format(o):0,r.price4.value=this._model.mainSeries()._formatter.format(a[4].price))},n.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},n.prototype.getStylesPropertyPage=function(){return a.LineToolLineTool5PointsPatternStylesPropertyPage},t.LineTool5PointsPattern=n},function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DateTimeFormatter",function(){return r}),n=i(130),o=i(201),r=function(){function e(e){void 0===e&&(e=!1),this._dwm=e}return e.prototype.format=function(e){var t=(new o.DateFormatter).format(e);return this._dwm||(t+=" "+(new n.TimeFormatter).format(e)),t},e.prototype.formatLocal=function(e){var t=(new o.DateFormatter).formatLocal(e);return this._dwm||(t+=" "+(new n.TimeFormatter).formatLocal(e)),t},e}()},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolNote";var o=t||new a("linetoolnote");o.hasChild("text")||o.addChild("text",new s($.t("Text"))),o.addExclusion("text"),r.call(this,e,o),this.version=n.version,i.e(0).then(function(e){var t=i(793).NotePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i=t||new a("linetoolnoteabsolute");i.locked.value()||i.locked.setValue(!0),n.call(this,e,i)}var r=i(0).LineDataSource,s=i(13),a=i(3).DefaultProperty,l=i(2).propertyPages;inherit(n,r),n.TOOLTIP_WIDTH=300,n.TOOLTIP_PADDING=10,n.TOOLTIP_LINESPACING=5,n.version=1,n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return $.t("Note")},n.prototype.name=function(){return"Note"},n.prototype.applyTemplate=function(e){delete e.locked,delete e.text,r.prototype.applyTemplate.call(this,e)},n.prototype.getTooltipWidth=function(){return n.TOOLTIP_WIDTH},n.prototype.getTooltipPadding=function(){return n.TOOLTIP_PADDING},n.prototype.getTooltipLineSpacing=function(){return n.TOOLTIP_LINESPACING},inherit(o,n),o.prototype.title=function(){return $.t("Anchored Note")},o.prototype.name=function(){return"Anchored Note"},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t},n.prototype.getStylesPropertyPage=function(){return l.LineToolNotePropertyPage},t.LineToolNote=n,t.LineToolNoteAbsolute=o},function(e,t,i){"use strict";function n(e,t){this._constructor="LineToolText";var n=t||new l("linetooltext");n.hasChild("text")||n.addChild("text",new a($.t("Text"))),n.addExclusion("text"),r.call(this,e,n),this._timeScale=e.timeScale(),this._barSpacing=e.timeScale().barSpacing(),i.e(0).then(function(e){var t=i(350).TextPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function o(e,t){var i=t||new l("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),n.call(this,e,i)}var r=i(0).LineDataSource,s=i(28).DataSource,a=i(13),l=i(3).DefaultProperty,c=i(2).propertyPages;inherit(n,r), n.MIN_WIDTH=100,n.prototype.setPoint=function(e,t){var i,o,r=this.properties();if(0===e&&r.wordWrapWidth&&r.wordWrapWidth.value()){if(i=r.locked&&r.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),o=this._timeScale.indexToCoordinate(t.index)-i-~~(r.fontsize.value()/6),!isFinite(o))return;r.wordWrapWidth.setValue(Math.max(n.MIN_WIDTH,o))}},n.prototype.pointsCount=function(){return 1},n.prototype.title=function(){return $.t("Text",{context:"tool"})},n.prototype.name=function(){return"Text"},n.prototype.setPriceScale=function(e){s.prototype.setPriceScale.call(this,e),e&&e.priceRange()&&(this._priceDencity=e.height()/e.priceRange().length(),this._isPriceDencityLog=e.isLog())},n.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},n.prototype.applyTemplate=function(e){delete e.locked,delete e.text,r.prototype.applyTemplate.call(this,e)},inherit(o,n),o.prototype.title=function(){return $.t("Anchored Text")},o.prototype.name=function(){return"Anchored Text"},n.prototype.state=function(e){var t=r.prototype.state.call(this,e);return e&&(t.state.fixedSize=!1),t},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return c.LineToolTextStylesPropertyPage},t.LineToolText=n,t.LineToolTextAbsolute=o},function(e,t,i){"use strict";function n(e){return e.description||""}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslatedSymbolDescription=n;i(11)},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,"SeriesPriceAxisView",function(){return d}),n=i(1),o=i(7),i.n(o),r=i(15),s=i(58),a=i(5),i.n(a),l=i(40),c=a.enabled("countdown"),h=a.enabled("price_scale_always_last_bar_value"),u=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_LINE,l.STYLE_AREA,l.STYLE_HOLLOW_CANDLES,l.STYLE_HEIKEN_ASHI],d=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return n.c(t,e),t.prototype._getSource=function(){return this._source},t.prototype._getData=function(){return this._data},t.prototype._isCountdownEnabled=function(){return c},t.prototype._countdownText=function(){var e,t,i,n,s,a,l,c,h,u,d;return this._source.isDWM()?"":(e=1e3*Object(o.ensure)(Object(o.ensureNotNull)(this._source.data().bars().last()).value[0]),t=1e3*this._source.serverTimeOffset(),i=r.Interval.parse(this._source.interval()),n=i.multiplier()||0,s=i.isSeconds()?n:60*n,a=e.valueOf()+1e3*s,l=(new Date).valueOf()+t,(c=Math.round((a-l)/1e3))<=0?"":(c=Math.min(c,s),h=null,c>=3600&&(h=this._addLeadingZero(Math.floor(c/3600))),c%=3600,u=this._addLeadingZero(Math.floor(c/60)),c%=60,d=this._addLeadingZero(Math.floor(c)),null!==h?h+":"+u+":"+d:u+":"+d))},t.prototype._updateRendererData=function(e){var t,i,n,o,r,s,a,d;e.visible=!1,t=this._source.properties(),i=this._data.model.properties().scalesProperties.showSeriesLastValue.value(), n=c&&-1!==u.indexOf(t.style.value())&&t.showCountdown.value(),(i||n)&&(o=this._source.lastValueData(void 0,h),o.noData||t.style.value()===l.STYLE_HEIKEN_ASHI&&t.haStyle.showRealLastPrice.value()&&(r=this._source.lastValueData(void 0,!1),s=this._source.lastValueData(void 0,!0),!r.noData&&!s.noData&&r.index===s.index)||(a=i?o.text:"",d=n?this._countdownText():"",0===a.length?(e.text=d,e.secondLine=""):(e.text=a,e.secondLine=d),0===a.length&&0===d.length||(e.visible=!0,e.background=this._source.priceLineColor(o.color),e.color=this.generateTextColor(e.background),e.coordinate=o.coordinate,e.floatCoordinate=o.floatCoordinate)))},t.prototype._addLeadingZero=function(e){return("0"+e).slice(-2)},t}(s.a)},function(e,t,i){"use strict";var n,o,r,s,a,l,c,h,u,d,p,_,f;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"SeriesDataWindowView",function(){return f}),n=i(1),o=i(24),i.n(o),r=i(83),i.n(r),s=i(118),a=i(123),l=i(17),c=i(70),h=i(281),u=i(38),d=new c.PercentageFormatter,p=window.t("n/a"),_=p+" ("+p+"%)",f=function(e){function t(t,i){var n=e.call(this)||this;return n._invalidated=!0,n._series=t,n._model=i,n._items.push(new s.DataWindowItem(window.t("Open"),"")),n._items.push(new s.DataWindowItem(window.t("High"),"")),n._items.push(new s.DataWindowItem(window.t("Low"),"")),n._items.push(new s.DataWindowItem(window.t("Close"),"")),n._items.push(new s.DataWindowItem("","")),n._items.push(new s.DataWindowItem(window.t("Change"),"")),n.update(),n}return n.c(t,e),t.prototype.update=function(){this._invalidated=!0},t.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},t.prototype.dump=function(){return{header:this._header,items:this._items}},t.prototype._updateImpl=function(){var e,t,i,n,s,c,f,m,y,g,v,S,b,w,P,T,x,C,L,I,A,k,E,M,V,D=this._series.symbolInfo();if(D?(this._header=[D.name,Object(a.translatedIntervalString)(this._series.interval()),D.exchange].join(", "),this._title=D.description):this._header=this._series.symbol(),this._items[0].setValue(p),this._items[1].setValue(p),this._items[2].setValue(p),this._items[3].setValue(p),this._items[5].setValue(_),e=this._items[4],e.setValue(p),e.setVisible(!1),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()){if(t=this._model.crossHairSource().appliedIndex(),!Object(r.isNumber)(t)){if(null===(i=this._series.data().last()))return;t=i.index}if(void 0!==(n=this._series.nearestIndex(t,l.PlotRowSearchMode.NearestLeft))&&(s=this._series.data().valueAt(n),c=this._series.data().valueAt(n-1),f=this._series.model().paneForSource(this._series),null!==s&&null!==f&&(m=s[1],y=s[2],g=s[3],v=s[4],S=c&&c[4],null!=m&&null!=y&&null!=g&&null!=v&&(b=this._series.formatter(),this._items[0].setValue(b.format(m)),this._items[1].setValue(b.format(y)),this._items[2].setValue(b.format(g)),this._items[3].setValue(b.format(v)),this._items[4].setValue(b.format(this._series.barFunction()(s))),w=_,null!=S&&(P=Object(h.a)(S,v),w=Object(u.forceLTRStr)(b.format(v-S,!0)+" ("+d.format(P,!0)+")")),this._items[5].setValue(w), T=this._series.barColorer(),x=T.barStyle(n,!1),C=null!=x.barBorderColor?x.barBorderColor:x.barColor,void 0!==(L=f.properties().child("background"))))))for(I=L.value(),A=Object(o.parseRgb)(C),k=Object(o.parseRgb)(I),Object(o.distanceRgb)(A,k)<70&&(C=Object(o.rgbToHexString)(Object(o.invertRgb)(A))),E=0,M=this._items;Ei)&&(e=this.m_series.bars().range(t,i),n=this.m_series.priceScale(),o=this.m_series.barColorer(),r={},e.each(function(e,t){var i,n;void 0!==t[TradingView.OPEN_PLOT]&&void 0!==t[TradingView.HIGH_PLOT]&&void 0!==t[TradingView.LOW_PLOT]&&void 0!==t[TradingView.CLOSE_PLOT]&&(i={},i.time=Math.round(e),i.open=t[TradingView.OPEN_PLOT],i.high=t[TradingView.HIGH_PLOT],i.low=t[TradingView.LOW_PLOT],i.close=t[TradingView.CLOSE_PLOT],r.value=t,n=t[TradingView.STYLE_PLOT]?t[TradingView.STYLE_PLOT]:o.barStyle(e,!1,r),t[TradingView.STYLE_PLOT]=n,r.previousValue=t,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,m.m_bars.push(i))},this),0!==this.m_bars.length&&(s=this.m_bars[0].close,n.barPricesToCoordinates(this.m_bars,s)),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_series===this.m_model.selectedSource()))for(a=b(t,i),this._selectionData={points:[]},this._selectionData.hittestResult=_.REGULAR,l=0;l=1?null!=b&&(x=b<=S?t:i):x=y<=S?t:i,void 0!==x))))for(I=0,A=this._items;I"),this.jqMenu=e,e.attr("cellspacing","0"),e.attr("cellpadding","0"),e.addClass("context-menu"),e.addClass("submenu");for(t in this.m_items)i=this.m_items[t],o.renderItem(e,i)}else{e=h.create(r.MENU_TAG,n),this.jqMenu=e;for(t in this.m_items)i=this.m_items[t],o.renderItem(e,i)}return this.jqMenu},o.prototype.getAttributes=function(){var e={},t=["context-menu"];return this.options.attributes&&this.options.attributes.class&&t.push(this.options.attributes.class),e.cellspacing=0,e.cellpadding=0,e.class=t.join(),e},o.prototype.deploy=function(e,t){var i,o=this,r=e.target&&e.target.ownerDocument||document,s=this.wrapper();return this.jqMenu=s.append(this.render()),t?($(t).data("submenu",this.jqMenu),$(r.body).append(this.jqMenu),this.jqMenu.data("parent-menu",t),this.jqMenu.data("parent-item",e.currentTarget)):($(r.body).append(this.jqMenu),i=function(e){var t,s;if(!o.m_wrapper[0].contains(e.target)){for(t=n(o), s=0;sy.width+g.left,a||this.options.reverse?u?s.left=i.left+t.width:(r=!0,s.left=i.left-t.width):s.left=i.left,l=e.target;l&&1===l.nodeType;l=l.parentNode)if("fixed"===$(l).css("position")){this.jqMenu.css("position","fixed");break}d(this.jqMenu[0],s),r&&(c=t.width-this.jqMenu.outerWidth())&&(s.left+=c,d(this.jqMenu[0],s))},o.prototype._wrapper=function(){var e=r.WRAPPER_ATTRIBUTES;return this.m_wrapper=h.create(r.WRAPPER_TAG,e),this._parentMenuItem||this.m_wrapper.addClass("topmenu"),this.m_wrapper},o.prototype.wrapper=function(e){return this.m_wrapper||this._wrapper()},e.exports=o},function(e,t,i){"use strict";e.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(e,t,i){"use strict";var n={};n.renderAttributes=function(e){var t,i="";for(t in e)e[t]&&(i+=" "+t+'="'+e[t]+'"');return i},n.create=function(e,t){var i=$(document.createElement(e));return t&&(t.html&&(i.html(t.html),delete t.html),i.attr(t)),i}, n.validAttributes=["abbr","accept-charset","accept","accesskey","action","align","alink","alt","archive","axis","background","bgcolor","border","cellpadding","cellspacing","char","charoff","charset","checked","cite","class","classid","clear","code","codebase","codetype","color","cols","colspan","compact","content","coords","data","datetime","declare","defer","dir","disabled","enctype","face","for","frame","frameborder","headers","height","href","hreflang","hspace","http-equiv","id","ismap","label","lang","language","link","longdesc","marginheight","marginwidth","maxlength","media","method","multiple","name","nohref","noresize","noshade","nowrap","object","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","profile","prompt","readonly","rel","rev","rows","rowspan","rules","scheme","scope","scrolling","selected","shape","size","span","src","standby","start","style","summary","tabindex","target","text","title","type","usemap","valign","value","valuetype","version","vlink","vspace","width"],n.validAttribute=function(e){return-1!==jQuery.inArray(e,n.validAttributes)},n.cleanAttributes=function(e){return jQuery.each(e,function(t,i){n.validAttribute(t)||delete e[t]}),e},e.exports=n},function(e,t,i){"use strict";function n(){null===a&&i.e(3).then(function(e){if(null===a){var t=i(813).FavoriteDrawingToolbar;a=new t({left:window.innerWidth/2,top:r.HEADER_TOOLBAR_HEIGHT_EXPANDED+61})}}.bind(null,i)).catch(i.oe)}function o(){var e,t;return null===l&&null!==a&&(e=new s.Action({text:window.t("Favorite Drawings Toolbar"),checkable:!0,statName:"ToggleFavoriteDrawingsToolbar"}),t=a,t.canBeShown().subscribe(function(t){e.setEnabled(t)},{callWithLast:!0}),t.visibility().subscribe(function(t){e.setChecked(t)},{callWithLast:!0}),e.callbacks().subscribe(null,function(){t.isVisible()?t.hide():t.show()}),l=e),l}var r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),t.createFavoriteDrawingToolbar=n,t.createToolbarAction=o,i(11),r=i(198),s=i(41),i.n(s),a=null,l=null},function(e,t,i){"use strict";function n(e){"number"!=typeof e&&(e=TradingView.STUDY_COUNT_LIMIT),(0,o.showNoticeDialog)({title:$.t("Warning"),content:$.t("Studies limit exceeded: {0} studies per layout.
\nPlease, remove some studies.").format(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.showTooManyStudiesNotice=n;var o=i(209)},function(e,t,i){"use strict";var n,o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"UndoStack",function(){return l}),n=i(43),o=i(8),r=i.n(o),s=i(4),a=Object(s.getLogger)("Common.UndoStack"),l=function(){function e(){this._commands=[],this._onChange=new r.a}return e.prototype.onChange=function(){return this._onChange},e.prototype.isEmpty=function(){return 0===this._commands.length},e.prototype.clear=function(){this._commands.length=0,this._onChange.fire()},e.prototype.push=function(e){ if(!(e instanceof n.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(e),this._onChange.fire()},e.prototype.pop=function(){if(this.isEmpty())return void a.logDebug("pop: undo stack is empty");var e=this._commands.pop();return this._onChange.fire(),e},e.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},e}()},function(e,t,i){"use strict";var n,o,r,s,a;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"RestoreDefaultsUndoCommand",function(){return r}),i.d(t,"RestoreUserDefaultsUndoCommand",function(){return s}),i.d(t,"RestoreFactoryDefaultsUndoCommand",function(){return a}),n=i(1),o=i(43),r=function(e){function t(t,i,n){var o=e.call(this,n)||this;return o._chartModel=t,o._defaultProperty=i,o._state=i.state(),o}return n.c(t,e),t.prototype.undo=function(){this._defaultProperty.mergeAndFire(this._state),this._chartModel.mainSeries().onChartStyleChanged()},t}(o.UndoCommand),s=function(e){function t(t,i,n){return void 0===n&&(n="Restore User Defaults"),e.call(this,t,i,n)||this}return n.c(t,e),t.prototype.redo=function(){this._chartModel.restoreDefaults(this._defaultProperty)},t}(r),a=function(e){function t(t,i,n){return void 0===n&&(n="Restore Defaults"),e.call(this,t,i,n)||this}return n.c(t,e),t.prototype.redo=function(){this._chartModel.restoreFactoryDefaults(this._defaultProperty)},t}(r)},function(e,t,i){"use strict";var n,o,r,s,a;i.d(t,"a",function(){return a}),n=i(4),o=i(33),r=i(135),i(132),s=Object(n.getLogger)("GUI.Blocks.AbstractIndicator"),a=function(){function e(e){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1,this._tooltipType="custom",this._quoteSession=e.quoteSession}return e.prototype.getValue=function(){return this._value},e.prototype.getTooltipText=function(){return this.getLabel()},e.prototype.getLabel=function(){return this._labelMap[this._value]||""},e.prototype.getElement=function(){return this._el},e.prototype.update=function(e,t){this._updateValue(e,t),this._render()},e.prototype.setTooltipEnabled=function(e){void 0===e&&(e=!1),this._showTooltip!==e&&(this._showTooltip=e,this._renderTooltip())},e.prototype.enableShortMode=function(){!0!==this._shortMode&&(this._shortMode=!0,this._render())},e.prototype.disableShortMode=function(){!1!==this._shortMode&&(this._shortMode=!1,this._render())},e.prototype.isShortModeEnabled=function(){return this._shortMode},e.prototype.start=function(){!this._subscribed&&this._symbolName&&(this._quoteSession||(this._quoteSession=Object(r.getQuoteSessionInstance)("simple")),this._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)},e.prototype.stop=function(){this._subscribed&&this._quoteSession&&this._symbolName&&(this._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)},e.prototype._init=function(e){this._el=e.el?e.el:document.createElement("span"),this._el.innerHTML="",this._classMap=e.classMap, this._labelMap=e.labelMap,this._showTooltip=e.showTooltip,this._classSuffix=e.classSuffix,this._symbolName=e.symbol,e.tooltipType&&(this._tooltipType=e.tooltipType),this._quoteSessionGUID=Object(o.guid)(),!0===e.short&&this.enableShortMode(),e.data&&this._updateValue(e.data)},e.prototype._clearClasses=function(){var e=this;Object.values(this._classMap).map(function(t){e._el.classList.remove(""+t),e._el.classList.remove(""+t+e._classSuffix)})},e.prototype._render=function(){this._renderClasses(),this._renderTooltip(),this._renderLabel()},e.prototype._renderLabel=function(){this._el.textContent=this.getLabel()},e.prototype._updateValue=function(e,t){var i=this._getValueFromData(e);(t||i!==this._value)&&(this._value=i)},e.prototype._renderClasses=function(){var e,t,i,n=this._el.classList;n.add(this._componentClass,this._componentClass+this._classSuffix),e=this._classMap[this._value];for(t in this._classMap)(i=this._classMap[t])&&(i===e?n.add(i,i+this._classSuffix):n.remove(i,i+this._classSuffix));!e&&this._value&&s.logWarn("no className for status "+this._value)},e.prototype._renderTooltip=function(){this._el.setAttribute("title",this._showTooltip?this.getTooltipText():""),"custom"===this._tooltipType&&this._el.classList.toggle("apply-common-tooltip",this._showTooltip)},e.prototype._getQuoteSessionId=function(){return this._quoteSessionPrefix+"."+this._quoteSessionGUID},e}(),window.AbstractIndicator=a},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){var i=new Date(e+t),n=Math.round(Math.abs(t)/6e4),o="UTC";return 0!==n&&(o+=t>0?"+":"-",o+=Math.floor(n/60),n%60&&(o+=":"+n%60)),i.getUTCFullYear()+"-"+("0"+(i.getUTCMonth()+1)).slice(-2)+"-"+("0"+i.getUTCDate()).slice(-2)+" "+("0"+i.getUTCHours()).slice(-2)+":"+("0"+i.getUTCMinutes()).slice(-2)+" ("+o+")"}function r(e){return"string"==typeof e&&0!==e.trim().length}function s(e){var t,i,n,o,s;if(!e||0===e.length)return!0;for(t=0;t2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.hasOwnProperty("text")?(i=r&&(0,d.forceLTRStr)(e.text)||e.text,e.hasOwnProperty("color")&&o?t.append($("",{style:"color: "+e.color}).text(i)):t.text(i)):(n=r&&(0,d.forceLTRStr)(e)||e,t.text(n))}function l(e,t){if(Array.isArray(e)&&2===e.length)$("
").append(a(e[0],$("
")),a(e[1],$("
"),!0,!0)).appendTo(t);else if(e.hasOwnProperty("br")&&e.br)$("
").appendTo(t);else{var i=$("
").append(a(e,$("
"))).appendTo(t);e.hasOwnProperty("listItem")&&i.addClass("list-item")}}function c(e,t){var i=(0,d.forceLTRStr)(e.text);$("").attr("href",e.href).text(i).addClass(e.class).appendTo(t)}function h(e,t){var i,n,r,s,a,h=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof e)i=(0,d.forceLTRStr)(e), $("

").text(i).appendTo(t);else if(e.hasOwnProperty("lines"))for(n=0;n").text(e.lines[n].line).appendTo(t):l(e.lines[n].line,t):e.lines[n].hasOwnProperty("link")&&c(e.lines[n].link,t);else e.hasOwnProperty("title")&&$("

").text(e.title).appendTo(t),e.hasOwnProperty("actual")&&(r=e.actual&&(0,d.forceLTRStr)(e.actual),$("
").append($("
").text($.t("Actual")+": "),$("
").text(r||"—")).appendTo(t)),e.hasOwnProperty("forecast")&&(s=e.forecast&&(0,d.forceLTRStr)(e.forecast),$("
").append($("
").text($.t("Forecast")+": "),$("
").text(s||"—")).appendTo(t)),e.hasOwnProperty("previous")&&(a=e.previous&&(0,d.forceLTRStr)(e.previous),$("
").append($("
").text($.t("Previous")+": "),$("
").text(a||"—")).appendTo(t)),e.hasOwnProperty("timestamp")&&$("
").append($("
").text($.t("Date")+": "),$("
").text(o(e.timestamp,h)||"—")).appendTo(t)}var u,d;Object.defineProperty(t,"__esModule",{value:!0}),t.Tooltip=void 0,u=function(){function e(e,t){var i,n;for(i=0;i0&&void 0!==arguments[0]?arguments[0]:{},i=t.direction,o=void 0===i?"top":i,r=t.clickable,s=void 0!==r&&r,a=t.wide,l=void 0!==a&&a;n(this,e),this._direction=o,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=l?250:200,this._$tooltip=$("
").addClass("tv-chart-events-source__tooltip").css({position:"absolute",width:this._width+"px"}),this._$tooltipContent=$("
").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip),s&&this._$tooltip.addClass("tv-chart-events-source__tooltip--clickable")}return u(e,[{key:"show",value:function(){var e,t,i,n,o,r,a,l,c,u,d,p,_,f,m,y,g,v,S,b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},w=b.items,P=void 0===w?[]:w,T=b.x,x=void 0===T?0:T,C=b.y,L=void 0===C?0:C,I=b.wrapElement,A=void 0===I?null:I,k=b.timeOffset,E=void 0===k?"":k,M=b.leftBorderColor,V=void 0===M?null:M;if(A&&!s(P)){if(e=$(A).width(),t=$(A).height(),i=!1,n=!1,this._tooltipShown||(this._$tooltip.appendTo(A),this._tooltipShown=!0,i=!0,n=!0),x===this._tooltipX&&L===this._tooltipY||(i=!0),i&&(o=Math.max(Math.min(x-this._width/2,e-this._width-10),0),this._$tooltip.css({left:Math.round(o),bottom:Math.round(t-L+10)})),this._tooltipItems||(n=!0),!n)for(r=P.length;r--;)if(this._tooltipItems[r]!==P[r]){n=!0;break}if(n){if(a=void 0,P.length<=1)a=P;else{for(l={},c=P.length;c--;)u=P[c].importance,null==u&&(u=-1),l[u]||(l[u]=[]),l[u].push(P[c]);if(d=Object.keys(l).sort(function(e,t){return e-t}),d.length<=1)a=l[d[0]];else for(a=[],p=d.length;p--;)for(_=l[d[p]],f=_.length;f--;)a.push(_[f])}for(this._$tooltipContent.empty(),m=a.length;m--;)y=a[m],g="", y.hasOwnProperty("importance")?("string"==typeof y.importance&&("earnings"===y.importance?g="--importance-earnings":"splits"===y.importance?g="--importance-splits":"dividends"===y.importance?g="--importance-dividends":"list"===y.importance&&(g="--importance-list")),0===y.importance?g="--importance-normal":y.importance>0&&(g="--importance-high")):V||(g="--importance-none"),v="tv-chart-events-source__tooltip__item",g&&(v+=" "+v+g),S=$("
").attr("class",v),V&&S.css("border-left-color",V),h(y,S,E),S.appendTo(this._$tooltipContent);this._tooltipItems=P}"bottom"===this._direction&&this._$tooltip.css({bottom:Math.round(t-L-this._$tooltipContent.height()+10)})}}},{key:"hide",value:function(){this._tooltipShown&&(this._$tooltip.detach(),this._tooltipShown=!1)}},{key:"isOpened",value:function(){return this._tooltipShown}}]),e}()},function(e,t,i){"use strict";(function(t){var n=i(37),o=i(15).Interval,r=i(8),s=i(5),a=function(e,t){this._server=e,this._session=t,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new r,this.seriesError=new r,this._lastBarTimes={}};a.prototype.lastBarTime=function(e){return this._lastBarTimes[e]},a.prototype._userTimezone=function(){return this._timezone},a.prototype.setTimezone=function(e){this._timezone="exchange"===e?"exchange":t.get_timezone(e),this._timezoneId=e},a.prototype.timezone=function(){return this._timezoneId},a.prototype.setResolution=function(e){this._isDWM=o.isDWM(e),this._resolution=e},a.prototype.onRequestMetadata=function(e,t){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,e,{errors:[],hash:"",metainfo:t,migrations:[]}]})},a.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},a.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},a.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},a.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},a.prototype.onSeriesCompleted=function(e,t,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]}),this.seriesCompleted.fire(e,t)},a.prototype.onSeriesError=function(e,t){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t]}),this.seriesError.fire(e,t)},a.prototype.onSeriesClearData=function(e,t){var i={};i[e]={series:[],turnaround:t},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[],index_diff:[]}]})},a.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},a.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},a.prototype._calcMarksTime=function(e,i,o,r,a){ var l,c,h,u,d,p=t.get_timezone(i),_=this;if(this._isDWM&&!s.enabled("disable_resolution_rebuild"))for(d=new n.Session,d.init(p,o),u=0;u=0;--a)if(Math.floor(r/l[a].divisor)!==Math.floor(s/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],e.exports=a}).call(t,i(35))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"supportedLineTools",function(){return n});var n={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush",onlySelectable:!0},text:{name:"LineToolText",supportsText:!0},anchored_text:{name:"LineToolTextAbsolute",supportsText:!0},note:{name:"LineToolNote",supportsText:!0},anchored_note:{name:"LineToolNoteAbsolute",supportsText:!0},callout:{name:"LineToolCallout",supportsText:!0},balloon:{name:"LineToolBalloon",supportsText:!0},arrow_up:{name:"LineToolArrowMarkUp",supportsText:!0},arrow_down:{name:"LineToolArrowMarkDown",supportsText:!0},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:!0},arrow_right:{name:"LineToolArrowMarkRight",supportsText:!0},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},cross_line:{name:"LineToolCrossLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},info_line:{name:"LineToolInfoLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fixed:{name:"LineToolGannFixed"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{ name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},function(e,t,i){"use strict";var n,o,r,s,a,l;i.d(t,"a",function(){return o}),i.d(t,"b",function(){return r}),i.d(t,"c",function(){return s}),i.d(t,"d",function(){return a}),i.d(t,"e",function(){return l}),n=i(25),i.n(n),o=function(){function e(){}return e.prototype.init=function(e,t){e.new_sym(t(1),n.Std.period(e),n.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1},e.prototype.main=function(e,t){var i,o,r,s,a,l,c=e.symbol.time,h=n.Std[this._source](e);return e.select_sym(1),i=n.Std[this._source](e),o=e.new_unlimited_var(i),r=e.new_unlimited_var(e.symbol.time),e.select_sym(0),isNaN(c)?null:(s=r.indexOf(c),-1!==s&&r.get(s)!==c&&(s=-1),a=s<0?NaN:o.get(s),l=this._doCalculation(this._scaleFactor1,h,this._scaleFactor2,a),[l])},e}(),r={styles:{plot1:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:2,inputs:{source:"close",symbol2:""}},s=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],a=[{id:"plot1",type:"line"}],l={plot1:{title:"Plot",histogramBase:0}}},function(e,t,i){"use strict";function n(e){var t=e.className,i=e.icon,n=void 0===i?"":i,r=e.onClick,s=e.title;return o.createElement("span",{title:s,className:t,dangerouslySetInnerHTML:{__html:n},onClick:r})}var o;t.a=n,o=i(20),i.n(o)},function(e,t,i){var n;!function(t){"use strict";function o(){}function r(e,t){ for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function s(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var l=o.prototype,c=t.EventEmitter;l.getListeners=function(e){var t,i,n=this._getEvents();if(e instanceof RegExp){t={};for(i in n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i])}else t=n[e]||(n[e]=[]);return t},l.flattenListeners=function(e){var t,i=[];for(t=0;t0&&e.stroke(),this._data.fillBackground&&(e.fillStyle=this.getColor(),e.fill()))},e.prototype.hitTest=function(e){var t,i,n,a,l,c,h,u,d,p;return null===this._data||this._data.points.length<2||this._data.nohittest?null:(t=this._data.points,i=t[0],n=t[1],a=new s.Point(n.x,i.y),l=new s.Point(i.x,n.y),c=Object(o.distanceToSegment)(i,a,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(a,n,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(n,l,e),c.distance<=3?this._hitTestResult:(c=Object(o.distanceToSegment)(l,i,e),c.distance<=3?this._hitTestResult:this._data.fillBackground&&(h=Math.min(i.x,n.x),u=Math.max(i.x,n.x),d=Math.min(i.y,n.y),p=Math.max(i.y,n.y),i=new s.Point(h,d),n=new s.Point(u,p),Object(r.pointInRectangle)(e,i,n))?this._backHitTestResult:null))))},e.prototype.getColor=function(){var e=Object(l.ensure)(this._data);return Object(a.generateColor)(e.backcolor,e.transparency,this._forceOverrideTransparency)},e}()},function(e,t,i){"use strict";var n,o,r,s;i.d(t,"a",function(){return s}),n=i(1),o=i(20),i.n(o),r=i(59),i.n(r),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._handleOutsideEvent=function(e){t.props.handler&&!r.findDOMNode(t).contains(e.target)&&t.props.handler(e)},t}return n.c(t,e),t.prototype.componentDidMount=function(){this.props.click&&document.addEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.addEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.addEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.addEventListener("touchstart",this._handleOutsideEvent,!1)},t.prototype.componentWillUnmount=function(){this.props.click&&document.removeEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.removeEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.removeEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.removeEventListener("touchstart",this._handleOutsideEvent,!1)},t.prototype.render=function(){var e=this.props,t=(e.click,e.handler,e.mouseDown,e.touchEnd,e.touchStart,e.ctor),i=void 0===t?"span":t,r=n.e(e,["click","handler","mouseDown","touchEnd","touchStart","ctor"]);return o.createElement(i,n.a({},r))},t}(o.Component)},function(e,t,i){"use strict";function n(e){ return void 0===e&&(e=""),'\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\x3c!--\n\t\t\t\t--\x3e
\n\t\t\t
\n\t\t
\n\t'}var o,r,s,a,l;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"DEFAULT_SIZE",function(){return s}),t.renderSpinnerTemplate=n,i.d(t,"Spinner",function(){return l}),o=i(333),i.n(o),r=i(202),s="large",a=Object(r.b)(n()),l=function(){function e(e){this._shown=!1,this._el=a.cloneNode(!0),this.setSize(e||s)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,e.appendChild(this._el)),this._shown=!0,this},e.prototype.stop=function(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},e.prototype.setStyle=function(e){var t=this;return Object.keys(e).forEach(function(i){var n=e[i];void 0!==n&&t._el.style.setProperty(i,n)}),this},e.prototype.setSize=function(e){var t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className="tv-spinner "+t+" "+(this._shown?"tv-spinner--shown":""),this},e.prototype.getEl=function(){return this._el},e.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},e}()},function(e,t,i){"use strict";function n(e){return Object(r.clean)(JSON.stringify(e))}function o(e){return JSON.parse(Object(r.clean)(e,!0))}var r;t.b=n,t.a=o,r=i(160),i.n(r)},function(e,t,i){"use strict";function n(e){for(var t=0;t=0&&!0!==p[t].func(e);t--);}function r(e){e.addEventListener("keypress",o,!1)}function s(e,t){var i={name:e,func:t},o=n(i.name);o>-1?p[o]=i:p.push(i)}function a(e){p.forEach(function(t,i){t.name===e&&p.splice(i,1)})}function l(e,t){var i={name:e,func:t},o=n(i.name);o>-1&&p.splice(o,1),p.unshift(i)}function c(){return _?null:_=Object(d.randomHashN)(4)}function h(e){if(e!==_)throw Error("Lock id is outdated");_=null}var u,d,p,_;Object.defineProperty(t,"__esModule",{value:!0}),t.listen=r,t.registerListener=s,t.removeListener=a,t.pushBackListener=l,t.disable=c,t.enable=h,u=i(14),i.n(u),d=i(33),p=[],_=null,r(window)},function(e,t,i){"use strict";(function(n){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),r=function(){function e(e,t){var i,n;for(i=0;i{{#labelLeft}}{{labelLeft}}{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}{{labelRight}}{{/labelRight}}{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}',inputWrapper:'<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}',checkbox:'',checkboxClass:"{{ customClass }}__input",box:''+i(195)+"",ripple:''},c="i-inited",h=function(){function e(t){var i,n=t.customClass,r=void 0===n?"tv-control-checkbox":n,s=t.$checkbox,l=t.tag,h=t.id,u=t.name,d=t.checked,p=t.disabled,_=t.labelLeft,f=t.labelRight,m=t.labelAddClass,y=t.boxAddClass;if(o(this,e),this.$el=null,void 0===l&&(l=_||f?"span":"label"),i=s instanceof $&&!!s.length){if(!s.is("input[type=checkbox]"))return void a.logError("`$checkbox` need to be input[type=checkbox]");if(s.hasClass(c))return;this._setInputId(s,h),this._setInputClass(s,r),this._setInputName(s,u),this._setInputChecked(s,d),this._setInputDisabled(s,p),d=!!s.prop("checked"),p=!!s.attr("disabled")}this.$el=this.render({$checkbox:s,hasCheckbox:i,customClass:r,tag:l,id:h,name:u,checked:d,disabled:p,labelLeft:_,labelRight:f,hasLabel:_||f,labelAddClass:m,boxAddClass:y}),this.$checkbox=i?s:this.$el.find("input[type=checkbox]")}return r(e,[{key:"_setInputId",value:function(e,t){void 0!==t&&e.attr("id",t)}},{key:"_setInputClass",value:function(e,t){var i=n.render(l.checkboxClass,{customClass:t});e.addClass(i)}},{key:"_setInputName",value:function(e,t){void 0!==t&&e.attr("name",t)}},{key:"_setInputChecked",value:function(e,t){void 0!==t&&e.prop("checked",!!t)}},{key:"_setInputDisabled",value:function(e,t){void 0!==t&&(t?e.setAttribute("disabled","disabled"):e.removeAttr("disabled"))}},{key:"render",value:function(e){var t,i=e.$checkbox,o=$(n.render(l.labelWrapper,e,l));return e.hasCheckbox&&(o.insertBefore(i),t=o.find("."+e.customClass).andSelf().filter("."+e.customClass).eq(0),t.prepend(i.detach()),i.addClass(c)),o}},{key:"checked",set:function(e){this._setInputChecked(this.$checkbox,!!e)},get:function(){return!!this.$checkbox.prop("checked")}}]),e}(),$.fn.tvControlCheckbox=(0,s.createTvBlockWithInstance)("tv-control-checkbox",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new h(TradingView.mergeObj(t,{$checkbox:e}))}),t.default=h,e.exports=t.default}).call(t,i(126))},function(e,t,i){"use strict";function n(e){if(e)return function(t,i,n){function o(t,i){return i?e[t](a,i):e[t](a)}var r,s,a=$(this) ;return"get"===t?(r=i,"function"==typeof e[r]?o(r,n):e[r]):e[t]?a.each(function(){return o(t,s)}):a}}function o(e,t){function i(e,t,i){return void 0===i?e[t]():e[t](i)}if(e&&t)return e=""+e,function(n,o,a){var l,c,h;return"get"===n?l=o:(c=o,"object"===(void 0===n?"undefined":r(n))&&void 0===o?(c=n,n="init"):"string"!=typeof n&&(n="init")),"getInstance"===n?$(this).eq(0).data(e):"destroy"===n?(h=$(this).eq(0).data(e))?void("function"==typeof h.destroy?(i(h,"destroy",c),$(this).eq(0).removeData(e)):s.logError("[Block Plugin] "+e+" does not support destroy command")):void console.warn("[Block Plugin] Trying to execute destroy method of "+e+" but it has not been inited"):"get"===n?(h=$(this).eq(0).data(e),h?"function"==typeof h[l]?i(h,l,a):h[l]:void console.warn("[Block Plugin] Trying to get prop or execute method of "+e+" but it has not been inited")):$(this).each(function(){var o=$(this),r=o.data(e);void 0===r&&(r=void 0===c?t(o):t(o,c),o.data(e,r)),"init"!==n&&("function"==typeof r[n]?i(r,n,c):s.logError("[Block Plugin] "+e+" does not support command "+n))})}}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=i(4).getLogger("CommonUI.CreateTVBlockPlugin");e.exports.createTvBlockPlugin=n,e.exports.createTvBlockWithInstance=o},,function(e,t,i){"use strict";function n(e){var t,i,n,o,r;return t=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i,i=t.exec(e)||[],n=~~i[1],o=i[2]&&i[2].toUpperCase()||null,r={qty:!n&&o?1:n,unit:o},r.error=!n&&!o,r.intraday=!(r.error||r.unit&&"H"!==r.unit),r}function o(e){var t,i,o;return l.enabled("allow_supported_resolutions_set_only")?null!==(t=r(e))&&Object(c.isAvailable)(""+t):(i=n(e),!i.error&&(i.intraday?h.linking.intraday.value():!(o=h.linking.supportedResolutions.value())||null!==i.unit&&!!~o.indexOf(i.unit)))}function r(e){var t=n(e),i=t.qty,o=t.unit;return t.error?null:("H"===o&&(i*=60,o=null),i&&!o?i+"":o&&(!i||1===i&&"S"!==o)?o:i+o)}function s(){var e=!1;return e}function a(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}var l,c,h;Object.defineProperty(t,"__esModule",{value:!0}),t.parseIntervalValue=n,t.intervalIsSupported=o,t.sanitizeIntervalValue=r,t.canShowSpreadActions=s,t.globalKeypressMatches=a,l=i(5),i.n(l),c=i(61),h=i(62)},function(e,t,i){"use strict";function n(e,t,i){this._cache=e,this._cacheRect=t,this._targetRect=i}var o=i(6).Point,r=i(60).pointInRectangle,s=i(9).HitTestResult;n.prototype.draw=function(e){e.translate(.5,.5),e.drawImage(this._cache,this._cacheRect.left,this._cacheRect.top,this._cacheRect.width,this._cacheRect.height,this._targetRect.left,this._targetRect.top,this._targetRect.width,this._targetRect.height),e.translate(-.5,-.5)},n.prototype.hitTest=function(e){var t=new o(this._targetRect.left,this._targetRect.top),i=t.add(new o(this._targetRect.width,this._targetRect.height));return r(e,t,i)?new s(s.REGULAR):null}, e.exports=n},,,function(e,t,i){"use strict";var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"PipFormatter",function(){return r}),n=i(1),o=i(21),r=function(e){function t(t,i,n,o){var r=this;return i||(i=1),"forex"!==n&&"cfd"!==n||!o?(r=e.call(this,1)||this,r._isForex=!1):(r=e.call(this,o)||this,r._isForex=!0),r._pipPriceScale=t,r._pipMinMove=i,r._pipMinMove2=o,r}return n.c(t,e),t.prototype.format=function(t,i,n){var o=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===o&&(o=NaN),e.prototype.format.call(this,t*this._pipPriceScale/o,i,n)},t}(o.PriceFormatter)},,function(e,t,i){function n(e,t,i,n,r,s){if(!e)return void o.logDebug("Missing control");this._control=e,this._property=t,this._applyOnFly=i,this._undoModel=n,this._undoText=r,t&&(this._formatters=[],this._changed=!1,this.setValue(t.value()),t.listeners().subscribe(this,this.propertyChanged))}var o=i(4).getLogger("Chart.PropertyPage.Binding");n.prototype.addFormatter=function(e){this._formatters.push(e),this.setValue(this._property.value())},n.prototype._formatValue=function(e){return this._formatters.reduce(function(e,t){return t(e)},e)},n.prototype._setValueToProperty=function(e){this._setter?this._setter.call(this,e):this.setValueToProperty(e)},n.prototype._attachToControl=function(e,t){var i=this;t?e.on("keyup change input",function(e){var t=i.value();i._setValueToProperty(t),i.setValue(t)}):(e.keypress(function(e){if(i._changed=!0,13===e.which){var t=i.value();i._setValueToProperty(t),i.setValue(t)}}),e.focusout(function(e){var t=i.value();i.changed()&&(i._setValueToProperty(t),i.setValue(t))}),e.change(function(e){var t=i.value();$(e.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i._setValueToProperty(t)},250)):i._setValueToProperty(t),i.setValue(t)}))},n.prototype.control=function(){return this._control},n.prototype.changed=function(){return this._changed},n.prototype.setValueToProperty=function(e){this._undoModel.setProperty(this._property,e,this._undoText),this._changed=!1},n.prototype.property=function(){return this._property},n.prototype.propertyChanged=function(e){this.setValue(e.value())},n.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},t.Binding=n},function(e,t,i){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"TimeSpanFormatter",function(){return n}),i(11),n=function(){function e(){}return e.prototype.format=function(e){var t,i,n,o,r=e<0;return e=Math.abs(e),t=Math.floor(e/86400),e-=86400*t,i=Math.floor(e/3600),e-=3600*i,n=Math.floor(e/60),e-=60*n,o="",t&&(o+=t+$.t("d",{context:"dates"})+" "),i&&(o+=i+$.t("h",{context:"dates"})+" "),n&&(o+=n+$.t("m",{context:"dates"})+" "),e&&(o+=e+$.t("s",{context:"dates"})+" "),r&&(o="-"+o),o.trim()},e}()},,,function(e,t,i){"use strict";function n(){return[[1,0,0],[0,1,0],[0,0,1]]}function o(e,t){var i,n,o,r=[[0,0,0],[0,0,0],[0,0,0]];for(i=0;i<3;i++)for(n=0;n<3;n++)for(o=0;o<3;o++)r[i][n]+=e[i][o]*t[o][n];return r} function r(e){var t=Math.cos(e),i=Math.sin(e);return[[t,-i,0],[i,t,0],[0,0,1]]}function s(e,t){return[[e,0,0],[0,t,0],[0,0,1]]}function a(e,t){return[[1,0,e],[0,1,t],[0,0,1]]}function l(e,t){var i,n,o=[t.x,t.y,1],r=[0,0,0];for(i=0;i<3;i++)for(n=0;n<3;n++)r[i]+=o[n]*e[i][n];return new c.Point(r[0],r[1])}Object.defineProperty(t,"__esModule",{value:!0});var c=i(6);t.identityMatrix=n,t.multiplyMatrices=o,t.rotationMatrix=r,t.scalingMatrix=s,t.translationMatrix=a,t.transformPoint=l},function(e,t,i){"use strict";function n(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Object.defineProperty(t,"__esModule",{value:!0}),t.regExpEscape=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"StatsPosition",function(){return n});var n;!function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(n||(n={}))},function(e,t,i){"use strict";var n,o;i.d(t,"a",function(){return o}),i(1),n=i(20),i.n(n),function(e){e[e.Enter=13]="Enter",e[e.Space=32]="Space",e[e.Backspace=8]="Backspace",e[e.DownArrow=40]="DownArrow",e[e.UpArrow=38]="UpArrow",e[e.RightArrow=39]="RightArrow",e[e.LeftArrow=37]="LeftArrow",e[e.Escape=27]="Escape",e[e.Tab=9]="Tab"}(o||(o={}))},function(e,t){e.exports=''},function(e,t,i){"use strict";function n(e){var t,i=e.className,n=e.icon,u=e.clearable,d=e.onClear,p=e.size,_=e.strictLeftDirectionInput,f=o.e(e,["className","icon","clearable","onClear","size","strictLeftDirectionInput"]),m=s(c.inputWrapper,(t={},t[i]=!!i,t[c.iconed]=!!n,t[c.clearable]=u,t));return r.createElement(h,o.a({theme:c,className:m,leftComponent:n?r.createElement(a.a,{key:"inputIcon",icon:n,className:c.inputIcon}):void 0,rightComponent:u?r.createElement(a.a,{className:c.clearIcon,icon:l,key:"clearIcon",onClick:d}):void 0,sizeMode:p,strictLeftDirectionInput:_},f))}var o,r,s,a,l,c,h;i.d(t,"a",function(){return h}),t.b=n,o=i(1),r=i(20),i.n(r),s=i(102),i.n(s),a=i(300),l=i(325),i.n(l),c=i(207),i.n(c),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o.c(t,e),t.prototype.render=function(){var e,t,i,n,a=this.props,l=a.theme,h=a.error,u=a.success,d=a.sizeMode,p=a.leftComponent,_=a.rightComponent,f=a.grouped,m=a.fontSize,y=a.reference,g=a.className,v=(a.strictLeftDirectionInput,o.e(a,["theme","error","success","sizeMode","leftComponent","rightComponent","grouped","fontSize","reference","className","strictLeftDirectionInput"])),S={fontSize:m},b=s(l.textInput,this.props.strictLeftDirectionInput&&c.textInputLeftDirection,(e={},e[l.error]=h,e[l.success]=u,e[l[d]]=!!d,e)),w=s(l.inputWrapper,(t={},t[g]=!!g,t[l.grouped]=f, t)),P=[],T=r.createElement("input",o.a({ref:y,className:b,key:"textInput",style:S},v));return p&&(i={className:s(l.leftComponent,p.props.className),key:"leftComponent"},P.push(r.cloneElement(p,i))),P.push(T),_&&(n={className:s(l.rightComponent,_.props.className),key:"rightComponent"},P.push(r.cloneElement(_,n))),r.createElement("div",{className:w},P)},t}(r.PureComponent)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"LabelSettings",function(){return n});var n;!function(e){e.offset=8,e.font="Arial",e.fontSize=12,e.lineSpacing=10,e.bgColor="rgba(255,255,255,.8)",e.borderColor="#e3e3e3",e.padding=8}(n||(n={}))},function(e,t,i){"use strict";function n(e){i.e(9).then(function(t){i(358).showGoToDateDialog(e)}.bind(null,i)).catch(i.oe)}Object.defineProperty(t,"__esModule",{value:!0}),t.showGoToDateDialog=n},,,function(e,t,i){"use strict";!function(e){e.fn.selectable=function(t){return this.each(function(){var i=e(this);i.css("user-select",t?"text":"none"),i.css("-moz-user-select",t?"text":"-moz-none"),i.css("-webkit-user-select",t?"auto":"none"),(e.browser.msie||e.browser.opera)&&i.attr("unselectable",t?"off":"on")})}}(jQuery)},,function(e,t){},function(e,t,i){"use strict";var n,o;i.d(t,"b",function(){return n}),i.d(t,"a",function(){return o}),n=52,o=5},function(e,t,i){"use strict";function n(){var e,t,i=[];for(i=i.concat([61536,61537,61538,61539]),i=i.concat([61725,61726]),i=i.concat([61575,61576,61796,61797]),i=i.concat([61779,61780,61781,61782,61783,61784,61785,61786]),e=i.slice(0),t=61440;t<=61846;t++)-1===i.indexOf(t)&&(t%16==15&&61487!==t||t>=61620&&t<=61630||61718!==t&&61719!==t&&61472!==t&&61619!==t&&e.push(t));return e}Object.defineProperty(t,"__esModule",{value:!0}),i.d(t,"availableIcons",function(){return o});var o=n()},function(e,t,i){"use strict";function n(e,t){return window.fetch(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.fetch=n},function(e,t){},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;i0&&void 0!==arguments[0]?arguments[0]:"keydown",i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n(this,e),this._event=t,this._preventDefault=i}return o(e,[{key:"regHandlers",value:function(e){this._handlers=e}},{key:"watchOn",value:function(e){this._listener=this._regListener(),this._watchingEl=e,e.addEventListener(this._event,this._listener)}},{key:"stopWatching",value:function(){this._watchingEl.removeEventListener(this._event,this._listener)}},{key:"_regListener",value:function(){var e=this;return function(t){var i=t.which,n=e._getHandler(i);t.stopPropagation(),n(t)}}},{key:"_getHandler",value:function(e){ var t=this,i=t._handlers[e],n=function(){},o=function(e){t._preventDefault&&e.preventDefault(),i(e)};return i?o:n}}]),e}()},function(e,t,i){"use strict";function n(e){l.call(this,e),this.ch=e.char[0]||" ",this.fontFamily=e.fontFamily||"Arial",this._charCache=new a(this.ch,!1,!1,this.fontFamily,this.height)}var o=i(6).Point,r=i(27).selectionTolerance,s=i(9).HitTestResult,a=i(265),l=i(44).PaneRendererAbstractShape;inherit(n,l),n.prototype.drawShape=function(e){var t,i,n,o,r,s,a=this._vertOffset>0?1:-1;for(t=0,i=this.items.length;t0?"middle":"bottom")},n.prototype.hitTest=function(e){var t,i,n,a=this._vertOffset,l=r(this.height);for(t=0;t0?"+"+(r-r%1)+n:0===r?"":r-r%1+n+"",{offset:i,string:"UTC"+t}}var o;t.a=n,o=i(35),i.n(o)},,,,,,,,function(e,t,i){"use strict";function n(e){var t,i;return void 0===e&&(e=location.host),t=["i18n.tradingview.com","partial.tradingview.com","www.tradingview.com","wwwcn.tradingview.com"],i=["d33t3vvu2t2yu5.cloudfront.net","dwq4do82y8xi7.cloudfront.net","s.tradingview.com","s3.tradingview.com"],-1!==t.indexOf(e)||-1!==i.indexOf(e)||e.match(/^[a-z]{2}\.tradingview\.com/)||e.match(/prod-[^.]+.tradingview.com/)?"battle":-1!==e.indexOf("tradingview.com")?"staging":e.match(/webcharts/)?"staging_local":(e.match(/^localhost(:\d+)?$/),"local")}function o(){return"local"===n()}function r(){return"battle"===n()}function s(){return!r()}Object.defineProperty(t,"__esModule",{value:!0}),t.environment=n,t.isLocal=o,t.isProd=r,t.isDebug=s},function(e,t,i){"use strict";function n(e,t,i){this._textSizeCache=t,this._data=e,this._fontSize=e.fontsize?e.fontsize:e.fontSize?e.fontSize:12,this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0,e.lines=this._lines=l.prototype.wordWrap.call(this,e.text,e.wordWrapWidth),this._hittest=i||new c(c.MOVEPOINT)}function o(){var e=document.createElement("canvas");e.width=0,e.height=0,r=e.getContext("2d"),e=null}var r,s=i(6).Point,a=i(60).pointInRectangle,l=i(186).TextRenderer,c=i(9).HitTestResult,h=i(46).drawRoundRect,u={priceRange:{width:15,height:14, data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15, 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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,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,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12, 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,0,0,0,134,134,138,255,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,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,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,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,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,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,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,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};n.prototype._preRender=function(){var e,t,i,n,a,l,c,h,u,d,p,_,f,m,y,g,v,S,b,w,P,T,x;if(!this._preRendered){if(r||o(),e=this._data.points[0].x+(this._data.offsetX||0),t=e,i=this._data.points[0].y+(this._data.offsetY||0),n=i,a=this._fontSize,l=this._lineSpacing,c=a+l,h=c*this._lines.length-l,r.textBaseline="top",r.font=this.fontStyle(),u=[],this._data.wordWrapWidth)for(d=this._data.wordWrapWidth,p=0;pn?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(114),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&&$("