(function(){function m(a){var b;if("object"!==typeof a||a.constructor&&!a.hasOwnProperty("constructor")&&!(a.constructor.prototype||{}).hasOwnProperty("isPrototypeOf"))return!1;for(b in a);return void 0===b||a.hasOwnProperty(b)}function k(){var a,b,c,e,d,f=arguments[0]||{},h=1,g=arguments.length,l=!1;"boolean"===typeof f&&(l=f,f=arguments[h]||{},h++);"object"!==typeof f&&"function"!==typeof f&&(f={});h===g&&(f=this,h--);for(;h'},onChartReady:function(a){this._ready?a.call(this):this._ready_handlers.push(a)},setSymbol:function(a,b,c){this._innerWindow().tradingViewApi.changeSymbol(a,b+"",c)},layout:function(){return this._innerWindow().tradingViewApi.layout()},setLayout:function(a){return this._innerWindow().tradingViewApi.setLayout(a)}, chartsCount:function(){return this._innerWindow().tradingViewApi.chartsCount()},chart:function(a){return this._innerWindow().tradingViewApi.chart(a)},activeChart:function(){return this._innerWindow().tradingViewApi.activeChart()},watchList:function(){return this._innerWindow().tradingViewApi.watchlist()},createButton:function(a){return this._innerWindow().createButton(a)},symbolInterval:function(a){return this._innerWindow().tradingViewApi.getSymbolInterval(a)},remove:function(){window.removeEventListener("resize", this._onWindowResize);this._ready_handlers.splice(0,this._ready_handlers.length);delete window[this.options.uid];var a=d.gEl(this.id);a.contentWindow.destroyChart();a.parentNode.removeChild(a)},getVisibleRange:function(a){return this._innerWindow().tradingViewApi.getVisibleRange(a)},getVisiblePriceRange:function(a){return this._innerWindow().tradingViewApi.getVisiblePriceRange(a)},subscribe:function(a,b){this._innerWindow().tradingViewApi.subscribe(a,b)},unsubscribe:function(a,b){this._innerWindow().tradingViewApi.unsubscribe(a, b)},onContextMenu:function(a){this._innerWindow().tradingViewApi.onContextMenu(a)},onShortcut:function(a,b){this._innerWindow().createShortcutAction(a,b)},onGrayedObjectClicked:function(a){this._innerWindow().tradingViewApi.onGrayedObjectClicked(a)},closePopupsAndDialogs:function(){this._innerWindow().tradingViewApi.closePopupsAndDialogs()},applyOverrides:function(a){this.options=k(!0,this.options,{overrides:a});this._innerWindow().applyOverrides(a)},applyStudiesOverrides:function(a){this._innerWindow().applyStudiesOverrides(a)}, createStudyTemplate:function(a,b){return this._innerWindow().tradingViewApi.createStudyTemplate(a,b)},addCustomCSSFile:function(a){this._innerWindow().addCustomCSSFile(a)},save:function(a){this._innerWindow().tradingViewApi.saveChart(a)},load:function(a,b){this._innerWindow().tradingViewApi.loadChart({json:a,extendedData:b})},setLanguage:function(a){this.remove();this.options.locale=a;this.create()},isFloatingTradingPanelVisible:function(){return this._innerWindow().isFloatingTradingPanelVisible()}, toggleFloatingTradingPanel:function(){this._innerWindow().toggleFloatingTradingPanel()},isBottomTradingPanelVisible:function(){return this._innerWindow().isBottomTradingPanelVisible()},toggleBottomTradingPanel:function(){this._innerWindow().toggleBottomTradingPanel()},showSampleOrderDialog:function(a){return this._innerWindow().showSampleOrderDialog(a)},mainSeriesPriceFormatter:function(){return this._innerWindow().tradingViewApi.mainSeriesPriceFormatter()},showNoticeDialog:function(a){this._innerWindow().tradingViewApi.showNoticeDialog(a)}, showConfirmDialog:function(a){this._innerWindow().tradingViewApi.showConfirmDialog(a)},selectLineTool:function(a){this._innerWindow().tradingViewApi.selectLineTool(a)},selectedLineTool:function(){return this._innerWindow().tradingViewApi.selectedLineTool()},getSavedCharts:function(a){this._innerWindow().tradingViewApi.getSavedCharts(a)},loadChartFromServer:function(a){this._innerWindow().tradingViewApi.loadChartFromServer(a)},saveChartToServer:function(a,b,c,d){this._innerWindow().tradingViewApi.saveChartToServer(a, b,c,d)},removeChartFromServer:function(a,b){this._innerWindow().tradingViewApi.removeChartFromServer(a,b)},getIntervals:function(){return this._innerWindow().tradingViewApi.getIntervals()},getStudiesList:function(){return this._innerWindow().tradingViewApi.getStudiesList()}};g("onSymbolChange");g("onIntervalChange");[["onTick"],["onAutoSaveNeeded"],["onScreenshotReady"],["onBarMarkClicked","onMarkClick"],["onTimescaleMarkClicked","onTimescaleMarkClick"]].forEach(function(a){d.widget.prototype[a[0]]= function(b){var c=a[1]||a[0];console.warn("Method `"+a[0]+'` is obsolete. Please use `widget.subscribe("'+c+'", callback)` instead.');this.subscribe(c,b)}});window.TradingView&&jQuery?jQuery.extend(window.TradingView,d):window.TradingView=d}})();