webpackJsonp([14],[function(t,e,i){"use strict";function o(t,e){function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function n(t,e){var i,o,n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(o=0,i=Object.getOwnPropertySymbols(t);o=0;r--)(n=t[r])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}function s(t,e){return function(i,o){e(i,o,t)}}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,i,o){return new(i||(i=Promise))(function(n,r){function s(t){try{l(o.next(t))}catch(t){r(t)}}function a(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(s,a)}l((o=o.apply(t,e||[])).next())})}function c(t,e){function i(t){return function(e){return o([t,e])}}function o(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(s=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[0,s.value]),i[0]){case 0:case 1:s=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}function d(t,e){var i,o,n,r,s="function"==typeof Symbol&&t[Symbol.iterator];if(!s)return t;i=s.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)n.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}return n}function p(){for(var t=[],e=0;e1||n(t,e)})})}function n(t,e){try{r(h[t](e))}catch(t){l(u[0][3],t)}} function r(t){t.value instanceof _?Promise.resolve(t.value.v).then(s,a):l(u[0][2],t)}function s(t){n("next",t)}function a(t){n("throw",t)}function l(t,e){t(e),u.shift(),u.length&&n(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,h=i.apply(t,e||[]),u=[];return c={},o("next"),o("throw"),o("return"),c[Symbol.asyncIterator]=function(){return this},c}function m(t){function e(e,n){t[e]&&(i[e]=function(i){return(o=!o)?{value:_(t[e](i)),done:"return"===e}:n?n(i):i})}var i,o;return i={},e("next"),e("throw",function(t){throw t}),e("return"),i[Symbol.iterator]=function(){return this},i}function g(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof u?u(t):t[Symbol.iterator]()}var v,y;Object.defineProperty(e,"__esModule",{value:!0}),e.__extends=o,i.d(e,"__assign",function(){return y}),e.__rest=n,e.__decorate=r,e.__param=s,e.__metadata=a,e.__awaiter=l,e.__generator=c,e.__exportStar=h,e.__values=u,e.__read=d,e.__spread=p,e.__await=_,e.__asyncGenerator=f,e.__asyncDelegator=m,e.__asyncValues=g,v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},y=Object.assign||function(t){var e,i,o,n;for(i=1,o=arguments.length;i0)for(s=0;s=i.multiplier()&&(e=t.key)}),e},n.prototype.calcIsActualSymbol=function(){var t,e=this._properties.symbol,i=this._model.mainSeries(),o=e.value();this._isActualSymbol=i.symbolSameAsCurrent(o),this._isActualSymbol&&(t=i.symbol(),o!==t&&(f.logWarn('Possible drawing "migrating" detected from "'+o+'" to "'+t+'"'),f.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),f.logWarn(Error().stack)),e.setValue(t)),this.calcIsActualInterval()},n.prototype.calcIsActualInterval=function(){var t,e,i,o,n,r=this._properties,s=this._model.mainSeries(),a=u.parse(s.interval()),l=r.intervalsVisibilities;this._isActualInterval=!1,a.kind()===u.SECONDS&&a.multiplier()<60&&(t=l.seconds.value(),e=l.secondsFrom.value(),i=l.secondsTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i), a.kind()===u.SECONDS&&a.multiplier()>=60&&(o=Math.floor(a.multiplier()/60),t=l.minutes.value(),e=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=t&&o>=e&&o<=i),a.kind()===u.MINUTES&&a.multiplier()<60&&(t=l.minutes.value(),e=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i),a.kind()===u.MINUTES&&a.multiplier()>=60&&(n=Math.floor(a.multiplier()/60),t=l.hours.value(),e=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=t&&n>=e&&n<=i),a.kind()===u.DAYS&&(t=l.days.value(),e=l.daysFrom.value(),i=l.daysTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i),a.kind()===u.WEEKS&&(this._isActualInterval=l.weeks.value()),a.kind()===u.MONTHS&&(this._isActualInterval=l.months.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},n.PointPriceProperty.prototype.value=function(){var t=this._lineSource.points()[this._pointIndex].price,e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},n.PointPriceProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.price=parseFloat(t),e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),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())},n.PointIndexProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(n.PointIndexProperty,t),n.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},n.PointIndexProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.index=t,e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),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())},n.prototype._syncMultichartState=function(){var t={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:t})},n.prototype._createPointProperty=function(t){var e,i=this._properties.points;i.addProperty(t),e=i[t],e.addChild("price",new n.PointPriceProperty(this,t)),e.addChild("bar",new n.PointIndexProperty(this,t))},n.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var t=0;t0&&(this._points=i)},n.prototype.restorePoints=function(t,e,i){this._timePoint=t,this._points=e,i||this.denormalizeTimePoints()},n.prototype.restoreExternalPoints=function(t){if(this.properties().interval.setValue(t.interval),this._timePoint=t.points,this.denormalizeTimePoints(),!this.isActualSymbol())return void this.clearServerPoints();this.createServerPoints()},n.prototype.restorePositionPercents=function(t){ this._positionPercents=t},n.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},n.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var t=this.properties().state(this._syncStateExclusions);delete t.interval,h.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}},n.prototype.points=function(){var t,e,i=[];for(t=0;t=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),this._convertPriceFromPercentIfNeeded(i),i},n.prototype.addPoint=function(t,e,i){var o=this._preparePoint(t,e);return this._addPointIntenal(o,e,i)},n.prototype._addPointIntenal=function(t,e,i){this._points.push(t);var o=this._points.length===this.pointsCount();return o?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=t,this._pointAdded.fire(this._points.length-1),o},n.prototype.addFixedPoint=function(t){this._fixedPoints.push(t);var e=this._fixedPoints.length===this.pointsCount();return e&&this.calcPositionPercents(),e},n.prototype.calcPositionPercents=function(){var t,e,i,o;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],t=0;t=0;--i)e.push(this._paneViews[i]);return e},n.prototype._setPaneViews=function(t){this._paneViews=t,this._model.invalidate(new _(_.LIGHT_UPDATE))},n.prototype.dataWindowView=function(){return null},n.prototype.statusView=function(){return null},n.prototype.isSourceHidden=function(){return!this._properties.visible.value()||h.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol},n.prototype.priceAxisViews=function(t,e){var i,o,n;return this.isSourceHidden()?null:-1!==t.dataSources().indexOf(this)&&e===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i"+t.title+": "+t.value}).join("
")},n.prototype.pointToScreenPoint=function(t){var e,i,o,n,s,a,l=this._model.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||l.isEmpty())return[new r(0,0),new r(0,0)];if(e=null,c.isPercent()){if(!this.ownerSource())return;if(null===(e=this.ownerSource().firstValue())||!isFinite(e))return}return i=l.indexToCoordinate(t.index,!0),o=t.price,c.isPercent()&&(o=c.priceRange().convertToPercent(o,e)),n=c.priceToCoordinate(o,!0),s=new r(i,n),i=l.indexToCoordinate(t.index,!1),n=c.priceToCoordinate(o,!1),a=new r(i,n),[s,a]},n.prototype.screenPointToPoint=function(t){var e=this._model.timeScale(),i=this.priceScale(),o=e.coordinateToIndex(t.x),n=i.coordinateToPrice(t.y),r=null;if(i.isPercent()){if(!this.ownerSource())return;if(null===(r=this.ownerSource().firstValue())||!isFinite(r))return}return i.isPercent()&&(n=i.priceRange().convertFromPercent(n,r)),{price:n,index:o}},n.prototype.tags=function(){return[this._constructor]},n.prototype._snapPoint45Degree=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f=this._model.timeScale(),m=f.indexToCoordinate(e.index),g=f.indexToCoordinate(t.index)-m,v=this.m_priceScale,y=e.price,b=t.price,S=this.ownerSource().firstValue();v.isPercent()&&(y=v.priceRange().convertToPercent(y,S)),o=v.priceToCoordinate(y),n=v.priceToCoordinate(b)-o,r=Math.round(Math.atan2(g,n)/Math.PI*4),2===Math.abs(r)?i||(t.price=y):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):(s=Math.sqrt(g*g+n*n),a=g<0?-1:1,l=n<0?-1:1,c=Math.max(Math.abs(n),Math.abs(g)),h=c*Math.sqrt(2),u=h/s,c/=u,d=Math.round(f.coordinateToIndex(m+c*a)),p=Math.abs(f.indexToCoordinate(d)-m),_=v.coordinateToPrice(o+p*l),t.index=d,t.price=_)},n.prototype.createPriceAxisView=function(t){return new s(this,{pointIndex:t})},n.prototype.version=1,n.isLineTool=function(t){var e=TradingView[t];return!!e&&TradingView.isInherited(e,n)},n.prototype.alertId=function(){return this._alertId},n.prototype.setAlert=function(t,e){},n.prototype.flushAlert=function(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)},n.prototype._processAlertHanders=function(t){var e,i,o,n=this;("unsubscribe"!==(t="subscribe"===t?"subscribe":"unsubscribe")||n._alertCallbacks)&&(i="subscribe"===t?"on":"off",e=n.properties(),o=n._alertCallbacks||{flush:n.flushAlert.bind(n),hovered:function(t,e){e?n._model.setHoveredSource(n):n._model.hoveredSource()===n&&n._model.setHoveredSource(null)},selected:function(t,e){ e&&n._model.setSelectedSource(n)},synchronizeSilently:function(t){n.synchronizeAlert(!1)}},n._alertCallbacks||(n._alertCallbacks=o),n.getAlert().done(function(r){r&&(r[i]("destroy",o.flush),r[i]("change:hovered",o.hovered),r[i]("change:selected",o.selected),e.extendLeft&&e.extendLeft[t](n,o.synchronizeSilently),e.extendRight&&e.extendRight[t](n,o.synchronizeSilently))}))},n.prototype.editAlert=function(){},n.prototype.getAlert=function(t){var e,i=this;return t=t||{},e=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:e.resolve.bind(e),error:e.reject.bind(e),fromCache:t.fromCache}):f.logError("[Alerts] Can't get alert without alerts dispatcher"),e.promise()},n.prototype.synchronizeAlert=function(t){var e=this;e.hasAlert.value()&&setTimeout(function(){function i(){e._alertUndoMode=!0,s.undoToCheckpoint(e._undoCheckpointAlert),setTimeout(function(){e._alertUndoMode=!1,e.localAndServerAlersMismatch=!1},0)}function o(t){var i=t.get("description")!==t.defaultDescription(),o=t.get("extra"),n=o.alertSeries(),r=e._model.mainSeries().stateForAlert();"MainSeries"===n.type&&r.actualSymbol===n.actualSymbol&&(o.mainSeries(r),o.alertSeries(r)),t.set("resolution",e.stateForAlert().interval),o.drawing(e),i||t.setDefaultDescription(),e.localAndServerAlersMismatch=!0}function n(t){TradingView.alertsDispatcher.restartAlert(t,{success:function(){e.localAndServerAlersMismatch=!1},error:i,complete:function(){delete e._undoCheckpointAlert}})}var r,s=e._getUndoHistory();e._undoCheckpointAlert||e._alertUndoMode||(r=s.undoStack().pop(),e._undoCheckpointAlert=s.createUndoCheckpoint(),r&&s.undoStack().push(r)),e.getAlert().done(function(e){o(e),t&&n(e)}).fail(i)},0)},n.prototype._getUndoHistory=function(){return this._model._undoModel.undoHistory},n.prototype.stateForAlert=function(){var t,e;if(this.canHasAlert())return t=this.state(),t.id=this.idForAlert(),t.uniqueId=this.idForAlert(),t.title=this.title(),t.interval=this._model.mainSeries().interval(),e=this._getAlertPlots(),e&&(t.plots=e),t},n.prototype._getAlertPlots=function(){return null},n.prototype._linePointsToAlertPlot=function(t,e,i,o){if(2!==t.length)return f.logError("[Drawing Alert] Wrong points"),null;var n=this._model.timeScale();return!n||n.isEmpty()?null:{type:"LinePlot",title:e||this.title(),timestamp:n.indexToTimePoint(0),offset1:t[0].index,offset2:t[1].index,price1:t[0].price,price2:t[1].price,extendBackward:i||!1,extendForward:o||!1}},n.prototype.getAlertIsActive=function(t){this.getAlert({fromCache:!0}).done(function(e){t(!!e&&e.get("active"))}).fail(function(){t(!1)})},n.prototype.geometry=function(){var t=this,e=function(e){var i=e.x/t._model.timeScale().width(),o=e.y/t.priceScale().height();return new r(i,o)};return this.points().map(function(i){var o=t.pointToScreenPoint(i)[0];return e(o)})},n.prototype.onlyYMoving=function(){return!1},n.prototype.model=function(){return this._model},n.prototype.isForcedDrawPriceAxisLabel=function(){return this.customization.forcePriceAxisLabel}, n.prototype.getInputsPropertyPage=function(){return g.LineToolInputsPropertyPage},n.prototype.getVisibilitiesPropertyPage=function(){return g.LineToolVisibilitiesPropertyPage},n.prototype.getSourceIcon=function(){var t=v[this.getType()];return void 0===t?null:{type:"svg",svgCode:t.icon}},n.prototype.destroy=function(){this.stop()},e.LineToolPriceAxisView=s,e.LineDataSource=n}).call(e,i(25))},,function(t,e,i){"use strict";var o,n,r=i(7).getLogger("Chart.DataSourcePropertyPages");e.propertyPages={},o=e.propertyPages,n=null,e.loadPropertyPages=function(){return null!==n?n:(r.logNormal("Start loading property pages"),n=new Promise(function(t){i.e(3).then(function(e){o.ChartStylesPropertyPage=i(1083),o.LineToolABCDPatternStylesPropertyPage=i(1084),o.LineToolArcStylesPropertyPage=i(1085),o.LineToolArrowMarkStylesPropertyPage=i(1086),o.LineToolBalloonStylesPropertyPage=i(1087),o.LineToolBarsPatternStylesPropertyPage=i(1088).LineToolBarsPatternStylesPropertyPage,o.LineToolBezierStylesPropertyPage=i(1089),o.LineToolBrushStylesPropertyPage=i(1090),o.LineToolCalloutStylesPropertyPage=i(1091),o.LineToolCircleLinesStylesPropertyPage=i(1092),o.LineToolDateAndPriceRangeStylesPropertyPage=i(1093),o.LineToolDateRangeStylesPropertyPage=i(1094),o.LineToolDisjointAngleStylesPropertyPage=i(1095),o.LineToolElliottStylesPropertyPage=i(1096),o.LineToolEllipseStylesPropertyPage=i(1097),o.LineToolFibChannelStylesPropertyPage=i(1098),o.LineToolFibCirclesStylesPropertyPage=i(1099),o.LineToolFibRetracementStylesPropertyPage=i(1078),o.LineToolFibSpeedResistanceArcsStylesPropertyPage=i(1100),o.LineToolFibSpeedResistanceFanStylesPropertyPage=i(1101),o.LineToolFibSpiralStylesPropertyPage=i(1102),o.LineToolFibTimeZoneStylesPropertyPage=i(1103),o.LineToolFibWedgeStylesPropertyPage=i(1104),o.LineToolFlatBottomStylesPropertyPage=i(1105),o.LineToolGannComplexStylesPropertyPage=i(1106).LineToolGannComplexStylesPropertyPage,o.LineToolGannFixedStylesPropertyPage=i(1107).LineToolGannFixedStylesPropertyPage,o.LineToolGannFanStylesPropertyPage=i(1108),o.LineToolGannSquareStylesPropertyPage=i(1109),o.LineToolGhostFeedInputsPropertyPage=i(400).LineToolGhostFeedInputsPropertyPage,o.LineToolGhostFeedStylesPropertyPage=i(400).LineToolGhostFeedStylesPropertyPage,o.LineToolHorzLineInputsPropertyPage=i(401).LineToolHorzLineInputsPropertyPage,o.LineToolHorzLineStylesPropertyPage=i(401).LineToolHorzLineStylesPropertyPage,o.LineToolIconStylesPropertyPage=i(1110),o.LineToolInputsPropertyPage=i(1076),o.LineToolLineTool5PointsPatternStylesPropertyPage=i(1111),o.LineToolNotePropertyPage=i(1112),o.LineToolParallelChannelStylesPropertyPage=i(1113),o.LineToolPitchfanStylesPropertyPage=i(1114),o.LineToolPitchforkStylesPropertyPage=i(1115),o.LineToolPolylineStylesPropertyPage=i(1116),o.LineToolPredictionStylesPropertyPage=i(1117),o.LineToolPriceLabelStylesPropertyPage=i(1118),o.LineToolProjectionStylesPropertyPage=i(1119),o.LineToolRectangleStylesPropertyPage=i(1120),o.LineToolRiskRewardInputsPropertyPage=i(402).LineToolRiskRewardInputsPropertyPage, o.LineToolRiskRewardStylesPropertyPage=i(402).LineToolRiskRewardStylesPropertyPage,o.LineToolTextStylesPropertyPage=i(1121),o.LineToolTimeCyclesPropertyPage=i(1122),o.LineToolTrendAngleInputsPropertyPage=i(403).LineToolTrendAngleInputsPropertyPage,o.LineToolTrendAngleStylesPropertyPage=i(403).LineToolTrendAngleStylesPropertyPage,o.LineToolTrendBasedFibExtensionStylesPropertyPage=i(1123),o.LineToolTrendBasedFibTimeStylesPropertyPage=i(1124),o.LineToolTrendLineStylesPropertyPage=i(1125),o.LineToolTrianglePatternStylesPropertyPage=i(1126),o.LineToolTriangleStylesPropertyPage=i(1127),o.LineToolVertLineInputsPropertyPage=i(404).LineToolVertLineInputsPropertyPage,o.LineToolVertLineStylesPropertyPage=i(404).LineToolVertLineStylesPropertyPage,o.LineToolVisibilitiesPropertyPage=i(1128),o.StudyCompareInputsPropertyPage=i(1129),o.StudyDisplayPropertyPage=i(378).StudyDisplayPropertyPage,o.StudyInputsPropertyPage=i(246).StudyInputsPropertyPage,o.StudyLineDataSourcePropertyPage=i(1130),o.StudyOverlayStylesPropertyPage=i(1131),o.StudyPivotPointsStandardStylesPropertyPage=i(1132),o.StudyStrategyPropertyPage=i(1133),o.StudyStylesPropertyPage=i(378).StudyStylesPropertyPage,o.VolumePropertyPage=i(1134),r.logNormal("Property pages loaded"),t()}.bind(null,i)).catch(i.oe)}))}},,function(t,e,i){var o=i(569),n={},r={},s={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets,Array.isArray(e)?e.forEach(function(t){n[t]=1}):e&&Object.keys(e).forEach(function(t){n[t]=1}),n[i]=1}),i=Object.keys(n),i.forEach(function(t){i.forEach(function(i){if(void 0!==(l=o[i])){if(!(e=l.subsets))return;r.hasOwnProperty(t)||(r[t]=[]),Array.isArray(e)&&~e.indexOf(t)?r[t].push(i):t in e&&r[t].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(t){a.disable(t)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(t){a.enable(t)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:n,_setsReverseDependencies:r,_setsStates:s}},enabled:function(t){var e=function(t){var i,o,n=r.hasOwnProperty(t)?r[t]:[];if(!1===s[t])return!1;for(i=s[t],o=0;o=1&&(o+=8*(1+encodeURIComponent(t[i]).length),!(i-1>0&&(n=8*(1+encodeURIComponent(t[i-1]).length),o+n>e)));i--);return t.slice(i)}function s(t,e,i,o,n){var r={id:m,message:e,subSystemId:o,timestamp:+t};m+=1,i.unshift(r),void 0!==n&&i.length>n&&(i.length=n)}function a(t){var e,i=b.reduce(function(t,e){return t.concat(e)},[]);return i.sort(function(t,e){return t.id-e.id}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subSystemId+":"+t.message.replace(/"/g,"'")}),r(e,g)}function l(t,e,i,n){var r,a;if((e!==w||n.id!==T)&&(r=new Date,t<=f.NORMAL&&s(r,e,i,n.id,n.maxCount),t<=x&&(!n.highRate||o())&&(!S||n.id.match(S)))){switch(a=r.toISOString()+":"+n.id+":"+e,t){case f.DEBUG:console.debug(a);break;case f.INFO:case f.NORMAL:n.color?console.log("%c"+a,"color: "+n.color):console.log(a);break;case f.WARNING:console.warn(a);break;case f.ERROR:console.error(a)}w=e,T=n.id,C&&clearTimeout(C),C=setTimeout(function(){w=null,T=null,C=NaN},1e3)}}function c(t,e){function i(t){return function(e){return l(t,e,o,n)}}var o,n;return void 0===e&&(e={}),o=[],b.push(o),n=Object.assign(e,{id:t}),{logDebug:i(f.DEBUG),logError:i(f.ERROR),logInfo:i(f.INFO),logNormal:i(f.NORMAL),logWarn:i(f.WARNING)}}function h(){P=!!p&&"true"===localStorage.getItem(y);var t=parseInt(p?localStorage.getItem(v)||"":"") ;Number.isNaN(t)&&(t=f.WARNING),n(t),L.logNormal("Init with settings - level: "+x+", high-rate: "+P)}function u(){try{p&&(localStorage.setItem(y,P+""),localStorage.setItem(v,x+""))}catch(t){L.logWarn("Cannot save logger state (level: "+x+", high-rate: "+P+") to localStorage: "+t.message)}}var d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L;Object.defineProperty(e,"__esModule",{value:!0}),d="undefined"!=typeof window?window:t,p=!1;try{localStorage.getItem(""),p=!0}catch(t){}_="undefined"!=typeof TradingView?TradingView:{},function(t){t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO",t[t.NORMAL=4]="NORMAL",t[t.DEBUG=5]="DEBUG"}(f=e.LOGLEVEL||(e.LOGLEVEL={})),m=0,g=75497472,v="tv.logger.loglevel",y="tv.logger.logHighRate",b=[],S=null,w=null,T=null,C=NaN,x=f.WARNING,P=!1,e.getLogLevel=i,e.isHighRateEnabled=o,e.setLogLevel=n,e.getLogHistory=a,e.getLogger=c,L=c("logger"),e.loggingOn=d.lon=_.loggingOn=function(t,e){n(f.DEBUG),L.logNormal("Debug logging enabled"),P=!!t,S=e||null,u()},e.loggingNormal=_.loggingNormal=function(){n(f.NORMAL),L.logNormal("Logging set to normal level")},e.loggingOff=d.loff=function(){n(f.INFO),L.logInfo("Debug logging disabled")},h()}).call(e,i(78))},function(t,e,i){"use strict";function o(t,e){return new h(t,e)}function n(t,e){return t.x===e.x&&t.y===e.y}function r(t,e,i){if(0===t&&0===e)throw Error("A and B can not be both equal to zero.");return{A:t,B:e,C:i}}function s(t,e){var i,o,s;if(n(t,e))throw Error("Points should be distinct");return i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,r(i,o,s)}function a(t,e){if(n(t,e))throw Error("Points of a segment should be distinct");return[t,e]}function l(t,e){return{edge:t,isPositive:e}}function c(t,e){return l(t,t.A*e.x+t.B*e.y+t.C>0)}Object.defineProperty(e,"__esModule",{value:!0});var h=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.scaled=function(e){return new t(this.x*e,this.y*e)},t.prototype.normalized=function(){return this.scaled(1/this.length())},t.prototype.transposed=function(){return new t(-this.y,this.x)},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=h,e.point=o,e.equalPoints=n,e.line=r,e.lineThroughPoints=s,e.lineSegment=a,e.halfplane=l,e.halfplaneThroughPoint=c},function(t,e,i){"use strict";function o(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}function n(t){if(void 0===t)throw Error("Value is undefined");return t}function r(t){if(null===t)throw Error("Value is null");return t}function s(t){return r(n(t))}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=o,e.ensureDefined=n,e.ensureNotNull=r,e.ensure=s},function(t,e,i){"use strict";(function(t){function e(){this._listeners=[]}i(7).getLogger("Common.Delegate") ;e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i=0;--e)i=this._listeners[e],i.object===t&&this._listeners.splice(e,1)},e.prototype.destroy=function(){delete this._listeners},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(42)(t))},function(t,e,i){"use strict";var o=function(){function t(t,e,i){this._result=t,this._data=e,this._eraseMarker=i}return t.prototype.result=function(){return this._result},t.prototype.data=function(){return this._data},t.prototype.eraseMarker=function(){return this._eraseMarker},t.MOVEPOINT_BACKGROUND=1,t.REGULAR=2,t.MOVEPOINT=3,t.CHANGEPOINT=4,t.CUSTOM=5,t.CUSTOM_MOVE=6,t}();t.exports=o},function(t,e,i){"use strict";function o(t){return t?(window._tv_languages||{})[t]||null:null}function n(){document.body&&document.body.dispatchEvent(new a.CustomEvent("tradingview-i18next-initialized"))}var r,s,a,l,c,h,u,d;i(571),r=i(293),s=i(285),a=i(572),l={translate:r.translationFunction},window.__tradingviewI18nextInited||(c=window.language||null,h=o(c),c&&h||(console.error("No translation data"),c="en",h=o("en")),c&&h?(u={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:c,nsSeparator:":::",resources:(d={},d[c]={translation:h},d)},s.init(u,n),l.translate=s.t.bind(s),r.addTranslationFunctionToWindow(l.translate),r.addTranslationFunctionToJQuery(l.translate)):n(),window.__tradingviewI18nextInited=!0),t.exports=l},,,function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t){return h(t)&&t.then}function r(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}function s(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function a(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")}var l,c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},h=function(t){return"object"==typeof t&&null!==t},u=function(t){return h(t)&&-1!==(""+t.constructor).indexOf("function Object")} ;"undefined"!=typeof window?(l=window.TradingView=window.TradingView||{},window.isNumber=e,window.isFunction=o,window.inherit=r,window.isArray=c):l=this.TradingView=this.TradingView||{},l.isNaN=function(t){return!(t<=0||t>0)},l.isAbsent=function(t){return null===t||void 0===t},l.isExistent=function(t){return null!==t&&void 0!==t},Number.isNaN=Number.isNaN||function(t){return t!=t},l.isSameType=function(t,e){return Number.isNaN(t)||Number.isNaN(e)?Number.isNaN(t)===Number.isNaN(e):{}.toString.call(t)==={}.toString.call(e)},l.isInteger=function(t){return"number"==typeof t&&t%1==0},l.parseBool=function(t){return!0===t||"true"===t},l.isBoolean=function(t){return!0===t||!1===t},l.isString=function(t){return null!==t&&void 0!==t&&t.constructor===String},l.isInherited=function(t,e){return t===e||!(!t||!t.prototype)&&(void 0!==t.prototype.superclass&&null!==t.prototype.superclass&&(t.prototype.superclass===e||l.isInherited(t.prototype.superclass,e)))},l.TypeValidator=function(t){this.m_type=t},l.TypeValidator.prototype.check=function(t){return t.constructor===this.m_type||l.isInherited(t.constructor,this.m_type)},l.PredicateValidator=function(t){this.m_predicate=t},l.PredicateValidator.prototype.check=function(t){return this.m_predicate(t)},l.clone=function(t){var e,i,o;if(!t||"object"!=typeof t)return t;e="function"==typeof t.pop?[]:{};for(i in t)t.hasOwnProperty(i)&&(o=t[i],e[i]=o&&"object"==typeof o?l.clone(o):o);return e},l.deepEquals=function(t,e,i){var n,r,s,a,h;if(i||(i=""),t===e)return[!0,i];if(o(t)&&(t=void 0),o(e)&&(e=void 0),void 0===t&&void 0!==e)return[!1,i];if(void 0===e&&void 0!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if("object"!=typeof t&&"object"!=typeof e)return[t===e,i];if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,r=e.length,n!==r)return[!1,i];for(s=0;sr&&(c=1*l),0===c);h++);return c}},void 0!==t&&t&&t.exports&&(t.exports={inherit:r,clone:l.clone,merge:l.merge,isNumber:e,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:h,isHashObject:u,isPromise:n,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(e,i(42)(t))},,function(t,e,i){"use strict";(function(t){function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(t=r.hook(t)),r.writeLock)return r._value;if(!e&&r._value===t&&r.hasOwnProperty("_value"))return t;for(r._value=t,i=r._listeners.slice(),o=0,n=0;n0?this._items[this._start]:null},t.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},t.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},t.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},t.prototype.size=function(){return this._end-this._start},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.contains=function(t){return null!==this._search(t)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.add=function(t,e){var i,o;return this._shareRead?(a.logDebug("add: readonly collection modification attempt"),!1):(i={index:t,value:e},o=this._search(t),this._rowSearchCache={},null===o?(this._items.splice(this._lowerbound(t),0,i),this._start=0,this._end=this._items.length,!0):(this._items[o]=i,!1))},t.prototype.search=function(t,e){var i,o;return void 0===e&&(e=l.Exact),this._rowSearchCache[t]&&this._rowSearchCache[t][e]?this._rowSearchCache[t][e]:null===(i=this._search(t,e))?null:(o={index:this._indexAt(i),value:this._valueAt(i)},this._rowSearchCache[t]=this._rowSearchCache[t]||{},this._rowSearchCache[t][e]=o,o)},t.prototype.fold=function(t,e){var i,o,n,r=e;for(i=this._start;i=r;--i)if(o=this._indexAt(i),n=this._valueAt(i),t(o,n))return{index:o,value:n};return null},t.prototype.each=function(t){var e,i,o;for(e=this._start;ee-s.offset&&(l=a),c=this._plotMinMax(a,l,s),h=o(h,c),void 0!==s.baseValue&&null!==h&&(h.min=h.min?Math.min(s.baseValue,h.min):h.min,h.max=h.max?Math.max(s.baseValue,h.max):h.max);return h},t.prototype.merge=function(t){var e,i,o,n;if(this._shareRead)return a.logDebug("merge: readonly collection modification attempt"),[];for(e=[],e.earliestRow=null,i=0,o=t;in.index)&&(e.earliestRow=n),this.add(n.index,n.value)?e.push({insert:n}):e.push({update:n});return e},t.prototype.addTail=function(t,e){var i,o,n,r;for(void 0===e&&(e=!1),i=0,e&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=t[0].value),o=i;oc.index)&&(e.earliestRow=c),this.add(c.index,c.value)?e.push({insert:c}):e.push({update:c}),this._invalidateCacheForRow(c)));return this._rowSearchCache={},e},t.prototype.remove=function(t){var e,i,o,n,r,s;if(this._shareRead)return a.logDebug("remove: readonly collection modification attempt"),[];if(null===(e=this._search(t,l.NearestRight)))return[];if(i=[],o=this._items.splice(e),o.length>0)for(i.earliestRow=o[0],n=0,r=o;nthis._start&&(i-=1),i!==this._end&&this._indexAt(i)t},this._start,this._end)},t.prototype._plotMinMax=function(t,e,i){var o,n,r,s=null;for(o=t;os.max&&(s.max=r)));return s},t.prototype._invalidateCacheForRow=function(t){var e,i=Math.floor(t.index/c);for(e=0;e=0;i--)t.test(o[i])&&r.push(o[i]),t.lastIndex=0;return r}function w(t){for(var e=0;e16)throw new TypeError("invalid length");return 0===e?""+t:("0000000000000000"+t).slice(-e)}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(15),r=i(7),s=r.getLogger("Chart.PriceFormatter"),e.customFormatters={dateFormatter:null,timeFormatter:null},e.formatterOptions={decimalSign:".",decimalSignFractional:"'"},a={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),secondFraction:$.t("Second fraction part is invalid.")},e.numberToStringWithLeadingZero=o,l=function(){function t(t,e,i,o){if(this.type="price",e||(e=1),n.isNumber(t)&&n.isInteger(t)||(t=100),t<0)throw new TypeError("invalid base");if(this._priceScale=t,this._minMove=e,this._minMove2=o,i&&void 0!==o&&o>0&&2!==o&&4!==o&&8!==o)return void s.logDebug("invalid minmove2");this._fractional=i,this.calculateDecimal()}return t.prototype.isFractional=function(){return!!this._fractional},t.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},t.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var t=this._priceScale;for(this._fractional&&this._minMove2&&(t/=this._minMove2);t>1;)t/=10,this._fractionalLength++}},t.prototype.format=function(t,e,i,o){void 0===o&&(o=!0);var n="";return t<0?(n=!0===e?"−":!1===o?"":"-",t=-t):t&&!0===e&&(n="+"),this._fractional?n+this._formatAsFractional(t,i):n+this._formatAsDecimal(t,i)},t.prototype.parse=function(t){ return this._fractional?this._minMove2?this._parseAsDoubleFractional(t):this._parseAsSingleFractional(t):this._parseAsDecimal(t)},t.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},t.serialize=function(t){return t.state()},t.deserialize=function(e){return new t(e.priceScale,e.minMove,e.fractional,e.minMove2)},t.prototype._formatAsDecimal=function(t,i){var n,r,s,a,l;return i=i||0,n=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,i)*this._priceScale/this._minMove,r=Math.floor(t),s=+(Math.round(t*n)-r*n).toFixed(this._fractionalLength),s>=n&&(s-=n,r+=1),a="",1!==n&&(l=void 0!==this._fractionalLength?this._fractionalLength:NaN,a=e.formatterOptions.decimalSign+o(+s.toFixed(this._fractionalLength)*this._minMove,l+i),a=this._removeEndingZeros(a,i)),""+r+a},t.prototype._formatAsFractional=function(t,i){var n,r,s,a,l,c,h,u,d,p=this._priceScale/this._minMove,_=Math.floor(t),f=i?Math.floor(t*p)-_*p:Math.round(t*p)-_*p;if(f===p&&(f=0,_+=1),n="",i&&(r=(t-_-f/p)*p,r=Math.round(r*Math.pow(10,i)),n=o(r,i),n=this._removeEndingZeros(n,i)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return s="",this._minMove2?(a=["0","5"],l=["0","2","5","7"],c=["0","1","2","3","4","5","6","7"],h=f%this._minMove2,f=(f-h)/this._minMove2,u=o(f,this._fractionalLength),d=2===this._minMove2?a[h]:8===this._minMove2?c[h]:l[h],s=u+e.formatterOptions.decimalSignFractional+d):s=o(f*this._minMove,this._fractionalLength),""+_+e.formatterOptions.decimalSignFractional+s+n},t.prototype._removeEndingZeros=function(t,e){for(var i=0;i=s||l<0?{error:a.fraction,res:!1}:(i=r+l/s,n&&(i=-i),{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t.prototype._parseAsDoubleFractional=function(t){var i,o,n,r,s,l,c,h,u,d=RegExp(/^(\-?)[0-9]+$/),p=d.exec(t);return p?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),p=o.exec(t),p?(n=!!p[1],r=parseInt(p[2]),s=void 0!==this._minMove2?this._minMove2:NaN,l=this._priceScale/s, c=this._minMove2,h=this._patchFractPart(parseInt(p[3]),l),u=this._patchFractPart(parseInt(p[4]),c),h>=l||h<0?{error:a.fraction,res:!1}:void 0!==c&&u>=c||u<0?{error:a.secondFraction,res:!1}:(i=void 0!==c?r+h/l+u/(l*c):NaN,n&&(i=-i),{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t}(),e.PriceFormatter=l},,function(t,e,i){"use strict";function o(t,e,i){var o,n,r,s,c;if(e=e||0,!a(t))return i?l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1-e/100))):t;if(e<0&&e>100)throw Error("invalid transparency");return o=l.parseRgb(t),n=o[0],r=o[1],s=o[2],c=l.normalizeAlphaComponent(1-e/100),l.rgbaToString([n,r,s,c])}function n(t){return a(t)?t:l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1)))}function r(t){var e=l.parseRgb(t).map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return+(.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3)}function s(t,e){return l.rgbaToString(l.blendRgba(l.parseRgba(t),l.parseRgba(e)))}function a(t){return 0===t.indexOf("#")}Object.defineProperty(e,"__esModule",{value:!0});var l=i(32);e.generateColor=o,e.resetTransparency=n,e.getLuminance=r,e.blendColors=s,e.isHexColor=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dur=350,e.easingFunc={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.color={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",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(t,e,i){"use strict";(function(t,e){function o(t){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}), TradingView.merge(this,t);var e=t.fullId||t.id;TradingView.merge(this,o.parseIdString(e)),this.name=this.id}var n=i(9).assert,r=i(7).getLogger("Chart.Study.MetaInfo"),s=i(206).applyOverridesToStudyDefaults,a=null;o.VERSION_STUDY_ARG_SOURCE=41,o.METAINFO_FORMAT_VERSION_SOS_V2=42,o.VERSION_PINE_PROTECT_TV_4164=43,o.CURRENT_METAINFO_FORMAT_VERSION=45,o.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],o.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies"],o.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],o.FilledArea={},o.FilledArea.TYPE_PLOTS="plot_plot",o.FilledArea.TYPE_HLINES="hline_hline",o.versionOf=function(t){var e="_metainfoVersion"in t&&isNumber(t._metainfoVersion)?t._metainfoVersion:0;return e<0&&r.logError("Metainfo format version cannot be negative: "+e),e>o.CURRENT_METAINFO_FORMAT_VERSION&&r.logWarn("Client doesn't support this version of metainfo format: "+e),e},o.parseIdString=function(t){var e,i,o,n,r={};if(-1===t.indexOf("@"))r.shortId=t,r.packageId="tv-basicstudies",r.id=t+"@"+r.packageId,r.version=1;else if(e=t.split("@"),r.shortId=e[0],i=e[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:"+t);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?(o=r.shortId,0===o.indexOf("Script$")||0===o.indexOf("StrategyScript$")?(n=o.indexOf("_"),r.productId=n>=0?o.substring(0,n):r.packageId):r.productId=r.packageId):r.productId=r.packageId,r},o.getPackageName=function(t){return(/^[^@]+@([^-]+-[^-]+)/.exec(t||"")||[0,"tv-basicstudies"])[1]},o.cutFullId=function(t){return t.replace(/(@[^-]+-[^-]+).*$/,"$1")},o.cutDollarHash=function(t){var e,i,o=t.indexOf("$"),n=t.indexOf("@");return-1===o?t:(e=t.substr(0,o),i=n>=0?t.substr(n):"",e+i)},o.cutScriptIdPart=function(t){var e=t.indexOf("$"),i=t.indexOf("@");return e<0&&i>=0?"":t.substring(Math.max(e+1,0),i>=0?i:t.length)},o.hasUserIdSuffix=function(t){return/^USER;[\d\w]+;\d+$/.test(t)},o.getSourceIdByInputs=function(t,e){var i,n,r;if(!Array.isArray(t)||!e)return null;for(i=0;i0&&(l=a.replace(/^[^\$]+/,i),n.inputs[s.id].setValue(l)))},o.patchChildStudyMetaInfoState=function(t){function e(t){if("object"==typeof t)for(var i in t)"string"==typeof t[i]&&/^[^\$]+\$\d+$/.test(t[i])?t[i]=t[i].replace(/^[^\$]+/,"{pid}"):e(t[i])}t.state&&e(t.state.inputs),t.state.isChildStudy=!0},o.prototype.parseValue=function(t,e){ return"bool"===t?TradingView.parseBool(e):e},o.prototype.defaultInputs=function(){var t,e=[];for(t=0;t0?t[0].id:null},o.findStudyMetaInfoByDescription=function(t,e){if(t){for(var i=0;i=i))return l;o.removeStudyMetaInfo(t,l,h)}else o.removeStudyMetaInfo(t,l,h)&&r.logDebug("Study with id="+l.id+" already exists in the model!");return t.push(l),l.defaults&&(s=TradingView.clone(l.defaults),s.precision="default",a=o.getStudyPropertyRootName(l),defaults.create(a,s)),l},o.overrideDefaults=function(t){null!==a&&0!==t.length&&s(a,t,function(t){return TradingView.defaultProperties["study_"+t]||null})},o.setDefaultsOverrides=function(t){a=t},o.createMetaInfoStub=function(t,e){var i,o,r;return n(TradingView.isExistent(t.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(t)),i=t.extra&&"strategy"===t.extra.kind||!0===t.isTVScriptStrategy,o=TVScript.createScriptStudyId(t.scriptIdPart,e,i),r={isTVScriptStubToCompile:!0,id:o,scriptIdPart:t.scriptIdPart,description:t.scriptName,TVScriptSourceCode:t.scriptSource,is_hidden_study:t.extra&&t.extra.is_hidden_study,extra:t.extra,version:e},r.pine={}, r.pine.version=TradingView.isExistent(t.version)?t.version:-1,r.pine.access=TVScript.Access.MAP_ID_TO_NAME[t.access],r.pine.userHaveAccess=t.userHaveAccess,!0===i&&(r.isTVScriptStrategy=!0),r},o.isScriptStrategy=function(t){if(t.extra&&t.extra.kind)return t.extra.kind===TVScript.Kinds.STRATEGY;if(!0===t.isTVScriptStrategy)return!0;var e=t.TVScriptSourceCode||t.scriptSource;return!!e&&TVScript.isStrategy(e)},o.replaceWithFullStudyMetaInfoAsync=function(t,e){var i=$.Deferred();return e.isTVScriptStubToCompile||i.resolve(e),i.promise()},o.getOrderedInputIds=function(t){var e,i,o=[],n=t.inputs;for(e=0;e0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new J(n,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c= 1");return s=TradingView.clone(defaults("study")),f(s,t),a=st.getStudyPropertyRootName(t),l=TradingView.clone(defaults(a,r)),t.isTVScript&&t.TVScriptSourceCode!==l.TVScriptSourceCode&&(l=TradingView.clone(TradingView.factoryDefaults(a,r))),TradingView.merge(s,l),o&&(S(!(o instanceof e),"propsState should not be an instance of Property"),TradingView.merge(s,o)),c=TradingView.clone(t),h={},_.mergeInputsObjPart(h,c.defaults.inputs),_.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!==n?n.model().getStudyShiftColorStartOffset():void 0,p=m(n,t),TradingView.merge(s,g(s,p,d)),o&&TradingView.merge(s.styles,o.styles),s}function _(t,e,o,n,r){var s,a,l,c,h,u,d=i(84);return t.version&&o.version&&t.version!==o.version&&ct.logWarn("Serialized metaInfo version "+t.version+" is not equal to the saved state version "+o.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults("study_"+t.id)),f(s,t),TradingView.merge(s,o),s=r.updateStudyState(s,t,e),a=TradingView.clone(e||t),a&&st.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!==n?n.model().getStudyShiftColorStartOffset():void 0,u=m(n,a),TradingView.merge(s,g(s,u,h)),s}function f(t,e){var i,o,n,r;if(e.plots)for(i=0;im+1?(T=_[m+1],void 0!==T&&null!==T?(C=g.valToIndex?g.valToIndex[T]:T,f.color=v.colors[C].color.value()):f.color=w):f.color=w,f.floatCoordinate=this.priceScale().priceToCoordinate(b,!0),f.coordinate=Math.round(f.floatCoordinate),f.item=_,f},v.prototype.series=function(){return this._series},v.prototype.model=function(){return this._model},v.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},v.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data=new ot(this._plotFields),this._graphics=new q(this._metaInfo),this._plotOffsets={}},v.prototype.onTagsChanged=function(){return this._tagsChanged},v.prototype.properties=function(){return this._properties},v.prototype.state=function(t){var e,i,o,n,r=TradingView.className(this.constructor),s={type:r,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof st?s.metaInfo=TradingView.clone(this.metaInfo().state()):(s.metaInfo=TradingView.clone(this.metaInfo()),s.metaInfo.id=st.parseIdString(s.metaInfo.id+(s.metaInfo.version?"-"+s.metaInfo.version:"")).fullId),t&&(s.data=this.m_data.state(),s.data.symbols=this._resolvedSymbols,s.data.graphics=this._graphics.graphics(),s.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(s.ownerSource=this.ownerSource().id()),e=0;e=0?n:0));return this._isChildStudy&&st.patchChildStudyMetaInfoState(s),s},v.prototype._plotsForAlert=function(){var t=this,e=this._metaInfo,i=[at.PlotTypes.LINE,at.PlotTypes.SHAPES,at.PlotTypes.CHARS,at.PlotTypes.ARROWS,at.PlotTypes.OHLC_OPEN,at.PlotTypes.OHLC_HIGH,at.PlotTypes.OHLC_LOW,at.PlotTypes.OHLC_CLOSE];return e.plots.map(function(t,e){ return t.pinePlotIndex=e,t}).filter(function(t){return-1!==i.indexOf(t.type)}).map(function(i){var o={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:t.offset(i.id)};return e.styles&&void 0!==e.styles[i.id]&&(o.title=e.styles[i.id].title||""),i.target&&e.ohlcPlots&&e.ohlcPlots[i.target]&&(o.ohlcTitle=e.ohlcPlots[i.target].title),o})},v.prototype.isSavedInStudyTemplates=function(){for(var t=0;t0?$.when.apply($,r).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),n.resolve("All symbols are resolved now")}.bind(this)).fail(function(t){this._status=$.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),n.reject("Invalid symbol, "+t)}.bind(this)):n.resolve("There are no symbols to resolve"),n.promise()},v.prototype._allInputsAreValid=function(){var t,e,i;for(t=0;t0)return!0;for(t in this._metaInfo.graphics)for(e in this._metaInfo.graphics[t])if(i=this.properties().graphics[t][e],!i.visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},v.prototype.start=function(t,e){var i,o=this._model.mainSeries();if(!o.isStarted())return void o.onCompleted().subscribe(this,function(){this.start(t,e)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==e||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(t,e)}.bind(this)).fail(function(t){ct.logError("ERROR: "+this._debugId()+" start failed, "+t),delete this._restarting}.bind(this))},v.prototype._getStudyIdWithLatestVersion=function(){var t=st.cutDollarHash(this._metaInfo.id),e=t;return["Script@tv-scripting","StrategyScript@tv-scripting","ESD@tv-scripting"].indexOf(t)>=0?e+="-72!":e+="-"+this._metaInfo.version,e},v.prototype._startAfterSymbolsResolved=function(t,e){var i,o;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);st.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=v.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._getStudyIdWithLatestVersion(),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===t&&this._children))for(o=0;o=t&&(e=w(this._series.bars().lastIndex())-t,w(this._series.bars().valueAt(e))[TradingView.TIME_PLOT]),null},v.prototype.getSymbolString=function(t){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:t,session:"extended"}):t},v.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},v.prototype.inputsForAlert=function(){var t=this.offset(),e=this.inputs();return t&&e.push(t),e},v.prototype.inputs=function(t){var e={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(e,t),this._buildInputs(e)},v.prototype._buildInputs=function(t){var e,i;S(!!t,"options not set"),e={};try{e=this._prepareInputs(t)}catch(t){ct.logWarn("Failed to prepare study inputs: "+t)}return t.asObject?(i={},Object.keys(e).forEach(function(t){null!=e[t]&&(i[t]=e[t])}),i):(i=[],Object.keys(e).forEach(function(t){null!=e[t]&&i.push(e[t])}),i)},v.prototype._prepareInputs=function(t){var e,i,o,r;for(S(!!t,"options not set"),e={},i=0;i=0?r:n),n):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()},v.prototype._rebindToSource=function(t,e){var i,o,n,r,s,a,l,c,h,u,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,o=null,t===this._model.mainSeries()){for(n=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(t,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,n=n.map(function(t){var i=isNumber(t)?f._numericFormatter.format(t):r&&r[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+n.join(", ")+")"}return o},v.prototype.invalidateTitleCache=function(t){if(this._titleCache={},!0===t&&this._children)for(var e=0;e0,S(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){r._makeJSONForNSData(t).then(function(i){var o,s;t.params.nonseries.d=i,r._processPlotOffsets(t.params),r.transformData(t.params.plots),o=r._mergeData(t.params.plots).earliestRow,r.hasBarColorer()&&(null!==o?r._model.mainSeries().invalidateBarStylesCache(o.index):ct.logNormal("ERROR: No earliestRow in studies plots, "+r._debugId())),r._graphics.process(t.params.nonseries),r._postProcessGraphics(),s=r._model.paneForSource(r),r._model.recalculatePane(s,n),r._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},v.prototype.transformData=function(t){},v.prototype.moveData=function(t){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(t)},v.prototype.replaceData=function(t,e,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(t+1),this.m_data.addTail(i,e)}, v.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},v.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},v.prototype._processPlotOffsets=function(t){v.processPlotOffsets(this,t)},v.prototype._mergeData=function(t){return this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(t)},v.prototype._postProcessGraphics=function(){var t=this,e=function(e){var i,o,n,r,s=t._graphics.graphics(),a=[];if(s&&s[e])for(n=s[e],i=0;i=0){if(g=o.properties().styles[h].histogramBase.value(),!isNumber(g))continue;f.baseValue=g}a.push(f)}if(v=o.m_data.minMaxOnRange2(t,e,a),s&&(a=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],y=o.series().data().bars().minMaxOnRange2(t,e,a),v=rt(v,y)),null!==v&&(i=new r(v.min,v.max)),n.bands)for(c=0;c1&&(this._currentIndex.set(r),this._currentValue.set(s),this._pivotIndex.set(a))}function a(t,e,i){var o,n,r,a,l;this._deviation=t,o=i.new_var(w.high(i)),n=i.new_var(w.low(i)),o.get(2*e+1),n.get(2*e+1),this._pivotHigh=new s(e,e,s.HIGH,o,i),this._pivotLow=new s(e,e,s.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=w.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),a=this._lastVal.get(1),l=this._lastType.get(1),this._index>1&&this.addPivot(r,a,l),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function l(t){this.symbol=t,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function c(t){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=t}function h(t,e){this.timezone=t||"America/New_York",this.session=e||"0000-0000"}function u(t,e,i,o,n,r){this.periodBase=i,this.tickerid=t,this.period=e,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 S.Session,this.other_sessions={},this.script=o,this.ticker=u.parseTicker(t);var s=u.parsePeriod(e);this.resolution=s.resolution,this.interval=s.interval,this.bb_cache={},this.minTick=n,this.periodForInitialRange=r}function d(t,e,i,o,n,r,s,a,c){this.body=n,this.symbols=[],this.runner=o,this.inputCallback=s,this.out=r,this.nonseriesOut=c,this.ctx=new l(this.add_sym(t,e,i,a)),this.init()}function p(t){this.symbols=[],this.barsets=[],this.subscription=[],this.host=t,this.isRecalculated=!1,this.start()}function _(t){p.feed=t}function f(t){this.runner=new p(t)}function m(t,e){this.info=t,this.bars=e||[],this.isBarClosed=!0}function g(t,e){this.period=t,this.generateEmptyBars=!!e}function v(){}var y="undefined"!=typeof window?window:e,b=y.PineJsCalendar?y.PineJsCalendar:i(50),S=i(58),w={};return w.max_series_size=10001,w.n=function(t){return t.symbol.index+1},w.nz=function(t,e){return e=e||0,isFinite(t)?t:e},w.na=function(t){return 0===arguments.length?NaN:isNaN(t)?1:0},w.isZero=function(t){return Math.abs(t)<=1e-10},w.toBool=function(t){return isFinite(t)&&!w.isZero(t)},w.eq=function(t,e){return w.isZero(t-e)},w.neq=function(t,e){return!w.eq(t,e)},w.ge=function(t,e){return w.isZero(t-e)||t>e},w.gt=function(t,e){return!w.isZero(t-e)&&t>e},w.lt=function(t,e){return!w.isZero(t-e)&&tn},w.less=function(t,e){return e-t>n},w.max=Math.max,w.min=Math.min,w.pow=Math.pow,w.abs=Math.abs,w.log=Math.log,w.log10=function(t){return Math.log(t)/Math.LN10},w.sqrt=Math.sqrt,w.sign=function(t){return isNaN(t)?NaN:w.isZero(t)?0:t>0?1:-1},w.exp=Math.exp,w.sin=Math.sin,w.cos=Math.cos,w.tan=Math.tan,w.asin=Math.asin,w.acos=Math.acos,w.atan=Math.atan,w.floor=Math.floor,w.ceil=Math.ceil,w.round=Math.round,w.avg=function(t,e,i,o,n,r){var s,a;if(2===arguments.length)return(t+e)/2;for(s=0,a=0;a=0;--r)(s=e[r])>=i.sessionStart||(i.moveTo(s),a=e[r+1],o.push(a));o.reverse()}return o},w.iff=function(t,e,i){return w.not(t)?i:e},w.rising=function(t,e){for(var i=1;it.get(0))return 0 ;return 1},w.falling=function(t,e){for(var i=1;i=0;o--)n=e-o,r+=n*t.get(o);return 2*r/(e*(e+1))},w.vwma=function(t,e,i){var o=i.new_var(w.volume(i)),n=i.new_var(t.get(0)*w.volume(i));return w.sma(n,e,i)/w.sma(o,e,i)},w.swma=function(t,e){return(t.get(0)+2*t.get(1)+2*t.get(2)+t.get(3))/6},w.lowestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).index},w.lowest=function(e,i,o){return t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).value},w.highestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).index},w.highest=function(e,i,o){return t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).value},w.cum=function(t,e){var i=e.new_var(),o=w.nz(i.get(1))+t;return i.set(o),o},w.accdist=function(t){var e=w.high(t),i=w.low(t),o=w.close(t),n=w.volume(t);return w.cum(o===e&&o===i||e===i?0:n*(2*o-i-e)/(e-i),t)},w.correlation=function(t,e,i,o){var n=w.sma(t,i,o),r=w.sma(e,i,o),s=o.new_var(t.get()*e.get());return(w.sma(s,i,o)-n*r)/Math.sqrt(w.variance2(t,n,i)*w.variance2(e,r,i))},w.stoch=function(t,e,i,o,n){var s=w.highest(e,o),a=w.lowest(i,o);return w.fixnan(r(t.get()-a,s-a),n)},w.tsi=function(t,e,i,o){var n=o.new_var(w.change(t)),r=o.new_var(w.abs(w.change(t))),s=o.new_var(w.ema(n,i,o)),a=o.new_var(w.ema(r,i,o));return w.ema(s,e,o)/w.ema(a,e,o)},w.cross=function(t,e,i){function o(t){return t<0?-1:0===t?0:1}if(isNaN(t)||isNaN(e))return!1;var n=i.new_var(o(t-e));return!isNaN(n.get(1))&&n.get(1)!==n.get()},w.linreg=function(t,e,i){var o,n,r,s,a,l,c=0,h=0,u=0,d=0;for(o=0;othis._currentValue.get():ithis._areaRight},s.prototype.update=function(){var t,e;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(t=!0,e=0;eo:ethis._deviation&&this.addPivot(t,e,i)))},a.prototype.processPivot=function(t){t.update(),this._isBarClosed&&t.isPivotFound()&&this.addPoint(t.pivotIndex(),t.currentValue(),t.pivotType())},w.zigzag=function(t,e,i){return new a(t,e,i).lastPrice()},w.zigzagbars=function(t,e,i){var o=new a(t,e,i);return-1===o.lastIndex()?NaN:o.lastIndex()-w.n(i)},l.prototype.new_sym=function(t,e,i,o){return this.symbol.script.add_sym(t,e,i,void 0,o)},l.prototype.select_sym=function(t){this.symbol=this.symbol.script.get_sym(t)},l.prototype.new_var=function(t){var e,i=this.vars;return i.length<=this.vars_index&&i.push(new c(this.symbol)),e=i[this.vars_index++],arguments.length>0&&e.set(t),e},l.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new l(this.symbol)),this.ctx[this.ctx_index++]},l.prototype.prepare=function(t){var e,i;for(this.ctx_index=0,this.vars_index=0,e=0;e=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(t):(this.mindepth=w.max(this.mindepth,t),NaN)},c.prototype._get=function(t){var e=this.hist_pos-t;return e<0&&(e+=this.hist.length),this.hist[e]},c.prototype.set=function(t){this.hist&&(this.hist[this.hist_pos]=t,this.modified=!0)},c.prototype.prepare=function(t){t===this.symbol&&(t.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},c.prototype.add_hist=function(){var t,e,i;if(!this.hist){for(t=w.na(this.mindepth)?w.max_series_size:w.min(this.mindepth+1,w.max_series_size),t=Math.round(t),e=Array(t),i=0;i=0,i&&(n=e.split(","),o=u.parsePeriod(n[1]),e=n[0]),r=!1,s=!1,a=e[e.length-1],-1==="DWM".indexOf(a)&&("S"===a?s=!0:(r=!0,a="")),l=parseInt(r?e:e.length>1?e.slice(0,e.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:r,isSeconds:s,range:o}},u.newBarBuilder=function(t,e,i){var o=u.parsePeriod(t);return S.newBarBuilder(o.resolution,o.interval,e,i)},u.newSession=function(t,e){var i=b.get_timezone(t);return(new S.Session).init(i,e)},u.prototype.set_symbolinfo=function(t){t||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=t,this.timezone=b.get_timezone(t.timezone),this.session.init(this.timezone,t.session);for(var e in this.other_sessions)this.other_sessions.hasOwnProperty(e)&&this.other_sessions[e].init(this.timezone,e)},u.prototype.get_session=function(t){if(!t)return this.session;var e=this.other_sessions[t];return e||(e=new S.Session,this.other_sessions[t]=e),e},u.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},u.prototype.enable_dwm_aligning=function(t,e){this.dwm_aligner=u.newBarBuilder(this.period,t,e)},u.prototype.bartime=function(t,e){var i,o,n,r,s=this.time;return t&&(i=t,e&&(i+=e),o=this.bb_cache[i],o||(n=this.get_session(e),o=u.newBarBuilder(t,n),this.bb_cache[i]=o),s=o.alignTime(s)),!this.isdwm()||isNaN(s)?s:(r=b.utc_to_cal(this.timezone,s),this.session.spec.correctTradingDay(r,this.timezone),b.cal_to_utc(this.timezone,r))},u.prototype.lastbar=function(t){var e,i;isNaN(t.time)||(e=t.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(e),e=this.dwm_aligner.startOfBar(0)),i=this.time!==e,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=e,this.open=t.open,this.high=t.high,this.low=t.low,this.close=t.close,this.volume=t.volume,this.updatetime=t.updatetime,this.isNewBar=i,this.isBarClosed=t.isBarClosed,this.isLastBar=t.isLastBar,this.isNewBar&&this.index++,this.script.calc(this))},d.prototype.calc=function(t){var e,i,o=this.ctx,n=this.body;o.prepare(t),e=n.main(o,this.inputCallback),i=this,this.out&&e&&(!isNaN(o.symbol.time)||e.nonseries)&&(e.nonseries?("projection"===e.type&&(e.projectionTime=o.symbol.time),this.nonseriesOut(o.symbol,e)):e.bars?e.bars.forEach(function(t){i.out(o.symbol,t)}):this.out(o.symbol,e))},d.prototype.init=function(){var t=this.ctx,e=this.body;e.init&&e.init(t,this.inputCallback),e.main(t,this.inputCallback)},d.prototype.add_sym=function(t,e,i,o,n){var r=this.runner.add_sym(t,e,i,this,o,n);return this.symbols.push(r),r.isdwm()&&this.symbols.length>1&&r.enable_dwm_aligning(this.symbols[0].session,r.session),r},d.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},d.prototype.get_sym=function(t){ return this.symbols[t]},p.prototype.add_sym=function(t,e,i,o,n,r){var s=new u(t,e,i,o,n,r);return this.symbols.push(s),s},p.prototype.get_sym=function(t){return this.symbols[t]},p.prototype.out=function(t,e){if(this.nonseriesUpdate){var i=$.extend({},this.nonseriesUpdate);e.splice(0,0,t.time),i.lastBar=e,this.host.nonseriesOut(t,i)}else this.host.out(t,e)},p.prototype.start=function(){function t(t,o){var n=p.feed.subscribe(t.tickerid,t.period,t.periodBase,t.periodForInitialRange,function(i){"series"==(i.nonseries?"nonseries":"series")?e.update(o,i):i.lastBar?(e.nonseriesUpdate=i,i.lastBar.isLastBar=!0,e.symbols[0].lastbar(i.lastBar),e.nonseriesUpdate=null):r.nonseriesOut(t,i)},r.onErrorCallback,r.symbolInfo,r.sessionId,r.rangeExtension);i.push(n)}var e,i,o,n,r=this.host;for(this._script=new d(r.tickerid,r.period,r.periodBase||r.period,this,r.body,this.out.bind(this),r.input,r.symbolInfo.minmov/r.symbolInfo.pricescale,r.nonseriesOut),e=this,i=[],o=this.symbols,n=0;n=0;e--)for(i=a[e],o=this.barsets[e],n=o.count(),r=0;re){if((o=n-1)6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},t.exports=h},,function(t,e,i){"use strict";(function(t){ function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this.statName=e.statName||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function r(t){o.call(this),this.deferred=t}var s=i(147);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,!0!==e&&this._bindShortCut())},o.prototype._bindShortCut=function(){s.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){s.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(r,o),e.Action=o,e.ActionSeparator=n,e.ActionPlaceholder=r}).call(e,i(10))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this._renderers=[],this._globalAlpha=1}return t.prototype.setGlobalAlpha=function(t){this._globalAlpha=t},t.prototype.append=function(t){this._renderers.push(t)},t.prototype.insert=function(t,e){this._renderers.splice(e,0,t)},t.prototype.draw=function(t){for(var e=0;e=0;e--)null!==(i=this._renderers[e].hitTest(t))&&(null===o||i.result()>o.result())&&(o=i);return o},t}();e.CompositeRenderer=o},function(t,e,i){"use strict";function o(t,e){ return t<=e}function n(t,e){return t>=e}function r(t,e,i){return Math.min(Math.max(t,e),i)}function s(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function c(t,e,i){return Math.abs(t-e)e?1:0}function d(t,e){var i,o;if(void 0===e&&(e=u),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o0&&(i=t[o]);return i}var _,f;Object.defineProperty(e,"__esModule",{value:!0}),_=i(7),f=_.getLogger("Common.MathEx"),e.lessThan=o,e.greaterThan=n,e.clamp=r,e.sign=s,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=c,e.log10=h,e.defComparator=u,e.min=d,e.max=p},,function(t,e,i){"use strict";function o(t){this.items=t.items,this.height=t.height||t.width,this.width=t.width||t.height,this._color=t.color,this._borderColor=t.borderColor,this._vertOffset=t.vertOffset||0,t.textCache&&(this._textCache=t.textCache,this._textColor=t.textColor,this._textVertOffset=this._vertOffset>0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,this._textImageHeight=this._textCache.textImageHeight)}var n=i(8).Point,r=i(11);o.prototype.draw=function(t){this.drawShape(t),this.drawText(t)},o.prototype.drawShape=function(t){throw Error("Not implemented")},o.prototype.drawText=function(t){var e,i,o,n,r,s;if(this._textCache)for(e=0,i=this.items.length;e0?"top":"bottom")},o.prototype.hitTest=function(t,e){var i,o,s,a,l,c,h,u,d,p,_,f,m,g=Math.max(this.height,this.width),v=this._vertOffset,y=this._textVertOffset;for(e=e||r.REGULAR,o=0;o0?0:-this._textImageHeight,h=v>0?this._textImageHeight:0,u=t.x,d=t.y,p=s.x-a,_=l+c,f=s.x+a,m=l+h,u>p&&u_&&di||o&&t.length>o})}function a(t,e,i){return l(t,e,function(t,e){return t.length>=i})}function l(t,e,i){var o,n,r,s,a,l=e;for(t.moveTo(l),o=[],n=0,r=0;!i(o,l);){if(n>5)throw console.trace(["0x10",new Date(e),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((s=t.indexOfBar(l))===I)l=t.startOfBar(0);else if(s===k)l=t.startOfBar(k);else{if((a=t.startOfBar(s))!==e){if(r&&r===a)throw console.trace(["0x11",new Date(e),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");r=a,n=0,o.push(a)}l=t.startOfBar(s+1)}t.moveTo(l),n++}return o}function c(t){if(isNaN(t))return NaN;var e=this.indexOfBar(t);return e===k&&(this.moveTo(t),e=this.indexOfBar(t)),e<0?NaN:this.startOfBar(e)}function h(t,e){this.period=t,this.session=e,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function u(t,e,i,o){this.period=i,this.sessionTgt=t,this.sessionSrc=e||t,this.builder=o,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function d(t,e,i){var o=M.clone(i);return e.alignToSessionStart(o,t),M.cal_to_utc(t,o)}function p(t,e){var i=M.get_day_of_week(e)-t.firstDayOfWeek();return i<0?i+7:i}function _(t,e){var i=e+t.firstDayOfWeek();return i>M.SATURDAY?i-M.SATURDAY:i}function f(t,e){var i=M.get_day_of_year(e)-1,o=p(t,e)-i%7;return 0===o?C(i/7):(o>=0&&(o-=7),C((o+i)/7))}function m(t,e,i){var o,n=0;for(o=e;o0){if((n=r-1)r.start()+r.length()&&o===r.dayOfWeek()-1&&(o++,n-=1440),o===r.dayOfWeek()&&n>=r.start()&&n=this.sessionEnd?k:C(M.time_seconds_diff(t,this.sessionStart)/this.period)},h.prototype.startOfBar=function(t){if(t===k)return this.sessionEnd;if(t<0)throw Error("Negative offset is not supported");return this.sessionStart+M.time_seconds(this.period*t)},h.prototype.isLastBar=function(t,e){return e>=this.sessionStart+M.time_seconds(this.period*(t+1)-1)},h.prototype.moveTo=function(t){var e=this.session.timezone,i=M.utc_to_cal(e,t),o=this.session.spec,n=o.alignToSessionStart(i,this.session.timezone);this.sessionStart=M.cal_to_utc(e,i),this.sessionEnd=this.sessionStart+M.time_minutes(n)},u.prototype.alignTime=c,u.prototype.alignTimeIfPossible=function(t){return this.tradingDayToSessionStart(t)},u.prototype.tradingDayToSessionStart=function(t){return this.moveTo(t),this.startOfBar(0)},u.prototype.indexOfBar=function(t){return t=this.periodEnd?k:0},u.prototype.startOfBar=function(t){if(t===k||t>0)return this.periodEnd;if(t===I)throw Error("PRE_SESSION is not supported");return this.periodStart},u.prototype.isLastBar=function(t,e){return e>=this.periodLastBarStart},u.prototype.moveTo=function(t){var e,i,o,n,r,s,a,l,c=M.utc_to_cal(this.sessionSrc.timezone,t);c=this.sessionSrc.spec.correctTradingDay(c,this.sessionSrc.timezone),e=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(c,e),o=C(i/this.period)*this.period,n=M.get_year(c),r=this.sessionTgt.spec,s=this.builder.startOfPeriod(e,o,n),this.periodStart=d(e,r,s),a=o+this.period,l=this.builder.startOfPeriod(e,a,n),this.periodEnd=d(e,r,l),M.add_date(l,-1),this.moveToPrevWorkDay(r,l),this.periodLastBarStart=d(e,r,l),(this.periodLastBarStart0;++o)r=s.sessionsSpec.isWeekEnd(_(s.sessionsSpec,o)),h+=r?1:0,n-=r?0:1;return a=e.weekEnds+h,l=C((i-e.businessDays)/(7-s.sessionsSpec.weekEndsCount())),c=a+s.sessionsSpec.weekEndsCount()*l,i+c}var s,a,l,c,h;return e>=g(this.sessionsSpec,i)&&(i++,e=0),s=this,a=new Date(Date.UTC(i,M.JANUARY,1)),l=p(this.sessionsSpec,a),c=new o(this.sessionsSpec,l),h=el?this.startOfPeriod(t,0,i+C(a/l)):(o=M.get_cal(t,i,M.JANUARY,1),n=M.add_days_considering_dst(t,o,a),M.utc_to_cal(t,+n))},T.prototype.indexOfPeriod=function(t){return M.get_month(t)},T.prototype.startOfPeriod=function(t,e,i){var o,n,r,s;return e<0?(o=C((11-e)/12),i-=o,e+=12*o):e>M.DECEMBER&&(i++,e=M.JANUARY),n=M.get_cal_utc(i,e,1),r=p(this.session.spec,n),r>4&&(s=7-r,M.add_date(n,s)),n},x.prototype.init=function(t,e){return this.timezone="string"==typeof t?M.get_timezone(t):t,this.spec=new o(e),this},{PRE_SESSION:I,POST_SESSION:k,LASTBAR_SESSION:-3,newBarBuilder:t,Session:x,alignPeriodsBack:r,extrapolateBarsFrontByCount:a,extrapolateBarsFrontToTime:s,lower_bound:P,isTradingNow:L,numberOfFullWeeks:f,numberOfWeekEndsSinceYearStart:v,BusinessDaysBuilder:b,alignExchangeTimeToSessionStartAndReturnUTC:d}}();t.exports=n}).call(e,i(78))},function(t,e,i){"use strict";function o(t){var e=t.className,i=t.icon,o=void 0===i?"":i,r=t.onClick,s=t.title;return n.createElement("span",{title:s,className:e,dangerouslySetInnerHTML:{__html:o},onClick:r})}Object.defineProperty(e,"__esModule",{value:!0});var n=i(2);e.Icon=o},function(t,e,i){"use strict";function o(t,e){var i=e.edge;return i.A*t.x+i.B*t.y+i.C>0===e.isPositive}function n(t,e,i,o){var n=e.add(i).scaled(.5),r=n.add(o).scaled(.5),s=l.intersectLineSegments(e,i,r,t);return null===s&&(null===(s=l.intersectLineSegments(i,o,r,t))&&null===(s=l.intersectLineSegments(o,e,r,t)))}function r(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function s(t,e){var i,o,n,r=e.length-1,s=!1,a=t.x,l=t.y;for(i=0;i=l||n.y=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)=0;e--)if(t=RegExp(i[e]),t.test(o))return!0;return!1},o.onOrder=function(){return"/order/"===window.location.pathname},t.exports.CheckMobile=o.isMobile,t.exports.isOnFeaturePage=i,t.exports.onWidget=o.onWidget,t.exports.supportTouch=o.supportTouch}).call(e,i(5))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(584);e.createDialog=o.createDialog},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(12),e.lineToolsInfo={LineTool5PointsPattern:{icon:i(622),localizedName:$.t("XABCD Pattern")},LineToolABCD:{icon:i(623),localizedName:$.t("ABCD Pattern")},LineToolArc:{icon:i(624),localizedName:$.t("Arc")},LineToolArrow:{ icon:i(625),localizedName:$.t("Arrow")},LineToolArrowMarkDown:{icon:i(626),localizedName:$.t("Arrow Mark Down")},LineToolArrowMarkLeft:{icon:i(627),localizedName:$.t("Arrow Mark Left")},LineToolArrowMarkRight:{icon:i(628),localizedName:$.t("Arrow Mark Right")},LineToolArrowMarkUp:{icon:i(629),localizedName:$.t("Arrow Mark Up")},LineToolBalloon:{icon:i(630),localizedName:$.t("Balloon")},LineToolBarsPattern:{icon:i(631),localizedName:$.t("Bars Pattern")},LineToolBezierCubic:{icon:i(632),localizedName:$.t("Double Curve")},LineToolBezierQuadro:{icon:i(633),localizedName:$.t("Curve")},LineToolBrush:{icon:i(634),localizedName:$.t("Brush")},LineToolCallout:{icon:i(635),localizedName:$.t("Callout")},LineToolCircleLines:{icon:i(636),localizedName:$.t("Cyclic Lines")},LineToolCypherPattern:{icon:i(637),localizedName:$.t("Cypher Pattern")},LineToolDateAndPriceRange:{icon:i(638),localizedName:$.t("Date and Price Range")},LineToolDateRange:{icon:i(639),localizedName:$.t("Date Range")},LineToolDisjointAngle:{icon:i(640),localizedName:$.t("Disjoint Angle")},LineToolElliottCorrection:{icon:i(641),localizedName:$.t("Elliott Correction Wave (ABC)")},LineToolElliottDoubleCombo:{icon:i(642),localizedName:$.t("Elliott Double Combo Wave (WXY)")},LineToolElliottImpulse:{icon:i(643),localizedName:$.t("Elliott Impulse Wave (12345)")},LineToolElliottTriangle:{icon:i(644),localizedName:$.t("Elliott Triangle Wave (ABCDE)")},LineToolElliottTripleCombo:{icon:i(645),localizedName:$.t("Elliott Triple Combo Wave (WXYXZ)")},LineToolEllipse:{icon:i(646),localizedName:$.t("Ellipse")},LineToolExtended:{icon:i(647),localizedName:$.t("Extended")},LineToolFibChannel:{icon:i(648),localizedName:$.t("Fib Channel")},LineToolFibCircles:{icon:i(649),localizedName:$.t("Fib Circles")},LineToolFibRetracement:{icon:i(650),localizedName:$.t("Fib Retracement")},LineToolFibSpeedResistanceArcs:{icon:i(651),localizedName:$.t("Fib Speed Resistance Arcs")},LineToolFibSpeedResistanceFan:{icon:i(652),localizedName:$.t("Fib Speed Resistance Fan")},LineToolFibSpiral:{icon:i(653),localizedName:$.t("Fib Spiral")},LineToolFibTimeZone:{icon:i(654),localizedName:$.t("Fib Time Zone")},LineToolFibWedge:{icon:i(655),localizedName:$.t("Fib Wedge")},LineToolFlagMark:{icon:i(656),localizedName:$.t("Flag Mark")},LineToolFlatBottom:{icon:i(657),localizedName:$.t("Flat Top/Bottom")},LineToolGannComplex:{icon:i(305),localizedName:$.t("Gann Square")},LineToolGannFixed:{icon:i(305),localizedName:$.t("Gann Square Fixed")},LineToolGannFan:{icon:i(658),localizedName:$.t("Gann Fan")},LineToolGannSquare:{icon:i(659),localizedName:$.t("Gann Box")},LineToolGhostFeed:{icon:i(660),localizedName:$.t("Ghost Feed")},LineToolHeadAndShoulders:{icon:i(661),localizedName:$.t("Head and Shoulders")},LineToolHorzLine:{icon:i(662),localizedName:$.t("Horizontal Line")},LineToolHorzRay:{icon:i(663),localizedName:$.t("Horizontal Ray")},LineToolIcon:{icon:"icon",localizedName:$.t("Font Icons")},LineToolInsidePitchfork:{icon:i(664),localizedName:$.t("Inside Pitchfork")},LineToolNote:{icon:i(665), localizedName:$.t("Note")},LineToolNoteAbsolute:{icon:i(666),localizedName:$.t("Anchored Note")},LineToolParallelChannel:{icon:i(667),localizedName:$.t("Parallel Channel")},LineToolPitchfan:{icon:i(668),localizedName:$.t("Pitchfan")},LineToolPitchfork:{icon:i(669),localizedName:$.t("Pitchfork")},LineToolPolyline:{icon:i(670),localizedName:$.t("Polyline")},LineToolPrediction:{icon:i(671),localizedName:$.t("Forecast")},LineToolPriceLabel:{icon:i(672),localizedName:$.t("Price Label")},LineToolPriceRange:{icon:i(673),localizedName:$.t("Price Range")},LineToolProjection:{icon:i(674),localizedName:$.t("Projection")},LineToolRay:{icon:i(675),localizedName:$.t("Ray")},LineToolRectangle:{icon:i(676),localizedName:$.t("Rectangle")},LineToolRegressionTrend:{icon:i(677),localizedName:$.t("Regression Trend")},LineToolRiskRewardLong:{icon:i(678),localizedName:$.t("Long Position")},LineToolRiskRewardShort:{icon:i(679),localizedName:$.t("Short Position")},LineToolRotatedRectangle:{icon:i(680),localizedName:$.t("Rotated Rectangle")},LineToolSchiffPitchfork:{icon:i(681),localizedName:$.t("Modified Schiff Pitchfork")},LineToolSchiffPitchfork2:{icon:i(682),localizedName:$.t("Schiff Pitchfork")},LineToolSineLine:{icon:i(683),localizedName:$.t("Sine Line")},LineToolText:{icon:i(684),localizedName:$.t("Text")},LineToolTextAbsolute:{icon:i(685),localizedName:$.t("Anchored Text")},LineToolThreeDrivers:{icon:i(686),localizedName:$.t("Three Drives Pattern")},LineToolTimeCycles:{icon:i(687),localizedName:$.t("Time Cycles")},LineToolTrendAngle:{icon:i(688),localizedName:$.t("Trend Angle")},LineToolTrendBasedFibExtension:{icon:i(689),localizedName:$.t("Trend-Based Fib Extension")},LineToolTrendBasedFibTime:{icon:i(690),localizedName:$.t("Trend-Based Fib Time")},LineToolTrendLine:{icon:i(691),localizedName:$.t("Trend Line")},LineToolTriangle:{icon:i(692),localizedName:$.t("Triangle")},LineToolTrianglePattern:{icon:i(693),localizedName:$.t("Triangle Pattern")},LineToolVertLine:{icon:i(694),localizedName:$.t("Vertical Line")},SyncDrawing:{icon:i(695),iconActive:i(696),localizedName:$.t("Sync drawings to all charts")},arrow:{icon:i(697),localizedName:$.t("Arrow")},cursor:{icon:i(698),localizedName:$.t("Cross")},dot:{icon:i(699),localizedName:$.t("Dot")},drawginmode:{icon:i(700),iconActive:i(701),localizedName:$.t("Stay in Drawing Mode")},eraser:{icon:i(702),localizedName:$.t("Eraser")},group:{icon:i(703),localizedName:$.t("Show Hidden Tools")},hideAllDrawings:{icon:i(302),iconActive:i(704),localizedName:$.t("Hide All Drawing Tools")},lockAllDrawings:{icon:i(705),iconActive:i(706),localizedName:$.t("Lock All Drawing Tools")},magnet:{icon:i(707),localizedName:$.t("Magnet Mode pulls the points of drawings to symbol values")},measure:{icon:i(708),localizedName:$.t("Measure (Shift + Click on the chart)")},removeAllDrawingTools:{icon:i(709),localizedName:$.t("Remove All Drawing Tools")},showObjectsTree:{icon:i(710),localizedName:$.t("Show Objects Tree")},zoom:{icon:i(711),localizedName:$.t("Zoom In")},"zoom-out":{icon:i(712),localizedName:$.t("Zoom Out")}} },function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(32),n=i(788),r=function(){function t(){this._rendererData={text:"",coordinate:0,fixedCoordinate:0,color:"#FFF",background:"#000",visible:!1},this._renderer=new n.PriceAxisViewRenderer(this._rendererData),this._invalidated=!0}return t.prototype.text=function(){return this._rendererData.text},t.prototype.background=function(){return this._rendererData.background},t.prototype.color=function(){return this.generateTextColor(this.background())},t.prototype.generateTextColor=function(t){return"black"===o.rgbToBlackWhiteString(o.parseRgb(t),160)?"white":"black"},t.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.coordinate},t.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.floatCoordinate||this._rendererData.coordinate},t.prototype.update=function(){this._invalidated=!0},t.prototype.height=function(t,e){return void 0===e&&(e=!1),this._renderer.height(t,e)},t.prototype.getFixedCoordinate=function(){return this._rendererData.fixedCoordinate||0},t.prototype.setFixedCoordinate=function(t){this._rendererData.fixedCoordinate=t},t.prototype.isVisible=function(){return this._rendererData.visible},t.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._renderer.setData(this._rendererData),this._renderer},t.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._rendererData),this._invalidated=!1)},t}(),e.PriceAxisView=r},,,function(t,e,i){"use strict";function o(t){return s.createElement(t.href?"a":"div",t)}function n(t){t.stopPropagation()}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(0),s=i(2),a=i(14),l=i(85),c=i(731),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.dontClosePopup,n=i.isDisabled,r=i.onClick,s=i.onClickArg;n||(r&&r(s,t),o||l.globalClosePopupMenu())},e}return r.__extends(e,t),e.prototype.render=function(){var t,e,i=this.props,r=i.className,l=i.forceShowHint,h=i.hint,u=i.icon,d=i.isActive,p=i.isDisabled,_=i.isHovered,f=i.appearAsDisabled,m=i.label,g=i.link,v=i.showToolboxOnHover,y=i.target,b=i.toolbox,S=i.theme,w=void 0===S?c:S;return s.createElement(o,{className:a(r,w.item,u&&w.withIcon,(t={},t[w.isActive]=d,t[w.isDisabled]=p||f,t[w.hovered]=_,t)),href:g,target:y,onClick:this._handleClick},void 0!==u&&s.createElement("div",{className:w.icon,dangerouslySetInnerHTML:{__html:u}}),s.createElement("div",{className:w.labelRow},s.createElement("div",{className:w.label},m)),(void 0!==h||l)&&s.createElement("div",{className:w.hint},h),void 0!==b&&s.createElement("div",{onClick:n,className:a(w.toolbox,(e={},e[w.showOnHover]=v,e))},b))},e}(s.PureComponent),e.PopupMenuItem=h},function(t,e,i){"use strict";(function(e){function o(){if("undefined"==typeof tradingService)return null;var t=tradingService();return t&&t.connectStatus()===CONNECTSTATUSES.CONNECTED?t.activeBroker():null} function n(){var t=o();if(t&&t.metainfo().configFlags.supportSymbolSearch)return t.metainfo().symbolSearchId||t.metainfo().id.toLowerCase()}var r=i(122).isIntervalAvailable,s=i(76),a=i(764),l=i(121),c=i(172).unifiedSpinner,h=i(144),u=i(200).regExpEscape,d=i(765),p=i(148).isFeatureEnabled,_=i(123),f=function(){function t(i){var o,n,r,s;if(!(this instanceof t))throw new TypeError("SymbolSearch is a constructor");if(i=i||{},o=!i.dontUseInputParser&&e.enabled("symbol_search_parser_mixin")&&t.canShowSpreadActions(),this._inputParserMixin=o?new SymbolSearchInputParserMixin(this):void 0,this._inputElement=$(i.input).get(0),!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");if(this.$list=$(i.list).eq(0),0===this.$list.size()&&delete this.$list,void 0!==i.callback){if("function"!=typeof i.callback)throw new TypeError("options.callback must be function");this._callback=i.callback}if(void 0!==i.onValueChanged){if("function"!=typeof i.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=i.onValueChanged}if(void 0!==i.onEmptyApply){if("function"!=typeof i.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=i.onEmptyApply}if(i.ignoreInterval&&(this._ignoreInterval=!0),t.resetStoredInterval(),i.hidePro&&(this._hidePro=!0),i.allowMultipleSymbols&&(this._allowMultipleSymbols=!0),void 0!==i.onParse){if("function"!=typeof i.onParse)throw new TypeError("options.onParse must be function");this._onParse=i.onParse}for(this._state={},this._resolveViaSymbolSearchId=null,this.acceptEmpty=!!i.acceptEmpty,$(this._inputElement).data("symbol-search-instance",this),n=this._boundListener=this._eventListener.bind(this),r=this.boundTimeoutListener=function(t){setTimeout(function(){n(t)},0)},s=0;s0&&(i=o[0].value),0!==o.length&&(o.forEach(function(o){var n=o.value,r=$('').attr("href","#"+n).text($.t(o.name));n===i&&r.addClass("active"),r.on("click",function(i){i.preventDefault(),e.find(".type-filter").removeClass("active"),$(this).addClass("active"),t.typeFilter(n),TVSettings.setValue("symboledit.filter",n)}),r.appendTo(e)}),t.typeFilter(i),!0)}function f(t,i){var o,n,r,s=ChartApiInstance.supportedExchangesList();if(s=a.displayedExchangesFilter(s),s=a.sortExchangesListByFlagIfNeeded(s),o=TVSettings.getValue("symboledit.exchangefilter"), "bovespa"!==TradingView.widgetCustomer)return!s.some(function(t){return t.value===o})&&s.length>0&&(o=s[0].value),0!==s.length&&(n=$('
').appendTo(i),r=$("
'+i(596)+$.t("NEW")+'
'+i(597)+'
'+$.t("Created ")+'. '+$.t("Last edited ")+'
',textNotesWidgetItem:'
{{title}}
{{#symbol}}
'+i(598)+'{{symbol}}
{{/symbol}}
{{description}}
',tvDataTable:'{{#columns}}{{/columns}}{{#bodies}}{{#strokes}}{{#cells}}{{/cells}}{{/strokes}}{{/bodies}}
{{{label}}}
{{#contain}}{{{contain}}}{{/contain}}
',tvDataTableRow:'{{#columns}}{{#contain}}{{{contain}}}{{/contain}}{{/columns}}',tvDataTableCell:'{{#contain}}{{{contain}}}{{/contain}}'}},function(t,e,i){"use strict";function o(t){ var e=t.split(":");return{name:e[0],type:2===e.length?e[1]:null}}function n(t,e,i,n){var r,s,a,l,c,p,_,f,m,g,v,y,b,S,w,T=i.split(".");if(0!==T.length&&0!==T[0].length){if(r=o(T[0]),s=r.name,a=r.type,l=null!==a,c=!l||"plot"===a,p=!l||"band"===a,_=!l||"area"===a,f=!l||"input"===a,m=c?d.getPlotIdByTitle(t,s):null,g=p?d.getBandIndexByName(t,s):null,v=_?d.getFilledAreaIdByTitle(t,s):null,y=f?d.getInputByName(t,s):null,b=e.hasOwnProperty(s),(null!==m?1:0)+(null!==g?1:0)+(null!==v?1:0)+(null!==y?1:0)+(b?1:0)>1)return void h.logWarn("Study '"+t.description+"' has ambiguous identifier '"+s+"'");if(S=T[1],null!==m){if(1===T.length)return void h.logWarn("Path of sub-property of '"+s+"' plot for study '"+t.description+"' must be not empty");w=T.slice(1),u.applyPlotProperty(t,e,m,w,n)}else if(null!==y)u.applyInputValue(e,y,n);else if(null!==g){if(void 0===S)return void h.logWarn("Property name of '"+s+"' band for study '"+t.description+"' must be set");u.applyBandProperty(e,g,S,n)}else if(null!==v){if(void 0===S)return void h.logWarn("Property name of '"+s+"' area for study '"+t.description+"' must be set");u.applyFilledAreaProperty(e,v,S,n)}else b?u.setRootProperty(e,T,n):h.logWarn("Study '"+t.description+"' has no plot or input '"+s+"'")}}function r(t,e){var i,o,r=t.properties(),s=r.state();for(i in e)e.hasOwnProperty(i)&&n(t.metaInfo(),s,i,e[i]);r.merge(s),o=r.precision,void 0!==o?o.listeners().fire(o):r.listeners().fire(r)}function s(t,e,i){var o,r,s,a,l;for(o in t)t.hasOwnProperty(o)&&-1!==(r=o.indexOf("."))&&(s=o.substr(0,r),a=d.getMetaInfoByDescription(e,s),null!==a?(l=i(a.id),null!==l?n(a,l,o.substr(r+1),t[o]):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(e,"__esModule",{value:!0}),a=i(111),l=i(9),c=i(7),h=c.getLogger("Chart.Model.StudyPropertiesOverrider"),function(t){function e(t){return"colorer"===t.type}function i(t,i,o){var n,r,s,a;if(void 0===t.plots)return null;for(n=0,r=t.plots;n0?void h.logWarn("Study plot does not have color #"+o):((0===o||isNaN(o))&&(l.ensureDefined(t.styles[i]).color=n+"",o=0),void(null!==e&&(l.ensureDefined(e.colors[o]).color=n+"")))}function n(t,e,n,r,s){var a,l,c,u,p;if(void 0===e.styles)return void h.logWarn("Study does not have styles");if("color"===(a=r[0]))return l=i(t,e,n),c=r.length>1?parseInt(r[1]):NaN,void o(e,l,n,c,s);if(void 0===(u=e.styles[n])||!u.hasOwnProperty(a))return void h.logWarn("Study plot does not have property '"+a+"'");if("plottype"===a){if(void 0===(p=d[s+""]))return void h.logWarn("Unsupported plot type for plot: "+s);s=p}u[a]=s}function r(t,e,i,o){var n,r;if(void 0===t.bands)return void h.logWarn("Study does not have bands");if(void 0===(n=t.bands[e])||!n.hasOwnProperty(i))return void h.logWarn("Study band does not have property '"+i+"'") ;if("plottype"===i){if(void 0===(r=d[o+""]))return void h.logWarn("Unsupported plot type for band: "+o);o=r}n[i]=o}function s(t,e,i,o){if(void 0===t.filledAreasStyle)return void h.logWarn("Study does not have areas");var n=t.filledAreasStyle[e];if(void 0===n||!n.hasOwnProperty(i))return void h.logWarn("Study area does not have property '"+i+"'");n[i]=o}function c(t,e,i){if(void 0===t.inputs||!t.inputs.hasOwnProperty(e))return void h.logWarn("Study does not have input '"+e+"'");t.inputs[e]=i}function u(t,e,i){var o,n,r,s,a;if(0!==e.length){for(o=t,n=0,r=e.slice(0,-1);ne?(a&&(clearTimeout(a),a=null),l=h,r=t.apply(o,n),a||(o=n=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,t.exports=e.default},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(43),n=i(2),r=i(14),s=i(59),a=i(85),l=i(151),c=i(722),h=i(392),u=function(t){function e(e){var i=t.call(this,e)||this;return i._toggleDropdown=function(t){i.setState({isOpened:void 0!==t?t:!i.state.isOpened})},i._handleClose=function(){i._toggleDropdown(!1)},i._getDropdownPosition=function(){ if(!i._control)return{x:0,y:0};var t=i._control.getBoundingClientRect();return{x:t.left+t.width+1,y:t.top-6}},i._handleClickArrow=function(){i._toggleDropdown()},i._handleTouchStart=function(){i.props.onClickButton(),i._toggleDropdown()},i._handlePressStart=function(){if(Modernizr.touch)i._longPressDelay||i.props.onClickButton();else{if(i._doubleClickDelay)return clearTimeout(i._doubleClickDelay),delete i._doubleClickDelay,void i._toggleDropdown(!0);i._doubleClickDelay=setTimeout(function(){delete i._doubleClickDelay,i._longPressDelay||i.props.onClickButton()},175)}i._longPressDelay=setTimeout(function(){delete i._longPressDelay,i._toggleDropdown(!0)},300)},i._handlePressEnd=function(){i._longPressDelay&&(clearTimeout(i._longPressDelay),delete i._longPressDelay,i.state.isOpened?i._toggleDropdown(!1):i.state.isOpened||!i.props.isActive||Modernizr.touch||i._toggleDropdown(!0))},i.state={isOpened:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t,e=this,i=this.props,o=i.buttonActiveClass,u=i.buttonClass,d=i.buttonIcon,p=i.buttonTitle,_=i.children,f=i.isActive,m=i.isGrayed,g=i.onClickWhenGrayed,v=this.state.isOpened;return n.createElement("div",{className:r(c.dropdown,"apply-common-tooltip common-tooltip-vertical",(t={},t[c.isGrayed]=m,t[c.isActive]=f,t[c.isOpened]=v,t)),onClick:m?g:void 0,title:p,"data-tooltip-delay":1500},n.createElement("div",{ref:function(t){return e._control=t},className:c.control},n.createElement("div",{className:c.buttonWrap,onMouseDown:m||Modernizr.touch?void 0:this._handlePressStart,onMouseUp:m||Modernizr.touch?void 0:this._handlePressEnd,onClick:!m&&Modernizr.touch?this._handleTouchStart:void 0},n.createElement(l.ToolButton,{activeClass:o,className:u,icon:d,isActive:f,isGrayed:m,isTransparent:!0})),!m&&!Modernizr.touch&&n.createElement("div",{className:c.arrow,onClick:this._handleClickArrow},n.createElement(s.Icon,{className:c.arrowIcon,icon:h}))),!m&&n.createElement(a.PopupMenu,{doNotCloseOn:this,isOpened:v,onClose:this._handleClose,position:this._getDropdownPosition},_))},e}(n.PureComponent),e.ToolDropdown=u},function(t,e){t.exports=''},function(t,e){ t.exports=''},function(t,e,i){"use strict";function o(t){return n.createDialog(Object.assign({},a,t))}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(65),r={key:13,name:"yes",text:$.t("Yes"),type:"success"},s={method:"close",name:"no",text:$.t("No"),type:"default"},a={actions:[r,s],actionsWrapTemplate:'
',content:$.t("Are you sure?"),contentWrapTemplate:'

',destroyOnClose:!0,title:$.t("Confirmation"),width:400},e.createConfirmDialog=o},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=i(19),function(t){t[t.FromLeft=-1]="FromLeft",t[t.FromRight=1]="FromRight"}(r=e.TimePointIndexSearchMode||(e.TimePointIndexSearchMode={})),s=function(){function t(t){this.m_bars=new n.PlotList(t),this.m_nsBars=new n.PlotList(t)}return t.prototype.bars=function(){return this.m_bars},t.prototype.nsBars=function(){return this.m_nsBars},t.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},t.prototype.each=function(t){this.m_bars.each(t),this.m_nsBars.each(t)},t.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},t.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},t.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},t.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},t.prototype.search=function(t,e){return this.nsBars().isEmpty()?this.bars().search(t,e):this.bars().isEmpty()?this.nsBars().search(t,e):o.ensureNotNull(this.nsBars().firstIndex())<=t?this.nsBars().search(t,e):this.bars().search(t,e)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.plotValueToTimePointIndex=function(t,e,i){var o,n,s,a;if(i===r.FromRight)return o=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t>=n},null!==(n=this.m_bars.findLast(o))?n.index:(s=this.m_nsBars.findLast(o), null!==s?s.index:this.m_bars.firstIndex());if(i===r.FromLeft)return a=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t<=n},null!==(n=this.m_bars.findFirst(a))?n.index:(s=this.m_nsBars.findFirst(a),null!==s?s.index:this.m_bars.lastIndex());throw Error("plotValueToTimePointIndex: unsupported search mode")},t}(),e.SeriesData=s},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(15),n=function(){function t(t){void 0===t&&(t=1),this._precision=t}return t.prototype.format=function(t){var e,i;return o.isNumber(t)||(t=parseFloat(t)),e=t.toFixed(this._precision),i=Math.pow(10,-this._precision),Math.max(parseFloat(e),i)+""},t}(),e.LimitedPrecisionNumericFormatter=n},function(t,e){t.exports=''},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=i(17),i(13),r=function(){function t(t){var e=this;this._alive=new n,this._body=new n,this._width=new n,this._height=new n,this._fullscreen=new n,this._detachable=new n,this._visible=new n,this._availWidth=new n,this._availHeight=new n,this._owner=new n,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(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var t=e._owner.value();t&&t.remove&&t.remove()},negotiateWidth:function(t){var i=e._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(t)},negotiateHeight:function(t){var i=e._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(t)},requestFullscreen:function(){var t=e._owner.value();t&&t.requestFullscreen&&t.requestFullscreen()},exitFullscreen:function(){var t=e._owner.value();t&&t.exitFullscreen&&t.exitFullscreen()},detach:function(t){var i=e._owner.value();i&&i.detach&&i.detach(t)},attach:function(){var t=e._owner.value();t&&t.attach&&t.attach()}},t&&this.pushOwner(t)}return t.prototype.bridge=function(){return this._bridge},t.prototype.pushOwner=function(t){var e,i,o,n;if(t.alive.value()){for(e=0,i=this._ownersStack;e=i;e--)this._unsubscribeOwner(this._ownersStack[e],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},t}(),e.ResizerDetacherState=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.layouts={s:{title:"1 chart",count:1,sizer:function(t,e,i,o){return{width:e.width-o-o,height:e.height-o-o,top:o,left:o}}}}},function(t,e,i){"use strict";function o(){this.backColorers=[]}function n(t){o.call(this),this._series=t}function r(t,e){o.call(this),this._study=t,this._plotIndex=e}var s=i(19).PlotRowSearchMode;o.prototype.barStyle=function(t,e,i){var o,n={};for(o=this.backColorers.length-1;o>=0;o--)this.backColorers[o].applyBarStyle(t,e,n,i);return this.applyBarStyle(t,e,n,i),n},o.prototype.pushBackBarColorer=function(t){this.backColorers.push(t)},o.prototype.applyBarStyle=function(t,e,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(n,o),n.prototype.applyBarStyle=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;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,n=this._series.properties(),n.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=n.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=n.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:r=n.barStyle.upColor.value(),s=n.barStyle.downColor.value(),a=r,l=s,c=this.findBar(t,!1,o),n.barStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o),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=n.candleStyle.upColor.value(),s=n.candleStyle.downColor.value(),a=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),l=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),u=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),d=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),c=this.findBar(t,!1,o),n.candleStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o), 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=n.hollowCandleStyle.upColor.value(),s=n.hollowCandleStyle.downColor.value(),a=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),l=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),u=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),d=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),c=this.findBar(t,!1,o),h=this.findPrevBar(t,!1,o),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=n.haStyle.upColor.value(),s=n.haStyle.downColor.value(),a=n.haStyle.borderUpColor.value(),l=n.haStyle.borderDownColor.value(),u=n.haStyle.wickUpColor.value(),d=n.haStyle.wickDownColor.value(),c=this.findBar(t,e,o),n.haStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,e,o),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_RENKO:c=this.findBar(t,e,o),p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.renkoStyle.upColorProjection.value():n.renkoStyle.upColor.value(),s=e?n.renkoStyle.downColorProjection.value():n.renkoStyle.downColor.value(),a=e?n.renkoStyle.borderUpColorProjection.value():n.renkoStyle.borderUpColor.value(),l=e?n.renkoStyle.borderDownColorProjection.value():n.renkoStyle.borderDownColor.value(),u=n.renkoStyle.wickUpColor.value(),d=n.renkoStyle.wickDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d,i.isBarUp=p;break;case TradingView.Series.STYLE_PB:c=this.findBar(t,e,o),p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.pbStyle.upColorProjection.value():n.pbStyle.upColor.value(),s=e?n.pbStyle.downColorProjection.value():n.pbStyle.downColor.value(),a=e?n.pbStyle.borderUpColorProjection.value():n.pbStyle.borderUpColor.value(),l=e?n.pbStyle.borderDownColorProjection.value():n.pbStyle.borderDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.isBarUp=p;break;case TradingView.Series.STYLE_KAGI:i.upColor=e?n.kagiStyle.upColorProjection.value():n.kagiStyle.upColor.value(),i.downColor=e?n.kagiStyle.downColorProjection.value():n.kagiStyle.downColor.value(),_=null,c=this.findBar(t,e,o),c[TradingView.LOW_PLOT]0,r=e?n.pnfStyle.upColorProjection.value():n.pnfStyle.upColor.value(),s=e?n.pnfStyle.downColorProjection.value():n.pnfStyle.downColor.value(),i.isBarUp=p,i.barColor=p?r:s;break;case TradingView.Series.STYLE_BASELINE:c=this.findBar(t,e,o),f=n.baselineStyle,m=this._series.priceScale(),g=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),v=m.coordinateToPrice(g),c[TradingView.CLOSE_PLOT]>v?i.barColor=n.baselineStyle.topLineColor.value():i.barColor=n.baselineStyle.bottomLineColor.value()}return i},n.prototype.getSeriesBars=function(t){return t?this._series.nsBars():this._series.bars()},n.prototype._findBarFieldValue=function(t,e,i){var o=this.getSeriesBars(i).valueAt(t);if(null!==o)return o[e]},n.prototype.findBar=function(t,e,i){return i?i.value:this.getSeriesBars(e).valueAt(t)||[]},n.prototype.findPrevBar=function(t,e,i){var o,n;return i&&i.previousValue?i.previousValue:(o=this._series.bars(),n=o._search(t,s.Exact),null!==n&&n>0?this._series.bars()._valueAt(n-1):[])},inherit(r,o),r.prototype.applyBarStyle=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f;return i||(i={}),e?i:(o=this._study.properties(),o.visible.value()?(n=this._study.metaInfo(),(r=this._study.data())&&0!==r.size()?(s=n.plots[this._plotIndex],this._study.getMinFirstBarIndexForPlot(s.id)>t?i:(a=o.styles[s.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(s.id),null===(c=r.valueAt(t-l))?i:null==(h=c[this._plotIndex+1])?i:(h=Math.round(h),u=n.plots[this._plotIndex].palette,d=o.palettes,p=d[u],_=n.palettes[u].valToIndex?n.palettes[u].valToIndex[h]:h,f=p.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i)))):i):i)},e.SeriesBarColorer=n,e.StudyBarColorer=r},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.colorUp=t.colorup,this.colorDn=t.colordown,this.colorBorderUp=t.colorBorderUp,this.colorBorderDown=t.colorBorderDown,this.width=this._calculateWidth(t.barSpacing),this.minHeight=t.minHeight,this.vertOffset=this._calculateVerticalOffset(t.barSpacing)}function n(t,e,i,o){this.x=t,this.y=e,this.height=i,this.isUp=o}var r=i(8).Point,s=i(11);o.prototype._calculateVerticalOffset=function(t){return Math.round((t||0)/4)},o.prototype._calculateMinHeight=function(t){return this.width||this._calculateWidth(t)},o.prototype._calculateWidth=function(t){var t=t||this.barSpacing;return Math.round(t/2)},o.prototype.draw=function(t){var e,i,o,n,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(t.translate(1,1),e=0,i=this.items.length;e1;return 0===this._graphics.indexes.length&&!t},o.prototype.graphics=function(){return this._graphics},o.prototype.setGraphics=function(t){this._graphics=t,this._postProcessGraphicsData()},o.prototype.process=function(t){if(""!==t.d)return t.d.indexes_replace?void this.replaceIndexes(t):void(t.d.graphicsCmds&&(this.processEraseCmds(t.d.graphicsCmds.erase),this.processCreateCmds(t.d.graphicsCmds.create,t.indexes)))},o.prototype.replaceIndexes=function(t){""!==t.d&&(n(!!t.d.indexes_replace),this._graphics.indexes=t.indexes)},o.prototype.processEraseCmds=function(t){var e,i,r,s,a;if(t)for(n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!"),e=0;e=0&&s.data.splice(a,1)}},o._findGraphicsObjIndexById=function(t,e){for(var i=0;i=c.priceHigh||d.priceLow>=c.priceLow)&&(d.priceHigh<=h.priceHigh||d.priceLow<=h.priceLow)&&(d.va=!0);n.shortDataObj||(n.shortDataObj={}),n.shortDataObj[s]=a.slice()}}},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,s={};for(i=0;i=0?new c(e,i,a):new c(e,i)},t.exports=o},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(67),s=i(15),a=function(t){function e(e,i){var o=t.call(this)||this;return o._activeBackground="#0F6DBF",o._background="#5592C9",o._active=!1,o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype.setActive=function(t){this._active=t},e.prototype.setBackground=function(t){this._background=t},e.prototype._updateRendererData=function(t){var e,i,o,r,a,l,c,h;if(t.visible=!1,e=this._source.model(),e.timeScale()&&!e.timeScale().isEmpty()&&null!==(i=this._source.priceScale())&&!i.isEmpty()&&(e.selectedSource()===this._source||this._source.isForcedDrawPriceAxisLabel())&&null!==e.timeScale().visibleBars()&&(o=this._source.axisPoints(),r=this._data.pointIndex,!(o.length<=r)&&(a=o[r], isFinite(a.price)))){if(i.isPercent()){if(!(l=this._source.ownerSource()))return;if(c=l.firstValue(),!s.isNumber(c))return;a.price=n.ensureNotNull(i.priceRange()).convertToPercent(a.price,c)}h=this._active?this._activeBackground:this._background,this._data.backgroundProperty&&(h=this._data.backgroundProperty.value()),t.background=h,t.borderColor="#2E84A6",t.color=this.generateTextColor(h),t.coordinate=i.priceToCoordinate(a.price),t.text=i.formatter().format(a.price),t.visible=!0}},e}(r.PriceAxisView),e.LineToolPriceAxisView=a},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(32),n=function(){function t(){this._text="",this._background="#585858",this._coordinate=0}return t.prototype.text=function(){return this._text},t.prototype.background=function(){return this._background},t.prototype.color=function(){return"black"===o.rgbToBlackWhiteString(o.parseRgb(this._background),150)?"white":"black"},t.prototype.coordinate=function(){return this._coordinate},t}(),e.TimeAxisView=n},function(t,e,i){"use strict";function o(){this._data=null}var n=/[1-9]/g;o.prototype.setData=function(t){this._data=t},o.prototype.draw=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;null!=this._data&&!1!==this._data.visible&&0!==this._data.text.length&&(t.font=e.font,(i=Math.round(e.widthCache.measureText(t,this._data.text,n)))<=0||(o=e.paddingHorizontal,r=i+2*o,s=r/2,a=this._data.width,l=this._data.coordinate,c=Math.floor(l-s)+.5,c<0?(l+=Math.abs(0-c),c=Math.floor(l-s)+.5):c+r>a&&(l-=Math.abs(a-(c+r)),c=Math.floor(l-s)+.5),h=c,u=h+r,d=u,p=Math.round(this._data.coordinate+1),_=p,f=.5,m=f+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,g=m,v=f,y=v,b=y+e.borderSize+e.tickLength,S=m-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(c,f),t.lineTo(h,m),t.lineTo(u,g),t.lineTo(d,v),t.fill(),t.beginPath(),t.moveTo(p,y),t.lineTo(_,b),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,c+o,S)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e)}var n=i(1).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,r;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n100&&y.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["entryPrice","stopPrice","targetPrice","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=o.version,this._entryPriceAxisView=new l(this,{colorProperty:y.linecolor,priceProperty:y.entryPrice}),this._stopPriceAxisView=new l(this,{colorProperty:y.stopBackground,priceProperty:y.stopPrice}),this._profitPriceAxisView=new l(this,{colorProperty:y.profitBackground,priceProperty:y.targetPrice}),i.e(1).then(function(t){var e=i(1170).RiskRewardPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){var i,n;this._constructor="LineToolRiskRewardShort",i=e||new h("linetoolriskrewardshort"),o.call(this,t,i),n=this.properties(), n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}function r(t,e){var i,n;this._constructor="LineToolRiskRewardLong",i=e||new h("linetoolriskrewardlong"),o.call(this,t,i),n=this.properties(),n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}var s=i(9).ensureNotNull,a=i(1).LineDataSource,l=i(843).LineToolRiskRewardPriceAxisView,c=i(26),h=i(6).DefaultProperty,u=i(89).NumericFormatter,d=i(3).propertyPages,p=i(408).RiskRewardPointIndex;inherit(o,a),o.prototype.riskFormatter=function(t){return"percents"===t?this._riskInPercentsFormatter:this._riskInMoneyFormatter},o.prototype.getRiskStep=function(t){return"percents"===t?.01:1},o.prototype._roundValue=function(t){return parseFloat(t.toFixed(2))},o.prototype._recalculateRisk=function(){var t=this.properties(),e=t.riskDisplayMode.value(),i=t.riskSize.value(),o=t.accountSize.value(),n=t.risk.value();n="percents"===e?this._roundValue(i/o*100):this._roundValue(o/100*n),this._riskInChange=!0,t.risk.setValue(this.riskFormatter(e).format(n)),this._riskInChange=!1},o.prototype._recalculateRiskSize=function(){var t,e,i,o;this._riskInChange||(t=this.properties(),e=t.risk.value(),i=t.riskDisplayMode.value(),o=t.accountSize.value(),"percents"===i?t.riskSize.setValue(e/100*o):e>o?(t.risk.setValue(o),t.riskSize.setValue(o)):t.riskSize.setValue(e))},o.version=2,o.prototype.i18nCache={title:$.t("Risk/Reward")},o.prototype.lastBarData=function(){var t,e,i,o,n,r=this._model.mainSeries().bars().firstIndex(),a=this._model.mainSeries().bars().lastIndex();return null===r||null===a||isNaN(r)||isNaN(a)?null:(t=this.points(),4===t.length?(e=t[p.ActualClose],e.index=1&&(o=[],o.push(this._points[0]),n=this._points[0],n={price:n.price,index:n.index+50},o.push(n),this._points[1]&&o.push(this._points[1]),this._points[2]&&o.push(this._points[2]),this._points=o,this._timePoint.length>=1&&(r=[],n=this._timePoint[0],r.push(n),s={price:n.price,time_t:n.time_t,offset:n.offset+50},r.push(s), this._timePoint[1]&&o.push(this._points[1]),this._timePoint[2]&&o.push(this._points[2]),this._timePoint=r))},o.prototype.checkAlert=function(){this.recalculate()},o.prototype.priceAxisViews=function(t,e){return this.isSourceHidden()?null:e!==this.priceScale()||this._model.paneForSource(this)!==t?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]},o.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()))},o.prototype.setPoint=function(t,e){var i,o=this.priceScale();switch(o.isPercent()&&(i=this.ownerSource().firstValue(),e.price=o.priceRange().convertFromPercent(e.price,i)),t){case 0:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,t,e),this.recalculate();break;case 1:this.isActualSymbol()&&this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));break;case 2:this.isActualSymbol()&&this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));break;case 3:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,1,e),this.recalculate()}},o.PriceProperty=function(t,e){a.PointPriceProperty.call(this,t,e)},inherit(o.PriceProperty,a.PointPriceProperty),o.PriceProperty.prototype.setValue=function(t){var e=this._lineSource.points()[this._pointIndex];e.price=parseFloat(t),this._lineSource.setPoint(this._pointIndex,e),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},o.StopPriceProperty=function(t){o.PriceProperty.call(this,t,1)},inherit(o.StopPriceProperty,o.PriceProperty),o.StopPriceProperty.prototype.value=function(){var t=this._lineSource.stopPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.StopPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(e),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},o.TargetPriceProperty=function(t){o.PriceProperty.call(this,t,2)},inherit(o.TargetPriceProperty,o.PriceProperty),o.TargetPriceProperty.prototype.value=function(){var t=this._lineSource.profitPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.TargetPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(e),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel) },o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return this.i18nCache.title},o.prototype.addPoint=function(t){var e,i;return t.price=this._roundPrice(t.price),a.prototype.addPoint.call(this,t,null,!0),e={price:t.price,index:t.index+50},a.prototype._addPointIntenal.call(this,e,null,!0),i=this.calculateActualEntry(t,e),i&&(a.prototype._addPointIntenal.call(this,i,null,!0),(e=this.findClosePoint(i,e))&&a.prototype._addPointIntenal.call(this,e,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype._roundPrice=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)/e},o.prototype.recalculate=function(){var t,e,i,o,n;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(t=this.properties().targetPrice.value(),e=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],o=this.calculateActualEntry(this.points()[0],this.points()[1]),o&&(i.push(o),(n=this.findClosePoint(o,this.points()[1]))&&i.push(n)),this._points=i,t!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),e!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},o.prototype.start=function(){a.prototype.start.call(this),this.recalculate()},o.prototype.startMoving=function(t){t.price=this._roundPrice(t.price),a.prototype.startMoving.call(this,t)},o.prototype.move=function(t){t.price=this._roundPrice(t.price),a.prototype.move.call(this,t),this.recalculate(),this._entryPriceAxisView.update()},o.prototype.correctPoints=function(t){return!!this.isActualSymbol()&&a.prototype.correctPoints.call(this,[t[0],t[1]])},o.prototype.entryPrice=function(){return this.points()[0].price},o.prototype.findClosePoint=function(t,e){var i,o,n,r=this._model.mainSeries().bars(),a=s(r.firstIndex()),l=Math.max(t.index,a),c=s(r.lastIndex());for(i=l;i<=Math.min(c,e.index);i++)if(o=s(r.valueAt(i)),null!=(n=this.checkStopPrice(o)))return{index:i,price:n};return null},o.prototype.calculateActualEntry=function(t,e){var i,o,n=this._model.mainSeries().bars(),r=s(n.firstIndex()),a=Math.max(t.index,r),l=t.price,c=s(n.lastIndex());for(i=a;i<=Math.min(c,e.index);i++)if(o=s(n.valueAt(i)),o[TradingView.HIGH_PLOT]>=l&&o[TradingView.LOW_PLOT]<=l)return{index:i,price:l};return null},o.prototype.axisPoints=function(){var t,e,i;if(!this._points[p.ActualEntry])return[];if(t=this._points[p.ActualEntry],e=null,4===this._points.length)e=this._points[p.ActualClose];else{if(!(i=this.lastBarData()))return[];e={index:i.index,price:i.closePrice}}return[t,e]},o.prototype.getInputsPropertyPage=function(){return d.LineToolRiskRewardInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return d.LineToolRiskRewardStylesPropertyPage},inherit(n,o),n.prototype.i18nCache={title:$.t("Risk/Reward short")},n.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(), o=t.riskSize.value(),n=Math.floor(o/Math.abs(i-e)),t.qty.setValue(n))},n.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(i-r)*o),a=this._roundValue(e-(n-i)*o),t.amountTarget.setValue(s),t.amountStop.setValue(a))},n.prototype.title=function(){return this.i18nCache.title},n.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},n.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},n.prototype.calculatePL=function(t){return this.entryPrice()-t},n.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},n.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},n.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.HIGH_PLOT]>=e?this.stopPrice():t[TradingView.LOW_PLOT]<=i?this.profitPrice():null},r.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(r,o),r.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(e-i)),t.qty.setValue(n))},r.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(r-i)*o),a=this._roundValue(e-(i-n)*o),t.amountTarget.setValue(s),t.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(t){return t-this.entryPrice()},r.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},r.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},r.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.LOW_PLOT]<=e?this.stopPrice():t[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},r.prototype.title=function(){return this.i18nCache.title},e.LineToolRiskReward=o,e.LineToolRiskRewardLong=r,e.LineToolRiskRewardShort=n}).call(e,i(73))},function(t,e,i){"use strict";function o(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}o.prototype.format=function(t){var e,i ;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i)}function r(t,e,i){o.call(this,t,e,i)}function s(t,e,i){o.call(this,t,e,i)}var a=i(105).LineStudyMtp;inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length0?1/0:i<0?-1/0:t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},o.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;to)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+1},o.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},o.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},o.prototype.addDataSource=function(t,e,i){var o;t instanceof r&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},o.prototype.insertDataSource=function(t,e,i){var n,r,s;this.m_dataSources.push(t),n=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,n=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,n=!0),t._isOverlay=!1, null!==e||this.canHaveMoreNoScaleSources()||(e=this.rightPriceScale()),null===e&&(r=this.m_rightPriceScale.topMargin(),s=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(r=.75,s=0),e=new c(this._model.properties().scalesProperties),e.setHeight(this.m_height),e.setTopMargin(r),e.setBottomMargin(s),t._isOverlay=!0),e.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(e),t.onTagsChanged&&t.onTagsChanged().subscribe(this,o.prototype.onSourceTagsChanged),t.setZorder(i),n&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(e),this.invalidateSourcesCache()},o.prototype.removeDataSource=function(t,e){var i,n=this.m_dataSources.indexOf(t);if(-1===n)return void l.logDebug("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(n,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(t)?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(t)&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,o.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},o.prototype.startScalePrice=function(t,e){t.startScale(e)},o.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},o.prototype.endScalePrice=function(t){t.endScale()},o.prototype.startScrollPrice=function(t,e){t.startScroll(e)},o.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},o.prototype.endScrollPrice=function(t){t.endScroll()},o.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},o.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},o.prototype.updateAllViews=function(){for(var t=0;t0&&!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),t.recalculatePriceRange(i)),t.updatePaneViews())},o.prototype.resetPriceScale=function(t){var e=this.timeScale().visibleBars();t.isLockScale()||t.setAutoScale(!0),t.recalculatePriceRange(e),this.updateAllViews()},o.prototype.recalculate=function(){var t,e;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),t=0;te&&(e=o.zorder());return{minZOrder:t,maxZOrder:e}},o.prototype.isZOrderAvailable=function(t){var e,i;for(e=0;e0&&e<0?(n=a[l-1].zorder(),r=t.zorder(),a[l-1].setZorder(r),t.setZorder(n)):l0&&(s=a[l+1].zorder(),r=t.zorder(),a[l+1].setZorder(r),t.setZorder(s)),this.invalidateSourcesCache()},o.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},o.prototype.onTagsChanged=function(){return this._tagsChanged},o.prototype.dumpPriceScale=function(t){var e,i,o,n=t.dataSources(),r=[];for(e=0;e=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this.m_dataSources.splice(t,1)},o.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(t){return(!t.properties().linkedToSeries||!t.properties().linkedToSeries.value())&&(TradingView.isInherited(t.constructor,a)&&t.showInObjectTree()&&!t.isNoScale())}).length},o.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},o.prototype.actionNoScaleIsEnabled=function(t){return!(!this.isOverlay(t)&&TradingView.isInherited(t.constructor,a))||this.canHaveMoreNoScaleSources()},o.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new n(this,this._model.timeScale())),this._executionsPositionController},o.prototype.isLast=function(){var t=this._model.panes();return t[t.length-1]===this}, o.prototype.setMaximized=function(t){this._maximized=t},o.prototype.isMaximized=function(){return this._maximized},o.prototype.isMainPane=function(){var t=this._model.mainSeries(),e=!1;return this.m_dataSources.forEach(function(i){e||(e=i===t)}),this._isMainPane=e,e},o.prototype.properties=function(){return this._properties},o.prototype._mainSourceVisiblePriceRange=function(t){var e=this.m_timeScale.visibleBars();return null!==e?t.mainSource().priceRange(e.firstBar(),e.lastBar()):new s(-.5,.5)},o.prototype.applyLeftPriceScaleRatio=function(t){this._lastLeftPriceScaleRatio!==t&&(this._setNewPriceRangeByScaleRatio(this.m_leftPriceScale,t,this._mainSourceVisiblePriceRange(this.m_leftPriceScale),!0,!0),this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale)))},o.prototype.applyRightPriceScaleRatio=function(t){this._lastRightPriceScaleRatio!==t&&(this._setNewPriceRangeByScaleRatio(this.m_rightPriceScale,t,this._mainSourceVisiblePriceRange(this.m_rightPriceScale),!0,!0),this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale)))},o.prototype.isLeftPriceScaleLocked=function(){return!this.m_leftPriceScale.isLog()&&this.m_leftPriceScale.isLockScale()},o.prototype.isRightPriceScaleLocked=function(){return!this.m_rightPriceScale.isLog()&&this.m_rightPriceScale.isLockScale()},o.prototype.leftPriceScaleRatio=function(){return null===this._lastLeftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale)),this._lastLeftPriceScaleRatio},o.prototype.rightPriceScaleRatio=function(){return null===this._lastRightPriceScaleRatio&&(this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale)),this._lastRightPriceScaleRatio},o.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&(this._lastLeftPriceScaleRatio=null,this._lastRightPriceScaleRatio=null,this._model.mainSeriesScaleRatioPropertyOnChanged())},o.prototype._applyOldScaleRatioToPriceScale=function(t,e){if(this._isRecalculatingScales||null===e||void 0===e)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(t,e,this._mainSourceVisiblePriceRange(t)),this._isRecalculatingScales=!1},o.prototype._applyOldScaleRatioToTimeScale=function(t,e){if(this._isRecalculatingScales||null===e||void 0===e)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(t,e),this._isRecalculatingScales=!1},o.prototype._tryToApplyNewLeftPriceScaleRatio=function(t){if(this._lastLeftPriceScaleRatio===t)return!1;this._leftPriceScaleRatioChanged.fire(this._lastLeftPriceScaleRatio,t),this._lastLeftPriceScaleRatio=t},o.prototype._tryToApplyNewRightPriceScaleRatio=function(t){if(this._lastRightPriceScaleRatio===t)return!1;this._rightPriceScaleRatioChanged.fire(this._lastRightPriceScaleRatio,t),this._lastRightPriceScaleRatio=t},o.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))))},o.prototype._recalculateTimeScaleByLeftScaleRatio=function(){this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))},o.prototype._recalculateTimeScaleByRightScaleRatio=function(){this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))},o.prototype._setNewPriceRangeByScaleRatio=function(t,e,i,o,n){var r=u(t,this.m_timeScale.barSpacing(),e);t.setPriceRange(null!==r?r:i,o,n)},o.prototype._setMinMaxPriceRange=function(t,e){var i=u(t,this.m_timeScale.maxBarSpacing(),e),o=u(t,this.m_timeScale.minBarSpacing(),e);null!==i&&t.setMaxPriceRange(i),null!==o&&t.setMinPriceRange(o)},o.prototype._onLeftPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_leftPriceScale,this._lastLeftPriceScaleRatio)},o.prototype._onRightPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_rightPriceScale,this._lastRightPriceScaleRatio)},o.prototype._setNewBarSpacingByScaleRatio=function(t,e){var i=this.m_timeScale.getValidBarSpacing(d(t,e));this.m_timeScale.isValidBarSpacing(i)&&this.m_timeScale.setBarSpacing(i)},t.exports=o}).call(e,i(10))},function(t,e,i){"use strict";(function(e,o){function n(t,e){if(this.m_base=t,this.m_integralDividers=e,this.m_fractionalDividers=[],c.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 r(t,e,i){this.m_marks=[],this.m_base=e,this.m_priceScale=t,this._formatter=i,i&&(this._cache=new h(function(t){return i.format(t)})),this._currentFormatBase=0}function s(t){for(var e=1;t*e!==Math.round(t*e);)e*=10;return e}function a(t,i){function n(){var t,e,i=s.m_dataSources;for(t=0;tn+r&&c.greaterOrEqual(s,n,r)&&c.greaterOrEqual(s,i*o,r)&&c.greaterOrEqual(s,1,r);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])s/=o;if(s<=n+r&&(s=n),s=Math.max(1,s),this.m_fractionalDividers.length>0&&c.equal(s,1,r))for(a=0,o=this.m_fractionalDividers[0];s>n+r&&c.greaterOrEqual(s,i*o,r);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])s/=o;return s},r.prototype.TICK_DENSITY=2.5,r.prototype.base=function(){return this.m_base},r.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t}, r.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},r.prototype.tickSpan=function(t,e){var i,o,r,s,a,l,h;if(t=e?1:-1,n=Math.max(i,e),r=Math.min(i,e),i=n,e=r,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(c=s(a),this._cache&&this._currentFormatBase===c||(u=new f(c),this._cache=new h(function(t){return u.format(t)}))),d=null,p=i-l;p>e;p-=a)_=this.m_priceScale.priceToCoordinate(p),null!==d&&Math.abs(_-d)30)throw new RangeError("invalid margin");this.m_topMargin!==t&&(this.m_topMargin=t,this._invalidateInternalHeightCache(),this._marksCache=null)},a.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},a.prototype.setBottomMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_bottomMargin!==t&&(this.m_bottomMargin=t,this._invalidateInternalHeightCache(),this._marksCache=null)},a.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var t=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=t,t},a.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()}, a.prototype.internalHeightChanged=function(){return this._internalHeightChanged},a.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},a.prototype.priceRangeChanged=function(){return this._priceRangeChanged},a.prototype.setPriceRange=function(t,e,i){var o,n,r;if(!(t instanceof g))throw new TypeError("incorrect price range");return o=this.m_priceRange,!!(e||null===o&&null!==t||null!==o&&!o.equals(t))&&(n=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(t),r=null!==this.m_minPriceRange&&t.containsStrictly(this.m_minPriceRange),!(this.isLockScale()&&!e&&(n||r))&&(this._marksCache=null,this.m_priceRange=t,void(i||this._priceRangeChanged.fire(o,t))))},a.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},a.prototype.invertedCoordinate=function(t){return this.height()-1-t},a._logicalOffset=4,a._coordOffset=1e-4,a.prototype.log10=function(t){return Math.log(t)/Math.log(10)},a.prototype._toLog=function(t){var e,i=Math.abs(t);return i<1e-8?0:(e=this.log10(i+a._coordOffset)+a._logicalOffset,t<0?-e:e)},a.prototype.priceToLogical=function(t){return this.isLog()&&t?this._toLog(t):t},a.prototype._fromLog=function(t){var e,i=Math.abs(t);return i<1e-8?0:(e=Math.pow(10,i-a._logicalOffset)-a._coordOffset,t<0?-e:e)},a.prototype.logicalToPrice=function(t){return this.isLog()?this._fromLog(t):t},a.prototype.priceToCoordinate=function(t,e){var i,o;return this.makeSureItIsValid(),this.isEmpty()?0:(t=this.priceToLogical(t),i=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(t-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(i),e?o:Math.round(o))},a.prototype.pricesToCoordinates=function(t){this.pricesToCoordinatesEx(t,function(t){return t.y},function(t,e){t.y=e})},a.prototype.pricesToCoordinatesEx=function(t,e,i){var o,n,r,s,a,l,c,h,u;if(this.makeSureItIsValid(),o=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),r=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(r-n),this.isLog())for(l=0;l.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=o,this._studyTopMargin=i,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new g(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new g(-.5,.5)),this._invalidatedForRange.isValid=!0}},a.prototype.sourcesToUpdateViews=function(){var t,e;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],t=0;t6&&(t.textAlign="center",t.textBaseline="middle",t.font="bold "+e.labelFontSize+"px Arial",t.fillStyle=e.labelFontColor,t.fillText(e.label,e.x,e.y))},n.prototype.hitTest=function(t){var e,i;for(i=this._plates.length-1;i>=0;--i)if(e=this._hitTestDot(this._plates[i],t))return e;return null},n.prototype._hitTestDot=function(t,e){var i=this._dotTransform(t),o=new s(i.x,i.y);return a(e,o,Math.max(i.radius,8))?new l(l.REGULAR,t):null},r.prototype._createLayout=function(){throw Error("Child class must override this member")},r.prototype._updatePlate=function(t){throw Error("Child class must override this member")},r.prototype._getContainer=function(t){return this._container&&this._context===t||(this._context=t,this._container=$(t.canvas).parent()),this._container},r.prototype._plateArrowSize=14,r.prototype.showPlate=function(t,e){var i,o,n,r,s,a,l,c;this._currentId===t.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=t.id,this._createLayout(),this._getContainer(e).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),o=Math.round(t.barWidth/2),o>15&&(o=15),o<10&&(o=10),this._updatePlate(t),n=e.canvas.getBoundingClientRect(),r=t.x-this._layout.outerWidth()=o.Std.max(l,c),a-.5*l+.25*h,o.Std.iff(l>=o.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return o.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*u/t*50)},this.f_1=function(t,e){var i=this.f_0(t,e);return o.Std.cum(i,e)},this.main=function(t,e){var i,o;return this._context=t,this._input=e,i=this._input(0),o=this.f_1(i,this._context),[o]}}},{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(t,e){return o.Std.gt(t,e)},this.f_1=function(t,e){return o.Std.lt(t,e)},this.f_2=function(t,e){return 0===e?t:t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=this.f_1(o.Std.close(this._context),o.Std.open(this._context)),l=this._context.new_var(a),c=o.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(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.alma(a,n,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(t,e){return 100*(t+e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=i+1,s=this._context.new_var(n),a=o.Std.highestbars(s,r,this._context),l=this.f_0(a,i),c=o.Std.low(this._context),h=this._context.new_var(c),u=o.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(t){var e=this._context.new_var(o.Std.high(this._context)),i=o.Std.change(e),n=this._context.new_var(o.Std.low(this._context)),r=-o.Std.change(n),s=this._context.new_var(o.Std.tr(void 0,this._context)),a=o.Std.rma(s,t,this._context),l=this._context.new_var(o.Std.and(o.Std.gt(i,r),o.Std.gt(i,0))?i:0),c=o.Std.fixnan(100*o.Std.rma(l,t,this._context)/a,this._context),h=this._context.new_var(o.Std.and(o.Std.gt(r,i),o.Std.gt(r,0))?r:0);return[c,o.Std.fixnan(100*o.Std.rma(h,t,this._context)/a,this._context)]},this.f_1=function(t,e){var i=this.f_0(t),n=i[0],r=i[1],s=n+r,a=this._context.new_var(o.Std.abs(n-r)/(o.Std.eq(s,0)?1:s));return[100*o.Std.rma(a,e,this._context)]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e){var i,n,r,s;return this._context=t,this._input=e,i=this._input(0),n=o.Std.tr(this._context),r=this._context.new_var(n),s=o.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(t,e){return t-e},this.f_1=function(t){return o.Std.le(t,0)?0:1},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e, i=o.Std.hl2(this._context),n=this._context.new_var(i),r=o.Std.sma(n,5,this._context),s=this._context.new_var(i),a=o.Std.sma(s,34,this._context),l=this.f_0(r,a),c=l,h=this._context.new_var(l),u=o.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(t,e,i,o){return(t-e)/(i-o)},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0(o.Std.close(this._context),o.Std.open(this._context),o.Std.high(this._context),o.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(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,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(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/(i-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,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(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,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(t,e,i,n){ return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.volume(this._context),l=this._context.new_var(a),c=o.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(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.accdist(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,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(t,e,i){return t-e*i},this.f_1=function(t,e,i){return t+e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.high(this._context),a=this._context.new_var(s),l=o.Std.highest(a,i,this._context),c=o.Std.atr(i,this._context),h=this.f_0(l,n,c),u=this._context.new_var(s),d=o.Std.lowest(u,i,this._context),p=this.f_1(d,n,c),_=this._context.new_var(h),f=o.Std.highest(_,r,this._context), m=this._context.new_var(p),g=o.Std.lowest(m,r,this._context),v=g,y=f,[v,y]}}},{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(t){return o.Std.ge(t,0)?t:0},this.f_1=function(t){return o.Std.ge(t,0)?0:-t},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return this.f_2(t-e,t+e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),h=o.Std.sum(c,i,this._context),u=this._context.new_var(l),d=o.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 t=o.Std.close(this._context),e=o.Std.hlc3(this._context),i=this._context.new_var(o.Std.high(this._context)),n=o.Std.highest(i,30,this._context),r=o.Std.lowest(i,30,this._context),s=25/(n-r)*r,a=this._context.new_var(t),l=this._context.new_var(o.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/e*s,h=o.Std.sqrt(1+c*c),u=o.Std.round(180*o.Std.acos(1/h)/3.141592653589793),d=o.Std.iff(o.Std.gt(c,0),-u,u),p=o.Std.and(o.Std.gt(d,-2.14),o.Std.le(d,-.71))?7:8,_=o.Std.and(o.Std.gt(d,-3.57),o.Std.le(d,-2.14))?6:p,f=o.Std.and(o.Std.gt(d,-5),o.Std.le(d,-3.57))?5:_,m=o.Std.le(d,-5)?4:f,g=o.Std.and(o.Std.lt(d,2.14),o.Std.ge(d,.71))?3:m,v=o.Std.and(o.Std.lt(d,3.57),o.Std.ge(d,2.14))?2:g,y=o.Std.and(o.Std.lt(d,5),o.Std.ge(d,3.57))?1:v;return[1,o.Std.ge(d,5)?0:y]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e,i,n){return 100*o.Std.log10(t/(e-i))/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=this._input(0),n=o.Std.atr(1,this._context),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.Std.low(this._context),u=this._context.new_var(h),d=o.Std.lowest(u,i,this._context),p=o.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(t,e,i){return(t-e)/(.015*i)},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.sma(r,n,this._context),a=this._context.new_var(i),l=o.Std.dev(a,n,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(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_3=function(){var t=0;return function(e){var i=e.get(0),n=e.get(1);return t=i===n?0:i>n?o.Std.nz(t)<=0?1:o.Std.nz(t)+1:o.Std.nz(t)>=0?-1:o.Std.nz(t)-1,this._context.new_var(t)}}(),this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=this._input(0),s=this._input(1),a=this._input(2),l=o.Std.rsi(this.f_1(n,r,this._context),this.f_2(n,r,this._context)),c=this.f_3(n),h=o.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),u=this._context.new_var(o.Std.roc(n,1)),d=o.Std.percentrank(u,a),p=o.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(t,e){return t+e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.roc(a,n),c=this._context.new_var(s),h=o.Std.roc(c,r),u=this.f_0(l,h),d=this._context.new_var(u),p=o.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(t,e){this._context=t,this._input=e,this._context.new_sym(this._input(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._context.new_var(this._context.symbol.time),this._input(0),o.Std.period(this._context),n=o.Std.close(this._context),r=this._input(1),this._context.select_sym(1),s=this._context.new_var(this._context.symbol.time),a=o.Std.close(this._context),l=this._context.new_var(a),this._context.select_sym(0),c=l.adopt(s,i,0),h=this._context.new_var(n),u=this._context.new_var(c),d=o.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 t=this._input(0),e=this._input(1),i=Math.floor(t/2+1),n=this._context.new_var(o.Std.close(this._context)),r=this._context.new_var(o.Std.sma(n,t,this._context)),s=this._context.new_var(o.Std.close(this._context)),a=s.get(i)-r,l=o.Std.close(this._context)-r.get(i),c=e?a:l,h=-i;return[c,e?h:0]}, this.main=function(t,e){this._context=t,this._input=e;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(t){return-t},this.f_1=function(t,e){return o.Std.and(o.Std.gt(t,e),o.Std.gt(t,0))?t:0},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return t+e},this.f_4=function(t,e,i){return o.Std.abs(t-e)/(o.Std.eq(i,0)?1:i)},this.f_5=function(t){return 100*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.high(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=o.Std.low(this._context),c=this._context.new_var(l),h=o.Std.change(c),u=this.f_0(h),d=o.Std.tr(this._context),p=this._context.new_var(d),_=o.Std.rma(p,i,this._context),f=this.f_1(a,u),m=this._context.new_var(f),g=o.Std.rma(m,i,this._context),v=this.f_2(g,_),y=o.Std.fixnan(v,this._context),b=this.f_1(u,a),S=this._context.new_var(b),w=o.Std.rma(S,i,this._context),T=this.f_2(w,_),C=o.Std.fixnan(T,this._context),x=this.f_3(y,C),P=this.f_4(y,C,x),L=this._context.new_var(P),I=o.Std.rma(L,n,this._context),k=this.f_5(I),A=y,M=C,E=k,[A,M,E]}}},{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(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=o.Std.low(this._context),r=this._context.new_var(n),s=o.Std.lowest(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.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(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.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(t,e,i,o,n){return t*e*(i-o)/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.hl2(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=this.f_0(i,a,o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),c=this._context.new_var(l),h=o.Std.sma(c,n,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(t,e){return t*e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s,o.Std.volume(this._context)),l=this._context.new_var(a),c=o.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(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.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(t,e,i){return t?e:i},this.f_1=function(t,e){return t*(1+e)},this.f_2=function(t,e){return t*(1-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.sma(c,n,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,g=_,[f,m,g]}}},{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(t){var e=o.Std.lt(t,-.99)?-.999:t;return[o.Std.gt(t,.99)?.999:e]},this.f_1=function(){var t,e,i,n=this._input(0),r=this._context.new_var(o.Std.hl2(this._context)),s=o.Std.highest(r,n,this._context),a=this._context.new_var(o.Std.hl2(this._context)),l=o.Std.lowest(a,n,this._context),c=this._context.new_var(),h=this.f_0(.66*((o.Std.hl2(this._context)-l)/o.Std.max(s-l,.001)-.5)+.67*o.Std.nz(c.get(1)));return c.set(h[0]),t=this._context.new_var(),t.set(.5*o.Std.log((1+c.get(0))/o.Std.max(1-c.get(0),.001))+.5*o.Std.nz(t.get(1))),e=t.get(1),i=t.get(0),[i,e]},this.main=function(t,e){return this._context=t,this._input=e,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 t=this._input(0),e=o.Std.or(o.Std.isintraday(this._context),o.Std.and(o.Std.isdaily(this._context),o.Std.eq(o.Std.interval(this._context),1)))?1:7,i=this._context.new_var(o.Std.close(this._context)),n=this._context.new_var(o.Std.log(o.Std.close(this._context)/i.get(1)));return[100*o.Std.stdev(n,t,this._context)*o.Std.sqrt(365/e)]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=n/2,s=this._context.new_var(i),a=o.Std.wma(s,r,this._context),l=this._context.new_var(i),c=o.Std.wma(l,n,this._context),h=this.f_0(a,c),u=o.Std.sqrt(n),d=o.Std.round(u),p=this._context.new_var(h),_=o.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(t){var e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.high(this._context));return o.Std.avg(o.Std.lowest(e,t,this._context),o.Std.highest(i,t,this._context))},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._input(3),r=this.donchian(t),s=this.donchian(e),a=o.Std.avg(r,s),l=this.donchian(i);return[r,s,o.Std.close(this._context),a,l,-n,n,n,o.Std.gt(a,l)?0:1]},this.main=function(t,e){this._context=t,this._input=e;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(t,e,i,o){return t?e:i-o},this.f_1=function(t,e,i){return t+e*i},this.f_2=function(t,e,i){return t-e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,r,this._context), c=this.f_0(n,o.Std.tr(this._context),o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.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(t,e){return o.Std.ge(t,0)?e:-e},this.f_1=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context)),a=this._context.new_var(s),l=o.Std.ema(a,34,this._context),c=this._context.new_var(s),h=o.Std.ema(c,55,this._context),u=this.f_1(l,h),d=this._context.new_var(u),p=o.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(t,e,i,o){return t+2*e+3*i+4*o},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W ;return this._context=t,this._input=e,i=this._input(0),n=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=o.Std.close(this._context),p=i,_=this._context.new_var(d),f=o.Std.roc(_,p),m=a,g=this._context.new_var(f),v=o.Std.sma(g,m,this._context),y=n,b=this._context.new_var(d),S=o.Std.roc(b,y),w=l,T=this._context.new_var(S),C=o.Std.sma(T,w,this._context),x=r,P=this._context.new_var(d),L=o.Std.roc(P,x),I=c,k=this._context.new_var(L),A=o.Std.sma(k,I,this._context),M=s,E=this._context.new_var(d),D=o.Std.roc(E,M),V=h,O=this._context.new_var(D),R=o.Std.sma(O,V,this._context),B=this.f_0(v,C,A,R),z=this._context.new_var(B),F=o.Std.sma(z,u,this._context),N=B,W=F,[N,W]}}},{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(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.linreg(s,i,n),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(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.linreg(r,n,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(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.sma(l,n,this._context),h=a,u=c,d=o.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(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.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(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.high(this._context),o.Std.low(this._context)), r=this._context.new_var(n),s=o.Std.ema(r,9,this._context),a=this._context.new_var(s),l=o.Std.ema(a,9,this._context),c=this.f_1(s,l),h=this._context.new_var(c),u=o.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 t,e=this._input(0),i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.ema(n,e,this._context),s=this._context.new_var(),a=s.get(1)+(i-s.get(1))/(e*o.Std.pow(i/s.get(1),4));return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=o.Std[this._input(1)](this._context),r=this._context.new_var(n),s=r.get(i),a=s?n-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(t,e,i){ return t*(o.Std.le(e,0)?0:i)},this.f_1=function(t,e,i){return t*(o.Std.ge(e,0)?0:i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.hlc3(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(o.Std.volume(this._context),s,n),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_1(o.Std.volume(this._context),s,n),u=this._context.new_var(h),d=o.Std.sum(u,i,this._context),p=o.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(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.sma(s,n,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(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=o.Std.high(this._context),n=o.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(n),u=o.Std.sma(c,r,this._context),d=o.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(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std[this._input(2)](this._context),n=this._input(0),r=this._input(1),s=this._input(3),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.ema(c,r,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=o.Std.ema(d,s,this._context),_=this.f_0(u,p),f=_,m=u,g=p,[f,m,g]}}},{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(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.ema(s,n,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(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.wma(s,n,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(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.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(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context),r),a=o.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(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.sar(i,n,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(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.high(this._context),n=this._context.new_var(i),r=o.Std.low(this._context),s=this._context.new_var(r),a=this._input(0),l=this._input(1),c=o.Std.highest(n,a,this._context),h=o.Std.lowest(s,a,this._context),u=o.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(t,e){return(t-e)/e*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.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 t=this._context.new_var(o.Std.close(this._context));return[o.Std.cum(o.Std.change(t)/t.get(1)*o.Std.volume(this._context),this._context)]},this.main=function(t,e){return this._context=t,this._input=e,[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(t,e){var i,n,r;return this._context=t,this._input=e,i=this._context.new_var(o.Std.close(this._context)),n=this._input(0),r=100*(i.get(0)-i.get(n))/i.get(n),[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(t){return o.Std.max(t,0)},this.f_1=function(t){return-o.Std.min(t,0)},this.f_2=function(t,e){return o.Std.eq(t,0)?100:o.Std.eq(e,0)?0:100-100/(1+e/t)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.change(r),a=this.f_0(s),l=this._context.new_var(a),c=o.Std.rma(l,n,this._context),h=this.f_1(s),u=this._context.new_var(h),d=o.Std.rma(u,n,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(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.swma(r,this._context),a=this._context.new_var(s),l=o.Std.sum(a,i,this._context),c=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.Std.swma(h,this._context),d=this._context.new_var(u),p=o.Std.sum(d,i,this._context),_=this.f_1(l,p),f=this._context.new_var(_),m=o.Std.swma(f,this._context),g=_,v=m,[g,v]}}},{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(t,e){return o.Std.le(t,0)?0:e},this.f_1=function(t,e){return o.Std.gt(t,0)?0:e},this.f_2=function(t,e){return t/(t+e)*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.stdev(r,i,this._context),a=this._context.new_var(n),l=o.Std.change(a),c=this.f_0(l,s),h=this._context.new_var(c),u=o.Std.ema(h,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),_=o.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(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,i,n,this._context),c=this._context.new_var(l),h=o.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 t,e=this._input(0),i=o.Std[this._input(1)](this._context),n=this._context.new_var(i),r=o.Std.sma(n,e,this._context),s=this._context.new_var(),a=(s.get(1)*(e-1)+i)/e;return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=o.Std.high(this._context),l=o.Std.low(this._context),c=this._context.new_var(s),h=this._context.new_var(a),u=this._context.new_var(l),d=o.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=o.Std.sma(p,n,this._context),f=this._context.new_var(_),m=o.Std.sma(f,r,this._context),g=_,v=m,[g,v]}}},{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(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=o.Std.rsi(this.f_1(l,n,this._context),this.f_2(l,n,this._context)),h=this._context.new_var(c),u=this._context.new_var(c), d=this._context.new_var(c),p=o.Std.stoch(h,u,d,r,this._context),_=this._context.new_var(p),f=o.Std.sma(_,s,this._context),m=this._context.new_var(f),g=o.Std.sma(m,a,this._context),v=f,y=g,[v,y]}}},{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(t){return o.Std.log(t)},this.f_1=function(t){return 1e4*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context)),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.Std.ema(c,i,this._context),u=this._context.new_var(h),d=o.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(t,e,i){return 3*(t-e)+i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.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(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,n,i,this._context),c=l,h=this._context.new_var(c),[c,o.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(t,e,i){var n=this._context.new_var(t),r=this._context.new_var(e);return[o.Std.sum(n,i,this._context)/o.Std.sum(r,i,this._context)]},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._context.new_var(o.Std.close(this._context)),r=o.Std.max(o.Std.high(this._context),n.get(1)),s=this._context.new_var(o.Std.close(this._context)),a=o.Std.min(o.Std.low(this._context),s.get(1)),l=o.Std.close(this._context)-a,c=r-a,h=this.f_0(l,c,t),u=this.f_0(l,c,e),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(t,e){return this._context=t,this._input=e,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(t){t.hist=null,t.add_hist()},this.init=function(t,e){this._isNewSession=o.Std.createNewSessionCheck(t)},this.main=function(t,e){var i,n,r,s;return this._context=t,this._input=e,i=t.new_var(),n=t.new_var(),this._context.symbol.time&&(r=this._context.symbol.time,this._isNewSession(r)&&(this.f_1(i),this.f_1(n))),i.set(o.Std.nz(i.get(1))+o.Std.hlc3(this._context)*o.Std.volume(this._context)),n.set(o.Std.nz(n.get(1))+o.Std.volume(this._context)),s=i.get(0)/n.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(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.vwma(r,n,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(t,e){return 100*(t-e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.volume(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,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 t=this._input(0),e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.abs(o.Std.high(this._context)-e.get(1))),n=o.Std.sum(i,t,this._context),r=this._context.new_var(o.Std.high(this._context)),s=this._context.new_var(o.Std.abs(o.Std.low(this._context)-r.get(1))),a=o.Std.sum(s,t,this._context),l=this._context.new_var(o.Std.atr(1,this._context)),c=o.Std.sum(l,t,this._context);return[n/c,a/c]},this.main=function(t,e){return this._context=t,this._input=e,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(t,e,i){return 100*(t-e)/(e-i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=this._context.new_var(n),s=o.Std.highest(r,i,this._context),a=o.Std.low(this._context),l=this._context.new_var(a),c=o.Std.lowest(l,i,this._context),h=this.f_0(o.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(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.hl2(this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(s),h=o.Std.ema(c,n,this._context),u=this._context.new_var(s),d=o.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 t=this._input(0),e=this._context.new_var(o.Std.high(this._context)),i=o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.lt(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.lt(e.get(t+3),e.get(t)),o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.eq(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.lt(e.get(t+3),e.get(t))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+5),e.get(t)),o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.eq(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.lt(e.get(t+6),e.get(t)),o.Std.lt(e.get(t+5),e.get(t))),o.Std.and(o.Std.eq(e.get(t+4),e.get(t)),o.Std.le(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))))),n=this._context.new_var(o.Std.low(this._context)) ;return[o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.gt(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.gt(n.get(t+3),n.get(t)),o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.eq(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.gt(n.get(t+3),n.get(t))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+5),n.get(t)),o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.eq(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.gt(n.get(t+6),n.get(t)),o.Std.gt(n.get(t+5),n.get(t))),o.Std.and(o.Std.eq(n.get(t+4),n.get(t)),o.Std.ge(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))))),i]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(39),s=i(14),a=i(85),l=i(368),c=i(1025),h=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){i._handleToggleDropdown()},i._handleToggleDropdown=function(t){var e=i.state.isOpened,o="boolean"==typeof t?t:!e;i.setState({isOpened:o})},i._handleClose=function(){i._handleToggleDropdown(!1)},i._getDropdownPosition=function(){var t=r.findDOMNode(i).getBoundingClientRect();return{x:t.left+(i.props.directionHorz===a.DirectionHorz.ToLeft?t.width:0),y:t.bottom+2}},i.state={isOpened:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t,e=this.props,i=e.id,o=e.arrow,r=e.children,h=e.content,u=e.directionHorz,d=e.isDisabled,p=e.minWidth,_=e.title,f=e.className,m=this.state.isOpened,g=s(f,c.button,"apply-common-tooltip",(t={},t[c.isDisabled]=d,t[c.isOpened]=m,t));return n.createElement("div",{id:i,className:g,onClick:d?void 0:this._handleClick,title:_},h,o&&n.createElement("div",{className:c.arrow},n.createElement("div",{className:c.arrowWrap},n.createElement(l.ToolWidgetCaret,{dropped:m}))),n.createElement(a.PopupMenu,{closeOnClickOutside:this.props.closeOnClickOutside,directionHorz:u,doNotCloseOn:this,isOpened:m,minWidth:p,onClose:this._handleClose,position:this._getDropdownPosition},r))},e.defaultProps={arrow:!0,closeOnClickOutside:!0},e}(n.PureComponent),e.ToolWidgetMenu=h},function(t,e,i){"use strict";function o(t){var e=t.className,i=n.__rest(t,["className"]);return r.createElement(a.ToolWidgetButton,n.__assign({},i,{className:s(e,l.button)}))}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(14),a=i(103), l=i(1033),e.ToolWidgetIconButton=o},function(t,e,i){"use strict";function o(t,e,i){var o,n,r,s,a;for(void 0===i&&(i={}),o=Object.assign({},e),n=0,r=Object.keys(e);nt?t:e}}function a(t){return function(e){var i=parseInt(e,10);return M(i)?t:i}}function l(t){var e=new B;return function(i){var o=e.parse(i);return M(o)?t:o}}function c(t){var e=new B;return function(i){var o=e.parse(i);return M(o)?t():o}}function h(t,e){var i=new z(e);return function(e){var o=i.format(e);return M(o)?t:o}}function u(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function d(t){return function(e){return 0===e.length?t:e}}function p(t,e,i,o,n,r,s){W.call(this,t,e,o,n,r),this._transformFunction=i,this._setter=s,this._attachToControl(t,o)}function _(t,e,i,o,n){p.call(this,t,e,l(e.value()),i,o,n),this.addFormatter(function(t){return(new B).format(t)})}function f(t,e,i,o,n,r){this._subControlIds=e,W.call(this,t,i,o,n,r),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function m(t,e,i,o,n,r,s){this._model=o,this._mainSeries=r,this._toIntTransformer=a(s),this._disabled=!1,W.call(this,t,e,i,o,n);var l=this;i&&t.change(function(){l.setValueToProperty(l.value())}),this._mainSeries.onBarReceived().subscribe(this,function(){l.setValue(this.property().value())})}function g(t,e,i,o,n){W.call(this,t,e,i,o,n),i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e)}.bind(this))}function v(t,e,i,o,n,r,s,a){W.call(this,t,e,o,n,r),this._transformFunction=i,this._propertyChangedHook=a,this._setter=s;var l=this;o&&t.change(function(){l._setter?l._setter.call(l,l.value()):l.setValueToProperty(l.value())})}function y(t,e){W.call(this,t,e)}function b(t,e,i,o,n,r){if(!t.is(":checkbox, :radio"))return new w(t,e,i,o,n);W.call(this,t,e,i,o,n),this._setter=r;var s=this;i&&t.change(function(){s._setter?s._setter.call(s,s.value()):s.setValueToProperty(s.value())})}function S(t,e,i,o,n,r){W.call(this,t,e,i,o,n),this._inverted=!0===r}function w(t,e,i,o,n){W.call(this,t,e,i,o,n);var r=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");r.setValueToProperty(t)})}function T(t,e,i,o,n,r){var s,a;s=t.is("input")?t:t.find("input"),W.call(this,s,e,i,o,n),this._transparencyProperty=r,this.applyOldTransparency(),a=this,i&&s.change(function(){a.setValueToProperty(a.value())})}function C(e,i,o,n,r,s){function a(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||il._transformers[1]&&$(r[1]).val(l._transformers[1]),-1!==$.inArray(t.keyCode,[46,8,9,27,13,110,190])||65===t.keyCode&&!0===t.ctrlKey||67===t.keyCode&&!0===t.ctrlKey||88===t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(r[0]).on("keyup",function(t){parseInt($(this).val())l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(r[1]).val())&&$(this).val(r[1].val()),l._control.slider("values",0,$(this).val()),I.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(r[1]).on("keyup",function(t){parseInt($(this).val())l._transformers[1]&&$(this).val(l._transformers[1]), parseInt($(this).val())<$(r[0]).val()&&$(this).val(r[0].val()),l._control.slider("values",1,$(this).val()),I.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,I.prototype.propertyChanged),this._propTo.listeners().subscribe(this,I.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)}})}function k(t,e,i,o,n,r){W.call(this,t,e,i,o,n),this._separator=r||" ";var s=this;i&&t.change(function(){s.setValueToProperty(s.value())})}var A,M,E,D,V,O,R,B,z,F,N,W,H;i(384),A=i(9).ensureNotNull,M=i(198).isNaN,E=i(32),D=E.rgba,V=E.rgbaToString,O=E.parseRgb,R=i(212).TimePointIndexSearchMode,B=i(89).NumericFormatter,z=i(213).LimitedPrecisionNumericFormatter,F=i(30),N=i(372).addColorPicker,W=i(320).Binding,H=i(7).getLogger("Chart.PropertyPage"),o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},o.prototype.loadData=function(){var t,e,i;for(t=0;t",r=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100, minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:1e7,minMove:1,frac:!1},{priceScale:1e8,minMove:1,frac:!1},{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];for(t in r)e=r[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="";return n+="",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,r,s,a=null;return"number"==typeof t.valueOf()?(a=t,o=e,n=i):(o=t,n=e),o+="",r=this._labelToId(o),s=$(""),$("