Elders force index indicator shows different results when compare to TradingView.com #766
6014 lines
3.0 MiB
6014 lines
3.0 MiB
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=Edge"><style>.pseudo{content:" "}.absolute-center{position:absolute;top:50%;left:50%}.text-overflow-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.frame-flat-arrow-down{padding-right:20px;position:relative}.frame-flat-arrow-down:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}.textfield-flat{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;margin:0;vertical-align:top;font-weight:700}.textfield-flat-numticker{position:relative}.textfield-flat-numticker>input{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;margin:0;vertical-align:top;font-weight:700;padding-right:20px;position:relative;padding-right:26px}.textfield-flat-numticker>input:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}.textfield-flat-numticker i{display:block;width:26px;height:50%;position:absolute;cursor:pointer;right:0}.textfield-flat-numticker i:after{content:'';display:block;width:0;height:0;position:absolute;right:12px;border-style:solid}.textfield-flat-numticker i.up{top:0}.textfield-flat-numticker i.up:after{border-color:transparent transparent #96989c;border-width:0 4px 4px;bottom:2px}.textfield-flat-numticker i.down{bottom:0}.textfield-flat-numticker i.down:after{border-color:#96989c transparent transparent;border-width:4px 4px 0;top:2px}.select-flat{border:1px solid #cfd2d4;color:#5c5d5e;padding:.5em;cursor:default;background-color:#fff;padding-right:20px;position:relative}.select-flat:hover{background-color:#f8f8f8}.select-flat.active,.select-flat:active{background-color:#f2f5f8}.select-flat:after{content:'';display:block;width:0;height:0;border-color:#96989c transparent transparent;border-style:solid;border-width:4px 4px 0;position:absolute;top:12px;right:6px}svg use{pointer-events:none}.avatar-small{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;width:32px;height:32px;overflow:hidden;position:relative}.avatar-small img{width:32px;height:32px;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.avatar-small.online:after,.avatar-small.is-online:after{content:'';display:block;width:10px;height:10px;border-radius:50%;position:absolute;top:-3px;right:-3px;background:#5cb888;border:3px solid #f2f5f8}.avatar-middle{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;width:39px;height:39px;overflow:hidden;position:relative}.avatar-middle img{width:39px;height:39px;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.avatar-middle.online:after,.avatar-middle.is-online:after{content:'';display:block;width:10px;height:10px;border-radius:50%;position:absolute;top:-3px;right:-3px;background:#5cb888;border:3px solid #f2f5f8}.user-stats-small{text-decoration:none;font-size:14px;font-weight:600}.user-stats-small .user-stats-charts{margin-right:14px}.user-stats-small .user-stats-charts:before{height:12px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -880px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-right:3px;top:-2px}.user-stats-small .user-stats-followers{margin-right:14px}.user-stats-small .user-stats-followers:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2220px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.user-stats-small .user-stats-reputation{margin-right:14px;color:#3cbf81}.user-stats-small .user-stats-reputation:before{height:13px;width:10px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2485px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.user-stats-small .user-stats-chat-rating{color:#3883df}.user-stats-small .user-stats-chat-rating:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -902px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-right:5px;top:-2px}.user-stats-small .user-stats-chat-rating.user-stats-chat-rating-negative{color:#e05c5e}.user-stats{text-decoration:none;color:#1380b7;font-size:19px}.user-stats .user-stats-charts{margin-right:14px}.user-stats .user-stats-charts:before{height:13px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -553px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:3px;top:-3px}.user-stats .user-stats-followers{margin-right:14px}.user-stats .user-stats-followers:before{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1804px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px}.user-stats .user-stats-reputation{color:#3cbf81}.user-stats .user-stats-reputation:before{height:15px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2460px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";top:-2px;padding-right:5px;top:-3px}.chart-stats-middle{text-decoration:none;color:#3b3e44;font-weight:700;font-size:14px}.chart-stats-middle .chart-stats-comments{margin-right:6px}.chart-stats-middle .chart-stats-comments:before{height:15px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1043px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:6px}.chart-stats-middle .chart-stats-views:before{height:12px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2815px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:5px;top:-1px}.chart-stats-small{text-decoration:none;color:#3b3e44;font-weight:700;font-size:12px}.chart-stats-small .chart-stats-comments{margin-right:9px}.chart-stats-small .chart-stats-comments:before{height:13px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1068px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:5px}.chart-stats-small .chart-stats-views:before{height:11px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2837px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" ";padding-left:4px;top:-1px}.symbol-change-direction.up{color:#41a771}.symbol-change-direction.down{color:#de7255}body.fullscreen-mode{overflow:hidden}.tv-layout-width{width:1000px;margin:0 auto}.tv-layout-half-width{width:500px;margin:0 auto}.tv-layout-half-width.left{float:left}.tv-layout-half-width.right{float:right}.tv-header{min-width:720px;background:#26282f;color:#fff;font-size:small}.is-not-authenticated .index-page .tv-header{background:#18b9d9}.is-not-authenticated .index-page .tv-header .index-learnmore-header{background:#18b9d9 url(images/index/learnmore-header-bg.png) 50% -25px repeat-x}.tv-footer{margin:-460px 0 0;height:460px;background:#26282f}.tv-content{padding:0 0 460px 0}.tv-overwrap{min-height:100%;overflow:hidden}.tv-main{height:auto!important;min-height:100%;background:#f2f5f8}.tv-content{background:#f2f5f8;height:auto!important;min-height:100%}.tv-side-toolbar{float:left;position:static;height:100%;overflow-x:visible;overflow-y:hidden}.tv-main-panel{position:relative;background-color:#f1f3f6;overflow:hidden}.tv-side-panel{float:right;position:relative;z-index:15;height:100%}.is-mobile .tv-side-panel{display:none}.tv-panels{height:100%}.chart-page .tv-content{padding:0}.clear{clear:both}.clearfix:after{clear:both;display:block;content:""}.hide{display:none!important}.show{display:block!important}.tv-right{float:right!important}.tv-left{float:left!important}#_atssh{position:absolute;margin-top:-20px}.js-right-boundary{margin-right:0}.hl-bg{background:#eaeff4}.content-page .bl-bg{background:#00b8dc;color:#fff}.content-page .bl-bg h1,.content-page .bl-bg h2,.content-page .bl-bg h3,.content-page .bl-bg h4,.content-page .bl-bg h5,.content-page .bl-bg h6{color:#fff}.content-page .bl-bg a,.content-page .bl-bg a:hover,.content-page .bl-bg a:visited{color:#c8cfd8}.content-page .bl-bg .contacts{color:inherit;background-color:#008da9}.content-page .bl-bg .contacts .title{color:#fff}.icon{display:inline-block;background:url(images/icons.png) 0 0 no-repeat;position:relative;vertical-align:middle}.tv-button:hover .icon-share{background-position:-100px -60px}.tv-button.active .icon-share{background-position:-120px -260px}.tv-button.disabled .icon-share{background-position:-80px -60px}.icon-favorites{background-position:-140px -60px;width:16px;height:15px;vertical-align:top;left:-3px;top:-1px}.tv-button:hover .icon-favorites{background-position:-160px -60px}.tv-button.active .icon-favorites{background-position:-140px -260px}.tv-button.disabled .icon-favorites{background-position:-140px -60px}.tv-button .icon-dropdown{position:relative;left:5px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.tv-button.active .icon-dropdown{background-position:2px -15px}.tv-button.load-more-button{width:88px}.tv-button.tv-button-fontstyle{height:14px;padding-left:0;padding-right:0;width:25px;text-align:center}.tv-button.process,.ajax-process-bg{background:url(images/bar-loader.gif)!important;background-repeat:repeat!important;background-position:0 0!important;pointer-events:none}.tv-button.tv-button-fontstyle .icon-fontstyle-bold,.tv-button.tv-button-fontstyle .icon-fontstyle-italic{display:block;height:11px;margin:auto;background:url(images/icons.png) 0 0 no-repeat;position:relative;top:1px}.tv-button.tv-button-fontstyle .icon-fontstyle-bold{width:10px;background-position:-40px -260px}.tv-button.tv-button-fontstyle .icon-fontstyle-italic{width:7px;background-position:-60px -260px}.tv-button,button.tv-button{cursor:default;padding:6px 10px 5px;height:15px;display:inline-block;vertical-align:top;text-decoration:none!important;color:#6f7073!important;border:1px solid #c9cbcd;font-size:11px;font-family:arial,sans-serif;font-weight:700;text-align:center;background:url(images/button-bg.png) 0 0 repeat-x;-webkit-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-webkit-appearance:none}.tv-button:hover{background-position:0 -26px;color:#68696b}.tv-button:active:not([disabled]),.tv-button.active,.tv-button.toolbutton:active,.tv-button.toolbutton.active,.tv-button.zeroclipboard-is-active,.tv-select-container.sbHolderOpen,.tv-select-container:active{background:#f4f7f9;color:#f5f5f5}.tv-button.ok{min-width:30px;background:#06b2ce;border-color:transparent;color:#fff!important}.tv-button.ok:hover{background:#06bfdd;border-color:transparent}.tv-button.ok:active{background:#06a5bf;border-color:transparent}.tv-button.ok.process{background:url(images/button-base-process.gif) 0 0 repeat!important}.tv-button.block{display:block;text-align:center}.tv-button.slim{padding:3px 8px;font-weight:400}.chart-description .tv-button.slim{line-height:normal}.tv-button.icon{padding:5px}.tv-button.icon.active{background:#cfe1ff}.tv-button.toolbutton{width:24px;height:25px;padding:0!important;text-align:center}.tv-button.wide{padding:5px 15px;min-width:50px}.tv-button.xwide{padding:5px 0;width:175px}.tv-button.xxwide{padding:5px 0;width:185px}.tv-button.disabled{color:#848484;background-position:0 -78px;opacity:.7;cursor:default}.tv-button.disabled:hover{background-position:0 -78px}.tv-button.disabled:active{background-position:0 -78px}.tv-button.theblueone{background:#4387f6 url(images/publish-chart-bg.png);color:#fff!important;border:1px solid #346bc2;padding:4px 10px 5px}.tv-button.theblueone:active{background-position:0 -26px}.tv-button.half-left{border-radius:3px 0 0 3px;border-right:none}.tv-button.half-right{border-radius:0 3px 3px 0}.tv-button.cancel{background:#9ca0a6;border-color:transparent;color:#fff!important}.tv-button.cancel:hover{background:#a4a8ad;border-color:transparent}.tv-button.cancel:active{background:#94989f;border-color:transparent}.tv-button.process{background:url(images/bar-loader.gif) 0 0 repeat}.tv-button.delete{background:#d75442;border-color:transparent;color:#fff!important}.tv-button.delete:hover{background:#da5f4f;border-color:transparent}.tv-button.delete:active{background:#d44935;border-color:transparent}.tv-button.green{background:#43be83;border-color:transparent;color:#fff!important}.tv-button.green:hover{background:#4ec28a;border-color:transparent}.tv-button.green:active{background:#3eb47b;border-color:transparent}.tv-button.with-arrow{position:relative;margin-left:2px}.tv-button.with-arrow.arrow-left:after,.tv-button.with-arrow.arrow-left:before{right:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.tv-button.with-arrow.arrow-left:after{border-color:rgba(249,249,249,0);border-right-color:#f9f9f9;border-width:5px;top:50%;margin-top:-5px}.tv-button.with-arrow.arrow-left:before{border-color:rgba(188,188,188,0);border-right-color:#bcbcbc;border-width:6px;top:50%;margin-top:-6px}.tv-button.with-arrow.arrow-left:active:after{border-color:rgba(227,231,233,0);border-right-color:#e3e7e9;margin-right:-1px}.tv-uppercase{text-transform:uppercase}.tv-select{display:none}.tv-select-container{background-color:#fafafa;border:1px solid #c9cbcd;border-radius:0;height:26px;position:relative;display:inline-block;vertical-align:top;color:#6b6b6d}.tv-select-container a{color:#6b6b6d}.tv-select-container.sbHolderOpen{color:#000}.tv-select-container.sbHolderOpen a{color:#000}.tv-select-container.sbHolderDisabled{background-color:#fff;border-color:#e3e5e6;color:gray}.tv-select-container.sbHolderDisabled a{color:gray}.tv-select-container.sbHolderDisabled .sbToggle{opacity:.2}.tv-select-container:hover:not(.sbHolderDisabled){color:#000}.tv-select-container:hover:not(.sbHolderDisabled) a{color:#000}.tv-select-container:hover:not(.sbHolderDisabled) .sbToggle:after{border-color:#000 transparent transparent transparent}.tv-select-container .sbSelector{cursor:default;display:block;height:26px;line-height:26px;outline:0;overflow:hidden;padding:0 23px 0 10px;color:#6b6b6d}.tv-select-container .sbSelector:hover{outline:0;text-decoration:none}.tv-select-container .sbToggle{cursor:default;position:absolute;right:5px;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.tv-select-container.dialog{height:25px;vertical-align:middle}.tv-select-container.dialog .sbSelector{height:25px;line-height:25px;padding:0 20px 0 10px;min-width:80px;width:calc(100% - 30px)}.tv-select-container.dialog .sbOptions{min-width:100%}.tv-select.inset+.tv-select-container{background:#eff3f6;box-shadow:inset 0 1px 2px rgba(0,0,0,.15);color:#6f7073}.tv-unstyled-select-container{position:relative}.property-wide-select .tv-select-container.dialog .sbSelector{width:90px}.tv-select-container .sbHolderDisabled{background-color:#3c3c3c;border:solid 1px #515151}.tv-unstyled-select-container .sbOptions,.tv-select-container .sbOptions{list-style:none;margin:0;padding:0;position:absolute;top:30px;min-width:150px;z-index:1;overflow-y:auto;background:#fff;border:1px solid #c9cbcd;overflow-x:hidden}.tv-unstyled-select-container .sbOptions.three-column-filter,.tv-select-container .sbOptions.three-column-filter{width:557px;padding-bottom:17px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item,.tv-select-container .sbOptions.three-column-filter li.filter-item{float:left;width:184px;min-height:34px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item:first-child,.tv-select-container .sbOptions.three-column-filter li.filter-item:first-child{width:557px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item .filter,.tv-select-container .sbOptions.three-column-filter li.filter-item .filter{border-bottom:0}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item:not(:first-child) .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item:not(:first-child) .filter:before{display:inline-block;width:16px;height:11px;background:url(images/symbolsearch/flags.png) no-repeat;content:" ";position:relative;margin:0 5px 3px 0;vertical-align:middle}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.canada .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.canada .filter:before{background-position:-16px 0}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.europe .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.europe .filter:before{background-position:-32px 0}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.india .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.india .filter:before{background-position:-16px -11px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.uk .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.uk .filter:before{background-position:0 -11px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.usa .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.usa .filter:before{background-position:-32px -11px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.forex .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.forex .filter:before{background-position:1px -22px;height:16px}.tv-unstyled-select-container .sbOptions.three-column-filter li.filter-item.bitcoin .filter:before,.tv-select-container .sbOptions.three-column-filter li.filter-item.bitcoin .filter:before{height:16px;background-position:-16px -22px}.tv-unstyled-select-container .sbOptions a,.tv-select-container .sbOptions a{display:block;white-space:nowrap;outline:0;padding:7px 12px;font-weight:400;font-size:13px;line-height:16px;color:#595959}.tv-unstyled-select-container .sbOptions a:link,.sbOptions a:visited,.tv-select-container .sbOptions a:link,.sbOptions a:visited{color:#595959;text-decoration:none}.tv-unstyled-select-container .sbOptions a:hover,.tv-select-container .sbOptions a:hover{background:#f4f7f9}.tv-unstyled-select-container .sbOptions a.active,.tv-select-container .sbOptions a.active{background:#f4f7f9;border-left:3px solid #5cb888;padding-left:9px;color:#333}.tv-unstyled-select-container .sbOptions li.last a,.tv-select-container .sbOptions li.last a{border-bottom:none}.tv-unstyled-select-container .sbOptions .sbDisabled,.tv-select-container .sbOptions .sbDisabled{display:block;padding:7px 0 7px 10px}.tv-unstyled-select-container .sbOptions .sbGroup,.tv-select-container .sbOptions .sbGroup{display:block;font-weight:700;padding:7px 0 7px 3px}.tv-unstyled-select-container .sbOptions .sbSub,.tv-select-container .sbOptions .sbSub{padding-left:17px}.tv-select-container.tv-select-container-fontsize .sbSelector{width:26px}.tv-select-container.tv-select-container-fontsize .sbOptions{min-width:54px}.tv-select-container-timezone .sbOptions{min-width:170px}.tv-text-input{color:#5a5a5a;margin:0;border:1px solid #c9cbcd;display:inline-block;overflow:hidden;width:100px;height:26px;vertical-align:top;padding:0 5px}.tv-text-input:focus{border-color:#4c82ce}.tv-text-input.inset{background:#fff}.tv-text-input.ticker{height:25px;width:60px}.tv-ticker{display:inline;position:absolute;width:13px;height:27px;margin:0 0 0 -13px}.tv-ticker .icon{background:url(images/ticker-icons.png);position:absolute;width:13px}.tv-ticker .icon.up{height:13px}.tv-ticker .icon.up:hover{background-position:0 -27px}.tv-ticker .icon.up:active{background-position:0 -54px}.tv-ticker .icon.down{height:14px;background-position:0 -13px;top:13px}.tv-ticker .icon.down:hover{background-position:0 -40px}.tv-ticker .icon.down:active{background-position:0 -67px}input:focus+.tv-ticker{border-left:1px solid #4c82ce}input:focus+.tv-ticker .icon{width:12px}input:focus+.tv-ticker .icon.up{background-position:-1px 0}input:focus+.tv-ticker .icon.up:hover{background-position:-1px -27px}input:focus+.tv-ticker .icon.up:active{background-position:-1px -54px}input:focus+.tv-ticker .icon.down{background-position:-1px -13px;top:13px}input:focus+.tv-ticker .icon.down:hover{background-position:-1px -40px}input:focus+.tv-ticker .icon.down:active{background-position:-1px -67px}.tv-close-panel{width:5px;height:25px;border:solid #c9cbcd;border-width:1px 0;background:#fff no-repeat 50% 50%}.tv-close-panel.left,.hidden .tv-close-panel.right{background:#fff url(data:image/gif;base64,R0lGODlhAwAFAIABAMnLzf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4zLWMwMTEgNjYuMTQ1NjYxLCAyMDEyLzAyLzA2LTE0OjU2OjI3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDRjdFQ0Y4OEJEQkIxMUU0QjE4NTg5OENGRUFDQjUyRSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDRjdFQ0Y4OUJEQkIxMUU0QjE4NTg5OENGRUFDQjUyRSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkNGN0VDRjg2QkRCQjExRTRCMTg1ODk4Q0ZFQUNCNTJFIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkNGN0VDRjg3QkRCQjExRTRCMTg1ODk4Q0ZFQUNCNTJFIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAAMABQAAAgZMcKCoBgUAOw==) no-repeat 50% 50%}.tv-close-panel.right,.hidden .tv-close-panel.left{background:#fff url(data:image/gif;base64,R0lGODlhAwAFAIABAMnLzf///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4zLWMwMTEgNjYuMTQ1NjYxLCAyMDEyLzAyLzA2LTE0OjU2OjI3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyREM5ODE0MUJEQzkxMUU0ODlBMkI3MkY1QjlDQjJDRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyREM5ODE0MkJEQzkxMUU0ODlBMkI3MkY1QjlDQjJDRiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjJEQzk4MTNGQkRDOTExRTQ4OUEyQjcyRjVCOUNCMkNGIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjJEQzk4MTQwQkRDOTExRTQ4OUEyQjcyRjVCOUNCMkNGIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAAMABQAAAgVEApaLVwA7) no-repeat 50% 50%}.tv-close-panel.top,.tv-close-panel.bottom{width:25px;height:5px;border-width:0 1px}.tv-close-panel.top{background-image:url(data:image/gif;base64,R0lGODlhBQADAIABAMnLzf///yH5BAEKAAEALAAAAAAFAAMAAAIFTGAHuF0AOw==)}.hidden .tv-close-panel.top{background-image:url(data:image/gif;base64,R0lGODlhBQADAIABAMnLzf///yH5BAEKAAEALAAAAAAFAAMAAAIFhB0XC1sAOw==)}html,body{margin:0;padding:0;background:#fff;color:#000;font-family:'Open Sans',sans-serif;font-size:small;height:100%!important}body{min-width:1000px}body.viewchart-body{min-width:1050px}body.extension{min-width:0}img{border:none}textarea{resize:none}:focus{outline:0!important}input::-ms-clear{display:none}input,textarea{-webkit-border-radius:0;-webkit-background-clip:padding-box;-moz-border-radius:0;-moz-background-clip:padding;border-radius:0;background-clip:padding-box}.chart-page :not(input):not(textarea):not(.selectable),.unselectable,.tv-profile .tags,.quote-area{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}input,textarea,.selectable{-moz-user-select:text;-webkit-user-select:text;user-select:text}.mt{border:0 #000 none;border-style:none;border-collapse:collapse;text-align:left;vertical-align:top;margin:0;padding:0}a{color:#0099d4;text-decoration:none}a:visited{color:#0099d4;text-decoration:none}a:hover{color:#0099d4;text-decoration:none}a:active{color:#0099d4;text-decoration:none}.auto-size{min-width:100%;min-height:100%;height:100%;width:100%;border:0 #000 none;border-style:none;border-collapse:collapse;text-align:left;vertical-align:top;margin:0;padding:0}.auto-w{min-width:100%;width:100%}.auto-h{min-height:100%;height:100%}.text-center{text-align:center}.center-align{text-align:center;vertical-align:middle}.l-align{text-align:left;vertical-align:middle}.r-align{text-align:right;vertical-align:middle}.simple-page{background-color:#626262;color:#fff}.form-page{background-color:#626262}.form-container{background-color:#626262}.form-at-all{background-color:#d3d3d3;padding:5px 5px 3px 5px}.form-header{font-size:xx-large;font-weight:700}.form-content{margin-top:10px;text-align:center}td.form-table{text-align:left;vertical-align:middle}.submit-button{margin-top:10px}.form-error{color:red;font-weight:700;margin-bottom:10px}#footer{background:#dbdbdb;color:#626262;border-top:1px #999 solid;height:24px;font-size:small}.copyright{margin-left:10px}.terms-of-use{margin-right:15px}#chart-area{background:0 0}#chart-area,.chart-container,.chart-place{position:relative;-ms-touch-action:none}#chart-area.fullscreen{position:fixed;z-index:15;left:0;top:0;width:100%!important;height:100%!important;background:#f1f3f6}.chart-page .chart-container{border:solid #c9cbcd 1px;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chart-page .chart-container.multiple.active{border:solid #007fb9 1px}.is-mobile .chart-page .chart-container.multiple.active{z-index:1}.chart-page .chart-container.inactive .chart-status-picture,.chart-page .chart-container.inactive .pane-legend{opacity:.6}.chart-page .chart-container.inactive .pane-legend-line.study,.chart-page .chart-container.inactive .back-to-present,.chart-page .chart-container.inactive .control-bar-wrapper{display:none}.viewchart-body .chart-container.multiple{border:solid #c9cbcd 1px;margin:-1px}#detailed-panel{background-color:#e8e8e8;height:100px;background-color:#f0f0f0;padding-left:7px}.detailed-header{text-align:left;vertical-align:middle}.detailed-header-symbol{font-size:xx-large;color:#484848}.detailed-header-value{font-size:x-large;color:#484848}.detailed-header-delta{font-size:x-large;color:#d84128}.detailed-date{font-size:small;color:#8f8f8f}.detailed-column{border-left:1px #c8c8c8 solid;width:100px}.detailed-param-name{text-align:right;vertical-align:middle;font-size:x-small;color:#8f8f8f}.detailed-param-value{text-align:left;vertical-align:middle;font-size:x-small;font-weight:700;color:#000}.gray-border-left{border-left:1px #c8c8c8 solid}.gray-border-right{border-left:1px #c8c8c8 solid}.q-search{background-color:#ebebeb;height:20px}.q-s{background-color:#ebebeb;border:1px #bdbdbd solid;color:#a4a4a4;margin:2px;padding:3px}.q-header{height:22px}.q-h{text-align:center;vertical-align:middle;background-color:#e8e8e8;font-weight:700;color:#545454;font-size:x-small}.q-even-row{background-color:#fbfbfb}.q-odd-row{background-color:#fff}.q-c-0{color:#363636;text-align:center;vertical-align:middle;font-weight:700}.q-c-1{color:#626262;text-align:center;vertical-align:middle}.q-c-2-3{color:#0f9900;text-align:center;vertical-align:middle}.o-c-t{border-bottom:2px #ccc solid;color:#363636;padding-left:10px;font-size:medium;font-weight:700}.chart-info-1{font-weight:700;color:#666}.chart-info-2{color:#666}.action-button{border-radius:3px;background:-moz-linear-gradient(-90deg,#fdfdfd,#e7e7e7);background:-webkit-gradient(linear,left bottom,left top,color-stop(0,#e7e7e7),color-stop(1,#fdfdfd));border:1px #919191 solid;color:#636363;text-align:center;font-weight:700;font-size:x-small;padding-top:5px;padding-bottom:5px;width:100px}.info-text{color:#576069;text-align:center;font-weight:700;font-size:small;padding-top:5px;padding-bottom:5px;width:100px}.o-c-i{border:1px #cdcdcd solid}.o-c-1{font-weight:700;font-size:medium}.o-c-2{font-size:small}.ui-tabs .ui-tabs-nav li a{font-size:x-small}table.save-chart-dialog{width:400px}input[type=text].save-chart-dialog{width:100%}input[type=button].save-chart-dialog{width:100;display:inline}textarea.save-chart-dialog{width:100%;height:100px}.input-reset{width:16px;height:16px;position:absolute;top:9px;right:7px;cursor:pointer;display:none;border-radius:50%}.input-reset:before{content:" ";display:block;width:10px;height:10px;background:url(images/icons.png) no-repeat -103px -340px;position:absolute;top:50%;left:50%;margin:-5px 0 0 -5px}.input-reset:hover{background-color:#f2f5f8}.input-reset:active{opacity:.6}.insert-study-dialog{position:absolute;width:830px;overflow:hidden;z-index:14;background:#fff;border:1px solid #d6d6d6;box-shadow:0 0 30px 0 rgba(0,0,0,.15)}.insert-study-row{overflow:auto;-webkit-overflow-scrolling:touch}.is-mobile .scrollbar{overflow:auto;-webkit-overflow-scrolling:touch}.custom-scroll-container{position:relative}.custom-scroll-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.custom-scroll-container .sb-scrollbar-top,.custom-scroll-container .sb-scrollbar-bottom{display:none}.load-chart .touch{visibility:visible;opacity:.3}.load-chart .touch:hover,.load-chart .touch.active{opacity:1}.load-chart .columns{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .columns.name{width:50%}.load-chart .columns.modified{width:30%}.load-chart .columns.symbol{width:20%}.load-chart .new-chart{padding-top:12px;border-left:1px solid #d6d6d6;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6;height:38px;width:140px;color:#8b8c8e;font-size:11px;font-weight:700;float:right;display:block;position:relative;cursor:pointer;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .new-chart:hover{color:#00c3e6}.load-chart .new-chart:active,.load-chart .new-chart.active{background-color:#f4f7f9;color:#00c3e6}.load-chart .chart-search{width:514px;position:relative;cursor:default;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.load-chart .chart-search input{width:514px;padding:9px 34px;height:36px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none}.load-chart .chart-search .input-reset{top:10px;right:10px}.load-chart .chart-search .search-icon{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.load-chart .please-log-in{height:452px;color:#8f8f8f;font-style:italic;text-align:center}.load-chart .please-log-in:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.load-chart .list-header{height:32px;color:#989797;padding:7px 30px 0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .list-header .item{display:inline-block;cursor:pointer;text-transform:uppercase;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .list-header .item.name{width:50%}.load-chart .list-header .item.modified{width:30%}.load-chart .list-header .item.symbol{width:20%}.load-chart .list-header .item:hover,.load-chart .list-header .item.active{color:#68696b}.load-chart .list-header .item.active{font-weight:700}.load-chart .list-header .item.name{padding-left:24px}.load-chart .charts-list-container{height:420px;position:relative}.load-chart .charts-list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.load-chart .charts-list-container .sb-scrollbar-top,.load-chart .charts-list-container .sb-scrollbar-bottom{display:none}.load-chart .charts-list-container .charts-list{position:absolute;width:100%}.load-chart .charts-list-container .charts-list .item{position:relative;cursor:pointer;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 30px 0 10px}.load-chart .charts-list-container .charts-list .item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:18px;display:inline-block;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.load-chart .charts-list-container .charts-list .item .value.name{width:50%}.load-chart .charts-list-container .charts-list .item .value.modified{width:30%}.load-chart .charts-list-container .charts-list .item .value.symbol{width:20%}.load-chart .charts-list-container .charts-list .item .value span.match{color:#4c82ce;font-weight:700}.load-chart .charts-list-container .charts-list .item .value.name{padding-left:24px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite{visibility:hidden;display:inline-block;width:16px;height:16px;position:absolute;top:1px;left:1px;background:url(images/icons.png);background-position:-40px -280px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover{visibility:visible;background-position:-120px -363px}.load-chart .charts-list-container .charts-list .item .value .icon-favorite.active{visibility:visible;background-position:-20px -280px}.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite{visibility:visible;opacity:.3}.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite:hover,.is-mobile .load-chart .charts-list-container .charts-list .item .value .icon-favorite.active,.feature-touch .load-chart .charts-list-container .charts-list .item .value .icon-favorite.active{opacity:1}.load-chart .charts-list-container .charts-list .item .actions{visibility:hidden;position:absolute;top:7px;right:16px}.load-chart .charts-list-container .charts-list .item .actions .icon-delete{display:inline-block;background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px}.load-chart .charts-list-container .charts-list .item .actions .icon-delete:hover{background-position:-81px -362px}.is-mobile .load-chart .charts-list-container .charts-list .item .actions,.feature-touch .load-chart .charts-list-container .charts-list .item .actions{visibility:visible;opacity:.3}.is-mobile .load-chart .charts-list-container .charts-list .item .actions:hover,.feature-touch .load-chart .charts-list-container .charts-list .item .actions:hover,.is-mobile .load-chart .charts-list-container .charts-list .item .actions.active,.feature-touch .load-chart .charts-list-container .charts-list .item .actions.active{opacity:1}.load-chart .charts-list-container .charts-list .item:hover{background:#f2f5f8}.load-chart .charts-list-container .charts-list .item:hover .value.name{color:#4c82ce}.load-chart .charts-list-container .charts-list .item:hover .actions{visibility:visible}.load-chart .charts-list-container .charts-list .item:hover .icon-favorite{visibility:visible}.load-chart .charts-list-container .charts-list .item.active .name{font-weight:700}.load-chart .charts-list-container .charts-list .item.active{background:#f2f5f8}.load-chart .charts-list-container .charts-list .item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#5cb888}.open-script .touch{visibility:visible;opacity:.3}.open-script .touch:hover,.open-script .touch.active{opacity:1}.open-script .columns{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .columns.name{width:45%}.open-script .columns.source{width:30%}.open-script .columns.modified{width:25%}.open-script .no-scripts{height:420px;color:#8f8f8f;font-style:italic;text-align:center;display:none}.open-script .no-scripts:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.open-script .search{position:relative;cursor:default;border-bottom:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.open-script .search input{width:514px;padding:9px 34px;height:36px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none}.open-script .search .input-reset{top:10px;right:10px}.open-script .search .search-icon{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.open-script .list-header{height:32px;color:#989797;padding:7px 30px 0 10px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-header .item{display:inline-block;cursor:pointer;text-transform:uppercase;font-size:11px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-header .item.name{width:45%}.open-script .list-header .item.source{width:30%}.open-script .list-header .item.modified{width:25%}.open-script .list-header .item:hover,.open-script .list-header .item.active{color:#68696b}.open-script .list-header .item.active{font-weight:700}.open-script .list-header .item.name{padding-left:24px}.open-script .list-container{height:420px;position:relative}.open-script .list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.open-script .list-container .sb-scrollbar-top,.open-script .list-container .sb-scrollbar-bottom{display:none}.open-script .list-container .list{position:absolute;width:100%}.open-script .list-container .list .item{position:relative;cursor:pointer;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:5px 30px 0 10px}.open-script .list-container .list .item .value{height:18px;display:inline-block;position:relative;vertical-align:bottom;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.open-script .list-container .list .item .value.name{width:45%}.open-script .list-container .list .item .value.source{width:30%}.open-script .list-container .list .item .value.modified{width:25%}.open-script .list-container .list .item .value span.match{color:#4c82ce;font-weight:700}.open-script .list-container .list .item .value.name{padding-left:24px}.open-script .list-container .list .item .value .icon-favorite{visibility:hidden;display:inline-block;width:16px;height:16px;position:absolute;top:1px;left:1px;background:url(images/icons.png);background-position:-40px -280px}.open-script .list-container .list .item .value .icon-favorite:hover{visibility:visible;background-position:-120px -363px}.open-script .list-container .list .item .value .icon-favorite.active{visibility:visible;background-position:-20px -280px}.is-mobile .open-script .list-container .list .item .value .icon-favorite,.feature-touch .open-script .list-container .list .item .value .icon-favorite{visibility:visible;opacity:.3}.is-mobile .open-script .list-container .list .item .value .icon-favorite:hover,.feature-touch .open-script .list-container .list .item .value .icon-favorite:hover,.is-mobile .open-script .list-container .list .item .value .icon-favorite.active,.feature-touch .open-script .list-container .list .item .value .icon-favorite.active{opacity:1}.open-script .list-container .list .item .value .text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block;max-width:90%}.open-script .list-container .list .item .value .text+.strategy{margin-left:4px;width:10px;height:16px;display:inline-block;vertical-align:baseline}.open-script .list-container .list .item .actions{visibility:hidden;position:absolute;top:7px;right:16px}.open-script .list-container .list .item .actions .icon-delete{display:inline-block;background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px}.open-script .list-container .list .item .actions .icon-delete:hover{background-position:-81px -362px}.is-mobile .open-script .list-container .list .item .actions,.feature-touch .open-script .list-container .list .item .actions{visibility:visible;opacity:.3}.is-mobile .open-script .list-container .list .item .actions:hover,.feature-touch .open-script .list-container .list .item .actions:hover,.is-mobile .open-script .list-container .list .item .actions.active,.feature-touch .open-script .list-container .list .item .actions.active{opacity:1}.open-script .list-container .list .item:hover{background:#f2f5f8}.open-script .list-container .list .item:hover .value.name{color:#4c82ce}.open-script .list-container .list .item:hover .actions{visibility:visible}.open-script .list-container .list .item:hover .icon-favorite{visibility:visible}.open-script .list-container .list .item.active .name{font-weight:700}.open-script .list-container .list .item.active{background:#f2f5f8}.open-script .list-container .list .item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#5cb888}.script-search{border:solid #d6d6d6;border-width:1px 0}.script-search .script-search-fld{margin:0;cursor:text;display:block;position:relative}.script-search .script-search-fld .script-search-spacer{padding:9px 34px}.script-search .script-search-fld .script-search-spacer input{height:19px;width:100%;border:0;padding:0;margin:0;display:block}.script-search .script-search-fld .search-icon{position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.script-search .script-search-fld .input-reset{top:10px;right:10px}.ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.insert-study-tabs{width:187px;height:100%;float:left;display:block;font-size:13px;line-height:13px;border-right:1px solid #d6d6d6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.insert-study-tabs .search{position:relative;padding:0;width:100%;height:38px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:default;border-top:1px solid #d6d6d6;border-bottom:1px solid #d6d6d6}.insert-study-tabs .search.active{border-top:1px solid #4c82ce;border-bottom:1px solid #4c82ce}.insert-study-tabs .search.active .left-border,.insert-study-tabs .search.active .right-border{display:block}.insert-study-tabs .search input{display:block;padding:13px 9px 11px 29px;width:100%;height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:none}.insert-study-tabs .search div{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.insert-study-tabs .search .left-border,.insert-study-tabs .search .right-border{display:none;width:1px;height:38px;top:-1px;background:#4c82ce}.insert-study-tabs .search .left-border{left:0}.insert-study-tabs .search .right-border{left:100%}.insert-study-tabs .search .input-reset{top:10px;right:10px}.insert-study-tabs .insert-study-tabs-list-container{height:calc(100% - 38px);position:relative}.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-top,.insert-study-tabs .insert-study-tabs-list-container .sb-scrollbar-bottom{display:none}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list{margin:0;padding:0;position:absolute;width:100%}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li{padding:11px 29px 9px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;clear:both;color:#595959;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li:hover{background:#f4f7f9}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.active:not(.search){border:0;padding-left:25px;font-weight:700;background:#f4f7f9;border-left:4px solid #5cb888}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs{padding:0;position:relative}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs:hover{background:0 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text{padding:11px 29px 9px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text:before{content:" ";position:absolute;display:block;width:5px;height:9px;top:12px;left:14px;background:url(images/select-bg.png);background-position:10px 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs .text.open:before{width:9px;height:5px;top:14px;left:12px;background-position:0 0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul{width:100%;padding:0}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:hover,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:active{padding-left:37px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li.active,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:hover.active,.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li.tabs ul li:active.active{padding-left:33px}.insert-study-tabs .insert-study-tabs-list-container .insert-study-tabs-list li .beta-sign{color:#5cb888;font-size:10px;position:relative;top:-2px;font-style:italic;margin-left:3px}.insert-study-pages .economy-page{padding:20px 28px}.insert-study-main{width:calc(100% - 187px);height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:-1px;border-left:1px solid #d6d6d6;border-top:1px solid #d6d6d6}.insert-study-pages{height:calc(100% - 47px);position:relative;display:block}.insert-study-pages>div:after{clear:both;display:table;content:""}.insert-study-pages .page-with-popular>div{margin:0;width:100%;float:left}.insert-study-pages .page-with-popular>div .header-container{margin:0;padding-left:28px;padding-right:12px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.insert-study-pages .page-with-popular>div .header-container .group-header{font-weight:700;font-size:14px;padding:20px 0 8px;margin:0}.insert-study-pages .page-with-popular>div .header-container.with-divider{margin-top:15px}.insert-study-pages .page-with-popular>div .header-container.with-divider .group-header{padding-top:24px;border-top:1px solid #d6d6d6}.insert-study-pages .page-with-popular>div .column-left,.insert-study-pages .page-with-popular>div .column-right{width:50%;float:left}.insert-study-pages .page-with-popular>div .column-left .subgroup-header,.insert-study-pages .page-with-popular>div .column-right .subgroup-header{font-weight:700;margin:0;padding:8px 0 8px 28px}.insert-study-pages .insert-study-pages-loading{display:none;width:100%;height:100%;position:absolute;background:#fff;opacity:.6}.insert-study-pages.loading .insert-study-pages-loading{display:block}.insert-study-items{margin:0;padding:0}.insert-study-items ul{margin:0 0 8px;padding:0}.insert-study-items ul.column{float:left;width:199px}.insert-study-items li{display:block;vertical-align:top;padding:8px 0 8px 28px;font-size:13px;position:relative;-webkit-transform:translate3d(0,0,0)}.insert-study-items li>span{display:inline-block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.insert-study-items li .text{box-sizing:border-box;padding-right:15px;max-width:100%}.insert-study-items li .text+.strategy{margin-left:-10px;width:10px;height:16px;display:inline-block;vertical-align:baseline}.insert-study-items li.grayed .text{opacity:.3}.insert-study-items li.grayed .fav.in-fav{visibility:hidden}.insert-study-items li.custom-script,.insert-study-items li.published-script{padding-right:68px}.insert-study-items li.custom-script .text,.insert-study-items li.published-script .text{max-width:60%}.insert-study-items li:not(.placeholder){color:#595959;cursor:pointer}.insert-study-items li:hover:not(.placeholder){background:#f4f7f9}.insert-study-items li .fav{display:block;position:absolute;top:10px;left:6px;visibility:hidden;width:16px;height:14px;background:url(images/icons.png) -40px -280px}.insert-study-items li:not(.grayed) .fav:hover:not(.in-fav){background-position:-120px -363px}.insert-study-items li:not(.grayed) .in-fav{background-position:-20px -280px}.insert-study-items li.custom-script .source,.insert-study-items li .open-chart-popup,.insert-study-items li .delete{display:block;position:absolute;top:9px;width:18px;height:18px;text-align:center;line-height:17px;border:1px solid #d6d6d6;background:#fff;color:#8c8c8c}.insert-study-items li.custom-script .source:hover,.insert-study-items li .open-chart-popup:hover,.insert-study-items li .delete:hover{border-color:#b5b7b9}.insert-study-items li.custom-script .source{right:33px}.insert-study-items li .open-chart-popup{right:8px}.insert-study-items li .delete{right:8px}.insert-study-items li .delete i{margin:3px 4px;height:12px;width:10px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2761px;display:block;position:absolute;overflow:hidden}.insert-study-items li .author,.insert-study-items li .agrees{display:block;position:absolute;top:8px}.insert-study-items li .agrees{right:11%;color:#919597;width:13%;text-align:right}.insert-study-items li:hover .fav,.insert-study-items li.custom-script:hover .source,.insert-study-items li .fav.in-fav,.is-mobile .insert-study-items li .fav,.is-mobile .insert-study-items li .agrees{visibility:visible}.insert-study-items li .fav.in-fav,.favored-list .item.quicked .to-quick,.favored-list .item .to-quick.quicked{opacity:.35}.insert-study-items li:hover .fav.in-fav,.favored-list .item.quicked:hover .to-quick,.favored-list .item:hover .to-quick.quicked{opacity:1;-webkit-transition:opacity .4s ease;-moz-transition:opacity .4s ease;-ms-transition:opacity .4s ease;-o-transition:opacity .4s ease;transition:opacity .4s ease}.insert-study-items li .match{color:#4c82ce}.insert-study-pages .search-header{padding:0;margin:0 14px 9px 28px;height:13px;font-weight:700;clear:both}.insert-study-pages .search-header:not(:first-child){margin-top:29px;padding-top:31px;border-top:1px solid #f0f0f0}.insert-study-pages .search-header:first-child{padding-top:20px}.insert-study-items li .author{right:24%;width:16%}.insert-study-items li .remove{display:none;position:absolute;top:8px;right:8px;width:14px;height:14px;background:url(images/icons.png) no-repeat scroll -102px -362px transparent}.insert-study-items li .remove:hover{background-position:-81px -362px}.insert-study-items li:hover .remove{display:block}.insert-study-offer-container{min-height:614px;margin-left:199px;display:block;border-left:1px solid #d6d6d6;background-color:#f4f7f9;position:relative}.insert-study-offer-header{font-size:11px;padding:12px 12px 0 15px;color:#666464;position:relative}.insert-study-offer-info,.insert-study-offer-description{position:relative;font-size:13px;line-height:1.65;color:#545454}.insert-study-offer-info{padding:15px}.insert-study-body{height:615px;overflow:hidden}.insert-study-offer-description{padding:15px 0;margin:15px 15px 0 15px;border-top:1px solid #dfdfdf;font-size:10px}.insert-study-offer-info-header{font-size:24px}.insert-study-offer-info-subheader,.insert-study-offer-info-subheader a{font-size:11px;color:#b8b8b8}.insert-study-offer-info-logo{position:absolute;right:15px;max-width:150px;max-height:30px}.insert-study-subscribe-button,.insert-study-button,.insert-study-subscribe-button:hover,.insert-study-button:hover,.insert-study-subscribe-button:active,.insert-study-button:active,.insert-study-subscribe-button:visited,.insert-study-button:visited{display:inline-block;padding:5px 17px;margin:16px 0 6px;font-size:12px;font-weight:700;background:#00b2d0;border:1px solid #00a8c4;color:#fff;cursor:pointer;margin-right:15px}.insert-study-offer-info-screenshots img{width:184px;margin:8px 16px 8px 0;border:1px solid #dce1e6}.scrollbar .insert-study-offer-info-screenshots img{width:179px}.insert-study-offer-info-screenshots a:last-child img{margin-right:0}.insert-study-header .header-text{font-weight:700;font-size:14px;padding:8px 0 9px 28px;border-bottom:1px solid #efefef;color:#000}.insert-study-header .tv-dialogs-label-hint{margin-left:4px;position:relative;top:2px}.insert-study-header .filter-control{display:inline-block;position:relative;border-color:#000;border-style:dashed;border-width:0;border-bottom-width:1px;cursor:pointer}.insert-study-header .filter-control:after{content:'';display:block;position:absolute;top:50%;right:-12px;border-color:inherit;border-style:solid;border-width:4px;border-left-color:transparent;border-right-color:transparent;border-bottom-width:0}.insert-study-header .filter-control.active{color:#4ab2dc;border-color:#4ab2dc}table.quote-bar{width:100%;text-align:center;white-space:nowrap}tr.quote-bar{height:26px}td.quote-bar{border:1px solid #ddd}.quote-bar.header{background-color:silver;font-weight:700}.quote-bar.data-row{font-family:verdana;font-size:9pt}.quote-bar.data-row.odd{background-color:#0ff}div.background-blur{width:100%;height:100%;position:absolute;left:0;top:0;opacity:.5;background-color:#fff;z-index:1000;display:none}div.missed-connection{width:500px;height:300px;color:#fff;background-color:red;font-size:36pt;text-align:center;vertical-align:middle;position:absolute;left:50%;top:50%;margin-left:-250px;margin-top:-150px;padding-top:50px;display:none}div.critical-error{width:500px;height:300px;color:#fff;background-color:red;font-size:36pt;text-align:center;vertical-align:middle;position:absolute;left:50%;top:50%;margin-left:-250px;margin-top:-150px;padding-top:50px;display:none}.loading-indicator{width:100%;height:100%;position:absolute;z-index:150;background:#fff}.loading-indicator img{position:absolute;top:50%;left:50%;margin:-58px 0 0 -58px}.loading-indicator img.small{margin:-12px 0 0 -12px}.ui-slider-horizontal{margin:7px 0 0;background:#f4f7f9!important;background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:-o-linear-gradient(top,#f2f7fa,#f4f7f9)!important;background:linear-gradient(top,#f2f7fa,#f4f7f9)!important;border:1px solid #c9cbcd!important;height:5px!important;box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.ui-slider-handle{width:15px!important;height:15px!important;background:url(images/icons.png) -20px -80px!important;border:none!important;top:-5px!important;margin-left:-7px!important;z-index:0!important}.ui-slider-horizontal.linewidth-slider{width:101px;margin:7px 10px;background:url(images/dialogs/linewidth-slider.png) 0 0 no-repeat!important;height:12px!important;border:none!important;box-shadow:none;display:inline-block;vertical-align:middle}.ui-slider-horizontal.linewidth-slider:before,.ui-slider-horizontal.linewidth-slider:after{content:none}.ui-slider-horizontal.transparency-slider{width:99px;height:8px!important;margin:7px 10px;background:url(images/dialogs/opacity-slider.png)!important}.ui-slider-horizontal.transparency-slider .gradient{width:100%;height:100%;position:absolute;top:0;left:0;background:-moz-linear-gradient(left,transparent 0,#7db9e8 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,transparent),color-stop(100%,#7db9e8));background:-webkit-linear-gradient(left,transparent 0,#7db9e8 100%);background:-o-linear-gradient(left,transparent 0,#7db9e8 100%);background:-ms-linear-gradient(left,transparent 0,#7db9e8 100%);background:linear-gradient(to right,transparent 0,#7db9e8 100%)}.ui-slider-horizontal.linewidth-slider .ui-slider-handle,.ui-slider-horizontal.transparency-slider .ui-slider-handle{width:20px!important;height:20px!important;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABvElEQVR42r1U2U7CUBD1D9V36oP4R/AHrmFRChFsQSExKihtFB804oOJLAXKcllEifU6pwkEuYVQH2hykpuZOZNZTmdtZV+11vDk8gWfnEgrh+GEBsjxtHJ9e++rGA1p6USs29tQzq9294OnL4QWYUj4BvCGDT7EMNbbWJisVm9uByJKlggsJCctrfDMS4bJO70P3uoO7Dds8CEGscTxzqtsPXCi3KCKi8s73mJ9PhqNHAEfYij2kzhZ4oqVpjJZtNmhwB+QlsA4KUP7MwswPZhLUFatRZWJlQ44OOD+WVROe/Rh2PmHJwS6gkYc4rZJEf5JwihJA/MoVU2B8PpW5uFoioeiSbwF/3u1wcENykl1khAaI6OFbc4QkAwEG+FYSvC3afvgHh0ndLcJUaXg7/SHdsKDUFyfblm1Wzbmtgw4tlwmji2fiKpOL8WPpUC0bpcCjrAUo2ZKY9k0/yebIslmy0nYDGJ1KewuCXvP8SjgN8I8XPx6X8TJEXdz3nHwjo8D6cqC0KFNbB/AG7aZ47Cz7PkqYtiomGABeMMGH9pErJsDK2FzMkmKdKpTa3rsLKPSgfVXjLq0skv/C1tGuRhzjqXzAAAAAElFTkSuQmCC) 0 0 no-repeat!important;top:50%!important;margin:-10px 0 0 -10px!important}.falling,.growing,.index-charts-tab .item .symbol-last.growing,.index-charts-tab .item .symbol-last.falling,.quotes-item .symbol-last.growing,.quotes-item .symbol-last.falling,.search-results .symbol-last.growing,.search-results .symbol-last.falling,.viewchart-column-main .symbol-quote .symbol-last.growing,.viewchart-column-main .symbol-quote .symbol-last.falling,.search-additional-info .symbol-quote .symbol-last.growing,.search-additional-info .symbol-quote .symbol-last.falling{color:#fff}.growing{background:#298755}.falling{background:#da563e}.font-awesome{font-weight:700;font-family:FontAwesome}@media (orientation:landscape){html.ipad.ios7,html.ipad.ios7 body{position:fixed;bottom:0;width:100%;height:672px!important}}.common-tooltip-wrapper{position:fixed;margin:2px 0;pointer-events:none;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;-ms-transition:opacity .15s linear;transition:opacity .15s linear;z-index:200}.common-tooltip-wrapper.vertical{margin:0 2px}.common-tooltip-wrapper.farther{margin:8px 0}.common-tooltip-wrapper.farther.vertical{margin:0 8px}.common-tooltip-wrapper.no-pointer-events{margin:8px 0}.common-tooltip-wrapper.no-pointer-events.vertical{margin:0 8px}.common-tooltip-wrapper.no-pointer-events.farther{margin:14px 0}.common-tooltip-wrapper.no-pointer-events.farther.vertical{margin:0 14px}.common-tooltip-wrapper .common-tooltip-body{position:relative;padding:7px 8px;background-color:#000;color:#fff;border:#fff 1px solid;font-size:11px;font-weight:600;max-width:300px;white-space:pre-wrap;text-align:center}.common-tooltip-wrapper:before,.common-tooltip-wrapper:after{content:"";display:block;position:absolute;width:0;height:0}.common-tooltip-wrapper.below:before{top:-7px;left:50%;margin-left:-8px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-bottom:#fff 8px solid}.common-tooltip-wrapper.below:after{top:-5px;left:50%;margin-left:-6px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-bottom:#000 6px solid}.common-tooltip-wrapper.above:before{bottom:-7px;left:50%;margin-left:-8px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-top:#fff 8px solid}.common-tooltip-wrapper.above:after{bottom:-5px;left:50%;margin-left:-6px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-top:#000 6px solid}.common-tooltip-wrapper.otr:before{left:-7px;top:50%;margin-top:-8px;border-top:transparent 8px solid;border-bottom:transparent 8px solid;border-right:#fff 8px solid}.common-tooltip-wrapper.otr:after{left:-5px;top:50%;margin-top:-6px;border-top:transparent 6px solid;border-bottom:transparent 6px solid;border-right:#000 6px solid}.common-tooltip-wrapper.otl:before{right:-7px;top:50%;margin-top:-8px;border-top:transparent 8px solid;border-bottom:transparent 8px solid;border-left:#fff 8px solid}.common-tooltip-wrapper.otl:after{right:-5px;top:50%;margin-top:-6px;border-top:transparent 6px solid;border-bottom:transparent 6px solid;border-left:#000 6px solid}.footer-sponsored-by{display:none}.sp-active .footer-sponsored-by{display:block}#chart-area .onchart-sponsored-by,#chart-container .onchart-sponsored-by{display:none}.sp-active #chart-area .onchart-sponsored-by,.sp-active #chart-container .onchart-sponsored-by{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;position:absolute;bottom:55px;left:10px;padding:0 6px;width:0;background-color:rgba(255,255,255,.5);overflow:hidden;opacity:0;-webkit-transition:width .5s ease-in-out;-moz-transition:width .5s ease-in-out;-o-transition:width .5s ease-in-out;-ms-transition:width .5s ease-in-out;transition:width .5s ease-in-out}.sp-active #chart-area .onchart-sponsored-by.expanded,.sp-active #chart-container .onchart-sponsored-by.expanded{width:129px;opacity:1}.sp-active #chart-area .onchart-sponsored-by>img,.sp-active #chart-container .onchart-sponsored-by>img{width:117px;height:35px}.sp-active #chart-container .onchart-sponsored-by{bottom:30px}.tv-dialog.popup-exante{max-width:500px}.tv-dialog.popup-exante .tv-dialog-title .tv-dialog-title-close{top:5px;right:5px}.tv-dialog.popup-exante .tv-dialog-content{background:#fff url(images/exante-logo-popup-bg.png) left -20px bottom -30px no-repeat;font-size:13px}.tv-dialog.popup-exante .tv-dialog-content .message{padding:35px 20px 20px}.tv-dialog.popup-exante .tv-dialog-content .actions-block{padding:10px 20px 20px;text-align:right}.tv-dialog.popup-exante .tv-dialog-content .actions-block *{display:inline-block;line-height:30px;white-space:nowrap}.tv-dialog.popup-exante .tv-dialog-content .actions-block .no-button{margin-right:30px;cursor:pointer}.tv-dialog.popup-exante .tv-dialog-content .actions-block .yes-button{background-color:#00b8d6;color:#fff;text-transform:uppercase;font-weight:600;padding:0 15px}.tv-dialog.popup-exante .tv-dialog-content .actions-block .yes-button:hover{background-color:#00c6e7}.decks .ad-pack .left-column,.decks .ad-pack .right-column{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:inline-block;width:50%;vertical-align:top}.decks .ad-pack .left-column{padding-right:13px}.decks .ad-pack .right-column{padding-left:13px}.decks .ad-pack table{width:100%;margin-bottom:30px}.decks .ad-pack table td{padding:10px 0}.decks .ad-pack table td:last-child{width:75%}.decks .ad-pack table td:last-child textarea{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;height:80px}.tv-dialog-shadowbox{position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,.5);z-index:120;-webkit-transform:translate3d(0,0,0)}.tv-dialog-shadowbox.transparent{background:0 0}.tv-dialog{position:absolute;min-height:18px;left:50%;top:50%;background:#fff;border:1px solid #c9cbcd;box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.tv-dialog.tv-dialog-min-width{min-width:400px}.tv-dialog.ui-resizable{position:absolute}.tv-dialog-title{color:#4c4848;font-weight:700;font-size:15px;padding:17px 35px 17px 20px;cursor:default}.tv-dialog-title.tv-dialog-title-no-close{padding-right:20px}.tv-dialog-title.tv-dialog-title-hidden{padding:0}.tv-dialog-title .tv-dialog-title-minimize,.tv-dialog-title .tv-dialog-title-close{width:21px;height:21px;display:block;position:absolute;right:15px;top:13px;cursor:pointer}.tv-dialog-title .tv-dialog-title-minimize:after,.tv-dialog-title .tv-dialog-title-close:after{width:9px;height:9px;content:" ";position:absolute;top:6px;left:6px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAASCAYAAACJgPRIAAAAUElEQVR42pWQMQoAIAwD++d+x8HJbyoOWXJDSSBgwpVS62vtc8ulXg/ZAZkFMycNoBJgXoUcX1cm9N1NSL0esgMyC2ZOGkAlwLwKObhu/qcHp/zWImEdH8EAAAAASUVORK5CYII=);display:block}.tv-dialog-title .tv-dialog-title-minimize:hover:after,.tv-dialog-title .tv-dialog-title-close:hover:after{background-position:center bottom}.tv-dialog-title .tv-dialog-title-minimize:after{background:url(images/dialogs/minimize-flat.gif)}.tv-dialog-content{color:#595959;max-width:100%}.tv-dialog-content .main{padding:0 20px 20px 20px}.tv-dialog-content .main p:first-child{margin-top:0}.tv-dialog-content .main p:last-child{margin-bottom:0}.tv-dialog-content .main .buttons{margin-top:25px;text-align:right}.tv-dialog-content .main .buttons.center{text-align:center}.tv-dialog-content .main .buttons .tv-button{min-width:60px;text-transform:uppercase}.tv-dialog-content .main-signup{padding:20px 15px 15px}.tv-dialog-content .main-tree{padding:0}.tv-dialog-content .main-properties,.tv-dialog-content .alert-dialog-content{padding:25px}.tv-dialog-content .main-properties.main-properties-aftertabs,.tv-dialog-content .alert-dialog-content.main-properties-aftertabs,.tv-dialog-content .main-properties.alert-aftertabs,.tv-dialog-content .alert-dialog-content.alert-aftertabs{padding-top:5px}.tv-dialog-content .main-properties.main-properties-tabless,.tv-dialog-content .alert-dialog-content.main-properties-tabless{padding-top:40px}.tv-dialog-content .main-browser-extension{padding:40px 70px 40px 52px;padding:0}.tv-dialog-content .main-browser-extension .extension-poster{width:328px;height:377px;background:url(images/dialogs/browser-extension/demo.png) 0 0}.tv-dialog-content .main-browser-extension .left,.tv-dialog-content .main-browser-extension .right{width:50%;box-sizing:border-box}.tv-dialog-content .main-browser-extension .left{float:left;padding:32px 0 0 46px}.tv-dialog-content .main-browser-extension .right{float:right;padding:51px 70px 0 44px}.tv-dialog-content .main-browser-extension .logo{float:left;width:36px;height:36px;background-size:36px 36px;margin-right:10px}.tv-dialog-content .main-browser-extension .logo.chrome{background:url(images/svg/google-chrome-logo.svg) 0 0}.tv-dialog-content .main-browser-extension .name,.tv-dialog-content .main-browser-extension .info{float:left;clear:right;color:#a9a9a9;width:200px}.tv-dialog-content .main-browser-extension .name{font-size:20px;height:20px;line-height:20px}.tv-dialog-content .main-browser-extension .info{font-size:12px;height:14px;line-height:20px}.tv-dialog-content .main-browser-extension h1{margin-top:48px;margin-bottom:0;font-size:20px;line-height:20px}.tv-dialog-content .main-browser-extension p{color:#c2c5cb;margin:14px 0 28px 0}.tv-dialog-content .main-browser-extension .install-extension button{height:42px;padding:0 25px;line-height:42px;text-align:center;border:none;font-size:12px;text-transform:uppercase;background:#52c3e7;color:#fff;cursor:pointer}.tv-dialog-content .alert-dialog-content{padding-top:10px}.tv-dialog-content .properties-separator{border-bottom:1px solid #c9cbcd}.tv-dialog-content table.tv-dialog-form{width:100%}.tv-dialog-content .tv-dialog-form td{vertical-align:middle;padding:3px 5px;color:#595959}.tv-dialog-content .tv-dialog-form td img{vertical-align:middle}.tv-dialog-content .tv-dialog-chart-container{height:220px;border:1px solid #828282}.tv-dialog-content .tv-dialog-termsofservice{width:390px;height:80px;border:1px solid #999;padding:5px;margin:0 0 10px}.tv-dialog-content .tv-dialog-termsofservice .content{width:100%;height:100%;overflow:auto}.tv-dialog-content .tv-dialog-checkbox-mask{width:18px;height:16px;position:absolute;top:2px;left:2px;background:url(images/dialogs/checkbox.png) 0 0}.tv-dialog-content .tv-dialog-checkbox-mask.radio{background:#fff url(images/icons.png);background-position:-100px -140px;width:16px}.tv-dialog-content .tv-dialog-checkbox-mask.disabled{background-position:0 -32px}.tv-dialog-content .tv-dialog-checkbox-mask-active{background:url(images/dialogs/checkbox.png) 0 -16px}.tv-dialog-content .tv-dialog-checkbox-mask-active.radio{background-position:-120px -140px}.tv-dialog-content .tv-dialogs-label-hint{position:relative;top:1px;margin:-1px 5px 0}.tv-dialogs-label-hint{width:14px;height:14px;padding:0;display:inline-block;border-radius:14px;background:url(images/help/help-icon.png) no-repeat center center}.tv-dialog-content form input[type=text],.tv-dialog-content form input[type=password],.tv-dialog-text-input{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;height:33px;border:1px solid #c9cbcd;margin:1px;padding:0 5px;background:#fff;color:#65676a}.tv-dialog-content form input[type=text]:disabled,.tv-dialog-content form input[type=password]:disabled,.tv-dialog-text-input:disabled{opacity:.5}.tv-dialog-content .alert-dialog-content input[type=text],.tv-dialog-content .alert-dialog-content input[type=password],.tv-dialog-content .tv-dialog-text-input{height:27px}.tv-dialog-text-input.disabled{color:#909292!important}.tv-dialog-content form input[type=text].error,.tv-dialog-content form input[type=password].error{margin:0;border:2px solid #de5764;background:#f7e4e6;color:#e06571}.tv-dialog-content textarea{color:#5a5a5a;font:12px/18px Arial,sans;border:1px solid #c9cbcd;padding:8px 5px;background:#fff;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-content form input.prompt-value{margin-top:15px}.tv-dialog-content form input.tv-dialog-content-textactive,.tv-dialog-text-input:focus{background:#fff;border-color:#4c82ce;color:#595959}.tv-dialog-text-input.tv-dialog-text-input-error{background:#fff;border-color:#d75442;color:#595959}.tv-dialog-content textarea{border:1px solid #c9cbcd;background:#fff}.tv-dialog-content textarea.tv-dialog-content-textareaactive{color:#595959;border-color:#4c82ce}.tv-dialog-content .tv-dialog-button-big{color:#576069;padding:10px 16px;border-radius:4px;font-weight:700;border:2px solid #a4a4a4;background:url(images/dialogs/big-button-bg.png)}.tv-dialog-content .tv-dialog-button-big:hover{background-position:0 -38px}.tv-dialog-content .tv-dialog-button-big:active{background-position:0 -76px}.tv-dialog-content .tv-dialog-button{color:#576069;padding:2px 12px;border-radius:4px;font-weight:700;border:1px solid #a4a4a4;background:url(images/dialogs/button-bg.png)}.tv-dialog-content .tv-dialog-button:hover{background:url(images/dialogs/big-button-bg.png);background-position:0 -48px}.tv-dialog-content .tv-dialog-button:active{background:url(images/dialogs/big-button-bg.png);background-position:0 -76px}.tv-dialog-content .tv-dialog-button-blue{cursor:default;background:#00b8d6;color:#fff;padding:5px 15px;font-size:12px;font-weight:700;height:15px;display:block}.tv-dialog-content .tv-dialog-button-blue:hover{background:#00c6e7}.tv-dialog-content .tv-dialog-button-blue:active{background:#00c6e7}.tv-dialog-content .caption{font-size:11px;color:#576069;margin-bottom:3px;margin-top:7px;font-weight:700}.tv-dialog-content .caption.half{float:left;width:50%}.tv-dialog-content .caption-text{font-size:12px;color:#576069;margin:5px 0 0;position:relative}.tv-dialog-content .caption-big{font-size:12px;color:#576069;margin:15px 0}.tv-dialog-content .caption-big-center{font-size:12px;color:#576069;margin:15px 0;text-align:center}.tv-dialog-content .caption-big-center.slim{margin:0;text-align:left}.tv-dialog-content .caption.first{margin-top:0}.tv-dialog-content .empty-caption{height:7px}.publish-dialog .tv-dialog-content .publish-text.autowidth textarea{width:100%;margin:0}.publish-dialog .tv-dialog-content .publish-text.jsfluid{height:175px}.publish-dialog .tv-dialog-content .publish-text.jsfluid textarea{height:100%;margin:0}.publish-dialog .tv-dialog-content .publish-text textarea{width:658px;height:175px}.publish-dialog .tv-dialog-content .published-text textarea{width:360px}.tv-dialog-content .tv-dialog-captcha-row input{float:left}.tv-dialog-content .tv-dialog-captcha{height:31px;float:left;margin:0 0 0 5px}.tv-dialog-content .instruct{background:#eaf3fb;border:1px solid #d1dee9;padding:10px;margin:0 0 10px 0;font-size:12px;line-height:15px;border-radius:2px}.tv-dialog-content .tv-dialogs-bottom{padding:12px 10px;color:#bdbdbd;font-size:12px}.tv-dialog-content .tv-dialogs-bottom .text-top{margin:0 0 5px;color:#595959}.tv-dialog-content .tv-dialogs-bottom .text{margin:8px 0 0;color:#9a9a9a;font-style:italic}.tv-dialog-content .tv-dialogs-bottom a{text-decoration:underline}.tv-dialog-content .tv-dialogs-bottom-signup{padding:20px 40px 20px 150px}.tv-dialog-content .tv-dialogs-bottom-button{margin:24px 0 0;height:31px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to{color:#858181;font-size:10px;height:31px;padding:0 1px 0 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input{display:none}.tv-dialog-content .tv-dialogs-bottom-button .repost-to .repost-to-label{float:left;padding:8px 10px 0 10px;height:21px;white-space:nowrap;border:solid #c9c9c9;border-width:1px 0 1px 1px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label{float:left;width:35px;height:29px;background:#f1f1f1;border:solid #c9c9c9 1px;margin:0 -1px 0 0}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label:hover{background:#fff}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label .icon{display:block;background:url(images/icons.png) 100px 100px no-repeat}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label.repost-to-twitter .icon{width:22px;height:18px;background-position:-50px -320px;margin:6px auto 0 auto}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-twitter{background:#9adff6;border-color:#72c3de;position:relative}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-twitter .icon{background-position:-75px -320px}.tv-dialog-content .tv-dialogs-bottom-button .repost-to label.repost-to-stocktwits .icon{width:22px;height:14px;background-position:0 -320px;margin:8px auto 0 auto}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-stocktwits{background:#f6b09a;border-color:#de8672;position:relative}.tv-dialog-content .tv-dialogs-bottom-button .repost-to input:checked+label.repost-to-stocktwits .icon{background-position:-25px -320px}.tv-dialog-readbefore{border-bottom:dashed #858181 1px;cursor:pointer;margin:0 0 0 10px}.tv-dialog-readbefore a{font-weight:400;font-size:10px;color:#858181}.tv-dialog-title .tv-dialog-readbefore{position:relative;top:-3px}.tv-dialog-title .tv-dialog-readbefore a{position:relative;top:2px}.tv-dialog-content .tv-dialogs-bottom-button #publish-dialog-do-publish{height:16px;padding-top:7px;padding-bottom:6px}.tv-dialog-content .caption-text input[type=checkbox]{visibility:hidden}.tv-dialog-content .disconnect,.tv-dialog-content .critical{padding-bottom:15px}.tv-dialog-content .disconnect ol,.tv-dialog-content .disconnect ul{padding-left:1.5em;margin-bottom:0}.tv-dialog-content .disconnect ul{list-style:square}.tv-dialogs-name{margin-top:13px;margin-bottom:4px;vertical-align:middle}.auth-dialog{border:none}.auth-dialog a{cursor:pointer}.auth-dialog .page{display:none;width:430px}.auth-dialog .page.active{display:block}.auth-dialog .properties-tabs{padding:0 29px}.auth-dialog .properties-tabs a.properties-tabs-label{padding:22px 0 8px;font-size:16px;font-weight:600!important;color:#999;text-transform:uppercase}.auth-dialog .properties-tabs a.properties-tabs-label:not(:first-child){margin-left:28px}.auth-dialog .properties-tabs a.properties-tabs-label.active{color:#000}.auth-dialog .main{padding:0 30px 30px}.auth-dialog .auth-dialog-socials{margin:30px 0;white-space:nowrap}.auth-dialog .auth-dialog-socials a{display:inline-block;position:relative;width:43px;height:43px;border-width:1px;border-style:solid;-webkit-border-radius:50%;-webkit-background-clip:padding-box;-moz-border-radius:50%;-moz-background-clip:padding;border-radius:50%;background-clip:padding-box;overflow:hidden}.auth-dialog .auth-dialog-socials a:not(:first-child){margin-left:20px}.auth-dialog .auth-dialog-socials a svg{position:absolute;top:50%;left:50%}.auth-dialog .auth-dialog-socials a:hover{width:45px;height:45px;border-width:0}.auth-dialog .auth-dialog-socials a:hover svg{fill:#fff!important}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook{border-color:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook svg{margin-left:-11px;margin-top:-11px;width:22px;height:22px;fill:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook:hover{background-color:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter{border-color:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter svg{margin-left:-11px;margin-top:-11px;width:24px;height:24px;fill:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter:hover{background-color:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2{border-color:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2 svg{margin-left:-9px;margin-top:-10px;width:22px;height:22px;fill:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2:hover{background-color:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo{border-color:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo svg{margin-left:-12.5px;margin-top:-10px;width:23px;height:22px;fill:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo:hover{background-color:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin{border-color:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin svg{margin-left:-9px;margin-top:-12px;width:19px;height:20px;fill:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin:hover{background-color:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits{border-color:#546c85}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits svg{margin-left:-10px;margin-top:-11px;width:22px;height:22px;fill:#546c85}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits:hover{background-color:#546c85}.auth-dialog .auth-dialog-separator{position:relative;overflow:hidden;height:15px;text-align:center;margin-bottom:33px}.auth-dialog .auth-dialog-separator-copy{display:inline-block;position:relative;height:15px;padding:0 17px;font-size:12px;line-height:15px;color:#a4a7ab;vertical-align:top;text-transform:uppercase}.auth-dialog .auth-dialog-separator-copy:before,.auth-dialog .auth-dialog-separator-copy:after{content:" ";position:absolute;top:7px;height:0;border-top:solid 1px #dbdfe4;width:200px}.auth-dialog .auth-dialog-separator-copy:before{margin:0 100% 0 0;right:0}.auth-dialog .auth-dialog-separator-copy:after{margin:0 0 0 100%;left:0}.auth-dialog .tv-dialog-content form input[type=text],.auth-dialog .tv-dialog-content form input[type=password]{display:block;margin:0 0 18px;padding:0 14px;height:43px;border-color:#d7dbe0;font-family:'Open Sans',sans-serif;font-size:14px;-webkit-appearance:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.auth-dialog .tv-dialog-content form input[type=text]:focus,.auth-dialog .tv-dialog-content form input[type=password]:focus{border-color:#1fb9ea}.auth-dialog .tv-dialog-content form input[type=text]::-webkit-input-placeholder,.auth-dialog .tv-dialog-content form input[type=password]::-webkit-input-placeholder{color:#b1b6c1}.auth-dialog .tv-dialog-content form input[type=text]:-moz-placeholder,.auth-dialog .tv-dialog-content form input[type=password]:-moz-placeholder{color:#b1b6c1}.auth-dialog .tv-dialog-content form input[type=text]::-moz-placeholder,.auth-dialog .tv-dialog-content form input[type=password]::-moz-placeholder{color:#b1b6c1}.auth-dialog .tv-dialog-content form button[type=submit]{cursor:pointer;display:block;margin:30px 0 0;border:0;padding:0;height:43px;width:143px;font-family:'Open Sans',sans-serif;font-size:14px;line-height:normal;text-align:center;font-weight:600;text-transform:uppercase;background-color:#52c3e7;color:#fff}.auth-dialog .tv-dialog-content form button[type=submit]::-moz-focus-inner{border:0;padding:0}.auth-dialog .tv-dialog-content form button[type=submit]:hover{background:#68cbea}.auth-dialog .tv-dialog-content form button[type=submit].process{background-image:url(images/button-base-process.gif)}.auth-dialog .auth-dialog-options{position:relative;font-size:12px}.auth-dialog .auth-dialog-options .auth-dialog-remember{display:inline-block;cursor:pointer}.auth-dialog .auth-dialog-options .auth-dialog-remember .auth-dialog-remember-pseudo{display:inline-block;width:16px;height:16px;background-color:#60b789;-webkit-border-radius:3px;-webkit-background-clip:padding-box;-moz-border-radius:3px;-moz-background-clip:padding;border-radius:3px;background-clip:padding-box}.auth-dialog .auth-dialog-options .auth-dialog-remember .auth-dialog-remember-pseudo input{position:absolute;visibility:hidden}.auth-dialog .auth-dialog-options .auth-dialog-remember .auth-dialog-remember-pseudo i{display:none;margin:5px 0 0 4px;width:8px;height:6px;background:url(data:image/gif;base64,R0lGODlhCAAGAKIAAAAAAP///6DUuLDbxMjm1v///wAAAAAAACH5BAEAAAUALAAAAAAIAAYAAAMRWLoTq42EAQMpbQjLAn/DtSQAOw==)}.auth-dialog .auth-dialog-options .auth-dialog-remember .auth-dialog-remember-pseudo input:checked+i{display:block}.auth-dialog .auth-dialog-options .auth-dialog-remember .auth-dialog-remember-text{display:inline-block;margin-left:8px;vertical-align:top}.auth-dialog .auth-dialog-options .auth-dialog-recover{display:block;position:absolute;top:0;right:0}.auth-dialog .auth-dialog-notice p{font-size:12px;margin:0}.auth-dialog .auth-dialog-notice p:not(:first-child){margin-top:5px}.auth-dialog .page.recover h2{margin:22px 0 30px;font-size:16px;font-weight:600!important;color:#000;text-transform:uppercase}.auth-dialog .auth-dialog-field{display:block;position:relative}.auth-dialog .auth-dialog-field .auth-dialog-field-placeholder{display:none;position:absolute;top:0;left:15px;color:#b1b6c1;font-size:14px;line-height:44px;cursor:text}.auth-dialog .auth-dialog-field input.empty+.auth-dialog-field-placeholder{display:block}@media (max-height:645px),(max-width:460px){.auth-dialog .page{width:300px}.auth-dialog .properties-tabs{padding:0 19px}.auth-dialog .main{padding:0 20px 20px}.auth-dialog .auth-dialog-socials{margin:20px 0 15px}.auth-dialog .auth-dialog-socials a{width:28px;height:28px}.auth-dialog .auth-dialog-socials a:not(:first-child){margin-left:16px}.auth-dialog .auth-dialog-socials a:hover{width:30px;height:30px}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook{border-color:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook svg{margin-left:-9px;margin-top:-9px;width:18px;height:18px;fill:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-facebook:hover{background-color:#3d5b97}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter{border-color:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter svg{margin-left:-8.5px;margin-top:-9.5px;width:19px;height:19px;fill:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-twitter:hover{background-color:#32abde}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2{border-color:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2 svg{margin-left:-7px;margin-top:-8px;width:18px;height:18px;fill:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-google-oauth2:hover{background-color:#db4c3f}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo{border-color:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo svg{margin-left:-10.5px;margin-top:-8px;width:19px;height:18px;fill:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-yahoo:hover{background-color:#592e71}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin{border-color:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin svg{margin-left:-7px;margin-top:-10px;width:15px;height:16px;fill:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-linkedin:hover{background-color:#1673b1}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits{border-color:#546c85}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits svg{margin-left:-8px;margin-top:-9px;width:18px;height:18px;fill:#546c85}.auth-dialog .auth-dialog-socials a.auth-dialog-social-stocktwits:hover{background-color:#546c85}.auth-dialog .auth-dialog-separator{margin-bottom:20px}.auth-dialog .tv-dialog-content form input[type=text],.auth-dialog .tv-dialog-content form input[type=password]{display:block;margin:0 0 12px;padding:0 10px;height:32px;font-size:12px}.auth-dialog .tv-dialog-content form button[type=submit]{margin:20px 0 0;height:32px;font-size:12px}.auth-dialog .page.recover h2{margin:22px 0 18px}.auth-dialog .auth-dialog-field .auth-dialog-field-placeholder{left:12px;font-size:12px;line-height:32px}}.tv-dialog-text-content{font-size:12px}.tv-dialog-text-content ul{margin:7px 0;padding:0}.tv-dialog-text-content ul li{list-style:none;background:url(images/index/bullet.png) 0 3px no-repeat;padding:0 0 0 15px}.tv-dialog-text-content ul.spacious{margin-left:12px}.tv-dialog-text-content ul.spacious li{padding-right:20px;margin:5px 0}.tv-dialog-text-content h3{margin:15px 0 7px}.tv-dialog-text-content p{margin:7px 0 7px}.tv-dialog-text-content .standsout-link{background:#ededed;padding:10px 21px;display:inline-block;margin:0 auto}.tv-dialog-content .small-text{color:#9a9a9a;font-size:11px;padding:5px 0}.tv-dialog-content .input input{width:298px!important}.tv-dialog-content .dual-input{margin:7px 0}.tv-dialog-content .dual-input input{width:138px!important;float:right}.tv-dialog-content .dual-input input:first-child{float:left}.tv-dialog-content .input{margin-bottom:7px}.tv-dialog-content .dual{margin:8px 1px 2px}.tv-dialog-content .dual .left{float:left;text-align:left;width:50%}.tv-dialog-content .dual .left.checkbox{margin:3px 0 0}.tv-dialog-content .dual .right{float:right;text-align:right;width:50%}.tv-dialog-content .dual .tv-button{padding:5px 30px}.tv-dialog-content .big-button .tv-button{padding:10px 50px;background:#fff}.tv-dialog-content .big-button .tv-button:hover{background:#fcfcfc}.tv-dialog-content label{color:#595959}.no-drawings{width:450px;color:#8f8f8f;font-style:italic;text-align:center}.no-drawings:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.main-tree-container{position:relative;width:450px;border-top:#e5e4e4 1px solid}.no-top-border .main-tree-container{border-top:0}.main-tree-container .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.main-tree-container .sb-scrollbar-top,.main-tree-container .sb-scrollbar-bottom{display:none}.main-tree-container .main-tree-wrap{position:absolute;width:100%}.tv-dialog-title .button-filter,.properties-tabs-label .button-filter{display:inline-block;position:relative;width:21px;height:16px;vertical-align:top;margin:3px 0 0 10px}.tv-dialog-title .button-filter:before,.properties-tabs-label .button-filter:before,.tv-dialog-title .button-filter:after,.properties-tabs-label .button-filter:after{content:'';position:absolute;top:50%}.tv-dialog-title .button-filter:before,.properties-tabs-label .button-filter:before{left:0;margin-top:-5px;width:12px;height:10px;background-image:url(images/icons.png);background-position:-61px -462px}.tv-dialog-title .button-filter:after,.properties-tabs-label .button-filter:after{right:0;width:0;margin-top:-1px;height:0;border-color:#929393;border-width:3px;border-style:solid;border-bottom:none;border-left-color:transparent!important;border-right-color:transparent!important}.tv-dialog-title .button-filter:hover:before,.properties-tabs-label .button-filter:hover:before{background-position:-78px -462px}.tv-dialog-title .button-filter:hover:after,.properties-tabs-label .button-filter:hover:after{border-color:#666769}.tv-dialog-title .button-filter:active:before,.properties-tabs-label .button-filter:active:before,.tv-dialog-title .button-filter.active:before,.properties-tabs-label .button-filter.active:before{background-position:-95px -462px}.tv-dialog-title .button-filter:active:after,.properties-tabs-label .button-filter:active:after,.tv-dialog-title .button-filter.active:after,.properties-tabs-label .button-filter.active:after{border-color:#49b5d6}.properties-tabs-label .button-filter{visibility:hidden}.properties-tabs-label.active .button-filter{visibility:visible}.tv-dialog-tree-group.empty{display:none}.tv-dialog-content .tv-dialog-tree-head{border-top:1px solid #c9cbcd;content:"";cursor:default}.tv-dialog-content .symbol-info-dialog table{padding-top:8px;width:100%}.tv-dialog-content .symbol-info-dialog tr td{border-bottom:1px solid #eaeaea}.tv-dialog-content .symbol-info-dialog tr:hover{background-color:#edf0f3}.tv-dialog-content .symbol-info-dialog .symbol-info-column{color:#888989;font-size:small}.tv-dialog-content .symbol-info-dialog .symbol-info-value{color:#7c7c7c;text-align:right;font-weight:700;min-width:100px;font-size:small}.tv-dialog-content .tv-dialog-tree-item{display:block;color:#3e4040;padding:2px 0 0 21px;position:relative;border-bottom:1px solid #f4f7f9;height:34px;cursor:pointer}.tv-dialog-content .tv-dialog-tree-item .name{display:inline-block;margin-top:7px;vertical-align:top;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:250px}.tv-dialog-content .tv-dialog-tree-item .symbol{display:inline-block;margin-top:7px;vertical-align:top}.tv-dialog-content .tv-dialog-tree-item .tree-icon-container{position:absolute;right:15px;top:6px}.tv-dialog-content .tv-dialog-tree-item:hover{background:#f7f9fb}.tv-dialog-content .tv-dialog-tree-item:hover .tree-icon-container{display:inline-block}.tv-dialog-content .tv-dialog-tree-item.active .tree-icon-container{display:inline-block}.tv-dialog-content .tv-dialog-tree-item.hidden{color:#969898}.tv-dialog-content .tv-dialog-tree-item.hidden .button.icon-hide .icon{background-position:-14px 14px}.tv-dialog-content .tv-dialog-tree-item .button.icon-hide .icon{background-position:-14px -28px}.tv-dialog-content .tv-dialog-tree-item.locked .button.icon-lock .icon{background-position:-71px -14px}.tv-dialog-content .tv-dialog-tree-item .button.icon-lock .icon{background-position:-71px -28px}.tv-dialog-content .tv-dialog-tree-item.active{background:#f1f3f6}.tv-dialog-content .tv-dialog-tree-item.active .name{font-weight:700}.tv-dialog-content .tv-dialog-tree-item.last{border-bottom:none}.tv-dialog-content .tv-dialog-tree-item.last .button.down{display:none}.tv-dialog-content .tv-dialog-tree-item.first .button.up{visibility:hidden}.tv-dialog-content .tv-dialog-tree-item.objects .name-column{width:80%}.tv-dialog-content .tv-dialog-tree-item .name-column{width:55%;display:inline-block}.tv-dialog-content .tv-dialog-tree-item .instrument{display:inline-block;margin-left:6px}.tv-dialog-content .tv-dialog-tree-item .instrument.linetool{width:30px;height:30px;background:url(images/sidetoolbar/instruments.png) no-repeat}.tv-dialog-content .tv-dialog-tree-item .instrument.series{width:19px;height:19px;margin-top:5px;background:url(chart-client/css/images/bartype-icons.png) no-repeat}.tv-dialog-content .tv-dialog-tree-item .instrument.lineicon{font-weight:700;font-family:FontAwesome;padding-top:7px;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#777;font-size:19px}.tv-dialog-content .tv-dialog-tree-item.skipped{display:none}.tv-dialog-content .with-drawings .tv-dialog-tree-item{padding-left:25px}.tv-dialog-content .tv-dialog-tree-item.hidden .instrument{opacity:.6}.tv-dialog-content .tv-dialog-tree-item .button{display:inline-block;width:22px;height:22px;margin:0 0 0 3px;cursor:pointer;padding:1px 0 0 4px;opacity:.5;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-content .tv-dialog-tree-item .button:hover{opacity:1}.tv-dialog-content .tv-dialog-tree-item .button:hover:before{display:none!important}.tv-dialog-content .tv-dialog-tree-item .button.hidden{visibility:hidden}.tv-dialog-content .tv-dialog-tree-item.active .button{opacity:.7}.tv-dialog-content .tv-dialog-tree-item.active .button:hover{opacity:1}.tv-dialog-content .tv-dialog-tree-item .icon{background:url(images/dialogs/objects-tree.png);width:14px;height:14px;display:inline-block;margin-top:-1px}.feature-touch .tv-dialog-content .tv-dialog-tree-item .icon{-webkit-transform:scale(1.1);transform:scale(1.1)}.tv-dialog-tree-item .button.delete .icon{background-position:0 -28px}.tv-dialog-tree-item .button.delete:active .icon{background-position:0 14px}.tv-dialog-tree-item .button.up .icon{background-position:-42px -28px}.tv-dialog-tree-item .button.up:active .icon{background-position:-42px 14px}.tv-dialog-tree-item .button.down .icon{background-position:-28px -28px}.tv-dialog-tree-item .button.down:active .icon{background-position:-28px 14px}.tv-dialog-tree-item .button.format .icon{background-position:-56px -28px}.tv-dialog-tree-item .button.format:active .icon{background-position:-56px 14px}.tv-dialog-tree-item-list-header{height:24px;padding:3px 0 0 25px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.tv-dialog-tree-item-list-header .item{display:inline-block;font-size:11px}.tv-dialog-tree-item-list-header .item .label:hover,.tv-dialog-tree-item-list-header .item .label.active{color:#68696b}.tv-dialog-tree-item-list-header .item .label.active{font-weight:700}.tv-dialog-tree-item-list-header .item .label{cursor:pointer;color:#989797}.tv-dialog-tree-item-list-header .tool{width:55%}.main-tree-page{display:none}.main-tree-page.active{display:block}.main-tree-page.compare{padding:22px 28px}.tv-dialog-content .tv-dialog-small{font-size:11px}.tv-dialog-content .tv-dialog-medium{font-size:13px}.tv-dialog-content .tv-dialog-left{text-align:left}.tv-dialog-content .tv-dialog-center{text-align:center}.tv-dialog-content .tv-dialog-right{text-align:right}.tv-dialog-content .tv-dialog-float-right{float:right}.tv-dialog-content td.tv-dialog-vtop{vertical-align:top}.tv-dialog-content .tv-dialog-relative{position:relative}.tv-dialog-content .tv-dialog-field-error{display:none;font-size:11px;color:#c34c36;border-top:2px solid #fcc;border-right:2px solid #fcc;border-bottom:2px solid #fcc;background:#f8dde0;padding:6px 10px 6px;border-radius:0 3px 3px 0;width:144px;height:14px;float:right}.tv-dialog-error,.tv-dialog-message{display:none;position:absolute;top:10px;font-size:12px;z-index:100;border:1px solid;padding:10px;text-align:center}.tv-dialog-error{color:#c34c36;border-color:#fcc;background:#f8dde0;background:rgba(248,221,224,.8)}.tv-dialog-message{color:#0a8415;border-color:#cfffcc;background:#e2fde1;background:rgba(226,253,225,.8)}.tv-dialog-content .dialog-buttons{text-align:right;margin:10px 7px 0 7px}.tv-dialog-content .dialog-buttons a:not(.tv-dialogs-label-hint){margin:0 0 0 5px;min-width:50px;text-align:center;position:relative;left:7px}.tv-dialog-content .dialog-buttons a.tv-left{left:-7px}.tv-dialog-content .dialog-buttons a.tv-left:not(.tv-dialogs-label-hint){margin:0 5px 0 0}.tv-dialog-content .dialog-buttons a.tv-left.tv-left.tv-dialogs-label-hint{margin-left:0;margin-right:0}.tv-dialog-content .dialog-buttons .tv-dialogs-label-hint{margin-top:7px}.tv-dialog-content .publish-options{color:#595959;height:105px}.tv-dialog-content .publish-option{border:1px solid #d0d3d6;border-radius:4px;position:relative;float:left;padding:10px 10px 10px 32px;width:285px;height:70px;cursor:pointer}.tv-dialog-content .publish-option.active{background:#f9f9f9}.tv-dialog-content .publish-option:last-child{float:right}.tv-dialog-content .publish-option-header{font-weight:700}.tv-dialog-content .publish-option-text{font-size:11px}.publish-radiobutton{background-position:-100px -140px;width:16px;height:16px;position:absolute;top:11px;left:9px}.publish-option.active .publish-radiobutton{background-position:-120px -140px}.tv-dialog-content .dialog-theme-buttons .tv-button{float:left;margin-right:6px}.tv-dialog-content .dialog-trail-checkbox{float:left}.tv-dialog-socials{text-align:right}.tv-dialog-social{display:inline-block;margin:0 0 0 11px;vertical-align:top}.tv-dialog-social-fbshare{margin-top:1px}.publish-direction-buttons{height:33px;margin:0 1px;position:relative}.publish-direction-buttons .col-long,.publish-direction-buttons .col-neutral,.publish-direction-buttons .col-short{height:33px;margin:0 -1px;padding:0 1px}.publish-direction-buttons .col-long{width:33.3%;float:left}.publish-direction-buttons .col-long .tv-button:active,.publish-direction-buttons .col-long .tv-button.active{background:#71db1b;border-color:#66a51c}.publish-direction-buttons .col-neutral{margin:0 33.3%}.publish-direction-buttons .col-neutral .tv-button:active,.publish-direction-buttons .col-neutral .tv-button.active{background:#f0cc00;border-color:#e0a300}.publish-direction-buttons .col-short{width:33.3%;float:right}.publish-direction-buttons .col-short .tv-button:active,.publish-direction-buttons .col-short .tv-button.active{background:#ff6c4a;border-color:#cb401f}.publish-direction-buttons .tv-button{display:block;margin:0 -1px;line-height:31px;height:31px;width:100%;padding:0;text-align:center;background:#fff;text-shadow:0 1px 0 rgba(255,255,255,.4);font-size:14px;border-radius:0}.publish-direction-buttons .tv-button:hover{background:#fff}.publish-direction-buttons .tv-button:active,.publish-direction-buttons .tv-button.active{background:#fff;color:#444!important;box-shadow:none;position:relative}.survey-dialog{box-shadow:0 2px 20px rgba(0,0,0,.4);border-radius:7px;font-size:14px}.survey-dialog .main{padding:20px 25px 15px}.survey-dialog h3{text-align:center;margin:10px 0}.survey-button-container{margin:15px 0 5px!important;text-align:center;position:relative}.survey-dialog .survey-button{font-size:19px;font-weight:700;display:inline-block;border-radius:5px;background:#4387f6;border:1px solid #346bc2;color:#fff;text-align:center;padding:10px 50px}.survey-dialog .survey-button:hover{background:#4d8cf3}.survey-dialog #no-button{position:absolute;top:6px;right:20px;padding:7px 15px;font-size:14px;font-weight:400;border-color:#474549;background:#716e73}.survey-dialog #no-button:hover{background:#767278}.tv-dialog.gopro-dialog .tv-dialog-content{padding:0;position:relative;background:#f2f5f8;width:814px;color:#3b414d;font-size:16px;line-height:28px}.gopro-dialog .col-main{float:left;width:447px;padding:0 22px 0 27px;margin:0 0 85px 0}.gopro-dialog h2{font-weight:400;font-size:26px;line-height:32px;margin:24px 0 10px;color:#26282f}.gopro-dialog .col-main h2{text-transform:uppercase}.gopro-dialog h2 em{font-style:normal;color:#da4739;text-transform:uppercase}.gopro-dialog .col-main p{margin:15px 0}.gopro-dialog .col-main .actions-block{position:absolute;height:47px;width:447px;left:27px;bottom:24px}.gopro-dialog .col-main .actions-block .no-button{position:absolute;color:#1380b7;left:0;top:8px;cursor:pointer}.gopro-dialog .col-main .actions-block .yes-button{position:absolute;top:0;right:0;font-size:16px;line-height:19px;height:19px;white-space:nowrap;padding:14px 22px;background:#63b68a;color:#fff;text-transform:uppercase;cursor:pointer}.gopro-dialog .actions-block .yes-button:hover{background:#70be95}.gopro-dialog .actions-block .yes-button .arrow-icon{display:inline-block;vertical-align:top;margin:6px -4px 0 21px;width:33px;height:7px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAHCAYAAACGESREAAAAPklEQVR4AWOgN/j///80IGZlGEjwHwL2AbHwwDkCAe4AsRZEcOAB10CGxC0gVhvI6NgNxIIDmSamAjELshgAEhnDI93qERIAAAAASUVORK5CYII=) 0 0 no-repeat}.gopro-dialog .col-main .actions-block .reconnect-button{position:absolute;top:0;left:0;font-size:16px;line-height:19px;height:19px;white-space:nowrap;padding:14px 22px;background:#31bce8;color:#fff;text-transform:uppercase;cursor:pointer}.gopro-dialog .col-main .actions-block .reconnect-button:hover{background:#50c0e4}.gopro-dialog .col-main .actions-block .reconnect-button.process{background-image:url(images/button-base-process.gif)}.gopro-dialog .col-aside{float:left;width:318px;margin:0 0 168px 0}.gopro-dialog .col-aside .col-bg{position:absolute;width:318px;top:0;bottom:0;right:0;background:#eaeff4 url(images/gopro/dialog-bg.png) 0 100% no-repeat}.gopro-dialog .col-aside .col-copy{position:relative;margin:0 10px 0 28px}.gopro-dialog .col-aside ul{display:block;margin:19px 0 15px 0;padding:0}.gopro-dialog .col-aside li{display:block;margin:0;padding:0 0 0 21px;line-height:20px;margin:10px 0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAALklEQVR4AWMAgZgdHROB+C0UT0QSbP8PpMEYxAZLQlX9j4VgmIK3OCVwGoXTcgAth09hyVizGQAAAABJRU5ErkJggg==) 3px 7px no-repeat}.go-prorealtime{width:500px}.go-prorealtime .main-properties{padding:5px 0}.go-prorealtime .dialog-buttons{margin:0}.go-prorealtime .dialog-buttons a{margin:0;position:static}.go-prorealtime p:nth-child(1){font-weight:700}.tv-dialog .ui-resizable-handle{width:11px;height:11px;background:url(images/dialogs/resize-handle.png) 0 0 no-repeat}.main.billing-cycle-dialog{padding:0 28px}.bcd-title{font-weight:400;font-size:26px;line-height:32px;margin:24px 0 20px;color:#26282f;text-transform:uppercase}.bcd-subtitle{font-weight:400;font-size:14px;margin:0 0 10px;color:#26282f}.bcd-title.right{width:48%;padding-left:2%}.bcd-choice-container{position:relative;overflow:hidden;background:#e1e7ef}.bcd-choice{position:relative;width:196px;float:left;cursor:pointer;-webkit-tap-highlight-color:transparent}.bcd-choice.active{cursor:default}.bcd-choice.disabled{cursor:default}.bcd-choice-bg{position:absolute;top:0;left:0;width:100%;height:400px}.bcd-choice-marker{position:absolute;top:25px;left:11px;width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAwCAYAAAAYX/pXAAAARUlEQVR4AWM4fOL8f0ow9QxgIBEMNwNGDRg1YOBzY8yOjv8UYOoZQHIgDkcDRg0YNYAcPOgNGC0PcPmXtgaMGjBaHlCCAe5lHJmu4YfrAAAAAElFTkSuQmCC) 0 0 no-repeat}.bcd-choice:hover .bcd-choice-marker{background-position:0 -16px}.bcd-choice.active .bcd-choice-marker{background-position:0 -32px}.bcd-choice.disabled .bcd-choice-marker{background-position:0 0}.bcd-choice-copy{position:relative;padding:5px 3px 30px 44px;font-size:14px;line-height:17px;color:#3b414e}.bcd-choice-copy p{margin:7px 0}.bcd-choice-copy h5{margin:17px 0;color:#4a4d54;font-weight:700;text-transform:uppercase;font-size:18px;line-height:24px}.bcd-choice.disabled .bcd-choice-copy,.bcd-choice.disabled .bcd-choice-copy h5{color:#c3c8cf}.bcd-continue{margin:31px 0 29px 0;overflow:hidden;text-align:right}.bcd-continue a{cursor:pointer;display:inline-block;vertical-align:top;border:0;padding:15px 45px;font-size:14px;line-height:17px;line-height:normal;text-align:center;font-weight:700;text-transform:uppercase;background:#1fb2cc;color:#fff}.bcd-continue a:hover{background:#1eb9d2}.prorttrial-dialog,.trialconfirm-dialog{font:400 16px Arial,Helvetica,Tahoma,sans-serif;border:none;border-radius:0;box-shadow:none}.prorttrial-dialog .main,.trialconfirm-dialog .main{width:600px;padding:10px 28px 20px 28px}.prorttrial-dialog h3,.trialconfirm-dialog h3{font-size:26px;font-weight:400;text-transform:uppercase;color:#26282f;margin:14px 0 20px 0}.prorttrial-dialog p,.trialconfirm-dialog p,.prorttrial-dialog li,.trialconfirm-dialog li{font-size:16px;line-height:28px;margin:0}.prorttrial-dialog p,.trialconfirm-dialog p,.prorttrial-dialog ul,.trialconfirm-dialog ul{margin:12px 0}.prorttrial-dialog .big-button,.trialconfirm-dialog .big-button{display:block;width:262px;float:right;background:#dbe1ea;color:#666c7d;text-transform:uppercase;text-align:center;font-size:14px;line-height:21px;padding:13px 0;text-decoration:none}.prorttrial-dialog .big-button:hover,.trialconfirm-dialog .big-button:hover{background:#e2e7ee}.prorttrial-dialog .big-button.ok,.trialconfirm-dialog .big-button.ok{width:183px;padding-left:20px;padding-right:20px}.prorttrial-dialog .big-button.ok,.trialconfirm-dialog .big-button.ok,.prorttrial-dialog .big-button.trial,.trialconfirm-dialog .big-button.trial{background:#05b2ce;color:#fff}.prorttrial-dialog .big-button.ok:hover,.trialconfirm-dialog .big-button.ok:hover,.prorttrial-dialog .big-button.trial:hover,.trialconfirm-dialog .big-button.trial:hover{background:#37c1d7}.prorttrial-dialog .big-button.ordernow,.trialconfirm-dialog .big-button.ordernow{background:#60b789;color:#fff}.prorttrial-dialog .big-button.ordernow:hover,.trialconfirm-dialog .big-button.ordernow:hover{background:#7fc5a0}.prorttrial-dialog .big-buttons,.trialconfirm-dialog .big-buttons{margin:22px 0 0 0;overflow:hidden}.prorttrial-dialog .big-buttons.two-buttons .big-button.later,.trialconfirm-dialog .big-buttons.two-buttons .big-button.later,.prorttrial-dialog .big-buttons.two-buttons .big-button.nothanks,.trialconfirm-dialog .big-buttons.two-buttons .big-button.nothanks{margin:0;float:left;width:183px}.prorttrial-dialog .big-buttons.two-buttons .big-button.trial,.trialconfirm-dialog .big-buttons.two-buttons .big-button.trial{margin:0;float:right;width:272px}.prorttrial-dialog .nothanks,.trialconfirm-dialog .nothanks{float:left;font-size:16px;color:#007fb9;text-decoration:underline;padding:13px 0}.prorttrial-dialog .actions-block,.trialconfirm-dialog .actions-block{position:relative;margin:30px 0 0;height:47px}.prorttrial-dialog .actions-block .no-button,.trialconfirm-dialog .actions-block .no-button{position:absolute;color:#1380b7;left:0;top:12px;cursor:pointer}.prorttrial-dialog .actions-block .yes-button,.trialconfirm-dialog .actions-block .yes-button{position:absolute;top:0;right:0;font-size:16px;line-height:19px;height:19px;white-space:nowrap;padding:14px 22px;background:#63b68a;color:#fff;text-transform:uppercase;cursor:pointer}.prorttrial-dialog .actions-block .yes-button:hover,.trialconfirm-dialog .actions-block .yes-button:hover{background:#70be95}.tv-dialog-layoutpicker.hidden{display:none}.tv-dialog-cancel-button,.tv-dialog-layout-button{display:inline-block;font-weight:700;font-size:12px;height:16px;margin-right:5px;padding:6px 10px 5px;color:#6f7073;cursor:default;border:1px solid #c9cbcd}.tv-dialog-layout-button .arrow-icon{float:right;margin:5px 0 0 5px;background:url(images/select-bg.png) 0 0 no-repeat;height:5px;width:9px}.tv-dialog-layout-button.open .arrow-icon{background-position:0 -20px}.tv-dialog-layout-button .icon,.tv-dialog-layout-popup .icon{background:url(images/bottomtoolbar/layout-buttons.png) -6px -3px no-repeat;width:17px;height:17px}.tv-dialog-layout-button .icon{float:left;margin:-1px 4px 0 -4px}.charts-popup-list .item.tv-dialog-layout-popup .icon{width:17px;height:17px}.tv-dialog-layout-2h .icon{background-position:-35px -3px}.tv-dialog-layout-2v .icon{background-position:-64px -3px}.tv-dialog-layout-3h .icon{background-position:-93px -3px}.tv-dialog-layout-3v .icon{background-position:-122px -3px}.tv-dialog-layout-3s .icon{background-position:-151px -3px}.tv-dialog-layout-4 .icon{background-position:-180px -3px}.tv-dialog-layout-6 .icon{background-position:-209px -3px}.tv-dialog-layout-8 .icon{background-position:-238px -3px}.tv-dialog-layout-s.active .icon{background-position:-6px -26px}.tv-dialog-layout-2h.active .icon{background-position:-35px -26px}.tv-dialog-layout-2v.active .icon{background-position:-64px -26px}.tv-dialog-layout-3h.active .icon{background-position:-93px -26px}.tv-dialog-layout-3v.active .icon{background-position:-122px -26px}.tv-dialog-layout-3s.active .icon{background-position:-151px -26px}.tv-dialog-layout-4.active .icon{background-position:-180px -26px}.tv-dialog-layout-6.active .icon{background-position:-209px -26px}.tv-dialog-layout-8.active .icon{background-position:-238px -26px}.tv-dialog-cancel-button{border-color:transparent;text-transform:uppercase}.tv-dialog-cancel-button:hover{border-color:#c9cbcd}.publish-dialog-privacy{display:block;padding:7px 5px 8px 5px;background:#25c6e0}.publish-dialog-privacy input{display:none}.publish-dialog-privacy .publish-dialog-privacy-icon{display:block;width:19px;height:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2122px}.publish-dialog-privacy input:checked+.publish-dialog-privacy-icon{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2146px}.publish-dialog-privacy input:active+.publish-dialog-privacy-icon,.publish-dialog-privacy:active .publish-dialog-privacy-icon{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2098px}#publish-chart-form .publish-text input,#publish-chart-form .publish-text textarea{margin:0;display:block}#publish-chart-form .bbcode-buttons{position:relative}#publish-chart-form .bbcode-button{position:relative;z-index:1;float:left;height:29px;width:40px;margin:0 -1px 0 0;border:1px solid #c9cbcd;border-bottom:none;cursor:default}#publish-chart-form .bbcode-button svg{display:block;margin:0 auto;fill:#8e9092}#publish-chart-form .bbcode-button:hover,#publish-chart-form .bbcode-button.active,#publish-chart-form .bbcode-button:active{background:#f2f5f8;border-color:#b5b7b9;z-index:2}#publish-chart-form .bbcode-button:hover svg,#publish-chart-form .bbcode-button.active svg,#publish-chart-form .bbcode-button:active svg{fill:#444}#publish-chart-form .bbcode-button.active svg,#publish-chart-form .bbcode-button:active svg{fill:#5ec6e8}#publish-chart-form .bbcode-embed-block{position:relative;overflow:hidden;float:left}#publish-chart-form .bbcode-embed-block .bbcode-embed-form{transition:top .2s;position:relative;padding:2px 4px 0 4px;top:-30px;left:0}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed{float:left;height:25px;width:250px;margin:0 2px 0 0}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed:focus{border-color:#4c82ce}#publish-chart-form .bbcode-embed-block .bbcode-embed-form .embed-submit{float:left}#publish-chart-form .bbcode-embed-block .bbcode-embed-form.active{top:0}.tv-dialog.change-interval-dialog .tv-dialog-title{text-align:center;font-size:13px;padding:28px 0 23px}.tv-dialog.change-interval-dialog .tv-dialog-content{padding:0 50px 13px;text-align:center}.tv-dialog.change-interval-dialog .tv-dialog-content .change-interval-input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:130px;height:76px;border:#4c82ce 1px solid;text-align:inherit;font-size:43px;color:#545454;text-transform:uppercase}.tv-dialog.change-interval-dialog .tv-dialog-content .change-interval-input.error{border-color:#d75442;background-color:#ffefef}.tv-dialog.change-interval-dialog .tv-dialog-content i{display:block;font-style:normal}.tv-dialog.change-interval-dialog .tv-dialog-content i.interval-caption{margin:8px 0 15px;color:#a8a8a8;font-size:12px;font-weight:600;cursor:default}.tv-dialog.change-interval-dialog .tv-dialog-content i.interval-caption.error{color:#d75442}.tv-dialog.change-interval-dialog .tv-dialog-content i.help-tooltip-trigger{margin:0 auto;width:12px;height:12px;font-size:11px;font-weight:700;line-height:12px;border:rgba(0,0,0,.5) 1px solid;-webkit-border-radius:50%;-webkit-background-clip:padding-box;-moz-border-radius:50%;-moz-background-clip:padding;border-radius:50%;background-clip:padding-box;cursor:default}.tv-dialog.session-lock-dialog .yes-button{text-align:center;width:210px}.tv-dialog.session-lock-dialog .reconnect-button{text-align:center;width:125px}.tv-dialog.invalid-file-dialog{width:450px}.tv-dialog-colomn-table{border-spacing:0;border:none}.tv-dialog-colomn-table>thead>tr>td,.tv-dialog-colomn-table>tbody>tr>td,.tv-dialog-colomn-table>tr>td{padding:0;border:0;text-align:left;vertical-align:top}.tv-dialog.ban-user-dialog .tv-dialog-content{min-width:400px;max-width:600px}.tv-dialog.ban-user-dialog .tv-dialog-content p{margin:0;padding:0 20px 15px}.tv-dialog.ban-user-dialog .tv-dialog-content p.nb{background-color:#fae0de;padding-top:15px;margin-bottom:15px;color:#000;font-weight:600;font-size:14px}.tv-dialog.ban-user-dialog .tv-dialog-content div{padding:5px 20px}.tv-dialog.ban-user-dialog .tv-dialog-content select{float:right}.tv-dialog.bug-report-dialog .tv-dialog-content{min-width:400px;max-width:600px}.tv-dialog.bug-report-dialog .tv-dialog-content p{margin:0;padding:0 20px 15px}.tv-dialog.bug-report-dialog .tv-dialog-content p.nb{background-color:#fae0de;padding-top:15px;margin-bottom:15px;color:#000;font-weight:600;font-size:14px}.tv-dialog.bug-report-dialog .tv-dialog-content p.ban-dialog-description{padding-bottom:0}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info{padding:5px 20px;color:#000;line-height:28px;white-space:nowrap}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info a{margin-left:10px;font-weight:700;text-transform:uppercase}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info a[href='#yes']{color:#59c18b}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info a[href='#yes']:hover{color:#7ecfa5}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info a[href='#no']{color:#eb847b}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info a[href='#no']:hover{color:#f2ada7}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info.editing a[href='#yes']{display:inline-block;width:60px;background-color:#06b2ce;color:#fff;text-align:center;cursor:default}.tv-dialog.bug-report-dialog .tv-dialog-content .browser-info.editing a[href='#yes']:hover{background-color:#06bfdd}.tv-dialog.bug-report-dialog .tv-dialog-content form{margin-top:10px}.tv-dialog.bug-report-dialog .tv-dialog-content table{border-spacing:0;border-collapse:collapse;width:100%}.tv-dialog.bug-report-dialog .tv-dialog-content table td{padding:5px 20px;vertical-align:top}.tv-dialog.bug-report-dialog .tv-dialog-content table td:first-child{width:20%}.tv-dialog.bug-report-dialog .tv-dialog-content table td.full-row{width:100%}.tv-dialog.bug-report-dialog .tv-dialog-content table td.full-row label{line-height:normal;white-space:normal}.tv-dialog.bug-report-dialog .tv-dialog-content table td .alert-input-container{display:inline-block}.tv-dialog.bug-report-dialog .tv-dialog-content table td .alert-input-container .tv-select-container{max-width:250px;margin-left:10px}.tv-dialog.bug-report-dialog .tv-dialog-content table td .alert-input-container .tv-select-container .sbSelector{overflow:hidden;text-overflow:ellipsis}.tv-dialog.bug-report-dialog .tv-dialog-content table td .alert-input-container .loading-indicator-small{display:inline-block;width:150px;vertical-align:middle}.tv-dialog.bug-report-dialog .tv-dialog-content table td .alert-input-message{display:none}.tv-dialog.bug-report-dialog .tv-dialog-content table td label{white-space:nowrap;line-height:27px}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container{max-width:100%;background-color:#fff}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container .sbSelector{white-space:nowrap}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.placeholder .sbSelector{color:#aeabab}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.error .sbSelector{color:#e06571}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container li>.sbDisabled{display:none}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.critical-last-option ul li:last-child{background-color:red}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.critical-last-option ul li:last-child a:link{color:#fff}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.critical-last-option ul li:last-child a:hover{background-color:#c00}.tv-dialog.bug-report-dialog .tv-dialog-content table td textarea{display:block;padding:4px 5px;width:100%;height:80px}.tv-dialog.bug-report-dialog .tv-dialog-content table td .tv-select-container.error,.tv-dialog.bug-report-dialog .tv-dialog-content table td textarea.error{border:1px solid #de5764;background:#f7e4e6;color:#e06571}.tv-dialog.bug-report-dialog .tv-dialog-content table td input[type=text]{margin:0;height:27px}.tv-dialog.bug-report-dialog .tv-dialog-content table td input[type=text].error{border-width:1px}.tv-dialog.bug-report-dialog .tv-dialog-content table td.buttons{padding:30px 20px 20px;text-align:right}.tv-dialog.bug-report-dialog .tv-dialog-content table td.buttons input{width:60px;margin-left:15px;text-transform:uppercase}.tv-dialog.bug-report-dialog .tv-dialog-content table td.buttons input.loading{background:transparent url(images/bar-loader.gif)}.tv-dialog.bug-report-dialog .tv-dialog-content table td.note{padding-top:15px;text-align:right;padding-bottom:0;color:#999}.tv-dialog.bug-report-dialog .tv-dialog-content.readonly .tv-select-container{pointer-events:none}.charts-popup-list{overflow-y:auto;display:none;right:7px;top:46px;z-index:50;position:absolute;border:1px solid #aaadb1;background:#fff;z-index:120;margin:0}.charts-popup-list .icon-white-arrow-up{position:absolute;top:-9px;right:53px}.charts-popup-list .item.special{background:rgba(248,248,248,.9)}.charts-popup-list .item:hover,.charts-popup-list .item.active{background:#f4f7f9}.charts-popup-list .item.first{border-top-left-radius:3px;border-top-right-radius:3px}.charts-popup-list .item:last-child{border-bottom-left-radius:3px}.charts-popup-list .item span{color:#595959;display:inline-block}.charts-popup-list .item.active{background:#f4f7f9}.charts-popup-list .item{display:block;padding:7px 30px 7px 7px;height:16px;position:relative}.charts-popup-list .item.setting-hidden{padding-left:28px;margin-right:16px}.charts-popup-list .item.setting-hidden>span.title-expanded{width:auto}.charts-popup-list .item.setting-hidden.checked{padding-left:2px}.charts-popup-list .item.setting-hidden.checked>span.title-expanded:before{margin:0 3px 0 7px;height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1139px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;content:" "}.charts-popup-list .item.button-new,.charts-popup-list .item.button-load{overflow:hidden;text-align:center;border:solid #aaadb1;border-width:1px 0 0 0;padding-left:0;padding-right:0}.charts-popup-list .item.button-new .title-expanded,.charts-popup-list .item.button-load .title-expanded{width:auto}.charts-popup-list .item.button-new{width:50%;float:left;border-width:1px 1px 0 0}.charts-popup-list .item:last-child{border-bottom-left-radius:3px}.charts-popup-list .item.special.disabled{cursor:default}.charts-popup-list .item.special.disabled span{color:#9d9d9d}.charts-popup-list .item.special.disabled:hover{background:rgba(248,248,248,.9)}.charts-popup-list .item .title{width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.charts-popup-list .item .title-expanded{width:225px;max-width:100%;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.charts-popup-list .item.active-item-backlight{background-color:#f4f7f9;border-radius:0}.charts-popup-list .item .date{width:65px;padding-right:20px;vertical-align:top;white-space:nowrap;float:right}.charts-popup-list .separator{display:block;margin:0;height:0;overflow:hidden;border-top:1px solid #c9cbcd}.charts-popup-list .charts-popup-tab-headers{overflow:hidden;padding:8px 0 8px 0;font-size:14px}.charts-popup-list .charts-popup-tab-header{float:left;margin:0 10px 5px 10px}.charts-popup-list .charts-popup-tab-header-label{padding:0;font-weight:700;border-bottom:dashed 1px;cursor:pointer}.charts-popup-list .charts-popup-tab-header.active .charts-popup-tab-header-label{color:#595959;border-bottom:none;cursor:default}.charts-popup-list .item.item-twobuttons{padding-right:52px}.charts-popup-list .item.item-twobuttons .title-expanded{width:203px}.charts-popup-list .item.with-indent{padding-left:28px}.charts-popup-list .item .icon-delete{background:url(images/icons.png) no-repeat scroll -102px -362px transparent;width:14px;height:14px;position:absolute;top:9px;right:7px}.charts-popup-list .item .icon-delete:hover{background-position:-81px -362px}.charts-popup-list .item .icon-delete{visibility:hidden}.is-mobile .charts-popup-list .item .icon-delete{visibility:visible;opacity:.3}.is-mobile .charts-popup-list .item .icon-delete:hover{opacity:1}.charts-popup-list .item:hover .icon-delete{visibility:visible}.charts-popup-list .item .icon-save{background:url(images/icons.png) -120px -280px;width:14px;height:14px;position:absolute;top:9px;right:23px}.charts-popup-list .item .icon-save:hover{background-position:-100px -280px}.charts-popup-list .item .icon-save{visibility:hidden}.charts-popup-list .item:hover .icon-save{visibility:visible}.charts-popup-list .item .icon{display:inline-block;width:16px;height:16px;margin:0 5px 0 0;vertical-align:top}.charts-popup-list.iconed .item{height:32px;padding:3px 2px;line-height:34px}.charts-popup-list.iconed .item{white-space:nowrap;position:relative;overflow:hidden}.charts-popup-list.iconed .item .title{padding-right:20px}.charts-popup-list.iconed .item .icon{width:32px;height:32px;margin:0 5px}.charts-popup-list.iconed.thin .title{width:50px}.charts-popup-list.narrow{width:155px}.charts-popup-list.narrow .item .title-expanded{width:112px}.charts-popup-list.narrow.with-scroll .item .title-expanded{width:100px}.charts-popup-list.thin{width:110px}.charts-popup-list.thin .item .title-expanded{width:67px}.charts-popup-list .item .counter{position:absolute;top:8px;right:6px;color:#b8b8b8}.charts-popup-list .item:hover .counter{color:#595959}.charts-popup-list .item .counter.blue{background:#4e8ff6;color:#fff;padding:2px 3px;border-radius:2px;top:5px}.charts-popup-list .item.grayed span{opacity:.3}.charts-popup-list.small-font{font-size:12px}.charts-popup-list.small-font .item{height:12px}.charts-popup-list.intervals-list{right:auto;width:auto;max-height:100%;overflow-y:auto}.charts-popup-list.intervals-list .item{cursor:pointer;padding:7px;min-width:180px;color:#595959}.charts-popup-list.intervals-list .item.quicked svg{fill:#ffc200!important}.charts-popup-itemheader{padding:3px 8px 4px 8px;border-top:1px solid #dbdbdb;cursor:pointer;color:#595959;background:rgba(204,204,204,.2)}.charts-popup-group-collapsible.collapsed .item{display:none}.charts-popup-group-collapsible .charts-popup-itemheader-icon{display:inline-block;vertical-align:middle;position:relative;top:-1px;width:11px;height:11px;margin:0 5px 0 -3px;background:url(images/icons.png) -180px -280px no-repeat}.charts-popup-group-collapsible.collapsed .charts-popup-itemheader-icon{background-position:-160px -280px}.favored-list .to-quick{position:absolute;display:block;width:16px;height:16px;background-position:-80px -100px;top:7px;right:7px;visibility:hidden}.favored-list .to-quick svg{float:left;fill:#9d9d9d!important}.favored-list .to-quick:hover svg{fill:#7d7d7d!important}.favored-list .to-quick.quicked svg{fill:#ffc200!important}.favored-list .delete{position:absolute;display:block;width:16px;height:16px;background:url(images/icons.png) -102px -362px;top:6px;right:30px;visibility:hidden}.favored-list .item:hover .delete{visibility:visible}.favored-list .item:hover .delete:hover{background-position:-81px -362px}.is-mobile .favored-list .delete{visibility:visible;opacity:.3}.is-mobile .favored-list .delete:hover{background-position:-81px -362px;opacity:1}.favored-list .item:hover .to-quick,.intervals-list .item:hover .delete,.intervals-list.touch .delete,.feature-touch .favored-list .to-quick{visibility:visible}.favored-list .item .to-quick{background-position:-40px -280px}.favored-list .item .to-quick:hover{background-position:-120px -363px}.favored-list .item.quicked .to-quick,.favored-list .item .to-quick.quicked{background-position:-20px -280px;visibility:visible}.favored-list .item.disabled{color:#c4c4c4}.intervals-list .item-add{min-width:230px}.intervals-list .item-add-wrap{overflow:hidden;white-space:nowrap}.intervals-list .item-add>span{margin:5px;display:block;overflow-x:hidden}.intervals-list input[type=text]{width:45px;height:25px}.intervals-list .mins,.intervals-list .add{text-transform:uppercase;margin-left:5px;height:14px}.intervals-list .mins{width:75px;position:relative;text-align:left}.intervals-list .add{width:45px;text-align:center}.intervals-list .mins i{background:url(images/select-bg.png) 0 0;display:block;width:9px;height:5px;position:absolute;right:7px;top:11px}.drawings-popup-list.favored-list .to-quick{top:11px}.drawings-popup-list.favored-list .item .title{padding-right:28px}.drawings-popup-list.favored-list.popup-with-scroll .title{padding-right:40px}/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */.fancybox-wrap,.fancybox-skin,.fancybox-outer,.fancybox-inner,.fancybox-image,.fancybox-wrap iframe,.fancybox-wrap object,.fancybox-nav,.fancybox-nav span,.fancybox-tmp{padding:0;margin:0;border:0;outline:0;vertical-align:top}.fancybox-wrap{position:absolute;top:0;left:0;z-index:17;cursor:default}.fancybox-skin{position:relative;background:#f9f9f9;color:#444;text-shadow:none}.fancybox-opened{z-index:18}.fancybox-outer,.fancybox-inner{position:relative}.fancybox-inner{overflow:hidden}.fancybox-type-iframe .fancybox-inner{-webkit-overflow-scrolling:touch}.fancybox-error{color:#444;font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;margin:0;padding:15px;white-space:nowrap}.fancybox-image,.fancybox-iframe{display:block;width:100%;height:100%}.fancybox-image{max-width:100%;max-height:100%}#fancybox-loading,.fancybox-prev span,.fancybox-next span{background-image:url(css/fancybox/fancybox_sprite.png)}#fancybox-loading{position:fixed;top:50%;left:50%;margin-top:-22px;margin-left:-22px;background-position:0 -108px;opacity:.8;cursor:pointer;z-index:1104}#fancybox-loading div{width:44px;height:44px;background:url(css/fancybox/fancybox_loading.gif) center center no-repeat}.fancybox-close-outer{position:absolute;top:0;right:0}.fancybox-close{position:absolute;right:0;display:block;top:0;width:36px;height:36px;cursor:pointer;z-index:40;margin-right:-36px;opacity:.8}.fancybox-close:hover{opacity:1}.fancybox-close:before{content:" ";height:12px;width:12px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1091px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-6px;margin-top:-6px}.fancybox-close-outer .fancybox-close{position:fixed;right:auto;top:20px}.fancybox-nav{position:absolute;top:0;width:40%;height:100%;cursor:pointer;text-decoration:none;background:transparent url(css/fancybox/blank.gif);-webkit-tap-highlight-color:transparent;z-index:40}.fancybox-prev{left:0}.fancybox-next{right:0}.fancybox-nav span{position:absolute;top:50%;width:36px;height:34px;margin-top:-18px;cursor:pointer;z-index:40;visibility:hidden}.fancybox-prev span{left:10px;background-position:0 -36px}.fancybox-next span{right:10px;background-position:0 -72px}.fancybox-nav:hover span{visibility:visible}.fancybox-tmp{position:absolute;top:-99999px;left:-99999px;visibility:hidden;max-width:99999px;max-height:99999px;overflow:visible!important}.fancybox-lock{overflow:hidden;width:auto}.fancybox-overlay{position:absolute;top:0;left:0;overflow:hidden;display:none;z-index:1104;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NzA2QzgxNjNDMEY0MTFFNDk1RTZGNzBENTU3RDMyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NzA2QzgxNjRDMEY0MTFFNDk1RTZGNzBENTU3RDMyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3MDZDODE2MUMwRjQxMUU0OTVFNkY3MEQ1NTdEMzI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3MDZDODE2MkMwRjQxMUU0OTVFNkY3MEQ1NTdEMzI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PvnoHEgAAAAPSURBVHjaYhDg4dkAEGAAATEA2alCfCIAAAAASUVORK5CYII=);cursor:pointer}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-mobile{z-index:1105}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.fancybox-title{visibility:hidden;font:400 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;position:relative;text-shadow:none;z-index:50}.fancybox-opened .fancybox-title{visibility:visible}.fancybox-title-float-wrap{position:absolute;bottom:0;right:50%;margin-bottom:-35px;z-index:50;text-align:center}.fancybox-title-float-wrap .child{display:inline-block;margin-right:-100%;padding:2px 20px;background:0 0;background:rgba(0,0,0,.8);-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;text-shadow:0 1px 2px #222;color:#fff;font-weight:700;line-height:24px;white-space:nowrap}.fancybox-title-outside-wrap{position:relative;margin-top:10px;color:#fff}.fancybox-title-inside-wrap{padding-top:10px}.fancybox-title-over-wrap{position:absolute;bottom:0;left:0;color:#fff;padding:10px;background:#000;background:rgba(0,0,0,.8)}a.fancy-box-arrow{display:block;position:fixed;z-index:39;top:0;height:100%;width:40px;color:#fff;font-size:50px;line-height:50px;text-align:center}a.fancy-box-arrow:hover{background:rgba(0,0,0,.3);background:rgba(0,0,0,.2)}.fancy-box-arrow.left{left:0}.fancy-box-arrow.right{right:15px}.fancy-box-arrow span{text-indent:-10000px;height:44px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2858px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-8px;margin-top:-22px}.fancy-box-arrow.right span{height:44px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2912px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-8px;margin-top:-22px}.mobile-safari .fancybox-wrap,.mobile-safari .fancybox-skin{-webkit-transform:translate3d(0,0,0)}.mobile-safari .fancybox-close{position:absolute;top:0}.header-menu-wrap{height:58px}.header-menu.header-logo{height:32px;margin:13px 5px 0 0}.header-menu.header-logo ul{width:192px}.header-menu.header-logo ul li a{position:relative}.header-menu.header-logo ul li a[target='_blank']:after{content:" ";display:inline-block;margin-left:10px;width:10px;height:10px;background-image:url(images/external-link/ext-bright.png);background-repeat:no-repeat}.is-not-authenticated .index-page .header-menu.header-logo ul li a[target='_blank']:after{background-image:url(images/external-link/ext-blue.png)}.header-menu.header-logo ul li a:hover[target='_blank']:after{background-position:0 -10px}.is-not-authenticated .index-page .header-menu.header-logo ul li a:hover[target='_blank']:after{background-position:0 0}.header-menu.header-logo>a{display:block;height:32px;padding-left:40px;padding-right:21px;margin-left:10px;background-image:url(images/logo.png);background-position:0 4px;background-repeat:no-repeat;font-size:14px;line-height:32px}.is-not-authenticated .index-page .header-menu.header-logo>a{background-image:url(images/logo-white.png);background-position:0 0}.is-not-authenticated .index-page .header-menu.header-logo.open>a{background-position:0 -32px}.header-button{display:block;height:32px;margin-top:13px;padding:0 15px;color:#dbdfeb;line-height:32px;text-decoration:none}.is-not-authenticated .header-button{font-size:13px;text-transform:uppercase}.header-button.with-icon:before{content:" ";position:relative;top:-2px;margin-right:10px}.header-button.with-icon.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1286px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1689px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1443px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1366px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;top:-2px;left:1px}.header-button.with-icon.active.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1234px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1633px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1393px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon.active.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1312px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.how-it-works:before{height:16px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1260px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.features:before{height:18px;width:19px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1661px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.chart:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1418px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover.tradingview-for-the-web:before{height:17px;width:13px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1339px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.is-not-authenticated .index-page .language-picker{background-color:transparent;border:1px solid transparent}.is-not-authenticated .index-page .language-picker .dropdown{background:rgba(255,255,255,.95);border:1px solid #000}.is-not-authenticated .index-page .language-picker .dropdown a{color:#333}.is-not-authenticated .index-page .language-picker .dropdown a.selected{background-color:#33353b;color:#fff}.is-not-authenticated .index-page .language-picker .dropdown a:hover{color:#02a3c3}.is-not-authenticated .index-page .language-picker.open{color:rgba(255,255,255,.8)}.is-not-authenticated .index-page .language-picker.open:after{border-color:rgba(255,255,255,.8)}.is-not-authenticated .index-page .language-picker:hover{cursor:pointer;color:rgba(255,255,255,.8)}.is-not-authenticated .index-page .language-picker:hover:after{border-color:rgba(255,255,255,.8)}.language-picker{display:block;min-height:32px;margin-top:13px;margin-right:15px;padding:0 14px;padding-right:25px;border:1px solid #33353b;color:#fff;line-height:32px;text-decoration:none;float:left;background-color:#26282f;position:relative;z-index:1;text-transform:uppercase;box-sizing:border-box}.language-picker.open{color:#58c3e5}.language-picker.open:after{border-color:#58c3e5}.language-picker:hover{cursor:pointer;color:#58c3e5}.language-picker:hover:after{border-color:#58c3e5}.language-picker a{display:block;padding:5px 15px;color:#c4c7d1}.language-picker a.selected{background-color:#fff;color:#000}.language-picker a:hover{color:#fff}.language-picker .dropdown{margin-top:9px;position:absolute;padding:0;width:640px;margin-left:-15px;box-sizing:border-box;border-left:1px solid #33353b;border-right:1px solid #33353b;border-bottom:1px solid #33353b;background:rgba(41,43,50,.97)}.language-picker:after{content:" ";position:absolute;right:10px;top:11px;width:6px;height:6px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;border-width:0 1px 1px 0;border-style:solid;border-color:#fff}.header-menu{position:relative;margin-top:13px;height:32px;-ms-touch-action:none}.header-menu a{color:#fff}.header-menu>a{display:inline-block;height:32px;line-height:32px}.header-menu.with-sub>a:after{content:" ";position:absolute;right:5px;top:11px;width:6px;height:6px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;border-width:0 1px 1px 0;border-style:solid;border-color:#fff}.is-authenticated .header-menu.with-sub:hover>a:after,.is-authenticated .header-menu.with-sub.open>a:after{border-color:#58c3e5}.header-menu ul{list-style:none;margin:0;padding:0}.header-menu>ul,.header-menu .popup-subblock{display:none;position:absolute;left:0;top:45px;width:165px;padding:0 0 3px;border:1px solid #343541;background:#292b32;background:rgba(41,43,50,.97);border-radius:0 0 2px 2px;-webkit-border-radius:0 0 2px 2px;-moz-border-radius:0 0 2px 2px;-webkit-box-shadow:0 0 10px rgba(0,0,0,.1);-moz-box-shadow:0 0 10px rgba(0,0,0,.1);box-shadow:0 0 10px rgba(0,0,0,.1);opacity:1;z-index:70}.is-not-authenticated .index-page .header-menu>ul,.is-not-authenticated .index-page .header-menu .popup-subblock{top:42px;padding:3px 0;background:#fff;background:rgba(255,255,255,.95);-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.header-menu.open ul,.header-menu.open .popup-subblock{display:block}.header-menu .popup-subblock ul{display:block;width:auto;position:relative;left:0;top:0;margin:2px 0;box-shadow:none;border-radius:0 0 4px 4px}.header-menu li a{display:block;padding:10px 15px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#c4c7d1}.is-not-authenticated .index-page .header-menu li a{color:#333}.header-menu li a:hover{color:#fff}.is-not-authenticated .index-page .header-menu li a:hover{color:#02a3c3}.header-menu li.separator{background:#3f4148;height:1px;font-size:0}.is-not-authenticated .index-page .header-menu li.separator{background:#d5e6e9}.header-menu.to-left ul{left:auto;right:0}.header-menu .counter-blue{position:absolute;color:#fff;right:8px;background:#286ed1;font-weight:700;padding:0 4px;border-radius:2px}.header-menu .counter{position:absolute;color:#dbdfeb;right:12px;font-size:13px}.header-menu a:hover .counter{color:#fff}.header-button,a.header-button,.header-menu>a{font-size:14px;color:#fff}.is-not-authenticated .header-button:hover,.is-not-authenticated .language-picker .language:hover .selected,.is-not-authenticated .header-button.active,.is-not-authenticated .header-menu:hover>a,.is-not-authenticated .header-menu.open>a{opacity:.85}.is-authenticated .header-button:hover,.is-authenticated .language-picker .language:hover .selected,.is-authenticated .header-button.active,.is-authenticated .header-menu:hover>a,.is-authenticated .header-menu.open>a{color:#58c3e5}.header-logo,.header-item-ideas,.header-item-chart,.header-search,.header-menu-group a{float:left}.header-item-profile,.header-item-gopro,.header-item-signin,.header-item-market-summary,.header-item-signup,.header-item-earlyaccess{float:right}.header-item-ideas,.header-item-scripts{float:left}.header-item-ideas.header-button,.header-item-chart.header-button,.header-item-scripts.header-button,.header-item-ideas.header-menu>a,.header-item-chart.header-menu>a,.header-item-scripts.header-menu>a{padding-left:35px!important;padding-right:18px!important;position:relative}.header-item-ideas.header-menu.with-sub>a,.header-item-chart.header-menu.with-sub>a,.header-item-scripts.header-menu.with-sub>a{padding-right:23px!important}.header-item-ideas.header-button:before,.header-item-ideas.header-menu>a:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1880px;display:block;position:absolute;overflow:hidden;left:10px;top:5px}.header-item-ideas:hover.header-button:before,.header-item-ideas.active.header-button:before,.header-item-ideas.open.header-button:before,.header-item-ideas:hover.header-menu>a:before,.header-item-ideas.active.header-menu>a:before,.header-item-ideas.open.header-menu>a:before{height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1909px;display:block;position:absolute;overflow:hidden}.header-item-chart.header-button:before,.header-item-chart.header-menu>a:before{content:" ";height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1830px;display:block;position:absolute;overflow:hidden;left:8px;top:8px}.header-item-chart:hover.header-button:before,.header-item-chart.active.header-button:before,.header-item-chart.open.header-button:before,.header-item-chart:hover.header-menu>a:before,.header-item-chart.active.header-menu>a:before,.header-item-chart.open.header-menu>a:before{height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1855px;display:block;position:absolute;overflow:hidden}.header-item-scripts.header-button:before,.header-item-scripts.header-menu>a:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1938px;display:block;position:absolute;overflow:hidden;left:10px;top:6px}.header-item-scripts:hover.header-button:before,.header-item-scripts.active.header-button:before,.header-item-scripts.open.header-button:before,.header-item-scripts:hover.header-menu>a:before,.header-item-scripts.active.header-menu>a:before,.header-item-scripts.open.header-menu>a:before{height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1967px;display:block;position:absolute;overflow:hidden}.header-item-ideas.header-menu{display:none}.header-item-chart .popup-subblock{width:233px;max-height:415px}.header-item-chart .popup-subblock .sb-scrollbar-wrap{z-index:71}.header-item-chart .popup-subblock .sb-scrollbar{z-index:71}.header-item-chart li a{padding-right:30px}.header-item-chart li a.new-chart{padding:15px 30px 15px 25px;background-image:url(images/new-chart-icon.png);background-repeat:no-repeat;background-position:6px 20px}.header-item-chart li:hover span{color:#fff}.header-item-chart li:hover span.icon{visibility:visible}html.feature-touch .header-item-chart li span.icon{visibility:visible}.header-item-chart .name,.header-item-chart .subscript{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-item-chart .name{font-weight:700}.header-item-chart .subscript{font-size:10px;color:#9e9e9e;height:14px}.header-item-chart span.icon-carousel-item-delete-dark{position:absolute;top:15px;right:10px;visibility:hidden}.is-not-authenticated .index-page .header-search{display:none}.header-search{height:58px;position:relative;margin-left:10px}.header-search input{height:36px;line-height:36px;width:180px;margin:10px 0 0 0;padding:0 30px 0 12px;border:1px solid #343541;font-size:14px;background:#26282f;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;color:#d4d4d4;box-shadow:none;font-family:'Open Sans',sans-serif;transition:background .3s}.is-trial .header-search input{width:160px}.three-columns .header-search input{width:180px}.header-search input:focus{border-color:#454652;color:#fff}.header-search.not-empty input{text-transform:uppercase}.header-search>span{position:absolute;top:10px;right:0;height:36px;width:36px;cursor:pointer}.header-search>span:before{content:" ";position:absolute;top:15px;right:15px;width:6px;height:6px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;border-top:2px solid #d4d4d4;border-right:2px solid #d4d4d4}.header-search>span:hover:before{border-color:#58c3e5}.header-search .header-item-chart{position:absolute;right:4px;top:0;background:#26282f}.header-search .header-item-chart.header-menu>a{padding-right:0!important;padding-left:0!important;width:20px}.header-search .header-item-chart.header-menu>a:before{display:none}.header-search .header-item-chart.header-menu.open .popup-subblock{top:34px;left:-211px}.header-search span.placeholder{color:#929292;line-height:24px}.header-menu.header-item-profile>a,.header-menu.header-item-profile>a:link,.header-menu.header-item-profile>a:visited{padding:0 25px 0 6px;height:32px}.header-menu.header-item-profile>a:after{right:10px}.header-menu.header-item-profile .user-info-username{display:inline-block;margin:0 3px 0 10px;max-width:115px;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.is-trial .header-menu.header-item-profile .user-info-username{max-width:60px}.three-columns .header-menu.header-item-profile .user-info-username{max-width:115px}.header-menu.header-item-profile .icon-profilemenu-settings{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2170px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-settings{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2195px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-profile{height:14px;width:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2293px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-profile{height:14px;width:14px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2317px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-signout{height:13px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2652px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-signout{height:13px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2675px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-status{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2243px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile li:hover .icon-profilemenu-status{height:15px;width:15px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2268px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-menu.header-item-profile .icon-profilemenu-settings{top:-1px;left:-1px}.header-menu.header-item-profile .icon-profilemenu-profile{top:-2px;left:-1px}.header-menu.header-item-profile .icon-profilemenu-status{top:-1px;left:-1px}.header-menu.header-item-profile ul{width:209px;opacity:1!important}.user-picture,.user-picture img{height:32px;width:32px}.user-picture{text-align:center;float:left}.user-picture img{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box}.is-not-authenticated .header-menu.header-item-profile{display:none}.is-not-pro .header-menu.header-item-profile strong.badge{display:none}.header-button.header-item-signin{padding-left:20px;padding-right:25px}.is-authenticated .header-item-gopro-signup{display:none}.is-authenticated .header-button.header-item-signin{display:none}.is-authenticated .header-button.header-item-signup{display:none}.gopro-page .header-button.header-item-gopro{display:none}.header-item-gopro,.header-item-gopro:link,.header-item-gopro:hover{padding:0;margin-top:12px;margin-right:10px;height:32px;border:#4bc2e8 1px solid;background:0 0;line-height:32px;text-transform:uppercase}.is-not-authenticated .index-page .header-item-gopro,.is-not-authenticated .index-page .header-item-gopro:link,.is-not-authenticated .index-page .header-item-gopro:hover{border:#fff 1px solid}.header-item-gopro-signup,.header-item-gopro-btn{float:left;height:16px;padding:0 6px;color:#4bc2e8}.is-not-authenticated .index-page .header-item-gopro-signup,.is-not-authenticated .index-page .header-item-gopro-btn{color:#fff}.header-item-gopro-signup .gopro-btn-big,.header-item-gopro-btn .gopro-btn-big{margin-top:4px;font-size:12px;font-weight:600;line-height:14px;text-align:center}.header-item-gopro-signup .gopro-btn-small,.header-item-gopro-btn .gopro-btn-small{font-size:10px;font-weight:700;line-height:11px;text-align:center;color:#b66052}.is-pro .header-item-gopro{display:none}.is-trial .header-item-gopro{display:block}.is-not-authenticated .header-item-gopro-main,.is-trial .header-item-gopro-main,.is-trial-available .header-item-gopro-main,.is-authenticated.is-not-trial.is-pro .header-item-gopro-main{display:none}.header-item-gopro-earlyaccess{display:none}.is-trial .header-item-gopro-earlyaccess{display:block}.header-item-gopro-trial{display:none}.is-trial-available .header-item-gopro-trial{display:block}.is-trial .header-item-gopro-trial{display:none}.tv-index-header-bg{background:#ebeff2;padding:0 0 10px}.tv-index-header-login{font:12px Arial,sans-serif;display:none;color:#5a5a5a}.tv-index-header-login-wrap{padding:10px 7px 0;position:relative}.tv-index-header-login .user-avatar{float:left;height:30px}.tv-index-header-login .user-avatar a{display:inline-block;height:30px}.tv-index-header-login .user-bar{background:#eaf3fb;border-radius:2px;padding:5px 7px;height:30px;border:1px solid #d1dee9}.tv-index-header-login .user-bar a{text-decoration:underline}.dashed-link{border-bottom:1px dashed #256dd0;color:#256dd0;cursor:pointer;font-size:13px;margin:5px 15px 0 0;text-decoration:none!important}.users-table-header .dashed-link{margin:0 15px 0 0}.dashed-link.active{border-bottom:none;color:#666}.tv-index-header-login .user-username{float:left;font-size:13px;font-weight:700;text-decoration:underline;margin:6px 0 0 10px}.tv-index-header-login .user-username a{text-decoration:underline}.tv-index-header-login .user-rating{float:left;font-size:13px;font-weight:700;margin:5px 0 0 12px}.tv-index-header-login .user-rating a{font-size:13px;text-decoration:underline}.tv-index-header-login .user-rating-position{float:left;margin:7px 0 0 7px}.tv-index-header-login .index-user-carousel-nav{width:100%;height:100%;position:absolute;left:0;top:0}.tv-index-header-login .nav-button{z-index:2;position:absolute;background:#edf0f2;width:27px;height:137px;top:0;opacity:.5;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;transition:opacity .5s}.tv-index-header-login .nav-button:hover{opacity:.8;-moz-transition:opacity .5s;-webkit-transition:opacity .5s;transition:opacity .5s}.tv-index-header-login .nav-button-left{left:0;border-right:1px solid #dadcde}.tv-index-header-login .nav-button-right{right:0;border-left:1px solid #dadcde}.tv-index-header-login .icon-nav-left-disabled{display:none}.tv-index-header-login .icon-nav-right-disabled{display:none}.tv-index-header-login .user-profile-follow-links{float:left;margin:3px 0 0 8px}.tv-index-header-login .show-more-link{background:#fff;border:1px solid #bfbfbf;margin:0 auto;display:block;text-align:center;color:#646464;position:relative;top:-1px;width:173px;padding:6px 0 0;border-radius:0 0 3px 3px;border-top:1px dashed #bfbfbf;height:21px;cursor:pointer;font:700 12px Calibri,Arial}.is-not-authenticated .logged-user-menu{display:none}.is-authenticated .guest-menu{display:none}.ISwraper{position:relative}.ISwraper .IStoggle{position:absolute;height:27px;width:13px;top:1px;right:0;cursor:pointer}.ISwraper .IStoggle:after{content:" ";position:absolute;right:0;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.ISwraper ul.ISdropdown{position:absolute;left:1px;top:0;border:1px solid #c9cbcd;background:#fff;z-index:120;margin:2px 0 0;padding:0;overflow:auto;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.ISwraper ul.ISdropdown li{display:block;padding:7px;height:16px;overflow:hidden;cursor:pointer}.ISwraper ul.ISdropdown li:hover{background:#f4f7f9}.ISwraper ul.ISdropdown li .IStext{display:inline-block;width:100%;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tv-dialog-content form .ISwraper .IStoggle{height:33px;width:25px}.tv-dialog-content form .ISwraper .IStoggle:after{top:10px;right:6px}.content-page{font-size:15px;color:#4b4b4d}.content-page p{line-height:28px;margin-bottom:20px}.content-page h1{font-size:40px;color:#2a2d33;line-height:normal;font-weight:400;margin:26px 0 26px}.content-page h1:first-child{margin-top:0}.content-page h2{font-size:29px;color:#2a2d33;line-height:normal;font-weight:400;margin:25px 0 25px}.content-page h2:first-child{margin-top:0}.content-page h3{font-size:21px;color:#2a2d33;line-height:normal;font-weight:400;margin:20px 0 15px}.content-page h3:first-child{margin-top:0}.content-page .more-languages{border:1px solid silver;padding:10px 10px;background:#fff;cursor:pointer}.content-page .languages-list{width:350px;border:1px solid silver;background:#fff;padding:10px 0;margin-left:-175px;top:-10px;left:50%;z-index:100;position:absolute}.content-page .languages-list .languages-list-items{padding:0 15px}.content-page .languages-list .languages-list-items span{width:33%;list-style-type:none;float:left;padding:5px 0;white-space:nowrap;text-align:left}.content-page .languages-list .large{width:100%;padding:0 0}.content-page .languages-list .large .content{margin-left:15px}.content-page .languages-list .large.top{border-bottom:1px solid silver;margin-bottom:10px;padding-bottom:10px;cursor:pointer}.content-page .languages-list .large.bottom{clear:both;border-top:1px solid silver;margin-top:10px;padding-top:10px}.content-page ul li span.mark{color:#60b789;font-weight:700}.content-page .separator{margin:45px 0 35px 0;background:#ccd8e4;height:1px;overflow:hidden}.content-page .vindent{padding:36px 0 36px}.content-page .vindent-top{padding-top:36px}.content-page .vindent-bottom{padding-bottom:36px}.content-page .hvindent{padding:36px 10px}.content-page .tv-content-button{display:inline-block;height:45px;padding:0 30px;color:#fff;text-align:center;text-transform:uppercase;font-size:15px;line-height:46px;cursor:pointer;border-width:0;outline:0;outline-style:none;-webkit-border-radius:0;-webkit-background-clip:padding-box;-moz-border-radius:0;-moz-background-clip:padding;border-radius:0;background-clip:padding-box}.content-page .tv-content-button::-moz-focus-inner{border:0;padding:0}.content-page .tv-content-button.float-bottom{position:absolute;bottom:0}.content-page .tv-content-button.blue{background-color:#00b8dc}.content-page .tv-content-button.blue:hover{background-color:#00c1e6}.content-page .tv-content-button.blue:active{background-color:#00c9f0}.content-page .tv-content-button.green{background-color:#5cb888}.content-page .tv-content-button.green:hover{background-color:#63bb8d}.content-page .tv-content-button.green:active{background-color:#6abe92}.content-page .tv-content-button.yellow{background-color:#e5c35f}.content-page .tv-content-button.yellow:hover{background-color:#e6c668}.content-page .tv-content-button.yellow:active{background-color:#e8ca71}.content-page .tv-content-button.black{background-color:#26282f}.content-page .tv-content-button.black:hover{background-color:#2b2d35}.content-page .tv-content-button.black:active{background-color:#2f323a}.content-page.how-it-works{overflow:hidden}.content-page.how-it-works .intro{height:497px;padding-top:52px}.content-page.how-it-works .intro .tv-layout-width{position:relative}.content-page.how-it-works .intro .text{width:415px;float:left}.content-page.how-it-works .intro img{position:absolute;top:0;left:392px}.content-page.how-it-works .watch-link{padding:47px 0 52px 0;border-bottom:solid 1px #d3d8de}.content-page.how-it-works .watch-link:after{clear:both;display:table;content:""}.content-page.how-it-works .watch-link a{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3211px;float:left;height:89px;padding-left:191px;padding-top:26px;font-size:24px;line-height:normal;color:#2a2d33;font-style:italic;width:120px}.content-page.how-it-works .mission{padding:30px 0 60px}.content-page.how-it-works table.stats{table-layout:fixed;padding-top:50px;width:100%}.content-page.how-it-works table.stats td{padding-left:40px}.content-page.how-it-works table.stats div{height:77px;display:inline-block;color:#7e848e;font-size:20px;padding-top:7px;text-align:left}.content-page.how-it-works table.stats div span{font-size:46px;color:#33353e;display:block}.content-page.how-it-works table.stats div.investors{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1977px;padding-left:85px}.content-page.how-it-works table.stats div.ideas{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1890px;padding-left:91px}.content-page.how-it-works table.stats div.charts{background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -511px;padding-left:100px}.content-page.how-it-works .how{padding:30px 0}.content-page.how-it-works .how table{width:100%;margin:50px 0 30px}.content-page.how-it-works .how table td{padding:0 20px 50px 0}.content-page.how-it-works .how table td i{width:69px;float:left;text-align:right;padding-right:16px}.content-page.how-it-works .how table td div{padding-left:85px;line-height:22px}.content-page.how-it-works .how table td h2{color:#2a2d33;font-size:24px;padding:0 0 10px;margin:0;font-weight:400;text-transform:uppercase}.content-page.how-it-works .how table td i:before{content:" "}.content-page.how-it-works .how table td.create i:before{height:43px;width:60px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -42px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .how table td.learn i:before{height:36px;width:42px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -95px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .how table td.share i:before{height:44px;width:34px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -141px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:11px}.content-page.how-it-works .how table td.colloborate i:before{height:32px;width:63px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 0;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.how-it-works .trading-ideas h1{text-align:center}.content-page.how-it-works .trading-ideas .image{height:185px;width:120px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3016px;float:left;margin-top:45px}.content-page.how-it-works .trading-ideas .text{padding-left:160px}.content-page.how-it-works .trading-ideas .text p.half.first{float:left;width:50%;margin-right:8%}.content-page.how-it-works .trading-ideas .text p.half.second{float:left;width:42%}.content-page.how-it-works .saying-about{padding-top:56px}.content-page.how-it-works .saying-about h1{text-align:center;margin-bottom:45px}.content-page.how-it-works .saying-about blockquote{color:#818284;font-size:17px;line-height:28px;font-weight:400;font-style:italic;margin:0 0 35px;padding:0 0 0 34px}.content-page.how-it-works .saying-about blockquote:before{content:" ";height:18px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2559px;display:block;position:absolute;overflow:hidden;margin-left:-32px}.content-page.how-it-works .saying-about .quote{width:47%;float:left}.content-page.how-it-works .saying-about .quote.r{float:right}.content-page.how-it-works .saying-about .quote .author{text-align:right;padding-left:34px;font-size:17px}.content-page.how-it-works .saying-about .quote .author .name{color:#2a2d33}.content-page.how-it-works .saying-about .quote .author .post{color:#818284}.content-page.how-it-works .saying-about .press-about{padding:80px 0 40px}.content-page.how-it-works .saying-about .press-about:after{clear:both;display:table;content:""}.content-page.how-it-works .saying-about .press-about .line{height:1px;background:#ced5db;overflow:hidden;margin-top:10px}.content-page.how-it-works .saying-about .press-about .head{color:silver;font-size:20px;background:#eaeff4;display:block;margin:-14px auto 30px;width:350px;text-align:center;text-transform:uppercase}.content-page.how-it-works .saying-about .press-about .item{width:228px;float:left;margin-right:27px}.content-page.how-it-works .saying-about .press-about .item:last-child{margin-right:0}.content-page.how-it-works .saying-about .press-about .item .balloon{background:#fff;position:relative;height:106px;font-size:14px;color:#818284;text-align:center;display:table-cell;vertical-align:middle;padding:0 21px}.content-page.how-it-works .saying-about .press-about .item .balloon:before{content:" ";height:20px;width:20px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -331px;display:block;position:absolute;overflow:hidden;top:100%;right:24px}.content-page.how-it-works .saying-about .press-about .item .image{float:right;margin-right:3px}.content-page.how-it-works .saying-about .press-about .item:nth-child(1) .image{height:36px;width:130px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2114px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:22px}.content-page.how-it-works .saying-about .press-about .item:nth-child(2) .image{height:24px;width:133px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2918px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:32px}.content-page.how-it-works .saying-about .press-about .item:nth-child(3) .image{height:43px;width:141px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3435px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:24px}.content-page.how-it-works .saying-about .press-about .item:nth-child(4) .image{height:22px;width:193px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1078px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-top:32px}.content-page.features .intro .head{text-align:center;padding-top:25px;overflow:hidden}.content-page.features .intro .head h1{margin-bottom:35px}.content-page.features .broad-market{padding-top:20px;text-align:center}.content-page.features .broad-market-icon-container{text-align:center;overflow:hidden}.content-page.features .broad-market-icon-container .broad-market-icon{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .mobile{position:relative}.content-page.features .mobile .text{width:620px}.content-page.features .mobile .text p{padding-right:15px}.content-page.features .mobile .image{float:right;margin:53px 10px 0 0;height:240px;width:341px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1210px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .mobile:after{clear:both;display:table;content:""}.content-page.features .chart-types .chart-types-list{height:140px;width:795px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -361px;width:auto;margin:30px 0 10px 53px}.content-page.features .chart-types .chart-types-list div{line-height:54px;height:54px;margin-bottom:32px}.content-page.features .chart-types .chart-types-list div span{float:left;width:171px;padding-left:73px;font-size:18px;color:#595e67}.content-page.features .chart-types .chart-types-list div span:last-child{width:auto}.content-page.features .chart-types .spread-charts .text{padding-left:200px}.content-page.features .chart-types .spread-charts .image{height:96px;width:96px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2636px;margin-left:-161px;float:left;margin-top:5px}.content-page.features .drawings{text-align:center}.content-page.features .drawings .image{height:32px;width:937px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1110px;margin:10px auto 25px}.content-page.features .technical-analysis{text-align:center}.content-page.features .technical-analysis .list{color:#4b5662;font-size:25px;text-align:center;margin-bottom:45px;margin-top:40px}.content-page.features .technical-analysis .list span:before{content:" "}.content-page.features .technical-analysis .list span:nth-child(1):before{height:40px;width:51px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2064px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:10px}.content-page.features .technical-analysis .list span:nth-child(2):before{height:45px;width:46px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2392px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:75px;margin-right:15px}.content-page.features .technical-analysis .list span:nth-child(3):before{height:42px;width:38px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1026px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:75px;margin-right:24px}.content-page.features .features-item.half{padding-top:56px}.content-page.features .features-item.half>div:nth-child(1){float:left;width:47%}.content-page.features .features-item.half>div:nth-child(2){float:right;width:47%}.content-page.features .features-item.center{text-align:center}.content-page.features .features-item h2 .image{margin-top:-23px;margin-right:6px}.content-page.features .features-item .image.fundamentals{height:40px;width:54px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1736px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.compare{height:41px;width:60px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -929px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.price-scaling{height:57px;width:69px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2447px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.multi-charts{height:48px;width:49px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2160px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.study-template{height:52px;width:54px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2856px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.extended-hours{height:48px;width:174px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1152px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.hotlist{height:45px;width:34px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1835px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.repeat{height:39px;width:53px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2587px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.headlines{height:39px;width:40px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1786px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.conversation{height:36px;width:42px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -980px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item .image.publish{height:35px;width:36px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2514px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.features .features-item:after{clear:both;display:table;content:""}.content-page.features .addons .text{padding-left:247px}.content-page.features .addons .image{float:left;margin-left:-200px;margin-top:8px;height:126px;width:136px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -195px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .woo-gopro{padding:65px 0 50px;background:#14b8da;text-align:center}.content-page .woo-gopro .title{font-size:34px;color:#f2f5f8;margin-bottom:15px}.content-page .woo-gopro p{font-size:16px;color:#f2f5f8;font-style:italic}.content-page .woo-gopro a{margin-top:20px;background:#1098b5;border:solid 1px #fff;color:#fff;font-size:18px;text-transform:uppercase;width:202px;height:45px;line-height:45px;display:inline-block}.content-page.licensing{overflow:hidden}.content-page.licensing .intro{text-align:center;padding-top:52px;padding-bottom:0}.content-page.licensing .intro .tv-layout-width{position:relative}.content-page.licensing .intro img{display:block;margin:55px 0 0 -62px}.content-page.licensing .base-info{padding:105px 0 75px}.content-page.licensing .base-info h3{color:#2a2d33;font-size:24px;font-weight:400;margin:0 0 15px}.content-page.licensing .base-info .three-colomns-layout .colomn-left,.content-page.licensing .base-info .three-colomns-layout .colomn-center,.content-page.licensing .base-info .three-colomns-layout .colomn-right{float:left;position:relative;height:453px;width:305px;width:calc((100% - 81px)/3);margin-right:40px;padding-bottom:45px}.content-page.licensing .base-info .three-colomns-layout .colomn-left.colomn-right,.content-page.licensing .base-info .three-colomns-layout .colomn-center.colomn-right,.content-page.licensing .base-info .three-colomns-layout .colomn-right.colomn-right{margin-right:0}.content-page.licensing .base-info .three-colomns-layout .colomn-left h3,.content-page.licensing .base-info .three-colomns-layout .colomn-center h3,.content-page.licensing .base-info .three-colomns-layout .colomn-right h3{font-size:17px;font-weight:700;color:#2a2d33}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image-container,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image-container,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image-container{height:100px;line-height:100px;text-align:center;margin-bottom:40px}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.window-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.window-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.window-chart{height:89px;width:110px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -3336px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.cloud-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.cloud-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.cloud-chart{height:81px;width:115px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -838px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .image.pages-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-center .image.pages-chart,.content-page.licensing .base-info .three-colomns-layout .colomn-right .image.pages-chart{height:100px;width:100px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2218px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.licensing .base-info .three-colomns-layout .colomn-left .tv-content-button,.content-page.licensing .base-info .three-colomns-layout .colomn-center .tv-content-button,.content-page.licensing .base-info .three-colomns-layout .colomn-right .tv-content-button{padding:0;width:100%}.content-page.licensing>.vindent:last-child{padding:70px 0}.content-page.charting-library .intro{position:relative;text-align:center;padding-bottom:0}.content-page.charting-library .intro .image{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-left:-45px;margin-top:-8px}.content-page.charting-library .buttons-container{position:relative;margin-top:45px;text-align:center;z-index:1}.content-page.charting-library .buttons-container .tv-content-button{margin-right:15px}.content-page.charting-library .buttons-container .tv-content-button:last-child{margin-right:0}.content-page.charting-library .chart-container.vindent{padding-top:65px;text-align:center}.content-page.charting-library #chart{width:100%;height:605px}.content-page .advantages .list{padding:25px 310px 0 75px}.content-page .advantages h2{font-size:25px;position:relative}.content-page .advantages h2 .image,.content-page .advantages h2 .rounded-number{position:absolute;left:-75px;top:-10px}.content-page .advantages h2 .rounded-number{top:-12px;width:50px;height:50px;line-height:50px;text-align:center;border:2px solid #14b8da;-webkit-border-radius:50px;-webkit-background-clip:padding-box;-moz-border-radius:50px;-moz-background-clip:padding;border-radius:50px;background-clip:padding-box;color:#14b8da}.content-page .advantages h2.blue{color:#14b8da}.content-page .advantages h2.blue .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -598px}.content-page .advantages h2.blue .rounded-number{border-color:#14b8da;color:#14b8da}.content-page .advantages h2.green{color:#60b789}.content-page .advantages h2.green .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -658px}.content-page .advantages h2.green .rounded-number{border-color:#60b789;color:#60b789}.content-page .advantages h2.yellow{color:#dbb710}.content-page .advantages h2.yellow .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -778px}.content-page .advantages h2.yellow .rounded-number{border-color:#dbb710;color:#dbb710}.content-page .advantages h2.red{color:#e26346}.content-page .advantages h2.red .image{height:50px;width:50px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -718px}.content-page .advantages h2.red .rounded-number{border-color:#e26346;color:#e26346}.content-page .advantages p{padding-bottom:25px}.content-page .contacts{margin-top:17px;float:right;position:relative;width:237px;padding:16px 18px;background:#eaeff4;border-radius:5px;color:#5e646f;line-height:20px;font-size:14px}.content-page .contacts .title{color:#2a2d33;padding-bottom:15px;font-weight:700;text-transform:uppercase}.content-page .contacts .fn,.content-page .contacts .email,.content-page .contacts .tel{display:block}.content-page .contacts:after{content:" ";height:54px;width:30px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2328px;display:block;position:absolute;overflow:hidden;bottom:0;right:11px}.content-page .hl-bg .contacts{background:#f2f5f8}.content-page.tv-widget-page .intro{text-align:center;overflow:hidden;padding-bottom:0}.content-page.tv-widget-page .intro .image{height:104px;width:1091px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -2742px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page.tv-widget-page .browser-container{margin-top:50px}.content-page [class^=flag-small-]{position:relative;top:-2px;margin-right:4px}.content-page .flag-small-greatbritain{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1535px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-taiwan{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1685px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-russian{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1635px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-japanese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1585px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-german{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1510px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-portuguese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1610px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-chinese{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1460px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-italy{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1560px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-spain{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1660px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-france{height:15px;width:24px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1485px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page .flag-small-vietnam{height:16px;width:23px;background-image:url(images/sprites/content-pages.png);background-repeat:no-repeat;background-position:0 -1710px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets){list-style-type:none}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets) li{background:0 0;display:block;margin:0 0 0 22px;padding:8px 0;line-height:30px}.content-page ul.moderator-list:not(.sbOptions):not(.no-bullets) a.user-badge{position:relative;top:3px;margin-left:8px}.charting-library-page-dialog{text-align:left;line-height:1.7;font-size:15px}.clients-list{background:#e0e5eb}.clients-list img{margin-right:30px;margin-top:30px}.clients-list .hint{margin:-20px 0 0 0}.clients-list .logo-list{padding-bottom:30px}.tv-tools-navbar{background:#fff;text-align:center;padding-top:22px;padding-bottom:24px;box-shadow:0 1px 1px 1px #e4e7e9;z-index:1;position:relative}.tv-tools-navbar ul{list-style-type:none;margin:0;padding:0}.tv-tools-navbar ul li{display:inline-block;text-transform:uppercase}.tv-tools-navbar ul li:not(:last-child){padding-right:78px}.tv-tools-navbar ul li a{color:#989898;text-decoration:none;font-weight:700;font-size:14px}.tv-tools-navbar ul li a:visited{color:#989898;text-decoration:none}.tv-tools-navbar ul li a:hover{color:#333;text-decoration:none}.tv-tools-navbar ul li a:active{color:#333;text-decoration:none}.tv-tools-navbar ul li a.active{color:#333;text-decoration:none;padding-bottom:2px;border-bottom:1px solid #989898}.tv-publishing-tools{background:#eaeff4}.tv-publishing-tools .hl-bg{background:#e6eaef}.tv-publishing-tools h1 a:not(.link-color),.tv-publishing-tools h2 a:not(.link-color){color:#4b4b4d}.tv-publishing-tools .integration-example{text-align:center;position:relative}.tv-publishing-tools .integration-example .widget-grid{display:table;width:100%;margin-bottom:40px}.tv-publishing-tools .integration-example .widget-grid .widget-grid-item{display:table-cell;vertical-align:top}.tv-publishing-tools .integration-example .widget-grid .widget-grid-item .left{float:left}.tv-publishing-tools .integration-example .widget-grid .widget-grid-item .right{float:right}.tv-publishing-tools .integration-example #widget-container{margin-bottom:30px}.tv-publishing-tools .integration-example #user-info-container-sample{margin-bottom:20px}.tv-publishing-tools #ideas-stream-container #tv-ideas-stream-container{margin-top:41px}.tv-publishing-tools #ideas-stream-container>div:not(.widget-code){display:inline-block;float:left;margin:0 20px 20px 0}.tv-publishing-tools #ideas-stream-container .tv-select-container{width:200px}.tv-publishing-tools .widget-code>textarea{width:100%;height:175px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}@-webkit-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-moz-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-ms-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@-o-keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}@keyframes highlight-animation{from{background:0 0}to{background:#ffe868}}.header-chart-panel{display:block;position:relative;z-index:1;padding:5px 5px 0;background-color:#f1f3f6}.header-chart-panel:after{clear:both;display:table;content:""}.is-mobile .header-chart-panel{background-color:#fff;padding:14px 28px;border-bottom:1px solid #c9cbcd}.is-mobile .header-chart-panel .symbol-edit-widget{width:170px;height:40px;margin-right:8px}.is-mobile .header-chart-panel .chart-style-widget .quick i{position:relative;top:-4px}.is-mobile .header-chart-panel .button i{display:block;position:relative;background-image:url(images/mobile/icons.png)}.is-mobile .header-chart-panel .button.properties svg{fill:#7d7d7d}.is-mobile .header-chart-panel .button.compare svg{fill:#7d7d7d}.is-mobile .header-chart-panel .button.indicators svg{fill:#7d7d7d}.is-mobile .header-chart-panel .button.load{margin-right:7px}.is-mobile .header-chart-panel .button.save.process{background:url(images/bar-loader.gif) 0 0 repeat!important;border:0;padding:14px 19px 12px}.is-mobile .header-chart-panel .button.save.no-change{color:#ddd!important}.is-mobile .header-chart-panel .button.options{padding-right:12px!important}.is-mobile .header-chart-panel .mobile-back-button{-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;width:40px;height:40px;border:2px solid #b5b7ba;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff;position:relative;margin-right:30px}.is-mobile .header-chart-panel .mobile-back-button:hover,.is-mobile .header-chart-panel .mobile-back-button:active,.is-mobile .header-chart-panel .mobile-back-button.active{background:#fff}.is-mobile .header-chart-panel .mobile-back-button:hover,.is-mobile .header-chart-panel .mobile-back-button:active,.is-mobile .header-chart-panel .mobile-back-button.active,.is-mobile .header-chart-panel .mobile-back-button.selected{background:#fff;border:2px solid #b5b7ba}.is-mobile .header-chart-panel .mobile-back-button i{position:absolute;top:11px;left:9px;display:block;width:19px;height:16px;background-image:url(images/mobile/icons.png);background-position:-40px -20px}.header-chart-panel .tv-close-panel{position:absolute;cursor:pointer;bottom:-5px;left:5px}.header-chart-panel.hidden{padding:0}.header-chart-panel.hidden .left,.header-chart-panel.hidden .right{display:none}.header-chart-panel .right{float:right}.header-chart-panel .left{margin:0 0 -5px 0}.header-chart-panel .group{display:inline-block;white-space:nowrap;padding:0;margin:0 0 5px 0;vertical-align:top}.is-mobile .header-chart-panel .group{margin:0}.header-chart-panel .symbol-edit-widget{margin-right:-1px;width:100px}.header-chart-panel .space-single,.chart-top-toolbar .space-single{padding:0 4px 0 0}.is-mobile .header-chart-panel .space-single,.is-mobile .chart-top-toolbar .space-single{padding-right:7px}.header-chart-panel .button,.hotlist-controls .button,.symbol-edit-widget .button,.bottom-widgetbar-content.backtesting .button{cursor:default;padding:7px 12px 7px;border:1px solid #c9cbcd;height:14px;background:#fff;color:#555;font-size:11px;font-weight:600;float:left;display:block;position:relative}.is-mobile .header-chart-panel .button.iconed,.is-mobile .hotlist-controls .button.iconed,.is-mobile .symbol-edit-widget .button.iconed,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed,.is-mobile .header-chart-panel .button,.is-mobile .hotlist-controls .button,.is-mobile .symbol-edit-widget .button,.is-mobile .bottom-widgetbar-content.backtesting .button{padding:12px 17px 10px;border:2px solid #b5b7ba;height:14px;background:#b5b7ba;color:#fff;font-size:12px;font-weight:400}.is-mobile .header-chart-panel .button.iconed:hover,.is-mobile .hotlist-controls .button.iconed:hover,.is-mobile .symbol-edit-widget .button.iconed:hover,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed:hover,.is-mobile .header-chart-panel .button:hover,.is-mobile .hotlist-controls .button:hover,.is-mobile .symbol-edit-widget .button:hover,.is-mobile .bottom-widgetbar-content.backtesting .button:hover,.is-mobile .header-chart-panel .button.iconed:active,.is-mobile .hotlist-controls .button.iconed:active,.is-mobile .symbol-edit-widget .button.iconed:active,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed:active,.is-mobile .header-chart-panel .button:active,.is-mobile .hotlist-controls .button:active,.is-mobile .symbol-edit-widget .button:active,.is-mobile .bottom-widgetbar-content.backtesting .button:active,.is-mobile .header-chart-panel .button.iconed.active:hover,.is-mobile .hotlist-controls .button.iconed.active:hover,.is-mobile .symbol-edit-widget .button.iconed.active:hover,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed.active:hover,.is-mobile .header-chart-panel .button.active:hover,.is-mobile .hotlist-controls .button.active:hover,.is-mobile .symbol-edit-widget .button.active:hover,.is-mobile .bottom-widgetbar-content.backtesting .button.active:hover,.is-mobile .header-chart-panel .button.iconed.active,.is-mobile .hotlist-controls .button.iconed.active,.is-mobile .symbol-edit-widget .button.iconed.active,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed.active,.is-mobile .header-chart-panel .button.active,.is-mobile .hotlist-controls .button.active,.is-mobile .symbol-edit-widget .button.active,.is-mobile .bottom-widgetbar-content.backtesting .button.active{background:#b5b7ba!important;color:#fff!important}.is-mobile .header-chart-panel .button.iconed .arrow-icon,.is-mobile .hotlist-controls .button.iconed .arrow-icon,.is-mobile .symbol-edit-widget .button.iconed .arrow-icon,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed .arrow-icon,.is-mobile .header-chart-panel .button .arrow-icon,.is-mobile .hotlist-controls .button .arrow-icon,.is-mobile .symbol-edit-widget .button .arrow-icon,.is-mobile .bottom-widgetbar-content.backtesting .button .arrow-icon{right:8px;top:13px;background:url(images/mobile/select-bg.png) repeat scroll 0 0 transparent;height:8px;width:14px}.is-mobile .header-chart-panel .button.iconed .arrow-icon:before,.is-mobile .hotlist-controls .button.iconed .arrow-icon:before,.is-mobile .symbol-edit-widget .button.iconed .arrow-icon:before,.is-mobile .bottom-widgetbar-content.backtesting .button.iconed .arrow-icon:before,.is-mobile .header-chart-panel .button .arrow-icon:before,.is-mobile .hotlist-controls .button .arrow-icon:before,.is-mobile .symbol-edit-widget .button .arrow-icon:before,.is-mobile .bottom-widgetbar-content.backtesting .button .arrow-icon:before{position:absolute;content:" ";width:1px;height:24px;background:#cbcdcf;top:-8px;right:24px}.header-chart-panel .left:not(.captions) .toggle-caption span.caption{display:none}.header-chart-panel .left.captions .toggle-caption{padding:7px 10px}.header-chart-panel .left.captions .toggle-caption.active{color:#4ab2dc}.is-mobile .header-chart-panel .left.captions .toggle-caption{padding:12px 17px 10px}.header-chart-panel .left.captions .toggle-caption svg{display:none}.header-chart-panel .button .arrow-icon,.hotlist-controls .arrow-icon,.symbol-edit-widget .arrow-icon,.ch-settings.button .arrow-icon{position:absolute;right:7px;top:12px;background:url(images/select-bg.png) repeat scroll 0 0 transparent;height:5px;width:9px}.header-chart-panel .button.with-arrow,.symbol-edit-widget .button.with-arrow{padding-right:20px}.is-mobile .header-chart-panel .button.with-arrow,.is-mobile .symbol-edit-widget .button.with-arrow{padding-right:46px}.symbol-edit-widget{height:27px;-webkit-user-select:none;position:relative}.is-mobile .symbol-edit-widget{width:170px}.symbol-edit-widget.no-button{width:110px}input.symbol-edit,.symbol-search-dialog input{background-color:#fff;border:1px solid #c9cbcd;width:291px;height:28px;padding:0 0 0 7px;color:#524f4f;font:13px 'Open Sans',sans-serif;font-weight:600;float:left}input.symbol-edit .is-mobile,.symbol-search-dialog input .is-mobile{color:#fff}.symbol-edit-widget .symbol-edit-wrap{position:absolute;z-index:1;width:100px;height:27px;top:0;left:0;transition:width .2s}.symbol-edit-widget .symbol-edit-wrap.expanded{width:484px;box-shadow:#f1f3f6 0 0 10px 10px;transition:width .4s;z-index:2}.is-mobile .symbol-edit-widget .symbol-edit-wrap{width:170px;height:40px}.is-mobile .symbol-edit-widget .symbol-edit-wrap.expanded{box-shadow:#fff 0 0 10px 10px;width:554px}.symbol-edit-widget .symbol-edit-inputspacer{padding:0 9px 0 0;overflow:hidden}.is-mobile .symbol-edit-widget .symbol-edit-inputspacer{height:40px;padding-right:11px}.is-mobile .symbol-edit-widget .symbol-edit-inputspacer input.symbol-edit{height:36px;border-width:2px;border-color:#b5b7ba}.symbol-edit-widget .symbol-edit-inputspacer input.symbol-edit{width:100%}.symbol-edit-wrap .symbol-edit-buttonswrap{height:30px;width:0;position:relative;overflow:hidden;background:#ff0;float:right;transition:width .2s}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap{height:40px}.symbol-edit-wrap.expanded .symbol-edit-buttonswrap{width:121px;transition:width .4s}.is-mobile .symbol-edit-wrap.expanded .symbol-edit-buttonswrap{width:172px}.symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions{position:absolute;top:0;right:0;width:120px}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions{height:36px;border:2px solid #b5b7ba;width:170px}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button{height:36px;width:34px;border-right:2px solid #b5b7ba}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button:last-child{border-right:none}.is-mobile .symbol-edit-wrap .symbol-edit-buttonswrap .spread-actions button .action-icon{top:8px;left:6px}input.symbol-edit.with-plus{padding-right:26px}input.symbol-edit.incomplete,.symbol-search-dialog input.incomplete{background-color:#ffffef}input.symbol-edit.error,input.symbol-edit.interval-error,.symbol-search-dialog input.error,.symbol-search-dialog input.interval-error{background-color:#ffefef}.symbol-search-loading{background:url(images/loading-small.gif) 50% 50% no-repeat;width:24px;height:24px;padding:3px;margin:0 auto}.property-page input.symbol-edit{padding:0 5px}div.symbol-edit-popup{position:absolute;width:550px;display:block;border:1px solid #c9cbcd;z-index:111;background:#fff;background:rgba(255,255,255,.9)}div.symbol-edit-popup .table-wrapper{border-top:1px solid #dde1e6;overflow-y:auto;width:550px}table.symbol-edit-popup{border-collapse:collapse}table.symbol-edit-popup tr.group-title{cursor:default}table.symbol-edit-popup tr.group-title td:first-child div{position:relative;border-color:#ccc;-webkit-transition:-webkit-border-color .1s linear;-moz-transition:-moz-border-color .1s linear;-o-transition:border-color .1s linear;-ms-transition:border-color .1s linear;transition:border-color .1s linear}table.symbol-edit-popup tr.group-title td:first-child div:before{content:'';display:block;position:absolute;top:50%;left:-13px;margin-top:-2px;width:0;height:0;border-color:inherit;border-style:solid;border-left-width:4px;border-right-width:4px;border-top-width:7px;border-bottom-width:0}table.symbol-edit-popup tr.group-title:not(.collapsed) td:first-child div:before{border-left-color:transparent;border-right-color:transparent}table.symbol-edit-popup tr.group-title.collapsed td:first-child div{border-color:#ccc}table.symbol-edit-popup tr.group-title.collapsed td:first-child div:before{left:-12px;margin-top:-3px;border-top-width:4px;border-bottom-width:4px;border-top-color:transparent;border-bottom-color:transparent;border-left-width:7px;border-right-width:0}table.symbol-edit-popup tr.group-title.symbol-edit-popup-active td:first-child div,table.symbol-edit-popup tr.group-title:hover td:first-child div{border-color:#555}table.symbol-edit-popup tr.group-close{pointer-events:none}table.symbol-edit-popup tr.group-close td{padding:0;height:0;font-size:0;background-color:transparent}table.symbol-edit-popup tr.hidden{display:none}table.symbol-edit-popup td{padding:7px}table.symbol-edit-popup td:first-child{padding-left:20px}table.symbol-edit-popup td:last-child{max-width:130px;padding-right:20px}tr.symbol-edit-popup{cursor:pointer;height:25px}tr.symbol-edit-popup td:first-child{max-width:105px}span.symbol-edit-highlight{color:#4c82ce;font-weight:700}.symbol-edit-popup-td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:230px;line-height:14px;vertical-align:middle}.symbol-edit-popup-td.name{font-weight:700}.symbol-edit-popup-td.desc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:100%}.symbol-edit-popup-td.name strong,.symbol-edit-popup-td.desc strong{font-weight:700;color:#4c82ce}.symbol-edit-popup-td.type{font-size:11px;color:#999;white-space:nowrap;text-align:right}tr.symbol-edit-popup:hover:not(.group-title):not(.group-close){background:#f2f5f8}.symbol-edit-popup-active{background:#d1e1f8}.symbol-edit-popup i.eod,.symbol-edit-popup i.pro{display:inline-block;height:auto;width:auto;font-size:10px;color:#fff;text-transform:uppercase;font-style:normal;line-height:12px;vertical-align:0;padding:1px 3px 0;overflow:visible}.symbol-edit-popup i.eod{background:#c9cbcd}.symbol-edit-popup i.pro{background:#bf645c}.symbol-edit-plus{display:block;width:25px;height:28px;position:absolute;top:1px;right:0;cursor:pointer}.symbol-edit-plus span{display:block;width:15px;height:15px;position:relative;top:7px;left:3px;background:url(images/icons.png) no-repeat -80px -220px}.symbol-edit-plus:hover span{background-position:-120px -300px}.symbol-edit-history-popup{padding:1px;overflow-y:auto;border:1px solid #999;z-index:11;cursor:pointer;background:#fff;background:rgba(255,255,255,.9);box-shadow:0 1px 2px rgba(0,0,0,.3);width:410px}.symbol-edit-history-popup .heading{background:#ddd;cursor:pointer;padding:4px 5px;color:#626262;font-size:11px;font-weight:700;cursor:default}.symbol-edit-history-popup .symbol{cursor:pointer;height:14px;padding:5px;color:#595959;font:12px Arial;clear:both;position:relative}.symbol-edit-history-popup .symbol .s{float:left;width:70px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.symbol-edit-history-popup .symbol .d{float:left;width:247px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.symbol-edit-history-popup .symbol .t{position:absolute;right:3px;top:5px;color:#999;font-size:11px;text-align:right}.symbol-edit-history-popup .symbol:hover{background:#e5edf7;color:#29313c}.symbol-search-dialog .symbol-block{width:auto;margin:0;overflow:hidden}.symbol-search-dialog .symbol-block .spread-actions{height:36px;border-top:none;border-right:none;background:#fff}.symbol-search-dialog .symbol-block .spread-actions:empty{border:none;background:0 0}.symbol-search-dialog .symbol-block button{width:30px;height:36px;border-left:1px solid #c9cbcd}.symbol-search-dialog .symbol-block button:first-child{border-left:none}.symbol-search-dialog .symbol-block button .action-icon{top:8px;left:4px}.symbol-search-dialog .symbol-block-inputspacer{overflow:hidden}.symbol-search-dialog .symbol-block-inputspacer input{width:100%;height:37px;font-size:13px;margin:0;padding:0 7px 0 34px;border-width:0;border-bottom-width:1px;border-radius:0;float:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.symbol-search-dialog .symbol-block-inputspacer .search-cion{content:" ";display:block;position:absolute;width:13px;height:13px;background:url(images/icons.png) no-repeat -80px -339px;top:12px;left:12px}.symbol-search-dialog .filter{padding:0 20px;border-bottom:1px solid #dde1e6}.symbol-search-dialog .filter a.type-filter,.symbol-search-dialog .filter .exchange-filter{position:relative;display:inline-block;margin-right:20px;padding:10px 0;color:#595959}.symbol-search-dialog .filter a.type-filter a,.symbol-search-dialog .filter .exchange-filter a{color:#595959}.symbol-search-dialog .filter a.type-filter.active,.symbol-search-dialog .filter .exchange-filter.active{font-weight:700}.symbol-search-dialog .filter a.type-filter.active:after,.symbol-search-dialog .filter .exchange-filter.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.symbol-search-dialog .filter a.type-filter:last-child,.symbol-search-dialog .filter .exchange-filter:last-child{margin-right:0}.symbol-search-dialog .results{height:500px;overflow-x:hidden;overflow-y:auto;margin:0}.symbol-search-dialog .results table{width:100%;border-collapse:collapse}.symbol-search-dialog .results table .symbol-edit-popup-td:first-child{padding-left:20px}.symbol-search-dialog .results table .symbol-edit-popup-td:last-child{padding-right:20px}.symbol-search-dialog .results table tr:first-child .symbol-edit-popup-td{padding-top:12px}.spread-actions{float:right;height:28px;border:1px solid #c9cbcd;background:#fff;margin:0}.spread-actions button::-moz-focus-inner{padding:0!important;margin:0!important}.spread-actions button{position:relative;float:left;width:20px;height:25px;background:0 0;padding:0;margin:0;border:none;cursor:pointer}.spread-actions button.disabled{cursor:default}.spread-actions button .action-icon{position:absolute;top:3px;left:0;width:20px;height:20px;display:block;overflow:hidden}.spread-actions button .action-icon .sprite{height:60px;width:20px;background:url(images/dialogs/spread-actions.png) 0 0 no-repeat;position:absolute;left:0;top:0;margin-top:1px}.spread-actions button:hover .action-icon .sprite{top:-20px}.spread-actions button.disabled .action-icon .sprite{top:-40px}.spread-actions button.div .action-icon .sprite{background-position:0 0}.spread-actions button.minus .action-icon .sprite{background-position:-20px 0}.spread-actions button.plus .action-icon .sprite{background-position:-40px 0}.spread-actions button.mult .action-icon .sprite{background-position:-60px 0}.spread-actions button.open .action-icon .sprite{background-position:-80px 0}.spread-actions button.close .action-icon .sprite{background-position:-100px 0}.spread-actions button.flip .action-icon .sprite{background-position:-120px 0}.spread-actions button.power .action-icon .sprite{background-position:-140px 0}div.symbol-edit-popup .exchange-filter,.symbol-search-dialog .exchange-filter{float:right}div.symbol-edit-popup .exchange-filter .tv-unstyled-select-container{display:inline-block}.symbol-search-dialog .exchange-filter .sbSelector{display:block;margin:0 12px 0 0}div.symbol-edit-popup .exchange-filter .sbSelector{display:block;margin:0 10px 0 0;font-weight:700;font-size:11px;height:13px}div.symbol-edit-popup .exchange-filter .sbToggle,.symbol-search-dialog .exchange-filter .sbToggle{width:9px;height:5px;position:absolute;top:6px;right:0;background:url(images/select-bg.png) 0 0}.symbol-edit-popup .filter{padding:0 20px;margin:0;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.symbol-edit-popup .filter a.type-filter,.symbol-edit-popup .filter .exchange-filter{padding:6px 0;margin-right:20px;font-weight:700;font-size:11px;display:inline-block;border-bottom:none;position:relative;color:#595959}.symbol-edit-popup .filter a.type-filter a,.symbol-edit-popup .filter .exchange-filter a{color:#595959}.symbol-edit-popup .filter a.type-filter.active:after,.symbol-edit-popup .filter .exchange-filter.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.symbol-edit-popup .filter a.type-filter:last-child,.symbol-edit-popup .filter .exchange-filter:last-child{margin-right:0}.symbol-edit-popup .filter .exchange-filter{margin:0}.compare-widget,.addsymbol-widget{position:relative}.compare-widget .symbol-edit-widget,.addsymbol-widget .symbol-edit-widget{margin:0 0 10px;width:300px}.compare-widget .symbol-edit-widget input.symbol-edit,.addsymbol-widget .symbol-edit-widget input.symbol-edit{width:265px;font-weight:400}.compare-widget .symbol-edit-widget input.symbol-edit:focus,.addsymbol-widget .symbol-edit-widget input.symbol-edit:focus{border-color:#4c82ce}.compare-widget .close-button,.addsymbol-widget .close-button{position:absolute;right:5px;top:5px}.compare-widget p,.addsymbol-widget p{margin:0;color:#8b8c8e;font-weight:700}.compare-widget p.vspace{margin:6px 0}.compare-widget p.note{font-weight:400;font-size:11px;margin-top:9px}.compare-widget p.note a{display:inline-block;border-bottom:dashed 1px #007fb9;font-weight:700}.compare-widget .tab-arrow{position:absolute;left:27px;top:-10px}.compare-widget .tv-button{padding:5px 18px 5px;color:#8b8c8e}.compare-widget .predefine-section{float:left;margin:0 10px 0 0;font-size:12px}.compare-widget .predefine-heading{text-transform:uppercase;color:#000;margin:0 0 5px 3px}.addsymbol-widget .opts-line,.compare-widget .predefine-line{color:#4c5151}.addsymbol-widget .opts-line{margin:5px 0}.addsymbol-widget .opts-line label,.compare-widget .predefine-line label{position:relative;top:-2px;padding:0 0 0 4px}.header-chart-panel .button:hover,.symbol-edit-widget .button:hover{background:#fff;color:#333}.header-chart-panel .button:active,.header-chart-panel .button.active,.header-chart-panel .button.active:hover,.symbol-edit-widget .button:active,.symbol-edit-widget .button.active,.save-load-buttons a:not(.link):active,.save-load-buttons .active,.save-load-buttons .active:hover,.hotlist-controls .button.active,.hotlist-controls .button:active,.ch-controls .button.active,.ch-controls .button:active,.bottom-widgetbar-content.backtesting .button:active,.bottom-widgetbar-content.backtesting .button.active{background:#f2f5f8!important;color:#333}.header-chart-panel .icon-container-toggle{width:70px;margin:0}.header-chart-panel .icon-container-toggle a{height:14px}.header-chart-panel .button.no-last{border-top-right-radius:0;border-bottom-right-radius:0}.header-chart-panel .button.no-first{border-top-left-radius:0;border-bottom-left-radius:0;border-left:0}.is-mobile .favored-list-container{background:#b5b7ba;color:#fff}.favored-list-container>span,.favored-list-container>div{vertical-align:top}.favored-list-container>div{display:inline-block}.favored-list-container span{display:inline-block;height:14px;position:relative;vertical-align:top;color:#524f4f;font-size:11px;font-weight:700;background:#fff;border:1px solid #c9cbcd;border-width:1px 1px 1px 0;padding:7px 12px 7px;cursor:default}.is-mobile .favored-list-container span{padding:15px 17px 11px;background:#b5b7ba;color:#fff;border:none}.is-mobile .favored-list-container span:active,.is-mobile .favored-list-container span.active,.is-mobile .favored-list-container span.selected{background:#b5b7ba!important;color:#58c3e5}.is-mobile .favored-list-container span:hover{background:#b5b7ba;color:#fff}.is-mobile .favored-list-container span.disabled,.is-mobile .favored-list-container span.disabled:active,.is-mobile .favored-list-container span.disabled.active{color:#ddd;background:#c2c4c6!important}.favored-list-container span:active,.favored-list-container span.active,.favored-list-container span.selected{background:#f2f5f8!important;color:#58c3e5}.favored-list-container span:hover{background:#fff;color:#68696b}.favored-list-container span.disabled,.favored-list-container span.disabled:active,.favored-list-container span.disabled.active{color:#adafb3;background:#f1f3f6!important;border-color:#c9cbcd;box-shadow:none}.favored-list-container .quick span:first-child{border-width:1px}.favored-list-container:not(.no-first) .favored-list-container .quick span:first-child{border-width:1px}.favored-list-container span.submenu{padding:0;width:20px;height:28px;position:relative}.is-mobile .favored-list-container span.submenu{width:30px;height:40px}.favored-list-container span.submenu i{display:block;width:9px;height:5px;position:absolute;top:12px;right:6px;background:url(images/select-bg.png)}.is-mobile .favored-list-container span.submenu i{background:#b5b7ba;background:url(images/mobile/select-bg.png);width:14px;height:8px;top:15px;right:8px}.is-mobile .favored-list-container span.submenu i:before{position:absolute;content:" ";width:1px;height:24px;background:#cbcdcf;top:-7px;left:-9px}.is-mobile .favored-list-container span.submenu i.study-template-icon{background:url(images/mobile/icons.png) -21px -18px}.is-mobile .favored-list-container span.submenu i.study-template-icon:before{display:none}.favored-list-container span.submenu.interval-dialog-button{border-right-style:dotted}.favored-list-container span.submenu.interval-dialog-button i{background:#8b8c8e;top:50%;left:50%;margin-top:-1px;margin-left:-1px;width:3px;height:3px;border-radius:2px}.is-mobile .favored-list-container span.submenu.interval-dialog-button i{background-color:#fff}.favored-list-container span.submenu.interval-dialog-button i:before,.favored-list-container span.submenu.interval-dialog-button i:after{content:'';display:block;position:absolute;left:0;width:3px;height:3px;background:inherit;border-radius:2px}.favored-list-container span.submenu.interval-dialog-button i:before{top:-6px}.favored-list-container span.submenu.interval-dialog-button i:after{bottom:-6px}.favored-list-container span.submenu.interval-dialog-button.active i{background:#5ec6e8}.is-mobile .favored-list-container span.submenu.interval-dialog-button.active i{background-color:#fff}.favored-list-container.active span.submenu,.favored-list-container span.submenu.active{color:#adafb3;background:#f1f3f6!important;border-color:#c9cbcd}.favored-list-container.active span.submenu i,.favored-list-container span.submenu.active i{background-position:0 -20px}.is-mobile .favored-list-container.active span.submenu i,.is-mobile .favored-list-container span.submenu.active i{background-position:0 -24px}.button.iconed,.header-chart-panel .button.iconed{padding:6px 10px 8px}.header-chart-panel .button.disabled,.header-chart-panel .button.disabled:active,.header-chart-panel .button.disabled.active{background:#fff!important;border-color:#dde1e6;box-shadow:none}.header-chart-panel .button.disabled i{opacity:.5}.button.iconed i{display:inline-block;width:15px;height:15px;background-image:url(images/icons.png)}.button.undo,.button.redo{padding:8px 5px 6px}.button.undo svg,.button.redo svg{width:15px;height:14px;fill:#8a8b8d}.button.undo.disabled svg,.button.redo.disabled svg{fill:#a5a5a5}.header-chart-panel .button.redo{left:-1px}.button.fullscreen,.header-chart-panel .button.fullscreen{margin-left:4px;padding:5px 6px 9px}.button.fullscreen svg{fill:#8a8b8d}.button.properties svg{fill:#7d7d7d}.button.properties:hover svg{fill:#68696b}.button.properties.active svg{fill:#5ec6e8}.button.alerts svg{width:20px;height:18px;fill:#8a8b8d}.button.alerts:hover svg,.button.alerts:active svg,.button.alerts.active svg{fill:#747474}.button.indicators svg{fill:#7d7d7d}.button.indicators:not(:only-child){border-right:none}.button.indicators.active svg{fill:#5ec6e8}.button.compare svg{fill:#7d7d7d}.button.compare.active svg{fill:#5ec6e8}.button.script-editor svg{fill:#7d7d7d}.button.script-editor.active svg{fill:#5ec6e8}.button.bars,.header-chart-panel .button.bars{padding:3px 22px 8px 9px}.button.bars i i,.chart-style-widget span i{display:inline-block;width:19px;height:19px;background:url(chart-client/css/images/bartype-icons.png)}.favored-list.study-template-popup{width:268px}.favored-list.study-template-popup .item .title-expanded{width:190px}.header-chart-panel .button.objects-tree{padding:6px 7px 8px 6px!important}.header-chart-panel .button.objects-tree i{width:18px;height:16px;background-position:1px -461px}.header-chart-panel .button.objects-tree:active i,.header-chart-panel .button.objects-tree.active i{background-position:-19px -461px}.favored-list-container.study-template-widget{float:left}.favored-list-container.study-template-widget svg{fill:#7f7f7f}.favored-list-container.study-template-widget .submenu{border-left-style:dotted;border-left-width:1px}.is-mobile .favored-list-container.study-template-widget .submenu{border-left:none}.favored-list-container.study-template-widget .quick>span{padding:7px 4px 7px}.favored-list-container.study-template-widget .quick>span i{display:block;background:url(images/icons.png) 0 -380px;width:13px;margin-top:1px;height:13px}.favored-list-container.study-template-widget .quick>span:first-child{border-left-width:1px}.favored-list-container.study-template-widget .quick>span:last-child{border-right-style:none}.header-chart-panel .button.published-timeline{padding:4px 7px 10px 7px}.header-chart-panel .button.published-timeline:not(:only-child){border-right-style:dotted}.header-chart-panel .button.published-timeline svg{fill:#7d7d7d}.header-chart-panel .button.published-timeline:active svg,.header-chart-panel .button.published-timeline.active svg{fill:#5ec6e8}.header-chart-panel .button.published-settings{position:relative;border:1px solid #c9cbcd;border-width:1px 1px 1px 0;cursor:default;padding:0;width:20px;height:28px;display:inline-block}.header-chart-panel .button.published-settings i{display:block;width:9px;height:5px;position:absolute;top:12px;right:6px;background:url(images/select-bg.png)}.header-chart-panel .button.published-settings:active i,.header-chart-panel .button.published-settings.active i{background-position:0 -20px}.is-mobile .header-chart-panel .button.published-settings:active i,.is-mobile .header-chart-panel .button.published-settings.active i{background-position:0 -24px}.up-active{position:relative}.charts-popup-list.chart-style-popup{width:195px}.charts-popup-list.chart-style-popup .item .title{width:120px;vertical-align:top;line-height:25px;padding-left:5px}.chart-style-popup .item{padding:5px 7px 0 7px;height:30px;transform:translate(0,0)}.chart-style-popup .item span.icon{width:19px;height:19px;margin-top:-1px}.chart-style-popup .item.active span.icon{background-position-y:-19px!important}.chart-style-popup .item svg{fill:#7d7d7d}.chart-style-widget svg{fill:#7d7d7d}.chart-style-widget span{padding:1px 8px 13px}.chart-style-widget span.selected svg{fill:#5ec6e8}.save-load-buttons{margin:0;float:left}.save-load-buttons>span{display:block;float:left;height:15px;max-width:80px;border:1px solid #c9cbcd;border-width:1px 0 1px 1px;padding:7px 12px 6px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#fff;text-align:center;color:#555;font-size:11px;font-weight:600;cursor:default}.save-load-buttons .button:hover{color:#333;border-color:#b5b7b9}.save-load-buttons .button:active,.save-load-buttons .button.active{background-color:#f4f7f9}.save-load-buttons .button.first{border-left:1px solid #c9cbcd}.save-load-buttons .button.last{border-right:1px solid #c9cbcd}.save-load-buttons .save.titled,.save-load-buttons .copy.titled{border-right:0;position:relative;padding-right:15px}.save-load-buttons .title.read-only{cursor:default}.save-load-buttons .read-only{color:#8b8c8e}.save-load-buttons .separator{display:none;width:7px;height:28px;position:absolute;top:0;right:0;background:url(images/save-load-separator-inv.png) 0 50% no-repeat}.save-load-buttons .separator.clicked{background-position:-7px 50%}.save-load-buttons .titled .separator,.save-load-buttons .titled .separator{display:block}.save-load-buttons .load{border-right:none}.save-load-buttons .arrow-icon{display:inline-block;height:5px;width:9px;margin:0 0 0 6px;padding-top:1px;background:url(images/select-bg.png) repeat scroll 0 0 transparent}.save-load-buttons .options .arrow-icon{margin:0}.save-load-buttons .options{padding-left:3px;padding-right:3px}.save-load-buttons .active .arrow-icon{background-position:0 -20px}.save-load-buttons .title{position:relative;max-width:136px;padding-left:5px;padding-right:5px;border-left:0;background:#e6e6e6;cursor:pointer}.save-load-buttons .title .sizer{display:block;min-width:50px;height:10px;visibility:hidden;margin:0;padding:0;border:none;font:700 11px sans-serif;text-align:right}.save-load-buttons input,.save-load-buttons .input{position:absolute;top:7px;left:5px;width:50px;margin:0;padding:0;border:none;background:0 0;color:#737475;font:700 11px sans-serif;text-align:left;cursor:pointer}.save-load-buttons input:focus,.save-load-buttons .input:focus{color:#404040;cursor:text}.save-load-buttons .input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.save-load-buttons .no-change,.save-load-buttons .no-change:hover{cursor:default;background:#e6e6e6}.save-load-buttons .process,.save-load-buttons .no-change.process{background:url(images/bar-loader.gif) 0 0 repeat!important;box-shadow:none!important}.save-load-buttons .button svg{display:inline-block;vertical-align:top;margin:-1px 0;height:18px;width:26px;fill:#8e8e92}.is-mobile .save-load-buttons .separator{display:none}.is-mobile .save-load-buttons .title{padding-top:12px;padding-bottom:11px}.charts-popup-list .item.save-load-chart-title{display:none;cursor:default;background:rgba(248,248,248,.9);border-bottom:1px solid #c9cbcd}.header-chart-panel .button.eotpro-button{color:#fff;background:#0071bc;border-color:#276b91}.header-chart-panel .button.eotpro-button:hover{color:#eee;background:#1088cb}.header-chart-panel .button.eotpro-button:hover .arrow-icon{border-color:#eee transparent transparent transparent}.header-chart-panel .button.eotpro-button.active,.header-chart-panel .button.eotpro-button:active{color:#eee;background:#1088cb!important}.header-chart-panel .button.eotpro-button.active .arrow-icon,.header-chart-panel .button.eotpro-button:active .arrow-icon{border-color:#eee transparent transparent transparent}.header-chart-panel .button.eotpro-button .arrow-icon{width:0;height:0;border-style:solid;border-width:5px 4.5px 0 4.5px;border-color:#fff transparent transparent transparent}.on-widget .header-chart-panel.hidden{height:0;padding:0}.on-widget .header-chart-panel.hidden .left{margin:0}@media (max-width:550px){div.symbol-edit-popup{width:100%}div.symbol-edit-popup .filter{padding:0 10px}div.symbol-edit-popup .filter a.type-filter,div.symbol-edit-popup .filter .exchange-filter{margin-left:0;margin-right:10px}div.symbol-edit-popup .table-wrapper{width:100%}table.symbol-edit-popup{width:100%;table-layout:fixed}table.symbol-edit-popup td{padding:5px}table.symbol-edit-popup td:first-child{padding-left:10px}.symbol-edit-popup-td{overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}.symbol-edit-popup-td.name{width:30%}.symbol-edit-popup-td.desc{width:40%}.symbol-edit-popup-td.type{width:30%}}#footer-chart-panel{padding:0 5px;background-color:#f1f3f6;position:relative;text-align:center}.is-mobile #footer-chart-panel{padding:6px 0;background-color:#fff}.is-mobile #footer-chart-panel .tools-group{float:left}.is-mobile #footer-chart-panel .publish-buttons{margin-top:8px}.is-mobile #footer-chart-panel .publish-buttons a{margin-right:30px}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button .icon{background:url(images/mobile/icons.png) no-repeat}.is-mobile #footer-chart-panel .publish-buttons a.getimage{width:40px;height:40px;border:2px solid #91b521;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.getimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.getimage:active,.is-mobile #footer-chart-panel .publish-buttons a.getimage.active,.is-mobile #footer-chart-panel .publish-buttons a.getimage.selected{background:#fff;border:2px solid #91b521}.is-mobile #footer-chart-panel .publish-buttons a.getimage:not([disabled]),.is-mobile #footer-chart-panel .publish-buttons a.getimage:active:not([disabled]),.is-mobile #footer-chart-panel .publish-buttons a.getimage.active:not([disabled]){background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.getimage .icon{top:2px;width:20px;height:17px;fill:#91b521}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage{width:40px;height:40px;border:2px solid #f46f35;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage:active,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage.active,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage.selected{background:#fff;border:2px solid #f46f35}.is-mobile #footer-chart-panel .publish-buttons a.tweetimage .icon{top:3px;width:20px;height:17px;fill:#f46f35}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage{width:40px;height:40px;border:2px solid #af3b37;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage:hover,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage:active,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage.active,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage.selected{background:#fff;border:2px solid #af3b37}.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage .icon{top:3px;width:20px;height:17px;fill:#af3b37}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button{padding-left:3px;padding-right:3px;width:40px;height:40px;border:2px solid #00adce;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button:hover,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button:active,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button.active,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button.selected{background:#fff;border:2px solid #00adce}.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button .icon{top:1px;left:1px;width:24px;height:17px;background-position:-60px 0}#footer-chart-panel.publish-widget{min-height:41px;border-top:1px solid #d9dadb;padding:5px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#footer-chart-panel.publish-widget label.usage-help{font-size:12px;line-height:30px;margin-left:5px}#footer-chart-panel .bottom-toolbar-tabs{float:left}#footer-chart-panel .bottom-toolbar-tab{position:relative;z-index:1;float:left;height:29px;background:#eff1f4;border:solid #c7c8ca;border-width:1px 1px 0 1px;margin:0 -1px 0 0;font-size:11px;cursor:pointer}#footer-chart-panel .bottom-toolbar-tab .title{display:inline-block;vertical-align:top;min-width:84px;text-align:center;line-height:15px;padding:7px 10px;white-space:nowrap}#footer-chart-panel .bottom-toolbar-tab.active{padding-bottom:1px;margin-bottom:-1px;color:#0099d4}#footer-chart-panel .bottom-toolbar-tab:hover,#footer-chart-panel .bottom-toolbar-tab.active{background:#fff}#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options{display:inline-block;overflow:hidden;width:0;transition:width .4s;vertical-align:top;height:29px;border-left:0 dotted #c7c8ca}#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options i{display:block;width:12px;height:12px;margin:8px auto;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1190px}#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options.active,#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options:hover{border:solid 1px #b5b7b9;margin:-1px -1px -1px 0}#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options.active i,#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options:hover i{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1212px}#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options.active,#footer-chart-panel .bottom-toolbar-tab .bottom-toolbar-tab-options:active{background:#f2f5f8}#footer-chart-panel .bottom-toolbar-tab.active .bottom-toolbar-tab-options{width:20px;border-left-width:1px}table.footer-chart-panel-wrapper{height:32px;border-collapse:collapse}table.footer-chart-panel-wrapper td{padding:0;vertical-align:top}#footer-chart-panel a.publish-chart-button{cursor:default;background:#60a8cd;color:#fff;padding:7px 14px 7px;font-size:12px;font-weight:700;float:left;height:15px;margin:0 0 0 7px}#footer-chart-panel a.publish-chart-button:hover{background:#74b3d3}#footer-chart-panel a.publish-chart-button.inprogress{background:#f1a333}#footer-chart-panel a.publish-chart-button.inprogress:hover{background:#f2ae4d}#footer-chart-panel a.getimage,#footer-chart-panel a.tweetimage,#footer-chart-panel a.stocktwitimage{float:left;margin:0 0 0 7px;position:relative;border:transparent solid 1px;background:0 0}#footer-chart-panel a.getimage .icon,#footer-chart-panel a.tweetimage .icon,#footer-chart-panel a.stocktwitimage .icon{fill:#7b7b7b;background-image:none}#footer-chart-panel a.getimage:hover,#footer-chart-panel a.tweetimage:hover,#footer-chart-panel a.stocktwitimage:hover{border-color:#c7c8ca}#footer-chart-panel a.getimage:active,#footer-chart-panel a.tweetimage:active,#footer-chart-panel a.stocktwitimage:active,#footer-chart-panel a.getimage.active,#footer-chart-panel a.tweetimage.active,#footer-chart-panel a.stocktwitimage.active{border-color:#b5b7b9;background:#f2f5f8}#footer-chart-panel a.getimage:active .icon,#footer-chart-panel a.tweetimage:active .icon,#footer-chart-panel a.stocktwitimage:active .icon,#footer-chart-panel a.getimage.active .icon,#footer-chart-panel a.tweetimage.active .icon,#footer-chart-panel a.stocktwitimage.active .icon{fill:#5fa7cd}a.getimage{padding:6px 4px;border:none}a.getimage .icon{width:20px;height:16px;position:relative;top:-1px}#footer-chart-panel a.tweetimage{padding:6px 4px}#footer-chart-panel a.tweetimage .icon{width:20px;height:16px;position:relative;top:-1px}#footer-chart-panel a.stocktwitimage{padding:6px 4px}#footer-chart-panel a.stocktwitimage .icon{width:22px;height:14px}.icon-container,.icon-container-toggle,#footer-chart-panel .icon-container-select{float:right;margin:0 5px 0 0}.icon-container-add-space{margin-right:10px}.icon-container-extra-space{margin-right:20px}.icon-container a{cursor:default;padding:4px 5px 3px;border:1px solid #c9cbcd;border-right:none;float:left;height:19px;background:url(images/button-bg.png) 0 0;text-align:center;color:#606060;font-size:11px;font-weight:700}.icon-container a:hover{background:#fff}.icon-container a:active{background:#f4f7f9;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.icon-container-toggle a{cursor:default;padding:6px 0 5px;border:1px solid #c9cbcd;border-right:none;float:left;height:15px;background:url(images/button-bg.png) 0 0;text-align:center;color:#8b8c8e;font:700 12px Calibri,Arial,sans-serif;width:29px;text-decoration:none!important}.icon-container-toggle a:hover{color:#68696b;background:#fff}.icon-container-toggle a:active,.icon-container-toggle a.active{background:#f4f7f9;color:#68696b;border-color:#c9cbcd;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.icon-container-toggle a.active+a,.icon-container-toggle a:active+a{border-left-color:#c9cbcd}.icon-container a img{vertical-align:baseline}.icon-container .icon-right,.icon-container-toggle .icon-right{border-right:1px solid #c9cbcd;border-top-right-radius:3px;border-bottom-right-radius:3px}.icon-container .icon-left,.icon-container-toggle .icon-left{border-top-left-radius:3px;border-bottom-left-radius:3px}.icon-container-toggle a.disabled,.icon-container-toggle a.disabled:hover,.icon-container-toggle a.disabled:active{color:silver;background:#fff!important;box-shadow:none}.icon-container .icon-individual{border-radius:2px;border-right:1px solid #c9cbcd}.icon-container-toggle a:active,.icon-container-toggle a.active,.icon-container a:active{background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9);background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9);background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9);background:-o-linear-gradient(top,#f2f7fa,#f4f7f9);background:linear-gradient(top,#f2f7fa,#f4f7f9)}.load-charts-list{width:145px;border:1px solid #999;border-radius:2px;padding:1px;background:#fff;box-shadow:0 1px 2px #bfbfbf;z-index:10;overflow-y:auto}.load-charts-list>div{padding:4px 5px;color:#3e4040;cursor:default}.load-charts-list>div:hover{background:#f4f7f9}.load-charts-list>div.selected{background:#d1e1f8}.load-charts-list>div div:first-child{font-weight:700}.load-charts-list>div div:last-child{font-size:11px}.publish-buttons{position:relative;top:-2px;float:right}.publish-buttons .tv-button{border-width:0}.layout-toggle-container{float:left;margin-right:4px}.layout-toggle-container .tv-button{padding:0;width:45px;height:28px;position:relative;background:#fff}.layout-toggle-container .tv-button svg{fill:#7d7d7d;position:absolute;top:2px;left:2px}.layout-toggle-container .tv-button:before{content:" ";position:absolute;top:12px;right:7px;width:0;height:0;border-style:solid;border-width:5px 4.5px 0 4.5px;border-color:#8f9091 transparent transparent transparent}.layout-toggle-container .tv-button.active{background:#f1f3f6!important}.layout-toggle-container .tv-button.active svg{fill:#5ec6e8}.layout-toggle-container .tv-button.active:before{border-width:0 4.5px 5px 4.5px;border-color:transparent transparent #81bde2 transparent}.layout-widget{position:absolute;z-index:120;border:1px solid #c9cbcd;min-width:296px;box-sizing:border-box;padding:12px 12px 8px 12px;background:#fff;color:#4c5151}.layout-widget .layout-buttons{height:25px;margin-bottom:10px}.layout-widget .layout-button{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:30px;float:left;height:25px;border:1px solid transparent;cursor:pointer}.layout-widget .layout-button svg{fill:#7d7d7d}.layout-widget .layout-button.active{border-color:#c9cbcd;background-color:#f2f5f8}.layout-widget .layout-button.active svg{fill:#5ec6e8}.layout-widget .input-row{margin:4px}.layout-widget .input-row label{position:relative;top:-2px;padding:0 0 0 4px}.tv-side-toolbar{background:#fff;width:51px;color:#babdc2;border-right:1px solid #c9cbcd}.is-mobile .tv-side-toolbar{width:auto;border-right:none;border-top:1px solid #c9cbcd;width:100%}.is-mobile .tv-side-toolbar .tools-group{display:inline-block;margin:3px 0 5px}.is-mobile .tv-side-toolbar .tools-group .button{position:relative;display:inline-block;-webkit-border-radius:20px;-moz-border-radius:20px;border-radius:20px;width:40px;height:40px;border:2px solid #b5b7ba;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:22px;-webkit-background-clip:padding-box;-moz-border-radius:22px;-moz-background-clip:padding;border-radius:22px;background-clip:padding-box;background:#fff;background:0 0;margin-left:15px;margin-right:15px}.is-mobile .tv-side-toolbar .tools-group .button:hover,.is-mobile .tv-side-toolbar .tools-group .button:active,.is-mobile .tv-side-toolbar .tools-group .button.active{background:#fff}.is-mobile .tv-side-toolbar .tools-group .button:hover,.is-mobile .tv-side-toolbar .tools-group .button:active,.is-mobile .tv-side-toolbar .tools-group .button.active,.is-mobile .tv-side-toolbar .tools-group .button.selected{background:#fff;border:2px solid #b5b7ba}.is-mobile .tv-side-toolbar .tools-group .button svg{fill:#7d7d7d}.is-mobile .tv-side-toolbar .tools-group .button.selected svg{fill:#5ec6e8}.is-mobile .tv-side-toolbar .tools-group .button .main{top:3px;left:3px;margin:0;border:none;background:transparent!important}.is-mobile .tv-side-toolbar .tools-group .button .main .text-as-icon{left:3.5px;top:2px}.is-mobile .tv-side-toolbar .tools-group .button .side{content:" ";position:absolute;visibility:visible;top:-12px;left:16px;width:0;height:0;border-style:solid;border-width:0 3px 3px 3px;border-color:transparent transparent #c9cbcd transparent;background:0 0}.is-mobile .tv-side-toolbar .tools-group .button .side::-moz-focus-inner{border:0}.is-mobile .tv-side-toolbar .tools-group .button i{top:3px;left:7px}.is-mobile .tv-side-toolbar .tools-group .button:hover i{top:3px;left:7px}.tv-side-toolbar.two-column{width:97px}.tv-side-toolbar.two-column .tv-close-panel{left:98px}.tv-side-toolbar.two-column .tools-group{margin-right:0}.tv-side-toolbar.two-column .tools-group:not(:first-child):not(.no-delimiter):before{width:87px}.tv-side-toolbar.two-column .tools-group:first-child{margin-bottom:-5px}.tv-side-toolbar.two-column .tools-group .button{display:inline-block;width:39px;margin-right:5px}.tv-side-toolbar.two-column .tools-group .button svg{fill:#7d7d7d}.tv-side-toolbar.two-column .tools-group .button.selected svg{fill:#5ec6e8!important}.tv-side-toolbar.hidden{width:0;overflow:hidden}.tv-side-toolbar.hidden>div{display:none}.tv-side-toolbar.hidden .tv-close-panel{left:1px}.tv-side-toolbar .tv-close-panel{position:absolute;top:50%;left:52px;margin-top:-20px;z-index:1}.tv-side-toolbar .button svg{fill:#7d7d7d}.tv-side-toolbar .button.selected svg{fill:#5ec6e8}.charts-popup-list.main-menu-popup{margin-top:0}.tv-side-toolbar .main-menu{display:block;width:39px;height:39px;margin:auto;background:url(images/small-logo.png) center center no-repeat;position:relative;cursor:pointer}.tv-side-toolbar .main-menu:hover,.tv-side-toolbar .main-menu:active,.tv-side-toolbar .main-menu.active{background-color:#e3e5e8}.tv-side-toolbar .main-menu.with-avatar{background:#fff}.tv-side-toolbar .main-menu a{position:absolute;top:0;right:0;padding:1px;background:#5091f7;color:#fff;font-size:10px;font-weight:700;text-align:center;z-index:1;margin-top:1px;margin-right:1px}.tv-side-toolbar .main-menu img{display:block;width:39px;height:39px;position:relative;top:0;left:0}.tv-side-toolbar .tools-group:not(:first-child):not(.no-delimiter):before{content:"";display:block;width:41px;height:1px;position:relative;left:0;background:#cecfd1}.is-mobile .tv-side-toolbar .tools-group:not(:first-child):not(.no-delimiter):before{width:1px;height:36px;position:absolute;top:7px}.tv-side-toolbar .tools-group.bottom-delimiter:after{content:"";display:block;width:41px;height:1px;position:relative;left:0;background:#cecfd1}.tv-side-toolbar .tools-group{margin:5px;position:relative}.tv-side-toolbar .tools-group .button,.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{border:1px solid transparent;cursor:default}.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{display:inline-block}.tv-side-toolbar .tools-group .button{display:block;height:30px;margin:6px 0 0 0;position:relative}.tv-side-toolbar .tools-group .button.hidden{display:none}.tv-side-toolbar .tools-group .button .main.grayed{opacity:.3}.tv-side-toolbar .help-button-container{position:absolute;left:0;bottom:0;z-index:1;height:38px;width:50px;background:#fff}.tv-side-toolbar .help-button-container:before{content:'';display:block;width:100%;height:5px;position:absolute;top:-5px;left:0;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ffffff', GradientType=0)}.tv-side-toolbar .tools-group .button .main{position:absolute;top:0;left:4px;width:30px;height:30px;text-align:center}.tv-side-toolbar .tools-group .button.subgroup .main{left:0}.tv-side-toolbar .tools-group .button .main.text-as-icon{font-weight:700;font-family:FontAwesome;padding-top:5px;text-align:center;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;color:#777;font-size:19px}.tv-side-toolbar .tools-group .button:hover .main.text-as-icon,.charts-popup-list.font-awesome .item span{color:#7d7d7d}.tv-side-toolbar .tools-group .button.selected .main.text-as-icon{color:#5ec6e8}.tv-side-toolbar .tools-group .button .side{position:absolute;top:0;left:30px;width:8px;height:30px;border-left:1px dotted #b6b9be;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAK0lEQVR4AWPYvufAfwYYWLxs9f+tu/b9h3NAeNPO/f/hnI07gLLIylAMAADDBCS+f7PA8AAAAABJRU5ErkJggg==) center center no-repeat;visibility:hidden}.tv-side-toolbar .tools-group .button:hover,.tv-side-toolbar .tools-group .button:active,.tv-side-toolbar .tools-group .button.active,.tv-side-toolbar .tools-group .button.selected,.properties-toolbar .tools-group .button,.drawing-favorites-toolbar .tools-group .button{background-color:#fff;border-color:#c9cbcd}.tv-side-toolbar .tools-group .button:not(.subgroup):active,.tv-side-toolbar .tools-group .button:not(.subgroup).active,.tv-side-toolbar .tools-group .button:not(.subgroup).selected,.properties-toolbar .tools-group .button:active,.properties-toolbar .tools-group .button.active,.drawing-favorites-toolbar .tools-group .button:active,.drawing-favorites-toolbar .tools-group .button.active,.tv-side-toolbar .tools-group .button.selected .main,.tv-side-toolbar .tools-group .button:active .side,.tv-side-toolbar .tools-group .button.active .side{background-color:#f2f5f8}.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup):active,.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup).active,.is-mobile .tv-side-toolbar .tools-group .button:not(.subgroup).selected,.is-mobile .properties-toolbar .tools-group .button:active,.is-mobile .properties-toolbar .tools-group .button.active,.is-mobile .drawing-favorites-toolbar .tools-group .button:active,.is-mobile .drawing-favorites-toolbar .tools-group .button.active,.is-mobile .tv-side-toolbar .tools-group .button.selected .main,.is-mobile .tv-side-toolbar .tools-group .button:active .side,.is-mobile .tv-side-toolbar .tools-group .button.active .side{background-color:transparent}.tv-side-toolbar .tools-group .button:hover .side,.tv-side-toolbar .tools-group .button:active .side,.tv-side-toolbar .tools-group .button.active .side,.tv-side-toolbar .tools-group .button.selected .side{visibility:visible}.tv-side-toolbar .tools-group .button.subgroup:hover:after,.tv-side-toolbar .tools-group .button.subgroup:active:after,.tv-side-toolbar .tools-group .button.subgroup.active:after,.tv-side-toolbar .tools-group .button.subgroup.selected:after{background-position:0 -10px}.tv-side-toolbar .tools-group .button i,.tv-side-toolbar .tools-group .button:hover i{display:block;width:30px;height:30px;position:absolute;top:1px;left:8px;background:url(images/sidetoolbar/instruments.png) no-repeat}.tv-side-toolbar .tools-group .button.subgroup i,.tv-side-toolbar .tools-group .button.subgroup:hover i{position:absolute;left:0;top:0}.tv-side-toolbar .tools-group .button.objects-tree i{background-position:-1px -2561px}.tv-side-toolbar .tools-group .button.objects-tree:active i{background-position:-33px -2561px}.tv-side-toolbar .tools-group .button.action:hover{background:#efeff2;border-color:#c9cbcd}.tv-side-toolbar .label{display:block;margin:10px 0 2px 0;font-size:9px;text-align:center;color:#a1a2a4;cursor:default}.tv-side-toolbar .tools-group .tvcolorpicker-widget{border-color:#babdc2;margin:0 7px 7px}.tv-side-toolbar .tools-group.hide-square div:nth-child(1) span.square{display:none}.tv-side-toolbar .slider{display:block;position:relative;left:13px;width:16px;height:102px}.tv-side-toolbar .slider i{display:block;width:16px;height:16px;border-radius:8px;background:url(images/sidetoolbar/slider-control.png) no-repeat;cursor:pointer;z-index:1}.tv-side-toolbar .slider span{display:block;height:79px;width:14px;position:absolute;left:1px;top:8px;background:url(images/sidetoolbar/slider-bg.png) no-repeat}.help-menu{position:absolute;padding:1px;background:#fff;border:1px solid #c9cbcd;z-index:16}.help-menu span{display:block;position:relative;color:#5a5d66;font-size:13px;padding:7px 24px;cursor:pointer}.help-menu span.external:after{content:'';position:absolute;top:11px;right:7px;width:10px;height:10px;background:url(images/external-link/ext-onwhite.png) no-repeat center right}.help-menu span:hover{color:#414349;background-color:#f4f7f9}.keyboard-help{width:560px}.keyboard-help:after,.keyboard-help>.column:nth-child(2n):after{content:'';display:block;clear:both}.keyboard-help>.column{float:left;width:50%}.keyboard-help>.column-chart{width:290px}.keyboard-help>.column-watch{width:265px}.keyboard-help h4{margin:0}.keyboard-help p{line-height:1.85;margin:3px 0}.keyboard-help kbd{font-size:11px;border:1px solid #777;padding:2px 5px;-webkit-box-shadow:0 2px 0 #777;-moz-box-shadow:0 2px 0 #777;box-shadow:0 2px 0 #777}.line-tool-icons-popup{width:358px;font-size:19px}.line-tool-icons-popup .item{display:inline-block;padding:7px;height:19px;text-align:center}.line-tool-icons-popup .item.active span{color:#5ec6e8}.line-tool-icons-popup .item .title-expanded{width:20px;height:20px}.drawings-popup-list .item>svg{margin:0 5px}.drawings-popup-list .item svg{fill:#7d7d7d}.drawings-popup-list .item.active>svg{fill:#74ddff!important}.widgetbar-wrap{top:0;right:0;position:absolute;height:100%}.widgetbar-wrap.fullscreen{width:100%}.widgetbar-place .widgetbar-wrap{position:fixed;z-index:15}.widgetbar-handle{position:absolute;top:0;left:-3px;height:100%;width:5px;background:0 0;cursor:ew-resize}html.feature-touch .widgetbar-handle{left:-8px;width:15px}.widgetbar-tabs{position:absolute;height:100%;width:45px;right:0;top:0;background:#f1f3f6}.widgetbar-tabscontrols{position:absolute;width:100%;bottom:0}@media (max-height:550px){.widgetbar-tabscontrols{display:none}}.widgetbar-tabscontrols-button{cursor:pointer;height:34px;width:34px;margin:auto}.widgetbar-tabscontrols-button:hover{background:#eee}.widgetbar-minimizebutton .icon{height:16px;width:20px;margin:9px 7px;background-position:-20px -360px}.widgetbar-minimizebutton.minimized .icon{height:16px;width:20px;margin:9px 7px;background-position:-40px -360px}.widgetbar-configbutton .icon{width:20px;height:20px;margin:7px;background-position:-60px -360px}.layout-edit-mode .widgetbar-configbutton .icon{width:22px;height:19px;margin:7px 6px;background-position:-175px -340px}.layout-edit-mode .widgetbar-configbutton,.layout-edit-mode .widgetbar-minimizebutton{display:none}.widgetbar-tab{cursor:pointer;position:relative;border-bottom:solid #c9cbcd 1px;background:#f1f3f6;padding:9px 0}.widgetbar-tab:hover,.widgetbar-tab.active{background:#fff}.widgetbar-tab.active .widgetbar-icon{fill:#5dc5e7}.widgetbar-tab-spacer{height:28px;background:#e7eaef;border-bottom:solid #c9cbcd 1px;text-align:center;text-transform:uppercase;font-size:10px;font-weight:700;line-height:29px;color:#555;cursor:default}.widgetbar-newpage-button{cursor:pointer;position:relative}.widgetbar-newpage-button{display:none}.layout-edit-mode .widgetbar-newpage-button{display:block}.widgetbar-iconplace{display:block;position:relative;margin:1px;padding:6px 0}.widgetbar-newpage-icon,.widgetbar-newwidget-icon,.widgetbar-delete-icon,.widgetbar-icon{display:block;margin:0 auto;fill:#7d7d7d}.widgetbar-chart-helpbutton .widgetbar-icon{width:30px;height:30px}.widgetbar-icon.active{fill:#5dc5e7}.widgetbar-icon-watchlist{background-position:0 -63px}.widgetbar-icon-watchlist.active{background-position:-21px -63px}.widgetbar-icon-hotlist{background-position:0 -84px}.widgetbar-icon-hotlist.active{background-position:-21px -84px}.widgetbar-icon-detail{background-position:0 -105px}.widgetbar-icon-detail.active{background-position:-21px -105px}.widgetbar-icon-news,.widgetbar-icon-news_yahoo{background-position:0 -126px}.widgetbar-icon-news.active,.widgetbar-icon-news_yahoo.active{background-position:-21px -126px}.widgetbar-icon-chat{background-position:0 -147px}.widgetbar-icon-chat.active{background-position:-21px -147px}.widgetbar-icon-messages{background-position:0 -234px}.widgetbar-icon-messages.active{background-position:-21px -234px}.widgetbar-icon-news_stocktwits{background-position:0 -168px}.widgetbar-icon-news_stocktwits.active{background-position:-21px -168px}.widgetbar-icon-news_fxwirepro{background-position:0 -189px}.widgetbar-icon-news_fxwirepro.active{background-position:-21px -189px}.widgetbar-icon-news_futuresmag{background-position:0 -210px}.widgetbar-icon-news_futuresmag.active{background-position:-21px -210px}.widgetbar-icon-calendar{background-position:0 -334px}.widgetbar-icon-calendar.active{background-position:-21px -334px}.widgetpage-icon-svg-base{width:27px;height:22px}.widgetpage-icon-svg-chat{width:23px}.widgetpage-icon-svg-hotlists{height:23px}.widgetpage-icon-svg-calendar{height:23px}.widgetpage-icon-svg-messages{width:23px}.widgetpage-icon-svg-datawindow{width:23px}.widgetpage-icon-svg-notes{width:26px;height:26px}.widgetbar-newwidget-iconplace{cursor:pointer;display:none;position:relative;width:13px;height:13px;padding:6px;border-radius:12px;margin:0 0 0 5px}.layout-edit-mode .widgetbar-tab.active .widgetbar-newwidget-iconplace{display:block}.widgetbar-newwidget-icon{display:block;height:13px;width:13px;background-position:-5px -26px}.widgetbar-newpage-iconplace{position:relative;margin:0 0 0 -1px;padding:12px 7px;background:#39b978;display:block}.widgetbar-newwidget-iconplace,.widgetbar-newpage-iconplace,.widgetbar-applybutton{background:#39b978}.widgetbar-newpage-iconplace:hover,.widgetbar-newpage-iconplace.active,.widgetbar-newwidget-iconplace:hover,.widgetbar-newwidget-iconplace.active,.widgetbar-applybutton:hover{background:#4cbf85}.widgetbar-newpage-icon{width:23px;height:23px;background-position:0 -21px}.widgetbar-delete{position:absolute;top:3px;right:3px;width:28px;height:19px;padding:4px 0 5px 0;cursor:pointer}.widgetbar-delete:hover{background:#dd6e5b}.widgetbar-delete-icon{display:block;width:16px;height:19px;background-position:-26px -42px;margin:0 auto}.widgetbar-delete:hover .widgetbar-delete-icon{background-position:-26px -21px}.widgetbar-notification-wrap{display:none;position:absolute;bottom:-1px;width:100%;text-align:right}.widgetbar-notification{display:inline-block;font-size:12px;line-height:15px;padding:0 3px;min-width:9px;border-radius:3px;background:#e0745f;color:#fff;text-align:center;border:solid 1px #fff}.widgetbar-pages{position:absolute;top:0;right:45px;height:100%;background:#fff;border-left:solid #c9cbcd 1px;border-right:solid #c9cbcd 1px}.widgetbar-pages.hidden{border-right:none}.widgetbar-pages.hidden .widgetbar-pagescontent{display:none}.widgetbar-pagescontent{height:100%;overflow:hidden}.widgetbar-pages.layered{box-shadow:0 0 10px rgba(0,0,0,.15)}.widgetbar-pages .tv-close-panel{position:absolute;top:50%;left:-6px;margin-top:-20px;z-index:1}.widgetbar-page{display:none;height:100%}.widgetbar-page.active{display:block}.widgetbar-widget{margin:0 0 1px 0;position:relative;background-color:#fff}.widgetbar-widget.widgetbar-widget-maximized{position:absolute;top:0;left:0;width:100%;height:100%;z-index:6}.widgetbar-widget.widgetbar-widget-maximized .widgetbar-widgetbody{position:absolute;top:40px;bottom:0;left:0;width:100%;height:auto!important}.widgetbar-widgetheader{background:#f1f3f6;height:34px;cursor:default;margin:3px;-moz-box-sizing:border-box;box-sizing:border-box}.widgetbar-headerspace{position:relative;float:right;overflow:hidden;padding:2px 2px 0 0}.widgetbar-widgetheader-icon{float:left;margin:7px 0 0 10px}.widgetbar-widgetbody{position:relative;overflow:hidden}.widgetbar-widgetbody .widgetbody-overlay{position:absolute;top:0;height:100%;width:100%;z-index:5;background:rgba(255,255,255,.8)}.widgetbar-addwidgetpopup-itemtitle,.widgetbar-widgettitle{height:15px;padding:10px 0 9px 11px;white-space:nowrap;font-size:13px;line-height:15px;font-weight:700;color:#5a5c62}.widgetbar-widgettitle{overflow:hidden;text-overflow:ellipsis}.widgetbar-widgethandle{display:none;position:absolute;height:5px;top:-3px;left:0;width:100%;background:0 0}html.feature-touch .widgetbar-widgethandle{height:15px;top:-8px}.widgetbar-widgethandle,.widgetbar-page.widget-resize-mode,.widgetbar-page.widget-resize-mode *{cursor:ns-resize}.widgetbar-widget+.widgetbar-widget .widgetbar-widgethandle{display:block}.layout-move-mode .widgetbar-widget .widgetbar-widgethandle{display:none}.layout-edit-mode .widgetbar-widgetbody{opacity:.2}.layout-edit-mode .widgetbar-headerspace{display:none}.widgetbar-tab-shield,.widgetbar-movemarker-self,.widgetbar-eventshield,.widgetbar-editshield{position:absolute;top:0;left:0;background:0 0;bottom:0;right:0}.widgetbar-tab-shield,.widgetbar-editshield,.widgetbar-movemarker-self{display:none}.widgetbar-tab-shield.highlighted,.widgetbar-movemarker-self{border:solid #52c3e7 2px;background:rgba(82,195,231,.2)}.layout-edit-mode .widgetbar-editshield{display:block}.widgetbar-editshield.highlighted .widgetbar-movemarker-self{display:block}.widgetbar-editshield-top,.widgetbar-editshield-bottom{display:none;position:absolute;z-index:10;background:0 0}.widgetbar-editshield-top{top:0;left:0;right:0;bottom:50%}.widgetbar-editshield-bottom{top:50%;left:0;right:0;bottom:-1px}.widgetbar-eventshield,.layout-move-mode .widgetbar-editshield-top,.layout-move-mode .widgetbar-editshield-bottom,.layout-move-mode .widgetbar-tab-shield{display:block;cursor:move}.widgetbar-movemarker{display:none;position:absolute;left:0;width:100%;height:3px;background:#52c3e7}.widgetbar-movemarker-top{top:-2px}.widgetbar-movemarker-bottom{bottom:-2px}.widgetbar-movemarker:before,.widgetbar-movemarker:after{content:" ";position:absolute;height:7px;top:-2px;width:1px;background:#52c3e7}.widgetbar-movemarker:before{left:0}.widgetbar-movemarker:after{right:0}.widgetbar-movemarker.highlighted{display:block}.widgetbar-addwidgetpopup{position:absolute;z-index:100;top:-1px;right:38px;background:#fff;fill:#fff;border:solid #d6dadf 1px;stroke:#d6dadf;stroke-width:1px}.widgetbar-newwidget-iconplace .widgetbar-addwidgetpopup{right:32px;top:-12px}.widgetbar-addwidgetpopup-list{overflow:auto}.widgetbar-addwidgetpopup-ear{position:absolute;width:10px;height:19px;top:14px;right:-10px}.widgetbar-addwidgetpopup-item{overflow:hidden;height:21px;margin:1px;cursor:pointer;padding:8px 10px}.widgetbar-addwidgetpopup-item:hover{background:#f2f5f8}.widgetbar-addwidgetpopup-itemtitle{padding:2px 0;margin:0 3px 0 30px;min-width:160px}.widgetbar-addwidgetpopup-item .widgetbar-icon{float:left}.widgetbar-editblock{display:none;position:absolute;width:100%;left:0;bottom:0;background:#dee4ec;height:50px}.layout-edit-mode .widgetbar-editblock{display:block}.widgetbar-applybutton,.widgetbar-applybutton:hover{cursor:pointer;display:block;height:15px;color:#fff;font-size:12px;line-height:15px;padding:8px 2px 7px 2px;text-align:center;text-transform:uppercase;margin:10px}.widgetbar-headerspace .button{padding-top:5px;background-color:#fff;border:1px #c9cbcd solid;font-size:12px;line-height:15px;width:39px;height:30px;float:left;display:block;position:relative;text-align:center;box-sizing:border-box;-moz-box-sizing:border-box;margin-left:4px}.widgetbar-headerspace .button.button-half{width:20px}.widgetbar-headerspace .button.button-half.button-nomarginleft{margin-left:0;border-left-width:0}.widgetbar-headerspace .button.detach-chat{margin-left:4px}.widgetbar-headerspace .button.with-arrow:after{content:" ";width:9px;height:5px;display:inline-block;vertical-align:middle;background:url(images/select-bg.png) 0 0 no-repeat;margin:0 0 0 4px}.widgetbar-headerspace .button .icon-list{width:18px;height:14px;background-position:0 -280px}.widgetbar-headerspace .button:hover .icon-list{background-position:0 -360px}.widgetbar-headerspace .button.active .icon-list{background-position:-122px -421px}.widgetbar-headerspace .button .icon-list-dots{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2018px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden;margin-right:2px}.widgetbar-headerspace .button:hover .icon-list-dots,.widgetbar-headerspace .button.active .icon-list-dots{height:16px;width:16px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2044px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.widgetbar-headerspace .button .icon-config{width:17px;height:17px;background-position:-160px -240px}.widgetbar-headerspace .button:hover .icon-config{background-position:-40px -340px}.widgetbar-headerspace .button.active .icon-config{background-position:0 -440px}.widgetbar-headerspace .button .icon-find{width:17px;height:17px;background-position:-23px -337px}.widgetbar-headerspace .button .icon-mentions{width:17px;height:17px;background-position:-80px -400px}.widgetbar-headerspace .button:hover .icon-mentions{background-position:-19px -440px}.widgetbar-headerspace .button.active .icon-mentions{background-position:-37px -440px}.widgetbar-headerspace .button.svg-detach svg{margin:4px 0 2px 0}.widgetbar-headerspace .button:hover .icon-detach,.widgetbar-headerspace .button.active .icon-detach{background-position:-140px -150px}.widgetbar-headerspace .button .icon-maximize{width:8px;height:18px;background-position:-112px -460px}.widgetbar-headerspace .button:hover .icon-maximize{background-position:-125px -460px}.widgetbar-headerspace .button.active .icon-maximize{background-position:-138px -460px}.widgetbar-headerspace .button .icon-plus{width:16px;height:14px;left:0;margin:1px 0 0;background-position:-179px -162px}.widgetbar-headerspace .button:hover .icon-plus,.widgetbar-headerspace .button.active .icon-plus{background-position:1px -162px}.widgetbar-headerspace .button .icon-phone{width:20px;height:20px;left:0;margin:-1px 0 0;background-position:-80px -380px}.widgetbar-headerspace .button:hover .icon-phone,.widgetbar-headerspace .button.active .icon-phone{background-position:-60px -380px}.widgetbar-headerspace .button .icon-hangup{width:20px;height:20px;left:0;margin:-1px 0 0;background-position:-40px -380px}.widgetbar-headerspace .button:hover .icon-hangup,.widgetbar-headerspace .button.active .icon-hangup{background-position:-20px -380px}.widgetbar-headerspace .button .icon-members{width:15px;height:15px;background-position:-158px -20px}.widgetbar-headerspace .button:hover .icon-members,.widgetbar-headerspace .button.active .icon-members{background-position:-158 -20px}.widgetbar-headerspace .button.active{background-color:#f2f5f8!important}.widgetbar-headerspace .button svg{fill:#7d7d7d}.widgetbar-headerspace .button.active svg{fill:#49b6d8}.widgetbar-widget-messages .input-reset:before{margin-top:-6px}.widgetbar-tabscontrols .widgetbar-chart-helpbutton{margin:5px auto;width:30px;height:30px;cursor:pointer}.widgetbar-tabscontrols .widgetbar-chart-helpbutton:hover .widgetbar-tabscontrols .widgetbar-chart-helpbutton.active{opacity:.8}.horizontal{height:100%}.horizontal .widgetbar-wrap{position:relative;width:100%}.horizontal .widgetbar-pages{width:100%;top:45px;right:0;left:0;bottom:0;border:none}.horizontal .widgetbar-tabs{width:100%;height:auto}.horizontal .widgetbar-tabs .widgetbar-tab-spacer{display:inline-block;height:45px;line-height:46px;padding:0 6px;margin:0;float:left}.horizontal .widgetbar-tabs .widgetbar-tab{display:inline-block;width:36px;height:45px;padding:0;border-bottom:none}.horizontal .widgetbar-tabs .widgetbar-tab .widgetbar-iconplace{padding-top:11px}.extension .widgetbar-tabs{background:#2e3540}.extension .widgetbar-tabs .widgetbar-tab-spacer{display:none}.extension .widgetbar-tabs .widgetbar-tab{box-sizing:border-box;width:25%;background:0 0}.extension .widgetbar-tabs .widgetbar-tab:hover,.extension .widgetbar-tabs .widgetbar-tab.active{background:0 0}.extension .widgetbar-tabs .widgetbar-tab:last-child{width:24%}.extension .widgetbar-widget{margin:0}.extension .widgetbar-headerspace{padding:0}.extension .widgetbar-widgetheader{margin:0}.extension .tv-messages-header{padding:0}.extension .ch-input .wrap{padding:0}.extension .msg-window-body.chat-page .ch-input .wrap{padding:0}.extension .pc-data{margin:0}.extension .msg-data{margin:0}.extension .symbol-list-item{margin-left:0;margin-right:0}.extension .widgetbar-widgetheader .standalone-chat-select{height:34px}.extension .widgetbar-widgetheader .standalone-chat-select:after{top:15px}.extension .widgetbar-widgetheader .standalone-chat-list{left:0}.extension .widgetbar-widgetheader .button{height:34px;line-height:33px;text-align:center;width:30px;border:none;margin:0;padding:0;background:0 0}.extension .widgetbar-widgetheader .button:hover{border:none;background:0 0}.extension .widgetbar-widgetheader .button .icon{display:inline-block}.extension .widgetbar-widgetheader .button .icon-plus{width:14px;height:14px;background-position:-180px -162px}.extension .widgetbar-widgetheader .button svg{margin-top:9px}.extension .widgetbar-widgetheader .msg-empty{line-height:34px}.extension .widgetbar-widgetheader .wl-symbol-edit{text-transform:none;font-weight:400;height:34px;border:none;line-height:34px;background:0 0}.extension .widgetbar-widgetheader .wl-symbol-edit:focus{background:rgba(255,255,255,.6)}.drawing-favorites-toolbar{top:140px;left:100px;position:absolute;height:35px;z-index:15;background:#fff;border:1px solid #c9cbcd;white-space:nowrap;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,.15);box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.drawing-favorites-toolbar span{transform:translate(0,0)}.drawing-favorites-toolbar span svg{fill:#7d7d7d}.drawing-favorites-toolbar span.active{background-color:#f2f5f8!important}.drawing-favorites-toolbar span.active svg{fill:#5ec6e8!important}.drawing-favorites-toolbar .tools-group{display:inline-block;padding:0 0 0 3px;vertical-align:top}.drawing-favorites-toolbar .drag-handler{display:inline-block;height:35px;width:16px;position:relative}.drawing-favorites-toolbar .drag-handler i{margin:7px;position:absolute;width:6px;height:22px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAFUlEQVR4AWPYs2fPfxBmgAKEANEAAL6kDM2cESQVAAAAAElFTkSuQmCC)}.drawing-favorites-toolbar .button{width:36px;height:31px;padding:2px;position:relative;text-align:center;border-top:0!important;border-bottom:0!important;border-left:0!important}.drawing-favorites-toolbar .button:first-of-type{border-left:1px solid #c9cbcd!important}.drawing-favorites-toolbar .button:last-of-type{border-right:0!important}.drawing-favorites-toolbar .button:hover:after{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid!important;background:0 0;z-index:1}.drawing-favorites-toolbar .button.active,.drawing-favorites-toolbar .button:active,.drawing-favorites-toolbar .button:focus{background-color:#f2f5f8!important}.drawing-favorites-toolbar .button i{width:30px;height:30px;display:inline-block;background-image:url(images/sidetoolbar/instruments.png);margin-top:1px}.properties-toolbar{position:absolute;top:70px;left:40%;height:35px;z-index:15;background:#fff;border:1px solid #c9cbcd;white-space:nowrap;-webkit-box-shadow:0 0 10px 0 rgba(0,0,0,.15);-moz-box-shadow:0 0 10px 0 rgba(0,0,0,.15);box-shadow:0 0 10px 0 rgba(0,0,0,.15)}.properties-toolbar span{transform:translate(0,0)}.properties-toolbar:after{clear:both;display:table;content:""}.properties-toolbar .charts-popup-list{margin-top:-1px!important;margin-left:-1px!important;border-color:#c9cbcd!important}.properties-toolbar>div,.properties-toolbar .tools-group{display:inline-block;vertical-align:top}.properties-toolbar>div>div,.properties-toolbar .tools-group>div,.properties-toolbar>div>input,.properties-toolbar .tools-group>input{display:inline-block;vertical-align:top}.properties-toolbar svg{fill:#7d7d7d}.properties-toolbar .tv-button{padding:10px 16px 10px 10px;margin:0!important;border:0!important;background-image:none}.properties-toolbar .tv-button .icon{position:absolute;right:5px;top:17px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0 2px;border-color:#707275 transparent transparent transparent;border-style:inset}.properties-toolbar .tools-group{position:relative;height:35px;padding:0;vertical-align:top}.properties-toolbar .tools-group>div,.properties-toolbar .tools-group>span,.properties-toolbar .tools-group>a,.properties-toolbar .tools-group>.colorpicker-widget{margin-right:3px}.properties-toolbar .tools-group.properties-tools-group{border-left:1px solid #c9cbcd}.properties-toolbar .tools-group.properties-tools-group>div,.properties-toolbar .tools-group.properties-tools-group>span,.properties-toolbar .tools-group.properties-tools-group>a,.properties-toolbar .tools-group.properties-tools-group>.colorpicker-widget{margin-right:0}.properties-toolbar .tools-group .button{width:36px;height:31px;padding:2px;position:relative;text-align:center;margin-right:0;border-top:0!important;border-bottom:0!important;border-left:0!important}.properties-toolbar .tools-group .button:first-of-type{border-left:1px solid #c9cbcd!important}.properties-toolbar .tools-group .button:last-of-type{border-right:1px!important}.properties-toolbar .tools-group .button.with-arrow{width:40px}.properties-toolbar .tools-group .button.with-arrow:after{position:relative;top:5px;left:5px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0 2px;border-color:#707275 transparent transparent transparent;border-style:inset}.properties-toolbar .tools-group .button.open{background-color:#f2f5f8!important}.properties-toolbar .tools-group .button.open svg{fill:#5ec6e8!important}.properties-toolbar .tools-group .button.active,.properties-toolbar .tools-group .button:active,.properties-toolbar .tools-group .button:focus{background-color:#f2f5f8!important}.properties-toolbar .tools-group .button.active svg,.properties-toolbar .tools-group .button:active svg,.properties-toolbar .tools-group .button:focus svg{fill:#5ec6e8!important}.properties-toolbar .tools-group .colorpicker-widget{border-color:#c9cbcd;border:0!important;width:40px;margin-top:1px;height:34px;cursor:default;border-right:1px solid #c9cbcd!important}.properties-toolbar .tools-group .colorpicker-widget:last-of-type{border-right:0!important}.properties-toolbar .tools-group .colorpicker-widget.svg-pencil{background-image:url(images/svg/chart/pencil2.svg)}.properties-toolbar .tools-group .colorpicker-widget.svg-pencil:focus{background-image:url(images/svg/chart/pencil2_active.svg)}.properties-toolbar .tools-group .colorpicker-widget.svg-bucket{background-image:url(images/svg/chart/bucket2.svg)}.properties-toolbar .tools-group .colorpicker-widget.svg-bucket:focus{background-image:url(images/svg/chart/bucket2_active.svg)}.properties-toolbar .tools-group .colorpicker-widget.svg-font{background-image:url(images/svg/chart/font.svg)}.properties-toolbar .tools-group .colorpicker-widget.svg-font:focus{background-image:url(images/svg/chart/font_active.svg)}.properties-toolbar .tools-group .colorpicker-widget:hover:after{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}.properties-toolbar .tools-group .custom-select{height:35px!important}.properties-toolbar .tools-group .custom-select .switcher{padding:5px 0;height:25px;width:40px;min-width:40px;background-color:#fff;border-top:0;border-bottom:0;border-right:0}.properties-toolbar .tools-group .custom-select .switcher.open{background-color:#f2f5f8}.properties-toolbar .tools-group .custom-select .switcher.open svg{fill:#5ec6e8!important}.properties-toolbar .tools-group .custom-select .switcher svg{fill:#7d7d7d}.properties-toolbar .tools-group .custom-select .switcher .title{width:40px;height:25px;padding:0}.properties-toolbar .tools-group .custom-select .switcher .icon{position:absolute;right:7px;top:16px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0 2px;border-color:#707275 transparent transparent transparent;border-style:inset}.properties-toolbar .tools-group .custom-select:first-of-type .switcher{border-left:1px solid #c9cbcd}.properties-toolbar .tools-group .custom-select .items{width:auto;top:35px}.properties-toolbar .tools-group .custom-select .items span{display:inline-block}.properties-toolbar .tools-group .custom-select .items .item{padding:0;display:inline-block;height:35px;width:40px;border:0;border-right:1px solid #c9cbcd}.properties-toolbar .tools-group .custom-select .items .item:last-of-type{border-right:0}.properties-toolbar .tools-group .custom-select .items .item svg{fill:#7d7d7d;position:relative;top:5px;left:4px}.properties-toolbar .tools-group .custom-select .items .item.selected svg{fill:#5ec6e8!important}.properties-toolbar .tools-group .custom-select.simple .title .combobox-simple{line-height:25px;color:#333;font-weight:600;padding-left:7px}.properties-toolbar .tools-group .custom-select.simple .items{padding:0}.properties-toolbar .tools-group .custom-select.simple .items .item{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;min-width:40px;line-height:25px;color:#333;padding:0 7px;border-right:0!important;height:25px!important}.properties-toolbar .tools-group .custom-select.simple .items .item.selected{border:none;font-weight:600}.properties-toolbar .tools-group .custom-select.simple .icon{right:6px}.properties-toolbar .tools-group .custom-select .combobox-icon{display:inline-block;width:32px;height:25px}.properties-toolbar .drag-handler{height:35px;width:19px;position:relative;border-right:1px solid #c9cbcd}.properties-toolbar .drag-handler i{margin:7px;position:absolute;width:6px;height:22px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAFUlEQVR4AWPYs2fPfxBmgAKEANEAAL6kDM2cESQVAAAAAElFTkSuQmCC)}.properties-toolbar [class*=icon-]{background-image:url(images/linetool-properties/icons.png)}.properties-toolbar [class*=icon-] svg{margin:4px 8.5px;fill:#727272}.properties-toolbar [class*=icon-].icon-pencil{background-position:0 5px}.properties-toolbar [class*=icon-].icon-bucket{background-position:0 -20px}.properties-toolbar [class*=icon-].icon-font{background-position:0 -45px}.properties-toolbar [class*=icon-].icon-list{background-position:0 -70px}.properties-toolbar [class*=icon-].icon-line{background-position:0 -95px}.properties-toolbar [class*=icon-].icon-line-left-arrow{background-position:0 -120px}.properties-toolbar [class*=icon-].icon-line-right-arrow{background-position:0 -145px}.properties-toolbar [class*=icon-].icon-line-two-arrow{background-position:0 -170px}.properties-toolbar [class*=icon-].icon-ray-left{background-position:0 -195px}.properties-toolbar [class*=icon-].icon-ray-right{background-position:0 -220px}.properties-toolbar [class*=icon-].icon-ray-segment{background-position:0 -245px}.properties-toolbar [class*=icon-].icon-line-dashed{background-position:0 -270px}.properties-toolbar [class*=icon-].icon-line-dotted{background-position:0 -295px}.properties-toolbar [class*=icon-].icon-line-width-1{background-position:0 -95px}.properties-toolbar [class*=icon-].icon-line-width-2{background-position:0 -320px}.properties-toolbar [class*=icon-].icon-line-width-3{background-position:0 -345px}.properties-toolbar [class*=icon-].icon-line-width-4{background-position:0 -370px}.properties-toolbar [class*=icon-].icon-settings{background-position:0 -395px}.properties-toolbar [class*=icon-].icon-clone{background-position:0 -420px}.properties-toolbar [class*=icon-].icon-remove{background-position:0 -445px}.properties-toolbar [class*=icon-].icon-hide{background-position:0 -470px}.properties-toolbar [class*=icon-].icon-zorder{background-position:0 -495px}.properties-toolbar [class*=icon-].icon-line-left-normal{background-position:0 -520px}.properties-toolbar [class*=icon-].icon-line-right-normal{background-position:0 -545px}.properties-toolbar [class*=icon-].icon-line-left-extend{background-position:0 -570px}.properties-toolbar [class*=icon-].icon-line-right-extend{background-position:0 -595px}.properties-toolbar [class*=icon-].icon-lock{background-position:0 -620px}.properties-toolbar [class*=icon-].icon-alert{background-image:none}.properties-toolbar [class*=icon-].icon-alert svg{width:17px;height:17px}.properties-toolbar [class*=icon-].icon-add-alert{background-image:none}.properties-toolbar [class*=icon-].icon-add-alert svg{width:22px;height:19px}.properties-toolbar [class*=icon-].active.icon-pencil,.properties-toolbar [class*=icon-]:active.icon-pencil,.properties-toolbar [class*=icon-]:focus.icon-pencil{background-position:-40px 5px}.properties-toolbar [class*=icon-].active.icon-bucket,.properties-toolbar [class*=icon-]:active.icon-bucket,.properties-toolbar [class*=icon-]:focus.icon-bucket{background-position:-40px -20px}.properties-toolbar [class*=icon-].active.icon-font,.properties-toolbar [class*=icon-]:active.icon-font,.properties-toolbar [class*=icon-]:focus.icon-font{background-position:-40px -45px}.properties-toolbar [class*=icon-].active.icon-list,.properties-toolbar [class*=icon-]:active.icon-list,.properties-toolbar [class*=icon-]:focus.icon-list{background-position:-40px -70px}.properties-toolbar [class*=icon-].active.icon-line,.properties-toolbar [class*=icon-]:active.icon-line,.properties-toolbar [class*=icon-]:focus.icon-line{background-position:-40px -95px}.properties-toolbar [class*=icon-].active.icon-line-left-arrow,.properties-toolbar [class*=icon-]:active.icon-line-left-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-left-arrow{background-position:-40px -120px}.properties-toolbar [class*=icon-].active.icon-line-right-arrow,.properties-toolbar [class*=icon-]:active.icon-line-right-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-right-arrow{background-position:-40px -145px}.properties-toolbar [class*=icon-].active.icon-line-two-arrow,.properties-toolbar [class*=icon-]:active.icon-line-two-arrow,.properties-toolbar [class*=icon-]:focus.icon-line-two-arrow{background-position:-40px -170px}.properties-toolbar [class*=icon-].active.icon-ray-left,.properties-toolbar [class*=icon-]:active.icon-ray-left,.properties-toolbar [class*=icon-]:focus.icon-ray-left{background-position:-40px -195px}.properties-toolbar [class*=icon-].active.icon-ray-right,.properties-toolbar [class*=icon-]:active.icon-ray-right,.properties-toolbar [class*=icon-]:focus.icon-ray-right{background-position:-40px -220px}.properties-toolbar [class*=icon-].active.icon-ray-segment,.properties-toolbar [class*=icon-]:active.icon-ray-segment,.properties-toolbar [class*=icon-]:focus.icon-ray-segment{background-position:-40px -245px}.properties-toolbar [class*=icon-].active.icon-line-dashed,.properties-toolbar [class*=icon-]:active.icon-line-dashed,.properties-toolbar [class*=icon-]:focus.icon-line-dashed{background-position:-40px -270px}.properties-toolbar [class*=icon-].active.icon-line-dotted,.properties-toolbar [class*=icon-]:active.icon-line-dotted,.properties-toolbar [class*=icon-]:focus.icon-line-dotted{background-position:-40px -295px}.properties-toolbar [class*=icon-].active.icon-line-width-1,.properties-toolbar [class*=icon-]:active.icon-line-width-1,.properties-toolbar [class*=icon-]:focus.icon-line-width-1{background-position:-40px -95px}.properties-toolbar [class*=icon-].active.icon-line-width-2,.properties-toolbar [class*=icon-]:active.icon-line-width-2,.properties-toolbar [class*=icon-]:focus.icon-line-width-2{background-position:-40px -320px}.properties-toolbar [class*=icon-].active.icon-line-width-3,.properties-toolbar [class*=icon-]:active.icon-line-width-3,.properties-toolbar [class*=icon-]:focus.icon-line-width-3{background-position:-40px -345px}.properties-toolbar [class*=icon-].active.icon-line-width-4,.properties-toolbar [class*=icon-]:active.icon-line-width-4,.properties-toolbar [class*=icon-]:focus.icon-line-width-4{background-position:-40px -370px}.properties-toolbar [class*=icon-].active.icon-settings,.properties-toolbar [class*=icon-]:active.icon-settings,.properties-toolbar [class*=icon-]:focus.icon-settings{background-position:-40px -395px}.properties-toolbar [class*=icon-].active.icon-clone,.properties-toolbar [class*=icon-]:active.icon-clone,.properties-toolbar [class*=icon-]:focus.icon-clone{background-position:-40px -420px}.properties-toolbar [class*=icon-].active.icon-remove,.properties-toolbar [class*=icon-]:active.icon-remove,.properties-toolbar [class*=icon-]:focus.icon-remove{background-position:-40px -445px}.properties-toolbar [class*=icon-].active.icon-hide,.properties-toolbar [class*=icon-]:active.icon-hide,.properties-toolbar [class*=icon-]:focus.icon-hide{background-position:-40px -470px}.properties-toolbar [class*=icon-].active.icon-zorder,.properties-toolbar [class*=icon-]:active.icon-zorder,.properties-toolbar [class*=icon-]:focus.icon-zorder{background-position:-40px -495px}.properties-toolbar [class*=icon-].active.icon-line-left-normal,.properties-toolbar [class*=icon-]:active.icon-line-left-normal,.properties-toolbar [class*=icon-]:focus.icon-line-left-normal{background-position:-40px -520px}.properties-toolbar [class*=icon-].active.icon-line-right-normal,.properties-toolbar [class*=icon-]:active.icon-line-right-normal,.properties-toolbar [class*=icon-]:focus.icon-line-right-normal{background-position:-40px -545px}.properties-toolbar [class*=icon-].active.icon-line-left-extend,.properties-toolbar [class*=icon-]:active.icon-line-left-extend,.properties-toolbar [class*=icon-]:focus.icon-line-left-extend{background-position:-40px -570px}.properties-toolbar [class*=icon-].active.icon-line-right-extend,.properties-toolbar [class*=icon-]:active.icon-line-right-extend,.properties-toolbar [class*=icon-]:focus.icon-line-right-extend{background-position:-40px -595px}.properties-toolbar [class*=icon-].active.icon-lock,.properties-toolbar [class*=icon-]:active.icon-lock,.properties-toolbar [class*=icon-]:focus.icon-lock{background-position:-40px -620px}.properties-toolbar [class*=icon-].active.icon-alert,.properties-toolbar [class*=icon-]:active.icon-alert,.properties-toolbar [class*=icon-]:focus.icon-alert{background-image:none}.properties-toolbar [class*=icon-].active.icon-alert svg,.properties-toolbar [class*=icon-]:active.icon-alert svg,.properties-toolbar [class*=icon-]:focus.icon-alert svg{margin:4px 9px;width:17px;height:17px;fill:#5dc5e7}.properties-toolbar .active [class*=icon-].icon-pencil,.properties-toolbar .selected [class*=icon-].icon-pencil{background-position:-40px 5px}.properties-toolbar .active [class*=icon-].icon-bucket,.properties-toolbar .selected [class*=icon-].icon-bucket{background-position:-40px -20px}.properties-toolbar .active [class*=icon-].icon-font,.properties-toolbar .selected [class*=icon-].icon-font{background-position:-40px -45px}.properties-toolbar .active [class*=icon-].icon-list,.properties-toolbar .selected [class*=icon-].icon-list{background-position:-40px -70px}.properties-toolbar .active [class*=icon-].icon-line,.properties-toolbar .selected [class*=icon-].icon-line{background-position:-40px -95px}.properties-toolbar .active [class*=icon-].icon-line-left-arrow,.properties-toolbar .selected [class*=icon-].icon-line-left-arrow{background-position:-40px -120px}.properties-toolbar .active [class*=icon-].icon-line-right-arrow,.properties-toolbar .selected [class*=icon-].icon-line-right-arrow{background-position:-40px -145px}.properties-toolbar .active [class*=icon-].icon-line-two-arrow,.properties-toolbar .selected [class*=icon-].icon-line-two-arrow{background-position:-40px -170px}.properties-toolbar .active [class*=icon-].icon-ray-left,.properties-toolbar .selected [class*=icon-].icon-ray-left{background-position:-40px -195px}.properties-toolbar .active [class*=icon-].icon-ray-right,.properties-toolbar .selected [class*=icon-].icon-ray-right{background-position:-40px -220px}.properties-toolbar .active [class*=icon-].icon-ray-segment,.properties-toolbar .selected [class*=icon-].icon-ray-segment{background-position:-40px -245px}.properties-toolbar .active [class*=icon-].icon-line-dashed,.properties-toolbar .selected [class*=icon-].icon-line-dashed{background-position:-40px -270px}.properties-toolbar .active [class*=icon-].icon-line-dotted,.properties-toolbar .selected [class*=icon-].icon-line-dotted{background-position:-40px -295px}.properties-toolbar .active [class*=icon-].icon-line-width-1,.properties-toolbar .selected [class*=icon-].icon-line-width-1{background-position:-40px -95px}.properties-toolbar .active [class*=icon-].icon-line-width-2,.properties-toolbar .selected [class*=icon-].icon-line-width-2{background-position:-40px -320px}.properties-toolbar .active [class*=icon-].icon-line-width-3,.properties-toolbar .selected [class*=icon-].icon-line-width-3{background-position:-40px -345px}.properties-toolbar .active [class*=icon-].icon-line-width-4,.properties-toolbar .selected [class*=icon-].icon-line-width-4{background-position:-40px -370px}.properties-toolbar .active [class*=icon-].icon-settings,.properties-toolbar .selected [class*=icon-].icon-settings{background-position:-40px -395px}.properties-toolbar .active [class*=icon-].icon-clone,.properties-toolbar .selected [class*=icon-].icon-clone{background-position:-40px -420px}.properties-toolbar .active [class*=icon-].icon-remove,.properties-toolbar .selected [class*=icon-].icon-remove{background-position:-40px -445px}.properties-toolbar .active [class*=icon-].icon-hide,.properties-toolbar .selected [class*=icon-].icon-hide{background-position:-40px -470px}.properties-toolbar .active [class*=icon-].icon-zorder,.properties-toolbar .selected [class*=icon-].icon-zorder{background-position:-40px -495px}.properties-toolbar .active [class*=icon-].icon-line-left-normal,.properties-toolbar .selected [class*=icon-].icon-line-left-normal{background-position:-40px -520px}.properties-toolbar .active [class*=icon-].icon-line-right-normal,.properties-toolbar .selected [class*=icon-].icon-line-right-normal{background-position:-40px -545px}.properties-toolbar .active [class*=icon-].icon-line-left-extend,.properties-toolbar .selected [class*=icon-].icon-line-left-extend{background-position:-40px -570px}.properties-toolbar .active [class*=icon-].icon-line-right-extend,.properties-toolbar .selected [class*=icon-].icon-line-right-extend{background-position:-40px -595px}.properties-toolbar .active [class*=icon-].icon-lock,.properties-toolbar .selected [class*=icon-].icon-lock{background-position:-40px -620px}.properties-toolbar .active [class*=icon-].icon-alert,.properties-toolbar .selected [class*=icon-].icon-alert{background-image:none}.properties-toolbar .active [class*=icon-].icon-alert svg,.properties-toolbar .selected [class*=icon-].icon-alert svg{margin:4px 9px;width:17px;height:17px;fill:#5dc5e7}.mini-widget{overflow:hidden;color:#5b5e61;background-color:#fff}.tv-mediumwidget{background-color:#fff;overflow:hidden}#miniwidget .tabs,.tv-mediumwidget .tv-mediumwidget-labels{border:1px solid #dde1e6}#miniwidget .tabs.empty,.tv-mediumwidget .tv-mediumwidget-labels.empty{border:none;border-top:1px solid #dde1e6}.mini-widget .tab,.tv-mediumwidget .tv-mediumwidget-label{margin:0 10px;padding:8px 0;display:inline-block;cursor:pointer;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.mini-widget .tab a,.tv-mediumwidget .tv-mediumwidget-label a{color:#999}.mini-widget .tab.active,.tv-mediumwidget .tv-mediumwidget-label.active{padding-bottom:7px;margin-bottom:-1px;border-bottom:2px solid #58b987;font-weight:700}.mini-widget .tab.active a,.tv-mediumwidget .tv-mediumwidget-label a{color:#5b5e61}.tv-mediumwidget .mini-chart-timeframes,.mini-widget .mini-chart-timeframes{position:absolute;top:14px;left:14px}.tv-mediumwidget .mini-chart-timeframes>a,.mini-widget .mini-chart-timeframes>a{font-size:11px;color:#999;padding:1px;margin-right:18px}.tv-mediumwidget .mini-chart-timeframes>a:last-child,.mini-widget .mini-chart-timeframes>a:last-child{margin-right:0}.tv-mediumwidget .mini-chart-timeframes>a.active,.mini-widget .mini-chart-timeframes>a.active{color:#333;border-bottom:1px solid #58b987}.tv-mediumwidget .footer,.mini-widget .footer{padding:6px 10px;font-size:11px;text-align:right}.tv-mediumwidget .footer .fade,.mini-widget .footer .fade{color:#b4b4b4}.mini-widget .graph{overflow:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6;border-bottom:none}.mini-widget .graph>div{height:100%;position:relative}.mini-widget .graph .mini-chart-timeframes{top:14px;left:14px}.mini-widget .divider{display:block;height:2px;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6}.mini-widget .pages{overflow-y:auto;overflow-x:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6}.mini-widget .pages table{width:100%;border-collapse:collapse;position:relative;border-spacing:10px}.mini-widget .pages table thead td{padding:2px 0 4px;color:#999;text-align:right;border-bottom:#e5e4e4 1px solid;font-size:.85em}.mini-widget .pages table thead td:first-child{padding-left:10px;text-align:left}.mini-widget .pages table thead td:last-child{padding-right:6px;padding-left:5px}.mini-widget .pages table thead td.symbol-last{padding-left:5px;padding-right:5px;text-align:right}.mini-widget .pages table .ticker{font-size:14px;overflow:hidden;background-color:#fff}.mini-widget .pages table .ticker.active{background-color:#edf0f3}.mini-widget .pages table .ticker td{position:relative;border-bottom:1px solid #dde1e6;cursor:default;text-align:center;padding:6px 0}.mini-widget .pages table .ticker td.symbol-short-name-container{width:35%;padding-left:10px;text-align:left;white-space:nowrap}.mini-widget .pages table .ticker td.symbol-last{width:35%;padding-left:5px;padding-right:5px;text-align:right}.mini-widget .pages table .ticker td.symbol-change{width:30%;padding-left:5px;text-align:right}.mini-widget .pages table .ticker td.symbol-change-pt{width:0;padding-right:6px;padding-left:5px;text-align:right}.mini-widget .footer{overflow:hidden;border-left:1px solid #dde1e6;border-right:1px solid #dde1e6;border-bottom:1px solid #dde1e6}.tv-mediumwidget{color:#26282f}.tv-mediumwidget .tv-mediumwidget-pages{border-left:1px solid #dde1e6;border-right:1px solid #dde1e6}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page{display:none}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page.active{display:block}.tv-mediumwidget .tv-mediumwidget-pages .mini-chart-timeframes{top:17px;left:19px}.tv-mediumwidget .footer{border:1px solid #dde1e6;border-top:none}.tv-mediumwidget .ticker-fundamental-container{width:100%}.tv-mediumwidget .ticker-fundamental-container .fundamentals-cell,.tv-mediumwidget .ticker-fundamental-container .ticker-cell{vertical-align:top}.tv-mediumwidget .tv-mediumwidget-ticker,.tv-mediumwidget .tv-mediumwidget-fundamentals,.tv-mediumwidget .tv-mediumwidget-symbolbuttons{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:15px 15px 0 15px;position:relative}.tv-mediumwidget .tv-mediumwidget-ticker,.tv-mediumwidget .tv-mediumwidget-fundamentals{min-height:97px}.tv-mediumwidget .tv-mediumwidget-ticker{white-space:nowrap}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-ticker-name{vertical-align:top}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-ticker-value{vertical-align:bottom;white-space:nowrap}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-short-name,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-short-name-container{font-size:22px;text-transform:uppercase}.tv-mediumwidget .tv-mediumwidget-ticker a.symbol-type-link{color:#26282f}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-last{display:inline-block;font-size:28px;font-weight:700;margin-right:5px;padding:0}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-container{white-space:nowrap;display:inline-block}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-pt{display:inline-block;font-weight:700;font-size:18px}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-change-pt{margin-left:5px}.tv-mediumwidget .tv-mediumwidget-ticker .symbol-description-name,.tv-mediumwidget .tv-mediumwidget-ticker .symbol-industry-sector-container{font-size:11px;color:#787878}.tv-mediumwidget .tv-mediumwidget-fundamentals{min-width:210px}.tv-mediumwidget .tv-mediumwidget-fundamentals table{width:100%;border:0;border-collapse:collapse}.tv-mediumwidget .tv-mediumwidget-fundamentals table td{padding:8px 0}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-name{width:24%;border-bottom:1px solid #dde1e6;text-align:left;color:#878c94;padding-right:5px}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-value{width:24%;border-bottom:1px solid #dde1e6;text-align:right}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-divider{width:4%;min-width:20px}.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:first-child td{padding-top:0}.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:last-child td.fundamental-name,.tv-mediumwidget .tv-mediumwidget-fundamentals table tr:last-child td.fundamental-value{border-bottom:none}.tv-mediumwidget .tv-mediumwidget-symbolbuttons{float:right}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .not-bold{font-weight:400}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .tv-button{cursor:pointer;padding:0 12px;width:auto;height:auto;line-height:27px;margin-left:10px;text-transform:uppercase}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .button-follow-symbol{min-width:105px}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .button-follow-symbol:before{content:"Follow "}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .button-follow-symbol.active:before{content:"Following "}.tv-mediumwidget .tv-mediumwidget-symbolbuttons .button-follow-symbol.active:hover:before{content:"Unllow "}.tv-mediumwidget .tv-mediumwidget-divider{float:left;height:1px;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:30px 15px;background-color:#dde1e6}.tv-mediumwidget .tv-mediumwidget-minichart{float:left;width:100%;margin-top:10px;position:relative}.tv-mediumwidget .tv-mediumwidget-minichart canvas{display:block}.chart-widget{border-style:none;position:absolute;left:0;top:0;width:512px;height:256px;margin:0;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chart-header{background-color:#fff;border-bottom:1px solid gray;color:#fff}.chart-header-form{background-color:#fff;color:#000;margin:3px}.chart-header-input-text{border:1px solid #000;color:#000}.chart-header-status{border:0}table.chart-markup-table{border:none;border-collapse:collapse;border-spacing:0;line-height:0;margin:0;padding:0}.chart-markup-table tr{margin:0;padding:0}td.chart-markup-table{border:none;text-align:left;vertical-align:top;line-height:0;margin:0;padding:0}.chart-data-window{position:absolute;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-collapse:collapse;margin:0;padding:0;background-color:#fff;text-align:left;color:#5a5c62}.chart-data-window .box{margin:3px}.chart-data-window .box.with-actions{cursor:pointer}.chart-data-window .box:first-child .chart-data-window-header:first-child{margin-top:0}.chart-data-window .hover .chart-data-window-header .hover-source-icon{display:block}.chart-data-window .active{border-left:2px solid #528cde}.chart-data-window .active .chart-data-window-header{background:#e9f8ff}.chart-data-window .active .chart-data-window-header,.chart-data-window .active .chart-data-window-item .chart-data-window-item-title{padding-left:8px}.chart-data-window .active .chart-data-window-item{font-weight:700}.chart-data-window .hidden{opacity:.3}.chart-data-window .hidden .chart-data-window-item{display:none}.chart-data-window .chart-data-window-header,.chart-data-window .chart-data-window-item{margin-bottom:3px;position:relative}.chart-data-window .chart-data-window-header{padding:9px 10px;background:#f2f5f8;font-weight:700;font-size:12px}.chart-data-window .chart-data-window-header .toggle-source-icon{display:block;position:absolute;right:14px;top:11px;width:16px;height:10px;background-image:url(images/icons.png);background-position:-80px -80px;cursor:pointer}.chart-data-window .chart-data-window-header .toggle-source-icon:hover{background-position:-60px -100px}.chart-data-window .chart-data-window-header .hover-source-icon{display:none;position:absolute;right:40px;top:11px;width:10px;height:10px;-webkit-border-radius:10px;-webkit-background-clip:padding-box;-moz-border-radius:10px;-moz-background-clip:padding;border-radius:10px;background-clip:padding-box;background:#528cde}.chart-data-window .chart-data-window-item:last-child{margin-bottom:0}.chart-data-window .chart-data-window-item .chart-data-window-item-title,.chart-data-window .chart-data-window-item .chart-data-window-item-value{width:50%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:4px 10px;display:inline-block;white-space:nowrap}.chart-data-window .chart-data-window-item .chart-data-window-item-title .real-color,.chart-data-window .chart-data-window-item .chart-data-window-item-value .real-color{display:inline-block;width:15px;height:8px;margin-right:15px;border:1px dotted #ccc;cursor:help}.chart-data-window .chart-data-window-item .chart-data-window-item-value{text-align:right}span.insert-study-dialog{cursor:pointer}table.insert-study-dialog{z-index:10}div.insert-study-dialog p{margin:0;padding:21px 28px;color:#8b8c8e;text-align:center}.pane{overflow:hidden}.pane-legend{background-color:transparent;color:#444;border:0;top:5px;left:5px;white-space:nowrap;margin:0 85px 0 0;padding:0;z-index:3;position:absolute;font-size:9pt;line-height:normal;pointer-events:none}.pane-legend-line{border:0;text-align:left;margin:0;padding:0;cursor:pointer;white-space:pre-line}.pane-legend-line span{pointer-events:auto}.pane-legend-line>span.pane-legend-line:not(.no-context-menu){margin-right:17px}.pane-legend-line>span.pane-legend-line{display:inline-block;position:relative}.pane-legend-line>span.pane-legend-line:not(.no-context-menu):after{content:'';display:block;position:absolute;top:50%;right:-12px;margin-top:-1px;border-style:solid;border-width:4px;border-top-color:#c9cbcd;border-left-color:transparent;border-right-color:transparent;border-bottom-width:0}.pane-legend-line>span.pane-legend-line:hover:after{border-top-color:inherit}.viewchart-column-main .pane-legend-line>span.pane-legend-line:after{display:none}.pane-legend-line button.follow-symbol{display:none;pointer-events:auto;margin-right:4px;opacity:.3;position:relative;top:3px;vertical-align:top}.pane-legend-line:hover button.follow-symbol{opacity:1}.is-mobile .pane-legend-line button.follow-symbol{opacity:.8}.view-chart .pane-legend-line button.follow-symbol{display:none}.pane-legend-item-value-container{display:inline-block}.pane-legend-item-value,.pane-legend-item-value-title,.pane-legend-item-additional{font-size:9pt;font-weight:400;cursor:default;pointer-events:none!important}.pane-legend-item-value{padding-left:5px;padding-right:5px}.pane-legend-item-value:first-child{padding-left:0}.pane-legend-line.disabled{color:#d8dada!important;border-color:#d8dada!important}.pane-legend-icon-container{display:inline-block;vertical-align:baseline;position:relative;left:3px;top:3px;padding-right:10px;margin-right:5px}.main .pane-legend-icon-container{top:1px}.pane-controls{position:absolute;right:5px;top:5px}.pane-legend-icon{background:url(images/legend-icons.png);width:14px;height:14px;display:inline-block;margin:0 0 0 3px;cursor:pointer;opacity:.3}.is-mobile .pane-legend-icon{-webkit-transform:scale(1.1);transform:scale(1.1);margin:0 0 0 10px;background:url(images/mobile/legend-icons.png);width:16px;height:16px}.pane-legend-icon.delete{background-position:0 -14px}.pane-legend-icon.delete.active{background-position:0 -28px}.is-mobile .pane-legend-icon.delete{opacity:.8;background-position:0 -16px}.is-mobile .pane-legend-icon.delete.active{background-position:0 -32px}.pane-legend-icon.icon-hide{background-position:-14px -14px}.pane-legend-icon.icon-hide.active{background-position:-14px -28px}.is-mobile .pane-legend-icon.icon-hide{opacity:.8;background-position:-16px -16px}.is-mobile .pane-legend-icon.icon-hide.active{background-position:-16px -32px}.pane-legend-icon.down{background-position:-28px -14px}.pane-legend-icon.down.active{background-position:-28px -28px}.is-mobile .pane-legend-icon.down{opacity:.8;background-position:-32px -16px}.is-mobile .pane-legend-icon.down.active{background-position:-32px -32px}.pane-legend-icon.up{background-position:-42px -14px}.pane-legend-icon.up.active{background-position:-42px -28px}.is-mobile .pane-legend-icon.up{opacity:.8;background-position:-48px -16px}.is-mobile .pane-legend-icon.up.active{background-position:-48px -32px}.pane-legend-icon.format{background-position:-56px -14px}.pane-legend-icon.format.active{background-position:-56px -28px}.is-mobile .pane-legend-icon.format{opacity:.8;background-position:-64px -16px}.is-mobile .pane-legend-icon.format.active{background-position:-64px -32px}.pane-legend-icon.source{background-position:-70px -14px}.pane-legend-icon.source.active{background-position:-70px -28px}.is-mobile .pane-legend-icon.source{opacity:.8;background-position:-80px -16px}.is-mobile .pane-legend-icon.source.active{background-position:-80px -32px}.pane-legend-line:hover .pane-legend-icon.delete,.pane-controls:hover .pane-legend-icon.delete{opacity:1;background-position:0 -14px}.pane-legend-line:hover .pane-legend-icon.delete:hover,.pane-controls:hover .pane-legend-icon.delete:hover{background-position:0 -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.delete,.is-mobile .pane-controls:hover .pane-legend-icon.delete{background-position:0 -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.delete:hover,.is-mobile .pane-controls:hover .pane-legend-icon.delete:hover{background-position:0 -32px}.pane-legend-line:hover .pane-legend-icon.icon-hide,.pane-controls:hover .pane-legend-icon.icon-hide{opacity:1;background-position:-14px -14px}.pane-legend-line:hover .pane-legend-icon.icon-hide:hover,.pane-controls:hover .pane-legend-icon.icon-hide:hover{background-position:-14px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.icon-hide,.is-mobile .pane-controls:hover .pane-legend-icon.icon-hide{background-position:-16px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.icon-hide:hover,.is-mobile .pane-controls:hover .pane-legend-icon.icon-hide:hover{background-position:-16px -32px}.pane-legend-line:hover .pane-legend-icon.down,.pane-controls:hover .pane-legend-icon.down{opacity:1;background-position:-28px -14px}.pane-legend-line:hover .pane-legend-icon.down:hover,.pane-controls:hover .pane-legend-icon.down:hover{background-position:-28px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.down,.is-mobile .pane-controls:hover .pane-legend-icon.down{background-position:-32px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.down:hover,.is-mobile .pane-controls:hover .pane-legend-icon.down:hover{background-position:-32px -32px}.pane-legend-line:hover .pane-legend-icon.up,.pane-controls:hover .pane-legend-icon.up{opacity:1;background-position:-42px -14px}.pane-legend-line:hover .pane-legend-icon.up:hover,.pane-controls:hover .pane-legend-icon.up:hover{background-position:-42px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.up,.is-mobile .pane-controls:hover .pane-legend-icon.up{background-position:-48px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.up:hover,.is-mobile .pane-controls:hover .pane-legend-icon.up:hover{background-position:-48px -32px}.pane-legend-line:hover .pane-legend-icon.format,.pane-controls:hover .pane-legend-icon.format{opacity:1;background-position:-56px -14px}.pane-legend-line:hover .pane-legend-icon.format:hover,.pane-controls:hover .pane-legend-icon.format:hover{background-position:-56px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.format,.is-mobile .pane-controls:hover .pane-legend-icon.format{background-position:-64px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.format:hover,.is-mobile .pane-controls:hover .pane-legend-icon.format:hover{background-position:-64px -32px}.pane-legend-line:hover .pane-legend-icon.source,.pane-controls:hover .pane-legend-icon.source{opacity:1;background-position:-70px -14px}.pane-legend-line:hover .pane-legend-icon.source:hover,.pane-controls:hover .pane-legend-icon.source:hover{background-position:-70px -28px}.is-mobile .pane-legend-line:hover .pane-legend-icon.source,.is-mobile .pane-controls:hover .pane-legend-icon.source{background-position:-80px -16px}.is-mobile .pane-legend-line:hover .pane-legend-icon.source:hover,.is-mobile .pane-controls:hover .pane-legend-icon.source:hover{background-position:-80px -32px}.pane-legend-line.disabled .pane-legend-icon.icon-hide{opacity:1;background-position:-14px -28px}.is-mobile .pane-legend-line.disabled .pane-legend-icon.icon-hide{background-position:-16px -32px}.pane-legend-line .exchange-warning{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAA7UlEQVR4XpWTgQaDUBSGI8YYl4iIGAMD2GP0BiNijAFgbxYRYwAYY2CMwIiIGCM27cfPzdGOLT44X76uOjnyeu+dBOTgAXrQggwkjnrZQMhAr3AGCy2yBA0Dd57K0HlgA2r6ejQG4YIrIzkwA9cO7vPBgbETcGUopayARyFDNmZPtpahjCKlkCE52zGUSVFTBD+GQoYqKXrwEg0tNGGok6Kh8EdCx39OlFOkYm7AChjlHelfjfOY81jES/vV9D2ach6BLYgYmYFisOHut81uGbtxk326gMFS2+xhbP7Dv3bRImObXoCOgScfkGqBD+IWI88/wYc0AAAAAElFTkSuQmCC);display:inline-block;width:18px;height:15px;margin:0 4px 0 0;vertical-align:-1px;cursor:pointer}.pane-separator{padding:0;margin:0}.pane-separator .handle{background-color:rgba(255,255,255,.02);position:absolute;height:5px;width:100%;z-index:50}.context-menu-wrapper{position:absolute;z-index:500;overflow:auto;border:1px solid #aaadb1;background:#fff;white-space:nowrap}.context-menu-wrapper .backlight{background-color:#f4f7f9}tr.context-menu.disabled{color:#9d9d9d}tr.context-menu.spinner>td{background:url(images/loading-small.gif) center center no-repeat;cursor:default}.submenu.center{background-color:#fff}.context-menu{font-size:8.5pt;white-space:nowrap}tr.context-menu{cursor:pointer;height:29px}tr.context-menu-hover{background:#f4f7f9}td.context-menu{opacity:1;cursor:pointer;padding-left:4px}.context-menu-item-separated{border-bottom:1px solid #cecece}.context-menu .text{min-width:100px}.context-menu .spacer{width:18px}.context-menu .icon{height:27px;width:18px}.context-menu .shortcut{color:#aaa;padding:0 2px}.submenu-arrow{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKElEQVR4AWOgExgFo6Cvr+8/1Q0EYaoaCMNUNBCBB68LqRvLIxiMAgAKDyqRblYs2AAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center;width:20px}.submenu-arrow.expanded{width:20px}.popup{position:absolute;display:block}div.submenu{background-image:url(chart-client/css/images/submenu_arrow.png);background-repeat:no-repeat;padding-left:25px}.checked-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAQ0lEQVR4AWPABcIjI6eBCGYsEjOB+D+IsRShACEBxMcYoIwVIAVAPAcmAcQ8IMntUIGHyBIwYzihChAScIBQ0IsuAQBi0S/426FUkgAAAABJRU5ErkJggg==);background-position:center;background-repeat:no-repeat}.unchecked-icon{background:0 0}.context-menu .action-separator{height:1px!important;background-color:#c9cbcd}.context-menu .action-separator{height:0;cursor:default}.context-menu .action-separator td{height:0;border-top:solid 1px #c9cbcd}.spacer.delete-spacer{width:23px}.context-menu-delete-button{display:none;vertical-align:middle;width:14px;height:14px;background:url(images/icons.png) no-repeat scroll -102px -362px transparent}tr:hover .context-menu-delete-button{display:inline-block}.context-menu-delete-button:hover{background-position:-81px -362px}.study_icon{background-image:url(chart-client/css/images/icon_study.png);background-position:50% 50%;background-repeat:no-repeat}.drawing_icon{background-image:url(chart-client/css/images/icon_drawing.png);background-position:50% 50%;background-repeat:no-repeat}.treeview-link{cursor:pointer}.property-page-column-2{display:inline-block;width:50%;vertical-align:top}.property-page{color:#595959}.property-page td{padding:3px 4px;height:27px}.property-page td:empty{padding:0}.property-page td:first-child{padding-left:0}.property-page td:last-child{padding-right:0}.property-page.study-properties{margin-top:10px}.property-page.study-strategy-properties{margin-top:10px}.property-page.study-strategy-properties tr.disabled label{color:#999}.property-page .tzeditor .sbSelector{min-width:165px}.property-page-fullwidth-wrapper{margin:0 13px 0 0}.property-page-small-select .tv-select-container{width:80px}.property-page-bandwidth{margin-left:8px;width:55px;vertical-align:middle}.property-page input[type=checkbox]{vertical-align:middle}.property-page td:first-child input[type=checkbox]{margin-left:0}.property-page .tv-text-input{height:25px}.property-page .visibility-switch-icon{background:url(images/legend-icons.png) -14px -14px;width:14px;height:14px;position:absolute;cursor:pointer;z-index:1}.property-page .visibility-switch-icon:hover{background-position:-14px -28px}.property-page-unpadded{border-collapse:collapse}.property-page-unpadded>tbody>tr>td,.property-page-unpadded>tbody>tr>th{padding:0}.property-page .property-page-separator-cell{height:21px;padding:0}.property-page .offset-row td:first-child{padding-left:30px}.propertypage-name-label{text-transform:capitalize}.colorpicker.main{border:1px solid #c9cbcd;box-shadow:0 1px 3px rgba(0,0,0,.4)}.custom-select{background-color:#fff;position:relative;display:inline-block;vertical-align:middle;height:27px}.custom-select .switcher{background:#fafafa;border:1px solid #c9cbcd;clear:both;height:25px;min-width:65px}.custom-select .switcher .title{display:block;background-repeat:repeat-x;float:left;height:10px;overflow:hidden;padding:5px 20px 5px 12px;vertical-align:middle;width:78px}.custom-select .switcher .icon{position:absolute;right:5px;top:6px;display:inline-block;height:15px;width:13px;vertical-align:top;background:url(images/select-bg.png) 2px 5px no-repeat}.custom-select .items{background:#fff;border:1px solid #c9cbcd;clear:both;cursor:pointer;display:none;position:absolute;top:28px;z-index:3;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%}.custom-select .items .item{cursor:pointer;padding:7px 12px}.custom-select .items .item:hover{background:#f4f7f9}.custom-select .items .item.selected{padding-left:8px;background:#f4f7f9;border-left:4px solid #5cb888}.custom-select .items .item .linestyle{width:100%}.linestyle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAABACAAAAADkRqISAAAAAnRSTlMAAHaTzTgAAAAiSURBVHjaY6hEBgyDCaC6bGi6czi4egj4AQtvcLkTgdB4AKeLTYXhQE1YAAAAAElFTkSuQmCC);background-repeat:repeat-x;height:15px}.solidline{background-position:0 -4px}.dottedline{background-position:0 -55px}.dashedline{background-position:0 -44px}.clearing{clear:both;display:block;height:0;line-height:0;width:100%}div.tooltip{background-color:#ffffc2;border:1px solid #b2b2b2;padding-left:10px;padding-right:10px;padding-top:5px;padding-bottom:5px;z-index:100}.zoom-selector{background-color:rgba(80,80,80,.15);border:1px solid rgba(80,80,80,.5);position:absolute;pointer-events:none}.tooltip-selector{position:absolute;font-weight:700;font-size:10px;line-height:normal;opacity:.8;white-space:nowrap}.tooltip-selector-hidden{display:none}.toolbarbuttonicon{width:24px;height:24px;position:absolute;top:1px;left:1px}.toolbarbuttonicon.wide{width:33px}.toolbarpopupbutton{width:32px;height:32px}.chart-note-tooltip{pointer-events:none;position:absolute;line-height:normal}.chart-note-tooltip:before{content:"";display:block;position:absolute;width:0;height:0}.chart-note-tooltip.below:before{top:-7px;left:50%;margin-left:-7px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-bottom:red 8px solid;border-bottom-color:inherit}.chart-note-tooltip.above:before{bottom:-7px;left:50%;margin-left:-7px;border-left:transparent 8px solid;border-right:transparent 8px solid;border-top:red 8px solid;border-top-color:inherit}.chart-note-tooltip .chart-note-tooltip-bgcaret{display:block;position:absolute;width:0;height:0;border-style:solid;border-width:0}.chart-note-tooltip.below .chart-note-tooltip-bgcaret{top:-5px;left:50%;margin-left:-5px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-bottom-width:6px}.chart-note-tooltip.above .chart-note-tooltip-bgcaret{bottom:-5px;left:50%;margin-left:-5px;border-left:transparent 6px solid;border-right:transparent 6px solid;border-top-width:6px}.chart-note-tooltip.no-caret:before,.chart-note-tooltip.no-caret .chart-note-tooltip-bgcaret{display:none}.chart-note-tooltip.hidden{display:none}.chart-note-tooltip .chart-note-tooltip-body{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:10px;background-color:#fff;border-width:1px;border-style:solid;border-color:inherit}#big-load-more-button-wrap{display:none;position:absolute;right:0;bottom:50%;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}#big-load-more-button-wrap.state-progress,#big-load-more-button-wrap.state-enabled{display:block}#big-load-more-button-wrap.state-hidden *,#big-load-more-button-wrap.state-disabled{display:none}.big-load-more-button{display:inline-block;margin-bottom:-50%;cursor:pointer;opacity:1}.big-load-more-button::before{content:' ';display:block;width:64px;height:64px;background:url(images/button-load-new-bars.png) no-repeat}#big-load-more-button-wrap.state-progress .big-load-more-button::before{opacity:.42}.tooltip-pad-wrap,.tooltip-newbars-wrap{position:absolute;right:50%;bottom:100%}.tooltip-pad,.tooltip-newbars{position:relative;left:50%;display:none;border:1px solid #fff;background:rgba(0,0,0,.75);-webkit-box-shadow:0 0 10px rgba(0,0,0,.15);-moz-box-shadow:0 0 10px rgba(0,0,0,.15);box-shadow:0 0 10px rgba(0,0,0,.15);white-space:nowrap;text-align:center;font-size:13px;color:#41474d}.tooltip-pad{padding:5px 10px;margin-bottom:5px}.tooltip-newbars{padding:13px}.tooltip-pad::after,.tooltip-newbars::after{content:' ';position:absolute;left:50%;bottom:0;display:inline-block;width:19px;height:11px;margin:-11px 0 -11px -9px;background:url(images/icons.png) 0 -80px no-repeat}#big-load-more-button-wrap.state-progress .big-load-more-button,.big-load-more-button:hover{opacity:1}#big-load-more-button-wrap.state-progress .big-load-more-button .tooltip-newbars,.big-load-more-button:hover .tooltip-newbars{display:inline-block;color:#fff}#big-load-more-button-wrap.state-enabled .big-load-more-button:hover::before{background-position:0 -64px}.themesMenu{border:1px solid #000;position:absolute;background:#fff;left:100px}.tvcolorpicker-widget{vertical-align:middle;background-image:url(images/tvcolorpicker-bg.png);background-position:0 0;background-repeat:no-repeat;border:1px solid #cacaca;overflow:hidden;padding:0;width:25px;height:25px;cursor:pointer;font-size:0;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none}.tvcolorpicker-popup{position:absolute;z-index:1000;padding:4px;background:#fff;border:1px solid #9d9d9d;box-shadow:0 1px 2px rgba(0,0,0,.3)}.tvcolorpicker-table{border-collapse:collapse;table-layout:fixed;margin:0 0 6px 0}.tvcolorpicker-popup .tvcolorpicker-table:last-of-type{margin-bottom:0}.tvcolorpicker-table td{padding:0;width:18px;height:18px}.tvcolorpicker-swatch{width:16px;height:16px;border:none 0;margin:1px;cursor:pointer;overflow:hidden}.tvcolorpicker-swatch.low-contrast{margin:0;border:solid #ccc 1px}.tvcolorpicker-swatch.tvcolorpicker-user{border:solid #eee 1px;margin:0}.tvcolorpicker-cell:hover .tvcolorpicker-swatch{border:solid #000 1px;margin:0}.tvcolorpicker-swatch.active{background:url(images/tvcolorpicker-check.png) 50% 50% no-repeat;border:solid #fff 1px;outline:solid #000 1px;margin:0}.tvcolorpicker-custom-button{display:block}.tvcolorpicker-hsv{position:relative;top:13px;height:130px;width:160px;margin:0 auto}.tvcolorpicker-hs{position:absolute;top:0;left:0;width:128px;height:128px;background:url(images/tvcolorpicker-sprite.png) 0 0 no-repeat;border:solid #eee 1px}.tvcolorpicker-hs-area,.tvcolorpicker-v-area{position:absolute;top:0;left:0;width:100%;height:100%}.tvcolorpicker-v{position:absolute;top:0;left:140px;width:9px;height:128px;background:url(images/tvcolorpicker-sprite.png) -128px 0 no-repeat;border:solid #eee 1px}.tvcolorpicker-hs-handle{width:11px;height:11px;position:absolute;left:0;top:0;margin:-5px 0 0 -5px;background:url(images/tvcolorpicker-sprite.png) 0 -128px no-repeat}.tvcolorpicker-v-handle{position:absolute;left:0;top:0;width:25px;height:11px;margin:-5px 0 0 -8px;background:url(images/tvcolorpicker-sprite.png) -11px -128px no-repeat}.tvcolorpicker-custom-button{margin:6px 0 0 0}.tvcolorpicker-user-swatches{margin:6px 0 0 0}.some-colorpicker .tvcolorpicker-widget{margin-right:8px}.properties-tabs{padding:0 25px;border-bottom:1px solid #dde1e6}.properties-tabs a.properties-tabs-label{padding:20px 0 14px;margin-left:45px;display:inline-block;position:relative;color:#595959}.properties-tabs a.properties-tabs-label.active{font-weight:700}.properties-tabs a.properties-tabs-label.active:after{content:" ";position:absolute;display:block;bottom:-1px;width:100%;height:3px;background-color:#5cb888}.properties-tabs a.properties-tabs-label:first-child{margin-left:0}.properties-tabs a.properties-tabs-label:last-child{margin-right:40px}.chart-status-picture{position:absolute;right:5px;top:10px;z-index:5;white-space:nowrap}.series-status-text .status,.series-status-text{display:inline-block;height:13px;vertical-align:top;font-size:11px;font-weight:400;pointer-events:none!important}.series-status-text .dot{width:8px;height:8px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;display:inline-block}.series-status-text.eod{color:#a953ae}.series-status-text.eod .dot{background-color:#a953ae}.series-status-text.connecting{color:#48abc0}.series-status-text.connecting .dot{background-color:#48abc0}.series-status-text.loading{color:#256ed0}.series-status-text.loading .dot{background-color:#256ed0}.series-status-text.delayed{color:#a953ae}.series-status-text.delayed .dot{background-color:#a953ae}.series-status-text.delayed-streaming{color:#ff9247}.series-status-text.delayed-streaming .dot{background-color:#ff9247}.series-status-text.invalid{color:#bd3820}.series-status-text.invalid .dot{background-color:#bd3820}.series-status-text.pre-market{color:#feb300}.series-status-text.pre-market .dot{background-color:#feb300}.series-status-text.post-market{color:#0073d2}.series-status-text.post-market .dot{background-color:#0073d2}.series-status-text.out-of-session{color:#939393}.series-status-text.out-of-session .dot{background-color:#939393}.series-status-text.market,.series-status-text.realtime{color:#318757}.series-status-text.market .dot,.series-status-text.realtime .dot{background-color:#318757}.series-status-text.snapshot{display:none}.chart-status-picture .bats-warning{height:16px;width:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPCAYAAADphp8SAAAA7UlEQVR4XpWTgQaDUBSGI8YYl4iIGAMD2GP0BiNijAFgbxYRYwAYY2CMwIiIGCM27cfPzdGOLT44X76uOjnyeu+dBOTgAXrQggwkjnrZQMhAr3AGCy2yBA0Dd57K0HlgA2r6ejQG4YIrIzkwA9cO7vPBgbETcGUopayARyFDNmZPtpahjCKlkCE52zGUSVFTBD+GQoYqKXrwEg0tNGGok6Kh8EdCx39OlFOkYm7AChjlHelfjfOY81jES/vV9D2ach6BLYgYmYFisOHut81uGbtxk326gMFS2+xhbP7Dv3bRImObXoCOgScfkGqBD+IWI88/wYc0AAAAAElFTkSuQmCC) 0 0 no-repeat;cursor:pointer;margin-right:3px;margin-top:-1px;display:none}.chart-status-picture .bats-warning.warn-bats{display:inline-block}.panel-ext{display:none;position:absolute;top:0;right:0;width:11px;height:32px;border:1px solid #c9cbcd;background:#fff}.panel-ext:hover{background:#fff;color:#68696b}.panel-ext.active{background:#f4f7f9;background:-moz-linear-gradient(top,#f2f7fa,#f4f7f9);background:-webkit-linear-gradient(top,#f2f7fa,#f4f7f9);background:-ms-linear-gradient(top,#f2f7fa,#f4f7f9);background:-o-linear-gradient(top,#f2f7fa,#f4f7f9);background:linear-gradient(top,#f2f7fa,#f4f7f9);color:#68696b;box-shadow:inset 0 0 3px rgba(0,0,0,.2)}.panel-ext-arrow{width:100%;height:100%;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAADCAQAAADxPw1zAAAAGElEQVR4XmPoqe/5D4b1DAwQTj0DBEAYAPmhC2SlApAHAAAAAElFTkSuQmCC) 50% 50% no-repeat}.chart-loading-screen{position:absolute;top:0;left:0;width:0;height:0;z-index:4}.chart-loading-screen .chart-loading-screen-shield{width:100%;height:100%;opacity:0;background:red}.chart-loading-screen.fade{width:100%;height:100%}.chart-loading-screen.fade .chart-loading-screen-shield{opacity:.5;-webkit-transition:opacity 300ms ease;-moz-transition:opacity 300ms ease;-ms-transition:opacity 300ms ease;-o-transition:opacity 300ms ease;transition:opacity 300ms ease}.control-bar-wrapper{margin-left:-82px;left:50%;position:absolute;bottom:33px;height:28px;z-index:13}.control-bar>svg{float:left;width:16px;height:16px;margin-left:6px;padding:5px;cursor:pointer;border:1px solid #8a8b8d;background:#eee;border-radius:15px;opacity:.4;fill:#8a8b8d}.control-bar>svg:hover{opacity:.8}.control-bar>svg:active{background:#ddd}.control-bar>svg:first-child{margin-left:0}.back-to-present{display:block;width:12px;height:12px;padding:7px;position:absolute;right:2px;bottom:33px;border-radius:15px;border:1px solid #8a8b8d;background:#eee;opacity:.4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;z-index:13}.back-to-present.hidden{display:none}.back-to-present:hover{opacity:.8}.back-to-present:active{background:#ddd}.property-page .symbol-edit-widget{margin:0}.properties-tabs .help{width:15px;height:15px;background:url(images/dialogs/study-help.png);float:right;margin:1px 10px 0 0}.bar-mark-tooltip{display:none;position:absolute;z-index:14;padding:8px 10px 8px 8px;background:rgba(255,255,255,.9);min-height:18px;border:solid 1px;border-color:gray}.bar-mark-tooltip .text{padding-left:4px;padding-top:2px;max-width:250px;overflow:hidden;text-overflow:ellipsis;display:inline-block;font-size:13px;line-height:13px}.published-charts-tooltip{display:none;position:absolute;z-index:14;padding:8px 30px 8px 8px;background:rgba(255,255,255,.9);border:solid 1px;height:32px;cursor:default;margin-top:-25px}.published-charts-tooltip .avatar{position:absolute;top:8px;left:8px;width:32px;height:32px}.published-charts-tooltip .avatar img{width:32px;height:32px}.published-charts-tooltip .pin{background-image:url(images/pin.png);width:16px;height:16px;vertical-align:top;position:absolute;top:9px;right:9px;cursor:pointer}.published-charts-tooltip .pin:hover{background-position:32px 0}.published-charts-tooltip .pin.pinned,.published-charts-tooltip .pin.pinned:hover{background-position:16px 0}.published-charts-tooltip .text{padding-left:39px;max-width:250px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;font-size:13px;line-height:15px;font-weight:700}.published-charts-tooltip .text:hover{text-decoration:underline}.published-charts-tooltip .username{font-size:11px;color:#8f8f8f;font-weight:400;padding-top:2px;padding-left:39px;white-space:nowrap;line-height:13px}.published-charts-tooltip:after,.published-charts-tooltip:before{left:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.published-charts-tooltip:after{border-width:1em;top:50%;margin-top:-1em}.published-charts-tooltip:before{border-width:1.1em;top:50%;margin-top:-1.1em}.published-charts-tooltip:after{border-color:rgba(255,255,255,0);border-left-color:#fff}.published-charts-tooltip.right:after{border-color:rgba(255,255,255,0);border-right-color:#fff}.published-charts-tooltip.right:before{left:-2.2em}.published-charts-tooltip.right:after{left:-2em}.published-charts-tooltip.green{border-color:#78c143}.published-charts-tooltip.red{border-color:#cc4545}.published-charts-tooltip.neutral{border-color:#eac300}.published-charts-tooltip.green:before{border-color:rgba(120,193,67,0);border-left-color:#78c143}.published-charts-tooltip.red:before{border-color:rgba(204,69,69,0);border-left-color:#cc4545}.published-charts-tooltip.neutral:before{border-color:rgba(234,195,0,0);border-left-color:#eac300}.published-charts-tooltip.green.right:before{border-color:rgba(120,193,67,0);border-right-color:#78c143}.published-charts-tooltip.red.right:before{border-color:rgba(204,69,69,0);border-right-color:#cc4545}.published-charts-tooltip.neutral.right:before{border-color:rgba(234,195,0,0);border-right-color:#eac300}.blue-tooltip{position:absolute;width:230px;border:1px solid #fff;background:rgba(0,0,0,.75);-webkit-box-shadow:0 0 10px rgba(0,0,0,.15);-moz-box-shadow:0 0 10px rgba(0,0,0,.15);box-shadow:0 0 10px rgba(0,0,0,.15);z-index:111;word-wrap:break-word}.blue-tooltip .double-width{width:460px}.blue-tooltip .short{width:150px}.blue-tooltip-text{margin:8px 10px;font-size:13px;color:#eee}.blue-tooltip-text small{font-size:12px}.blue-tooltip-hidden{display:none}.tooltip-pad::before,.tooltip-newbars::before,.blue-tooltip-icon{position:absolute;width:19px;height:11px;margin:-11px 0 -11px -9px}.tooltip-pad::before,.tooltip-newbars::before,.blue-tooltip-top .blue-tooltip-icon{bottom:0;background-position:0 -80px}.blue-tooltip-bottom .blue-tooltip-icon{top:0;background-position:-180px -80px}.blue-tooltip-bottom.ch-smiles-popup .blue-tooltip-icon{background-position:-167px -441px}.chart-controls-bar{position:absolute;height:22px;width:100%;left:0;bottom:0;background:#e6e9ed;overflow:hidden}.chart-container.inactive .chart-controls-bar{background:#f3f5f6}.chart-series-controls{float:right}.chart-controls-bar-buttons{overflow:hidden}.chart-controls-bar-buttons a{cursor:pointer;float:left;position:relative;padding:4px 13px;margin:0 0 1px 0;color:#8b8c8e;stroke:#8b8c8e;fill:#8b8c8e;font-size:11px;line-height:14px;font-weight:700}.chart-controls-bar-buttons a:not(.disabled):hover{background:#eceef1;color:#555;stroke:#555;fill:#555}.chart-controls-bar-buttons a.active,.chart-controls-bar-buttons a.active:hover{color:#58c3e5;stroke:#58c3e5;fill:#58c3e5}.chart-controls-bar-buttons a.disabled{color:#aaa;stroke:#aaa;fill:#aaa;cursor:default}.chart-controls-bar-buttons a:before{content:" ";display:block;position:absolute;top:4px;left:-1px;width:0;height:14px;border-left:solid 1px #d0d4d9}.chart-container.inactive .chart-controls-bar-buttons a{color:#d0d4d9;stroke:#d0d4d9;fill:#d0d4d9}.chart-container.inactive .chart-controls-bar-buttons a:not(.disabled):hover{background:#eceef1;color:#666;stroke:#666;fill:#666}.chart-container.inactive .chart-controls-bar-buttons a.active{color:#a2ddf0;stroke:#a2ddf0;fill:#a2ddf0}.chart-container.inactive .chart-controls-bar-buttons a.active:hover{color:#58c3e5;stroke:#58c3e5;fill:#58c3e5}.onchart-messages-wrapper{position:absolute;bottom:28px;right:9px;z-index:14}.onchart-message-top,.onchart-message-bottom{background:#fff;background:rgba(255,255,255,.92);border:solid #c9c9c9}.onchart-message-top{border-width:1px 1px 0 1px;font-size:14px;line-height:17px;padding:1px 18px;text-align:center}.onchart-message p,.onchart-message h3{color:#595959;font-size:14px;line-height:17px;margin:7px 0}.onchart-message .submit-button{margin:15px 0 0 0;text-align:center}.onchart-message .submit-button a{cursor:pointer;pointer-events:auto;display:inline-block;vertical-align:top;color:#fff;padding:6px 20px 5px 20px;background:#1fb2cc}.onchart-message .submit-button a:hover{background:#1fbad3}.onchart-message .onchart-message-close{cursor:pointer;pointer-events:auto;position:absolute;width:23px;height:23px;top:0;right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANklEQVR4AWMAgcjIyGUMqAAuDmcA8X8khRjiGAIYfBw6H8MVYANICh7DxIg2Ca+bSPUd4XACAJL9StMP8XreAAAAAElFTkSuQmCC) 50% 50% no-repeat}.onchart-message-bottom{height:23px;border-width:0 1px 1px 1px;margin:0 0 0 23px}.onchart-message-ear{position:absolute;height:23px;width:23px;bottom:0;left:0;border-top:1px solid #c9c9c9;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAASUlEQVR4AbXMgQAAIBAAsVHl8u7vUhLdAGZmzu7e3yDJIckhySHJIckhySHJIckhySHJIckhySHJIckhySHJIckhySHJIckhyR97eKuLN6YbhwAAAABJRU5ErkJggg==) 100% 0 no-repeat}.onchart-message-copy{position:relative;top:9px}@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?v=4.0.3);src:url(fonts/fontawesome-webfont.eot?#iefix&v=4.0.3) format('embedded-opentype'),url(fonts/fontawesome-webfont.woff?v=4.0.3) format('woff'),url(fonts/fontawesome-webfont.ttf?v=4.0.3) format('truetype'),url(fonts/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.ui-draggable{-ms-touch-action:none}.chart-gui-button-pseudo-border{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}.header-chart-panel .button,.properties-toolbar .button,.bottom-widgetbar-content.backtesting .button,.tv-dialog .button,.header-chart-panel .favored-list-container span,.properties-toolbar .favored-list-container span,.bottom-widgetbar-content.backtesting .favored-list-container span,.tv-dialog .favored-list-container span,.header-chart-panel .submenu,.properties-toolbar .submenu,.bottom-widgetbar-content.backtesting .submenu,.tv-dialog .submenu,.header-chart-panel .custom-select .switcher,.properties-toolbar .custom-select .switcher,.bottom-widgetbar-content.backtesting .custom-select .switcher,.tv-dialog .custom-select .switcher{position:relative}.header-chart-panel .button:not(.disabled):not(.selected):hover:before,.properties-toolbar .button:not(.disabled):not(.selected):hover:before,.bottom-widgetbar-content.backtesting .button:not(.disabled):not(.selected):hover:before,.tv-dialog .button:not(.disabled):not(.selected):hover:before,.header-chart-panel .favored-list-container span:not(.disabled):not(.selected):hover:before,.properties-toolbar .favored-list-container span:not(.disabled):not(.selected):hover:before,.bottom-widgetbar-content.backtesting .favored-list-container span:not(.disabled):not(.selected):hover:before,.tv-dialog .favored-list-container span:not(.disabled):not(.selected):hover:before,.header-chart-panel .submenu:not(.disabled):not(.selected):hover:before,.properties-toolbar .submenu:not(.disabled):not(.selected):hover:before,.bottom-widgetbar-content.backtesting .submenu:not(.disabled):not(.selected):hover:before,.tv-dialog .submenu:not(.disabled):not(.selected):hover:before,.header-chart-panel .custom-select .switcher:not(.disabled):not(.selected):hover:before,.properties-toolbar .custom-select .switcher:not(.disabled):not(.selected):hover:before,.bottom-widgetbar-content.backtesting .custom-select .switcher:not(.disabled):not(.selected):hover:before,.tv-dialog .custom-select .switcher:not(.disabled):not(.selected):hover:before{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}.header-chart-panel .colorpicker-widget:not(.disabled):not(.selected),.properties-toolbar .colorpicker-widget:not(.disabled):not(.selected),.bottom-widgetbar-content.backtesting .colorpicker-widget:not(.disabled):not(.selected),.tv-dialog .colorpicker-widget:not(.disabled):not(.selected){position:relative}.header-chart-panel .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover,.properties-toolbar .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover,.bottom-widgetbar-content.backtesting .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover,.tv-dialog .colorpicker-widget:not(.disabled):not(.selected):not(.disabled):hover{border:#b5b7b9 1px solid;z-index:1}.header-chart-panel .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.properties-toolbar .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.bottom-widgetbar-content.backtesting .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.tv-dialog .tv-button:not(.ok):not(.cancel):not(.disabled):not(.delete):hover,.header-chart-panel .tv-select-container:not(.sbHolderDisabled):hover,.properties-toolbar .tv-select-container:not(.sbHolderDisabled):hover,.bottom-widgetbar-content.backtesting .tv-select-container:not(.sbHolderDisabled):hover,.tv-dialog .tv-select-container:not(.sbHolderDisabled):hover{border:#b5b7b9 1px solid}.widgetbar-widgetheader .button:hover{border:#b5b7b9 1px solid}#footer-chart-panel .layout-toggle-container .tv-button{position:relative}#footer-chart-panel .layout-toggle-container .tv-button:hover:after{content:"";display:block;position:absolute;top:-1px;left:-1px;width:100%;height:100%;border:#b5b7b9 1px solid;background:0 0;z-index:1}#footer-chart-panel .save-load-buttons .button{position:relative}#footer-chart-panel .save-load-buttons .button:hover{border:#b5b7b9 1px solid;z-index:1}#footer-chart-panel .save-load-buttons .button:hover:not(.last){margin-right:-1px}#footer-chart-panel .save-load-buttons .button.save.titled:hover{overflow:visible;border-right:none;margin-right:0}#footer-chart-panel .save-load-buttons .button.save.titled:hover .separator{margin-top:-1px;border-top:#c9cbcd 1px solid;border-bottom:#c9cbcd 1px solid}.charts-popup-list.sound-selector .item .title-expanded{width:109px}.drawings-popup-list .item .title{vertical-align:top}.manage-sound-button{display:inline-block;float:right;cursor:pointer;width:18px;height:18px;position:relative}.manage-sound-button:before{content:" ";position:absolute;top:5px;left:5px}.manage-sound-button.play:before{width:0;height:0;border-style:solid;border-width:4px 0 4px 8px;border-color:transparent transparent transparent #a0a8b5}.manage-sound-button.stop:before{width:8px;height:8px;background-color:#a0a8b5}.manage-sound-button:hover.play:before{border-color:transparent transparent transparent #8791a1}.manage-sound-button:hover.stop:before{background-color:#8791a1}.manage-sound-button:active.play:before{border-color:transparent transparent transparent #cdd3db}.manage-sound-button:active.stop:before{background-color:#cdd3db}.property-page.strategy-properties td input[type=text]{width:100px}.property-page.strategy-properties tr.spacer td{padding:0;height:15px}.property-page.strategy-properties input+label{margin:0 12px 0 8px}.property-page.strategy-properties tr.disabled,.property-page.strategy-properties tr.disabled label:not(.always-enabled){color:#ccc}.property-page.strategy-properties input[type=text]:disabled{color:#ccc}.property-page.strategy-properties input[type=text]:disabled+.tv-ticker{display:none}.chart-sidebar{position:relative;width:270px;height:100%;top:0;right:0;overflow:hidden}.chart-sidebar.hidden{width:12px}.chart-sidebar .separator{width:13px;height:100%;position:absolute;left:0;z-index:10;cursor:pointer}.chart-sidebar .separator-bar{height:100%;width:1px;border-left:1px solid #c9cbcd;border-right:1px solid #c9cbcd;position:absolute;left:0;background:#fff;overflow:hidden}.chart-sidebar .separator:hover .separator-bar{background:#f4f7f9;width:11px;-moz-transition:all .2s;-webkit-transition:all .2s;-o-transition:all .2s;-ms-transition:all .2s;transition:all .2s}.chart-sidebar.hidden .separator-bar{background:#f4f7f9;width:11px}.chart-sidebar .separator-icon{background:url(images/sidebar.png) no-repeat;width:7px;height:43px;position:absolute;top:50%;left:2px;margin:-21px 0 0}.chart-sidebar.hidden .separator-icon{background-position:-7px 0}.chart-sidebar-pane{margin:34px 0 0 3px;position:relative}.chart-sidebar-pane .header{position:absolute;top:-34px;height:23px;padding:11px 7px 0;width:100%;color:#6f7073;background:#f1f3f6;font-weight:700;font-size:12px}.chart-sidebar-pane .header:hover{background:#f4f7f9;cursor:pointer}.chart-sidebar-pane .header>.icon{width:7px;height:4px;background-position:-184px -140px;vertical-align:middle;margin:0 6px 0 0}.chart-sidebar-pane.minimized .header>.icon{background-position:-192px -140px;height:7px;top:-1px}.chart-sidebar-pane .header .reorder-button{display:none;width:26px;height:26px;border:1px solid #f4f7f9;position:absolute;margin:-8px 0 0 4px;vertical-align:top}.chart-sidebar-pane .header .reorder-button:hover{background:#e0e5ea;border:1px solid #c9cbcd;border-radius:3px}.chart-sidebar-pane .header:hover .reorder-button{display:inline-block}.chart-sidebar-pane .header .reorder-button .icon{width:10px;height:11px;position:absolute;top:7px;left:8px;background-position:-180px -149px}.chart-sidebar-pane .header .reorder-button .icon.down{background-position:-190px -149px}.chart-sidebar-pane .container{height:100%}.chart-sidebar-vseparator{height:1px;background:#c9cbcd;position:relative;z-index:1;-ms-touch-action:none}.chart-sidebar-vseparator .handle{height:5px;width:100%;top:-2px;position:absolute;background:#fff;opacity:.01;cursor:url(chart-client/css/light/cursor_size_vertical.cur),w-resize}.chart-sidebar-vseparator .handle{cursor:url(chart-client/css/light/cursor_size_vertical.cur) 16 15,w-resize}.sb-inner-shadow{box-shadow:0 -1px 4px rgba(0,0,0,.15);position:absolute;bottom:-10px;width:100%;height:10px;background:#fff;z-index:5}.sb-inner-shadow.top{box-shadow:0 1px 4px rgba(0,0,0,.15);top:-10px}.sb-scrollbar{position:absolute;opacity:0;position:absolute!important;width:7px;height:100px;top:73px;right:1px;z-index:1;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-o-transition:opacity .3s;-ms-transition:opacity .3s;transition:opacity .3s}.sb-scrollbar.active,.sb-scrollbar.active-always{opacity:1}.sb-scrollbar-wrap{position:absolute;top:0;right:1px;width:6px;height:100%;z-index:1}.sb-scrollbar-wrap .sb-scrollbar{right:0}.sb-scrollbar-body{width:5px;border:0;background:#d8d8d8;width:6px}.gray .sb-scrollbar-body{background:#75757a;border-color:#75757a;border-radius:3px}.sb-scrollbar-top,.sb-scrollbar-bottom{display:none}.gray,.active-always.gray{opacity:.5}.chart-sidebar-pane .header.selectable .title{color:#007fb9;border-bottom:1px dashed #007fb9}.chart-sidebar-pane .header.selectable .title:hover{color:#3592bd;border-color:#3592bd}.chart-sidebar-pane .header.selectable .dropdown{display:inline-block;width:16px;height:12px;position:relative;top:1px;left:0}.chart-sidebar-pane .header.selectable .dropdown:after{content:'';display:block;width:0;height:0;border:4px solid transparent;border-top-color:#007fb9;position:relative;top:6px;left:6px}.symbol-list-container,.symbol-list{position:relative}.minimized .symbol-list-container,.minimized .symbol-list-header{display:none}.symbol-list-header{height:21px;z-index:1;margin:0 3px;border-bottom:1px solid #ebedf0;color:#888989;cursor:default}.symbol-list-header.sortable{cursor:default}.symbol-list-header.sortable .sorter:hover{cursor:pointer;color:#4c4f66}.symbol-list-item{display:block;height:32px;position:relative;color:#8f8f8f;margin:0 3px;cursor:pointer}.symbol-list-item:nth-child(even){background-color:#f8fafb}.symbol-list-item:hover{background:#edf1f2}.symbol-list-item>div,.symbol-list-header div{display:inline-block}.symbol-list-item .symbol{overflow:hidden}.symbol-list-item .symbol,.symbol-list-item .last-block,.symbol-list-item .change{margin:8px 0 0 0;white-space:nowrap;vertical-align:top}.symbol-list-item .symbol,.symbol-list-header .header-symbol{width:30%;text-indent:10px}.symbol-list-item .estimate,.symbol-list-header .header-estimate{width:10%;text-align:right}.symbol-list-item .last-block,.symbol-list-header .header-last{width:25%;text-align:right}.symbol-list-item .last-block .last{padding:0 2px}.symbol-list-item .change,.symbol-list-header .header-change{width:45%;text-align:right}.symbol-list-header .header-change div{margin:0 3px 0 0}.symbol-list-item .change .percent,.symbol-list-header .header-change div:last-child{margin:0 8px 0 0}.symbol-list-item.active{background:#ebf8ff}.symbol-list-item.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#3e98cd}.symbol-list .controls{display:none;position:absolute;top:6px;right:100%;overflow:hidden;height:100%}.symbol-list-item:hover .controls{right:8px;display:block}.controls-delete{display:none}.symbol-list.deletable .controls-delete{display:block;width:20px;height:20px;background:#da563e url(data:image/gif;base64,R0lGODlhBwAHAPIFAPLHv/vt6v///+eVhtpWPgAAAAAAAAAAACH5BAUKAAUALAAAAAAHAAcAAAMTOEAMKgtAIsNkNjAqbJySszRDAgA7) 50% 50% no-repeat;cursor:pointer;opacity:.75}.symbol-list.deletable .controls-delete:hover{opacity:1}.symbol-list-item.success{color:#333}.symbol-list-item.error{color:#da563e}.symbol-list-item .change.success .percent:before{content:'('}.symbol-list-item .change.success .percent:after{content:'%)'}.symbol-list-item .plus{color:#238859}.symbol-list-item .minus{color:#dc5538}.symbol-list-item .plus-bg,.symbol-list-item .minus-bg{color:#fff}.symbol-list-item .plus-bg{background-color:#238859}.symbol-list-item .minus-bg{background-color:#dc5538}.symbol-list-item .session-status{display:inline-block;width:4px;height:4px;margin:6px 0 5px 4px;border-radius:2px;position:relative}.symbol-list-item .session-status.market{background:0 0}.symbol-list-item .session-status.pre_market{background:#f79d16}.symbol-list-item .session-status.post_market{background:#0a8dff}.symbol-list-item .session-status.out_of_session{background:#9c9c9c}.wl-symbol-edit{float:left;background:#fff;color:#cfd2d4;font-size:12px;width:100px;padding:0 5px;border:solid #c9cbcd 1px;color:#000;height:30px;font-family:'Open Sans',sans-serif;box-sizing:border-box;-moz-box-sizing:border-box}.wl-symbol-edit:focus{border-color:#4c82ce}.symbol-list-item sup{font-size:80%;vertical-align:top}.tv-detail{height:100%;position:relative;overflow:hidden;-webkit-overflow-scrolling:touch}.tv-detail sup{vertical-align:25%;font-size:80%}.dl-header{padding:9px 10px 5px}.dl-header-figures{clear:both;white-space:nowrap}.dl-header-price{font-size:28px;font-weight:700;color:#42434a;min-height:34px}.dl-header-change{font-size:17px;font-weight:700;margin:0 0 0 8px}.dl-header-session-status{font-size:11px;color:#9e9e9e;margin-top:-2px}.dl-header-price .plus,.dl-header-price-extended .plus,.dl-header-change.plus,.dl-header-change-extended.plus{color:#238853}.dl-header-price .minus,.dl-header-price-extended .minus,.dl-header-change.minus,.dl-header-change-extended.minus{color:#dd5538}.dl-header-extended-data{clear:both;white-space:nowrap;margin:6px 0 0}.dl-header-price-extended{font-size:22px;font-weight:700;color:#42434a}.dl-header-change-extended{font-size:16px;font-weight:700;margin:0 0 0 8px}.dl-header .market-status-marker{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:3px;margin-right:5px}.dl-header .market-status-marker.open{background:#68a582}.dl-header .market-status-marker.closed{background:#9c9c9c}.dl-header .market-status-marker.pre-market{background:#f79d16}.dl-header .market-status-marker.post-market{background:#0a8dff}.dl-header #showExtendedHoursLink a{border-bottom:1px dashed #007fb9}.dl-header-symbol{color:#43464e;font-size:15px}.dl-header-symbol-desc{color:#333;font-weight:700;font-size:15px;margin:0 7px 0 0}.dl-header-earning{float:right;width:28px;height:28px;text-align:center;cursor:default;border:1px solid #c9cbcd;color:#c9cbcd;padding-top:5px;box-sizing:border-box;-moz-box-sizing:border-box}.dl-header-earning.soon{border:1px solid #dc5538;color:#dc5538}.dl-header-industry{padding:3px 0 4px;font-size:11px;color:#787878}.dl-bidoffer-spread{margin:10px 0 0}.dl-bidoffer-spread span{display:inline-block;font-size:12px;margin-right:1px;padding:2px 8px;border-radius:9px}.dl-bidoffer-spread span.dl-bid{color:#5b85bf;background:#d4e6fe;margin-right:5px}.dl-bidoffer-spread span.dl-ask{color:#b35b46;background:#f5d8d3}.dl-bidoffer-spread span b{color:#5b85bf}.dl-data{position:relative;padding:0 3px 10px}.dl-item-nodata{display:none;margin:10px;color:#666}.dl-item-group{display:none;margin:12px 10px 0}.dl-item-group-col{float:left;width:48%}.dl-item-group-col:nth-child(even){float:right}.dl-item-group-header{height:20px;cursor:default;color:#343649;font-weight:700;border-bottom:1px solid #343649;padding:3px 0 0 3%}.dl-item{color:#5a5d66;border-bottom:1px solid #eaeaea;height:21px;cursor:default;position:relative;float:left;width:50%}.dl-item.full{float:none;width:100%}.dl-item:hover{background:#edf0f3}.dl-item.drag{background:#edf0f3;box-shadow:0 1px 1px rgba(0,0,0,.2)}.dl-item:hover .wl-icon-delete,.dl-item.drag .wl-icon-delete{display:inline-block}.dl-col{float:left;height:18px;padding:3px 0 0;overflow:hidden}.dl-col-field{width:42%;font-size:11px;color:#888989;padding-left:4%;padding-top:4px;white-space:nowrap;text-overflow:ellipsis}.dl-col-val{width:50%;padding-right:4%;white-space:nowrap;text-overflow:ellipsis;text-align:right;font-weight:700}.dl-col-del{width:15px;position:absolute;right:0}.dl-col-del .wl-icon-delete{top:0}.dl-item.full .dl-col-field{width:69%}.dl-item.full .dl-col-val{width:23%;font-weight:700;color:#7c7c7c}.dl-minichart{height:80px;margin:10px 10px 19px 10px;position:relative;overflow:hidden}.dl-range{height:43px;position:relative;margin:0 10px}.dl-range.first-child{margin:5px 10px 0}.dl-range-mark{width:9px;height:13px;background-position:-140px -220px;position:absolute;margin-left:-5px;left:0;top:2px;-moz-transition:all .3s;-webkit-transition:all .3s;-o-transition:all .3s;-ms-transition:all .3s;transition:all .3s;z-index:1}.dl-range-mark.bid{background-position:0 -337px;opacity:.5;z-index:2}.dl-range-mark.ask{background-position:-9px -337px;opacity:.5;z-index:2}.dl-range-mark.low{margin-left:-4px}.dl-range-bar-bg{height:7px;position:absolute;top:16px;width:100%;background:#d8d8d8}.dl-range-bar{height:7px;background:#51a076;position:absolute;-moz-transition:all .3s;-webkit-transition:all .3s;-o-transition:all .3s;-ms-transition:all .3s;transition:all .3s;border:solid #fff;border-width:0 1px;margin-left:-1px}.dl-range-bar.low{background:#b35b46}.dl-range-bar.hl{background:#aaa}.dl-range-price-l,.dl-range-price-r{position:absolute;font-weight:700;color:#42434a;top:25px}.dl-range-price-r{right:0}.dl-range-caption{position:absolute;bottom:2px;width:100%;text-align:center;color:#787878;font-size:11px}.dl-dialog{height:500px;overflow-y:scroll}.dl-dialog-data{margin:10px 0 0}.dl-dialog-header{font-size:12px;margin:0 0 5px 0}.dl-dialog-header>strong{font-size:14px}.dl-dialog-header>a{margin:0 0 0 8px;text-decoration:underline}.dl-company-desc{font-size:12px;color:#787878;height:46px}.dl-dialog-more{display:inline-block;cursor:pointer;border-bottom:1px dashed #007fb9;height:14px}.dl-followsymbol button.follow-symbol{vertical-align:top;margin:3px 0 0 4px}.dl-estimate-tooltip>div{margin-top:4px}.depth-widget-notice{padding:2px 10px;color:#666}.depth-widget-notice p{margin:8px 0;text-align:center}.depth-widget-notice p.hint{font-size:12px;font-style:italic}.depth-zoom-wrapper{pointer-events:none;position:absolute;top:2%;left:50%;margin:6px 0 0 -53px;width:99px;background:#d8d8d8;padding:0 0 0 6px;height:4px}.depth-zoom-handle{pointer-events:auto;z-index:11;position:absolute;left:0;top:-8px;width:6px;height:18px;background:#b0b0b0;border-radius:2px;border:1px solid #fff;margin:0 0 0 -1px}.depth-zoom-plus,.depth-zoom-minus{pointer-events:auto;cursor:pointer;position:absolute;top:-8px;width:20px;height:18px;background:#b0b0b0 50% 50% no-repeat;border:1px solid #fff;border-radius:2px}.depth-zoom-plus{right:-22px;background-image:url(data:image/gif;base64,R0lGODlhCAAIAKECAPX19f39/f///////yH5BAEKAAMALAAAAAAIAAgAAAISnBWmI7LnYJsC2GaBao/FhSgFADs=)}.depth-zoom-minus{left:-22px;background-image:url(data:image/gif;base64,R0lGODlhCAAIAPACAPX19f///yH5BAUKAAIALAAAAAAIAAgAQAIMlG+gEQoIozSs1jkLADs=)}.depth-zoom-plus:hover,.depth-zoom-minus:hover{background-color:#b7b7b7}.depth-zoom-plus:active,.depth-zoom-minus:active{background-color:#aaa}.depth-zoom-plus.disabled,.depth-zoom-minus.disabled{opacity:.5;cursor:default;pointer-events:none;background-color:#b0b0b0}.depth-widget-wrap.dragging,.depth-widget-wrap.dragging .depth-zoom-plus,.depth-widget-wrap.dragging .depth-zoom-minus,.depth-zoom-handle{cursor:ew-resize}.tv-news{height:100%;position:relative}.ns-data{position:absolute;width:100%;-moz-transition:opacity .3s;-webkit-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}.ns-data.loading{opacity:.5}.ns-item{border-bottom:1px solid #ebedf0;padding:6px 0 6px;position:relative;margin:0 3px}.ns-item:hover{background:#edf0f3}.ns-item-title{margin:0 12px;color:#5a5d66;font-size:13px}.ns-item-title a:hover{text-decoration:underline}.ns-item-desc,.ns-item-date{color:#8f8f8f;font-size:10px}.ns-item-desc{margin:2px 30px 0 12px;min-height:13px}.ns-item-desc .source{font-weight:700}.ns-item-date{position:absolute;bottom:6px;right:12px}.ns-fxwire-message{margin:30px 15px 0;text-align:center;font-size:14px;color:#595959}.ns-fxwire-message h3{margin:5px 0}.ns-fxwire-message a{cursor:pointer;pointer-events:auto;display:inline-block;vertical-align:top;color:#fff;padding:6px 20px 5px 20px;background:#1fb2cc}.ns-fxwire-message-close{cursor:pointer;pointer-events:auto;position:absolute;width:23px;height:23px;top:0;right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAANklEQVR4AWMAgcjIyGUMqAAuDmcA8X8khRjiGAIYfBw6H8MVYANICh7DxIg2Ca+bSPUd4XACAJL9StMP8XreAAAAAElFTkSuQmCC) 50% 50% no-repeat}div.widgetbar-widgetheader-icon-economic-calendar{background-position:0 -338px}.widgetbar-widgetheader-icon svg{fill:#7d7d7d}div.widgetbar-widgetheader-icon-earnings-calendar{background-position:-2px -387px}div.calendar-widget-scnt{height:100%;position:relative;overflow:hidden;-webkit-overflow-scrolling:touch}div.calendar-widget-dcnt{position:absolute;width:100%}div.calendar-widget,div.calendar-widget.header{font-size:.9em;height:18px;padding:7px 0 7px 11px;color:#5a5d66;cursor:default;display:block;overflow:hidden;margin:0 3px}div.calendar-widget.header{height:17px;padding:0 0 0 11px}div.calendar-widget div{white-space:nowrap;display:inline-block;z-index:2;overflow:hidden;box-sizing:border-box}div.calendar-widget.day{padding:8px 5px 6px 10px;display:block;background:#eff9ff;font-weight:700;color:#2f5d7a;margin:3px;text-transform:uppercase}div.calendar-widget.day.green{background:#e4f3d5;color:#4c6e28}div.calendar-widget.green{background:#f7fbf3}div.calendar-widget.day.hand{cursor:pointer}div.calendar-widget div a{color:#5d8ed5}div.calendar-widget.regular{margin-left:3px;position:relative}div.calendar-widget.regular:hover{background:#ecf6e1;cursor:pointer}div.calendar-widget.regular:hover div{cursor:pointer}div.calendar-widget.regular.active,div.calendar-widget.regular.active:hover{background:#ebf8ff}div.calendar-widget.regular.active:before{content:'';display:block;width:3px;height:100%;position:absolute;top:0;left:0;background:#3e98cd}div.calendar-widget.hidden{display:none;visibility:hidden;height:0}div.calendar-widget.regular div.symbol{color:#303030}div.calendar-widget div img{margin:0 0 0 10px;width:11px;height:11px;border:0 solid #000;display:inline}div.calendar-widget div.bold{font-weight:700}div.calendar-widget div.ar{text-align:right}div.calendar-widget div.actual{text-align:right;color:#5a5d66}div.calendar-widget div.calendar-widget-w-15{width:20%}div.calendar-widget div.calendar-widget-w-23{width:23%}div.calendar-widget div.calendar-widget-w-15-l{width:15%;padding:0 2% 0 0}div.calendar-widget div.calendar-widget-w-30{width:30%}div.calendar-widget div.calendar-widget-w-35{width:35%}div.calendar-widget div.calendar-widget-w-25-l{width:30%}div.calendar-widget.header div.calendar-widget-w-15,div.calendar-widget.header div.calendar-widget-w-23,div.calendar-widget.header div.calendar-widget-w-15-l,div.calendar-widget.header div.calendar-widget-w-30,div.calendar-widget.header div.calendar-widget-w-35,div.calendar-widget.header div.calendar-widget-w-25-l{color:#888989;font-weight:400}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#6b6b6d}.ui-widget-content a{color:#6b6b6d}.ui-widget-header{border:1px solid #c9cbcd;background:#fafafa;color:#6b6b6d}.ui-widget-header a{color:#6b6b6d}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#fafafa;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-widget :active{outline:0}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #FDE763;background:#FFF8CF;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}// .ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}// .ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}// .ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}// .ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}// .ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}// .ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}// .ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}// .ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-autocomplete{position:absolute;cursor:default}* html .ui-autocomplete{width:1px}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left}.ui-menu .ui-menu{margin-top:-3px}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;margin:5px 0;background:0 0}.ui-tabs .ui-tabs-hide{position:absolute;left:-10000px}.ui-datepicker{padding:0;border:none;display:none}.ui-datepicker .ui-datepicker-header{position:relative;height:53px;line-height:53px;border:none;padding:0;background-color:#00b9db;color:#fff;// arrows .ui-datepicker-prev,.ui-datepicker-next{opacity:.8;position:absolute;top:0;width:40px;height:100%;background:0 0;border:none;cursor:pointer;&.ui-state-disabled{opacity:.4}}.ui-datepicker-prev-hover:not(.ui-state-disabled),.ui-datepicker-next-hover:not(.ui-state-disabled){opacity:1;background:0 0;border:none}.ui-datepicker-next{right:0;span{.icon-absolute("white_arrow_small_r.png")}}.ui-datepicker-prev{left:0;span{.icon-absolute("white_arrow_small_l.png")}}}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:12px;border-collapse:collapse;margin:0;border:1px solid #d6d6d6;border-top:none}.ui-datepicker th{width:40px;height:28px;border-bottom:1px solid red;padding:0;border:none;border-bottom:1px solid #d6d6d6;text-align:center;font-weight:400;color:#8d9196;background-color:#f8f8f8}.ui-datepicker td{border:none;padding:0;margin:0;span,a,span.ui-state-default,a.ui-state-default{display:block;position:relative;height:39px;padding:0;margin:0;text-align:center;line-height:40px;background:#fff;border:none;border-bottom:1px solid #f6f7f8;border-right:1px solid #f6f7f8;text-decoration:none;&.ui-state-highlight{color:#00b9db;&:after{position:absolute;top:0;right:0;content:" ";width:0;height:0;border-style:solid;border-width:0 11px 11px 0;border-color:transparent #00badb transparent transparent}}&.ui-state-hover{background:#eceff2}}&.ui-datepicker-current-day{span,a{border:2px solid #00b9db;color:#00b9db;height:36px;line-height:37px}}}.ui-datepicker td:last-child span:not(.ui-state-highlight),.ui-datepicker td:last-child a:not(.ui-state-highlight){border-right:none}.ui-datepicker tr:last-child td span:not(.ui-state-highlight),.ui-datepicker tr:last-child td a:not(.ui-state-highlight){border-bottom:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%}html.min-width-auto,html.min-width-auto body{min-width:0}.chart-section{background:#eaeff4;.not-moderated &{background-color:#F5F4E0}}.view-chart{.view-chart-header{padding:20px 0 22px;.avatar{float:left;img{width:70px;height:70px;.border-radius(2px)}}h1{margin:0;font-weight:600;font-size:21px;text-transform:uppercase;display:inline-block;color:#3b3e44;vertical-align:middle;line-height:24px}.header-icons{display:inline-block;margin-left:3px;vertical-align:middle;span{line-height:18px}}.chart-name-author{padding-left:90px}.chart-author{padding-top:7px;font-size:14px;font-weight:600;.creation-date{margin-left:8px;font-size:13px;color:#9BA9B7;font-weight:400}.user-badge{margin:1px 3px 0 5px;vertical-align:top}.follow-link{display:inline-block;position:static;margin-top:2px;vertical-align:top}}}.chart-symbol{display:inline-block;.follow-symbol{top:2px}}.symbol-quote{font-size:13px;font-weight:600;&>div{white-space:nowrap}a{margin-right:7px}.symbol-quote-stats{margin-left:3px;>span{padding:0 3px;&:empty{display:none};.border-radius(2px)}}}.symbol-market-type{text-transform:uppercase}.symbol-descr{margin-right:7px;a{margin-right:0}}}.viewchart-column-main{.chart-view-top{padding-bottom:16px;.creation-date{float:right;color:#707070;padding-left:10px}}.chart-buttons-wrap{position:absolute;top:60px;left:7px;z-index:3;.chart-relation-buttons{position:static;margin-bottom:10px}.chart-share-button{position:relative}}}body.viewchart-body{.tv-layout-width{margin:0 auto;width:980px;@media (min-width:1000px){width:96%}@media (min-width:1400px){width:94%}}.tv-layout-width .tv-index-footer-wrap{padding-left:0;padding-right:0}}.viewchart-column-main{padding:10px 0 15px}.viewchart-body-popup{height:auto}.viewchart-column-main .chart-title{height:45px;border:1px dotted red;border-width:0}.viewchart-column-main .chart-container-wrap{position:relative}.viewchart-column-main .chart-actions-float{float:right}.viewchart-column-main .chart-actions-float .button{background:#00b8c9;line-height:20px;display:inline-block;padding:0 8px;.border-radius(1px);color:#fff;font-weight:700;cursor:pointer;&:hover{background:lighten(#00b8c9,5%)}}.viewchart-column-main #chart-container,.viewchart-column-main .chart-place{height:100%;position:relative}.viewchart-column-main #published-loading-indicator{z-index:14}.viewchart-column-main .chart-stats{float:right;font:700 15px Calibri,Arial;color:#828282;position:relative;top:5px}.viewchart-column-main .chart-footmeta{.chart-tags{padding:15px 100px 0 0}.chart-tag{@chart_tag_bg:#E2E9F0;float:left;line-height:16px;height:22px;white-space:nowrap;padding:4px 7px 0 10px;margin:4px 20px 4px 0;position:relative;background:@chart_tag_bg;color:#8C919A;&:after{content:' ';position:absolute;top:0;right:-7px;width:0;height:0;border-top:13px solid transparent;border-bottom:13px solid transparent;border-left:7px solid @chart_tag_bg}&:hover{color:#fff;background:#06b2ce;&:after{border-left-color:#06b2ce}}}}.viewchart-column-main .symbol-quote .symbol-change-pt:before{content:'('}.viewchart-column-main .symbol-quote .symbol-change-pt:after{content:')'}.viewchart-column-main .symbol-quote .symbol-change-pt:empty:before{content:''}.viewchart-column-main .symbol-quote .symbol-change-pt:empty:after{content:''}.view-chart.is-my-chart .chart-relation-buttons .agree{cursor:default}.view-chart .chart-status-buttons{display:none;margin-left:40px}.view-chart.is-my-chart .chart-status-buttons{display:inline}.view-chart.is-staff .chart-status-buttons{display:inline}.viewchart-column-main .chart-actions-agree-wrapper{overflow:hidden;height:0}.viewchart-column-main .chart-actions-agree{clear:both;position:relative;padding:15px 9px;margin:5px 0 0;font-size:12px;background:#f2f5f8;border:1px solid #BFBFBF;border-radius:2px}.viewchart-column-main .chart-actions-agree .close{position:absolute;top:5px;right:5px;display:block;width:13px;height:13px;background:transparent url(images/icons.png) -80px -100px;cursor:pointer}.viewchart-column-main .chart-actions-agree .close:hover{background-position:-100px -100px}.chart-actions-agree-comment-block{position:relative;margin:12px 0 0 0}.viewchart-column-main .chart-actions-agree-comment-block textarea{width:670px;min-height:46px}.viewchart-column-main .chart-actions .chart-opinion-sum .positive{color:#390}.viewchart-column-main .chart-actions .chart-opinion-sum .positive:before{content:"+"}.viewchart-column-main .chart-actions .chart-opinion-sum .negative{color:#C00}.viewchart-column-main .chart-actions .chart-followers-count span{color:#ea9207}.viewchart-column-main .chart-actions .tv-button.with-arrow span{font-family:Arial;vertical-align:baseline}.user-list-popup{width:400px;position:fixed}.user-list-popup .likes-col{width:50%;float:left}.user-list-popup .dislikes-col{width:50%;float:left}.user-list-popup .col-head{padding:4px 0 12px 0;font-size:15px;line-height:19px}.user-list-popup .col-head:before{width:12px;height:14px;background:url(images/icons.png) no-repeat;display:inline-block;content:" ";margin-right:6px;vertical-align:top;margin-top:1px}.user-list-popup .likes-col .col-head:before{background-position:-20px -180px}.user-list-popup .dislikes-col .col-head:before{background-position:-180px -180px;margin-top:5px}.search-results .chart-actions{opacity:.5;.transition(opacity .1s ease)}.search-results .item:hover .chart-actions{opacity:1}.viewchart-column-main .chart-actions{float:right}.chart-actions-agree .controls{float:right}.chart-actions-agree .tv-button{text-transform:uppercase;padding:6px 14px 5px}.chart-actions-agree-comment-field{overflow:hidden}.chart-actions-agree-comment-field-sizer{margin:0 14px 0 0}.chart-actions-agree-comment-block .chart-actions-agree-comment-field-sizer textarea{display:block;width:100%}.viewchart-column-main textarea{color:#595959;border:1px solid #c9cbcd;background:#FAFAFA;border-radius:1px;margin:0;padding:2px 3px;font-family:sans-serif;font-size:14px}.viewchart-column-main textarea::-webkit-input-placeholder{color:#777}.viewchart-column-main textarea:-moz-placeholder{color:#777}.viewchart-column-main textarea:-ms-input-placeholder{color:#777}.viewchart-column-main textarea:focus::-webkit-input-placeholder{color:transparent}.viewchart-column-main textarea:focus:-moz-placeholder{color:transparent}.viewchart-column-main textarea:focus:-ms-input-placeholder{color:transparent}.viewchart-column-main .chart-description{position:relative;margin-top:25px;padding:3px 60px 3px 3px;color:#3b3e44;font-size:15px;line-height:25px}.viewchart-column-main .chart-description div{overflow-x:hidden;text-overflow:ellipsis}.viewchart-column-main .chart-description .tv-button{border:none;border-radius:0}.viewchart-column-main .chart-description .edit{position:absolute;top:3px;right:3px;.button-base-color();color:#fff!important;width:35px;text-align:center;&.pending{background:url(images/button-base-process.gif)}}.chart-related-block{padding:10px 0 10px;background:#EAEFF4;>.tv-layout-width{padding-top:12px;border-top:#D9E1EA 1px solid}.chart-related-col.half{float:left;width:50%}.head{position:relative;color:#5CB888;font-size:16px;font-weight:600;text-transform:uppercase;margin:12px 0 0;padding-left:21px;&:before{content:' ';display:block;position:absolute;margin-top:-8px;top:50%;left:0;.sprite("related-chart-green.png",true)}&.rebounds:before{.sprite("rebound-chart-green.png",true)}}.related-charts-wrap{margin:15px 0;font-size:0}}.related-chart{margin:15px 35px 15px 0;.avatar{position:relative;top:4px;float:left;margin-right:10px}.chart-info{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;.chart-name{font-size:14px;font-weight:600}.chart-info{margin:4px 0 0 0;color:#8c919a;font-size:12px;a{font-weight:600}span{margin-left:8px}.comments{color:#3A3D44}.icon-comments{margin-left:5px;display:inline-block;.sprite("comments-small.png",true);vertical-align:bottom;vertical-align:text-bottom}.user-badge{margin-left:3px}}}}.chart-comment-form-container{margin-bottom:30px}.comment-block .chart-comment-form{margin:10px 0 0 0}.chart-comment-form-avatar{width:53px}.chart-comment-form-avatar>div{width:41px;height:41px;margin:0 6px 0 0;background:#fff;border:1px solid #C4CED6}.chart-comment-form-textarea{position:relative;overflow:hidden}.chart-comment-form-textarea textarea{display:block;height:78px;font:14px 'Open Sans',sans-serif;margin:0;padding:6px 8px;padding-right:30px;border:solid 1px #d5d9de;width:100%;.box-sizing(border-box);&:focus{border-color:#1fb2cc};&.process{background:rgba(255,255,255,.5)}}.chart-comment-form-textarea textarea.disabled,.chart-comment-form-textarea textarea:focus.disabled{border:1px solid #D22}.chart-comment-form-textarea .non-latin-warning{display:none;color:#D22;font-size:12px;padding-top:4px}.chart-comment-form-controls{margin-top:15px;height:32px}.chart-comment-form-controls .button{.button-base();float:right}.reply-form-block{width:100%;clear:both;.chart-comment-form-controls{margin-bottom:8px}.chart-comment-form{margin-top:15px}}.insert-chart-tag{display:block;width:22px;height:22px;position:absolute;top:7px;right:7px;cursor:pointer;background:#f2f5f8;&:hover{background:darken(#f2f5f8,5%)}&:before{.pseudo();.icon-absolute("chart-small.png");top:5px;left:5px}.border-radius(2px)}.attach-chart-toolbar{position:absolute;top:-29px;right:7px;&.active{top:7px}.transition(top .1s ease);input{.box-sizing(content-box);float:left;width:290px;height:24px;line-height:24px;border:solid 1px #d5d9de;margin:0;padding:0 5px;&.error{background:#FFEFEF;color:#9E2E30}}.button{float:left;margin-left:7px;.button-base(13px,26px)}}.chart-comments-list{margin-left:-9px;.comment-form-toolbar{height:21px;padding:0 5px;border-radius:4px 4px 0 0;background:url(images/gallery/nav-bg.png);border:1px solid #c5c5c5;border-bottom-color:#a5a5a5;box-shadow:0 1px 0 rgba(0,0,0,.1);position:relative;top:3px}.comment-form-toolbar a{display:inline-block;text-align:center;float:left;margin:0 1px;width:21px;height:21px;cursor:default}.comment-form-toolbar a:hover{margin:0;border-left:1px solid #ccc;border-right:1px solid #ccc}.comment-form-toolbar a:active{margin:0;border-left:1px solid #ccc;border-right:1px solid #ccc;background:url(images/button-bg.png) 0 -52px}.post-comment-button{margin:1px 0 0 10px;float:left}.chart-comments{margin:7px 0 20px 7px}.comment-block{padding:9px 9px 3px;font-size:14px;color:#3b3e44;overflow:hidden;margin-bottom:15px;background:#f2f5f8;&:hover,&.active{background:#eaeff4}}.comment-block .spam_message{border:solid 1px red;background:#EDBEBF;padding:10px;margin-bottom:10px}.comment-header-text{margin-left:50px}.comment-header{position:relative}.comment-header .avatar-middle{float:left;margin-top:2px}.comment-block .comment-author a.userlink{color:#0099D4;font-size:14px;font-weight:600}.comment-block .comment-author .user-badge{margin-left:4px}.comment-block .comment-date{color:#8c919a;font-size:12px;margin-left:8px}.comment-block .comment-body{margin:5px 0 0;word-wrap:break-word;padding-right:50px;line-height:20px;font-size:13px}.comment-actions-inline{font-size:13px;// opacity:0;// .transition(opacity .2s ease-in);line-height:20px;padding-top:5px;height:27px}.comment-block:hover .comment-actions-inline{// opacity:1}.comment-actions-inline a{text-decoration:none;cursor:pointer}.comment-actions-inline .separator{width:2px;height:2px;display:inline-block;margin:3px 3px 2px;background:0 0;overflow:hidden;&.rating-indent{margin-right:6px}}.comment-actions-inline .rating{.rating-sum{padding:0 7px;.border-radius(2px);color:#fff;font-weight:600;&.positive{background-color:#5CB888;&:before{content:"+"}}&.negative{background-color:#E0735E}&.zero{padding:0;font-size:0;margin-left:-17px;visibility:hidden}}.vote{margin-left:15px;font-size:0;vertical-align:middle}.agree,.disagree{vertical-align:middle;display:inline-block;position:relative;font-size:0;width:15px;height:16px;opacity:.7;&:hover{opacity:1}}.agree:before{.pseudo();.icon-absolute-center("wi_up_icon.png");margin-top:-7px!important}.agree.active:before{.icon-absolute-center("wi_up_active_icon.png")}.disagree:before{.pseudo();.icon-absolute-center("wi_down_icon.png")}.disagree.active:before{.icon-absolute-center("wi_down_active_icon.png")}.active{font-weight:700;opacity:1}.separator{display:none}}.comment-block .comment-body.notice{font-style:italic;margin:10px 0 7px;color:#909090}.comment-0{margin-left:0}.comment-1{margin-left:30px}.comment-2{margin-left:60px}.comment-3{margin-left:90px}.comment-4{margin-left:120px}.comment-5{margin-left:150px}.comment-6{margin-left:180px}.comment-7{margin-left:210px}.comment-8{margin-left:240px}.comment-9{margin-left:270px}.comment-10{margin-left:300px}.comment-11{margin-left:330px}.comment-12{margin-left:360px}.comment-13{margin-left:390px}.comment-14{margin-left:420px}.comment-15{margin-left:450px}}.share-options{display:none;background:#f2f5f8;position:absolute;z-index:14;width:930px;min-height:315px;top:50%;left:50%;margin-top:-157px;margin-left:-465px;.box-shadow(0 0 10px rgba(0,0,0,.2));.tab-arrow{position:absolute;left:398px;top:-10px}.close-button{position:absolute;right:10px;top:10px;width:10px;height:10px;background:url(images/icons.png) no-repeat -103px -340px;cursor:pointer}p{margin:13px 3px 7px 3px;font-size:14px}a.embed{cursor:pointer;border-bottom:1px dashed #5590d1;font-weight:700}a.embed.active{border:none;color:#636565}input[type=text]:not(.tv-dialog-text-input){color:#3e4040;width:300px;height:28px;border:1px solid #bfbfbf;margin:0;padding:0 5px;background:#f7f9fc}input[type=text]:not(.tv-dialog-text-input):focus{background:#f1f1f1;margin:0}.addthis{position:relative;top:-1px;.custom_button_stocktwits{display:inline-block;float:left;width:20px;height:18px;margin:0 2px;padding:6px 6px 8px;background:#890A0A;cursor:pointer;.icon{display:inline-block;position:relative;vertical-align:middle;width:22px;height:14px;background:url(images/icons.png) -140px -300px no-repeat}}}.share-warapper{padding:10px 20px;max-width:910px;margin:0 auto}.share-base{float:left;width:315px}.make-it-mine label{.button-base();width:300px+12px;padding:0}}.embed-options{margin:0 0 5px;padding-left:335px}.embed-options textarea{color:#3e4040;height:80px;border:1px solid #bfbfbf;margin:0;padding:5px;background:#f7f9fc;resize:both;width:100%;.box-sizing(border-box)}.embed-options textarea:focus{background:#f1f1f1;margin:0}.embed-options p.desc{font-size:12px}.embed-options .size-select{.clearfix();padding-bottom:10px}.embed-options .size-button{cursor:pointer;width:60px;height:37px;float:left;background:#ececec;border:1px solid silver;position:relative;margin:14px 12px 0 0}.embed-options .size-button.active{background:#cceaff;border:1px solid #528cde}.embed-options .size-button.b2{width:96px;height:60px}.embed-options .size-button.b3{width:108px;height:72px}.embed-options .size-button.b4{width:119px;height:71px}.embed-options .size-button div{position:absolute;width:100%;top:50%;text-align:center;margin:-7px 0 0}.embed-options .size-custom{float:left;font-size:12px}.embed-options .size-custom input[type=text]{width:40px}.viewchart-column-right{float:right;width:320px}.viewchart-column-right .carousel-item{margin:9px 0 0 0}.viewchart-column-right .carousel-item.active{border:2px solid #007FB9}.viewchart-column-right .show-more{margin:6px 5px 50px 0;.button{.button-base-hollow();display:block;font-weight:600;width:60%;margin:0 auto}}.viewchart-column-right .related-charts+.clear{height:15px}.viewchart-column-right h2{font:700 16px Arial;color:#5A5A5A;text-transform:uppercase;margin:0 0}.viewchart-column-right h2 .icon{top:3px;margin:0 3px 0 0}.exit-fullscreen{z-index:16;position:fixed;top:-1px;left:50%;opacity:.6;background:#FFF;color:#848487;border-radius:0 0 3px 3px;border:1px solid #c9cbcd;font-size:11px;width:116px;font-weight:700;padding:2px 4px;cursor:default;margin:0 0 0 -62px}.exit-fullscreen:hover{opacity:1}.viewchart-body .chart-status-picture{z-index:50;position:absolute}.chart-additional{padding:40px 0 0;.head{color:#26282f;font-size:16px;font-weight:700;text-transform:uppercase;padding-bottom:15px}.similar-charts{margin:-5px 0 0 -5px}}.chart-comments{padding-right:350px;padding-bottom:25px;.embeded-image,.embeded-chart-image{cursor:pointer;margin-top:4px}.embeded-image img,.embeded-chart-image img{border:1px solid #C4CED6;max-width:100%}.comment-body iframe{margin-top:4px;max-width:100%}}.chart-additional.no-similar .chart-comments{padding-right:0}.embeded-image-popup{position:fixed;z-index:100;border:1px solid #C4CED6;padding:10px;border-radius:5px;background:#fff}.chart-direction-label,.chart-activity-label{text-transform:uppercase;color:#fff;font-size:11px;border-radius:1px;padding:0 4px;display:inline-block;line-height:18px;vertical-align:top;margin:0 0 0 3px;position:relative;font-weight:700;cursor:default;white-space:nowrap}.chart-activity-label{padding:0}.chart-activity-label-plate,.chart-activity-label-help{display:inline-block;vertical-align:top;background:#888;padding:0 4px}.chart-activity-label-help{padding:0 2px;margin-left:1px;color:rgba(255,255,255,.75)}.chart-activity-label-help:hover{color:#fff}.chart-activity-label-active .chart-activity-label-plate,.chart-activity-label-active .chart-activity-label-help{background:#008ccc}.chart-direction-label.direction-0{background:#E7C400;display:none}.chart-direction-label.direction-1{background:#60b789}.chart-direction-label.direction-2{background:#dc7d6e}.chart-title .chart-direction-label,.chart-title .chart-activity-label,.chart-title .icon-chart-recommended{vertical-align:middle}.chart-actions .button-set{font-size:0;white-space:nowrap}.chart-actions .button-set .tv-button{border-radius:0;margin-left:1px;border:none;background:#e2e8ef}.chart-actions .button-set .tv-button:hover:not(.disabled){background:lighten(#e2e8ef,1%)}.chart-actions .tv-button.active:not(.chart-active-button){color:#fff!important;box-shadow:none;background:#64c581;border:none}.chart-actions .tv-button.active:hover:not(.chart-active-button):not(.chart-closed-button){background:saturate(#64c581,5%)}.chart-agree-button.active{background:#7dbc52!important;border-color:#4e812d!important}.chart-agree-button.active+.chart-disagree-button{border-left-color:#4e812d!important}.chart-disagree-button.active{background:#c15135!important;border-color:#843825!important}.chart-actions .tv-button .tooltip{display:none}.chart-actions .tv-button.chart-active-button.active{position:relative;background:#d9e1e9!important;box-shadow:none}.chart-actions .tv-button.chart-closedbullseye-button.active{position:relative}.chart-actions .tv-button.chart-closed-button.active{position:relative;background:#c15135!important}.icon-chartstate-active{background-position:-80px -300px;width:18px;height:15px;margin:-7px 2px -7px 0;vertical-align:middle}.icon-chartstate-closed{background-position:-40px -300px;width:17px;height:17px;margin:-7px 2px -5px 0;vertical-align:middle}.tv-button.active .icon-chartstate-closed{background-position:-60px -300px}.icon-chartstate-closedbullseye{background-position:0 -300px;width:17px;height:17px;margin:-7px 2px -5px 0;vertical-align:middle}.tv-button.active .icon-chartstate-closedbullseye{background-position:-20px -300px}.share-button{position:relative}.share-button.active{background:#fb611a!important;border-color:#d55415!important}.share-button img.tab-arrow{position:absolute;left:23px;bottom:-7px;z-index:1;display:none}.share-button.active img.tab-arrow{display:block}#chart-favorites-button.active{background:#fc9c21!important;border-color:#c97c18!important}.chart-comment-form textarea:focus,.viewchart-column-main .chart-actions-agree-comment-block textarea:focus{background:#fff}.similar-charts .item{margin-bottom:28px}.modal-page-chart{background:#f2f5f8;.fancybox-skin{background:#f2f5f8}.tv-layout-width{width:auto!important;padding-left:28px!important;padding-right:28px!important}.chart-popup-iframe-wraper{margin:0 27px 0 28px;position:relative}.view-chart .view-chart-header{padding-top:28px}.chart-popup-iframe-wraper iframe{width:100%;height:475px;position:absolute;top:165px;z-index:1;margin:-1px 0 0 -1px}.chart-comments{padding-right:0}}.script-source-block{position:relative;margin:0 1px;.script-source{background:#fff;font-size:13px;margin:0;padding:0;font-family:Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;max-height:225px;overflow:auto}.script-actions{z-index:10;position:absolute;top:5px;right:5px}.pubscript-button{float:left}.script-unwrap{display:none;cursor:pointer;position:absolute;bottom:1px;right:20px;background:rgba(40,41,42,.05);width:59px;height:52px;&:hover{background:rgba(40,41,42,.1)}i{.sprite("roll-down.png");display:block;width:15px;height:11px;margin:21px auto 0}&.active i{.sprite("roll-up.png")}}}.script-updateinfo{margin-bottom:20px;font-style:italic}html,body{background:0 0;overflow:hidden;min-width:240px;height:100%}body{min-width:600px}#library-container{border:1px solid #d9dadb;background:#fff}#library-container #showExtendedHoursLink{display:none}#library-container .header-chart-panel{min-height:0;padding:0 0 0 5px}.insert-study-dialog.minimized{width:490px}.insert-study-dialog.minimized .insert-study-tabs{display:none}.insert-study-dialog.minimized .insert-study-page-content.page-padded{padding:10px 0 0 10px}.insert-study-dialog.scrollbar.minimized{width:498px}.minimized .insert-study-header .header-text{display:none}.minimized .insert-study-items li{height:13px;padding:8px 5px 8px 20px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.minimized .insert-study-items li:hover{overflow:visible;z-index:18;position:relative;width:auto;min-width:140px}.minimized .insert-study-items li .fav{display:none}.minimized .insert-study-main{width:490px}.minimized .insert-study-pages .search-header{padding-left:4px}.minimized .insert-study-items ul.column{width:150px}.minimized .search-header{display:none}.on-widget .getimage,.on-widget .open-popup{margin-left:4px;padding:7px;border-width:0!important}.on-widget .getimage:hover{background:#5ece93}.on-widget .open-popup{border:none;background:#6798bb}.on-widget .open-popup:hover{background:#69a3cc}.on-widget .open-popup:active{background:#71acd6}.on-widget .open-popup i{width:16px;height:14px;background-image:url(images/icons.png);background-position:-180px -400px}.on-widget .widgetbar-widget-hotlist .widgetbar-widgetheader .widgetbar-headerspace{display:none}.onchart-tv-logo,.onchart-cme-logo,.onchart-custom-logo{display:block;position:absolute;z-index:10}.onchart-cme-logo{left:10px;bottom:25px;width:135px}.onchart-tv-logo,.onchart-custom-logo{left:1px;bottom:22px;width:auto}.onchart-tv-logo.on-pane,.onchart-custom-logo.on-pane{bottom:1px}.onchart-custom-logo .inner{display:block;padding:2px 9px 2px 9px;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease;background-color:rgba(255,255,255,.8)}.onchart-custom-logo .wrapper{display:block;padding:3px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease;background-color:rgba(255,255,255,.4)}.onchart-custom-logo table.inner{border-collapse:collapse;border:0}.onchart-custom-logo table.inner tbody{opacity:.6}.onchart-custom-logo table.inner td{padding:0}.onchart-custom-logo table.inner td.custom-logo{line-height:0}.onchart-custom-logo table.inner td.tv-link{text-align:center;line-height:10px}.onchart-custom-logo .text{font-size:10px}.onchart-tv-logo .wrapper{display:block;padding:3px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease}.onchart-tv-logo.expanded .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.expanded.grey .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.expanded.blue .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo.black .wrapper{background-color:rgba(0,0,0,.3)}.onchart-tv-logo.expanded.black .wrapper{background-color:rgba(255,255,255,.3)}.onchart-tv-logo .inner{display:block;height:32px;line-height:31px;padding:0 9px;-webkit-transition:background .7s ease;-moz-transition:background .7s ease;-ms-transition:background .7s ease;-o-transition:background .7s ease;transition:background .7s ease}.onchart-tv-logo.expanded .inner{background-color:rgba(255,255,255,.8)}.onchart-tv-logo.expanded.grey .inner{background-color:rgba(224,222,222,.8)}.onchart-tv-logo.expanded.blue .inner{background-color:rgba(209,232,255,.8)}.onchart-tv-logo.expanded.black .inner{background-color:rgba(0,0,0,.8)}.onchart-tv-logo img{width:33px;height:23px;display:inline-block;vertical-align:middle;-webkit-transition:display .7s ease;-moz-transition:display .7s ease;-ms-transition:display .7s ease;-o-transition:display .7s ease;transition:display .7s ease}.onchart-tv-logo .text{display:inline-block;width:0;overflow:hidden;padding-left:36px;vertical-align:middle;-webkit-transition:width .7s ease;-moz-transition:width .7s ease;-ms-transition:width .7s ease;-o-transition:width .7s ease;transition:width .7s ease}.onchart-tv-logo.expanded .text{width:145px}.onchart-tv-logo img{display:block;position:absolute;top:8px;-webkit-transition:opacity .7s ease;-moz-transition:opacity .7s ease;-ms-transition:opacity .7s ease;-o-transition:opacity .7s ease;transition:opacity .7s ease}.onchart-tv-logo img.faded{opacity:1}.onchart-tv-logo.expanded img.faded{opacity:0}.text .logo-highlighted{font-weight:700;text-decoration:underline}.onchart-cme-logo img{width:inherit;opacity:.55}.onchart-cme-logo a.onchart-logo{width:inherit;white-space:nowrap;position:relative;top:-6px;left:0;color:#007fb9;opacity:.7;font-size:12px}.onchart-cme-logo a.onchart-logo .logo-fade{color:#231f20;opacity:.85}.on-cme-widget .symbol-search-dialog .filter,.on-cme-widget .symbol-edit-popup .filter,.on-cme-widget .compare-widget .predefine-section,.on-cme-widget .compare-widget .vspace{display:none}.on-cme-widget .symbol-search-dialog .results{height:450px}.tv-embed-buttons-contaner{float:right}.on-cme-widget .getimage:hover{background:#5ece93}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container{position:absolute;left:1px;bottom:1px;height:38px;width:50px;background:#fff}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container:before{content:'';display:block;width:100%;height:5px;position:absolute;top:-5px;left:0;background:-moz-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff', endColorstr='#ffffff', GradientType=0)}.on-cme-widget .tv-side-toolbar>.cme-saveimage-container .getimage{margin:6px 11px}.on-cme-widget #library-container>.cme-saveimage-container{position:absolute;left:8px;bottom:7px}.on-cme-widget #library-container>.cme-saveimage-container .getimage{margin:0;padding:3px 7px 2px 6px;border:none}.tv-side-toolbar .tv-close-panel{margin-left:1px}.onchart-tv-logo img.custom-image{position:relative;top:0;left:0;width:auto;height:auto}.save-load-buttons.in-header{margin-left:0}.header-chart-panel .button.iconed.screenshot.process{background:url(images/bar-loader.gif) 0 0 repeat!important}.header-chart-panel .button.iconed.screenshot{padding:6px 8px 8px;margin-left:3px}.header-chart-panel .button.iconed.screenshot i{background:url(images/icons.png) 0 0 no-repeat;background-position:-60px -240px;width:16px;height:13px}.header-chart-panel .left{margin:0}.header-chart-panel .group{margin:5px 0 0 0}.load-chart .chart-search,.load-chart .chart-search input{width:100%}.properties-tabs-label{margin-right:30px}</style></head><body class="chart-page on-widget"><svg style="display:none;"><defs><linearGradient id="google-chrome-logo-a" gradientUnits="userSpaceOnUse" x1="85.277" y1="54.545" x2="85.277" y2="116.947"><stop offset="0" stop-color="#81b4e0"/><stop offset="1" stop-color="#0c5a94"/></linearGradient><linearGradient id="google-chrome-logo-b" gradientUnits="userSpaceOnUse" x1="87.981" y1=".384" x2="87.981" y2="69.714"><stop offset="0" stop-color="#f06b59"/><stop offset="1" stop-color="#df2227"/></linearGradient><linearGradient id="google-chrome-logo-c" gradientUnits="userSpaceOnUse" x1="20.762" y1="146.366" x2="55.807" y2="88.465"><stop offset="0" stop-color="#388b41"/><stop offset="1" stop-color="#4cb749"/></linearGradient><linearGradient id="google-chrome-logo-d" gradientUnits="userSpaceOnUse" x1="138.163" y1="152.524" x2="100.832" y2="62.625"><stop offset="0" stop-color="#e4b022"/><stop offset=".3" stop-color="#fcd209"/></linearGradient><linearGradient id="google-chrome-logo-e" gradientUnits="userSpaceOnUse" x1="32.364" y1="94.856" x2="32.364" y2="33.908"><stop offset="0" stop-opacity=".149"/><stop offset=".3" stop-opacity=".059"/><stop offset="1" stop-opacity=".027"/></linearGradient><linearGradient id="google-chrome-logo-f" gradientUnits="userSpaceOnUse" x1="116.491" y1="114.538" x2="74.589" y2="157.201"><stop offset="0" stop-opacity=".149"/><stop offset=".3" stop-opacity=".059"/><stop offset="1" stop-opacity=".027"/></linearGradient><linearGradient id="google-chrome-logo-g" gradientUnits="userSpaceOnUse" x1="115.884" y1="126.812" x2="121.979" y2="66.628"><stop offset="0" stop-opacity=".149"/><stop offset=".3" stop-opacity=".059"/><stop offset="1" stop-opacity=".027"/></linearGradient></defs><symbol viewBox="0 0 17.5 16" id="svg-alarm-clock-plus"><title>alarm-clock-plus</title><path d="M2.766.016c-1.515 0-2.75 1.235-2.75 2.75 0 .518.155.992.406 1.406.981-1.569 2.539-2.737 4.375-3.219-.504-.564-1.218-.938-2.031-.938zm7.781 0c-.813 0-1.527.374-2.031.938 1.841.479 3.391 1.648 4.375 3.219.251-.415.406-.888.406-1.406 0-1.515-1.235-2.75-2.75-2.75zm-3.875 1.719c-3.489 0-6.313 2.854-6.313 6.344 0 1.363.423 2.625 1.156 3.656l-.906 1.156a.857.857 0 1 0 1.344 1.063l.75-.969c1.083.875 2.466 1.406 3.969 1.406.668 0 1.298-.123 1.906-.313v-1.719c-.581.26-1.226.406-1.906.406-2.596 0-4.688-2.092-4.688-4.688 0-2.596 2.092-4.719 4.688-4.719 2.261 0 4.147 1.619 4.594 3.75h1.625c-.463-3.036-3.057-5.375-6.219-5.375zm-.063 2.438a.65.65 0 0 0-.094.031.65.65 0 0 0-.5.656v2.938l-1.25 1.313a.652.652 0 1 0 .938.906l1.438-1.5.188-.188v-3.469a.65.65 0 0 0-.719-.688zm6.375 4.625v2.687h-2.719v1.813h2.719v2.688h1.781v-2.688h2.719v-1.813h-2.719v-2.687h-1.781z"/></symbol><symbol viewBox="0 0 13.3 14.4" id="svg-alarm-clock"><title>alarm-clock</title><path d="M2.759.013c-1.515 0-2.75 1.235-2.75 2.75 0 .518.155.992.406 1.406.981-1.569 2.539-2.737 4.375-3.219-.504-.564-1.218-.938-2.031-.938zm7.781 0c-.813 0-1.527.374-2.031.938 1.841.479 3.391 1.648 4.375 3.219.251-.415.406-.888.406-1.406 0-1.515-1.235-2.75-2.75-2.75zm-3.875 1.719c-3.489 0-6.313 2.854-6.313 6.344 0 1.363.423 2.625 1.156 3.656l-.906 1.156a.857.857 0 1 0 1.344 1.063l.75-.969c1.083.875 2.466 1.406 3.969 1.406 1.496 0 2.888-.507 3.969-1.375l.719.938a.857.857 0 1 0 1.344-1.063l-.875-1.125c.742-1.035 1.156-2.316 1.156-3.687 0-3.489-2.823-6.344-6.313-6.344zm0 1.625c2.596 0 4.688 2.123 4.688 4.719 0 1.234-.476 2.352-1.25 3.187a.85.85 0 0 0-.063.063c-.852.885-2.045 1.438-3.375 1.438-2.596 0-4.688-2.092-4.688-4.687 0-2.596 2.092-4.719 4.688-4.719zm-.063.813a.65.65 0 0 0-.094.031.65.65 0 0 0-.5.656v2.938l-1.25 1.313a.652.652 0 1 0 .938.906l1.438-1.5.188-.188v-3.469a.65.65 0 0 0-.719-.688z"/></symbol><symbol viewBox="2 6 27 22" id="svg-base"><title>base</title><path d="M12.1 24h-2v-1h.4c-.5-.3-.9-.7-1.4-1.2v.2H4v-1h4.3c-.3-.3-.5-.7-.7-1H4v-1h3c-.2-.3-.3-.7-.4-1H4v-1h2.3c-.2-.8-.3-1.6-.3-2.5 0-1.6.4-3.1 1-4.5H2v18h15v-3h-.5c-1.6 0-3.1-.4-4.4-1zM9 26H4v-1h5v1zm0-2H4v-1h5v1zm6 2h-5v-1h5v1zm8.5-6.6c1-1.4 1.5-3 1.5-4.9C25 9.8 21.2 6 16.5 6S8 9.8 8 14.5s3.8 8.5 8.5 8.5c1.8 0 3.5-.6 4.9-1.5l5.6 5.6 2.1-2.1-5.6-5.6zM22 18.1L20.1 20c-1 .7-2.3 1.1-3.6 1.1-3.6 0-6.5-2.9-6.5-6.5S12.9 8 16.5 8s6.5 2.9 6.5 6.5c0 1.3-.4 2.5-1 3.6z"/></symbol><symbol viewBox="0 0 13 11" id="svg-brackets"><title>brackets</title><g><g style="line-height:125%;-inkscape-font-specification:Open Sans" font-size="40" letter-spacing="0" word-spacing="0" font-family="Open Sans"><g style="line-height:125%;-inkscape-font-specification:Open Sans"><path d="M5 0c-.942 0-1.69.178-2.25.53-.56.354-.844.834-.844 1.47v1.906c0 .394-.137.686-.437.875-.3.19-.797.274-1.47.282v.875c.62 0 1.08.1 1.406.282.326.18.5.478.5.905V9c0 .632.274 1.12.813 1.47.537.348 1.297.522 2.28.53v-.875c-.585-.008-1.04-.092-1.344-.28-.303-.19-.437-.49-.437-.908V7.095c0-.883-.597-1.403-1.75-1.563v-.06c1.153-.16 1.75-.68 1.75-1.564V2.094C3.22 1.3 3.81.868 5 .844V0zm3 0v.844c1.19.024 1.78.457 1.78 1.25v1.812c0 .883.597 1.403 1.75 1.563v.06c-1.153.16-1.75.68-1.75 1.564v1.843c0 .42-.133.718-.436.907-.303.19-.76.273-1.344.28V11c.983-.008 1.743-.182 2.28-.53.54-.35.814-.838.814-1.47V7.125c0-.427.174-.724.5-.906.326-.184.785-.282 1.406-.282v-.875c-.673-.01-1.17-.093-1.47-.282-.3-.188-.436-.48-.436-.874V2c0-.636-.285-1.116-.844-1.47C9.69.18 8.942 0 8 0z"/></g></g></g></symbol><symbol viewBox="0 0 16 18" id="svg-bug-report"><title>bug-report</title><path d="M16 5h-2.8c-.5-.8-1.1-1.5-1.8-2L13 1.4 11.6 0 9.4 2.2C9 2.1 8.5 2 8 2c-.5 0-1 .1-1.4.2L4.4 0 3 1.4 4.6 3c-.7.5-1.3 1.2-1.8 2H0v2h2.1c-.1.3-.1.7-.1 1v1H0v2h2v1c0 .3 0 .7.1 1H0v2h2.8c1 1.8 3 3 5.2 3s4.2-1.2 5.2-3H16v-2h-2.1c.1-.3.1-.7.1-1v-1h2V9h-2V8c0-.3 0-.7-.1-1H16V5zm-6 8H6v-2h4v2zm0-4H6V7h4v2z"/></symbol><symbol viewBox="4 4 21 23" id="svg-calendar"><title>calendar</title><path d="M23 9v15H7V9H5v17h20V9h-2zm-4-3h-2v4h2V6zm-6 0h-2v4h2V6zm-2 8H9v2h2v-2zm5 0h-2v2h2v-2zm5 0h-2v2h2v-2zm-2 7h2v-2h-2v2zm-3-2h-2v2h2v-2zm-5 0H9v2h2v-2z"/></symbol><symbol viewBox="0 0 32 24" id="svg-chat-quote"><title>chat-quote</title><path d="M32 24V0L20 12v12zm-20 0V0L0 12v12z"/></symbol><symbol viewBox="0 0 1024 973.125" id="svg-chat-search"><title>chat-search</title><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></symbol><symbol viewBox="4 6 23 21" id="svg-chat"><title>chat</title><path d="M22 6H5v12h1v4l4-4h3v-6h9V6zm-8 7v10h8l4 3v-3h1V13H14z"/></symbol><symbol viewBox="-2.4 120.9 600 600" id="svg-config"><title>config</title><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></symbol><symbol viewBox="5 7 23 21" id="svg-datawindow"><title>datawindow</title><path d="M6 7v18h20V7H6zm18 16H8V9h16v14zm-2-8H10v2h12v-2zm0-4H10v2h12v-2zm0 8H10v2h12v-2z"/></symbol><symbol viewBox="0 0 26 18" id="svg-download"><title>download</title><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16h4.9l-1-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5h-5l-1 1h5.9c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm-2 7v5H7l6 6 6-6h-3V7h-6zm1 1h4v5h1.6L13 16.6 9.4 13H11V8z"/></symbol><symbol viewBox="0 0 60 60" id="svg-edit"><title>edit</title><path d="m0 46l35-35 14 14-35 35h-14zm39-39l6-6c5-5 19 9 14 14l-6 6z"/></symbol><symbol viewBox="0 0 7 12" id="svg-facebook"><title>facebook</title><path d="M4.09 12V6.526h1.857l.278-2.133H4.09V3.03c0-.617.173-1.037 1.068-1.037H6.3V.082C6.102.06 5.425 0 4.636 0 2.99 0 1.862.994 1.862 2.82v1.573H0v2.133h1.862V12H4.09z"/></symbol><symbol viewBox="0 0 14.5 13.8" id="svg-favorite"><title>favorite</title><path d="M7.3 0l2.2 4.5 5 .7-3.6 3.6.8 5-4.4-2.4-4.5 2.4.8-5-3.6-3.6 5-.7z"/></symbol><symbol viewBox="0 0 13 13" id="svg-gear"><title>gear</title><g><path d="M12.888 5.894s-.236-.088-.92-.152c-.834-.077-1.086-.39-1.363-.778H10.6c-.035-.093-.072-.184-.113-.274h.003c-.08-.47-.122-.87.414-1.515.438-.527.542-.756.542-.756-.103-.262-.35-.51-.35-.51s-.247-.245-.508-.348c0 0-.23.104-.757.542-.644.535-1.043.492-1.515.413h-.003c-.09-.04-.18-.077-.274-.112v-.012c-.39-.278-.703-.53-.78-1.364-.063-.683-.152-.92-.152-.92C6.85 0 6.5 0 6.5 0s-.35 0-.607.11c0 0-.088.238-.15.92-.08.834-.392 1.085-.78 1.363v.012c-.094.035-.185.07-.275.112h-.003c-.472.08-.87.122-1.516-.413-.528-.438-.76-.542-.76-.542-.26.103-.506.35-.506.35s-.247.247-.35.507c0 0 .104.23.542.755.536.645.493 1.044.414 1.515h.003c-.04.09-.077.18-.112.273h-.005c-.277.39-.53.702-1.364.78-.682.062-.918.15-.918.15C0 6.152 0 6.5 0 6.5s0 .35.112.606c0 0 .236.09.92.15.834.078 1.085.392 1.363.78H2.4c.036.093.072.184.113.274H2.51c.08.47.122.87-.414 1.515-.438.526-.542.756-.542.756.103.262.35.508.35.508s.247.247.508.35c0 0 .23-.104.757-.542.644-.535 1.043-.492 1.515-.413h.003c.09.04.18.077.274.112v.012c.39.277.702.53.78 1.363.063.682.152.92.152.92.257.11.606.11.606.11s.35 0 .606-.11c0 0 .09-.237.152-.92.077-.833.39-1.085.78-1.363v-.012c.093-.035.184-.072.274-.112h.003c.472-.08.87-.122 1.516.413.528.438.76.542.76.542.26-.102.506-.35.506-.35s.247-.246.35-.507c0 0-.104-.228-.542-.755-.536-.644-.493-1.044-.414-1.515h-.003c.04-.09.078-.18.112-.273h.005c.277-.39.53-.702 1.364-.78.682-.062.918-.15.918-.15C13 6.848 13 6.5 13 6.5s0-.35-.112-.606zM6.5 9.537c-1.68 0-3.04-1.36-3.04-3.037 0-1.677 1.36-3.037 3.04-3.037S9.54 4.823 9.54 6.5c0 1.677-1.36 3.037-3.04 3.037z"/></g></symbol><symbol id="svg-google-chrome-logo"><title>google-chrome-logo</title><g><g><path d="M169.12 85.713c0 46.284-37.522 83.805-83.806 83.805S1.51 131.998 1.51 85.713c0-46.284 37.52-83.805 83.804-83.805s83.805 37.52 83.805 83.805z" fill-rule="evenodd" fill="#fff"/></g><g><path d="M138.644 100.95c0-29.454-23.877-53.33-53.33-53.33-29.454 0-53.33 23.876-53.33 53.33H47.22c0-21.04 17.055-38.094 38.093-38.094 21.038 0 38.093 17.055 38.093 38.094" fill-opacity=".098"/></g><g><path d="M118.074 96.38c0 15.988-12.962 28.95-28.95 28.95-15.99 0-28.952-12.962-28.952-28.95 0-15.99 12.962-28.952 28.95-28.952 15.99 0 28.952 12.962 28.952 28.95z" fill-rule="evenodd" fill-opacity=".098"/></g><g><path d="M116.55 85.712c0 17.25-13.985 31.236-31.236 31.236-17.25 0-31.236-13.985-31.236-31.236 0-17.25 13.985-31.236 31.236-31.236 17.25 0 31.236 13.985 31.236 31.236z" fill-rule="evenodd" fill="url(#google-chrome-logo-a)"/></g><g><path d="M161.5 47.62C140.525 5.42 89.312-11.79 47.11 9.185c-13.158 6.54-24.404 16.367-32.65 28.53L48.746 97.14C42.43 77.074 53.582 55.686 73.65 49.373c3.53-1.11 7.203-1.7 10.902-1.752" fill="url(#google-chrome-logo-b)"/><defs/></g><g><path d="M14.46 37.716c-26.24 39.144-15.78 92.148 23.364 118.39 12.11 8.118 26.1 12.998 40.633 14.174l35.808-60.948c-13.39 16.228-37.397 18.53-53.625 5.14-5.512-4.547-9.634-10.552-11.895-17.33" fill="url(#google-chrome-logo-c)"/><defs/></g><g><path d="M78.457 170.28c46.99 3.552 87.965-31.662 91.518-78.653 1.146-15.162-1.78-30.354-8.476-44.007H84.55c21.037.097 38.014 17.23 37.917 38.268-.04 8.51-2.93 16.766-8.206 23.444" fill="url(#google-chrome-logo-d)"/><defs/></g><g><path d="M14.46 37.716L48.746 97.14c-2.54-8.546-2-17.713 1.523-25.903L15.983 35.43" fill="url(#google-chrome-logo-e)"/><defs/></g><g><path d="M78.457 170.28l35.808-60.948c-5.65 6.737-13.456 11.312-22.094 12.95L76.935 170.28" fill="url(#google-chrome-logo-f)"/><defs/></g><g><path d="M161.5 47.62H84.552c11.59.053 22.526 5.38 29.712 14.475l48.76-12.19" fill="url(#google-chrome-logo-g)"/><defs/></g></g></symbol><symbol viewBox="0 0 22 22" id="svg-googleplus"><title>googleplus</title><path d="M11.358 12.558l-1.04-.8c-.315-.26-.747-.606-.747-1.234 0-.632.433-1.034.81-1.405 1.212-.947 2.418-1.954 2.418-4.076 0-2.182-1.383-3.33-2.044-3.876h1.785L14.412 0H8.735c-1.558 0-3.803.367-5.45 1.714C2.046 2.776 1.443 4.24 1.443 5.56c0 2.236 1.727 4.505 4.785 4.505.287 0 .603-.03.92-.06-.142.35-.288.635-.288 1.122 0 .89.46 1.433.863 1.95-1.295.09-3.72.232-5.506 1.323C.514 15.4 0 16.866 0 17.896 0 20.022 2.013 22 6.196 22c4.96 0 7.583-2.724 7.583-5.42 0-1.983-1.15-2.957-2.42-4.022zM7.58 9.262c-2.48 0-3.603-3.183-3.603-5.107 0-.747.143-1.52.634-2.12.46-.576 1.268-.95 2.022-.95 2.388 0 3.63 3.215 3.63 5.28 0 .515-.056 1.433-.72 2.094-.464.46-1.24.802-1.96.802zM7.61 20.8c-3.087 0-5.075-1.465-5.075-3.503 0-2.04 1.844-2.728 2.48-2.957 1.212-.404 2.768-.46 3.027-.46.29 0 .432 0 .662.03 2.193 1.55 3.145 2.322 3.145 3.788 0 1.776-1.47 3.1-4.24 3.1z"/><path d="M17 7v3h-3v1h3v3h1v-3h3v-1h-3V7h-1z"/></symbol><symbol viewBox="0 0 595.3 841.9" id="svg-help"><title>help</title><path d="M297 127.5c-161.8 0-293 131.2-293 293s131.2 293 293 293 293-131.2 293-293-131.2-293-293-293zm0 537.2c-134.8 0-244.2-109.3-244.2-244.2S162.2 176.3 297 176.3s244.2 109.3 244.2 244.2S431.8 664.7 297 664.7zm-24.4-122.1h48.8v-48.8h-48.8v48.8zM368 319c-17.7-13.9-41.6-20.9-71.5-20.9-28.5 0-51.5 6.9-69 20.6-17.5 13.7-26.8 33.2-28.2 52.9h48.8c3.3-13.7 8.4-21.5 17.3-28.2 8.9-6.7 20-10.1 33.3-10.1 13.7 0 24.7 3.2 32.8 9.6 8.1 6.4 12.2 14.2 12.2 23.2 0 6.5-2.3 12.4-6.9 17.8-3 3.4-12.1 10.6-27.3 21.6-15.2 11-25.4 20.9-30.5 29.7-5.1 8.8-7.6 20-7.6 33.6 0 1.3 1-5.7 1.2.4h48.8c-.2-12.7-1.5-10.9 1.2-15.9 2.7-4.9 9.5-11.5 20.5-19.6 21.3-15.7 35.2-28.1 41.7-37.3 6.5-9.1 9.8-18.8 9.8-29 0-18.3-8.9-34.5-26.6-48.4z"/></symbol><symbol viewBox="6 6 21 23" id="svg-hotlists"><title>hotlists</title><path d="M22 14s-.8 1.8-1 4c0 0-1.6-8.8-8.3-13 0 0 2.8 4.5.9 6.5 0 0-1.2 1.4-1.6 3.5 0 0-.4 1.5 0 3 .3 1-2-.6-2-3 0 0-1.4 1.7 1 6 0 0 1.3 1.7 1 3 0 0-2.7-.6-4-4 0 0 .1 4.2 2 6 2 1.8 4.5 2 6 2 0 0 6.6 0 7-5 .5-5.2-1.6-6.5-1-9z"/></symbol><symbol viewBox="-80 -25 140 140" id="svg-left"><title>left</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M10 12l-10.7-11.3-40.3 42.5.1.1-.1.1 40.3 42.5 10-10.6-29.7-31.2z"/></symbol><symbol viewBox="0 0 80 80" id="svg-link"><title>link</title><path d="M29.298 63.47l-4.048 4.02c-3.51 3.48-9.216 3.482-12.723 0-1.686-1.672-2.612-3.894-2.612-6.256s.927-4.585 2.61-6.258l14.9-14.783c3.09-3.062 8.898-7.57 13.132-3.372 1.943 1.93 5.08 1.918 7.01-.024 1.93-1.942 1.918-5.08-.025-7.01-7.197-7.14-17.834-5.82-27.098 3.37l-14.9 14.785C1.967 51.49 0 56.21 0 61.235s1.968 9.743 5.544 13.292C9.224 78.176 14.054 80 18.887 80c4.834 0 9.667-1.824 13.348-5.476l4.05-4.02c1.943-1.93 1.954-5.067.024-7.01-1.928-1.94-5.07-1.952-7.012-.023zM74.454 6.045c-7.73-7.67-18.538-8.086-25.694-.986l-5.046 5.01c-1.943 1.928-1.955 5.065-.025 7.008 1.93 1.943 5.067 1.954 7.01.025l5.044-5.005c3.707-3.68 8.56-2.155 11.727.986 1.69 1.674 2.616 3.897 2.616 6.26 0 2.362-.928 4.585-2.613 6.258l-15.897 15.77c-7.27 7.212-10.68 3.827-12.134 2.383-1.943-1.928-5.08-1.916-7.01.026-1.93 1.942-1.918 5.08.025 7.01 3.337 3.31 7.146 4.953 11.14 4.953 4.888 0 10.052-2.463 14.962-7.338l15.896-15.77C78.03 29.082 80 24.362 80 19.338c0-5.022-1.97-9.743-5.546-13.294z"/></symbol><symbol viewBox="0 0 13 12" id="svg-linkedin"><title>linkedin</title><path d="M3.344 11.996V3.898H.664v8.098h2.68zm-1.34-9.204c.935 0 1.516-.62 1.516-1.4C3.503.6 2.94-.005 2.022-.005 1.105-.006.506.6.506 1.394c0 .777.58 1.398 1.48 1.398h.018z"/><path d="M4.827 11.996h2.68V7.474c0-.242.017-.484.088-.657.194-.484.635-.984 1.375-.984.97 0 1.358.742 1.358 1.83v4.333h2.68V7.353c0-2.488-1.323-3.645-3.086-3.645-1.446 0-2.08.812-2.433 1.364h.017V3.898h-2.68c.035.76 0 8.098 0 8.098z"/></symbol><symbol viewBox="0 0 9 12" id="svg-lock"><title>lock</title><path d="M4 0c-1.653 0-3 1.347-3 3v2h-.699c-.166 0-.301.135-.301.301v6.398c0 .166.135.301.301.301h8.398c.166 0 .301-.135.301-.301v-6.398c0-.166-.135-.301-.301-.301h-.699v-2c0-1.653-1.347-3-3-3h-1zm0 1h1c1.117 0 2 .883 2 2v2h-5v-2c0-1.117.883-2 2-2z"/></symbol><symbol viewBox="4 6 23 21" id="svg-messages"><title>messages</title><path d="M16 18h3v-3h-3v3zm-2-5v10h9l3 3v-3h1V13H14zm6 2v4h-4v3h-1v-8h5v1zm6 0v7h-1v-6h-1v1h-1v-1h-1v6h-1v-8h1v1h1v1h1v-1h1v-1h1v1zm-4-9H5v12h1v4l4-4h3v-6h9V6z"/></symbol><symbol viewBox="0 0 120 120" id="svg-minus"><title>minus</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M28 50h65v17h-65z"/></symbol><symbol viewBox="300 310 0.3 216.9" id="svg-notes"><title>notes</title><path d="M363.5 411.5v17H406v-17h-42.5zm-59.5-102h-17V352h17v-42.5zm76.3 42l-12-12-30.1 30.1 12 12 30.1-30.1zm-169.6 137l12 12 30.1-30.1-12-12-30.1 30.1zm42.4-123.1L222.6 335l-12.2 12.2 30.4 30.4 12.3-12.2zm84.8 109.2l30.4 30.4 12.2-12.2-30.4-30.4-12.2 12.2zM277.5 497h-.2v23.9l5.9 3.8 5.6 5.9h13.7l5.3-5.9 6.1-3.8V497h-36.4zm68.6-74.5c.8-6.6.3-11.3.3-11.3-2.8-19.3-13.3-29.7-23.5-35.4-7.4-4.2-16.2-6.7-24.9-6.8h-2.5c-15.8.5-27 7-33.8 12.5-5.1 4.1-7.7 7.7-7.7 7.7-6.9 8.7-9.4 17.7-9.5 25.9-.1 10.7 3.7 20.2 7.1 26.5 2.6 4.9 5 7.8 5 7.8 3.6 4.6 5.8 10.1 7 15.1 1.8 7.4 1.7 10.2 1.7 10.2.3 6.5 2.5 10.1 4.1 11 .5.3 1.3.7 2.3.7l4.2 3.9h39.7l3.9-3.9h.7c3.6-.5 5.6-6.6 6-10.5.4-4 .5-6 .5-6 0-.4.1-.9.1-1.5.9-9.4 9.9-23.1 9.9-23.1.5-.6.9-1.1 1.3-1.7 5.2-6.9 7.3-14.8 8.1-21.1zm-118.6-11H185v17h42.5v-17z"/></symbol><symbol viewBox="5 6 21 21" id="svg-notifications"><title>notifications</title><path d="M15.5 27c1.2 0 2.2-.9 2.4-2H13c.3 1.1 1.3 2 2.5 2zm6.5-7v-6c-.2-2.9-2.3-5.3-5.1-5.9 0-.2.1-.4.1-.6 0-.8-.7-1.5-1.5-1.5S14 6.7 14 7.5c0 .2.1.4.2.6-2.8.6-4.9 3-5.1 5.9v5.9C9 22.7 7 23 7 23v1h17v-1s-2-.3-2-3z"/></symbol><symbol viewBox="0 0 17 17" id="svg-plus-bolder"><title>plus-bolder</title><path d="M7 2h3v13H7M2 7h13v3H2z"/></symbol><symbol viewBox="0 0 140 140" id="svg-plus"><title>plus</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M112 60h-34v-34h-17v34h-34v17h34v34h17v-34h34z"/></symbol><symbol viewBox="0 0 15 15" id="svg-redo"><title>redo</title><path d="M7.5 8.2v3.2l7.5-4.9-7.5-4.8v3.3s-7.5-.9-7.5 8.4c0-.1 1.7-5.2 7.5-5.2z"/></symbol><symbol viewBox="-58 -18 120 120" id="svg-restore"><title>restore</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M31 13c-7.6-7.7-18.2-12.5-29.9-12.5-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8c-4.8 3.6-10.8 5.7-17.3 5.7-16.2 0-29.3-13.2-29.3-29.4s13.1-29.4 29.3-29.4c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5v-32.8l-12.3 12.5z"/></symbol><symbol viewBox="0 0 14.8 13.4" id="svg-right-stop"><title>right-stop</title><path fill="#8A8B8D" d="M8 6.7l-6.3-6.7-1.6 1.7 4.7 4.9-4.8 5 1.7 1.8 6.3-6.7zm6.8 0l-6.4-6.7-1.6 1.7 4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></symbol><symbol viewBox="-90 -55 140 140" id="svg-right"><title>right</title><path fill-rule="evenodd" clip-rule="evenodd" fill="#8A8B8D" d="M10 12l-40.3-42.5-10 10.6 29.7 31.2-30.4 32.1 10.7 11.3 40.3-42.5-.1-.1z"/></symbol><symbol viewBox="0 0 42 42" id="svg-settings-gear"><title>settings-gear</title><path d="M38.626 17.554h-2.81c-.354-1.755-1.055-3.157-1.756-4.566l1.756-1.755c1.4-1.4 1.4-3.51 0-4.912s-3.51-1.4-4.912 0l-1.756 1.757c-1.4-.7-2.81-1.4-4.565-1.755V3.51c0-2.11-1.402-3.51-3.51-3.51s-3.52 1.41-3.52 3.51v2.81c-1.754.355-3.156 1.056-4.565 1.756L11.233 6.32c-1.4-1.4-3.51-1.4-4.912 0s-1.4 3.512 0 4.913l1.757 1.755c-.7 1.402-1.4 2.81-1.755 4.566H3.51c-2.1 0-3.51 1.41-3.51 3.51s1.4 3.512 3.51 3.512h2.81c.355 1.755 1.056 3.156 1.756 4.565L6.32 30.898c-1.4 1.402-1.4 3.51 0 4.913s3.512 1.4 4.913 0l1.755-1.757c1.402.7 2.81 1.402 4.566 1.756v2.815c0 2.11 1.4 3.51 3.51 3.51s3.51-1.4 3.51-3.51v-2.81c1.757-.354 3.158-1.055 4.567-1.756l1.757 1.755c1.402 1.4 3.51 1.4 4.913 0s1.4-3.51 0-4.912l-1.757-1.756c.7-1.4 1.402-2.81 1.756-4.565h2.81c2.107 0 3.51-1.402 3.51-3.51.006-2.11-1.403-3.52-3.505-3.52zm-17.56 14.05c-5.968 0-10.534-4.565-10.534-10.532s4.566-10.54 10.533-10.54 10.532 4.566 10.532 10.533-4.558 10.54-10.532 10.54zm0-14.05c-2.11 0-3.512 1.4-3.512 3.51s1.4 3.512 3.51 3.512 3.51-1.402 3.51-3.51-1.4-3.512-3.51-3.512z"/></symbol><symbol viewBox="0 0 15 11.5" id="svg-snapshot"><title>snapshot</title><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zm5.5-2.9h-2.2c0-1-.9-1.9-2-1.9h-2.7c-1.1 0-1.9.9-1.9 1.9h-2.3c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9h11.1c1.1 0 1.9-.9 1.9-1.9v-5.7c.1-1.1-.8-2-1.9-2zm-5.5 8.3c-1.9 0-3.5-1.6-3.5-3.5s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></symbol><symbol viewBox="0 0 14.8 9.4" id="svg-stocktwits"><title>stocktwits</title><path d="M3.9 4c-.7-.3-1.1-.5-1.3-.6l-.4-.4c-.1-.1-.1-.3-.1-.5 0-.3.1-.5.3-.7.2-.2.5-.3.9-.3.3 0 .7 0 1 .1.3.2.7.4 1.2.5l.7-1.5c-.5-.2-1-.4-1.4-.5l-1.4-.1c-1.1 0-1.9.2-2.4.7s-.9 1.1-.9 1.9c0 .4.1.8.3 1.1s.4.6.7.8c.3.2.7.5 1.3.8l1.2.6c.2.2.4.3.5.4.1.1.2.3.2.5 0 .3-.1.6-.4.7-.2.2-.6.2-1 .2s-.8-.1-1.2-.2c-.5 0-1.1-.2-1.7-.5v1.8c.8.4 1.7.6 2.7.6 1.1 0 2-.2 2.6-.7.7-.5 1-1.2 1-2 0-.6-.2-1.1-.5-1.5-.4-.4-1-.8-1.9-1.2zm3.1-4v1.6h3.1v7.8h1.6v-7.8h3.1v-1.6h-7.8z"/></symbol><symbol viewBox="0 0 10 8" id="svg-strategy"><title>strategy</title><g fill="#595959" fill-rule="evenodd"><path d="M2.5 2L0 5h2v3h1V5h2z"/><path d="M7.5 6L5 3h2V0h1v3h2z"/></g></symbol><symbol viewBox="0 0 10 14" id="svg-trading-connect"><title>trading-connect</title><circle cx="5" cy="7" r="3"/></symbol><symbol viewBox="0 0 15 11.6" id="svg-twitter"><title>twitter</title><path d="M15 1.4c-.3.1-1 .4-1.7.5.4-.2 1.1-1 1.3-1.6-.4.3-1.4.7-1.9.7-.6-.7-1.4-1-2.3-1-1.7 0-3.1 1.3-3.1 3 0 .2 0 .4.1.7-2.3-.1-5-1.2-6.5-3.1-.9 1.5-.1 3.3.9 3.9-.4 0-1 0-1.3-.3 0 1 .5 2.4 2.4 2.9-.4.2-1 .1-1.3.1.1.9 1.4 2 2.8 2-.6.5-2.3 1.4-4.4 1.1 1.4.8 3.1 1.3 4.8 1.3 5 0 8.8-3.9 8.6-8.6.5-.4 1.1-.9 1.6-1.6z"/></symbol><symbol viewBox="0 0 15 15" id="svg-undo"><title>undo</title><path d="M15 13.4c0-9.3-7.5-8.4-7.5-8.4v-3.3l-7.5 4.8 7.5 4.9v-3.2c5.8 0 7.5 5.1 7.5 5.2z"/></symbol><symbol viewBox="0 0 26 18" id="svg-upload"><title>upload</title><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16H9v-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5H17v1h5.3c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm1 6l-6 6h3v5h6v-5h3l-6-6z"/></symbol><symbol viewBox="0 0 21 13" id="svg-yahoo"><title>yahoo</title><path d="M19.502 12.2l-1.5-.184.16-1.33 1.503.183-.163 1.33z"/><path d="M18.44 3.9l.01 5.95 1.102.136 1.445-5.763L18.44 3.9z"/><path d="M19.437 2.51c-.33.035-1.707.34-2.168.438-.498.132-5.022 3.61-5.32 4.465-.067.297-.1.75-.1 1.177l-.03.69c0 .493.135 1.286.202 1.716.296.064 2.448.007 2.845.073l-.048.88c-.388-.026-3.122-.018-4.682-.018-.795 0-3.342.085-4.125.06l.148-.838c.43-.034 2.207.076 2.598-.334.194-.205.133-.422.133-1.605v-.56c0-.264 0-.755-.065-1.214-.166-.492-4.15-5.444-5.175-6.233-.295-.1-2.16-.284-2.62-.383L1.005.067c.23-.116 2.3.028 4.31-.046 1.323-.048 4.336 0 4.708.044L9.93.732c-.4.1-2.305.135-2.802.267 1.288 1.904 3.327 4.358 3.985 5.31.363-.524 3.557-2.71 3.657-3.464-.497-.1-2.138-.336-2.4-.336l-.158-.86c.45-.07 2.815 0 3.99 0 1.014 0 3.182 0 3.797.05l-.563.81z"/></symbol></svg><div class="loading-indicator" id="loading-indicator"></div><script src="//fgnass.github.io/spin.js/spin.min.js"></script><script>var loadingSpinner=new Spinner({lines:15,length:0,width:9,radius:30,corners:1,rotate:0,direction:1,color:"#000",speed:0.75,trail:74,shadow:false,hwaccel:false,className:"spinner",zIndex:2000000000,top:"50%",left:"50%"}).spin(document.getElementById("loading-indicator"));</script><div id="library-container" class="chart-page"><div class="tv-side-toolbar"></div><div class="tv-side-panel"></div><div class="tv-main-panel"><div class="header-chart-panel"><div class="right"></div><div class="left"></div></div><div id="chart-area"></div></div></div><script>var A82={};var __initialEnabledFeaturesets=["charting_library"];</script><script>urlParams=(function(){var b,e=/\+/g,d=/([^&=]+)=?([^&]*)/g,h=function(i){return decodeURIComponent(i.replace(e," "))},f=function(){var j=location.href;var i=j.indexOf("#");if(i>=0){return j.substring(i+1)}else{throw"Unexpected use of this page"}}(),a={};while(b=d.exec(f)){a[h(b[1])]=h(b[2])}var c=window.parent[a.uid];for(var g in c){if(g!="datafeed"){a[g]=JSON.stringify(c[g])}}return a})();</script><script>(function(){var a=function(){};"undefined"===typeof window.console&&(window.console={});for(var b=window.console,c="dir log time info warn count clear debug error group trace assert dirxml profile timeEnd groupEnd profileEnd timeStamp exception table notifyFirebug groupCollapsed getFirebugElement firebug userObjects".split(" "),d=0,e=c.length;d<e;d++){var f=c[d];if("undefined"===typeof b[f])try{b[f]=a}catch(g){}}var h=window.onerror;window.__tv_js_errors=[];window.onerror=function(a,b,c){window.__tv_js_errors.push(a+
|
|
" (found at "+b+", line "+c+")");if(h)try{h.apply(window,arguments)}catch(d){}}})();(function(a,b){function c(a){var b=T[a]={},c,d;a=a.split(/\s+/);c=0;for(d=a.length;c<d;c++)b[a[c]]=!0;return b}function d(a,c,d){if(d===b&&1===a.nodeType)if(d="data-"+c.replace(S,"-$1").toLowerCase(),d=a.getAttribute(d),"string"===typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:q.isNumeric(d)?+d:M.test(d)?q.parseJSON(d):d}catch(e){}q.data(a,c,d)}else d=b;return d}function e(a){for(var b in a)if(("data"!==b||!q.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function f(a,b,c){var d=
|
|
b+"defer",e=b+"queue",f=b+"mark",g=q._data(a,d);!g||"queue"!==c&&q._data(a,e)||"mark"!==c&&q._data(a,f)||setTimeout(function(){q._data(a,e)||q._data(a,f)||(q.removeData(a,d,!0),g.fire())},0)}function g(){return!1}function h(){return!0}function k(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function l(a,b,c){b=b||0;if(q.isFunction(b))return q.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return q.grep(a,function(a,d){return a===b===c});if("string"===typeof b){var d=q.grep(a,
|
|
function(a){return 1===a.nodeType});if(Ua.test(b))return q.filter(b,d,!c);b=q.filter(b,d)}return q.grep(a,function(a,d){return 0<=q.inArray(a,b)===c})}function m(a){var b=Pa.split("|");a=a.createDocumentFragment();if(a.createElement)for(;b.length;)a.createElement(b.pop());return a}function n(a,b){return q.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function p(a,b){if(1===b.nodeType&&q.hasData(a)){var c,d,e;d=q._data(a);var f=q._data(b,
|
|
d),g=d.events;if(g)for(c in delete f.handle,f.events={},g)for(d=0,e=g[c].length;d<e;d++)q.event.add(b,c,g[c][d]);f.data&&(f.data=q.extend({},f.data))}}function r(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==
|
|
a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(q.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function t(a){return"undefined"!==typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!==typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function v(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function w(a){var b=(a.nodeName||"").toLowerCase();
|
|
"input"===b?v(a):"script"!==b&&"undefined"!==typeof a.getElementsByTagName&&q.grep(a.getElementsByTagName("input"),v)}function u(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?1:0;if(0<d){if("border"!==c)for(;4>e;e+=2)c||(d-=parseFloat(q.css(a,"padding"+ha[e]))||0),d="margin"===c?d+(parseFloat(q.css(a,c+ha[e]))||0):d-(parseFloat(q.css(a,"border"+ha[e]+"Width"))||0);return d+"px"}d=pa(a,b);if(0>d||null==d)d=a.style[b];if(ma.test(d))return d;d=parseFloat(d)||0;if(c)for(;4>e;e+=
|
|
2)d+=parseFloat(q.css(a,"padding"+ha[e]))||0,"padding"!==c&&(d+=parseFloat(q.css(a,"border"+ha[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(q.css(a,c+ha[e]))||0);return d+"px"}function x(a){return function(b,c){"string"!==typeof b&&(c=b,b="*");if(q.isFunction(c))for(var d=b.toLowerCase().split(fb),e=0,f=d.length,g,h;e<f;e++)g=d[e],(h=/^\+/.test(g))&&(g=g.substr(1)||"*"),g=a[g]=a[g]||[],g[h?"unshift":"push"](c)}}function C(a,c,d,e,f,g){f=f||c.dataTypes[0];g=g||{};g[f]=!0;f=a[f];for(var h=0,k=f?f.length:
|
|
0,l=a===bb,m;h<k&&(l||!m);h++)m=f[h](c,d,e),"string"===typeof m&&(!l||g[m]?m=b:(c.dataTypes.unshift(m),m=C(a,c,d,e,m,g)));!l&&m||g["*"]||(m=C(a,c,d,e,"*",g));return m}function A(a,c){var d,e,f=q.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&q.extend(!0,a,e)}function y(a,b,c,d){if(q.isArray(b))q.each(b,function(b,e){c||ia.test(a)?d(a,e):y(a+"["+("object"===typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==q.type(b))d(a,b);else for(var e in b)y(a+"["+e+"]",b[e],c,
|
|
d)}function D(){try{return new a.XMLHttpRequest}catch(b){}}function E(){setTimeout(z,0);return jb=q.now()}function z(){jb=b}function F(a,b){var c={};q.each(kb.concat.apply([],kb.slice(0,b)),function(){c[this]=a});return c}function K(a){if(!qb[a]){var b=B.body,c=q("<"+a+">").appendTo(b),d=c.css("display");c.remove();if("none"===d||""===d)Ha||(Ha=B.createElement("iframe"),Ha.frameBorder=Ha.width=Ha.height=0),b.appendChild(Ha),cb&&Ha.createElement||(cb=(Ha.contentWindow||Ha.contentDocument).document,
|
|
cb.write((q.support.boxModel?"<!doctype html>":"")+"<html><body>"),cb.close()),c=cb.createElement(a),cb.body.appendChild(c),d=q.css(c,"display"),b.removeChild(Ha);qb[a]=d}return qb[a]}function Q(a){return q.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var B=a.document,J=a.navigator,O=a.location,q=function(){function c(){if(!d.isReady){try{B.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,
|
|
g,h=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,k=/\S/,l=/^\s+/,m=/\s+$/,p=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,x=/(?:^|:|,)(?:\s*\[)+/g,t=/(webkit)[ \/]([\w.]+)/,u=/(opera)(?:.*version)?[ \/]([\w.]+)/,C=/(msie) ([\w.]+)/,y=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,v=/^-ms-/,A=function(a,b){return(b+"").toUpperCase()},sa=J.userAgent,ia,D,z=Object.prototype.toString,Z=Object.prototype.hasOwnProperty,
|
|
O=Array.prototype.push,F=Array.prototype.slice,E=String.prototype.trim,ya=Array.prototype.indexOf,K={};d.fn=d.prototype={constructor:d,init:function(a,c,e){var f;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!c&&B.body)return this.context=B,this[0]=B.body,this.selector=a,this.length=1,this;if("string"===typeof a){f="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:h.exec(a);if(!f||!f[1]&&c)return!c||c.jquery?(c||e).find(a):this.constructor(c).find(a);
|
|
if(f[1])return e=(c=c instanceof d?c[0]:c)?c.ownerDocument||c:B,(a=p.exec(a))?d.isPlainObject(c)?(a=[B.createElement(a[1])],d.fn.attr.call(a,c,!0)):a=[e.createElement(a[1])]:(a=d.buildFragment([f[1]],[e]),a=(a.cacheable?d.clone(a.fragment):a.fragment).childNodes),d.merge(this,a);if((c=B.getElementById(f[2]))&&c.parentNode){if(c.id!==f[2])return e.find(a);this.length=1;this[0]=c}this.context=B;this.selector=a;return this}if(d.isFunction(a))return e.ready(a);a.selector!==b&&(this.selector=a.selector,
|
|
this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?O.apply(e,a):d.merge(e,a);e.prevObject=this;e.context=this.context;"find"===b?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,
|
|
b){return d.each(this,a,b)},ready:function(a){d.bindReady();ia.add(a);return this},eq:function(a){a=+a;return-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:O,sort:[].sort,splice:[].splice};
|
|
d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a,c,e,f,g,h=arguments[0]||{},k=1,l=arguments.length,m=!1;"boolean"===typeof h&&(m=h,h=arguments[1]||{},k=2);"object"===typeof h||d.isFunction(h)||(h={});l===k&&(h=this,--k);for(;k<l;k++)if(null!=(a=arguments[k]))for(c in a)e=h[c],f=a[c],h!==f&&(m&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,e=e&&d.isArray(e)?e:[]):e=e&&d.isPlainObject(e)?e:{},h[c]=d.extend(m,e,f)):f!==b&&(h[c]=f));return h};d.extend({noConflict:function(b){a.$===
|
|
d&&(a.$=f);b&&a.jQuery===d&&(a.jQuery=e);return d},isReady:!1,readyWait:1,holdReady:function(a){a?d.readyWait++:d.ready(!0)},ready:function(a){if(!0===a&&!--d.readyWait||!0!==a&&!d.isReady){if(!B.body)return setTimeout(d.ready,1);d.isReady=!0;!0!==a&&0<--d.readyWait||(ia.fireWith(B,[d]),d.fn.trigger&&d(B).trigger("ready").off("ready"))}},bindReady:function(){if(!ia){ia=d.Callbacks("once memory");if("complete"===B.readyState)return setTimeout(d.ready,1);if(B.addEventListener)B.addEventListener("DOMContentLoaded",
|
|
D,!1),a.addEventListener("load",d.ready,!1);else if(B.attachEvent){B.attachEvent("onreadystatechange",D);a.attachEvent("onload",d.ready);var b=!1;try{b=null==a.frameElement}catch(e){}B.documentElement.doScroll&&b&&c()}}},isFunction:function(a){return"function"===d.type(a)},isArray:Array.isArray||function(a){return"array"===d.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):K[z.call(a)]||
|
|
"object"},isPlainObject:function(a){if(!a||"object"!==d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!Z.call(a,"constructor")&&!Z.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}for(var e in a);return e===b||Z.call(a,e)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw Error(a);},parseJSON:function(b){if("string"!==typeof b||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(r,
|
|
"@").replace(q,"]").replace(x,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(c){if("string"!==typeof c||!c)return null;var e,f;try{a.DOMParser?(f=new DOMParser,e=f.parseFromString(c,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(c))}catch(g){e=b}e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||d.error("Invalid XML: "+c);return e},noop:function(){},globalEval:function(b){b&&k.test(b)&&(a.execScript||function(b){a.eval.call(a,
|
|
b)})(b)},camelCase:function(a){return a.replace(v,"ms-").replace(w,A)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,k=h===b||d.isFunction(a);if(e)if(k)for(f in a){if(!1===c.apply(a[f],e))break}else for(;g<h&&!1!==c.apply(a[g++],e););else if(k)for(f in a){if(!1===c.call(a[f],f,a[f]))break}else for(;g<h&&!1!==c.call(a[g],g,a[g++]););return a},trim:E?function(a){return null==a?"":E.call(a)}:function(a){return null==a?
|
|
"":a.toString().replace(l,"").replace(m,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var e=d.type(a);null==a.length||"string"===e||"function"===e||"regexp"===e||d.isWindow(a)?O.call(c,a):d.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(ya)return ya.call(b,a,c);d=b.length;for(c=c?0>c?Math.max(0,d+c):c:0;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if("number"===typeof c.length)for(var f=c.length;e<f;e++)a[d++]=c[e];else for(;c[e]!==b;)a[d++]=
|
|
c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,e){var f,g,h=[],k=0,l=a.length;if(a instanceof d||l!==b&&"number"===typeof l&&(0<l&&a[0]&&a[l-1]||0===l||d.isArray(a)))for(;k<l;k++)f=c(a[k],k,e),null!=f&&(h[h.length]=f);else for(g in a)f=c(a[g],g,e),null!=f&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if("string"===typeof c){var e=a[c];c=a;a=e}if(!d.isFunction(a))return b;
|
|
var f=F.call(arguments,2),e=function(){return a.apply(c,f.concat(F.call(arguments)))};e.guid=a.guid=a.guid||e.guid||d.guid++;return e},access:function(a,c,e,f,g,h,k){var l,m=null==e,p=0,n=a.length;if(e&&"object"===typeof e){for(p in e)d.access(a,c,p,e[p],1,h,f);g=1}else if(f!==b){l=k===b&&d.isFunction(f);m&&(l?(l=c,c=function(a,b,c){return l.call(d(a),c)}):(c.call(a,f),c=null));if(c)for(;p<n;p++)c(a[p],e,l?f.call(a[p],p,c(a[p],e)):f,k);g=1}return g?a:m?c.call(a):n?c(a[0],e):h},now:function(){return(new Date).getTime()},
|
|
uaMatch:function(a){a=a.toLowerCase();a=t.exec(a)||u.exec(a)||C.exec(a)||0>a.indexOf("compatible")&&y.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this);a.superclass=this;a.fn=a.prototype=this();a.fn.constructor=a;a.sub=this.sub;a.fn.init=function(c,e){e&&e instanceof d&&!(e instanceof a)&&(e=a(e));return d.fn.init.call(this,c,e,b)};a.fn.init.prototype=a.fn;var b=a(B);return a},browser:{}});d.each("Boolean Number String Function Array Date RegExp Object".split(" "),
|
|
function(a,b){K["[object "+b+"]"]=b.toLowerCase()});sa=d.uaMatch(sa);sa.browser&&(d.browser[sa.browser]=!0,d.browser.version=sa.version);d.browser.webkit&&(d.browser.safari=!0);k.test("\u00a0")&&(l=/^[\s\xA0]+/,m=/[\s\xA0]+$/);g=d(B);B.addEventListener?D=function(){B.removeEventListener("DOMContentLoaded",D,!1);d.ready()}:B.attachEvent&&(D=function(){"complete"===B.readyState&&(B.detachEvent("onreadystatechange",D),d.ready())});return d}(),T={};q.Callbacks=function(a){a=a?T[a]||c(a):{};var d=[],e=
|
|
[],f,g,h,k,l,m,p=function(b){var c,e,f,g;c=0;for(e=b.length;c<e;c++)f=b[c],g=q.type(f),"array"===g?p(f):"function"===g&&(a.unique&&r.has(f)||d.push(f))},n=function(b,c){c=c||[];f=!a.memory||[b,c];h=g=!0;m=k||0;k=0;for(l=d.length;d&&m<l;m++)if(!1===d[m].apply(b,c)&&a.stopOnFalse){f=!0;break}h=!1;d&&(a.once?!0===f?r.disable():d=[]:e&&e.length&&(f=e.shift(),r.fireWith(f[0],f[1])))},r={add:function(){if(d){var a=d.length;p(arguments);h?l=d.length:f&&!0!==f&&(k=a,n(f[0],f[1]))}return this},remove:function(){if(d)for(var b=
|
|
arguments,c=0,e=b.length;c<e;c++)for(var f=0;f<d.length&&(b[c]!==d[f]||(h&&f<=l&&(l--,f<=m&&m--),d.splice(f--,1),!a.unique));f++);return this},has:function(a){if(d)for(var b=0,c=d.length;b<c;b++)if(a===d[b])return!0;return!1},empty:function(){d=[];return this},disable:function(){d=e=f=b;return this},disabled:function(){return!d},lock:function(){e=b;f&&!0!==f||r.disable();return this},locked:function(){return!e},fireWith:function(b,c){e&&(h?a.once||e.push([b,c]):a.once&&f||n(b,c));return this},fire:function(){r.fireWith(this,
|
|
arguments);return this},fired:function(){return!!g}};return r};var I=[].slice;q.extend({Deferred:function(a){var b=q.Callbacks("once memory"),c=q.Callbacks("once memory"),d=q.Callbacks("memory"),e="pending",f={resolve:b,reject:c,notify:d},g={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){h.done(a).fail(b).progress(c);return this},always:function(){h.done.apply(h,arguments).fail.apply(h,arguments);return this},pipe:function(a,
|
|
b,c){return q.Deferred(function(d){q.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],f;if(q.isFunction(c))h[a](function(){if((f=c.apply(this,arguments))&&q.isFunction(f.promise))f.promise().then(d.resolve,d.reject,d.notify);else d[e+"With"](this===h?d:this,[f])});else h[a](d[e])})}).promise()},promise:function(a){if(null==a)a=g;else for(var b in g)a[b]=g[b];return a}},h=g.promise({}),k;for(k in f)h[k]=f[k].fire,h[k+"With"]=f[k].fireWith;h.done(function(){e=
|
|
"resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock);a&&a.call(h,h);return h},when:function(a){function b(a){return function(b){d[a]=1<arguments.length?I.call(arguments,0):b;--h||k.resolveWith(k,d)}}function c(a){return function(b){g[a]=1<arguments.length?I.call(arguments,0):b;k.notifyWith(l,g)}}var d=I.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,k=1>=f&&a&&q.isFunction(a.promise)?a:q.Deferred(),l=k.promise();if(1<f){for(;e<f;e++)d[e]&&d[e].promise&&q.isFunction(d[e].promise)?
|
|
d[e].promise().then(b(e),k.reject,c(e)):--h;h||k.resolveWith(k,d)}else k!==a&&k.resolveWith(k,f?[a]:[]);return l}});q.support=function(){var b,c,d,e,f,g,h,k,l=B.createElement("div");l.setAttribute("className","t");l.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";c=l.getElementsByTagName("*");d=l.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=B.createElement("select");f=e.appendChild(B.createElement("option"));c=
|
|
l.getElementsByTagName("input")[0];b={leadingWhitespace:3===l.firstChild.nodeType,tbody:!l.getElementsByTagName("tbody").length,htmlSerialize:!!l.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===c.value,optSelected:f.selected,getSetAttribute:"t"!==l.className,enctype:!!B.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==B.createElement("nav").cloneNode(!0).outerHTML,
|
|
submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0};q.boxModel=b.boxModel="CSS1Compat"===B.compatMode;c.checked=!0;b.noCloneChecked=c.cloneNode(!0).checked;e.disabled=!0;b.optDisabled=!f.disabled;try{delete l.test}catch(m){b.deleteExpando=!1}!l.addEventListener&&l.attachEvent&&l.fireEvent&&(l.attachEvent("onclick",function(){b.noCloneEvent=!1}),l.cloneNode(!0).fireEvent("onclick"));
|
|
c=B.createElement("input");c.value="t";c.setAttribute("type","radio");b.radioValue="t"===c.value;c.setAttribute("checked","checked");c.setAttribute("name","t");l.appendChild(c);d=B.createDocumentFragment();d.appendChild(l.lastChild);b.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked;b.appendChecked=c.checked;d.removeChild(c);d.appendChild(l);if(l.attachEvent)for(h in{submit:1,change:1,focusin:1})c="on"+h,k=c in l,k||(l.setAttribute(c,"return;"),k="function"===typeof l[c]),b[h+"Bubbles"]=
|
|
k;d.removeChild(l);d=e=f=l=c=null;q(function(){var c,d,e,f,h=B.getElementsByTagName("body")[0];h&&(c=B.createElement("div"),c.style.cssText="padding:0;margin:0;border:0;visibility:hidden;width:0;height:0;position:static;top:0;margin-top:1px",h.insertBefore(c,h.firstChild),l=B.createElement("div"),c.appendChild(l),l.innerHTML="<table><tr><td style='padding:0;margin:0;border:0;display:none'></td><td>t</td></tr></table>",g=l.getElementsByTagName("td"),k=0===g[0].offsetHeight,g[0].style.display="",g[1].style.display=
|
|
"none",b.reliableHiddenOffsets=k&&0===g[0].offsetHeight,a.getComputedStyle&&(l.innerHTML="",d=B.createElement("div"),d.style.width="0",d.style.marginRight="0",l.style.width="2px",l.appendChild(d),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(d,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!==typeof l.style.zoom&&(l.innerHTML="",l.style.width=l.style.padding="1px",l.style.border=0,l.style.overflow="hidden",l.style.display="inline",l.style.zoom=1,b.inlineBlockNeedsLayout=3===l.offsetWidth,
|
|
l.style.display="block",l.style.overflow="visible",l.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=3!==l.offsetWidth),l.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:0;visibility:hidden;",l.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;display:block;'><div style='padding:0;margin:0;border:0;display:block;overflow:hidden;'></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",
|
|
d=l.firstChild,e=d.firstChild,f=d.nextSibling.firstChild.firstChild,f={doesNotAddBorder:5!==e.offsetTop,doesAddBorderForTableAndCells:5===f.offsetTop},e.style.position="fixed",e.style.top="20px",f.fixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",f.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,f.doesNotIncludeMarginInBodyOffset=1!==h.offsetTop,a.getComputedStyle&&(l.style.marginTop="1%",b.pixelMargin="1%"!==
|
|
(a.getComputedStyle(l,null)||{marginTop:0}).marginTop),"undefined"!==typeof c.style.zoom&&(c.style.zoom=1),h.removeChild(c),l=null,q.extend(b,f))});return b}();var M=/^(?:\{.*\}|\[.*\])$/,S=/([A-Z])/g;q.extend({cache:{},uuid:0,expando:"jQuery"+(q.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?q.cache[a[q.expando]]:a[q.expando];return!!a&&!e(a)},data:function(a,c,d,e){if(q.acceptData(a)){var f;
|
|
f=q.expando;var g="string"===typeof c,h=a.nodeType,k=h?q.cache:a,l=h?a[f]:a[f]&&f,m="events"===c;if(l&&k[l]&&(m||e||k[l].data)||!g||d!==b){l||(h?a[f]=l=++q.uuid:l=f);k[l]||(k[l]={},h||(k[l].toJSON=q.noop));if("object"===typeof c||"function"===typeof c)e?k[l]=q.extend(k[l],c):k[l].data=q.extend(k[l].data,c);f=a=k[l];e||(a.data||(a.data={}),a=a.data);d!==b&&(a[q.camelCase(c)]=d);if(m&&!a[c])return f.events;g?(d=a[c],null==d&&(d=a[q.camelCase(c)])):d=a;return d}}},removeData:function(a,b,c){if(q.acceptData(a)){var d,
|
|
f,g,h=q.expando,k=a.nodeType,l=k?q.cache:a,m=k?a[h]:h;if(l[m]){if(b&&(d=c?l[m]:l[m].data)){q.isArray(b)||(b in d?b=[b]:(b=q.camelCase(b),b=b in d?[b]:b.split(" ")));f=0;for(g=b.length;f<g;f++)delete d[b[f]];if(!(c?e:q.isEmptyObject)(d))return}if(!c&&(delete l[m].data,!e(l[m])))return;q.support.deleteExpando||!l.setInterval?delete l[m]:l[m]=null;k&&(q.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}}},_data:function(a,b,c){return q.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=
|
|
q.noData[a.nodeName.toLowerCase()];if(b)return!(!0===b||a.getAttribute("classid")!==b)}return!0}});q.fn.extend({data:function(a,c){var e,f,g,h,k,l=this[0],m=0,p=null;if(a===b){if(this.length&&(p=q.data(l),1===l.nodeType&&!q._data(l,"parsedAttrs"))){g=l.attributes;for(k=g.length;m<k;m++)h=g[m].name,0===h.indexOf("data-")&&(h=q.camelCase(h.substring(5)),d(l,h,p[h]));q._data(l,"parsedAttrs",!0)}return p}if("object"===typeof a)return this.each(function(){q.data(this,a)});e=a.split(".",2);e[1]=e[1]?"."+
|
|
e[1]:"";f=e[1]+"!";return q.access(this,function(c){if(c===b)return p=this.triggerHandler("getData"+f,[e[0]]),p===b&&l&&(p=q.data(l,a),p=d(l,a,p)),p===b&&e[1]?this.data(e[0]):p;e[1]=c;this.each(function(){var b=q(this);b.triggerHandler("setData"+f,e);q.data(this,a,c);b.triggerHandler("changeData"+f,e)})},null,c,1<arguments.length,null,!1)},removeData:function(a){return this.each(function(){q.removeData(this,a)})}});q.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",q._data(a,b,(q._data(a,b)||0)+
|
|
1))},_unmark:function(a,b,c){!0!==a&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark";(a=a?0:(q._data(b,d)||1)-1)?q._data(b,d,a):(q.removeData(b,d,!0),f(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=q._data(a,b),c&&(!d||q.isArray(c)?d=q._data(a,b,q.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=q.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift());d&&("fx"===b&&c.unshift("inprogress"),q._data(a,b+".run",e),d.call(a,function(){q.dequeue(a,
|
|
b)},e));c.length||(q.removeData(a,b+"queue "+b+".run",!0),f(a,b,"queue"))}});q.fn.extend({queue:function(a,c){var d=2;"string"!==typeof a&&(c=a,a="fx",d--);return arguments.length<d?q.queue(this[0],a):c===b?this:this.each(function(){var b=q.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&q.dequeue(this,a)})},dequeue:function(a){return this.each(function(){q.dequeue(this,a)})},delay:function(a,b){a=q.fx?q.fx.speeds[a]||a:a;return this.queue(b||"fx",function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},
|
|
clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function d(){--h||e.resolveWith(f,[f])}"string"!==typeof a&&(c=a,a=b);a=a||"fx";for(var e=q.Deferred(),f=this,g=f.length,h=1,k=a+"defer",l=a+"queue",m=a+"mark",p;g--;)if(p=q.data(f[g],k,b,!0)||(q.data(f[g],l,b,!0)||q.data(f[g],m,b,!0))&&q.data(f[g],k,q.Callbacks("once memory"),!0))h++,p.add(d);d();return e.promise(c)}});var N=/[\n\t\r]/g,W=/\s+/,V=/\r/g,R=/^(?:button|input)$/i,aa=/^(?:button|input|object|select|textarea)$/i,
|
|
U=/^a(?:rea)?$/i,L=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,X=q.support.getSetAttribute,G,P,ta;q.fn.extend({attr:function(a,b){return q.access(this,q.attr,a,b,1<arguments.length)},removeAttr:function(a){return this.each(function(){q.removeAttr(this,a)})},prop:function(a,b){return q.access(this,q.prop,a,b,1<arguments.length)},removeProp:function(a){a=q.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},
|
|
addClass:function(a){var b,c,d,e,f,g,h;if(q.isFunction(a))return this.each(function(b){q(this).addClass(a.call(this,b,this.className))});if(a&&"string"===typeof a)for(b=a.split(W),c=0,d=this.length;c<d;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){f=" "+e.className+" ";g=0;for(h=b.length;g<h;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=q.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,k;if(q.isFunction(a))return this.each(function(b){q(this).removeClass(a.call(this,
|
|
b,this.className))});if(a&&"string"===typeof a||a===b)for(c=(a||"").split(W),d=0,e=this.length;d<e;d++)if(f=this[d],1===f.nodeType&&f.className)if(a){g=(" "+f.className+" ").replace(N," ");h=0;for(k=c.length;h<k;h++)g=g.replace(" "+c[h]+" "," ");f.className=q.trim(g)}else f.className="";return this},toggleClass:function(a,b){var c=typeof a,d="boolean"===typeof b;return q.isFunction(a)?this.each(function(c){q(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===
|
|
c)for(var e,f=0,g=q(this),h=b,k=a.split(W);e=k[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else if("undefined"===c||"boolean"===c)this.className&&q._data(this,"__className__",this.className),this.className=this.className||!1===a?"":q._data(this,"__className__")||""})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;b<c;b++)if(1===this[b].nodeType&&-1<(" "+this[b].className+" ").replace(N," ").indexOf(a))return!0;return!1},val:function(a){var c,d,e,f=this[0];if(arguments.length)return e=
|
|
q.isFunction(a),this.each(function(d){var f=q(this);1===this.nodeType&&(d=e?a.call(this,d,f.val()):a,null==d?d="":"number"===typeof d?d+="":q.isArray(d)&&(d=q.map(d,function(a){return null==a?"":a+""})),c=q.valHooks[this.type]||q.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,d,"value")!==b||(this.value=d))});if(f){if((c=q.valHooks[f.type]||q.valHooks[f.nodeName.toLowerCase()])&&"get"in c&&(d=c.get(f,"value"))!==b)return d;d=f.value;return"string"===typeof d?d.replace(V,""):null==
|
|
d?"":d}}});q.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d=a.selectedIndex,e=[],f=a.options,g="select-one"===a.type;if(0>d)return null;a=g?d:0;for(c=g?d+1:f.length;a<c;a++)if(b=f[a],!(!b.selected||(q.support.optDisabled?b.disabled:null!==b.getAttribute("disabled"))||b.parentNode.disabled&&q.nodeName(b.parentNode,"optgroup"))){b=q(b).val();if(g)return b;e.push(b)}return g&&!e.length&&f.length?q(f[d]).val():
|
|
e},set:function(a,b){var c=q.makeArray(b);q(a).find("option").each(function(){this.selected=0<=q.inArray(q(this).val(),c)});c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,h=a.nodeType;if(a&&3!==h&&8!==h&&2!==h){if(e&&c in q.attrFn)return q(a)[c](d);if("undefined"===typeof a.getAttribute)return q.prop(a,c,d);if(e=1!==h||!q.isXMLDoc(a))c=c.toLowerCase(),g=q.attrHooks[c]||(L.test(c)?P:G);if(d!==b)if(null===
|
|
d)q.removeAttr(a,c);else{if(g&&"set"in g&&e&&(f=g.set(a,d,c))!==b)return f;a.setAttribute(c,""+d);return d}else{if(g&&"get"in g&&e&&null!==(f=g.get(a,c)))return f;f=a.getAttribute(c);return null===f?b:f}}},removeAttr:function(a,b){var c,d,e,f,g,h=0;if(b&&1===a.nodeType)for(d=b.toLowerCase().split(W),f=d.length;h<f;h++)if(e=d[h])c=q.propFix[e]||e,(g=L.test(e))||q.attr(a,e,""),a.removeAttribute(X?e:c),g&&c in a&&(a[c]=!1)},attrHooks:{type:{set:function(a,b){if(R.test(a.nodeName)&&a.parentNode)q.error("type property can't be changed");
|
|
else if(!q.support.radioValue&&"radio"===b&&q.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b);c&&(a.value=c);return b}}},value:{get:function(a,b){return G&&q.nodeName(a,"button")?G.get(a,b):b in a?a.value:null},set:function(a,b,c){if(G&&q.nodeName(a,"button"))return G.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",
|
|
frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g;g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g){if(g=1!==g||!q.isXMLDoc(a))c=q.propFix[c]||c,f=q.propHooks[c];return d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):aa.test(a.nodeName)||U.test(a.nodeName)&&a.href?0:b}}}});q.attrHooks.tabindex=q.propHooks.tabIndex;
|
|
P={get:function(a,c){var d,e=q.prop(a,c);return!0===e||"boolean"!==typeof e&&(d=a.getAttributeNode(c))&&!1!==d.nodeValue?c.toLowerCase():b},set:function(a,b,c){!1===b?q.removeAttr(a,c):(b=q.propFix[c]||c,b in a&&(a[b]=!0),a.setAttribute(c,c.toLowerCase()));return c}};X||(ta={name:!0,id:!0,coords:!0},G=q.valHooks.button={get:function(a,c){var d;return(d=a.getAttributeNode(c))&&(ta[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);d||(d=B.createAttribute(c),
|
|
a.setAttributeNode(d));return d.nodeValue=b+""}},q.attrHooks.tabindex.set=G.set,q.each(["width","height"],function(a,b){q.attrHooks[b]=q.extend(q.attrHooks[b],{set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}})}),q.attrHooks.contenteditable={get:G.get,set:function(a,b,c){""===b&&(b="false");G.set(a,b,c)}});q.support.hrefNormalized||q.each(["href","src","width","height"],function(a,c){q.attrHooks[c]=q.extend(q.attrHooks[c],{get:function(a){a=a.getAttribute(c,2);return null===a?b:a}})});
|
|
q.support.style||(q.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}});q.support.optSelected||(q.propHooks.selected=q.extend(q.propHooks.selected,{get:function(a){if(a=a.parentNode)a.selectedIndex,a.parentNode&&a.parentNode.selectedIndex;return null}}));q.support.enctype||(q.propFix.enctype="encoding");q.support.checkOn||q.each(["radio","checkbox"],function(){q.valHooks[this]={get:function(a){return null===a.getAttribute("value")?
|
|
"on":a.value}}});q.each(["radio","checkbox"],function(){q.valHooks[this]=q.extend(q.valHooks[this],{set:function(a,b){if(q.isArray(b))return a.checked=0<=q.inArray(q(a).val(),b)}})});var ba=/^(?:textarea|input|select)$/i,ea=/^([^\.]*)?(?:\.(.+))?$/,na=/(?:^|\s)hover(\.\S+)?\b/,ja=/^key/,ga=/^(?:mouse|contextmenu)|click/,ka=/^(?:focusinfocus|focusoutblur)$/,Aa=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,qa=function(a){if(a=Aa.exec(a))a[1]=(a[1]||"").toLowerCase(),a[3]=a[3]&&new RegExp("(?:^|\\s)"+a[3]+
|
|
"(?:\\s|$)");return a},oa=function(a){return q.event.special.hover?a:a.replace(na,"mouseenter$1 mouseleave$1")};q.event={add:function(a,c,d,e,f){var g,h,k,l,m,p,n,r,x;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=q._data(a))){d.handler&&(n=d,d=n.handler,f=n.selector);d.guid||(d.guid=q.guid++);k=g.events;k||(g.events=k={});h=g.handle;h||(g.handle=h=function(a){return"undefined"===typeof q||a&&q.event.triggered===a.type?b:q.event.dispatch.apply(h.elem,arguments)},h.elem=a);c=q.trim(oa(c)).split(" ");
|
|
for(g=0;g<c.length;g++)l=ea.exec(c[g])||[],m=l[1],p=(l[2]||"").split(".").sort(),x=q.event.special[m]||{},m=(f?x.delegateType:x.bindType)||m,x=q.event.special[m]||{},l=q.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:f,quick:f&&qa(f),namespace:p.join(".")},n),r=k[m],r||(r=k[m]=[],r.delegateCount=0,x.setup&&!1!==x.setup.call(a,e,p,h)||(a.addEventListener?a.addEventListener(m,h,!1):a.attachEvent&&a.attachEvent("on"+m,h))),x.add&&(x.add.call(a,l),l.handler.guid||(l.handler.guid=d.guid)),
|
|
f?r.splice(r.delegateCount++,0,l):r.push(l),q.event.global[m]=!0;a=null}},global:{},remove:function(a,b,c,d,e){var f=q.hasData(a)&&q._data(a),g,h,k,l,m,p,n,r,x,t;if(f&&(n=f.events)){b=q.trim(oa(b||"")).split(" ");for(g=0;g<b.length;g++)if(h=ea.exec(b[g])||[],k=l=h[1],h=h[2],k){r=q.event.special[k]||{};k=(d?r.delegateType:r.bindType)||k;x=n[k]||[];m=x.length;h=h?new RegExp("(^|\\.)"+h.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(p=0;p<x.length;p++)t=x[p],!e&&l!==t.origType||c&&c.guid!==
|
|
t.guid||h&&!h.test(t.namespace)||d&&d!==t.selector&&("**"!==d||!t.selector)||(x.splice(p--,1),t.selector&&x.delegateCount--,r.remove&&r.remove.call(a,t));0===x.length&&m!==x.length&&(r.teardown&&!1!==r.teardown.call(a,h)||q.removeEvent(a,k,f.handle),delete n[k])}else for(k in n)q.event.remove(a,k+b[g],c,d,!0);if(q.isEmptyObject(n)){if(b=f.handle)b.elem=null;q.removeData(a,["events","handle"],!0)}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,f){if(!e||3!==e.nodeType&&
|
|
8!==e.nodeType){var g=c.type||c,h=[],k,l,m,p,n;if(!ka.test(g+q.event.triggered)&&(0<=g.indexOf("!")&&(g=g.slice(0,-1),k=!0),0<=g.indexOf(".")&&(h=g.split("."),g=h.shift(),h.sort()),e&&!q.event.customEvent[g]||q.event.global[g]))if(c="object"===typeof c?c[q.expando]?c:new q.Event(g,c):new q.Event(g),c.type=g,c.isTrigger=!0,c.exclusive=k,c.namespace=h.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,k=0>g.indexOf(":")?"on"+g:"",e){if(c.result=b,c.target||
|
|
(c.target=e),d=null!=d?q.makeArray(d):[],d.unshift(c),m=q.event.special[g]||{},!m.trigger||!1!==m.trigger.apply(e,d)){n=[[e,m.bindType||g]];if(!f&&!m.noBubble&&!q.isWindow(e)){p=m.delegateType||g;h=ka.test(p+g)?e:e.parentNode;for(l=null;h;h=h.parentNode)n.push([h,p]),l=h;l&&l===e.ownerDocument&&n.push([l.defaultView||l.parentWindow||a,p])}for(l=0;l<n.length&&!c.isPropagationStopped();l++)h=n[l][0],c.type=n[l][1],(p=(q._data(h,"events")||{})[c.type]&&q._data(h,"handle"))&&p.apply(h,d),(p=k&&h[k])&&
|
|
q.acceptData(h)&&!1===p.apply(h,d)&&c.preventDefault();c.type=g;f||c.isDefaultPrevented()||m._default&&!1!==m._default.apply(e.ownerDocument,d)||"click"===g&&q.nodeName(e,"a")||!q.acceptData(e)||!k||!e[g]||("focus"===g||"blur"===g)&&0===c.target.offsetWidth||q.isWindow(e)||((l=e[k])&&(e[k]=null),q.event.triggered=g,e[g](),q.event.triggered=b,l&&(e[k]=l));return c.result}}else for(l in e=q.cache,e)e[l].events&&e[l].events[g]&&q.event.trigger(c,d,e[l].handle.elem,!0)}},dispatch:function(c){c=q.event.fix(c||
|
|
a.event);var d=(q._data(this,"events")||{})[c.type]||[],e=d.delegateCount,f=[].slice.call(arguments,0),g=!c.exclusive&&!c.namespace,h=q.event.special[c.type]||{},k=[],l,m,p,n,r,x,t;f[0]=c;c.delegateTarget=this;if(!h.preDispatch||!1!==h.preDispatch.call(this,c)){if(e&&(!c.button||"click"!==c.type))for(p=q(this),p.context=this.ownerDocument||this,m=c.target;m!=this;m=m.parentNode||this)if(!0!==m.disabled){r={};x=[];p[0]=m;for(l=0;l<e;l++){n=d[l];t=n.selector;if(r[t]===b){var u=r,C=t,J;if(n.quick){J=
|
|
n.quick;var y=m.attributes||{};J=(!J[1]||m.nodeName.toLowerCase()===J[1])&&(!J[2]||(y.id||{}).value===J[2])&&(!J[3]||J[3].test((y["class"]||{}).value))}else J=p.is(t);u[C]=J}r[t]&&x.push(n)}x.length&&k.push({elem:m,matches:x})}d.length>e&&k.push({elem:this,matches:d.slice(e)});for(l=0;l<k.length&&!c.isPropagationStopped();l++)for(e=k[l],c.currentTarget=e.elem,d=0;d<e.matches.length&&!c.isImmediatePropagationStopped();d++)if(n=e.matches[d],g||!c.namespace&&!n.namespace||c.namespace_re&&c.namespace_re.test(n.namespace))c.data=
|
|
n.data,c.handleObj=n,n=((q.event.special[n.origType]||{}).handle||n.handler).apply(e.elem,f),n!==b&&(c.result=n,!1===n&&(c.preventDefault(),c.stopPropagation()));h.postDispatch&&h.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(a,b){null==a.which&&
|
|
(a.which=null!=b.charCode?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,e,f=c.button,g=c.fromElement;null==a.pageX&&null!=c.clientX&&(d=a.target.ownerDocument||B,e=d.documentElement,d=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||d&&d.scrollLeft||0)-(e&&e.clientLeft||d&&d.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||d&&d.scrollTop||0)-(e&&e.clientTop||d&&
|
|
d.clientTop||0));!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?c.toElement:g);a.which||f===b||(a.which=f&1?1:f&2?3:f&4?2:0);return a}},fix:function(a){if(a[q.expando])return a;var c,d,e=a,f=q.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=q.Event(e);for(c=g.length;c;)d=g[--c],a[d]=e[d];a.target||(a.target=e.srcElement||B);3===a.target.nodeType&&(a.target=a.target.parentNode);a.metaKey===b&&(a.metaKey=a.ctrlKey);return f.filter?f.filter(a,e):a},special:{ready:{setup:q.bindReady},
|
|
load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){q.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){a=q.extend(new q.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?q.event.trigger(a,null,b):q.event.dispatch.call(b,a);a.isDefaultPrevented()&&c.preventDefault()}};q.event.handle=q.event.dispatch;q.removeEvent=B.removeEventListener?function(a,
|
|
b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};q.Event=function(a,b){if(!(this instanceof q.Event))return new q.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||!1===a.returnValue||a.getPreventDefault&&a.getPreventDefault()?h:g):this.type=a;b&&q.extend(this,b);this.timeStamp=a&&a.timeStamp||q.now();this[q.expando]=!0};q.Event.prototype={preventDefault:function(){this.isDefaultPrevented=
|
|
h;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=h;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=h;this.stopPropagation()},isDefaultPrevented:g,isPropagationStopped:g,isImmediatePropagationStopped:g};q.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){q.event.special[a]={delegateType:b,
|
|
bindType:b,handle:function(a){var c=a.relatedTarget,d=a.handleObj,e;if(!c||c!==this&&!q.contains(this,c))a.type=d.origType,e=d.handler.apply(this,arguments),a.type=b;return e}}});q.support.submitBubbles||(q.event.special.submit={setup:function(){if(q.nodeName(this,"form"))return!1;q.event.add(this,"click._submit keypress._submit",function(a){a=a.target;(a=q.nodeName(a,"input")||q.nodeName(a,"button")?a.form:b)&&!a._submit_attached&&(q.event.add(a,"submit._submit",function(a){a._submit_bubble=!0}),
|
|
a._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&q.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(q.nodeName(this,"form"))return!1;q.event.remove(this,"._submit")}});q.support.changeBubbles||(q.event.special.change={setup:function(){if(ba.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)q.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&
|
|
(this._just_changed=!0)}),q.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,q.event.simulate("change",this,a,!0))});return!1}q.event.add(this,"beforeactivate._change",function(a){a=a.target;ba.test(a.nodeName)&&!a._change_attached&&(q.event.add(a,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||q.event.simulate("change",this.parentNode,a,!0)}),a._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||
|
|
a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type)return a.handleObj.handler.apply(this,arguments)},teardown:function(){q.event.remove(this,"._change");return ba.test(this.nodeName)}});q.support.focusinBubbles||q.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){q.event.simulate(b,a.target,q.event.fix(a),!0)};q.event.special[b]={setup:function(){0===c++&&B.addEventListener(a,d,!0)},teardown:function(){0===--c&&B.removeEventListener(a,d,!0)}}});q.fn.extend({on:function(a,
|
|
c,d,e,f){var h,k;if("object"===typeof a){"string"!==typeof c&&(d=d||c,c=b);for(k in a)this.on(k,c,d,a[k],f);return this}null==d&&null==e?(e=c,d=c=b):null==e&&("string"===typeof c?(e=d,d=b):(e=d,d=c,c=b));if(!1===e)e=g;else if(!e)return this;1===f&&(h=e,e=function(a){q().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=q.guid++));return this.each(function(){q.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=
|
|
a.handleObj;q(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if("object"===typeof a){for(e in a)this.off(e,c,a[e]);return this}if(!1===c||"function"===typeof c)d=c,c=b;!1===d&&(d=g);return this.each(function(){q.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){q(this.context).on(a,this.selector,b,c);return this},die:function(a,b){q(this.context).off(a,
|
|
this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1==arguments.length?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){q.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return q.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||q.guid++,d=0,e=function(c){var e=(q._data(this,"lastToggle"+a.guid)||0)%d;q._data(this,"lastToggle"+a.guid,e+1);c.preventDefault();
|
|
return b[e].apply(this,arguments)||!1};for(e.guid=c;d<b.length;)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});q.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){q.fn[b]=function(a,c){null==c&&(c=a,a=null);return 0<arguments.length?this.on(b,null,a,c):this.trigger(b)};
|
|
q.attrFn&&(q.attrFn[b]=!0);ja.test(b)&&(q.event.fixHooks[b]=q.event.keyHooks);ga.test(b)&&(q.event.fixHooks[b]=q.event.mouseHooks)});(function(){function a(b,c,d,f,g,h){g=0;for(var k=f.length;g<k;g++){var l=f[g];if(l){for(var m=!1,l=l[b];l;){if(l[e]===d){m=f[l.sizset];break}1!==l.nodeType||h||(l[e]=d,l.sizset=g);if(l.nodeName.toLowerCase()===c){m=l;break}l=l[b]}f[g]=m}}}function c(a,b,d,f,g,h){g=0;for(var k=f.length;g<k;g++){var l=f[g];if(l){for(var m=!1,l=l[a];l;){if(l[e]===d){m=f[l.sizset];break}if(1===
|
|
l.nodeType)if(h||(l[e]=d,l.sizset=g),"string"!==typeof b){if(l===b){m=!0;break}}else if(0<n.filter(b,[l]).length){m=l;break}l=l[a]}f[g]=m}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,k=!0,l=/\\/g,m=/\r\n/g,p=/\W/;[0,0].sort(function(){k=!1;return 0});var n=function(a,b,c,e){c=c||[];var f=b=b||B;if(1!==b.nodeType&&9!==
|
|
b.nodeType)return[];if(!a||"string"!==typeof a)return c;var h,k,l,m,p,r=!0,q=n.isXML(b),u=[],C=a;do if(d.exec(""),h=d.exec(C))if(C=h[3],u.push(h[1]),h[2]){m=h[3];break}while(h);if(1<u.length&&t.exec(a))if(2===u.length&&x.relative[u[0]])k=A(u[0]+u[1],b,e);else for(k=x.relative[u[0]]?[b]:n(u.shift(),b);u.length;)a=u.shift(),x.relative[a]&&(a+=u.shift()),k=A(a,k,e);else if(!e&&1<u.length&&9===b.nodeType&&!q&&x.match.ID.test(u[0])&&!x.match.ID.test(u[u.length-1])&&(h=n.find(u.shift(),b,q),b=h.expr?n.filter(h.expr,
|
|
h.set)[0]:h.set[0]),b)for(h=e?{expr:u.pop(),set:J(e)}:n.find(u.pop(),1!==u.length||"~"!==u[0]&&"+"!==u[0]||!b.parentNode?b:b.parentNode,q),k=h.expr?n.filter(h.expr,h.set):h.set,0<u.length?l=J(k):r=!1;u.length;)h=p=u.pop(),x.relative[p]?h=u.pop():p="",null==h&&(h=b),x.relative[p](l,h,q);else l=[];l||(l=k);l||n.error(p||a);if("[object Array]"===g.call(l))if(r)if(b&&1===b.nodeType)for(a=0;null!=l[a];a++)l[a]&&(!0===l[a]||1===l[a].nodeType&&n.contains(b,l[a]))&&c.push(k[a]);else for(a=0;null!=l[a];a++)l[a]&&
|
|
1===l[a].nodeType&&c.push(k[a]);else c.push.apply(c,l);else J(l,c);m&&(n(m,f,c,e),n.uniqueSort(c));return c};n.uniqueSort=function(a){if(w&&(h=k,a.sort(w),h))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};n.matches=function(a,b){return n(a,null,null,b)};n.matchesSelector=function(a,b){return 0<n(b,null,null,[a]).length};n.find=function(a,b,c){var d,e,f,g,h,k;if(!a)return[];e=0;for(f=x.order.length;e<f;e++)if(h=x.order[e],g=x.leftMatch[h].exec(a))if(k=g[1],g.splice(1,1),"\\"!==
|
|
k.substr(k.length-1)&&(g[1]=(g[1]||"").replace(l,""),d=x.find[h](g,b,c),null!=d)){a=a.replace(x.match[h],"");break}d||(d="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};n.filter=function(a,c,d,e){for(var f,g,h,k,l,m,p,r,q=a,t=[],u=c,C=c&&c[0]&&n.isXML(c[0]);a&&c.length;){for(h in x.filter)if(null!=(f=x.leftMatch[h].exec(a))&&f[2]&&(m=x.filter[h],l=f[1],g=!1,f.splice(1,1),"\\"!==l.substr(l.length-1))){u===t&&(t=[]);if(x.preFilter[h])if(f=x.preFilter[h](f,
|
|
u,d,t,e,C),!f)g=k=!0;else if(!0===f)continue;if(f)for(p=0;null!=(l=u[p]);p++)l&&(k=m(l,f,p,u),r=e^k,d&&null!=k?r?g=!0:u[p]=!1:r&&(t.push(l),g=!0));if(k!==b){d||(u=t);a=a.replace(x.match[h],"");if(!g)return[];break}}if(a===q)if(null==g)n.error(a);else break;q=a}return u};n.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var r=n.getText=function(a){var b,c;b=a.nodeType;var d="";if(b)if(1===b||9===b||11===b){if("string"===typeof a.textContent)return a.textContent;if("string"===
|
|
typeof a.innerText)return a.innerText.replace(m,"");for(a=a.firstChild;a;a=a.nextSibling)d+=r(a)}else{if(3===b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=r(c));return d},x=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
|
|
CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"===typeof b,d=c&&!p.test(b),
|
|
c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&1!==f.nodeType;);a[d]=c||f&&f.nodeName.toLowerCase()===b?f||!1:f===b}c&&n.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,e=0,f=a.length;if(d&&!p.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<f;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&n.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,k=c;"string"!==
|
|
typeof d||p.test(d)||(g=d=d.toLowerCase(),k=a);k("parentNode",d,h,b,g,e)},"~":function(b,d,e){var g,h=f++,k=c;"string"!==typeof d||p.test(d)||(g=d=d.toLowerCase(),k=a);k("previousSibling",d,h,b,g,e)}},find:{ID:function(a,b,c){if("undefined"!==typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!==typeof b.getElementsByName){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);
|
|
return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!==typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(l,"")+" ";if(f)return a;f=0;for(var g;null!=(g=b[f]);f++)g&&(e^(g.className&&0<=(" "+g.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?c||d.push(g):c&&(b[f]=!1));return!1},ID:function(a){return a[1].replace(l,"")},TAG:function(a,b){return a[1].replace(l,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||
|
|
n.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&n.error(a[0]);a[0]=f++;return a},ATTR:function(a,b,c,d,e,f){b=a[1]=a[1].replace(l,"");!f&&x.attrMap[b]&&(a[1]=x.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(l,"");"~="===a[2]&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if("not"===a[1])if(1<(d.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=
|
|
n(a[3],null,null,b);else return a=n.filter(a[3],b,c,1^f),c||e.push.apply(e,a),!1;else if(x.match.POS.test(a[0])||x.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},
|
|
has:function(a,b,c){return!!n(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&
|
|
"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===
|
|
a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=x.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||r([a])||"").indexOf(b[3]);
|
|
if("not"===e){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}n.error(e)},CHILD:function(a,b){var c,d,f,g,h,k;c=b[1];k=a;switch(c){case "only":case "first":for(;k=k.previousSibling;)if(1===k.nodeType)return!1;if("first"===c)return!0;k=a;case "last":for(;k=k.nextSibling;)if(1===k.nodeType)return!1;return!0;case "nth":c=b[2];d=b[3];if(1===c&&0===d)return!0;f=b[0];if((g=a.parentNode)&&(g[e]!==f||!a.nodeIndex)){h=0;for(k=g.firstChild;k;k=k.nextSibling)1===k.nodeType&&(k.nodeIndex=++h);
|
|
g[e]=f}k=a.nodeIndex-d;return 0===c?0===k:0===k%c&&0<=k/c}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1],c=n.attr?n.attr(a,c):x.attrHandle[c]?x.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],f=b[4];return null==c?"!="===e:!e&&n.attr?null!=c:"="===e?
|
|
d===f:"*="===e?0<=d.indexOf(f):"~="===e?0<=(" "+d+" ").indexOf(f):f?"!="===e?d!==f:"^="===e?0===d.indexOf(f):"$="===e?d.substr(d.length-f.length)===f:"|="===e?d===f||d.substr(0,f.length+1)===f+"-":!1:d&&!1!==c},POS:function(a,b,c,d){var e=x.setFilters[b[2]];if(e)return e(a,c,b,d)}}},t=x.match.POS,u=function(a,b){return"\\"+(b-0+1)},C;for(C in x.match)x.match[C]=new RegExp(x.match[C].source+/(?![^\[]*\])(?![^\(]*\))/.source),x.leftMatch[C]=new RegExp(/(^(?:.|\r|\n)*?)/.source+x.match[C].source.replace(/\\(\d+)/g,
|
|
u));x.match.globalPOS=t;var J=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(B.documentElement.childNodes,0)[0].nodeType}catch(y){J=function(a,b){var c=0,d=b||[];if("[object Array]"===g.call(a))Array.prototype.push.apply(d,a);else if("number"===typeof a.length)for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var w,v;B.documentElement.compareDocumentPosition?w=function(a,b){return a===b?(h=!0,0):a.compareDocumentPosition&&
|
|
b.compareDocumentPosition?a.compareDocumentPosition(b)&4?-1:1:a.compareDocumentPosition?-1:1}:(w=function(a,b){if(a===b)return h=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[];c=a.parentNode;d=b.parentNode;var g=c;if(c===d)return v(a,b);if(!c)return-1;if(!d)return 1;for(;g;)e.unshift(g),g=g.parentNode;for(g=d;g;)f.unshift(g),g=g.parentNode;c=e.length;d=f.length;for(g=0;g<c&&g<d;g++)if(e[g]!==f[g])return v(e[g],f[g]);return g===c?v(a,f[g],-1):v(e[g],b,1)},
|
|
v=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});(function(){var a=B.createElement("div"),c="script"+(new Date).getTime(),d=B.documentElement;a.innerHTML="<a name='"+c+"'/>";d.insertBefore(a,d.firstChild);B.getElementById(c)&&(x.find.ID=function(a,c,d){if("undefined"!==typeof c.getElementById&&!d)return(c=c.getElementById(a[1]))?c.id===a[1]||"undefined"!==typeof c.getAttributeNode&&c.getAttributeNode("id").nodeValue===a[1]?[c]:b:[]},x.filter.ID=
|
|
function(a,b){var c="undefined"!==typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b});d.removeChild(a);d=a=null})();(function(){var a=B.createElement("div");a.appendChild(B.createComment(""));0<a.getElementsByTagName("*").length&&(x.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&d.push(c[e]);c=d}return c});a.innerHTML="<a href='#'></a>";a.firstChild&&"undefined"!==typeof a.firstChild.getAttribute&&
|
|
"#"!==a.firstChild.getAttribute("href")&&(x.attrHandle.href=function(a){return a.getAttribute("href",2)});a=null})();B.querySelectorAll&&function(){var a=n,b=B.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){n=function(b,c,d,e){c=c||B;if(!e&&!n.isXML(c)){var f=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(f&&(1===c.nodeType||9===c.nodeType)){if(f[1])return J(c.getElementsByTagName(b),d);if(f[2]&&x.find.CLASS&&c.getElementsByClassName)return J(c.getElementsByClassName(f[2]),
|
|
d)}if(9===c.nodeType){if("body"===b&&c.body)return J([c.body],d);if(f&&f[3]){var g=c.getElementById(f[3]);if(g&&g.parentNode){if(g.id===f[3])return J([g],d)}else return J([],d)}try{return J(c.querySelectorAll(b),d)}catch(h){}}else if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){var f=c,k=(g=c.getAttribute("id"))||"__sizzle__",l=c.parentNode,m=/^\s*[+~]/.test(b);g?k=k.replace(/'/g,"\\$&"):c.setAttribute("id",k);m&&l&&(c=c.parentNode);try{if(!m||l)return J(c.querySelectorAll("[id='"+k+"'] "+
|
|
b),d)}catch(p){}finally{g||f.removeAttribute("id")}}}return a(b,c,d,e)};for(var c in a)n[c]=a[c];b=null}}();(function(){var a=B.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(B.createElement("div"),"div"),d=!1;try{b.call(B.documentElement,"[test!='']:sizzle")}catch(e){d=!0}n.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!n.isXML(a))try{if(d||!x.match.PSEUDO.test(e)&&!/!=/.test(e)){var f=b.call(a,
|
|
e);if(f||!c||a.document&&11!==a.document.nodeType)return f}}catch(g){}return 0<n(e,null,null,[a]).length}}})();(function(){var a=B.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length&&(x.order.splice(1,0,"CLASS"),x.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},
|
|
a=null))})();n.contains=B.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:B.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};n.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var A=function(a,b,c){var d,e=[],f="";for(b=b.nodeType?[b]:b;d=x.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(x.match.PSEUDO,"");a=x.relative[a]?a+"*":a;d=0;for(var g=b.length;d<g;d++)n(a,
|
|
b[d],e,c);return n.filter(f,e)};n.attr=q.attr;n.selectors.attrMap={};q.find=n;q.expr=n.selectors;q.expr[":"]=q.expr.filters;q.unique=n.uniqueSort;q.text=n.getText;q.isXMLDoc=n.isXML;q.contains=n.contains})();var Qa=/Until$/,Va=/^(?:parents|prevUntil|prevAll)/,Ia=/,/,Ua=/^.[^:#\[\.,]*$/,Ja=Array.prototype.slice,Ra=q.expr.match.globalPOS,fa={children:!0,contents:!0,next:!0,prev:!0};q.fn.extend({find:function(a){var b=this,c,d;if("string"!==typeof a)return q(a).filter(function(){c=0;for(d=b.length;c<
|
|
d;c++)if(q.contains(b[c],this))return!0});var e=this.pushStack("","find",a),f,g,h;c=0;for(d=this.length;c<d;c++)if(f=e.length,q.find(a,this[c],e),0<c)for(g=f;g<e.length;g++)for(h=0;h<f;h++)if(e[h]===e[g]){e.splice(g--,1);break}return e},has:function(a){var b=q(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(q.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(l(this,a,!1),"not",a)},filter:function(a){return this.pushStack(l(this,a,!0),"filter",a)},is:function(a){return!!a&&
|
|
("string"===typeof a?Ra.test(a)?0<=q(a,this.context).index(this[0]):0<q.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){var c=[],d,e,f=this[0];if(q.isArray(a)){for(e=1;f&&f.ownerDocument&&f!==b;){for(d=0;d<a.length;d++)q(f).is(a[d])&&c.push({selector:a[d],elem:f,level:e});f=f.parentNode;e++}return c}var g=Ra.test(a)||"string"!==typeof a?q(a,b||this.context):0;d=0;for(e=this.length;d<e;d++)for(f=this[d];f;)if(g?-1<g.index(f):q.find.matchesSelector(f,a)){c.push(f);break}else if(f=
|
|
f.parentNode,!f||!f.ownerDocument||f===b||11===f.nodeType)break;c=1<c.length?q.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return a?"string"===typeof a?q.inArray(this[0],q(a)):q.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"===typeof a?q(a,b):q.makeArray(a&&a.nodeType?[a]:a),d=q.merge(this.get(),c);return this.pushStack(k(c[0])||k(d[0])?d:q.unique(d))},andSelf:function(){return this.add(this.prevObject)}});
|
|
q.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return q.dir(a,"parentNode")},parentsUntil:function(a,b,c){return q.dir(a,"parentNode",c)},next:function(a){return q.nth(a,2,"nextSibling")},prev:function(a){return q.nth(a,2,"previousSibling")},nextAll:function(a){return q.dir(a,"nextSibling")},prevAll:function(a){return q.dir(a,"previousSibling")},nextUntil:function(a,b,c){return q.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return q.dir(a,"previousSibling",
|
|
c)},siblings:function(a){return q.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return q.sibling(a.firstChild)},contents:function(a){return q.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:q.makeArray(a.childNodes)}},function(a,b){q.fn[a]=function(c,d){var e=q.map(this,b,c);Qa.test(a)||(d=c);d&&"string"===typeof d&&(e=q.filter(d,e));e=1<this.length&&!fa[a]?q.unique(e):e;(1<this.length||Ia.test(d))&&Va.test(a)&&(e=e.reverse());return this.pushStack(e,a,Ja.call(arguments).join(","))}});
|
|
q.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return 1===b.length?q.find.matchesSelector(b[0],a)?[b[0]]:[]:q.find.matches(a,b)},dir:function(a,c,d){var e=[];for(a=a[c];a&&9!==a.nodeType&&(d===b||1!==a.nodeType||!q(a).is(d));)1===a.nodeType&&e.push(a),a=a[c];return e},nth:function(a,b,c,d){b=b||1;for(d=0;a&&(1!==a.nodeType||++d!==b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var Pa="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
|
ca=/ jQuery\d+="(?:\d+|null)"/g,Ka=/^\s+/,Wa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,Xa=/<tbody/i,Ca=/<|&#?\w+;/,ua=/<(?:script|style)/i,Sa=/<(?:script|object|embed|option|style)/i,Da=new RegExp("<(?:"+Pa+")[\\s/>]","i"),ra=/checked\s*(?:[^=]|=\s*.checked.)/i,Ea=/\/(java|ecma)script/i,La=/^\s*<!(?:\[CDATA\[|\-\-)/,da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>",
|
|
"</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},H=m(B);da.optgroup=da.option;da.tbody=da.tfoot=da.colgroup=da.caption=da.thead;da.th=da.td;q.support.htmlSerialize||(da._default=[1,"div<div>","</div>"]);q.fn.extend({text:function(a){return q.access(this,function(a){return a===b?q.text(this):this.empty().append((this[0]&&this[0].ownerDocument||B).createTextNode(a))},
|
|
null,a,arguments.length)},wrapAll:function(a){if(q.isFunction(a))return this.each(function(b){q(this).wrapAll(a.call(this,b))});if(this[0]){var b=q(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return q.isFunction(a)?this.each(function(b){q(this).wrapInner(a.call(this,b))}):this.each(function(){var b=q(this),c=b.contents();
|
|
c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=q.isFunction(a);return this.each(function(c){q(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){q.nodeName(this,"body")||q(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){1===this.nodeType&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&
|
|
this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=q.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,q.clean(arguments));return a}},remove:function(a,
|
|
b){for(var c=0,d;null!=(d=this[c]);c++)if(!a||q.filter(a,[d]).length)b||1!==d.nodeType||(q.cleanData(d.getElementsByTagName("*")),q.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;null!=(b=this[a]);a++)for(1===b.nodeType&&q.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a,b){a=null==a?!1:a;b=null==b?a:b;return this.map(function(){return q.clone(this,a,b)})},html:function(a){return q.access(this,
|
|
function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(ca,""):null;if(!("string"!==typeof a||ua.test(a)||!q.support.leadingWhitespace&&Ka.test(a)||da[(Ba.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Wa,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},1===c.nodeType&&(q.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(q.isFunction(a))return this.each(function(b){var c=
|
|
q(this),d=c.html();c.replaceWith(a.call(this,b,d))});"string"!==typeof a&&(a=q(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;q(this).remove();b?q(b).before(a):q(c).append(a)})}return this.length?this.pushStack(q(q.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,f,g,h=a[0],k=[];if(!q.support.checkClone&&3===arguments.length&&"string"===typeof h&&ra.test(h))return this.each(function(){q(this).domManip(a,
|
|
c,d,!0)});if(q.isFunction(h))return this.each(function(e){var f=q(this);a[0]=h.call(this,e,c?f.html():b);f.domManip(a,c,d)});if(this[0]){e=h&&h.parentNode;e=q.support.parentNode&&e&&11===e.nodeType&&e.childNodes.length===this.length?{fragment:e}:q.buildFragment(a,this,k);g=e.fragment;if(f=1===g.childNodes.length?g=g.firstChild:g.firstChild){c=c&&q.nodeName(f,"tr");for(var l=0,m=this.length,p=m-1;l<m;l++)d.call(c?n(this[l],f):this[l],e.cacheable||1<m&&l<p?q.clone(g,!0,!0):g)}k.length&&q.each(k,function(a,
|
|
b){b.src?q.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):q.globalEval((b.text||b.textContent||b.innerHTML||"").replace(La,"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)})}return this}});q.buildFragment=function(a,b,c){var d,e,f,g,h=a[0];b&&b[0]&&(g=b[0].ownerDocument||b[0]);g.createDocumentFragment||(g=B);!(1===a.length&&"string"===typeof h&&512>h.length&&g===B&&"<"===h.charAt(0))||Sa.test(h)||!q.support.checkClone&&ra.test(h)||!q.support.html5Clone&&Da.test(h)||(e=!0,(f=
|
|
q.fragments[h])&&1!==f&&(d=f));d||(d=g.createDocumentFragment(),q.clean(a,g,d,c));e&&(q.fragments[h]=f?d:1);return{fragment:d,cacheable:e}};q.fragments={};q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){q.fn[a]=function(c){var d=[];c=q(c);var e=1===this.length&&this[0].parentNode;if(e&&11===e.nodeType&&1===e.childNodes.length&&1===c.length)return c[b](this[0]),this;for(var e=0,f=c.length;e<f;e++){var g=(0<e?this.clone(!0):
|
|
this).get();q(c[e])[b](g);d=d.concat(g)}return this.pushStack(d,a,c.selector)}});q.extend({clone:function(a,b,c){var d,e,f;q.support.html5Clone||q.isXMLDoc(a)||!Da.test("<"+a.nodeName+">")?d=a.cloneNode(!0):(d=B.createElement("div"),H.appendChild(d),d.innerHTML=a.outerHTML,d=d.firstChild);var g=d;if(!(q.support.noCloneEvent&&q.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||q.isXMLDoc(a)))for(r(a,g),d=t(a),e=t(g),f=0;d[f];++f)e[f]&&r(d[f],e[f]);if(b&&(p(a,g),c))for(d=t(a),e=t(g),f=0;d[f];++f)p(d[f],
|
|
e[f]);return g},clean:function(a,b,c,d){var e,f=[];b=b||B;"undefined"===typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||B);for(var g=0,h;null!=(h=a[g]);g++)if("number"===typeof h&&(h+=""),h){if("string"===typeof h)if(Ca.test(h)){h=h.replace(Wa,"<$1></$2>");e=(Ba.exec(h)||["",""])[1].toLowerCase();var k=da[e]||da._default,l=k[0],n=b.createElement("div"),p=H.childNodes;b===B?H.appendChild(n):m(b).appendChild(n);for(n.innerHTML=k[1]+h+k[2];l--;)n=n.lastChild;if(!q.support.tbody)for(l=
|
|
Xa.test(h),k="table"!==e||l?"<table>"!==k[1]||l?[]:n.childNodes:n.firstChild&&n.firstChild.childNodes,e=k.length-1;0<=e;--e)q.nodeName(k[e],"tbody")&&!k[e].childNodes.length&&k[e].parentNode.removeChild(k[e]);!q.support.leadingWhitespace&&Ka.test(h)&&n.insertBefore(b.createTextNode(Ka.exec(h)[0]),n.firstChild);h=n.childNodes;n&&(n.parentNode.removeChild(n),0<p.length&&(n=p[p.length-1])&&n.parentNode&&n.parentNode.removeChild(n))}else h=b.createTextNode(h);var r;if(!q.support.appendChecked)if(h[0]&&
|
|
"number"===typeof(r=h.length))for(e=0;e<r;e++)w(h[e]);else w(h);h.nodeType?f.push(h):f=q.merge(f,h)}if(c)for(a=function(a){return!a.type||Ea.test(a.type)},g=0;f[g];g++)b=f[g],d&&q.nodeName(b,"script")&&(!b.type||Ea.test(b.type))?d.push(b.parentNode?b.parentNode.removeChild(b):b):(1===b.nodeType&&(h=q.grep(b.getElementsByTagName("script"),a),f.splice.apply(f,[g+1,0].concat(h))),c.appendChild(b));return f},cleanData:function(a){for(var b,c,d=q.cache,e=q.event.special,f=q.support.deleteExpando,g=0,h;null!=
|
|
(h=a[g]);g++)if(!h.nodeName||!q.noData[h.nodeName.toLowerCase()])if(c=h[q.expando]){if((b=d[c])&&b.events){for(var k in b.events)e[k]?q.event.remove(h,k):q.removeEvent(h,k,b.handle);b.handle&&(b.handle.elem=null)}f?delete h[q.expando]:h.removeAttribute&&h.removeAttribute(q.expando);delete d[c]}}});var Fa=/alpha\([^)]*\)/i,Y=/opacity=([^)]*)/,Ma=/([A-Z]|^ms)/g,va=/^[\-+]?(?:\d*\.)?\d+$/i,ma=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Na=/^([\-+])=([\-+.\de]+)/,Ya=/^margin/,wa={position:"absolute",visibility:"hidden",
|
|
display:"block"},ha=["Top","Right","Bottom","Left"],pa,Ga,la;q.fn.css=function(a,c){return q.access(this,function(a,c,d){return d!==b?q.style(a,c,d):q.css(a,c)},a,c,1<arguments.length)};q.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=pa(a,"opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":q.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&
|
|
3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g=q.camelCase(c),h=a.style,k=q.cssHooks[g];c=q.cssProps[g]||g;if(d!==b){if(e=typeof d,"string"===e&&(f=Na.exec(d))&&(d=+(f[1]+1)*+f[2]+parseFloat(q.css(a,c)),e="number"),!(null==d||"number"===e&&isNaN(d)||("number"!==e||q.cssNumber[g]||(d+="px"),k&&"set"in k&&(d=k.set(a,d))===b)))try{h[c]=d}catch(l){}}else return k&&"get"in k&&(f=k.get(a,!1,e))!==b?f:h[c]}},css:function(a,c,d){var e,f;c=q.camelCase(c);f=q.cssHooks[c];c=q.cssProps[c]||c;"cssFloat"===c&&
|
|
(c="float");if(f&&"get"in f&&(e=f.get(a,!0,d))!==b)return e;if(pa)return pa(a,c)},swap:function(a,b,c){var d={},e;for(e in b)d[e]=a.style[e],a.style[e]=b[e];c=c.call(a);for(e in b)a.style[e]=d[e];return c}});q.curCSS=q.css;B.defaultView&&B.defaultView.getComputedStyle&&(Ga=function(a,b){var c,d,e,f=a.style;b=b.replace(Ma,"-$1").toLowerCase();(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""!==c||q.contains(a.ownerDocument.documentElement,a)||(c=q.style(a,
|
|
b)));!q.support.pixelMargin&&e&&Ya.test(b)&&ma.test(c)&&(d=f.width,f.width=c,c=e.width,f.width=d);return c});B.documentElement.currentStyle&&(la=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;null==e&&f&&(c=f[b])&&(e=c);if(ma.test(e)){c=f.left;if(d=a.runtimeStyle&&a.runtimeStyle.left)a.runtimeStyle.left=a.currentStyle.left;f.left="fontSize"===b?"1em":e;e=f.pixelLeft+"px";f.left=c;d&&(a.runtimeStyle.left=d)}return""===e?"auto":e});pa=Ga||la;q.each(["height","width"],function(a,
|
|
b){q.cssHooks[b]={get:function(a,c,d){if(c)return 0!==a.offsetWidth?u(a,b,d):q.swap(a,wa,function(){return u(a,b,d)})},set:function(a,b){return va.test(b)?b+"px":b}}});q.support.opacity||(q.cssHooks.opacity={get:function(a,b){return Y.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=q.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(1<=b&&""===q.trim(f.replace(Fa,
|
|
""))&&(c.removeAttribute("filter"),d&&!d.filter))return;c.filter=Fa.test(f)?f.replace(Fa,e):f+" "+e}});q(function(){q.support.reliableMarginRight||(q.cssHooks.marginRight={get:function(a,b){return q.swap(a,{display:"inline-block"},function(){return b?pa(a,"margin-right"):a.style.marginRight})}})});q.expr&&q.expr.filters&&(q.expr.filters.hidden=function(a){var b=a.offsetHeight;return 0===a.offsetWidth&&0===b||!q.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||q.css(a,"display"))},
|
|
q.expr.filters.visible=function(a){return!q.expr.filters.hidden(a)});q.each({margin:"",padding:"",border:"Width"},function(a,b){q.cssHooks[a+b]={expand:function(c){var d="string"===typeof c?c.split(" "):[c],e={};for(c=0;4>c;c++)e[a+ha[c]+b]=d[c]||d[c-2]||d[0];return e}}});var Oa=/%20/g,ia=/\[\]$/,xa=/\r?\n/g,gb=/#.*$/,sa=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Z=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ya=/^(?:GET|HEAD)$/,za=/^\/\//,
|
|
lb=/\?/,hb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,mb=/^(?:select|textarea)/i,fb=/\s+/,ib=/([?&])_=[^&]*/,db=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Za=q.fn.load,bb={},nb={},$a,ab,sb=["*/"]+["*"];try{$a=O.href}catch(Ab){$a=B.createElement("a"),$a.href="",$a=$a.href}ab=db.exec($a.toLowerCase())||[];q.fn.extend({load:function(a,c,d){if("string"!==typeof a&&Za)return Za.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(0<=e){var f=a.slice(e,a.length);a=
|
|
a.slice(0,e)}e="GET";c&&(q.isFunction(c)?(d=c,c=b):"object"===typeof c&&(c=q.param(c,q.ajaxSettings.traditional),e="POST"));var g=this;q.ajax({url:a,type:e,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText;a.isResolved()&&(a.done(function(a){c=a}),g.html(f?q("<div>").append(c.replace(hb,"")).find(f):c));d&&g.each(d,[c,b,a])}});return this},serialize:function(){return q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?q.makeArray(this.elements):
|
|
this}).filter(function(){return this.name&&!this.disabled&&(this.checked||mb.test(this.nodeName)||Z.test(this.type))}).map(function(a,b){var c=q(this).val();return null==c?null:q.isArray(c)?q.map(c,function(a,c){return{name:b.name,value:a.replace(xa,"\r\n")}}):{name:b.name,value:c.replace(xa,"\r\n")}}).get()}});q.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){q.fn[b]=function(a){return this.on(b,a)}});q.each(["get","post"],function(a,c){q[c]=function(a,
|
|
d,e,f){q.isFunction(d)&&(f=f||e,e=d,d=b);return q.ajax({type:c,url:a,data:d,success:e,dataType:f})}});q.extend({getScript:function(a,c){return q.get(a,b,c,"script")},getJSON:function(a,b,c){return q.get(a,b,c,"json")},ajaxSetup:function(a,b){b?A(a,q.ajaxSettings):(b=a,a=q.ajaxSettings);A(a,b);return a},ajaxSettings:{url:$a,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ab[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,
|
|
async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":sb},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":q.parseJSON,"text xml":q.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:x(bb),ajaxTransport:x(nb),ajax:function(a,c){function d(a,c,n,p){if(2!==y){y=2;u&&clearTimeout(u);t=b;r=p||"";A.readyState=0<a?4:
|
|
0;var x,C,J;p=c;if(n){var v=e,sa=A,ia=v.contents,D=v.dataTypes,B=v.responseFields,z,Z,F,O;for(Z in B)Z in n&&(sa[B[Z]]=n[Z]);for(;"*"===D[0];)D.shift(),z===b&&(z=v.mimeType||sa.getResponseHeader("content-type"));if(z)for(Z in ia)if(ia[Z]&&ia[Z].test(z)){D.unshift(Z);break}if(D[0]in n)F=D[0];else{for(Z in n){if(!D[0]||v.converters[Z+" "+D[0]]){F=Z;break}O||(O=Z)}F=F||O}F?(F!==D[0]&&D.unshift(F),n=n[F]):n=void 0}else n=b;if(200<=a&&300>a||304===a){if(e.ifModified){if(z=A.getResponseHeader("Last-Modified"))q.lastModified[m]=
|
|
z;if(z=A.getResponseHeader("Etag"))q.etag[m]=z}if(304===a)p="notmodified",x=!0;else try{z=e;z.dataFilter&&(n=z.dataFilter(n,z.dataType));var E=z.dataTypes;Z={};var ya,K,xa=E.length,T,I=E[0],za,Q,Ta,M,R;for(ya=1;ya<xa;ya++){if(1===ya)for(K in z.converters)"string"===typeof K&&(Z[K.toLowerCase()]=z.converters[K]);za=I;I=E[ya];if("*"===I)I=za;else if("*"!==za&&za!==I){Q=za+" "+I;Ta=Z[Q]||Z["* "+I];if(!Ta)for(M in R=b,Z)if(T=M.split(" "),T[0]===za||"*"===T[0])if(R=Z[T[1]+" "+I]){M=Z[M];!0===M?Ta=R:!0===
|
|
R&&(Ta=M);break}Ta||R||q.error("No conversion from "+Q.replace(" "," to "));!0!==Ta&&(n=Ta?Ta(n):R(M(n)))}}C=n;p="success";x=!0}catch(S){p="parsererror",J=S}}else if(J=p,!p||a)p="error",0>a&&(a=0);A.status=a;A.statusText=""+(c||p);x?h.resolveWith(f,[C,p,A]):h.rejectWith(f,[A,p,J]);A.statusCode(l);l=b;w&&g.trigger("ajax"+(x?"Success":"Error"),[A,e,x?C:J]);k.fireWith(f,[A,p]);w&&(g.trigger("ajaxComplete",[A,e]),--q.active||q.event.trigger("ajaxStop"))}}"object"===typeof a&&(c=a,a=b);c=c||{};var e=q.ajaxSetup({},
|
|
c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof q)?q(f):q.event,h=q.Deferred(),k=q.Callbacks("once memory"),l=e.statusCode||{},m,n={},p={},r,x,t,u,J,y=0,w,v,A={readyState:0,setRequestHeader:function(a,b){if(!y){var c=a.toLowerCase();a=p[c]=p[c]||a;n[a]=b}return this},getAllResponseHeaders:function(){return 2===y?r:null},getResponseHeader:function(a){var c;if(2===y){if(!x)for(x={};c=sa.exec(r);)x[c[1].toLowerCase()]=c[2];c=x[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){y||
|
|
(e.mimeType=a);return this},abort:function(a){a=a||"abort";t&&t.abort(a);d(0,a);return this}};h.promise(A);A.success=A.done;A.error=A.fail;A.complete=k.add;A.statusCode=function(a){if(a){var b;if(2>y)for(b in a)l[b]=[l[b],a[b]];else b=a[A.status],A.then(b,b)}return this};e.url=((a||e.url)+"").replace(gb,"").replace(za,ab[1]+"//");e.dataTypes=q.trim(e.dataType||"*").toLowerCase().split(fb);null==e.crossDomain&&(J=db.exec(e.url.toLowerCase()),e.crossDomain=!(!J||J[1]==ab[1]&&J[2]==ab[2]&&(J[3]||("http:"===
|
|
J[1]?80:443))==(ab[3]||("http:"===ab[1]?80:443))));e.data&&e.processData&&"string"!==typeof e.data&&(e.data=q.param(e.data,e.traditional));C(bb,e,c,A);if(2===y)return!1;w=e.global;e.type=e.type.toUpperCase();e.hasContent=!ya.test(e.type);w&&0===q.active++&&q.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=(lb.test(e.url)?"&":"?")+e.data,delete e.data),m=e.url,!1===e.cache)){J=q.now();var ia=e.url.replace(ib,"$1_="+J);e.url=ia+(ia===e.url?(lb.test(e.url)?"&":"?")+"_="+J:"")}(e.data&&
|
|
e.hasContent&&!1!==e.contentType||c.contentType)&&A.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(m=m||e.url,q.lastModified[m]&&A.setRequestHeader("If-Modified-Since",q.lastModified[m]),q.etag[m]&&A.setRequestHeader("If-None-Match",q.etag[m]));A.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+sb+"; q=0.01":""):e.accepts["*"]);for(v in e.headers)A.setRequestHeader(v,e.headers[v]);if(e.beforeSend&&(!1===e.beforeSend.call(f,
|
|
A,e)||2===y))return A.abort(),!1;for(v in{success:1,error:1,complete:1})A[v](e[v]);if(t=C(nb,e,c,A)){A.readyState=1;w&&g.trigger("ajaxSend",[A,e]);e.async&&0<e.timeout&&(u=setTimeout(function(){A.abort("timeout")},e.timeout));try{y=1,t.send(n,d)}catch(D){if(2>y)d(-1,D);else throw D;}}else d(-1,"No Transport");return A},param:function(a,c){var d=[],e=function(a,b){b=q.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=q.ajaxSettings.traditional);if(q.isArray(a)||
|
|
a.jquery&&!q.isPlainObject(a))q.each(a,function(){e(this.name,this.value)});else for(var f in a)y(f,a[f],c,e);return d.join("&").replace(Oa,"+")}});q.extend({active:0,lastModified:{},etag:{}});var vb=q.now(),ob=/(\=)\?(&|$)|\?\?/i;q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return q.expando+"_"+vb++}});q.ajaxPrefilter("json jsonp",function(b,c,d){c="string"===typeof b.data&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if("jsonp"===b.dataTypes[0]||!1!==b.jsonp&&(ob.test(b.url)||
|
|
c&&ob.test(b.data))){var e,f=b.jsonpCallback=q.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,g=a[f],h=b.url,k=b.data,l="$1"+f+"$2";!1!==b.jsonp&&(h=h.replace(ob,l),b.url===h&&(c&&(k=k.replace(ob,l)),b.data===k&&(h+=(/\?/.test(h)?"&":"?")+b.jsonp+"="+f)));b.url=h;b.data=k;a[f]=function(a){e=[a]};d.always(function(){a[f]=g;if(e&&q.isFunction(g))a[f](e[0])});b.converters["script json"]=function(){e||q.error(f+" was not called");return e[0]};b.dataTypes[0]="json";return"script"}});q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
|
|
contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){q.globalEval(a);return a}}});q.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1);a.crossDomain&&(a.type="GET",a.global=!1)});q.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=B.head||B.getElementsByTagName("head")[0]||B.documentElement;return{send:function(e,f){c=B.createElement("script");c.async="async";a.scriptCharset&&(c.charset=a.scriptCharset);c.src=a.url;c.onload=c.onreadystatechange=function(a,
|
|
e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success")};d.insertBefore(c,d.firstChild)},abort:function(){if(c)c.onload(0,1)}}}});var rb=a.ActiveXObject?function(){for(var a in eb)eb[a](0,1)}:!1,wb=0,eb;q.ajaxSettings.xhr=a.ActiveXObject?function(){var b;if(!(b=!this.isLocal&&D()))a:{try{b=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}b=void 0}return b}:D;(function(a){q.extend(q.support,
|
|
{ajax:!!a,cors:!!a&&"withCredentials"in a})})(q.ajaxSettings.xhr());q.support.ajax&&q.ajaxTransport(function(c){if(!c.crossDomain||q.support.cors){var d;return{send:function(e,f){var g=c.xhr(),h,k;c.username?g.open(c.type,c.url,c.async,c.username,c.password):g.open(c.type,c.url,c.async);if(c.xhrFields)for(k in c.xhrFields)g[k]=c.xhrFields[k];c.mimeType&&g.overrideMimeType&&g.overrideMimeType(c.mimeType);c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(k in e)g.setRequestHeader(k,
|
|
e[k])}catch(l){}g.send(c.hasContent&&c.data||null);d=function(a,e){var k,l,m,n,p;try{if(d&&(e||4===g.readyState))if(d=b,h&&(g.onreadystatechange=q.noop,rb&&delete eb[h]),e)4!==g.readyState&&g.abort();else{k=g.status;m=g.getAllResponseHeaders();n={};(p=g.responseXML)&&p.documentElement&&(n.xml=p);try{n.text=g.responseText}catch(r){}try{l=g.statusText}catch(x){l=""}k||!c.isLocal||c.crossDomain?1223===k&&(k=204):k=n.text?200:404}}catch(t){e||f(-1,t)}n&&f(k,l,n,m)};c.async&&4!==g.readyState?(h=++wb,rb&&
|
|
(eb||(eb={},q(a).unload(rb)),eb[h]=d),g.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var qb={},Ha,cb,xb=/^(?:toggle|show|hide)$/,yb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,pb,kb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],jb;q.fn.extend({show:function(a,b,c){if(a||0===a)return this.animate(F("show",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=a.style.display,q._data(a,
|
|
"olddisplay")||"none"!==b||(b=a.style.display=""),(""===b&&"none"===q.css(a,"display")||!q.contains(a.ownerDocument.documentElement,a))&&q._data(a,"olddisplay",K(a.nodeName)));for(c=0;c<d;c++)if(a=this[c],a.style&&(b=a.style.display,""===b||"none"===b))a.style.display=q._data(a,"olddisplay")||"";return this},hide:function(a,b,c){if(a||0===a)return this.animate(F("hide",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=q.css(a,"display"),"none"===b||q._data(a,"olddisplay")||q._data(a,
|
|
"olddisplay",b));for(c=0;c<d;c++)this[c].style&&(this[c].style.display="none");return this},_toggle:q.fn.toggle,toggle:function(a,b,c){var d="boolean"===typeof a;q.isFunction(a)&&q.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:q(this).is(":hidden");q(this)[b?"show":"hide"]()}):this.animate(F("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,
|
|
b,c,d){function e(){!1===f.queue&&q._mark(this);var b=q.extend({},f),c=1===this.nodeType,d=c&&q(this).is(":hidden"),g,h,k,l,m;b.animatedProperties={};for(k in a)if(g=q.camelCase(k),k!==g&&(a[g]=a[k],delete a[k]),(h=q.cssHooks[g])&&"expand"in h)for(k in l=h.expand(a[g]),delete a[g],l)k in a||(a[k]=l[k]);for(g in a){h=a[g];q.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if("hide"===h&&d||"show"===h&&!d)return b.complete.call(this);
|
|
!c||"height"!==g&&"width"!==g||(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===q.css(this,"display")&&"none"===q.css(this,"float")&&(q.support.inlineBlockNeedsLayout&&"inline"!==K(this.nodeName)?this.style.zoom=1:this.style.display="inline-block"))}null!=b.overflow&&(this.style.overflow="hidden");for(k in a)if(c=new q.fx(this,b,k),h=a[k],xb.test(h))if(g=q._data(this,"toggle"+k)||("toggle"===h?d?"show":"hide":0))q._data(this,"toggle"+k,"show"===g?"hide":"show"),
|
|
c[g]();else c[h]();else g=yb.exec(h),l=c.cur(),g?(h=parseFloat(g[2]),m=g[3]||(q.cssNumber[k]?"":"px"),"px"!==m&&(q.style(this,k,(h||1)+m),l*=(h||1)/c.cur(),q.style(this,k,l+m)),g[1]&&(h=("-="===g[1]?-1:1)*h+l),c.custom(l,h,m)):c.custom(l,h,"");return!0}var f=q.speed(b,c,d);if(q.isEmptyObject(a))return this.each(f.complete,[!1]);a=q.extend({},a);return!1===f.queue?this.each(e):this.queue(f.queue,e)},stop:function(a,c,d){"string"!==typeof a&&(d=c,c=a,a=b);c&&!1!==a&&this.queue(a||"fx",[]);return this.each(function(){var b,
|
|
c=!1,e=q.timers,f=q._data(this);d||q._unmark(!0,this);if(null==a)for(b in f){if(f[b]&&f[b].stop&&b.indexOf(".run")===b.length-4){var g=f[b];q.removeData(this,b,!0);g.stop(d)}}else f[b=a+".run"]&&f[b].stop&&(f=f[b],q.removeData(this,b,!0),f.stop(d));for(b=e.length;b--;)if(e[b].elem===this&&(null==a||e[b].queue===a)){if(d)e[b](!0);else e[b].saveState();c=!0;e.splice(b,1)}d&&c||q.dequeue(this,a)})}});q.each({slideDown:F("show",1),slideUp:F("hide",1),slideToggle:F("toggle",1),fadeIn:{opacity:"show"},
|
|
fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){q.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}});q.extend({speed:function(a,b,c){var d=a&&"object"===typeof a?q.extend({},a):{complete:c||!c&&b||q.isFunction(a)&&a,duration:a,easing:c&&b||b&&!q.isFunction(b)&&b};d.duration=q.fx.off?0:"number"===typeof d.duration?d.duration:d.duration in q.fx.speeds?q.fx.speeds[d.duration]:q.fx.speeds._default;if(null==d.queue||!0===d.queue)d.queue="fx";d.old=d.complete;d.complete=function(a){q.isFunction(d.old)&&
|
|
d.old.call(this);d.queue?q.dequeue(this,d.queue):!1!==a&&q._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});q.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(q.fx.step[this.prop]||q.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];
|
|
var a,b=q.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?b&&"auto"!==b?b:0:a},custom:function(a,c,d){function e(a){return f.step(a)}var f=this,g=q.fx;this.startTime=jb||E();this.end=c;this.now=this.start=a;this.pos=this.state=0;this.unit=d||this.unit||(q.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=function(){q._data(f.elem,"fxshow"+f.prop)===b&&(f.options.hide?q._data(f.elem,"fxshow"+f.prop,f.start):f.options.show&&q._data(f.elem,"fxshow"+f.prop,f.end))};
|
|
e()&&q.timers.push(e)&&!pb&&(pb=setInterval(g.tick,g.interval))},show:function(){var a=q._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||q.style(this.elem,this.prop);this.options.show=!0;a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur());q(this.elem).show()},hide:function(){this.options.orig[this.prop]=q._data(this.elem,"fxshow"+this.prop)||q.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b,
|
|
c=jb||E(),d=!0,e=this.elem,f=this.options;if(a||c>=f.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();f.animatedProperties[this.prop]=!0;for(b in f.animatedProperties)!0!==f.animatedProperties[b]&&(d=!1);if(d){null==f.overflow||q.support.shrinkWrapBlocks||q.each(["","X","Y"],function(a,b){e.style["overflow"+b]=f.overflow[a]});f.hide&&q(e).hide();if(f.hide||f.show)for(b in f.animatedProperties)q.style(e,b,f.orig[b]),q.removeData(e,"fxshow"+b,!0),q.removeData(e,"toggle"+
|
|
b,!0);if(a=f.complete)f.complete=!1,a.call(e)}return!1}Infinity==f.duration?this.now=c:(a=c-this.startTime,this.state=a/f.duration,this.pos=q.easing[f.animatedProperties[this.prop]](this.state,a,0,1,f.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};q.extend(q.fx,{tick:function(){for(var a,b=q.timers,c=0;c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||q.fx.stop()},interval:13,stop:function(){clearInterval(pb);pb=null},speeds:{slow:600,fast:200,
|
|
_default:400},step:{opacity:function(a){q.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&null!=a.elem.style[a.prop]?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}});q.each(kb.concat.apply([],kb),function(a,b){b.indexOf("margin")&&(q.fx.step[b]=function(a){q.style(a.elem,b,Math.max(0,a.now)+a.unit)})});q.expr&&q.expr.filters&&(q.expr.filters.animated=function(a){return q.grep(q.timers,function(b){return a===b.elem}).length});var tb,zb=/^t(?:able|d|h)$/i,ub=/^(?:body|html)$/i;
|
|
tb="getBoundingClientRect"in B.documentElement?function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!q.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};a=b.body;b=Q(b);return{top:d.top+(b.pageYOffset||q.support.boxModel&&c.scrollTop||a.scrollTop)-(c.clientTop||a.clientTop||0),left:d.left+(b.pageXOffset||q.support.boxModel&&c.scrollLeft||a.scrollLeft)-(c.clientLeft||a.clientLeft||0)}}:function(a,b,c){var d,e=a.offsetParent,f=b.body;d=(b=b.defaultView)?b.getComputedStyle(a,
|
|
null):a.currentStyle;for(var g=a.offsetTop,h=a.offsetLeft;(a=a.parentNode)&&a!==f&&a!==c&&(!q.support.fixedPosition||"fixed"!==d.position);)d=b?b.getComputedStyle(a,null):a.currentStyle,g-=a.scrollTop,h-=a.scrollLeft,a===e&&(g+=a.offsetTop,h+=a.offsetLeft,!q.support.doesNotAddBorder||q.support.doesAddBorderForTableAndCells&&zb.test(a.nodeName)||(g+=parseFloat(d.borderTopWidth)||0,h+=parseFloat(d.borderLeftWidth)||0),e=a.offsetParent),q.support.subtractsBorderForOverflowNotVisible&&"visible"!==d.overflow&&
|
|
(g+=parseFloat(d.borderTopWidth)||0,h+=parseFloat(d.borderLeftWidth)||0);if("relative"===d.position||"static"===d.position)g+=f.offsetTop,h+=f.offsetLeft;q.support.fixedPosition&&"fixed"===d.position&&(g+=Math.max(c.scrollTop,f.scrollTop),h+=Math.max(c.scrollLeft,f.scrollLeft));return{top:g,left:h}};q.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){q.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;return d?c===d.body?q.offset.bodyOffset(c):tb(c,d,
|
|
d.documentElement):null};q.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;q.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(q.css(a,"marginTop"))||0,c+=parseFloat(q.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=q.css(a,"position");"static"===d&&(a.style.position="relative");var e=q(a),f=e.offset(),g=q.css(a,"top"),h=q.css(a,"left"),k={},l={};("absolute"===d||"fixed"===d)&&-1<q.inArray("auto",[g,h])?(l=e.position(),d=l.top,h=l.left):(d=parseFloat(g)||
|
|
0,h=parseFloat(h)||0);q.isFunction(b)&&(b=b.call(a,c,f));null!=b.top&&(k.top=b.top-f.top+d);null!=b.left&&(k.left=b.left-f.left+h);"using"in b?b.using.call(a,k):e.css(k)}};q.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ub.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(q.css(a,"marginTop"))||0;c.left-=parseFloat(q.css(a,"marginLeft"))||0;d.top+=parseFloat(q.css(b[0],"borderTopWidth"))||0;d.left+=parseFloat(q.css(b[0],
|
|
"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||B.body;a&&!ub.test(a.nodeName)&&"static"===q.css(a,"position");)a=a.offsetParent;return a})}});q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);q.fn[a]=function(e){return q.access(this,function(a,e,f){var g=Q(a);if(f===b)return g?c in g?g[c]:q.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:a[e];
|
|
g?g.scrollTo(d?q(g).scrollLeft():f,d?f:q(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}});q.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,f="offset"+a;q.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(q.css(a,c,"padding")):this[c]():null};q.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(q.css(b,c,a?"margin":"border")):this[c]():null};q.fn[c]=function(a){return q.access(this,function(a,c,g){if(q.isWindow(a))return c=a.document,
|
|
a=c.documentElement[d],q.support.boxModel&&a||c.body&&c.body[d]||a;if(9===a.nodeType)return c=a.documentElement,c[d]>=c[e]?c[d]:Math.max(a.body[e],c[e],a.body[f],c[f]);if(g===b)return a=q.css(a,c),c=parseFloat(a),q.isNumeric(c)?c:a;q(a).css(c,g)},c,a,arguments.length,null)}});a.jQuery=a.$=q;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return q})})(window);jQuery.cookie=function(a,b,c){if(1<arguments.length&&"[object Object]"!==String(b)){c=jQuery.extend({},c);if(null===b||void 0===b)c.expires=-1;if("number"===typeof c.expires){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};e=c.raw?function(a){return a}:
|
|
decodeURIComponent;return(d=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?e(d[1]):null};(function(a){function b(b){var c=b||window.event,d=[].slice.call(arguments,1),h=0,k=0,l=0;b=a.event.fix(c);b.type="mousewheel";c.wheelDelta&&(h=c.wheelDelta/120);c.detail&&(h=-c.detail/3);l=h;void 0!==c.axis&&c.axis===c.HORIZONTAL_AXIS&&(l=0,k=-1*h);void 0!==c.wheelDeltaY&&(l=c.wheelDeltaY/120);void 0!==c.wheelDeltaX&&(k=-1*c.wheelDeltaX/120);d.unshift(b,h,k,l);return(a.event.dispatch||a.event.handle).apply(this,d)}var c=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var d=c.length;d;)a.event.fixHooks[c[--d]]=
|
|
a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],b,!1);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);(function(a){a.fn.pixelSnap=function(){a(this).each(function(){var b=a(this);if(this.getBoundingClientRect){var c=this.getBoundingClientRect();if(.01>c.left%1||.99<c.left%1)if(.01>c.top%1||.99<c.top%1)return;var c=Math.round(parseFloat(b.css("margin-left")))||0,d=Math.round(parseFloat(b.css("margin-top")))||0;b.css({"margin-left":c+"px","margin-top":d+"px"});var e=this.getBoundingClientRect(),f=-e.left%1;0<f&&--f;-.5>f&&(f+=1);e=-e.top%1;0<e&&--e;-.5>e&&(e+=1);b.css({"margin-left":c+f+"px","margin-top":d+
|
|
e+"px"})}});return this}})(jQuery);(function(a,b){function c(){this._state=[];this._defaults={classHolder:"sbHolder",classHolderDisabled:"sbHolderDisabled",classHolderOpen:"sbHolderOpen",classSelector:"sbSelector",classOptions:"sbOptions",classGroup:"sbGroup",classSub:"sbSub",classDisabled:"sbDisabled",classToggleOpen:"sbToggleOpen",classToggle:"sbToggle",speed:200,slidesUp:!1,effect:"slide",onChange:null,onOpen:null,onClose:null}}a.extend(c.prototype,{_isOpenSelectbox:function(a){return a?this._getInst(a).isOpen:!1},_isDisabledSelectbox:function(a){return a?
|
|
this._getInst(a).isDisabled:!1},_attachSelectbox:function(c,e){function f(){var b,c=this.attr("id").split("_")[1];for(b in l._state)b!==c&&l._state.hasOwnProperty(b)&&a(":input[sb='"+b+"']")[0]&&l._closeSelectbox(a(":input[sb='"+b+"']")[0])}function g(b){k.children().each(function(e){if(a(this).is(":selected")){if(38==b&&0<e)return e=a(k.children()[e-1]),l._changeSelectbox(c,e.val(),e.text()),!1;if(40==b&&e<k.children().length-1)return e=a(k.children()[e+1]),l._changeSelectbox(c,e.val(),e.text()),
|
|
!1}})}function h(e,f){var g=f&&f.sub?!0:!1,h=f&&f.disabled?!0:!1;e.each(function(e){var f=a(this),k=a("<li>"),n;f.is(":selected")&&(p.text(f.text()),v=!0);e===u-1&&k.addClass("last");(function(){var e=f.text(),p=f.data("custom-option-text"),p=p!==b?p:e;f.is(":disabled")||h?n=a("<span>",{text:p}).addClass(m.settings.classDisabled):(n=a("<a>",{href:"#"+f.val(),rel:f.val(),text:p,"class":"filter",click:function(b){b.preventDefault();b=r;b.attr("id").split("_");l._closeSelectbox(c);l._changeSelectbox(c,
|
|
a(this).attr("rel"),e);b.focus()}}),f.is(":selected")&&n.addClass("active"));g&&n.addClass(m.settings.classSub);n.appendTo(k)})();k.addClass(f.attr("class"));k.appendTo(t)})}if(this._getInst(c))return!1;var k=a(c),l=this,m=l._newInst(k),n,p,r,t,v=!1;k.find("optgroup");var w=k.find("option"),u=w.length;k.attr("sb",m.uid);a.extend(m.settings,l._defaults,e);l._state[m.uid]=!1;k.hide();n=a("<div>",{id:"sbHolder_"+m.uid,"class":m.settings.classHolder});var x=k.data("selectbox-css");x&&n.css(x);p=a("<a>",
|
|
{id:"sbSelector_"+m.uid,href:"#","class":m.settings.classSelector,click:function(b){b.preventDefault();b.stopPropagation();f.apply(a(this),[]);b=a(this).attr("id").split("_")[1];l._state[b]?l._closeSelectbox(c):(l._openSelectbox(c),r.focus())},keyup:function(a){g(a.keyCode)}});r=a("<a>",{id:"sbToggle_"+m.uid,href:"#","class":m.settings.classToggle,click:function(b){b.preventDefault();b.stopPropagation();f.apply(a(this),[]);b=a(this).attr("id").split("_")[1];l._state[b]?l._closeSelectbox(c):(l._openSelectbox(c),
|
|
r.focus())},keyup:function(a){g(a.keyCode)}});r.appendTo(n);t=a("<ul>",{id:"sbOptions_"+m.uid,"class":m.settings.classOptions,css:{display:"none"}});k.children().each(function(b){b=a(this);var c,d={};b.is("option")?h(b):b.is("optgroup")&&(c=a("<li>"),a("<span>",{text:b.attr("label")}).addClass(m.settings.classGroup).appendTo(c),c.appendTo(t),b.is(":disabled")&&(d.disabled=!0),d.sub=!0,h(b.find("option"),d))});v||p.text(w.first().text());a.data(c,"selectbox",m);p.appendTo(n);t.appendTo(n);n.insertAfter(k);
|
|
k.is(":disabled")&&a.selectbox._disableSelectbox(c);k.change(function(){var b=a(this).val(),e=k.find("option[value='"+b+"']").text();l._changeSelectbox(c,b,e)})},_detachSelectbox:function(b){var c=this._getInst(b);if(!c)return!1;a("#sbHolder_"+c.uid).remove();delete this._state[c.uid];a.data(b,"selectbox",null);a(b).show()},_changeSelectbox:function(b,c,f){var g=this._getInst(b),h=this._get(g,"onChange");a("#sbSelector_"+g.uid).text()===f&&a("#sbOptions_"+g.uid).find('a[rel="'+c+'"]').hasClass("active")||
|
|
(a("#sbSelector_"+g.uid).text(f),a("#sbOptions_"+g.uid).find(".active").removeClass("active"),a("#sbOptions_"+g.uid).find('a[rel="'+c+'"]').addClass("active"),a(b).find("option").attr("selected",!1),a(b).find("option[value='"+c+"']").attr("selected",!0),h?h.apply(g.input?g.input[0]:null,[c,g]):g.input&&g.input.trigger("change"))},_enableSelectbox:function(b){var c=this._getInst(b);if(!c||!c.isDisabled)return!1;a("#sbHolder_"+c.uid).removeClass(c.settings.classHolderDisabled);c.isDisabled=!1;a.data(b,
|
|
"selectbox",c)},_disableSelectbox:function(b){var c=this._getInst(b);if(!c||c.isDisabled)return!1;a("#sbHolder_"+c.uid).addClass(c.settings.classHolderDisabled);c.isDisabled=!0;a.data(b,"selectbox",c)},_optionSelectbox:function(b,c,f){var g=this._getInst(b);if(!g)return!1;g[c]=f;a.data(b,"selectbox",g)},_openSelectbox:function(b){var c=this._getInst(b),f=this;if(c&&!c.isOpen&&!c.isDisabled){var g=a("#sbOptions_"+c.uid),h=parseInt(a(window).height(),10),k=parseInt(a(window).width(),10),l=a("#sbHolder_"+
|
|
c.uid).offset(),m=a(window).scrollTop(),n=g.prev().height(),h=h-(l.top-m)-n/2,p=this._get(c,"onOpen");50<h&&!c.settings.slidesUp?g.css({bottom:"auto",top:n+2+"px",maxHeight:h-n+"px"}):g.css({top:"auto",bottom:n+2+"px",maxHeight:l.top-m-n/2+"px"});l.left+g.width()>k?g.css("left","-"+(g.width()-g.parent().width()+3)+"px"):g.css("left","-1px");"fade"===c.settings.effect?g.fadeIn(c.settings.speed):g.slideDown(c.settings.speed);a("#sbToggle_"+c.uid).addClass(c.settings.classToggleOpen);a("#sbHolder_"+
|
|
c.uid).addClass(c.settings.classHolderOpen);this._state[c.uid]=!0;c.isOpen=!0;p&&p.apply(c.input?c.input[0]:null,[c]);a.data(b,"selectbox",c);a("html").unbind("click.sbClose").one("click.sbClose",function(){f._closeSelectbox(b)})}},_closeSelectbox:function(b){var c=this._getInst(b);if(c&&c.isOpen){var f=this._get(c,"onClose");a("#sbOptions_"+c.uid).hide();a("#sbToggle_"+c.uid).removeClass(c.settings.classToggleOpen);a("#sbHolder_"+c.uid).removeClass(c.settings.classHolderOpen);this._state[c.uid]=
|
|
!1;c.isOpen=!1;f&&f.apply(c.input?c.input[0]:null,[c]);a.data(b,"selectbox",c);a("html").unbind("click.sbClose")}},_newInst:function(a){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,uid:Math.floor(99999999*Math.random()),isOpen:!1,isDisabled:!1,settings:{}}},_getInst:function(b){try{return a.data(b,"selectbox")}catch(c){throw"Missing instance data for this selectbox";}},_get:function(a,c){return a.settings[c]!==b?a.settings[c]:this._defaults[c]}});a.fn.selectbox=function(b){var c=
|
|
Array.prototype.slice.call(arguments,1);return"string"==typeof b&&"isDisabled"==b||"option"==b&&2==arguments.length&&"string"==typeof arguments[1]?a.selectbox["_"+b+"Selectbox"].apply(a.selectbox,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.selectbox["_"+b+"Selectbox"].apply(a.selectbox,[this].concat(c)):a.selectbox._attachSelectbox(this,b)})};a.selectbox=new c;a.selectbox.version="0.1.3"})(jQuery);(function(a,b){var c="fontFamily fontSize fontWeight fontStyle letterSpacing textTransform wordSpacing".split(" "),d=a('<textarea style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden">')[0];d.setAttribute("oninput","return");a.isFunction(d.oninput)||"onpropertychange"in d?a.fn.autosize=function(b){return this.each(function(){function d(){var a,b;n||(n=!0,k.value=g.value,
|
|
k.style.overflowY=g.style.overflowY,k.style.width=h.css("width"),k.style.textIndent=h.css("text-indent"),k.scrollTop=0,k.scrollTop=9E4,a=k.scrollTop,b="hidden",a>m?(a=m,b="scroll"):a<l&&(a=l),g.style.overflowY=b,g.style.height=g.style.minHeight=g.style.maxHeight=a+r+"px",setTimeout(function(){n=!1},1));h.trigger("autosizeComplete")}for(var g=this,h=a(g).css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),k=a('<textarea style="position:absolute; top:-9999px; left:-9999px; right:auto; bottom:auto; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden">').addClass(b||
|
|
"autosizejs")[0],l=h.height(),m=parseInt(h.css("maxHeight"),10),n,p=c.length,r="border-box"===h.css("box-sizing")?h.outerHeight()-h.height():0,m=m&&0<m?m:9E4;p--;)k.style[c[p]]=h.css(c[p]);a("body").append(k);"onpropertychange"in g?"oninput"in g?g.oninput=g.onkeyup=d:g.onpropertychange=d:g.oninput=d;a(window).resize(d);h.bind("autosize",d);d()})}:a.fn.autosize=function(){return this}})(jQuery);var Modernizr=window.Modernizr=function(a,b,c){function d(a,b){return typeof a===b}function e(a,b){for(var d in a){var e=a[d];if(!~(""+e).indexOf("-")&&l[e]!==c)return"pfx"==b?e:!0}return!1}function f(a,b,f){var g=a.charAt(0).toUpperCase()+a.slice(1),h=(a+" "+n.join(g+" ")+g).split(" ");if(d(b,"string")||d(b,"undefined"))b=e(h,b);else a:{h=(a+" "+p.join(g+" ")+g).split(" "),a=h;for(var k in a)if(g=b[a[k]],g!==c){b=!1===f?a[k]:d(g,"function")?g.bind(f||b):g;break a}b=!1}return b}var g={},h=b.documentElement,
|
|
k=b.createElement("modernizr"),l=k.style,m=" -webkit- -moz- -o- -ms- ".split(" "),n=["Webkit","Moz","O","ms"],p=["webkit","moz","o","ms"],k={},r=[],t=r.slice,v,w=function(a,c,d,e){var f,g,k,l,m=b.createElement("div"),n=b.body,p=n||b.createElement("body");if(parseInt(d,10))for(;d--;)k=b.createElement("div"),k.id=e?e[d]:"modernizr"+(d+1),m.appendChild(k);return f=['­<style id="smodernizr">',a,"</style>"].join(""),m.id="modernizr",(n?m:p).innerHTML+=f,p.appendChild(m),n||(p.style.background="",
|
|
p.style.overflow="hidden",l=h.style.overflow,h.style.overflow="hidden",h.appendChild(p)),g=c(m,a),n?m.parentNode.removeChild(m):(p.parentNode.removeChild(p),h.style.overflow=l),!!g},u=function(){var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return function(e,f){f=f||b.createElement(a[e]||"div");e="on"+e;var g=e in f;return g||(f.setAttribute||(f=b.createElement("div")),f.setAttribute&&f.removeAttribute&&(f.setAttribute(e,""),g=d(f[e],"function"),
|
|
d(f[e],"undefined")||(f[e]=c),f.removeAttribute(e))),g}}(),x={}.hasOwnProperty,C;d(x,"undefined")||d(x.call,"undefined")?C=function(a,b){return b in a&&d(a.constructor.prototype[b],"undefined")}:C=function(a,b){return x.call(a,b)};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=t.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var e=new e,f=b.apply(e,c.concat(t.call(arguments)));
|
|
return Object(f)===f?f:e}return b.apply(a,c.concat(t.call(arguments)))};return d});k.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")};k.canvastext=function(){return!!g.canvas&&!!d(b.createElement("canvas").getContext("2d").fillText,"function")};k.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),"modernizr){#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=
|
|
9===a.offsetTop}),c};k.history=function(){return!!a.history&&!!history.pushState};k.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a};k.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a};k.multiplebgs=function(){l.cssText="background:url(https://),url(https://),red url(https://)";return/(url\s*\(.*?){3}/.test(l.background)};k.csscolumns=function(){return f("columnCount")};k.csstransitions=function(){return f("transition")};k.localstorage=
|
|
function(){try{return localStorage.setItem("modernizr","modernizr"),localStorage.removeItem("modernizr"),!0}catch(a){return!1}};for(var A in k)C(k,A)&&(v=A.toLowerCase(),g[v]=k[A](),r.push((g[v]?"":"no-")+v));g.addTest=function(a,b){if("object"==typeof a)for(var d in a)C(a,d)&&g.addTest(d,a[d]);else{a=a.toLowerCase();if(g[a]!==c)return g;b="function"==typeof b?b():b;h.className+=" feature-"+(b?"":"no-")+a;g[a]=b}return g};l.cssText="";return k=null,g._version="2.7.1",g._prefixes=m,g._domPrefixes=
|
|
p,g._cssomPrefixes=n,g.hasEvent=u,g.testProp=function(a){return e([a])},g.testAllProps=f,g.testStyles=w,h.className=h.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(" feature-js feature-"+r.join(" feature-")),g}(this,this.document);Modernizr.touch=Modernizr.touch&&"onorientationchange"in window;
|
|
Modernizr.addTest("pointerevents",function(){var a=document.createElement("x"),b=document.documentElement,c=window.getComputedStyle,d=!1;if(!("pointerEvents"in a.style))return!1;a.style.pointerEvents="auto";a.style.pointerEvents="x";b.appendChild(a);c&&(d=(c=c(a,""))?"auto"===c.pointerEvents:!1);b.removeChild(a);return!!d});(function(a){function b(a,b,c){a/=255;b/=255;c/=255;var d=Math.max(a,b,c),e=Math.min(a,b,c),f,g=d-e;if(d==e)f=0;else{switch(d){case a:f=(b-c)/g+(b<c?6:0);break;case b:f=(c-a)/g+2;break;case c:f=(a-b)/g+4}f/=6}return[f,0==d?0:g/d,d]}function c(a,b,c){var d,e,f,g=Math.floor(6*a),h=6*a-g;a=c*(1-b);var k=c*(1-h*b);b=c*(1-(1-h)*b);switch(g%6){case 0:d=c;e=b;f=a;break;case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c,e=a,f=k}return[255*d,255*
|
|
e,255*f]}function d(a){a=a.replace(/^(?:[\da-f]{3}){1,2}$/i,"#$&");a=a.replace(/^#([\da-f])([\da-f])([\da-f])$/i,"#$1$1$2$2$3$3");return a=a.replace(/^\s*RGB\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\s*$/,function(a,b,c,d){return f(b,c,d)})}function e(a){a.replace(/^#([\da-f])([\da-f])([\da-f])$/i,"#$1$1$2$2$3$3");a=/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(a)||[null,0,0,0];return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}function f(a,b,c){2 in arguments||(c=a[2],b=a[1],a=a[0]);
|
|
return("#@0"+(~~a).toString(16)+"@0"+(~~b).toString(16)+"@0"+(~~c).toString(16)).replace(/@0?([\da-f]{2})/gi,"$1")}function g(a){a&&(a.join||(a=a?(""+a).split(","):[]),l=a)}function h(m){function n(b){var c=!1;b=b.toLowerCase();a.each(l,function(a,d){if(d.toLowerCase()==b)return c=!0,!1});if(c)return!1;l=[b].concat(l.slice(0,k-1));return!0}function p(b){r.call(this,b);a(this).removeData("tvcolorpicker").removeData("tvcolorpicker-custom-color");x()}function r(b){var c=a(this);c.val(b);c.change();b?
|
|
c.trigger("pick-color",b):c.trigger("pick-transparent");t.call(this,b)}function t(b){a(this).css({backgroundColor:b,color:b})}function v(c,d){var f=this,g=a(f).val().toLowerCase(),h=document.createElement("table"),l=document.createElement("tbody");h.appendChild(l);var m,n=0;a.each(c,function(c,h){n++;0==c%k&&(m=a("<tr></tr>").appendTo(l));var r=a('<td class="tvcolorpicker-cell"></td>').appendTo(m),r=a('<div class="tvcolorpicker-swatch"></div>').appendTo(r);d&&d.addClass&&r.addClass(d.addClass);if(h){h=
|
|
h.toLowerCase();g==h&&r.addClass("active");r.css({backgroundColor:h}).data("color",h);r.bind("click",function(){p.call(f,h)});var x=b.apply(this,e(h));.9<(1-x[1])*x[2]&&r.addClass("low-contrast")}});a(h).addClass("tvcolorpicker-table");return n?h:a()}function w(b,c,d){var e=a(b).offset();a(document).scrollLeft();var f=a(document).scrollTop(),g=a(b).outerWidth(),h=a(b).outerHeight();b=a(window).width();var k=a(window).height(),l=a(c).outerWidth(),m=a(c).outerHeight();switch(d.direction){default:case "down":d=
|
|
{top:e.top+h+d.offset,left:e.left+d.drift};break;case "right":d={top:e.top+d.drift,left:e.left+g+d.offset}}d.top+m>k+f&&(d.top=k-m+f);e.left+l>b&&(d.left=b-l);d.left+="px";d.top+="px";c.css(d)}function u(d){function g(a){var b=a.originalEvent,d=a.offsetX||a.layerX||b&&(b.offsetX||b.layerX)||0;a=a.offsetY||a.layerY||b&&(b.offsetY||b.layerY)||0;T.css({left:d+"px",top:a+"px"});U[0]=d/W;U[1]=1-a/N;M.css({backgroundColor:f(c(U[0],U[1],1))});n()}function h(b){1==b.which&&(V=!1,x.is(".opened")&&a(p).get(0).focus(),
|
|
a(document).unbind("mouseup",h))}function k(a){var b=a.originalEvent;a=a.offsetY||a.layerY||b&&(b.offsetY||b.layerY)||0;S.css({top:a+"px"});U[2]=1-a/N;n()}function m(b){1==b.which&&(R=!1,a(document).unbind("mouseup",m),x.is(".opened")&&a(p).get(0).focus())}function n(){aa&&(aa=!1,x.find(".tvcolorpicker-swatch.active").removeClass("active"));var a=f(c(U[0],U[1],U[2]));p.val().toUpperCase()!=a.toUpperCase()&&(p.data("tvcolorpicker-custom-color",a),r.call(p,a))}var p=a(this),x=a('<div class="tvcolorpicker-popup opened">'),
|
|
u=a('<div class="tvcolorpicker-swatches-area"></div>').appendTo(x);u.append(v.call(this,"#000000 #424242 #656565 #989898 #b6b6b6 #cbcbcb #d8d8d8 #eeeeee #f2f2f2 #ffffff".split(" ")));u.append(v.call(this,"#970000 #ff0000 #ff9800 #ffff00 #00ff00 #00ffff #4985e7 #0000ff #9800ff #ff00ff".split(" ")));u.append(v.call(this,"#e6b8af #f4cccc #fce5cd #fff2cc #d9ead3 #d0e0e3 #c9daf8 #cfe2f3 #d9d2e9 #ead1dc #dd7e6b #ea9999 #f9cb9c #ffe599 #b6d7a8 #a2c4c9 #a4c2f4 #9fc5e8 #b4a7d6 #d5a6bd #cc4125 #e06666 #f6b26b #ffd966 #93c47d #76a5af #6d9eeb #6fa8dc #8e7cc3 #c27ba0 #a61c00 #cc0000 #e69138 #f1c232 #6aa84f #45818e #3c78d8 #3d85c6 #674ea7 #a64d79 #85200c #990000 #b45f06 #bf9000 #38761d #134f5c #1155cc #0b5394 #351c75 #741b47 #5b0f00 #660000 #783f04 #7f6000 #274e13 #0c343d #1c4587 #073763 #20124d #4c1130".split(" ")));
|
|
var t=a('<div class="tvcolorpicker-custom-area"></div>').css({display:"none"}).appendTo(x),C=a('<div class="tvcolorpicker-hsv"></div>').appendTo(t),q=a('<div class="tvcolorpicker-hs"></div>').appendTo(C),T=a('<div class="tvcolorpicker-hs-handle"></div>').appendTo(q),I=a('<div class="tvcolorpicker-hs-area"></div>').appendTo(q),M=a('<div class="tvcolorpicker-v"></div>').appendTo(C),S=a('<div class="tvcolorpicker-v-handle"></div>').appendTo(M),C=a('<div class="tvcolorpicker-v-area"></div>').appendTo(M),
|
|
N=q.height(),W=q.width(),V=!1,R=!1,aa=!0,U=[0,0,.5];I.bind("mousedown",function(b){1==b.which&&(V=!0,a(document).bind("mouseup",h),g(b),b.preventDefault())});I.bind("mousemove",function(a){V&&(g(a),a.preventDefault())});C.bind("mousedown",function(b){1==b.which&&(R=!0,a(document).bind("mouseup",m),k(b),b.preventDefault())});C.bind("mousemove",function(a){R&&(k(a),a.preventDefault())});a('<a class="tvcolorpicker-custom-button tv-button">'+a.t("Custom color...")+"</a>").appendTo(x).bind("click",function(){var d=
|
|
a(this).is(".active");d||t.css({minWidth:u.width()+"px",minHeight:u.height()+"px"});a(this)[d?"removeClass":"addClass"]("active");t.css({display:d?"none":"block"});u.css({display:d?"block":"none"});d?p.removeData("tvcolorpicker-custom-color"):(N=q.height(),W=q.width(),d=e(p.val()),U=b.apply(this,d),T.css({left:~~(U[0]*W)+"px",top:~~((1-U[1])*N)+"px"}),S.css({top:~~((1-U[2])*N)+"px"}),M.css({backgroundColor:f(c(U[0],U[1],1))}))});x.append(a(v.call(this,l,{addClass:"tvcolorpicker-user"})).addClass("tvcolorpicker-user-swatches"));
|
|
a(document.body).append(x);w(p,x,d);return x}function x(){a(".tvcolorpicker-popup").removeClass("opened").remove();a(C).data("tvcolorpicker",null);a(C).each(function(){var b=a(this).data("tvcolorpicker-custom-color");b&&(n(b)&&a(this).trigger("customcolorchange",[l]),a(this).data("tvcolorpicker-custom-color",null));(b=a(this).data("tvcolorpicker-previous-color"))&&b!=a(this).val()&&a(this).trigger("change");a(this).removeData("tvcolorpicker-previous-color")})}m=a.extend({},h.options,m||{});var C=
|
|
this;m&&"customColors"in m&&g(m.customColors);return this.each(function(){function b(){var a=d(c.val());t.call(c,a)}var c=a(this);c.val(d(c.val()));var e=null,f=!1;c.addClass("tvcolorpicker-widget").attr("autocomplete","off").attr("readonly",!0);var g=function(){c.data("tvcolorpicker")||(e=u.call(c,m),c.data("tvcolorpicker-custom-color",null),c.data("tvcolorpicker",e),c.data("tvcolorpicker-previous-color",c.val()),e.bind("mousedown click",function(b){a(b.target).parents().andSelf().is(e)&&(c.focus(),
|
|
f=!0,setTimeout(function(){f=!1},0))}))};c.on("touchstart",g);c.focus(g);c.blur(function(a){f?a.stopPropagation():x.call(c)});c.change(function(a){b()});b()})}if(!a)throw Error("This program cannot be run in DOS mode");h.setCustomColors=g;a.fn.tvcolorpicker=h;var k=10,l=[];h.options={direction:"down",offset:0,drift:0}})(window.jQuery);var Mustache="undefined"!==typeof module&&module.exports||{};
|
|
(function(a){function b(a){return String(a).replace(/&(?!\w+;)|[<>"']/g,function(a){return C[a]||a})}function c(a,b,c,d){d=d||"<template>";for(var e=b.split("\n"),f=Math.max(c-3,0),g=Math.min(e.length,c+3),e=e.slice(f,g),h=0,k=e.length;h<k;++h)g=h+f+1,e[h]=(g===c?" >> ":" ")+e[h];a.template=b;a.line=c;a.file=d;a.message=[d+":"+c,e.join("\n"),"",a.message].join("\n");return a}function d(a,b,c){if("."===a)return b[b.length-1];a=a.split(".");for(var d=a.length-1,e=a[d],f,g,h=b.length,k,l;h;){l=b.slice(0);
|
|
g=b[--h];for(k=0;k<d;){g=g[a[k++]];if(null==g)break;l.push(g)}if(g&&e in g){f=g[e];break}}"function"===typeof f&&(f=f.call(l[l.length-1]));return null==f?c:f}function e(a,b,c,e){var f="";a=d(a,b);if(e){if(null==a||!1===a||r(a)&&0===a.length)f+=c()}else if(r(a))t(a,function(a){b.push(a);f+=c();b.pop()});else if("object"===typeof a)b.push(a),f+=c(),b.pop();else if("function"===typeof a)var g=b[b.length-1],f=f+(a.call(g,c(),function(a){return k(a,g)})||"");else a&&(f+=c());return f}function f(b,d){d=
|
|
d||{};for(var e=d.tags||a.tags,f=e[0],g=e[e.length-1],h=['var buffer = "";',"\nvar line = 1;","\ntry {",'\nbuffer += "'],k=[],l=!1,m=!1,n=function(){if(!l||m||d.space)k=[];else for(;k.length;)h.splice(k.pop(),1);m=l=!1},p=[],r,x,u,t=function(a){e=w(a).split(/\s+/);x=e[0];u=e[e.length-1]},C=function(a){h.push('";',r,'\nvar partial = partials["'+w(a)+'"];',"\nif (partial) {","\n buffer += render(partial,stack[stack.length - 1],partials);","\n}",'\nbuffer += "')},A=function(a,e){var f=w(a);if(""===
|
|
f)throw c(Error("Section name may not be empty"),b,L,d.file);p.push({name:f,inverted:e});h.push('";',r,'\nvar name = "'+f+'";',"\nvar callback = (function () {","\n return function () {",'\n var buffer = "";','\nbuffer += "')},V=function(a){A(a,!0)},R=function(a){a=w(a);var e=0!=p.length&&p[p.length-1].name;if(!e||a!=e)throw c(Error('Section named "'+a+'" was never opened'),b,L,d.file);a=p.pop();h.push('";',"\n return buffer;","\n };","\n})();");a.inverted?h.push("\nbuffer += renderSection(name,stack,callback,true);"):
|
|
h.push("\nbuffer += renderSection(name,stack,callback);");h.push('\nbuffer += "')},aa=function(a){h.push('";',r,'\nbuffer += lookup("'+w(a)+'",stack,"");','\nbuffer += "')},U=function(a){h.push('";',r,'\nbuffer += escapeHTML(lookup("'+w(a)+'",stack,""));','\nbuffer += "')},L=1,X,G,P=0,ta=b.length;P<ta;++P)if(b.slice(P,P+f.length)===f){P+=f.length;X=b.substr(P,1);r="\nline = "+L+";";x=f;u=g;l=!0;switch(X){case "!":P++;G=null;break;case "=":P++;g="="+g;G=t;break;case ">":P++;G=C;break;case "#":P++;
|
|
G=A;break;case "^":P++;G=V;break;case "/":P++;G=R;break;case "{":g="}"+g;case "&":P++;m=!0;G=aa;break;default:m=!0,G=U}X=b.indexOf(g,P);if(-1===X)throw c(Error('Tag "'+f+'" was not closed properly'),b,L,d.file);f=b.substring(P,X);G&&G(f);for(G=0;~(G=f.indexOf("\n",G));)L++,G++;P=X+g.length-1;f=x;g=u}else switch(X=b.substr(P,1),X){case '"':case "\\":m=!0;h.push("\\"+X);break;case "\r":break;case "\n":k.push(h.length);h.push("\\n");n();L++;break;default:v.test(X)?k.push(h.length):m=!0,h.push(X)}if(0!=
|
|
p.length)throw c(Error('Section "'+p[p.length-1].name+'" was not closed properly'),b,L,d.file);n();h.push('";',"\nreturn buffer;","\n} catch (e) { throw {error: e, line: line}; }");g=h.join("").replace(/buffer \+= "";\n/g,"");d.debug&&("undefined"!=typeof console&&console.log?console.log(g):"function"===typeof print&&print(g));return g}function g(a,g){var h=f(a,g),l=new Function("view,partials,stack,lookup,escapeHTML,renderSection,render",h);return function(f,h){h=h||{};var m=[f];try{return l(f,h,
|
|
m,d,b,e,k)}catch(n){throw c(n.error,a,n.line,g.file);}}}function h(a,b){b=b||{};return!1!==b.cache?(A[a]||(A[a]=g(a,b)),A[a]):g(a,b)}function k(a,b,c){return h(a)(b,c)}a.name="mustache.js";a.version="0.5.0-dev";a.tags=["{{","}}"];a.parse=f;a.compile=h;a.render=k;a.clearCache=function(){A={}};a.to_html=function(a,b,c,d){a=k(a,b,c);if("function"===typeof d)d(a);else return a};var l=Object.prototype.toString,m=Array.isArray,n=Array.prototype.forEach,p=String.prototype.trim,r;r=m?m:function(a){return"[object Array]"===
|
|
l.call(a)};var t;t=n?function(a,b,c){return n.call(a,b,c)}:function(a,b,c){for(var d=0,e=a.length;d<e;++d)b.call(c,a[d],d,a)};var v=/^\s*$/,w;if(p)w=function(a){return null==a?"":p.call(a)};else{var u,x;v.test("\u00a0")?(u=/^\s+/,x=/\s+$/):(u=/^[\s\xA0]+/,x=/[\s\xA0]+$/);w=function(a){return null==a?"":String(a).replace(u,"").replace(x,"")}}var C={"&":"&","<":"<",">":">",'"':""","'":"'"},A={}})(Mustache);Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)});Array.prototype.forEach||(Array.prototype.forEach=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!==typeof a)throw new TypeError;for(var d=2<=arguments.length?arguments[1]:void 0,e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)});
|
|
Array.prototype.map||(Array.prototype.map=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!==typeof a)throw new TypeError;for(var d=Array(c),e=2<=arguments.length?arguments[1]:void 0,f=0;f<c;f++)f in b&&(d[f]=a.call(e,b[f],f,b));return d});Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c="toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor".split(" "),d=c.length;return function(e){if("object"!==typeof e&&"function"!==typeof e||null===e)throw new TypeError("Object.keys called on non-object");var f=[],g;for(g in e)a.call(e,g)&&f.push(g);if(b)for(g=0;g<d;g++)a.call(e,c[g])&&f.push(c[g]);return f}}());(function(a){var b=["","webkit","moz","o","ms"],c=0;(function(c,e){var f;a:{var g;for(f in b){g=b[f];var h;h=c;h=h[0].toUpperCase()+h.slice(1);g+=h;g=g[0].toLowerCase()+g.slice(1);if(a[g]){f=g;break a}}f=!1}a[c]=f?a[f]:e})("requestAnimationFrame",function(a){setTimeout(a,16);return c++})})(this);(function(){var a,b,c,d,e,f;window.parent!==window&&window.CanvasRenderingContext2D&&window.TextMetrics&&(b=window.CanvasRenderingContext2D.prototype)&&b.hasOwnProperty("font")&&b.hasOwnProperty("mozTextStyle")&&"function"===typeof b.__lookupSetter__&&(c=b.__lookupSetter__("font"))&&(b.__defineSetter__("font",function(a){try{return c.call(this,a)}catch(b){if("NS_ERROR_FAILURE"!==b.name)throw b;}}),d=b.measureText,a=function(){this.width=0;this.isFake=!0;this.__proto__=window.TextMetrics.prototype},
|
|
b.measureText=function(b){try{return d.apply(this,arguments)}catch(c){if("NS_ERROR_FAILURE"!==c.name)throw c;return new a}},e=b.fillText,b.fillText=function(a,b,c,d){try{e.apply(this,arguments)}catch(f){if("NS_ERROR_FAILURE"!==f.name)throw f;}},f=b.strokeText,b.strokeText=function(a,b,c,d){try{f.apply(this,arguments)}catch(e){if("NS_ERROR_FAILURE"!==e.name)throw e;}})})();eval(function(a,b,c,d,e,f){e=function(a){return(a<b?"":e(parseInt(a/b)))+(35<(a%=b)?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){for(;c--;)f[e(c)]=d[c]||e(c);d=[function(a){return f[a]}];e=function(){return"\\w+"};c=1}for(;c--;)d[c]&&(a=a.replace(new RegExp("\\b"+e(c)+"\\b","g"),d[c]));return a}("h.i['1a']=h.i['z'];h.O(h.i,{y:'D',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});",
|
|
62,74," return Math function if var PI jQuery easing pow 75 70158 else sin sqrt 5625 asin undefined easeOutBounce abs def swing easeInBounce 525 cos easeOutQuad easeOutBack easeInBack easeInSine easeOutElastic easeInOutQuint easeOutQuint easeInQuint easeInOutQuart easeOutQuart easeInQuart extend easeInElastic easeInOutCirc easeInOutCubic easeOutCirc easeInOutElastic easeOutCubic easeInCirc easeInOutExpo easeInCubic easeOutExpo easeInExpo 9375 easeInOutSine easeInOutQuad 25 easeOutSine easeInOutBack easeInQuad 625 984375 jswing easeInOutBounce".split(" "),
|
|
0,{}));(function(a){var b=a(window),c=a(document),d=function(d){d=jQuery.data(d.target);b.scrollTop()>c.height()-b.innerHeight()-(d.tolerance||190)&&a(this).trigger("scrolltoend")};a.event.special.scrolltoend={setup:function(b,c){a(this).bind("scroll.scrolltoend",d)},teardown:function(b){a(this).unbind("scroll.scrolltoend",d)}};jQuery.event.special.scrollto={bindType:"scroll",handle:function(a){var d=a.handleObj;a.scrollData||(a.scrollData={scrollTop:b.scrollTop()});var g=null;if("number"===typeof a.data.to)g=
|
|
a.scrollData.scrollTop>a.data.to-(a.data.tolerance||0)?!0:!1;else if("bottom"===a.data.to)a.scrollData.bottomOffset||(a.scrollData.bottomOffset=c.height()-b.innerHeight()),g=a.scrollData.scrollTop>a.scrollData.bottomOffset-(a.data.tolerance||0)?!0:!1;else throw Error('Special event scrollto: property "to" has unexpected value');var h=Array.prototype.slice.apply(arguments);if(g)return h.push(!0),d.handler.apply(this,h);if(a.data.twoway)return h.push(!1),d.handler.apply(this,h)}}})(jQuery);jQuery.fn.timeUpdate=function(){return this.each(function(){var a=jQuery(this).data("timestamp"),a=a?1E3*a:1E3*jQuery(this).text();TradingView.agoDateFormatter(jQuery(this),new Date(a));jQuery(this).removeClass("time-upd")})};(function(a){function b(a,b,c){for(var d=0;d<m.length;d++)m[d]||(b=b.toLowerCase()),a.addEventListener(m[d]+b,c,!1)}function c(a){a.stop(!0);a.css("background-color","");a.removeData("flicker-enable");a.removeData("flicker-options")}function d(b){var d=b.data("flicker-enable");d&&(!0!==d?(d--,d?(e(b),b.data("flicker-enable",d)):(d=b.data("flicker-options").complete,c(b),d&&a.isFunction(d)&&d())):e(b))}function e(a){var b=a.css("background-color"),c=a.data("flicker-options"),e=c.duration||400,f=c.easing||
|
|
"swing";a.animate({"background-color":c.highlightColor||"#fbf8e9"},e,f).animate({"background-color":b},e,f,d.bind(a,a))}var f=!1,g=document.body||document.documentElement,h="animation",k=["Webkit","Moz","O","ms","Khtml"],l="";void 0!==g.style.animationName&&(f=!0);if(!1===f)for(l=0;l<k.length;l++)if(void 0!==g.style[k[l]+"AnimationName"]){l=k[l];h=l+"Animation";l.toLowerCase();f=!0;break}var m=["webkit","moz","MS","o",""];a.fn.highlight=function(d,g){switch(d){default:d=void 0===d?!0:d;this.each(function(){if(f)d=
|
|
!0===d?"infinite":d,b(this,"AnimationEnd",function(){this.style[h]=""}),this.style[h]="highlight-animation 0.4s ease-in-out "+d+" alternate";else{var c=a(this);c.data("flicker-enable",d);c.data("flicker-options",a.extend({},g||{}));c.is(":animated")||e(c)}});break;case !1:this.each(function(){f?this.style[h]="":c(a(this))})}}})(jQuery);(function(a){var b,c;"undefined"!==typeof document.hidden?(b="hidden",c="visibilitychange"):"undefined"!==typeof document.mozHidden?(b="mozHidden",c="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(b="msHidden",c="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(b="webkitHidden",c="webkitvisibilitychange");a.tabvisible=!0;c&&(a(document).on(c,function(c){a.tabvisible=!document[b];a(window).trigger("visibilitychange",!document[b])}),a(document).trigger(c));a.whenTabVisible=
|
|
function(b){if(!c||a.tabvisible)b();else a(window).one("visibilitychange",b)}})(jQuery);!function(a){function b(e,f,g,h,k){var l=e.contents(),m=!1;e.empty();for(var n=0,p=l.length;p>n&&!m;n++){var D=l[n],E=a(D);"undefined"!=typeof D&&(e.append(E),k&&e[e.is("table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style")?"after":"append"](k),3==D.nodeType?d(g,h)&&(m=c(E,f,g,h,k)):m=b(E,f,g,h,k),m||k&&k.detach())}return m}function c(a,b,f,k,l){var m=!1,n=a[0];if("undefined"==typeof n)return!1;for(var p=h(n),
|
|
y=-1!==p.indexOf(" ")?" ":"\u3000",y="letter"==k.wrap?"":y,p=p.split(y),D=-1,E=-1,z=0,F=p.length-1;F>=z;){var K=Math.floor((z+F)/2);if(K==E)break;E=K;g(n,p.slice(0,E+1).join(y)+k.ellipsis);d(f,k)?F=E:(D=E,z=E);F==z&&0==F&&k.fallbackToLetter&&(y="",p=p[0].split(y),D=-1,E=-1,z=0,F=p.length-1)}-1==D||1==p.length&&0==p[0].length?(y=a.parent(),a.remove(),n=l?l.length:0,y.contents().size()>n?(m=y.contents().eq(-1-n),m=c(m,b,f,k,l)):(b=y.prev(),n=b.contents().eq(-1)[0],"undefined"!=typeof n&&(p=e(h(n),k),
|
|
g(n,p),l&&b.append(l),y.remove(),m=!0))):(p=e(p.slice(0,D+1).join(y),k),m=!0,g(n,p));return m}function d(a,b){return a.innerHeight()>b.maxHeight}function e(b,c){for(;-1<a.inArray(b.slice(-1),c.lastCharacter.remove);)b=b.slice(0,-1);return 0>a.inArray(b.slice(-1),c.lastCharacter.noEllipsis)&&(b+=c.ellipsis),b}function f(a){return{width:a.innerWidth(),height:a.innerHeight()}}function g(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function h(a){return a.innerText?
|
|
a.innerText:a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function k(b,c){return"undefined"==typeof b?!1:b?"string"==typeof b?(b=a(b,c),b.length?b:!1):"object"==typeof b?"undefined"==typeof b.jquery?!1:b:!1:!1}function l(a,b){return a?(b="string"==typeof b?"dotdotdot: "+b:["dotdotdot:",b],"undefined"!=typeof window.console&&"undefined"!=typeof window.console.log&&window.console.log(b),!1):!1}if(!a.fn.dotdotdot){a.fn.dotdotdot=function(c){if(0==this.length)return c&&!1===c.debug||l(!0,'No element found for "'+
|
|
this.selector+'".'),this;if(1<this.length)return this.each(function(){a(this).dotdotdot(c)});var e=this;e.data("dotdotdot")&&e.trigger("destroy.dot");e.data("dotdotdot-style",e.attr("style"));e.css("word-wrap","break-word");e.bind_events=function(){return e.bind("update.dot",function(c,f){c.preventDefault();c.stopPropagation();var k=h,l;if("number"==typeof h.height)l=h.height;else{l=e.innerHeight();for(var m=["paddingTop","paddingBottom"],p=0,r=m.length;r>p;p++){var x=parseInt(e.css(m[p]),10);isNaN(x)&&
|
|
(x=0);l-=x}}k.maxHeight=l;h.maxHeight+=h.tolerance;"undefined"!=typeof f&&(("string"==typeof f||f instanceof HTMLElement)&&(f=a("<div />").append(f).contents()),f instanceof a&&(g=f));A=e.wrapInner('<div class="dotdotdot" />').children();A.empty().append(g.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});k=m=!1;n.afterElement&&(m=n.afterElement.clone(!0),n.afterElement.remove());if(d(A,h))if("children"==h.wrap){k=A;l=h;p=k.children();r=!1;k.empty();for(var x=0,C=p.length;C>
|
|
x;x++){var O=p.eq(x);if(k.append(O),m&&k.append(m),d(k,l)){O.remove();r=!0;break}m&&m.detach()}k=r}else k=b(A,e,A,h,m);return A.replaceWith(A.contents()),A=null,a.isFunction(h.callback)&&h.callback.call(e[0],k,g),n.isTruncated=k,k}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(e[0],n.isTruncated),n.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(e[0],
|
|
g),g}).bind("destroy.dot",function(a){a.preventDefault();a.stopPropagation();e.unwatch().unbind_events().empty().append(g).attr("style",e.data("dotdotdot-style")).data("dotdotdot",!1)}),e};e.unbind_events=function(){return e.unbind(".dot"),e};e.watch=function(){if(e.unwatch(),"window"==h.watch){var b=a(window),c=b.width(),d=b.height();b.bind("resize.dot"+n.dotId,function(){c==b.width()&&d==b.height()&&h.windowResizeFix||(c=b.width(),d=b.height(),C&&clearInterval(C),C=setTimeout(function(){e.trigger("update.dot")},
|
|
10))})}else p=f(e),C=setInterval(function(){var a=f(e);(p.width!=a.width||p.height!=a.height)&&(e.trigger("update.dot"),p=f(e))},100);return e};e.unwatch=function(){return a(window).unbind("resize.dot"+n.dotId),C&&clearInterval(C),e};var g=e.contents(),h=a.extend(!0,{},a.fn.dotdotdot.defaults,c),n={},p={},C=null,A=null;return h.lastCharacter.remove instanceof Array||(h.lastCharacter.remove=a.fn.dotdotdot.defaultArrays.lastCharacter.remove),h.lastCharacter.noEllipsis instanceof Array||(h.lastCharacter.noEllipsis=
|
|
a.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),n.afterElement=k(h.after,e),n.isTruncated=!1,n.dotId=m++,e.data("dotdotdot",!0).bind_events().trigger("update.dot"),h.watch&&e.watch(),e};a.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,debug:!1};a.fn.dotdotdot.defaultArrays={lastCharacter:{remove:" \u3000,;.!?".split(""),noEllipsis:[]}};var m=1,n=a.fn.html;a.fn.html=function(a){return"undefined"!=
|
|
typeof a?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):n.call(this,a):n.call(this)};var p=a.fn.text;a.fn.text=function(b){if("undefined"!=typeof b){if(this.data("dotdotdot")){var c=a("<div />");return c.text(b),b=c.html(),c.remove(),this.trigger("update",[b])}return p.call(this,b)}return p.call(this)}}}(jQuery);(function(a){if(!a.support.cors&&a.ajaxTransport&&window.XDomainRequest){var b=/^https?:\/\//i,c=/^get|post$/i,d=new RegExp("^"+location.protocol,"i"),e=/text\/html/i,f=/\/json/i,g=/\/xml/i;a.ajaxTransport("* text html xml json",function(h,k,l){if(h.crossDomain&&h.async&&c.test(h.type)&&b.test(h.url)&&d.test(h.url)){var m=null,n=(k.dataType||"").toLowerCase();return{send:function(b,c){m=new XDomainRequest;/^\d+$/.test(k.timeout)&&(m.timeout=k.timeout);m.ontimeout=function(){c(500,"timeout")};m.onload=
|
|
function(){var b="Content-Length: "+m.responseText.length+"\r\nContent-Type: "+m.contentType,d=200,h="success",k={text:m.responseText};try{if("html"===n||e.test(m.contentType))k.html=m.responseText;else if("json"===n||"text"!==n&&f.test(m.contentType))try{k.json=a.parseJSON(m.responseText)}catch(l){d=500,h="parseerror"}else if("xml"===n||"text"!==n&&g.test(m.contentType)){var p=new ActiveXObject("Microsoft.XMLDOM");p.async=!1;try{p.loadXML(m.responseText)}catch(t){p=void 0}if(!p||!p.documentElement||
|
|
p.getElementsByTagName("parsererror").length)throw d=500,h="parseerror","Invalid XML: "+m.responseText;k.xml=p}}catch(D){throw D;}finally{c(d,h,k,b)}};m.onprogress=function(){};m.onerror=function(){c(500,"error",{text:m.responseText})};var d="";k.data&&(d="string"===a.type(k.data)?k.data:a.param(k.data));m.open(h.type,h.url);m.send(d)},abort:function(){m&&m.abort()}}}})}})(jQuery);(function(a){a.fn.inputselectable=function(b){var c=a(this);b=a.extend({},b);if(!c.is('input[type="text"]'))throw Error(c+' should be input[type="text"]');if(b.list&&b.list.length&&!c.hasClass("ISinput")){c.addClass("ISinput");var d=a('<div class="ISwraper"></div>'),e=a('<div class="IStoggle"></div>'),f=function(d,f,k){function l(d,f){f||(f=m);f.remove();c.off("click");b.closeHandle instanceof a&&b.closeHandle.off("click");e.removeClass("active");c.focus()}d.stopPropagation();if(e.is(":active")||
|
|
e.is(".active"))if(l(null,a(".ISdropdown")),k)return;if(f&&f.length){d='<ul class="ISdropdown">';for(k=0;k<f.length;k++)d+='<li><div><span class="IStext">'+f[k]+"</span></div></li>";var m=a(d+"</ul>");m.find("li").each(function(){a(this).click(function(){c.val(a(this).find(".IStext").text());l()})});c.on("click","",l);if(b.closeHandle instanceof a)b.closeHandle.on("click","",l);m.insertAfter(c);m.css({top:c.outerHeight(),width:c.outerWidth(),"max-height":a(window).height()-m.offset().top-35});e.toggleClass("active")}};
|
|
c.wrap(d);"static"==c.css("position")?d.css("position","relative"):d.css({top:c.css("top"),left:c.css("left"),position:c.css("position")});d.css({width:c.outerHeight(),height:c.outerWidth()});e.insertAfter(c);e.click(function(a){f(a,b.list,!0)});c.keyup(function(d){var e=new RegExp(c.val(),"i"),k=a.grep(b.list,function(a){return e.test(a)});f(d,k)});return c.focus()}}})(jQuery);(function(a){function b(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(a,b){return function(c){return l(a.call(this,c),b)}}function d(a,b){return function(c){return this.lang().ordinal(a.call(this,c),b)}}function e(){}function f(a){x(a);h(this,a)}function g(a){a=t(a);var b=a.year||0,c=a.month||0,d=a.week||0,e=a.day||0;this._milliseconds=+(a.millisecond||0)+1E3*(a.second||0)+6E4*(a.minute||
|
|
0)+36E5*(a.hour||0);this._days=+e+7*d;this._months=+c+12*b;this._data={};this._bubble()}function h(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function k(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b,c){for(var d=""+Math.abs(a);d.length<b;)d="0"+d;return(0<=a?c?"+":"":"-")+d}function m(a,b,c,d){var e,f,g=b._milliseconds,h=b._days;b=b._months;g&&a._d.setTime(+a._d+g*
|
|
c);(h||b)&&(e=a.minute(),f=a.hour());h&&a.date(a.date()+h*c);b&&a.month(a.month()+b*c);g&&!d&&G.updateOffset(a);(h||b)&&(a.minute(e),a.hour(f))}function n(a){return"[object Array]"===Object.prototype.toString.call(a)}function p(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&w(a[d])!==w(b[d]))&&g++;return g+f}function r(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=Ya[a]||wa[b]||b}return a}function t(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&
|
|
(b=r(c),b&&(d[b]=a[c]));return d}function v(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12;d="month"}G[b]=function(e,f){var g,h,k=G.fn._lang[b],l=[];if("number"==typeof e&&(f=e,e=a),h=function(a){a=G().utc().set(d,a);return k.call(G.fn._lang,a,e||"")},null!=f)return h(f);for(g=0;c>g;g++)l.push(h(g));return l}}function w(a){a=+a;var b=0;return 0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a)),b}function u(a){return 0===a%4&&0!==a%100||0===a%400}function x(a){var b;
|
|
a._a&&-2===a._pf.overflow&&(b=0>a._a[na]||11<a._a[na]?na:1>a._a[ja]||a._a[ja]>(new Date(Date.UTC(a._a[ea],a._a[na]+1,0))).getUTCDate()?ja:0>a._a[ga]||23<a._a[ga]?ga:0>a._a[ka]||59<a._a[ka]?ka:0>a._a[Aa]||59<a._a[Aa]?Aa:0>a._a[qa]||999<a._a[qa]?qa:-1,a._pf._overflowDayOfYear&&(ea>b||b>ja)&&(b=ja),a._pf.overflow=b)}function C(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&0>a._pf.overflow&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,
|
|
a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function A(a){return a?a.toLowerCase().replace("_","-"):a}function y(a,b){return b._isUTC?G(a).zone(b._offset||0):G(a).local()}function D(a){var b,c,d,e,f=0,g=function(a){if(!oa[a]&&Va)try{require("./lang/"+a)}catch(b){}return oa[a]};if(!a)return G.fn._lang;if(!n(a)){if(c=g(a))return c;a=[a]}for(;f<a.length;){e=A(a[f]).split("-");b=e.length;for(d=(d=A(a[f+1]))?d.split("-"):null;0<b;){if(c=g(e.slice(0,
|
|
b).join("-")))return c;if(d&&d.length>=b&&p(e,d,!0)>=b-1)break;b--}f++}return G.fn._lang}function E(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function z(a){var b,c,d=a.match(Ra);b=0;for(c=d.length;c>b;b++)d[b]=la[d[b]]?la[d[b]]:E(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function F(a,b){return a.isValid()?(b=K(b,a.lang()),ha[b]||(ha[b]=z(b)),ha[b](a)):a.lang().invalidDate()}function K(a,b){function c(a){return b.longDateFormat(a)||
|
|
a}var d=5;for(fa.lastIndex=0;0<=d&&fa.test(a);)a=a.replace(fa,c),fa.lastIndex=0,--d;return a}function Q(a,b){var c=b._strict;switch(a){case "DDDD":return Ea;case "YYYY":case "GGGG":case "gggg":return c?La:Ka;case "Y":case "G":case "g":return H;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?da:Wa;case "S":if(c)return Da;case "SS":if(c)return ra;case "SSS":if(c)return Ea;case "DDD":return ca;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return Xa;case "a":case "A":return D(b._l)._meridiemParse;
|
|
case "X":return Sa;case "Z":case "ZZ":return Ca;case "T":return ua;case "SSSS":return Ba;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?ra:Pa;case "M":case "D":case "d":case "H":case "h":case "m":case "s":case "w":case "W":case "e":case "E":return Pa;default:var c=RegExp,d;d=T(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new c(d)}}function B(a){a=(a||"").match(Ca)||[];a=((a[a.length-1]||[])+"").match(va)||
|
|
["-",0,0];var b=+(60*a[1])+w(a[2]);return"+"===a[0]?-b:b}function J(a){var b,c,d,e,f,g,h,k,l,m=[];if(!a._d){c=O(a);a._w&&null==a._a[ja]&&null==a._a[na]&&(e=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[ea]?G().weekYear():a._a[ea]},f=a._w,null!=f.GG||null!=f.W||null!=f.E?g=V(e(f.GG),f.W||1,f.E,4,1):(h=D(a._l),k=null!=f.d?S(f.d,h):null!=f.e?parseInt(f.e,10)+h._week.dow:0,l=parseInt(f.w,10)||1,null!=f.d&&k<h._week.dow&&l++,g=V(e(f.gg),l,k,h._week.doy,h._week.dow)),
|
|
a._a[ea]=g.year,a._dayOfYear=g.dayOfYear);a._dayOfYear&&(d=null==a._a[ea]?c[ea]:a._a[ea],a._dayOfYear>(u(d)?366:365)&&(a._pf._overflowDayOfYear=!0),b=M(d,0,a._dayOfYear),a._a[na]=b.getUTCMonth(),a._a[ja]=b.getUTCDate());for(b=0;3>b&&null==a._a[b];++b)a._a[b]=m[b]=c[b];for(;7>b;b++)a._a[b]=m[b]=null==a._a[b]?2===b?1:0:a._a[b];m[ga]+=w((a._tzm||0)/60);m[ka]+=w((a._tzm||0)%60);a._d=(a._useUTC?M:I).apply(null,m)}}function O(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:
|
|
[b.getFullYear(),b.getMonth(),b.getDate()]}function q(a){a._a=[];a._pf.empty=!0;var b,c,d,e,f;b=D(a._l);var g=""+a._i,h=g.length,k=0;d=K(a._f,b).match(Ra)||[];for(b=0;b<d.length;b++)if(e=d[b],(c=(g.match(Q(e,a))||[])[0])&&(f=g.substr(0,g.indexOf(c)),0<f.length&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),k+=c.length),la[e]){c?a._pf.empty=!1:a._pf.unusedTokens.push(e);var l=a,m=void 0,n=l._a;switch(e){case "M":case "MM":null!=c&&(n[na]=w(c)-1);break;case "MMM":case "MMMM":m=D(l._l).monthsParse(c);
|
|
null!=m?n[na]=m:l._pf.invalidMonth=c;break;case "D":case "DD":null!=c&&(n[ja]=w(c));break;case "DDD":case "DDDD":null!=c&&(l._dayOfYear=w(c));break;case "YY":n[ea]=w(c)+(68<w(c)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":n[ea]=w(c);break;case "a":case "A":l._isPm=D(l._l).isPM(c);break;case "H":case "HH":case "h":case "hh":n[ga]=w(c);break;case "m":case "mm":n[ka]=w(c);break;case "s":case "ss":n[Aa]=w(c);break;case "S":case "SS":case "SSS":case "SSSS":n[qa]=w(1E3*("0."+c));break;case "X":l._d=
|
|
new Date(1E3*parseFloat(c));break;case "Z":case "ZZ":l._useUTC=!0;l._tzm=B(c);break;case "w":case "ww":case "W":case "WW":case "d":case "dd":case "ddd":case "dddd":case "e":case "E":e=e.substr(0,1);case "gg":case "gggg":case "GG":case "GGGG":case "GGGGG":e=e.substr(0,2),c&&(l._w=l._w||{},l._w[e]=c)}}else a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-k;0<g.length&&a._pf.unusedInput.push(g);a._isPm&&12>a._a[ga]&&(a._a[ga]+=12);!1===a._isPm&&12===a._a[ga]&&(a._a[ga]=0);J(a);x(a)}function T(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
function(a,b,c,d,e){return b||c||d||e})}function I(a,b,c,d,e,f,g){b=new Date(a,b,c,d,e,f,g);return 1970>a&&b.setFullYear(a),b}function M(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function S(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function N(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function W(a,b,c){var d;b=c-b;c-=a.day();return c>b&&(c-=7),b-7>c&&(c+=7),d=G(a).add("d",
|
|
c),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function V(a,b,c,d,e){var f,g,h=M(a,0,1).getUTCDay();return c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:0<g?a:a-1,dayOfYear:0<g?g:(u(a-1)?366:365)+g}}function R(c){var d=c._i,e=c._f;if(null===d)c=G.invalid({nullInput:!0});else{"string"==typeof d&&(c._i=d=D().preparse(d));if(G.isMoment(d)){c=d;var g,k={};for(g in c)c.hasOwnProperty(g)&&Qa.hasOwnProperty(g)&&(k[g]=c[g]);c=k;c._d=new Date(+d._d)}else if(e)if(n(e)){var l=c,m,p;if(0===
|
|
l._f.length)l._pf.invalidFormat=!0,l._d=new Date(0/0);else{for(d=0;d<l._f.length;d++)g=0,k=h({},l),k._pf=b(),k._f=l._f[d],q(k),C(k)&&(g+=k._pf.charsLeftOver,g+=10*k._pf.unusedTokens.length,k._pf.score=g,(null==p||p>g)&&(p=g,m=k));h(l,m||k)}}else q(c);else if(k=c,m=k._i,p=Ia.exec(m),m===a)k._d=new Date;else if(p)k._d=new Date(+p[1]);else if("string"==typeof m)if(l=k._i,d=Fa.exec(l)){k._pf.iso=!0;m=0;for(p=Y.length;p>m;m++)if(Y[m][1].exec(l)){k._f=Y[m][0]+(d[6]||" ");break}m=0;for(p=Ma.length;p>m;m++)if(Ma[m][1].exec(l)){k._f+=
|
|
Ma[m][0];break}l.match(Ca)&&(k._f+="Z");q(k)}else k._d=new Date(l);else n(m)?(k._a=m.slice(0),J(k)):"[object Date]"===Object.prototype.toString.call(m)||m instanceof Date?k._d=new Date(+m):"object"==typeof m?k._d||(l=t(k._i),k._a=[l.year,l.month,l.day,l.hour,l.minute,l.second,l.millisecond],J(k)):k._d=new Date(m);c=new f(c)}return c}function aa(a,b){G.fn[a]=G.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),G.updateOffset(this),this):this._d["get"+c+b]()}}function U(a){G.duration.fn[a]=
|
|
function(){return this._data[a]}}function L(a,b){G.duration.fn["as"+a]=function(){return+this/b}}function X(a){var b=!1,c=G;"undefined"==typeof ender&&(a?(ta.moment=function(){return!b&&console&&console.warn&&(b=!0,console.warn("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.")),c.apply(null,arguments)},h(ta.moment,c)):ta.moment=G)}for(var G,P,ta=this,ba=Math.round,ea=0,na=1,ja=2,ga=3,ka=4,Aa=5,qa=6,oa={},Qa={_isAMomentObject:null,_i:null,_f:null,
|
|
_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},Va="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,Ia=/^\/?Date\((\-?\d+)/i,Ua=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Ja=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Ra=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,
|
|
fa=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Pa=/\d\d?/,ca=/\d{1,3}/,Ka=/\d{1,4}/,Wa=/[+\-]?\d{1,6}/,Ba=/\d+/,Xa=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ca=/Z|[\+\-]\d\d:?\d\d/gi,ua=/T/i,Sa=/[\+\-]?\d+(\.\d{1,3})?/,Da=/\d/,ra=/\d\d/,Ea=/\d{3}/,La=/\d{4}/,da=/[+-]?\d{6}/,H=/[+-]?\d+/,Fa=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
|
|
Y=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],Ma=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],va=/([\+\-]|\d\d)/gi,ma=["Date","Hours","Minutes","Seconds","Milliseconds"],Na={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},Ya={ms:"millisecond",s:"second",
|
|
m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},wa={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},ha={},pa="DDD w W M D d".split(" "),Ga="MDHhmswW".split(""),la={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},
|
|
DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},YYYYYY:function(){var a=this.year();return(0<=a?"+":"-")+l(Math.abs(a),
|
|
6)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return l(this.weekYear(),4)},ggggg:function(){return l(this.weekYear(),5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return l(this.isoWeekYear(),4)},GGGGG:function(){return l(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),
|
|
!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return w(this.milliseconds()/100)},SS:function(){return l(w(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},SSSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(w(a/60),2)+":"+l(w(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,
|
|
b="-"),b+l(w(a/60),2)+l(w(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Oa=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];pa.length;)P=pa.pop(),la[P+"o"]=d(la[P],P);for(;Ga.length;)P=Ga.pop(),la[P+P]=c(la[P],2);la.DDDD=c(la.DDD,3);h(e.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January February March April May June July August September October November December".split(" "),
|
|
months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;this._monthsParse||(this._monthsParse=[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(c=G.utc([2E3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
|
|
weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;this._weekdaysParse||(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(c=G([2E3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,
|
|
""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},
|
|
_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return 11<a?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",
|
|
y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[0<a?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return W(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",
|
|
invalidDate:function(){return this._invalidDate}});G=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=c,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=b(),R(g)};G.utc=function(c,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=c,g._f=d,g._strict=f,g._pf=b(),R(g).utc()};G.unix=function(a){return G(1E3*a)};G.duration=function(a,b){var c,d,e,f=a,h=null;return G.isDuration(a)?f={ms:a._milliseconds,
|
|
d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=Ua.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:w(h[ja])*c,h:w(h[ga])*c,m:w(h[ka])*c,s:w(h[Aa])*c,ms:w(h[qa])*c}):(h=Ja.exec(a))&&(c="-"===h[1]?-1:1,e=function(a){a=a&&parseFloat(a.replace(",","."));return(isNaN(a)?0:a)*c},f={y:e(h[2]),M:e(h[3]),d:e(h[4]),h:e(h[5]),m:e(h[6]),s:e(h[7]),w:e(h[8])}),d=new g(f),G.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d};G.version="2.5.1";G.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
|
|
G.updateOffset=function(){};G.lang=function(a,b){var c,d;a?(b?(d=A(a),b.abbr=d,oa[d]||(oa[d]=new e),oa[d].set(b)):null===b?(delete oa[a],a="en"):oa[a]||D(a),d=(c=G.duration.fn._lang=G.fn._lang=D(a),c._abbr)):d=G.fn._lang._abbr;return d};G.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),D(a)};G.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")};G.isDuration=function(a){return a instanceof g};for(P=Oa.length-1;0<=P;--P)v(Oa[P]);G.normalizeUnits=
|
|
function(a){return r(a)};G.invalid=function(a){var b=G.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b};G.parseZone=function(a){return G(a).parseZone()};h(G.fn=f.prototype,{clone:function(){return G(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.clone().lang("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=
|
|
G(this).utc();return 0<a.year()&&9999>=a.year()?F(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):F(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return C(this)},isDSTShifted:function(){return this._a?this.isValid()&&0<p(this._a,(this._isUTC?G.utc(this._a):G(this._a)).toArray()):!1},parsingFlags:function(){return h({},this._pf)},invalidAt:function(){return this._pf.overflow},
|
|
utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){a=F(this,a||G.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;return c="string"==typeof a?G.duration(+b,a):G.duration(a,b),m(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?G.duration(+b,a):G.duration(a,b),m(this,c,-1),this},diff:function(a,b,c){var d,e;a=y(a,this);var f=6E4*(this.zone()-a.zone());return b=r(b),"year"===b||"month"===b?(d=
|
|
432E5*(this.daysInMonth()+a.daysInMonth()),e=12*(this.year()-a.year())+(this.month()-a.month()),e+=(this-G(this).startOf("month")-(a-G(a).startOf("month")))/d,e-=6E4*(this.zone()-G(this).startOf("month").zone()-(a.zone()-G(a).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-a,e="second"===b?d/1E3:"minute"===b?d/6E4:"hour"===b?d/36E5:"day"===b?(d-f)/864E5:"week"===b?(d-f)/6048E5:d),c?e:k(e)},from:function(a,b){return G.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(G(),
|
|
a)},calendar:function(){var a=y(G(),this).startOf("day"),a=this.diff(a,"days",!0),a=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,this))},isLeapYear:function(){return u(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=S(a,this.lang()),this.add({d:a-
|
|
b})):b},month:function(a){var b,c=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?this:(b=this.date(),this.date(1),this._d["set"+c+"Month"](a),this.date(Math.min(b,this.daysInMonth())),G.updateOffset(this),this):this._d["get"+c+"Month"]()},startOf:function(a){switch(a=r(a)){case "year":this.month(0);case "month":this.date(1);case "week":case "isoWeek":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}return"week"===
|
|
a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),this},endOf:function(a){return a=r(a),this.startOf(a).add("isoWeek"===a?"week":a,1).subtract("ms",1)},isAfter:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+G(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+G(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+y(a,this).startOf(b)},min:function(a){return a=G.apply(null,
|
|
arguments),this>a?this:a},max:function(a){return a=G.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=B(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&m(this,G.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==
|
|
typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?G(a).zone():0,0===(this.zone()-a)%60},daysInMonth:function(){var a=this.year(),b=this.month();return(new Date(Date.UTC(a,b+1,0))).getUTCDate()},dayOfYear:function(a){var b=ba((G(this).startOf("day")-G(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},quarter:function(){return Math.ceil((this.month()+1)/3)},weekYear:function(a){var b=W(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==
|
|
a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=W(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=W(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this.day()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},get:function(a){return a=r(a),this[a]()},set:function(a,
|
|
b){return a=r(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=D(b),this)}});for(P=0;P<ma.length;P++)aa(ma[P].toLowerCase().replace(/s$/,""),ma[P]);aa("year","FullYear");G.fn.days=G.fn.day;G.fn.months=G.fn.month;G.fn.weeks=G.fn.week;G.fn.isoWeeks=G.fn.isoWeek;G.fn.toJSON=G.fn.toISOString;h(G.duration.fn=g.prototype,{_bubble:function(){var a,b;a=this._milliseconds;b=this._days;var c=this._months,d=this._data;d.milliseconds=a%1E3;a=k(a/1E3);d.seconds=
|
|
a%60;a=k(a/60);d.minutes=a%60;a=k(a/60);d.hours=a%24;b+=k(a/24);d.days=b%30;c+=k(b/30);d.months=c%12;b=k(c/12);d.years=b},weeks:function(){return k(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*w(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),e=ba(Math.abs(b)/1E3),f=ba(e/60),g=ba(f/60),h=ba(g/24),k=ba(h/365),e=45>e&&["s",e]||1===f&&["m"]||45>f&&["mm",f]||1===g&&["h"]||22>g&&["hh",g]||1===h&&["d"]||25>=h&&["dd",
|
|
h]||45>=h&&["M"]||345>h&&["MM",ba(h/30)]||1===k&&["y"]||["yy",k];c=(e[2]=c,e[3]=0<b,e[4]=d,N.apply({},e));return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=G.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=G.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=
|
|
r(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=r(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:G.fn.lang,toIsoString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1E3);return this.asSeconds()?(0>this.asSeconds()?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}});for(P in Na)Na.hasOwnProperty(P)&&
|
|
(L(P,Na[P]),U(P.toLowerCase()));L("Weeks",6048E5);G.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};G.lang("en",{ordinal:function(a){var b=a%10,b=1===w(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});Va?(module.exports=G,X(!0)):"function"==typeof define&&define.amd?define("moment",function(b,c,d){return d.config&&d.config()&&!0!==d.config().noGlobal&&X(d.config().noGlobal===a),G}):X()}).call(this);(function(){function a(a){return(10>a?"0":"")+a}function b(a){var b=++t+"";return a?a+b:b}function c(c,e){function k(a,b){var c=r.offset(),d=/^touch/.test(a.type),l=c.left+100,m=c.top+100,x=(d?a.originalEvent.touches[0]:a).pageX-l,t=(d?a.originalEvent.touches[0]:a).pageY-m,c=Math.sqrt(x*x+t*t),C=!1;if(!b||!(67>c||93<c)){a.preventDefault();var J=setTimeout(function(){g.addClass("clockpicker-moving")},200);h&&r.append(K.canvas);K.setHand(x,t,!b,!0);f.off(n).on(n,function(a){a.preventDefault();var b=
|
|
/^touch/.test(a.type),c=(b?a.originalEvent.touches[0]:a).pageX-l;a=(b?a.originalEvent.touches[0]:a).pageY-m;if(C||c!==x||a!==t)C=!0,K.setHand(c,a,!1,!0)});f.off(p).one(p,function(a){a.preventDefault();var c=/^touch/.test(a.type),d=(c?a.originalEvent.changedTouches[0]:a).pageX-l;a=(c?a.originalEvent.changedTouches[0]:a).pageY-m;(b||C)&&d===x&&a===t&&K.setHand(d,a);"hours"===K.currentView?K.toggleView("minutes",v/2):e.autoclose&&(K.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){K.done()},
|
|
v/2));r.prepend(O);clearTimeout(J);g.removeClass("clockpicker-moving");f.off(n)})}}var l=d('<div class="popover clockpicker-popover"><div class="arrow"></div><div class="popover-title"><span class="clockpicker-span-hours text-primary"></span> : <span class="clockpicker-span-minutes"></span></div><div class="popover-content"><div class="clockpicker-plate"><div class="clockpicker-canvas"></div><div class="clockpicker-dial clockpicker-hours"></div><div class="clockpicker-dial clockpicker-minutes clockpicker-dial-out"></div></div></div></div>'),
|
|
r=l.find(".clockpicker-plate"),t=l.find(".clockpicker-hours"),D=l.find(".clockpicker-minutes"),E="INPUT"===c.prop("tagName"),z=E?c:c.find("input"),F=c.find(".input-group-addon"),K=this;this.id=b("cp");this.element=c;this.options=e;this.isShown=this.isAppended=!1;this.currentView="hours";this.isInput=E;this.input=z;this.addon=F;this.popover=l;this.plate=r;this.hoursView=t;this.minutesView=D;this.spanHours=l.find(".clockpicker-span-hours");this.spanMinutes=l.find(".clockpicker-span-minutes");e.autoclose||
|
|
d('<button type="button" class="btn btn-sm btn-default btn-block clockpicker-button">'+e.donetext+"</button>").click(d.proxy(this.done,this)).appendTo(l);"top"!==e.placement&&"bottom"!==e.placement||"top"!==e.align&&"bottom"!==e.align||(e.align="left");"left"!==e.placement&&"right"!==e.placement||"left"!==e.align&&"right"!==e.align||(e.align="top");l.addClass(e.placement);l.addClass("clockpicker-align-"+e.align);this.spanHours.click(d.proxy(this.toggleView,this,"hours"));this.spanMinutes.click(d.proxy(this.toggleView,
|
|
this,"minutes"));z.on("focus.clockpicker click.clockpicker",d.proxy(this.show,this));F.on("click.clockpicker",d.proxy(this.toggle,this));for(var E=d('<div class="clockpicker-tick"></div>'),Q,z=0;24>z;z+=1){F=E.clone();Q=z/6*Math.PI;var B=0<z&&13>z,J=B?54:80;F.css({left:100+Math.sin(Q)*J-13,top:100-Math.cos(Q)*J-13});B&&F.css("font-size","120%");F.html(0===z?"00":z);t.append(F);F.on(m,k)}for(z=0;60>z;z+=5)F=E.clone(),Q=z/30*Math.PI,F.css({left:100+80*Math.sin(Q)-13,top:100-80*Math.cos(Q)-13}),F.css("font-size",
|
|
"120%"),F.html(a(z)),D.append(F),F.on(m,k);r.on(m,function(a){0===d(a.target).closest(".clockpicker-tick").length&&k(a,!0)});if(h){var O=l.find(".clockpicker-canvas"),l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("class","clockpicker-svg");l.setAttribute("width",200);l.setAttribute("height",200);t=document.createElementNS("http://www.w3.org/2000/svg","g");t.setAttribute("transform","translate(100,100)");D=document.createElementNS("http://www.w3.org/2000/svg","circle");
|
|
D.setAttribute("class","clockpicker-canvas-bearing");D.setAttribute("cx",0);D.setAttribute("cy",0);D.setAttribute("r",2);E=document.createElementNS("http://www.w3.org/2000/svg","line");E.setAttribute("x1",0);E.setAttribute("y1",0);z=document.createElementNS("http://www.w3.org/2000/svg","circle");z.setAttribute("class","clockpicker-canvas-bg");z.setAttribute("r",13);F=document.createElementNS("http://www.w3.org/2000/svg","circle");F.setAttribute("class","clockpicker-canvas-fg");F.setAttribute("r",
|
|
3.5);t.appendChild(E);t.appendChild(z);t.appendChild(F);t.appendChild(D);l.appendChild(t);O.append(l);this.hand=E;this.bg=z;this.fg=F;this.bearing=D;this.g=t;this.canvas=O}}var d=window.jQuery,e=d(window),f=d(document),g,h="SVGAngle"in window&&function(){var a,b=document.createElement("div");b.innerHTML="<svg/>";a="http://www.w3.org/2000/svg"==(b.firstChild&&b.firstChild.namespaceURI);b.innerHTML="";return a}(),k=function(){var a=document.createElement("div").style;return"transition"in a||"WebkitTransition"in
|
|
a||"MozTransition"in a||"msTransition"in a||"OTransition"in a}(),l="ontouchstart"in window,m="mousedown"+(l?" touchstart":""),n="mousemove.clockpicker"+(l?" touchmove.clockpicker":""),p="mouseup.clockpicker"+(l?" touchend.clockpicker":""),r=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,t=0,v=k?350:1;c.DEFAULTS={"default":"",fromnow:0,placement:"bottom",align:"left",donetext:"\u5b8c\u6210",autoclose:!1,vibrate:!0};c.prototype.toggle=function(){this[this.isShown?"hide":"show"]()};
|
|
c.prototype.locate=function(){var a=this.element,b=this.popover,c=a.offset(),d=a.outerWidth(),a=a.outerHeight(),e=this.options.placement,f=this.options.align,g={};b.show();switch(e){case "bottom":g.top=c.top+a;break;case "right":g.left=c.left+d;break;case "top":g.top=c.top-b.outerHeight();break;case "left":g.left=c.left-b.outerWidth()}switch(f){case "left":g.left=c.left;break;case "right":g.left=c.left+d-b.outerWidth();break;case "top":g.top=c.top;break;case "bottom":g.top=c.top+a-b.outerHeight()}b.css(g)};
|
|
c.prototype.show=function(b){if(!this.isShown){var c=this;this.isAppended||(g=d(document.body).append(this.popover),e.on("resize.clockpicker"+this.id,function(){c.isShown&&c.locate()}),this.isAppended=!0);b=((this.input.prop("value")||this.options["default"]||"")+"").split(":");"now"===b[0]&&(b=new Date(+new Date+this.options.fromnow),b=[b.getHours(),b.getMinutes()]);this.hours=+b[0]||0;this.minutes=+b[1]||0;this.spanHours.html(a(this.hours));this.spanMinutes.html(a(this.minutes));"function"===typeof this.options.beforeShow&&
|
|
this.options.beforeShow.apply(this);this.toggleView("hours");this.locate();this.isShown=!0;f.on("click.clockpicker."+this.id+" focusin.clockpicker."+this.id,function(a){a=d(a.target);0===a.closest(c.popover).length&&0===a.closest(c.addon).length&&0===a.closest(c.input).length&&c.hide()});f.on("keyup.clockpicker."+this.id,function(a){27===a.keyCode&&c.hide()});"function"===typeof this.options.afterShow&&this.options.afterShow.apply(this)}};c.prototype.hide=function(){this.isShown=!1;f.off("click.clockpicker."+
|
|
this.id+" focusin.clockpicker."+this.id);f.off("keyup.clockpicker."+this.id);this.popover.hide()};c.prototype.toggleView=function(a,b){var c="hours"===a,d=c?this.hoursView:this.minutesView,e=c?this.minutesView:this.hoursView;this.currentView=a;this.spanHours.toggleClass("text-primary",c);this.spanMinutes.toggleClass("text-primary",!c);e.addClass("clockpicker-dial-out");d.css("visibility","visible").removeClass("clockpicker-dial-out");this.resetClock(b);clearTimeout(this.toggleViewTimer);this.toggleViewTimer=
|
|
setTimeout(function(){e.css("visibility","hidden")},v)};c.prototype.resetClock=function(a){var b=this.currentView,c=this[b],d="hours"===b,b=Math.PI/(d?6:30)*c,c=d&&0<c&&13>c?54:80,e=Math.sin(b)*c,f=-Math.cos(b)*c,g=this;h&&a?(g.canvas.addClass("clockpicker-canvas-out"),setTimeout(function(){g.canvas.removeClass("clockpicker-canvas-out");g.setHand(e,f)},a)):this.setHand(e,f)};c.prototype.setHand=function(b,c,e,f){var g=Math.atan2(b,-c),k="hours"===this.currentView,l=Math.PI/(k||e?6:30);b=Math.sqrt(b*
|
|
b+c*c);b=(c=k&&67>b)?54:80;var m;0>g&&(g=2*Math.PI+g);m=Math.round(g/l);g=m*l;k?(12===m&&(m=0),m=c?0===m?12:m:0===m?0:m+12):(e&&(m*=5),60===m&&(m=0));this[this.currentView]!==m&&r&&this.options.vibrate&&!this.vibrateTimer&&(navigator[r](10),this.vibrateTimer=setTimeout(d.proxy(function(){this.vibrateTimer=null},this),100));this[this.currentView]=m;this[k?"spanHours":"spanMinutes"].html(a(m));h?(f||!k&&m%5?(this.g.insertBefore(this.hand,this.bearing),this.g.insertBefore(this.bg,this.fg),this.bg.setAttribute("class",
|
|
"clockpicker-canvas-bg clockpicker-canvas-bg-trans")):(this.g.insertBefore(this.hand,this.bg),this.g.insertBefore(this.fg,this.bg),this.bg.setAttribute("class","clockpicker-canvas-bg")),e=Math.sin(g)*b,g=-Math.cos(g)*b,this.hand.setAttribute("x2",e),this.hand.setAttribute("y2",g),this.bg.setAttribute("cx",e),this.bg.setAttribute("cy",g),this.fg.setAttribute("cx",e),this.fg.setAttribute("cy",g)):this[k?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var a=d(this);a.toggleClass("active",
|
|
m===+a.html())})};c.prototype.done=function(){this.hide();var b=this.input.prop("value"),c=a(this.hours)+":"+a(this.minutes);this.input.prop("value",c);c!==b&&(this.input.triggerHandler("change"),this.isInput||this.element.trigger("change"))};c.prototype.remove=function(){this.element.removeData("clockpicker");this.input.off("focus.clockpicker click.clockpicker");this.addon.off("click.clockpicker");this.isShown&&this.hide();this.isAppended&&(e.off("resize.clockpicker"+this.id),this.popover.remove())};
|
|
d.fn.clockpicker=function(a){var b=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=d(this),f=e.data("clockpicker");f?"function"===typeof f[a]&&f[a].apply(f,b):(f=d.extend({},c.DEFAULTS,e.data(),"object"==typeof a&&a),e.data("clockpicker",new c(e,f)))})}})();(function(){function a(a,b){if(!b||"function"===typeof b)return a;for(var c in b)a[c]=b[c];return a}function b(a,b,c){var d,e=0,f=a.length,g=void 0===f||"[object Array]"!==Object.prototype.toString.apply(a)||"function"===typeof a;if(c)if(g)for(d in a){if(!1===b.apply(a[d],c))break}else for(;e<f&&!1!==b.apply(a[e++],c););else if(g)for(d in a){if(!1===b.call(a[d],d,a[d]))break}else for(;e<f&&!1!==b.call(a[e],e,a[e++]););return a}function c(a){var b=function(a){if(window.XMLHttpRequest)return a(null,
|
|
new XMLHttpRequest);if(window.ActiveXObject)try{return a(null,new ActiveXObject("Msxml2.XMLHTTP"))}catch(b){return a(null,new ActiveXObject("Microsoft.XMLHTTP"))}return a(Error())},c=function(a){if("string"===typeof a)return a;var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")},d=function(){for(var a=arguments[0],b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a},e=function(a,
|
|
f,g,h){"function"===typeof g&&(h=g,g={});g.cache=g.cache||!1;g.data=g.data||{};g.headers=g.headers||{};g.jsonp=g.jsonp||!1;g.async=void 0===g.async?!0:g.async;var k=d({accept:"*/*","content-type":"application/x-www-form-urlencoded;charset=UTF-8"},e.headers,g.headers),l;l="application/json"===k["content-type"]?JSON.stringify(g.data):c(g.data);if("GET"===a){var m=[];l&&(m.push(l),l=null);g.cache||m.push("_="+(new Date).getTime());g.jsonp&&(m.push("callback="+g.jsonp),m.push("jsonp="+g.jsonp));m=m.join("&");
|
|
1<m.length&&(f=-1<f.indexOf("?")?f+("&"+m):f+("?"+m));if(g.jsonp){var m=document.getElementsByTagName("head")[0],n=document.createElement("script");n.type="text/javascript";n.src=f;m.appendChild(n);return}}b(function(b,c){if(b)return h(b);c.open(a,f,g.async);for(var d in k)k.hasOwnProperty(d)&&c.setRequestHeader(d,k[d]);c.onreadystatechange=function(){if(4===c.readyState){var a=c.responseText||"";h&&h(c.status,{text:function(){return a},json:function(){return JSON.parse(a)}})}};c.send(l)})};({authBasic:function(a,
|
|
b){var c=e.headers,d;d=a+":"+b;d=d.replace(/\r\n/g,"\n");for(var f="",g=0;g<d.length;g++){var h=d.charCodeAt(g);128>h?f+=String.fromCharCode(h):(127<h&&2048>h?f+=String.fromCharCode(h>>6|192):(f+=String.fromCharCode(h>>12|224),f+=String.fromCharCode(h>>6&63|128)),f+=String.fromCharCode(h&63|128))}d=f;var f="",k,l,m,n,p=0;do k=d.charCodeAt(p++),g=d.charCodeAt(p++),h=d.charCodeAt(p++),l=k>>2,k=(k&3)<<4|g>>4,m=(g&15)<<2|h>>6,n=h&63,isNaN(g)?m=n=64:isNaN(h)&&(n=64),f+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n);while(p<d.length);c.Authorization="Basic "+f},connect:function(a,b,c){return e("CONNECT",a,b,c)},del:function(a,b,c){return e("DELETE",a,b,c)},get:function(a,b,c){return e("GET",a,b,c)},head:function(a,b,c){return e("HEAD",a,b,c)},headers:function(a){e.headers=a||{}},
|
|
isAllowed:function(a,b,c){this.options(a,function(a,d){c(-1!==d.text().indexOf(b))})},options:function(a,b,c){return e("OPTIONS",a,b,c)},patch:function(a,b,c){return e("PATCH",a,b,c)},post:function(a,b,c){return e("POST",a,b,c)},put:function(a,b,c){return e("PUT",a,b,c)},trace:function(a,b,c){return e("TRACE",a,b,c)}})[a.type?a.type.toLowerCase():"get"](a.url,a,function(b,c){200===b?a.success(c.json(),b,null):a.error(c.text(),b,null)})}function d(a,b){"function"===typeof a&&(b=a,a={});a=a||{};z.extend(y,
|
|
a);delete y.fixLng;"string"==typeof y.ns&&(y.ns={namespaces:[y.ns],defaultNs:y.ns});"string"==typeof y.fallbackNS&&(y.fallbackNS=[y.fallbackNS]);if("string"==typeof y.fallbackLng||"boolean"==typeof y.fallbackLng)y.fallbackLng=[y.fallbackLng];y.interpolationPrefixEscaped=z.regexEscape(y.interpolationPrefix);y.interpolationSuffixEscaped=z.regexEscape(y.interpolationSuffix);y.lng||(y.lng=z.detectLanguage());y.lng?y.useCookie&&z.cookie.create(y.cookieName,y.lng,y.cookieExpirationTime,y.cookieDomain):
|
|
(y.lng=y.fallbackLng[0],y.useCookie&&z.cookie.remove(y.cookieName));C=z.toLanguages(y.lng);u=C[0];z.log("currentLng set to: "+u);var c=l;a.fixLng&&(c=function(a,b){b=b||{};b.lng=b.lng||c.lng;return l(a,b)},c.lng=u);K.setCurrentLng(u);t&&y.setJqueryExt&&f();var d;t&&t.Deferred&&(d=t.Deferred());if(y.resStore)w=y.resStore,A=!0,b&&b(c),d&&d.resolve(c);else{var e=z.toLanguages(y.lng);"string"===typeof y.preload&&(y.preload=[y.preload]);for(var g=0,h=y.preload.length;g<h;g++)for(var k=z.toLanguages(y.preload[g]),
|
|
m=0,n=k.length;m<n;m++)0>e.indexOf(k[m])&&e.push(k[m]);v.sync.load(e,y,function(a,e){w=e;A=!0;b&&b(c);d&&d.resolve(c)})}if(d)return d.promise()}function e(a,b){var c={dynamicLoad:y.dynamicLoad,resGetPath:y.resGetPath,getAsync:y.getAsync,customLoad:y.customLoad,ns:{namespaces:a,defaultNs:""}},d=z.toLanguages(y.lng);"string"===typeof y.preload&&(y.preload=[y.preload]);for(var e=0,f=y.preload.length;e<f;e++)for(var g=z.toLanguages(y.preload[e]),h=0,k=g.length;h<k;h++)0>d.indexOf(g[h])&&d.push(g[h]);
|
|
for(var l=[],e=0,f=d.length;e<f;e++){g=!1;if(h=w[d[e]])for(var k=0,m=a.length;k<m;k++)h[a[k]]||(g=!0);else g=!0;g&&l.push(d[e])}l.length?v.sync._fetch(l,c,function(c,d){var e=a.length*l.length;z.each(a,function(a,c){0>y.ns.namespaces.indexOf(c)&&y.ns.namespaces.push(c);z.each(l,function(a,f){w[f]=w[f]||{};w[f][c]=d[f][c];e--;0===e&&b&&(y.useLocalStorage&&v.sync._storeLocal(w),b())})})}):b&&b()}function f(){function a(b,c,d){if(0!==c.length){var e="text";0===c.indexOf("[")&&(e=c.split("]"),c=e[1],
|
|
e=e[0].substr(1,e[0].length-1));c.indexOf(";")===c.length-1&&(c=c.substr(0,c.length-2));if("html"===e)d=y.defaultValueFromContent?t.extend({defaultValue:b.html()},d):d,b.html(t.t(c,d));else if("text"===e)d=y.defaultValueFromContent?t.extend({defaultValue:b.text()},d):d,b.text(t.t(c,d));else if("prepend"===e)d=y.defaultValueFromContent?t.extend({defaultValue:b.html()},d):d,b.prepend(t.t(c,d));else if("append"===e)d=y.defaultValueFromContent?t.extend({defaultValue:b.html()},d):d,b.append(t.t(c,d));
|
|
else if(0===e.indexOf("data-")){var f=e.substr(5);d=y.defaultValueFromContent?t.extend({defaultValue:b.data(f)},d):d;c=t.t(c,d);b.data(f,c);b.attr(e,c)}else d=y.defaultValueFromContent?t.extend({defaultValue:b.attr(e)},d):d,b.attr(e,t.t(c,d))}}function b(c,d){var e=c.attr(y.selectorAttr);e||"undefined"===typeof e||!1===e||(e=c.text()||c.val());if(e){var f=c,g=c.data("i18n-target");g&&(f=c.find(g)||c);d||!0!==y.useDataAttrOptions||(d=c.data("i18n-options"));d=d||{};0<=e.indexOf(";")?(e=e.split(";"),
|
|
t.each(e,function(b,c){""!==c&&a(f,c,d)})):a(f,e,d);!0===y.useDataAttrOptions&&c.data("i18n-options",d)}}t.t=t.t||l;t.fn.i18n=function(a){return this.each(function(){b(t(this),a);t(this).find("["+y.selectorAttr+"]").each(function(){b(t(this),a)})})}}function g(a,b,c,d){if(!a)return a;d=d||b;if(0>a.indexOf(d.interpolationPrefix||y.interpolationPrefix))return a;var e=d.interpolationPrefix?z.regexEscape(d.interpolationPrefix):y.interpolationPrefixEscaped,f=d.interpolationSuffix?z.regexEscape(d.interpolationSuffix):
|
|
y.interpolationSuffixEscaped,h="HTML"+f;z.each(b,function(b,k){var l=c?c+y.keyseparator+b:b;"object"===typeof k&&null!==k?a=g(a,k,l,d):d.escapeInterpolation||y.escapeInterpolation?(a=a.replace(new RegExp([e,l,h].join(""),"g"),k),a=a.replace(new RegExp([e,l,f].join(""),"g"),z.escape(k))):a=a.replace(new RegExp([e,l,f].join(""),"g"),k)});return a}function h(a,b){var c=z.extend({},b);for(delete c.postProcess;-1!=a.indexOf(y.reusePrefix);){x++;if(x>y.maxRecursion)break;var d=a.lastIndexOf(y.reusePrefix),
|
|
e=a.indexOf(y.reuseSuffix,d)+y.reuseSuffix.length,d=a.substring(d,e),e=d.replace(y.reusePrefix,"").replace(y.reuseSuffix,"");if(-1!=e.indexOf(",")){var f=e.indexOf(",");if(-1!=e.indexOf("{",f)&&-1!=e.indexOf("}",f)){var g=e.indexOf("{",f),h=e.indexOf("}",g)+1;try{c=z.extend(c,JSON.parse(e.substring(g,h))),e=e.substring(0,f)}catch(k){}}}e=n(e,c);a=a.replace(d,e)}return a}function k(a,b){b=b||{};var c=void 0!==b.defaultValue?b.defaultValue:a,d=p(a,b);return void 0!==d||d===c}function l(a,b){b=b||{};
|
|
if(!A)return a||"";x=0;return n.apply(null,arguments)}function m(){for(var a=[],b=1;b<arguments.length;b++)a.push(arguments[b]);return{postProcess:"sprintf",sprintf:a}}function n(a,b){b&&"object"!==typeof b?"sprintf"===y.shortcutFunction?b=m.apply(null,arguments):"defaultValue"===y.shortcutFunction&&(b={defaultValue:b}):b=b||{};if(void 0===a||null===a)return"";"string"==typeof a&&(a=[a]);var c=a[0];if(1<a.length)for(var d=0;d<a.length&&(c=a[d],!k(c,b));d++);var d=void 0!==b.defaultValue?b.defaultValue:
|
|
c,e=p(c,b),f=b.lng?z.toLanguages(b.lng):C,l=b.ns||y.ns.defaultNs,n;-1<c.indexOf(y.nsseparator)&&(n=c.split(y.nsseparator),l=n[0],c=n[1]);void 0===e&&y.sendMissing&&(b.lng?F.postMissing(f[0],l,c,d,f):F.postMissing(y.lng,l,c,d,f));f=b.postProcess||y.postProcess;void 0!==e&&f&&Q[f]&&(e=Q[f](e,c,b));n=d;-1<d.indexOf(y.nsseparator)&&(n=d.split(y.nsseparator),n=n[1]);n===c&&y.parseMissingKey&&(d=y.parseMissingKey(d));void 0===e&&(d=g(d,b),d=h(d,b),f&&Q[f]&&(e=Q[f](void 0!==b.defaultValue?b.defaultValue:
|
|
c,c,b)));e||(window.parent.__translations||(window.parent.__translations=[]),0>window.parent.__translations.indexOf(d)&&1<d.length&&window.parent.__translations.push(d));return void 0!==e?e:d}function p(a,b){b=b||{};var c,d=void 0!==b.defaultValue?b.defaultValue:a,e=C;if(!w||"cimode"===e[0].toLowerCase())return d;if(b.lng&&(e=z.toLanguages(b.lng),!w[e[0]])){var f=y.getAsync;y.getAsync=!1;v.sync.load(e,y,function(a,b){z.extend(w,b);y.getAsync=f})}var k=b.ns||y.ns.defaultNs;-1<a.indexOf(y.nsseparator)&&
|
|
(c=a.split(y.nsseparator),k=c[0],a=c[1]);if(b.context&&("string"==typeof b.context||"number"==typeof b.context)&&(c=z.extend({},b),delete c.context,c.defaultValue=y.contextNotFound,c=l(k+y.nsseparator+a+"_"+b.context,c),c!=y.contextNotFound))return g(c,{context:b.context});if(void 0!==b.count&&"string"!=typeof b.count&&1!==b.count){c=z.extend({},b);delete c.count;c.defaultValue=y.pluralNotFound;var m=k+y.nsseparator+a+y.pluralSuffix,r=K.get(e[0],b.count);0<=r?m=m+"_"+r:1===r&&(m=k+y.nsseparator+a);
|
|
c=l(m,c);if(c!=y.pluralNotFound)return g(c,{count:b.count,interpolationPrefix:b.interpolationPrefix,interpolationSuffix:b.interpolationSuffix})}var x;c=a.split(y.keyseparator);m=0;for(r=e.length;m<r&&void 0===x;m++){for(var t=e[m],u=0,A=w[t]&&w[t][k];c[u];)A=A&&A[c[u]],u++;if(void 0!==A){x=Object.prototype.toString.apply(A);if("string"===typeof A)A=g(A,b),A=h(A,b);else if("[object Array]"===x&&!y.returnObjectTrees&&!b.returnObjectTrees)A=A.join("\n"),A=g(A,b),A=h(A,b);else if(null===A&&!0===y.fallbackOnNull)A=
|
|
void 0;else if(null!==A)if(!y.returnObjectTrees&&!b.returnObjectTrees)y.objectTreeKeyHandler&&"function"==typeof y.objectTreeKeyHandler?A=y.objectTreeKeyHandler(a,A,t,k,b):(A="key '"+k+":"+a+" ("+t+")' returned an object instead of string.",z.log(A));else if("[object Number]"!==x&&"[object Function]"!==x&&"[object RegExp]"!==x){var B="[object Array]"===x?[]:{};z.each(A,function(c){B[c]=n(k+y.nsseparator+a+y.keyseparator+c,b)});A=B}"string"===typeof A&&""===A.trim()&&!0===y.fallbackOnEmpty&&(A=void 0);
|
|
x=A}}if(void 0===x&&!b.isFallbackLookup&&(!0===y.fallbackToDefaultNS||y.fallbackNS&&0<y.fallbackNS.length))if(b.isFallbackLookup=!0,y.fallbackNS.length)for(e=0,c=y.fallbackNS.length;e<c;e++){if(x=p(y.fallbackNS[e]+y.nsseparator+a,b))if(m=-1<x.indexOf(y.nsseparator)?x.split(y.nsseparator)[1]:x,r=-1<d.indexOf(y.nsseparator)?d.split(y.nsseparator)[1]:d,m!==r)break}else x=p(a,b);return x}Array.prototype.indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),
|
|
c=b.length>>>0;if(0===c)return-1;var d=0;0<arguments.length&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&Infinity!=d&&-Infinity!=d&&(d=(0<d||-1)*Math.floor(Math.abs(d))));if(d>=c)return-1;for(d=0<=d?d:Math.max(c-Math.abs(d),0);d<c;d++)if(d in b&&b[d]===a)return d;return-1});Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=c;1<arguments.length&&(d=Number(arguments[1]),d!=d?d=0:0!=d&&d!=1/0&&
|
|
d!=-(1/0)&&(d=(0<d||-1)*Math.floor(Math.abs(d))));for(c=0<=d?Math.min(d,c-1):c-Math.abs(d);0<=c;c--)if(c in b&&b[c]===a)return c;return-1});"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var r=this||window,t=r.jQuery||r.Zepto,v={},w={},u,x=0,C=[],A=!1;"undefined"!==typeof module&&module.exports?module.exports=v:(t&&(t.i18n=t.i18n||v),r.i18n=r.i18n||v);var y={lng:void 0,load:"all",preload:[],lowerCaseLng:!1,returnObjectTrees:!1,fallbackLng:["dev"],
|
|
fallbackNS:[],detectLngQS:"setLng",ns:"translation",fallbackOnNull:!0,fallbackOnEmpty:!1,fallbackToDefaultNS:!1,nsseparator:":",keyseparator:".",selectorAttr:"data-i18n",debug:!1,resGetPath:"locales/__lng__/__ns__.json",resPostPath:"locales/add/__lng__/__ns__",getAsync:!1,postAsync:!1,resStore:void 0,useLocalStorage:!1,localStorageExpirationTime:6048E5,dynamicLoad:!1,sendMissing:!1,sendMissingTo:"fallback",sendType:"POST",interpolationPrefix:"__",interpolationSuffix:"__",reusePrefix:"$t(",reuseSuffix:")",
|
|
pluralSuffix:"_plural",pluralNotFound:["plural_not_found",Math.random()].join(""),contextNotFound:["context_not_found",Math.random()].join(""),escapeInterpolation:!1,setJqueryExt:!0,defaultValueFromContent:!0,useDataAttrOptions:!1,cookieExpirationTime:void 0,useCookie:!0,cookieName:"i18next",cookieDomain:void 0,objectTreeKeyHandler:void 0,postProcess:void 0,parseMissingKey:void 0,shortcutFunction:"sprintf"},D={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},r={create:function(a,
|
|
b,c,d){if(c){var e=new Date;e.setTime(e.getTime()+6E4*c);c="; expires="+e.toGMTString()}else c="";document.cookie=a+"="+b+c+";"+(d?"domain="+d+";":"")+"path=/"},read:function(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0===d.indexOf(a))return d.substring(a.length,d.length)}return null},remove:function(a){this.create(a,"",-1)}},E={create:function(a,b,c,d){},read:function(a){return null},remove:function(a){}},z={extend:t?
|
|
t.extend:a,each:t?t.each:b,ajax:t?t.ajax:"undefined"!==typeof document?c:function(){},cookie:"undefined"!==typeof document?r:E,detectLanguage:function(){var a,b=[];if("undefined"!==typeof window){for(var c=window.location.search.substring(1).split("&"),d=0;d<c.length;d++){var e=c[d].indexOf("=");if(0<e){var f=c[d].substring(0,e),e=c[d].substring(e+1);b[f]=e}}b[y.detectLngQS]&&(a=b[y.detectLngQS])}!a&&"undefined"!==typeof document&&y.useCookie&&(b=z.cookie.read(y.cookieName))&&(a=b);a||"undefined"===
|
|
typeof navigator||(a=navigator.language?navigator.language:navigator.userLanguage);return a},escape:function(a){return"string"===typeof a?a.replace(/[&<>"'\/]/g,function(a){return D[a]}):a},log:function(a){y.debug&&"undefined"!==typeof console&&console.log(a)},toLanguages:function(a){var b=[];if("string"===typeof a&&-1<a.indexOf("-")){var c=a.split("-");a=y.lowerCaseLng?c[0].toLowerCase()+"-"+c[1].toLowerCase():c[0].toLowerCase()+"-"+c[1].toUpperCase();"unspecific"!==y.load&&b.push(a);"current"!==
|
|
y.load&&b.push(c[0])}else b.push(a);for(a=0;a<y.fallbackLng.length;a++)-1===b.indexOf(y.fallbackLng[a])&&y.fallbackLng[a]&&b.push(y.fallbackLng[a]);return b},regexEscape:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}};z.applyReplacement=g;var F={load:function(a,b,c){b.useLocalStorage?F._loadLocal(a,b,function(d,e){for(var f=[],g=0,h=a.length;g<h;g++)e[a[g]]||f.push(a[g]);0<f.length?F._fetch(f,b,function(a,b){z.extend(e,b);F._storeLocal(b);c(null,e)}):c(null,e)}):F._fetch(a,
|
|
b,function(a,b){c(null,b)})},_loadLocal:function(a,b,c){var d={},e=(new Date).getTime();if(window.localStorage){var f=a.length;z.each(a,function(a,g){var h=window.localStorage.getItem("res_"+g);h&&(h=JSON.parse(h),h.i18nStamp&&h.i18nStamp+b.localStorageExpirationTime>e&&(d[g]=h));f--;0===f&&c(null,d)})}},_storeLocal:function(a){if(window.localStorage)for(var b in a)a[b].i18nStamp=(new Date).getTime(),window.localStorage.setItem("res_"+b,JSON.stringify(a[b]))},_fetch:function(a,b,c){var d=b.ns,e={};
|
|
if(b.dynamicLoad){var f=function(a,b){c(null,b)};if("function"==typeof b.customLoad)b.customLoad(a,d.namespaces,b,f);else{var h=g(b.resGetPath,{lng:a.join("+"),ns:d.namespaces.join("+")});z.ajax({url:h,success:function(a,b,d){z.log("loaded: "+h);c(null,a)},error:function(a,b,d){z.log("failed loading: "+h);c(null,void 0)},dataType:"json",async:b.getAsync})}}else{var k=d.namespaces.length*a.length,l;z.each(d.namespaces,function(d,f){z.each(a,function(a,d){var g=function(a,b){a&&(l=l||[],l.push(a));
|
|
e[d]=e[d]||{};e[d][f]=b;k--;0===k&&c(l,e)};"function"==typeof b.customLoad?b.customLoad(d,f,b,g):F._fetchOne(d,f,b,g)})})}},_fetchOne:function(a,b,c,d){var e=g(c.resGetPath,{lng:a,ns:b});z.ajax({url:e,success:function(a,b,c){z.log("loaded: "+e);d(null,a)},error:function(a,b,c){b&&200==b||a&&a.status&&200==a.status?z.log("There is a typo in: "+e):b&&404==b||a&&a.status&&404==a.status?z.log("Does not exist: "+e):z.log((b?b:a&&a.status?a.status:null)+" when loading "+e);d(c,{})},dataType:"json",async:c.getAsync})},
|
|
postMissing:function(a,b,c,d,e){var f={};f[c]=d;var h=[];if("fallback"===y.sendMissingTo&&!1!==y.fallbackLng[0])for(a=0;a<y.fallbackLng.length;a++)h.push({lng:y.fallbackLng[a],url:g(y.resPostPath,{lng:y.fallbackLng[a],ns:b})});else if("current"===y.sendMissingTo||"fallback"===y.sendMissingTo&&!1===y.fallbackLng[0])h.push({lng:a,url:g(y.resPostPath,{lng:a,ns:b})});else if("all"===y.sendMissingTo){a=0;for(var k=e.length;a<k;a++)h.push({lng:e[a],url:g(y.resPostPath,{lng:e[a],ns:b})})}e=0;for(a=h.length;e<
|
|
a;e++){var l=h[e];z.ajax({url:l.url,type:y.sendType,data:f,success:function(a,e,f){z.log("posted missing key '"+c+"' to: "+l.url);a=c.split(".");e=0;for(f=w[l.lng][b];a[e];)f=e===a.length-1?f[a[e]]=d:f[a[e]]=f[a[e]]||{},e++},error:function(a,b,d){z.log("failed posting missing key '"+c+"' to: "+l.url)},dataType:"json",async:y.postAsync})}}},K={rules:{ach:{name:"Acholi",numbers:[1,2],plurals:function(a){return Number(1<a)}},af:{name:"Afrikaans",numbers:[1,2],plurals:function(a){return Number(1!=a)}},
|
|
ak:{name:"Akan",numbers:[1,2],plurals:function(a){return Number(1<a)}},am:{name:"Amharic",numbers:[1,2],plurals:function(a){return Number(1<a)}},an:{name:"Aragonese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ar:{name:"Arabic",numbers:[0,1,2,3,11,100],plurals:function(a){return Number(0===a?0:1==a?1:2==a?2:3<=a%100&&10>=a%100?3:11<=a%100?4:5)}},arn:{name:"Mapudungun",numbers:[1,2],plurals:function(a){return Number(1<a)}},ast:{name:"Asturian",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},ay:{name:"Aymar\u00e1",numbers:[1],plurals:function(a){return 0}},az:{name:"Azerbaijani",numbers:[1,2],plurals:function(a){return Number(1!=a)}},be:{name:"Belarusian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},bg:{name:"Bulgarian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},bn:{name:"Bengali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},bo:{name:"Tibetan",numbers:[1],plurals:function(a){return 0}},
|
|
br:{name:"Breton",numbers:[1,2],plurals:function(a){return Number(1<a)}},bs:{name:"Bosnian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},ca:{name:"Catalan",numbers:[1,2],plurals:function(a){return Number(1!=a)}},cgg:{name:"Chiga",numbers:[1],plurals:function(a){return 0}},cs:{name:"Czech",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a&&4>=a?1:2)}},csb:{name:"Kashubian",numbers:[1,2,5],plurals:function(a){return Number(1==
|
|
a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},cy:{name:"Welsh",numbers:[1,2,3,8],plurals:function(a){return Number(1==a?0:2==a?1:8!=a&&11!=a?2:3)}},da:{name:"Danish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},de:{name:"German",numbers:[1,2],plurals:function(a){return Number(1!=a)}},dz:{name:"Dzongkha",numbers:[1],plurals:function(a){return 0}},el:{name:"Greek",numbers:[1,2],plurals:function(a){return Number(1!=a)}},en:{name:"English",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},eo:{name:"Esperanto",numbers:[1,2],plurals:function(a){return Number(1!=a)}},es:{name:"Spanish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},es_ar:{name:"Argentinean Spanish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},et:{name:"Estonian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},eu:{name:"Basque",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fa:{name:"Persian",numbers:[1],plurals:function(a){return 0}},fi:{name:"Finnish",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},fil:{name:"Filipino",numbers:[1,2],plurals:function(a){return Number(1<a)}},fo:{name:"Faroese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fr:{name:"French",numbers:[1,2],plurals:function(a){return Number(1<a)}},fur:{name:"Friulian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},fy:{name:"Frisian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ga:{name:"Irish",numbers:[1,2,3,7,11],plurals:function(a){return Number(1==a?0:2==a?1:7>a?2:11>a?3:4)}},gd:{name:"Scottish Gaelic",
|
|
numbers:[1,2,3,20],plurals:function(a){return Number(1==a||11==a?0:2==a||12==a?1:2<a&&20>a?2:3)}},gl:{name:"Galician",numbers:[1,2],plurals:function(a){return Number(1!=a)}},gu:{name:"Gujarati",numbers:[1,2],plurals:function(a){return Number(1!=a)}},gun:{name:"Gun",numbers:[1,2],plurals:function(a){return Number(1<a)}},ha:{name:"Hausa",numbers:[1,2],plurals:function(a){return Number(1!=a)}},he:{name:"Hebrew",numbers:[1,2],plurals:function(a){return Number(1!=a)}},hi:{name:"Hindi",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},hr:{name:"Croatian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},hu:{name:"Hungarian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},hy:{name:"Armenian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ia:{name:"Interlingua",numbers:[1,2],plurals:function(a){return Number(1!=a)}},id:{name:"Indonesian",numbers:[1],plurals:function(a){return 0}},is:{name:"Icelandic",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a%10||11==a%100)}},it:{name:"Italian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ja:{name:"Japanese",numbers:[1],plurals:function(a){return 0}},jbo:{name:"Lojban",numbers:[1],plurals:function(a){return 0}},jv:{name:"Javanese",numbers:[0,1],plurals:function(a){return Number(0!==a)}},ka:{name:"Georgian",numbers:[1],plurals:function(a){return 0}},kk:{name:"Kazakh",numbers:[1],plurals:function(a){return 0}},km:{name:"Khmer",numbers:[1],plurals:function(a){return 0}},kn:{name:"Kannada",numbers:[1,
|
|
2],plurals:function(a){return Number(1!=a)}},ko:{name:"Korean",numbers:[1],plurals:function(a){return 0}},ku:{name:"Kurdish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},kw:{name:"Cornish",numbers:[1,2,3,4],plurals:function(a){return Number(1==a?0:2==a?1:3==a?2:3)}},ky:{name:"Kyrgyz",numbers:[1],plurals:function(a){return 0}},lb:{name:"Letzeburgesch",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ln:{name:"Lingala",numbers:[1,2],plurals:function(a){return Number(1<a)}},lo:{name:"Lao",
|
|
numbers:[1],plurals:function(a){return 0}},lt:{name:"Lithuanian",numbers:[1,2,10],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&(10>a%100||20<=a%100)?1:2)}},lv:{name:"Latvian",numbers:[1,2,0],plurals:function(a){return Number(1==a%10&&11!=a%100?0:0!==a?1:2)}},mai:{name:"Maithili",numbers:[1,2],plurals:function(a){return Number(1!=a)}},mfe:{name:"Mauritian Creole",numbers:[1,2],plurals:function(a){return Number(1<a)}},mg:{name:"Malagasy",numbers:[1,2],plurals:function(a){return Number(1<
|
|
a)}},mi:{name:"Maori",numbers:[1,2],plurals:function(a){return Number(1<a)}},mk:{name:"Macedonian",numbers:[1,2],plurals:function(a){return Number(1==a||1==a%10?0:1)}},ml:{name:"Malayalam",numbers:[1,2],plurals:function(a){return Number(1!=a)}},mn:{name:"Mongolian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},mnk:{name:"Mandinka",numbers:[0,1,2],plurals:function(a){return Number(1==a?1:2)}},mr:{name:"Marathi",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ms:{name:"Malay",numbers:[1],
|
|
plurals:function(a){return 0}},mt:{name:"Maltese",numbers:[1,2,11,20],plurals:function(a){return Number(1==a?0:0===a||1<a%100&&11>a%100?1:10<a%100&&20>a%100?2:3)}},nah:{name:"Nahuatl",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nap:{name:"Neapolitan",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nb:{name:"Norwegian Bokmal",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ne:{name:"Nepali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nl:{name:"Dutch",numbers:[1,
|
|
2],plurals:function(a){return Number(1!=a)}},nn:{name:"Norwegian Nynorsk",numbers:[1,2],plurals:function(a){return Number(1!=a)}},no:{name:"Norwegian",numbers:[1,2],plurals:function(a){return Number(1!=a)}},nso:{name:"Northern Sotho",numbers:[1,2],plurals:function(a){return Number(1!=a)}},oc:{name:"Occitan",numbers:[1,2],plurals:function(a){return Number(1<a)}},or:{name:"Oriya",numbers:[2,1],plurals:function(a){return Number(1!=a)}},pa:{name:"Punjabi",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},pap:{name:"Papiamento",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pl:{name:"Polish",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},pms:{name:"Piemontese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ps:{name:"Pashto",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pt:{name:"Portuguese",numbers:[1,2],plurals:function(a){return Number(1!=a)}},pt_br:{name:"Brazilian Portuguese",numbers:[1,2],plurals:function(a){return Number(1!=
|
|
a)}},rm:{name:"Romansh",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ro:{name:"Romanian",numbers:[1,2,20],plurals:function(a){return Number(1==a?0:0===a||0<a%100&&20>a%100?1:2)}},ru:{name:"Russian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},sah:{name:"Yakut",numbers:[1],plurals:function(a){return 0}},sco:{name:"Scots",numbers:[1,2],plurals:function(a){return Number(1!=a)}},se:{name:"Northern Sami",numbers:[1,2],
|
|
plurals:function(a){return Number(1!=a)}},si:{name:"Sinhala",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sk:{name:"Slovak",numbers:[1,2,5],plurals:function(a){return Number(1==a?0:2<=a&&4>=a?1:2)}},sl:{name:"Slovenian",numbers:[5,1,2,3],plurals:function(a){return Number(1==a%100?1:2==a%100?2:3==a%100||4==a%100?3:0)}},so:{name:"Somali",numbers:[1,2],plurals:function(a){return Number(1!=a)}},son:{name:"Songhay",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sq:{name:"Albanian",
|
|
numbers:[1,2],plurals:function(a){return Number(1!=a)}},sr:{name:"Serbian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},su:{name:"Sundanese",numbers:[1],plurals:function(a){return 0}},sv:{name:"Swedish",numbers:[1,2],plurals:function(a){return Number(1!=a)}},sw:{name:"Swahili",numbers:[1,2],plurals:function(a){return Number(1!=a)}},ta:{name:"Tamil",numbers:[1,2],plurals:function(a){return Number(1!=a)}},te:{name:"Telugu",numbers:[1,
|
|
2],plurals:function(a){return Number(1!=a)}},tg:{name:"Tajik",numbers:[1,2],plurals:function(a){return Number(1<a)}},th:{name:"Thai",numbers:[1],plurals:function(a){return 0}},ti:{name:"Tigrinya",numbers:[1,2],plurals:function(a){return Number(1<a)}},tk:{name:"Turkmen",numbers:[1,2],plurals:function(a){return Number(1!=a)}},tr:{name:"Turkish",numbers:[1,2],plurals:function(a){return Number(1<a)}},tt:{name:"Tatar",numbers:[1],plurals:function(a){return 0}},ug:{name:"Uyghur",numbers:[1],plurals:function(a){return 0}},
|
|
uk:{name:"Ukrainian",numbers:[1,2,5],plurals:function(a){return Number(1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2)}},ur:{name:"Urdu",numbers:[1,2],plurals:function(a){return Number(1!=a)}},uz:{name:"Uzbek",numbers:[1,2],plurals:function(a){return Number(1<a)}},vi:{name:"Vietnamese",numbers:[1],plurals:function(a){return 0}},wa:{name:"Walloon",numbers:[1,2],plurals:function(a){return Number(1<a)}},wo:{name:"Wolof",numbers:[1],plurals:function(a){return 0}},yo:{name:"Yoruba",numbers:[1,
|
|
2],plurals:function(a){return Number(1!=a)}},zh:{name:"Chinese",numbers:[1],plurals:function(a){return 0}}},addRule:function(a,b){K.rules[a]=b},setCurrentLng:function(a){if(!K.currentRule||K.currentRule.lng!==a){var b=a.split("-");K.currentRule={lng:a,rule:K.rules[b[0]]}}},get:function(a,b){var c=a.split("-");if(c=K.currentRule&&K.currentRule.lng===a?K.currentRule.rule:K.rules[c[0]]){var d=c.plurals(b),d=c.numbers[d];2===c.numbers.length&&1===c.numbers[0]&&(2===d?d=-1:1===d&&(d=1));c=d}else c=1===
|
|
b?"1":"-1";return c}},Q={},r=function(a,b){Q[a]=b},B=function(){function a(b){return Object.prototype.toString.call(b).slice(8,-1).toLowerCase()}var b=function(){b.cache.hasOwnProperty(arguments[0])||(b.cache[arguments[0]]=b.parse(arguments[0]));return b.format.call(null,b.cache[arguments[0]],arguments)};b.format=function(b,c){var d=1,e=b.length,f="",g=[],h,k,l,m;for(h=0;h<e;h++)if(f=a(b[h]),"string"===f)g.push(b[h]);else if("array"===f){l=b[h];if(l[2])for(f=c[d],k=0;k<l[2].length;k++){if(!f.hasOwnProperty(l[2][k]))throw B('[sprintf] property "%s" does not exist',
|
|
l[2][k]);f=f[l[2][k]]}else f=l[1]?c[l[1]]:c[d++];if(/[^s]/.test(l[8])&&"number"!=a(f))throw B("[sprintf] expecting number but found %s",a(f));switch(l[8]){case "b":f=f.toString(2);break;case "c":f=String.fromCharCode(f);break;case "d":f=parseInt(f,10);break;case "e":f=l[7]?f.toExponential(l[7]):f.toExponential();break;case "f":f=l[7]?parseFloat(f).toFixed(l[7]):parseFloat(f);break;case "o":f=f.toString(8);break;case "s":f=(f=String(f))&&l[7]?f.substring(0,l[7]):f;break;case "u":f=Math.abs(f);break;
|
|
case "x":f=f.toString(16);break;case "X":f=f.toString(16).toUpperCase()}f=/[def]/.test(l[8])&&l[3]&&0<=f?"+"+f:f;k=l[4]?"0"==l[4]?"0":l[4].charAt(1):" ";m=l[6]-String(f).length;if(l[6]){for(var n=[];0<m;n[--m]=k);k=n.join("")}else k="";g.push(l[5]?f+k:k+f)}return g.join("")};b.cache={};b.parse=function(a){for(var b=[],c=[],d=0;a;){if(null!==(b=/^[^\x25]+/.exec(a)))c.push(b[0]);else if(null!==(b=/^\x25{2}/.exec(a)))c.push("%");else if(null!==(b=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(a))){if(b[2]){var d=
|
|
d|1,e=[],f=b[2],g=[];if(null!==(g=/^([a-z_][a-z_\d]*)/i.exec(f)))for(e.push(g[1]);""!==(f=f.substring(g[0].length));)if(null!==(g=/^\.([a-z_][a-z_\d]*)/i.exec(f)))e.push(g[1]);else if(null!==(g=/^\[(\d+)\]/.exec(f)))e.push(g[1]);else throw"[sprintf] huh?";else throw"[sprintf] huh?";b[2]=e}else d|=2;if(3===d)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";c.push(b)}else throw"[sprintf] huh?";a=a.substring(b[0].length)}return c};return b}();r("sprintf",function(a,b,
|
|
c){return c.sprintf?"[object Array]"===Object.prototype.toString.apply(c.sprintf)?(b=c.sprintf,b.unshift(a),B.apply(null,b)):"object"===typeof c.sprintf?B(a,c.sprintf):a:a});v.init=d;v.setLng=function(a,b,c){"function"===typeof b?(c=b,b={}):b||(b={});b.lng=a;return d(b,c)};v.preload=function(a,b){"string"===typeof a&&(a=[a]);for(var c=0,e=a.length;c<e;c++)0>y.preload.indexOf(a[c])&&y.preload.push(a[c]);return d(b)};v.addResourceBundle=function(a,b,c){"string"!==typeof b?(c=b,b=y.ns.defaultNs):0>y.ns.namespaces.indexOf(b)&&
|
|
y.ns.namespaces.push(b);w[a]=w[a]||{};w[a][b]=w[a][b]||{};z.extend(w[a][b],c)};v.removeResourceBundle=function(a,b){"string"!==typeof b&&(b=y.ns.defaultNs);w[a]=w[a]||{};w[a][b]={}};v.loadNamespace=function(a,b){e([a],b)};v.loadNamespaces=e;v.setDefaultNamespace=function(a){y.ns.defaultNs=a};v.t=l;v.translate=l;v.exists=k;v.detectLanguage=z.detectLanguage;v.pluralExtensions=K;v.sync=F;v.functions=z;v.lng=function(){return u};v.addPostProcessor=r;v.options=y})();(function(a,b){function c(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function d(a){return n?n(a):"[object Array]"===p.call(a)}function e(a){return a&&"[object Object]"===p.call(a)}function f(a,b){var c;a=a||{};b=b||{};for(c in b)b.hasOwnProperty(c)&&null==a[c]&&(a[c]=b[c]);return a}function g(a,b,c){var d=[],e,f;if(!a)return d;if(m&&a.map===m)return a.map(b,c);e=0;for(f=a.length;e<f;e++)d[e]=b.call(c,a[e],e,a);return d}function h(a,b){a=Math.round(Math.abs(a));return isNaN(a)?b:a}function k(a){var b=
|
|
l.settings.currency.format;"function"===typeof a&&(a=a());return c(a)&&a.match("%v")?{pos:a,neg:a.replace("-","").replace("%v","-%v"),zero:a}:a&&a.pos&&a.pos.match("%v")?a:c(b)?l.settings.currency.format={pos:b,neg:b.replace("%v","-%v"),zero:b}:b}var l={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},m=Array.prototype.map,n=Array.isArray,p=Object.prototype.toString,r=l.unformat=
|
|
l.parse=function(a,b){if(d(a))return g(a,function(a){return r(a,b)});a=a||0;if("number"===typeof a)return a;b=b||l.settings.number.decimal;var c=new RegExp("[^0-9-"+b+"]",["g"]),c=parseFloat((""+a).replace(/\((.*)\)/,"-$1").replace(c,"").replace(b,"."));return isNaN(c)?0:c},t=l.toFixed=function(a,b){b=h(b,l.settings.number.precision);var c=Math.pow(10,b);return(Math.round(l.unformat(a)*c)/c).toFixed(b)},v=l.formatNumber=l.format=function(a,b,c,k){if(d(a))return g(a,function(a){return v(a,b,c,k)});
|
|
a=r(a);var m=f(e(b)?b:{precision:b,thousand:c,decimal:k},l.settings.number),n=h(m.precision),p=0>a?"-":"",w=parseInt(t(Math.abs(a||0),n),10)+"",F=3<w.length?w.length%3:0;return p+(F?w.substr(0,F)+m.thousand:"")+w.substr(F).replace(/(\d{3})(?=\d)/g,"$1"+m.thousand)+(n?m.decimal+t(Math.abs(a),n).split(".")[1]:"")},w=l.formatMoney=function(a,b,c,m,n,p){if(d(a))return g(a,function(a){return w(a,b,c,m,n,p)});a=r(a);var t=f(e(b)?b:{symbol:b,precision:c,thousand:m,decimal:n,format:p},l.settings.currency),
|
|
z=k(t.format);return(0<a?z.pos:0>a?z.neg:z.zero).replace("%s",t.symbol).replace("%v",v(Math.abs(a),h(t.precision),t.thousand,t.decimal))};l.formatColumn=function(a,b,m,n,p,t){if(!a)return[];var w=f(e(b)?b:{symbol:b,precision:m,thousand:n,decimal:p,format:t},l.settings.currency),z=k(w.format),F=z.pos.indexOf("%s")<z.pos.indexOf("%v")?!0:!1,K=0;a=g(a,function(a,b){if(d(a))return l.formatColumn(a,w);a=r(a);var c=(0<a?z.pos:0>a?z.neg:z.zero).replace("%s",w.symbol).replace("%v",v(Math.abs(a),h(w.precision),
|
|
w.thousand,w.decimal));c.length>K&&(K=c.length);return c});return g(a,function(a,b){return c(a)&&a.length<K?F?a.replace(w.symbol,w.symbol+Array(K-a.length+1).join(" ")):Array(K-a.length+1).join(" ")+a:a})};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=l),exports.accounting=l):"function"===typeof define&&define.amd?define([],function(){return l}):(l.noConflict=function(c){return function(){a.accounting=c;l.noConflict=b;return l}}(a.accounting),a.accounting=
|
|
l)})(this);(function(a,b){var c=a.document,d=a.navigator,e=a.setTimeout,f=a.clearTimeout,g=a.setInterval,h=a.clearInterval,k=a.getComputedStyle,l=a.encodeURIComponent,m=a.ActiveXObject,n=a.Error,p=a.Number.parseInt||a.parseInt,r=a.Number.parseFloat||a.parseFloat,t=a.Number.isNaN||a.isNaN,v=a.Date.now,w=a.Object.keys,u=a.Object.defineProperty,x=a.Object.prototype.hasOwnProperty,C=a.Array.prototype.slice,A=function(){var b=function(a){return a};if("function"===typeof a.wrap&&"function"===typeof a.unwrap)try{var d=
|
|
c.createElement("div"),e=a.unwrap(d);1===d.nodeType&&e&&1===e.nodeType&&(b=a.unwrap)}catch(f){}return b}(),y=function(a){return C.call(a,0)},D=function(){var a,c,d,e,f,g=y(arguments),h=g[0]||{};a=1;for(c=g.length;a<c;a++)if(null!=(d=g[a]))for(e in d)x.call(d,e)&&(f=d[e],h!==f&&f!==b&&(h[e]=f));return h},E=function(a){var b,c,d;if("object"!==typeof a||null==a||"number"===typeof a.nodeType)b=a;else if("number"===typeof a.length)for(b=[],c=0,d=a.length;c<d;c++)x.call(a,c)&&(b[c]=E(a[c]));else for(c in b=
|
|
{},a)x.call(a,c)&&(b[c]=E(a[c]));return b},z=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument)){do{if(a===b)return!0;a=a.parentNode}while(a)}return!1},F=function(a){var b;"string"===typeof a&&a&&(a.split("#")[0].split("?"),b=a.slice(0,a.lastIndexOf("/")+1));return b},K=function(){var a,d,e;if(c.currentScript&&(a=c.currentScript.src))return a;d=c.getElementsByTagName("script");
|
|
if(1===d.length)return d[0].src||b;if("readyState"in d[0])for(e=d.length;e--;)if("interactive"===d[e].readyState&&(a=d[e].src))return a;if("loading"===c.readyState&&(a=d[d.length-1].src))return a;var f;try{throw new n;}catch(g){d=g}if(d&&!(f=d.sourceURL||d.fileName)){f=d.stack;var h;"string"===typeof f&&f&&((d=f.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&d[1]?h=d[1]:(d=f.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&
|
|
d[1]&&(h=d[1]));f=h}return(a=f)?a:b},Q=null==a.opener&&(!!a.top&&a!=a.top||!!a.parent&&a!=a.parent),B={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,sandboxed:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},J,O={},q,T,I={},M=null,S=0,N=0,W={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard",
|
|
"flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.",
|
|
"flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity"}},
|
|
V="flash-unavailable flash-degraded flash-overdue version-mismatch config-mismatch clipboard-error".split(" "),R="flash-disabled flash-outdated flash-sandboxed flash-unavailable flash-degraded flash-deactivated flash-overdue".split(" "),aa=new RegExp("^flash-("+R.map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),U=new RegExp("^flash-("+R.slice(1).map(function(a){return a.replace(/^flash-/,"")}).join("|")+")$"),L={swfPath:function(){var a;if(!(a=F(K()))){var d,e,f=c.getElementsByTagName("script");
|
|
for(a=f.length;a--;){if(!(e=f[a].src)){d=null;break}e=F(e);if(null==d)d=e;else if(d!==e){d=null;break}}a=d||b}return(a||"")+"ZeroClipboard.swf"}(),trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3E4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",
|
|
forceHandCursor:!1,title:null,zIndex:999999999},X=function(a){if("object"===typeof a&&null!==a)for(var b in a)if(x.call(a,b))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(b))L[b]=a[b];else if(null==B.bridge)if("containerId"===b||"swfObjectId"===b){var c=a[b];if("string"===typeof c&&c&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(c))L[b]=a[b];else throw Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");}else L[b]=a[b];if("string"===typeof a&&a){if(x.call(L,a))return L[a]}else return E(L)},
|
|
G=function(){La();for(var a=["userAgent","platform","appName"],b={},c=0,e=a.length;c<e;c++)a[c]in d&&(b[a[c]]=d[a[c]]);var a=["bridge"],c={},f;for(f in B)-1===a.indexOf(f)&&(c[f]=B[f]);return{browser:b,flash:c,zeroclipboard:{version:H.version,config:H.config()}}},P=function(){return!!(B.disabled||B.outdated||B.sandboxed||B.unavailable||B.degraded||B.deactivated)},ta=function(a,c){var d,e,f,g={};if("string"===typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"===typeof a&&a&&"undefined"===
|
|
typeof c)for(d in a)if(x.call(a,d)&&"string"===typeof d&&d&&"function"===typeof a[d])H.on(d,a[d]);if(f&&f.length){d=0;for(e=f.length;d<e;d++)a=f[d].replace(/^on/,""),g[a]=!0,O[a]||(O[a]=[]),O[a].push(c);g.ready&&B.ready&&H.emit({type:"ready"});if(g.error){d=0;for(e=R.length;d<e;d++)if(!0===B[R[d].replace(/^flash-/,"")]){H.emit({type:"error",name:R[d]});break}J!==b&&H.version!==J&&H.emit({type:"error",name:"version-mismatch",jsVersion:H.version,swfVersion:J})}}return H},ba=function(a,b){var c,d,e,
|
|
f,g;if(0===arguments.length)f=w(O);else if("string"===typeof a&&a)f=a.split(/\s+/);else if("object"===typeof a&&a&&"undefined"===typeof b)for(c in a)x.call(a,c)&&"string"===typeof c&&c&&"function"===typeof a[c]&&H.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;c<d;c++)if(a=f[c].toLowerCase().replace(/^on/,""),(g=O[a])&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return H},ea=function(a){return"string"===typeof a&&a?E(O[a])||null:E(O)},na=function(b){var d,
|
|
e,f;if(b=Ia(b)){d=b;var g=d.target||q||null,h="swf"===d.R99;delete d.R99;switch(d.type){case "error":!(g="flash-sandboxed"===d.name)&&(g=null,!1===Q||d&&"error"===d.type&&d.name&&-1!==V.indexOf(d.name))&&(g=!1);"boolean"===typeof g&&(B.sandboxed=g);-1!==R.indexOf(d.name)?D(B,{disabled:"flash-disabled"===d.name,outdated:"flash-outdated"===d.name,unavailable:"flash-unavailable"===d.name,degraded:"flash-degraded"===d.name,deactivated:"flash-deactivated"===d.name,overdue:"flash-overdue"===d.name,
|
|
ready:!1}):"version-mismatch"===d.name&&(J=d.swfVersion,D(B,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1}));ra();break;case "ready":J=d.swfVersion;g=!0===B.deactivated;D(B,{disabled:!1,outdated:!1,sandboxed:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:g,ready:!g});ra();break;case "beforecopy":T=g;break;case "copy":var k,l,g=d.relatedTarget;!I["text/html"]&&!I["text/plain"]&&g&&(l=g.value||g.outerHTML||g.innerHTML)&&(k=g.value||g.textContent||g.innerText)?
|
|
(d.clipboardData.clearData(),d.clipboardData.setData("text/plain",k),l!==k&&d.clipboardData.setData("text/html",l)):!I["text/plain"]&&d.target&&(k=d.target.getAttribute("data-clipboard-text"))&&(d.clipboardData.clearData(),d.clipboardData.setData("text/plain",k));break;case "aftercopy":Ra(d);H.clearData();if(k=g){var m;try{m=c.activeElement}catch(n){m=null}k=g!==m}k&&g.focus&&g.focus();break;case "_mouseover":H.focus(g);!0===L.bubbleEvents&&h&&(g&&g!==d.relatedTarget&&!z(d.relatedTarget,g)&&fa(D({},
|
|
d,{type:"mouseenter",bubbles:!1,cancelable:!1})),fa(D({},d,{type:"mouseover"})));break;case "_mouseout":H.blur();!0===L.bubbleEvents&&h&&(g&&g!==d.relatedTarget&&!z(d.relatedTarget,g)&&fa(D({},d,{type:"mouseleave",bubbles:!1,cancelable:!1})),fa(D({},d,{type:"mouseout"})));break;case "_mousedown":Ca(g,L.activeClass);!0===L.bubbleEvents&&h&&fa(D({},d,{type:d.type.slice(1)}));break;case "_mouseup":ua(g,L.activeClass);!0===L.bubbleEvents&&h&&fa(D({},d,{type:d.type.slice(1)}));break;case "_click":T=null;
|
|
!0===L.bubbleEvents&&h&&fa(D({},d,{type:d.type.slice(1)}));break;case "_mousemove":!0===L.bubbleEvents&&h&&fa(D({},d,{type:d.type.slice(1)}))}d=/^_(?:click|mouse(?:over|out|down|up|move))$/.test(d.type)?!0:void 0;if(!d){if("ready"===b.type&&!0===B.overdue)return H.emit({type:"error",name:"flash-overdue"});d=D({},b);if("object"===typeof d&&d&&d.type&&(g=Ua(d),(k=(O["*"]||[]).concat(O[d.type]||[]))&&k.length)){var p,r;l=0;for(m=k.length;l<m;l++)h=k[l],p=this,"string"===typeof h&&"function"===typeof a[h]&&
|
|
(h=a[h]),"object"===typeof h&&h&&"function"===typeof h.handleEvent&&(p=h,h=h.handleEvent),"function"===typeof h&&(r=D({},d),Ja(h,p,[r],g))}if("copy"===b.type){e={};b={};if("object"===typeof I&&I){for(f in I)if(f&&x.call(I,f)&&"string"===typeof I[f]&&I[f])switch(f.toLowerCase()){case "text/plain":case "text":case "air:text":case "flash:text":e.text=I[f];b.text=f;break;case "text/html":case "html":case "air:html":case "flash:html":e.html=I[f];b.html=f;break;case "application/rtf":case "text/rtf":case "rtf":case "richtext":case "air:rtf":case "flash:rtf":e.rtf=
|
|
I[f],b.rtf=f}f={data:e,formatMap:b}}else f=void 0;e=f.data;M=f.formatMap}return e}}},ja=function(){var a=B.sandboxed;La();"boolean"!==typeof B.ready&&(B.ready=!1);B.sandboxed!==a&&!0===B.sandboxed?(B.ready=!1,H.emit({type:"error",name:"flash-sandboxed"})):H.isFlashUnusable()||null!==B.bridge||(a=L.flashLoadTimeout,"number"===typeof a&&0<=a&&(S=e(function(){"boolean"!==typeof B.deactivated&&(B.deactivated=!0);!0===B.deactivated&&H.emit({type:"error",name:"flash-deactivated"})},a)),B.overdue=!1,Ka())},
|
|
ga=function(){H.clearData();H.blur();H.emit("destroy");Wa();H.off()},ka=function(a,b){var c;if("object"===typeof a&&a&&"undefined"===typeof b)c=a,H.clearData();else if("string"===typeof a&&a)c={},c[a]=b;else return;for(var d in c)"string"===typeof d&&d&&x.call(c,d)&&"string"===typeof c[d]&&c[d]&&(I[d]=c[d])},Aa=function(a){if("undefined"===typeof a){if(I)for(var b in I)x.call(I,b)&&delete I[b];M=null}else"string"===typeof a&&x.call(I,a)&&delete I[a]},qa=function(a){if("undefined"===typeof a)return E(I);
|
|
if("string"===typeof a&&x.call(I,a))return I[a]},oa=function(a){if(a&&1===a.nodeType){q&&(ua(q,L.activeClass),q!==a&&ua(q,L.hoverClass));q=a;Ca(a,L.hoverClass);var b=a.getAttribute("title")||L.title;if("string"===typeof b&&b){var c=ca(B.bridge);c&&c.setAttribute("title",b)}a=!0===L.forceHandCursor||"pointer"===Sa(a,"cursor");!0===B.ready&&(B.bridge&&"function"===typeof B.bridge.setHandCursor?B.bridge.setHandCursor(a):B.ready=!1);var d;q&&(d=ca(B.bridge))&&(a=Da(q),D(d.style,{width:a.width+"px",height:a.height+
|
|
"px",top:a.top+"px",left:a.left+"px",zIndex:""+Ea(L.zIndex)}))}},Qa=function(){var a=ca(B.bridge);a&&(a.removeAttribute("title"),a.style.left="0px",a.style.top="-9999px",a.style.width="1px",a.style.height="1px");q&&(ua(q,L.hoverClass),ua(q,L.activeClass),q=null)},Va=function(){return q||null},Ia=function(d){var e;"string"===typeof d&&d?(e=d,d={}):"object"===typeof d&&d&&"string"===typeof d.type&&d.type&&(e=d.type);if(e){e=e.toLowerCase();!d.target&&(/^(copy|aftercopy|_click)$/.test(e)||"error"===
|
|
e&&"clipboard-error"===d.name)&&(d.target=T);D(d,{type:e,target:d.target||q||null,relatedTarget:d.relatedTarget||null,currentTarget:B&&B.bridge||null,timeStamp:d.timeStamp||v()||null});e=W[d.type];"error"===d.type&&d.name&&e&&(e=e[d.name]);e&&(d.message=e);"ready"===d.type&&D(d,{target:null,version:B.version});"error"===d.type&&(aa.test(d.name)&&D(d,{target:null,minimumVersion:"11.0.0"}),U.test(d.name)&&D(d,{version:B.version}));"copy"===d.type&&(d.clipboardData={setData:H.setData,clearData:H.clearData});
|
|
if("aftercopy"===d.type&&(e=M,"object"===typeof d&&d&&"object"===typeof e&&e)){var f={},g;for(g in d)if(x.call(d,g))if("errors"===g){f[g]=d[g]?d[g].slice():[];for(var h=0,k=f[g].length;h<k;h++)f[g][h].format=e[f[g][h].format]}else if("success"!==g&&"data"!==g)f[g]=d[g];else{f[g]={};var h=d[g],l;for(l in h)l&&x.call(h,l)&&x.call(e,l)&&(f[g][e[l]]=h[l])}d=f}d.target&&!d.relatedTarget&&(g=d,l=(l=(l=d.target)&&l.getAttribute&&l.getAttribute("data-clipboard-target"))?c.getElementById(l):null,g.relatedTarget=
|
|
l);if((g=d)&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(g.type)){l=g.target;d="_mouseover"===g.type&&g.relatedTarget?g.relatedTarget:b;e="_mouseout"===g.type&&g.relatedTarget?g.relatedTarget:b;var h=Da(l),f=h.left+("number"===typeof g._stageX?g._stageX:0),h=h.top+("number"===typeof g._stageY?g._stageY:0),k=f-(c.body.scrollLeft+c.documentElement.scrollLeft),m=h-(c.body.scrollTop+c.documentElement.scrollTop),n=(a.screenLeft||a.screenX||0)+k,p=(a.screenTop||a.screenY||0)+m,r="number"===typeof g.movementX?
|
|
g.movementX:0,t="number"===typeof g.movementY?g.movementY:0;delete g._stageX;delete g._stageY;D(g,{srcElement:l,fromElement:d,toElement:e,screenX:n,screenY:p,pageX:f,pageY:h,clientX:k,clientY:m,x:k,y:m,movementX:r,movementY:t,offsetX:0,offsetY:0,layerX:0,layerY:0})}return g}},Ua=function(a){return!/^(?:(?:before)?copy|destroy)$/.test(a&&"string"===typeof a.type&&a.type||"")},Ja=function(a,b,c,d){d?e(function(){a.apply(b,c)},0):a.apply(b,c)},Ra=function(a){if(a.errors&&0<a.errors.length){var b=E(a);
|
|
D(b,{type:"error",name:"clipboard-error"});delete b.success;e(function(){H.emit(b)},0)}},fa=function(b){if(b&&"string"===typeof b.type&&b){var d,e=b.target||null;d=e&&e.ownerDocument||c;b=D({view:d.defaultView||a,canBubble:!0,cancelable:!0,detail:"click"===b.type?1:0,button:"number"===typeof b.which?b.which-1:"number"===typeof b.button?b.button:d.createEvent?0:1},b);e&&d.createEvent&&e.dispatchEvent&&(b=[b.type,b.canBubble,b.cancelable,b.view,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,
|
|
b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget],d=d.createEvent("MouseEvents"),d.initMouseEvent&&(d.initMouseEvent.apply(d,b),d.R99="js",e.dispatchEvent(d)))}},Pa=function(){var a=L.flashLoadTimeout;if("number"===typeof a&&0<=a){var a=Math.min(1E3,a/10),b=L.swfObjectId+"_fallbackContent";N=g(function(){var a;var d=c.getElementById(b);if(d){a=k(d,null);var e=0<r(a.height),f=0<r(a.width),g=0<=r(a.top),h=0<=r(a.left),l=e&&f&&g&&h,d=l?null:Da(d);a="none"!==a.display&&"collapse"!==a.visibility&&
|
|
(l||!!d&&(e||0<d.height)&&(f||0<d.width)&&(g||0<=d.top)&&(h||0<=d.left))}else a=!1;a&&(ra(),B.deactivated=null,H.emit({type:"error",name:"swf-not-found"}))},a)}},ca=function(a){for(a=a&&a.parentNode;a&&"OBJECT"===a.nodeName&&a.parentNode;)a=a.parentNode;return a||null},Ka=function(){var b,d=B.bridge,e=ca(d);if(!d){var d=Xa(a.location.host,L),f="never"===d?"none":"all",g,e=D({jsVersion:H.version},L),h,k,m,n="",p=[];e.trustedDomains&&("string"===typeof e.trustedDomains?g=[e.trustedDomains]:"object"===
|
|
typeof e.trustedDomains&&"length"in e.trustedDomains&&(g=e.trustedDomains));if(g&&g.length)for(h=0,k=g.length;h<k;h++)if(x.call(g,h)&&g[h]&&"string"===typeof g[h]&&(m=Ba(g[h]))){if("*"===m){p.length=0;p.push(m);break}p.push.apply(p,[m,"//"+m,a.location.protocol+"//"+m])}p.length&&(n+="trustedOrigins="+l(p.join(",")));!0===e.forceEnhancedClipboard&&(n+=(n?"&":"")+"forceEnhancedClipboard=true");"string"===typeof e.swfObjectId&&e.swfObjectId&&(n+=(n?"&":"")+"swfObjectId="+l(e.swfObjectId));"string"===
|
|
typeof e.jsVersion&&e.jsVersion&&(n+=(n?"&":"")+"jsVersion="+l(e.jsVersion));g=n;e=L.swfPath;h=null==L||L&&!0===L.cacheBust?(-1===L.swfPath.indexOf("?")?"?":"&")+"noCache="+v():"";h=e+h;e=c.createElement("div");e.id=L.containerId;e.className=L.containerClass;e.style.position="absolute";e.style.left="0px";e.style.top="-9999px";e.style.width="1px";e.style.height="1px";e.style.zIndex=""+Ea(L.zIndex);k=c.createElement("div");e.appendChild(k);c.body.appendChild(e);m=c.createElement("div");n="activex"===
|
|
B.pluginType;m.innerHTML='<object id="'+L.swfObjectId+'" name="'+L.swfObjectId+'" width="100%" height="100%" '+(n?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+h+'"')+">"+(n?'<param name="movie" value="'+h+'"/>':"")+'<param name="allowScriptAccess" value="'+d+'"/><param name="allowNetworking" value="'+f+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+g+'"/><div id="'+L.swfObjectId+
|
|
'_fallbackContent"> </div></object>';d=m.firstChild;A(d).ZeroClipboard=H;e.replaceChild(d,k);Pa()}d||((d=c[L.swfObjectId])&&(b=d.length)&&(d=d[b-1]),!d&&e&&(d=e.firstChild));B.bridge=d||null;return d},Wa=function(){var a=B.bridge;if(a){var c=ca(a);c&&("activex"===B.pluginType&&"readyState"in a?(a.style.display="none",function za(){if(4===a.readyState){for(var b in a)"function"===typeof a[b]&&(a[b]=null);a.parentNode&&a.parentNode.removeChild(a);c.parentNode&&c.parentNode.removeChild(c)}else e(za,
|
|
10)}()):(a.parentNode&&a.parentNode.removeChild(a),c.parentNode&&c.parentNode.removeChild(c)));ra();B.ready=null;B.bridge=null;B.deactivated=null;J=b}},Ba=function(a){if(null==a||""===a)return null;a=a.replace(/^\s+|\s+$/g,"");if(""===a)return null;var b=a.indexOf("//");a=-1===b?a:a.slice(b+2);var c=a.indexOf("/");return(a=-1===c?a:-1===b||0===c?null:a.slice(0,c))&&".swf"===a.slice(-4).toLowerCase()?null:a||null},Xa=function(){return function(a,b){var c=Ba(b.swfPath);null===c&&(c=a);var d=b.trustedDomains,
|
|
e,f,g,h=[];"string"===typeof d&&(d=[d]);if("object"===typeof d&&d&&"number"===typeof d.length)for(e=0,f=d.length;e<f;e++)if(x.call(d,e)&&(g=Ba(d[e]))){if("*"===g){h.length=0;h.push("*");break}-1===h.indexOf(g)&&h.push(g)}d=h.length;if(0<d){if(1===d&&"*"===h[0])return"always";if(-1!==h.indexOf(a))return 1===d&&a===c?"sameDomain":"always"}return"never"}}(),Ca=function(a,b){var c,d,e,f=[];"string"===typeof b&&b&&(f=b.split(/\s+/));if(a&&1===a.nodeType&&0<f.length)if(a.classList)for(c=0,d=f.length;c<
|
|
d;c++)a.classList.add(f[c]);else if(a.hasOwnProperty("className")){e=" "+a.className+" ";c=0;for(d=f.length;c<d;c++)-1===e.indexOf(" "+f[c]+" ")&&(e+=f[c]+" ");a.className=e.replace(/^\s+|\s+$/g,"")}return a},ua=function(a,b){var c,d,e,f=[];"string"===typeof b&&b&&(f=b.split(/\s+/));if(a&&1===a.nodeType&&0<f.length)if(a.classList&&0<a.classList.length)for(c=0,d=f.length;c<d;c++)a.classList.remove(f[c]);else if(a.className){e=(" "+a.className+" ").replace(/[\r\n\t]/g," ");c=0;for(d=f.length;c<d;c++)e=
|
|
e.replace(" "+f[c]+" "," ");a.className=e.replace(/^\s+|\s+$/g,"")}return a},Sa=function(a,b){var c=k(a,null).getPropertyValue(b);return"cursor"!==b||c&&"auto"!==c||"A"!==a.nodeName?c:"pointer"},Da=function(b){var d={left:0,top:0,width:0,height:0};if(b.getBoundingClientRect){b=b.getBoundingClientRect();var e=a.pageXOffset,f=a.pageYOffset,g=c.documentElement.clientLeft||0,h=c.documentElement.clientTop||0,k=0,l=0;if("relative"===Sa(c.body,"position"))var l=c.body.getBoundingClientRect(),m=c.documentElement.getBoundingClientRect(),
|
|
k=l.left-m.left||0,l=l.top-m.top||0;d.left=b.left+e-g-k;d.top=b.top+f-h-l;d.width="width"in b?b.width:b.right-b.left;d.height="height"in b?b.height:b.bottom-b.top}return d},ra=function(){f(S);S=0;h(N);N=0},Ea=function(a){if(/^(?:auto|inherit)$/.test(a))return a;var b;"number"!==typeof a||t(a)?"string"===typeof a&&(b=Ea(p(a,10))):b=a;return"number"===typeof b?b:"auto"},La=function(b){var c,d,e,f=B.sandboxed,g=null;b=!0===b;if(!1===Q)g=!1;else{try{d=a.frameElement||null}catch(h){e={name:h.name,message:h.message}}if(d&&
|
|
1===d.nodeType&&"IFRAME"===d.nodeName)try{g=d.hasAttribute("sandbox")}catch(k){g=null}else{try{c=document.domain||null}catch(l){c=null}if(null===c||e&&"SecurityError"===e.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(e.message.toLowerCase()))g=!0}}B.sandboxed=g;f===g||b||da(m);return g},da=function(a){function b(a){a=a.match(/[\d]+/g);a.length=3;return a.join(".")}function c(a){a&&(f=!0,a.version&&(k=b(a.version)),!k&&a.description&&(k=b(a.description)),a.filename&&(a=a.filename,h=
|
|
!!a&&(a=a.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(a)||"chrome.plugin"===a.slice(-13))))}var e,f=!1,g=!1,h=!1,k="";if(d.plugins&&d.plugins.length)a=d.plugins["Shockwave Flash"],c(a),d.plugins["Shockwave Flash 2.0"]&&(f=!0,k="2.0.0.11");else if(d.mimeTypes&&d.mimeTypes.length)a=(a=d.mimeTypes["application/x-shockwave-flash"])&&a.enabledPlugin,c(a);else if("undefined"!==typeof a){g=!0;try{e=new a("ShockwaveFlash.ShockwaveFlash.7"),f=!0,k=b(e.GetVariable("$version"))}catch(l){try{e=
|
|
new a("ShockwaveFlash.ShockwaveFlash.6"),f=!0,k="6.0.21"}catch(m){try{e=new a("ShockwaveFlash.ShockwaveFlash"),f=!0,k=b(e.GetVariable("$version"))}catch(n){g=!1}}}}B.disabled=!0!==f;B.outdated=k&&r(k)<r("11.0.0");B.version=k||"0.0.0";B.pluginType=h?"pepper":g?"activex":f?"netscape":"unknown"};da(m);La(!0);var H=function(){if(!(this instanceof H))return new H;"function"===typeof H._createClient&&H._createClient.apply(this,y(arguments))};u(H,"version",{value:"2.2.0",writable:!1,configurable:!0,enumerable:!0});
|
|
H.config=function(){return X.apply(this,y(arguments))};H.state=function(){return G.apply(this,y(arguments))};H.isFlashUnusable=function(){return P.apply(this,y(arguments))};H.on=function(){return ta.apply(this,y(arguments))};H.off=function(){return ba.apply(this,y(arguments))};H.handlers=function(){return ea.apply(this,y(arguments))};H.emit=function(){return na.apply(this,y(arguments))};H.create=function(){return ja.apply(this,y(arguments))};H.destroy=function(){return ga.apply(this,y(arguments))};
|
|
H.setData=function(){return ka.apply(this,y(arguments))};H.clearData=function(){return Aa.apply(this,y(arguments))};H.getData=function(){return qa.apply(this,y(arguments))};H.focus=H.activate=function(){return oa.apply(this,y(arguments))};H.blur=H.deactivate=function(){return Qa.apply(this,y(arguments))};H.activeElement=function(){return Va.apply(this,y(arguments))};var Fa=0,Y={},Ma=0,va={},ma={};D(L,{autoActivate:!0});var Na=function(a){var b=this;b.id=""+Fa++;Y[b.id]={instance:b,elements:[],handlers:{}};
|
|
a&&b.clip(a);H.on("*",function(a){return b.emit(a)});H.on("destroy",function(){b.destroy()});H.create()},Ya=function(a,c){var d,e,f,g={},h=(e=Y[this.id])&&e.handlers;if(!e)throw Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");if("string"===typeof a&&a)f=a.toLowerCase().split(/\s+/);else if("object"===typeof a&&a&&"undefined"===typeof c)for(d in a)if(x.call(a,d)&&"string"===typeof d&&d&&"function"===typeof a[d])this.on(d,a[d]);if(f&&f.length){d=0;for(e=f.length;d<
|
|
e;d++)a=f[d].replace(/^on/,""),g[a]=!0,h[a]||(h[a]=[]),h[a].push(c);g.ready&&B.ready&&this.emit({type:"ready",client:this});if(g.error){d=0;for(e=R.length;d<e;d++)if(B[R[d].replace(/^flash-/,"")]){this.emit({type:"error",name:R[d],client:this});break}J!==b&&H.version!==J&&this.emit({type:"error",name:"version-mismatch",jsVersion:H.version,swfVersion:J})}}return this},wa=function(a,b){var c,d,e,f,g,h=(d=Y[this.id])&&d.handlers;if(!h)return this;if(0===arguments.length)f=w(h);else if("string"===typeof a&&
|
|
a)f=a.split(/\s+/);else if("object"===typeof a&&a&&"undefined"===typeof b)for(c in a)x.call(a,c)&&"string"===typeof c&&c&&"function"===typeof a[c]&&this.off(c,a[c]);if(f&&f.length)for(c=0,d=f.length;c<d;c++)if(a=f[c].toLowerCase().replace(/^on/,""),(g=h[a])&&g.length)if(b)for(e=g.indexOf(b);-1!==e;)g.splice(e,1),e=g.indexOf(b,e);else g.length=0;return this},ha=function(a){var b=null,c=Y[this.id]&&Y[this.id].handlers;c&&(b="string"===typeof a&&a?c[a]?c[a].slice(0):[]:E(c));return b},pa=function(b){var c;
|
|
var d=b;if(!d||!d.type||d.client&&d.client!==this)c=!1;else{var e=(c=Y[this.id])&&c.elements,f=!!e&&0<e.length,g=!d.target||f&&-1!==e.indexOf(d.target),e=d.relatedTarget&&f&&-1!==e.indexOf(d.relatedTarget),d=d.client&&d.client===this;c=c&&(g||e||d)?!0:!1}if(c&&("object"===typeof b&&b&&"string"===typeof b.type&&b.type&&(b=D({},b)),b=D({},Ia(b),{client:this}),g=Y[this.id],"object"===typeof b&&b&&b.type&&g&&(c=Ua(b),(g=(g&&g.handlers["*"]||[]).concat(g&&g.handlers[b.type]||[]))&&g.length)))for(var h,
|
|
k,d=0,e=g.length;d<e;d++)f=g[d],h=this,"string"===typeof f&&"function"===typeof a[f]&&(f=a[f]),"object"===typeof f&&f&&"function"===typeof f.handleEvent&&(h=f,f=f.handleEvent),"function"===typeof f&&(k=D({},b),Ja(f,h,[k],c));return this},Ga=function(a){if(!Y[this.id])throw Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");a=xa(a);for(var b=0;b<a.length;b++)if(x.call(a,b)&&a[b]&&1===a[b].nodeType){a[b].zcClippingId?-1===va[a[b].zcClippingId].indexOf(this.id)&&va[a[b].zcClippingId].push(this.id):
|
|
(a[b].zcClippingId="zcClippingId_"+Ma++,va[a[b].zcClippingId]=[this.id],!0===L.autoActivate&&gb(a[b]));var c=Y[this.id]&&Y[this.id].elements;-1===c.indexOf(a[b])&&c.push(a[b])}return this},la=function(a){var b=Y[this.id];if(!b)return this;var b=b.elements,c;a="undefined"===typeof a?b.slice(0):xa(a);for(var d=a.length;d--;)if(x.call(a,d)&&a[d]&&1===a[d].nodeType){for(c=0;-1!==(c=b.indexOf(a[d],c));)b.splice(c,1);var e=va[a[d].zcClippingId];if(e){for(c=0;-1!==(c=e.indexOf(this.id,c));)e.splice(c,1);
|
|
if(0===e.length){if(!0===L.autoActivate&&(c=a[d])&&1===c.nodeType&&(e=ma[c.zcClippingId],"object"===typeof e&&e)){for(var f=void 0,g=void 0,h=["move","leave","enter","out","over"],k=0,l=h.length;k<l;k++)f="mouse"+h[k],g=e[f],"function"===typeof g&&c.removeEventListener(f,g,!1);delete ma[c.zcClippingId]}delete a[d].zcClippingId}}}return this},Oa=function(){var a=Y[this.id];return a&&a.elements?a.elements.slice(0):[]},ia=function(){Y[this.id]&&(this.unclip(),this.off(),delete Y[this.id])},xa=function(a){"string"===
|
|
typeof a&&(a=[]);return"number"!==typeof a.length?[a]:a},gb=function(b){if(b&&1===b.nodeType){var c=function(b){if(b||(b=a.event))"js"!==b.R99&&(b.stopImmediatePropagation(),b.preventDefault()),delete b.R99},d=function(d){if(d||(d=a.event))c(d),H.focus(b)};b.addEventListener("mouseover",d,!1);b.addEventListener("mouseout",c,!1);b.addEventListener("mouseenter",c,!1);b.addEventListener("mouseleave",c,!1);b.addEventListener("mousemove",c,!1);ma[b.zcClippingId]={mouseover:d,mouseout:c,mouseenter:c,
|
|
mouseleave:c,mousemove:c}}};H._createClient=function(){Na.apply(this,y(arguments))};H.prototype.on=function(){return Ya.apply(this,y(arguments))};H.prototype.off=function(){return wa.apply(this,y(arguments))};H.prototype.handlers=function(){return ha.apply(this,y(arguments))};H.prototype.emit=function(){return pa.apply(this,y(arguments))};H.prototype.clip=function(){return Ga.apply(this,y(arguments))};H.prototype.unclip=function(){return la.apply(this,y(arguments))};H.prototype.elements=function(){return Oa.apply(this,
|
|
y(arguments))};H.prototype.destroy=function(){return ia.apply(this,y(arguments))};H.prototype.setText=function(a){if(!Y[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");H.setData("text/plain",a);return this};H.prototype.setHtml=function(a){if(!Y[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");H.setData("text/html",a);return this};H.prototype.setRichText=function(a){if(!Y[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");
|
|
H.setData("application/rtf",a);return this};H.prototype.setData=function(){if(!Y[this.id])throw Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");H.setData.apply(this,y(arguments));return this};H.prototype.clearData=function(){if(!Y[this.id])throw Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");H.clearData.apply(this,y(arguments));return this};H.prototype.getData=function(){if(!Y[this.id])throw Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");
|
|
return H.getData.apply(this,y(arguments))};"function"===typeof define&&define.amd?define(function(){return H}):"object"===typeof module&&module&&"object"===typeof module.exports&&module.exports?module.exports=H:a.ZeroClipboard=H})(function(){return this||window}());var svgAsset=function(){var a={},b,c=function(c,e){var f=a[c];f||(f='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"></svg>',window.console&&console.error&&console.error('svgAsset: "'+c+'" was not registered'));if("string"===typeof e){var g=/^\s*(\d*)\s*x\s*(\d*)\s*$/i.exec(e);if(!g)throw new TypeError("attrs must be an object or size string");e={};g[1]&&(e.width=g[1]);g[2]&&(e.height=g[2])}b||(b=document.createElement("div"));b.innerHTML=f;for(f=0;f<b.childNodes.length;f++)if(g=b.childNodes[f],
|
|
1===g.nodeType){b.removeChild(g);if(e)for(var h in e)g.setAttribute(h,e[h]);return g}};c.register=function(b){for(var c in b)a[c]=b[c].toString()};return c}();var TradingView=TradingView||{};
|
|
TradingView.ChartingLibraryBackend=function(){var a={},b,c,d,e;a.initialize=function(a,g,h,k){b=a;c=g;d=h;e=k};a.getCharts=function(a){return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(d,e,b,c),type:"GET",crossDomain:!0}).done(function(b){b=JSON.parse(b);"ok"!=b.status&&console.warn("Charts list request failed: "+b.message);b=b.data.map(function(a){return{id:a.id,name:a.name,image_url:a.id,modified_iso:a.timestamp,short_symbol:a.symbol,interval:a.resolution}});a(b)})};a.removeChart=function(a,
|
|
g){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,e,b,c,a),type:"DELETE",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=a.status&&console.warn("Chart delete request failed: "+a.message);g()})};a.saveChart=function(a,g,h,k,l,m,n){var p="{0}/{1}/charts?client={2}&user={3}".format(d,e,b,c);"undefined"!=typeof l&&(p+="&chart="+l);$.ajax({url:p,data:{name:a,content:JSON.stringify(k),symbol:g,resolution:h},type:"POST",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=
|
|
a.status?(console.warn("Chart save request failed: "+a.message),n()):m(a.id)}).fail(function(){n()})};a.loadChart=function(a){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,e,b,c,a.id),type:"GET",crossDomain:!0}).done(function(b){b=JSON.parse(b);"ok"!=b.status?console.warn("Chart load request failed: "+b.message):(b=JSON.parse(b.data.content),b.uid=a.id,D17.emit("chart_load_requested",b))}).fail(function(){console.warn("Error loading chart")})};a.removeStudyTemplate=
|
|
function(a,g){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(d,e,b,c,a),type:"DELETE",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=a.status&&console.warn("Chart delete request failed: "+a.message);g()})};a.getStudyTemplateContent=function(a,g){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(d,e,b,c,a),type:"GET",crossDomain:!0}).done(function(a){g(JSON.parse(a).data)})};a.saveStudyTemplate=function(a,g){$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(d,
|
|
e,b,c),type:"POST",crossDomain:!0,data:{name:a.name,content:a.content}}).done(function(a){a=JSON.parse(a);"ok"!=a.status&&console.warn("Template save request failed: "+a.message);g({error:"ok"==a.status?"":a.status})})};a._templatesCache=null;a.getStudyTemplatesList=function(f){a._templatesCache?f(a._templatesCache):$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(d,e,b,c),type:"GET",crossDomain:!0}).done(function(b){b=JSON.parse(b);"ok"!=b.status?console.warn("Templates list request failed: "+
|
|
b.message):(b=b.data.map(function(a){return{is_default:!1,name:a.name}}),a._templatesCache=b,f(b))})};a.clearStudyTemplatesListCache=function(b){a._templatesCache=null};return a}();var localizationReady=$.Deferred();$.i18n.init({lng:urlParams.locale,load:"unspecific",resGetPath:"localization/translations/__lng__.json",keyseparator:"@",nsseparator:"@",fallbackLng:"en"},function(a){localizationReady.resolve();$(window).resize();$(".loading-indicator").hide()});svgAsset.register({LineTool5PointsPattern:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M25.3 19L22.5 8H24V4h-4v4h1.3l-4 4h-2.4L12 7.6V4H8v4h1.5L5.7 23H4v4h4v-3.4l6.8-7.6h2.798L23 19.9V23h4v-4zM9 7V5h2v2zM7.003 26H5v-2h2v2zM14 15.4L7.2 23h-.397L10.5 8.102l-.498-.098h1.1l2.898 4.4zm3-.4h-2v-2h2zm4-8V5h2v2zm-3.002 8.102v-2.4l3.698-3.697L24.2 19h-.8zM26 22h-2v-2h2z"/></svg>',LineToolABCD:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M21 3v1.975l-9 4.91V9H8v4h1.34L7.648 24H6v4h4v-1.975l9-4.91V22h4v-4h-1.34l1.692-11H25V3zm1 1h2v2h-2zm-1 2.115V7h1.34l-1.692 11h-1.12L12 12.145v-1.12zM9 10h2v2H9zm1.352 3h1.12L19 18.855v1.12l-9 4.91V24H8.66zM20 19h2v2h-2zM7 25h2v2H7z"/></svg>',
|
|
LineToolArc:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M455.1 285.4C310.8 141.1 110.9 106.7 4.2 206l23.2 23.3c.2-.2.5-.4.8-.6l483.7 483.7c-.2.3-.4.5-.6.8l23.2 23.2c99.3-106.8 64.9-306.7-79.4-451zm76.2 400.1L55 209.2c98.3-58.6 256.8-19.5 376.3 100s158.7 278.1 100 376.3z"/></svg>',LineToolArrow:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M21 5v3.302l-5.598 2.3 1.7 1.702L9.298 20H6v4h4v-3.298l7.7-7.7 1.5 1.5 2.3-5.4.102-.1L25 9V5zM9 23H7v-2h2zM24 8l-1.9-.002.1-.2-.202.1L22 6h2z"/></svg>',
|
|
LineToolArrowMarkDown:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M16 27l10-13h-6V6h-8v8H6l10 13zm0-1.5L8 15h5V7h6v8h5l-8 10.5z"/><path d="M16 25.5L8 15h5V7h6v8h5z" opacity=".3"/></svg>',LineToolArrowMarkLeft:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M5 16l13 10v-6h8v-8h-8V6L5 16zm1.5 0L17 8v5h8v6h-8v5L6.5 16z"/><path d="M6.5 16L17 8v5h8v6h-8v5z" opacity=".3"/></svg>',
|
|
LineToolArrowMarkRight:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M26 16L13 6v6H5v8h8v6l13-10zm-1.5 0L14 24v-5H6v-6h8V8l10.5 8z"/><path d="M24.5 16L14 24v-5H6v-6h8V8z" opacity=".3"/></svg>',LineToolArrowMarkUp:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M15 5L5 18h6v8h8v-8h6L15 5zm0 1.5L23 17h-5v8h-6v-8H7l8-10.5z"/><path d="M15 6.5L23 17h-5v8h-6v-8H7z" opacity=".3"/></svg>',
|
|
LineToolBalloon:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M139.9 488.7H134c-64.3-2.9-113.9-55.5-113.9-116.9 0-64.3 55.5-116.9 122.7-116.9h309.7c67.2 0 122.7 52.6 122.7 116.9s-55.5 116.9-122.7 116.9H224.6v93.5l-84.7-93.5z" fill-opacity=".2"/><path d="M452.5 269.5c58.4 0 108.1 46.7 108.1 102.3s-49.7 102.3-108.1 102.3H210v70.1l-55.5-61.4-8.8-8.8H134c-55.5-2.9-99.3-49.7-99.3-102.3 0-55.5 49.7-102.3 108.1-102.3h309.7m0-29.1H142.8c-76 0-137.3 58.4-137.3 131.5 0 70.1 58.4 125.6 128.6 131.5l105.2 116.9V503.3h213.3c76 0 137.3-58.4 137.3-131.5s-61.4-131.5-137.4-131.5z"/></svg>',
|
|
LineToolBarsPattern:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M17 4v2h-1v11h1v6h1v-6h1V6h-1V4zm8 0v2h-1v11h1v6h1v-6h1V6h-1V4zM4 5v2H3v11h1v6h1v-6h1V7H5V5zm9 0v2h-1v11h1v6h1v-6h1V7h-1V5zM8 7v6H7v11h1v2h1v-2h1V13H9V7zm9 0h1v9h-1zm8 0h1v9h-1zM4 8h1v9H4zm9 0h1v9h-1zm8 0v3h-1v11h1v2h1v-2h1V11h-1V8zm0 4h1v9h-1zM8 14h1v9H8z"/></svg>',LineToolBezierCubic:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M23 3v4h1.447c-.458.96-3.4 6.5-10.447 6.5-4.187 0-6.633 2.41-7.938 4.758-1.304 2.35-1.558 4.687-1.558 4.687L5 23H3v4h4v-4H5.504c.018-.15.282-2.186 1.434-4.258C8.133 16.592 10.188 14.5 14 14.5c8.292 0 11.46-7.303 11.46-7.303L25 7h2V3h-4zm1 1h2v2h-2V4zM4 24h2v2H4v-2z"/></svg>',
|
|
LineToolBezierQuadro:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M23 3v1.5c-9.658 0-14.39 4.657-16.576 9.287C4.256 18.377 4.496 22.922 4.5 23H3v4h4v-4H5l.5-.027s-.237-4.39 1.826-8.76C9.39 9.843 13.658 5.5 23 5.5V7h4V3zm1 1h2v2h-2zM4 24h2v2H4z"/></svg>',LineToolBrush:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M377.6 283.1s-136.2-10.2-183.8 170.2c-30.6 115.7-177 251.9-177 251.9l10.2 17s224.7-54.5 360.8-139.6c177-112.3 64.7-255.3 64.7-255.3l-74.9-44.2zm44.3-143L374.2 249l122.5 68.1 78.3-88.5-153.1-88.5z"/></svg>',
|
|
LineToolCallout:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M179.9 462.6h-42.1c-25.9 0-48.6-22.7-48.6-48.6V284.6c0-25.9 22.7-48.6 48.6-48.6h388.5c25.9 0 48.6 22.7 48.6 48.6v129.5c0 25.9-22.7 48.6-48.6 48.6H264L56.9 605.1l123-142.5z" fill-opacity=".2"/><path d="M526.3 252.2c19.4 0 32.4 12.9 32.4 32.4v129.5c0 19.4-12.9 32.4-32.4 32.4H257.6l-9.7 6.5-97.1 64.7 16.2-16.2 45.3-55h-74.5c-19.4 0-32.4-12.9-32.4-32.4V284.6c0-19.4 12.9-32.4 32.4-32.4h388.5m0-32.4H137.8c-35.6 0-64.7 29.1-64.7 64.7V414c0 35.6 29.1 64.7 64.7 64.7h6.5L1.8 640.7H31l233-161.9h259c35.6 0 64.7-29.1 64.7-64.7V284.6c3.3-35.6-25.8-64.8-61.4-64.8z"/></svg>',
|
|
LineToolCircleLines:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M7 4v22h1V4H7zm5 0v22h1V4h-1zm5 0v22h1V4h-1zm5 0v22h1V4h-1z"/></svg>',LineToolDateRange:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M4 10v11h1v-5h15v3l5-3.5-5-3.5v3H5v-5H4zm21 5.5V21h1V10h-1v5.5z"/></svg>',LineToolDisjointAngle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M22 3v2.047L9 10.352V10H5v4h4v-2.566l13-5.307V7h4V3zm1 1h2v2h-2zM6 11h2v2H6zm-1 6v4h4v-.783l13 5.2V28h4v-4h-4v.34l-13-5.2V17zm1 1h2v2H6zm17 7h2v2h-2z"/></svg>',
|
|
LineToolElliottCircle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M566.9 338.7v-24h24v-24h-72v24h24v119.9h-24v24h72v-24h-24v-95.9zm-407.5 71.9c-26.4 0-47.9 21.6-47.9 47.9s21.6 47.9 47.9 47.9 47.9-21.6 47.9-47.9-21.5-47.9-47.9-47.9zm57.5 86.3l-16.8 16.8 47.9 47.9 16.8-16.8-47.9-47.9zm124.7 47.9l16.8 16.8 119.9-119.9-16.9-16.7-119.8 119.8zm-38.4 9.6c-26.4 0-47.9 21.6-47.9 47.9 0 26.4 21.6 47.9 47.9 47.9s47.9-21.6 47.9-47.9c.1-26.3-21.5-47.9-47.9-47.9zM6 592.8l16.8 16.8 95.9-95.9-16.8-16.8L6 592.8z"/></svg>',
|
|
LineToolElliottCorrection:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M12 10a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zm10.646.646l-3.91 3.91a3 3 0 0 1 .705.71l3.92-3.912-.71-.708zM9.56 13.734l-3.914 3.912.708.708 3.91-3.91a3 3 0 0 1-.705-.71zm4.883.002a3 3 0 0 1-.71.705l.824.83a3 3 0 0 1 .71-.7l-.824-.82zM17 15a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zM9.97 9.92h-.9l-.626-1.77h-2.75L5.07 9.92h-.86l2.317-6.36h1.128L9.97 9.92zm-1.786-2.5L7.07 4.3 5.95 7.42h2.234zm16.472 15.446c-.016.69-.52 1.47-1.17 1.71-.345.13-2.165.12-3.344.12v-6.36s1.256-.016 1.884 0c1.078.025 1.902.426 2.008 1.41.05.464-.044.95-.483 1.298.87.47 1 1.072 1.11 1.822zm-1.502-2.993c-.015-.403-.39-.807-.82-.81-.344-.002-.727-.006-1.346-.006v1.837c.826-.01 1.11-.012 1.435-.02.356-.01.753-.396.73-1zm.527 2.933c.01-.84-.52-1.185-1.09-1.196-.31-.006-.87-.002-1.59-.002v2.367c.67.026 1.56.05 1.87-.04.42-.118.82-.262.826-1.13z"/></svg>',
|
|
LineToolElliottDoubleCombo:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M12 10a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zm10.646.646l-3.91 3.91a3 3 0 0 1 .705.71l3.92-3.912-.71-.708zM9.56 13.734l-3.914 3.912.708.708 3.91-3.91a3 3 0 0 1-.705-.71zm4.883.002a3 3 0 0 1-.71.705l.824.83a3 3 0 0 1 .71-.7l-.824-.82zM17 15a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zM9.673 3.37L7.477 6.514 9.67 9.73h-.98L6.956 7.113l-1.778 2.62h-.922l2.217-3.18L4.307 3.37h.974L7 5.955 8.75 3.37h.928zm15.28 14.965l-2.24 3.572v2.79h-.845v-2.7l-2.248-3.662h.936l1.74 2.845 1.755-2.845h.91z"/></svg>',
|
|
LineToolElliottImpulse:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M12 10a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zm10.646.646l-3.91 3.91a3 3 0 0 1 .705.71l3.92-3.912-.71-.708zM9.56 13.734l-3.914 3.912.708.708 3.91-3.91a3 3 0 0 1-.705-.71zm4.883.002a3 3 0 0 1-.71.705l.824.83a3 3 0 0 1 .71-.7l-.824-.82zM17 15a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zM8.53 9.808H5.09v-.65h1.324V4.896H5.088v-.58c.833-.094 1.25-.11 1.482-.89h.662V9.16h1.3zM24.014 24.95h-4.922v-1.02c1.178-1.155 3.23-2.536 3.618-4.05.164-.64-.54-1.208-1.416-1.206-.706.002-1.38.325-2.022.635v-1.03c1.824-.69 2.762-.71 3.815.01.458.31.706.99.62 1.53-.295 1.84-2.272 3.173-3.604 4.28h3.91z"/></svg>',
|
|
LineToolElliottMajorRetr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M162.5 446.7c-27 0-49 22.1-49 49 0 27 22.1 49 49 49s49-22.1 49-49-22-49-49-49zm58.9 88.3l-17.2 17.2 49 49 17.2-17.2-49-49zm127.5 49.1l17.2 17.2 122.6-122.6-17.2-17.2-122.6 122.6zm-39.3 9.8c-27 0-49 22.1-49 49 0 27 22.1 49 49 49 27 0 49-22.1 49-49 .1-27-22-49-49-49zm-304 39.2l17.2 17.2 98.1-98.1-17.2-17.2-98.1 98.1zm505.1-370.3h-27l-73.6 193.7h27l22.1-58.9h80.9l22.1 58.9h29.4l-80.9-193.7zm-46.6 112.8l22.1-56.4c4.9-12.3 7.4-24.5 9.8-36.8 2.5 9.8 7.4 24.5 14.7 39.2l19.6 53.9h-66.2z"/></svg>',
|
|
LineToolElliottMinor:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M227.1 479.2l-17.5 17.5 49.9 49.9 17.5-17.5-49.9-49.9zm-59.9-89.9c-27.5 0-49.9 22.5-49.9 49.9 0 27.5 22.5 49.9 49.9 49.9s49.9-22.5 49.9-49.9-22.5-49.9-49.9-49.9zm407-124.9h-7.5v7.5l-17.5 17.5h-32.5v25h50v124.9h25V264.4h-17.5zM317 539.1c-27.5 0-49.9 22.5-49.9 49.9s22.4 50 49.9 50 49.9-22.5 49.9-49.9-22.4-50-49.9-50zm39.9-10l17.5 17.5 124.9-124.9-17.5-17.5-124.9 124.9zm-349.5 50l17.5 17.5 99.9-99.9-17.5-17.5-99.9 99.9z"/></svg>',
|
|
LineToolElliottMinorRetr:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M168.6 391.9c-28.1 0-51.1 23-51.1 51.1s23 51.1 51.1 51.1 51.1-23 51.1-51.1-23-51.1-51.1-51.1zm61.3 92L212 501.8l51.1 51.1L281 535l-51.1-51.1zM362.8 535l17.9 17.9 127.7-127.7-17.9-17.9L362.8 535zm-40.9 10.2c-28.1 0-51.1 23-51.1 51.1s23 51.1 51.1 51.1 51.1-23 51.1-51.1-23-51.1-51.1-51.1zM5.2 586.1L23 603.9l102.2-102.2-17.9-17.9L5.2 586.1zm577.3-227.4c0-7.7-2.6-23-2.6-48.5v-35.8c0-12.8 0-20.4-2.6-25.5-2.6-7.7-5.1-12.8-7.7-17.9-5.1-5.1-10.2-7.7-17.9-12.8-7.7-2.6-20.4-5.1-33.2-5.1-12.8 0-25.5 2.6-35.8 5.1-10.2 2.6-17.9 10.2-23 15.3-5.1 10.2-10.2 17.9-12.8 30.7l25.5 2.6c2.6-10.2 7.7-17.9 12.8-23 5.1-5.1 15.3-7.7 28.1-7.7s23 2.6 30.7 10.2c5.1 5.1 7.7 12.8 7.7 23v7.7c-10.2 2.6-25.5 7.7-48.5 10.2-10.2 2.6-17.9 2.6-23 5.1-7.7 2.6-12.8 5.1-20.4 7.7-5.1 5.1-10.2 10.2-12.8 15.3-2.6 7.7-5.1 12.8-5.1 20.4 0 12.8 5.1 23 15.3 33.2 10.2 7.7 23 12.8 40.9 12.8 10.2 0 20.4-2.6 30.7-5.1 10.2-2.6 17.9-10.2 28.1-17.9 0 7.7 2.6 12.8 5.1 20.4h28.1c-2.5-7.6-5.1-15.3-7.6-20.4zm-28.1-51.1c0 12.8-2.6 20.4-5.1 28.1s-10.2 15.3-17.9 17.9c-7.7 5.1-17.9 7.7-28.1 7.7s-17.9-2.6-23-7.7c-5.1-5.1-7.7-10.2-7.7-17.9 0-5.1 0-10.2 2.6-12.8 2.6-5.1 5.1-7.7 10.2-7.7 5.1-2.6 12.8-2.6 23-5.1 20.4-2.6 33.2-5.1 43.4-10.2v7.7h2.6z"/></svg>',
|
|
LineToolElliottSubminuette:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M564.1 417.7h25.2v-126h-25.2v126zm0-176.3v25.2h25.2v-25.2h-25.2zM161.2 367.3c-27.7 0-50.4 22.7-50.4 50.4s22.7 50.4 50.4 50.4 50.4-22.7 50.4-50.4c-.1-27.7-22.7-50.4-50.4-50.4zm60.4 90.6L204 475.6l50.4 50.4 17.6-17.6-50.4-50.5zm131 50.4l17.6 17.6L496.1 400l-17.6-17.6-125.9 125.9zm-40.3 10.1c-27.7 0-50.4 22.7-50.4 50.4s22.7 50.4 50.4 50.4 50.4-22.7 50.4-50.4-22.7-50.4-50.4-50.4zM0 558.7l17.6 17.6 100.7-100.7-17.6-17.6L0 558.7z"/></svg>',
|
|
LineToolElliottTriangle:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M12 10a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zm10.646.646l-3.91 3.91a3 3 0 0 1 .705.71l3.92-3.912-.71-.708zM9.56 13.734l-3.914 3.912.708.708 3.91-3.91a3 3 0 0 1-.705-.71zm4.883.002a3 3 0 0 1-.71.705l.824.83a3 3 0 0 1 .71-.7l-.824-.82zM17 15a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zM9.97 9.92h-.9l-.626-1.77h-2.75L5.07 9.92h-.86l2.317-6.36h1.128L9.97 9.92zm-1.786-2.5L7.07 4.3 5.95 7.42h2.234zm16.472 15.446c-.016.69-.52 1.47-1.17 1.71-.345.13-2.165.12-3.344.12v-6.36s1.256-.016 1.884 0c1.078.025 1.902.426 2.008 1.41.05.464-.044.95-.483 1.298.87.47 1 1.072 1.11 1.822zm-1.502-2.993c-.015-.403-.39-.807-.82-.81-.344-.002-.727-.006-1.346-.006v1.837c.826-.01 1.11-.012 1.435-.02.356-.01.753-.396.73-1zm.527 2.933c.01-.84-.52-1.185-1.09-1.196-.31-.006-.87-.002-1.59-.002v2.367c.67.026 1.56.05 1.87-.04.42-.118.82-.262.826-1.13z"/></svg>',
|
|
LineToolElliottTripleCombo:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M12 10a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zm10.646.646l-3.91 3.91a3 3 0 0 1 .705.71l3.92-3.912-.71-.708zM9.56 13.734l-3.914 3.912.708.708 3.91-3.91a3 3 0 0 1-.705-.71zm4.883.002a3 3 0 0 1-.71.705l.824.83a3 3 0 0 1 .71-.7l-.824-.82zM17 15a2 2 0 0 0-2 2 2 2 0 0 0 2 2 2 2 0 0 0 2-2 2 2 0 0 0-2-2zM9.673 3.37L7.477 6.514 9.67 9.73h-.98L6.956 7.113l-1.778 2.62h-.922l2.217-3.18L4.307 3.37h.974L7 5.955 8.75 3.37h.928zm15.28 14.965l-2.24 3.572v2.79h-.845v-2.7l-2.248-3.662h.936l1.74 2.845 1.755-2.845h.91z"/></svg>',
|
|
LineToolEllipse:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M13 5v1.557C10.26 6.84 7.792 7.69 5.887 8.95c-2.36 1.564-3.885 3.78-3.885 6.27 0 2.49 1.525 4.708 3.885 6.27 2.36 1.563 5.574 2.508 9.115 2.508 3.54 0 6.755-.945 9.115-2.508 2.36-1.562 3.885-3.78 3.885-6.27 0-2.49-1.525-4.706-3.885-6.27C22.21 7.69 19.743 6.84 17 6.558V5zm1 1h2v2h-2zm3 1.562c2.555.282 4.838 1.08 6.563 2.223C25.727 11.218 27 13.14 27 15.22c0 2.082-1.273 4-3.438 5.434-2.164 1.433-5.198 2.342-8.56 2.342s-6.398-.91-8.563-2.342C4.27 19.22 3 17.302 3 15.22c0-2.08 1.27-4 3.435-5.433 1.723-1.14 4.006-1.94 6.56-2.22V9h4z"/></svg>',
|
|
LineToolExtended:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M23.605 6.646l-4.34 4.34L16 11l-.014 3.307L13.293 17H10v3.293l-3.354 3.353.708.708L10.707 21H14v-3.293l2.67-2.67L20 15v-3.334l4.313-4.312zM17 12h2v2h-2zm-6 6h2v2h-2z"/></svg>',LineToolFibChannel:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M387.382 160.99L19.62 528.75 5.193 514.327l367.763-367.762zM399.6 195.6v67.3l-259 259H73.2v81.6h81.6v-67.3l259-259h67.3v-81.6h-81.5zM134.4 583.1H93.6v-40.8h40.8v40.8zm326.3-326.3h-40.8V216h40.8v40.8zm114.2 73.4L426.1 481.1h-53l175.4-175.4-14.3-14.3-367.1 367.2 14.3 14.3 175.4-175.4v53l-151 150.9 14.3 14.3L371 564.8h69.3v-67.3l150.9-150.9-16.3-16.4zm-155 212.1h-40.8v-40.8h40.8v40.8zm88.53-257.64L162.304 630.787 147.88 616.36l346.125-346.124z"/></svg>',
|
|
LineToolFibCircles:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 362.3c-32.2 0-58.6 26.4-58.6 58.6s26.4 58.6 58.6 58.6 58.6-26.4 58.6-58.6-26.3-58.6-58.6-58.6zm0 87.9c-17.6 0-29.3-14.7-29.3-29.3 0-17.6 14.7-29.3 29.3-29.3 17.6 0 29.3 14.7 29.3 29.3 0 17.6-11.7 29.3-29.3 29.3zm0-175.8c-79.1 0-146.5 64.5-146.5 146.5s64.5 146.5 146.5 146.5S444.2 503 444.2 420.9s-67.4-146.5-146.6-146.5zm0 263.8c-64.5 0-117.2-52.7-117.2-117.2s52.7-117.2 117.2-117.2S414.8 356.5 414.8 421s-52.7 117.2-117.2 117.2zm0-322.4c-114.3 0-205.1 90.8-205.1 205.1S183.3 626 297.6 626s205.1-90.8 205.1-205.1-90.8-205.1-205.1-205.1zm0 381c-96.7 0-175.8-79.1-175.8-175.8s79.1-175.8 175.8-175.8S473.4 324.3 473.4 421s-79.1 175.8-175.8 175.8zm0-468.9c-161.2 0-293 131.9-293 293s131.9 293 293 293 293-131.9 293-293-131.8-293-293-293zm0 556.8C151.1 684.7 33.9 567.5 33.9 421s117.2-263.7 263.7-263.7S561.3 274.5 561.3 421 444.2 684.7 297.6 684.7z"/></svg>',
|
|
LineToolFibRetracement:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M4.3 642.1H591v-32.6H4.3v32.6zm0-195.6H591v-32.6H4.3v32.6zm0-228.1V251H591v-32.6H4.3z"/></svg>',LineToolFibSpeedResistanceArcs:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297.6 439.5c79 0 146.3-64.4 146.3-146.3h-29.3c0 64.4-52.7 117.1-117.1 117.1s-117.1-52.7-117.1-117.1h-29.3c.2 82 64.6 146.3 146.5 146.3zm0-87.7c32.2 0 58.5-26.3 58.5-58.5h-29.3c0 17.6-14.6 29.3-29.3 29.3s-29.3-14.6-29.3-29.3h-29.3c.2 32.1 26.5 58.5 58.7 58.5zm0 146.3c114.1 0 204.8-90.7 204.8-204.8h-29.3c0 96.6-79 175.6-175.6 175.6s-175.6-79-175.6-175.6H92.8c0 114.1 90.7 204.8 204.8 204.8zM561 293.2c0 146.3-117.1 263.4-263.4 263.4S34.3 439.5 34.3 293.2H5c0 161 131.7 292.6 292.6 292.6s292.6-131.7 292.6-292.6H561z"/></svg>',
|
|
LineToolFibSpeedResistanceFan:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H21v-6.102l.182.424 1.838-.787-.393-.92-1.627.7v-7.61l2.854-2.852-.708-.708L20.293 9h-7.607l.7-1.627-.92-.393-.788 1.838.424.182H6V4.5H5zM6 10h13.293l-5 5h-4.178l.117-.273-.92-.395-.285.668H6v-5zm4.89.656l-.788 1.838.918.395.79-1.84-.92-.4zm9.11.05V24h-5v-3.027l.668-.286-.395-.92-.273.118v-4.178l5-5zm6.303 4.335l-1.838.79.394.92 1.83-.79-.4-.91zM6 16h2.6l-.075.172.92.392.242-.564h3.606l-6.31 6.31.1-.23-.92-.394-.163.378V16zm8 .707v3.605l-.564.243.392.92L14 21.4V24H7.936l.378-.162-.394-.92-.23.098 6.31-6.31zM7.738 18.01l-.79 1.838.92.394.788-1.84-.918-.392zm11.21.18l-1.837.79.4.918 1.84-.787-.39-.92zm-7.35 3.154l-1.84.787.394.92 1.838-.78-.392-.92z"/></svg>',
|
|
LineToolFibSpiral:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M411.2 234c-83.058 0-152.1 69.043-152.1 152.1 0 17.915 3.948 35.028 11.01 50.504l-150.4 30.076c-12.193-30.528-18.91-63.825-18.91-98.68h-20c0 36.155 6.758 70.764 19.046 102.652l-95.88 19.174 5.06 25.3L110.48 494.84C157.367 589.342 254.892 654.5 367.3 654.5c126.89 0 232.2-102.785 232.2-232.2 0-103.637-84.663-188.3-188.3-188.3zm0 20c92.76 0 168.3 75.54 168.3 168.3 0 118.587-96.087 212.2-212.2 212.2-102.81 0-192.092-58.358-236.532-143.72l153.378-30.673c22.716 30.04 58.685 49.694 98.655 49.694 54.71 0 100.4-45.69 100.4-100.4 0-46.72-38.25-82.4-82.4-82.4v20c33.46 0 62.4 26.53 62.4 62.4 0 43.5-36.9 80.4-80.4 80.4-29.91 0-57.24-13.27-76.33-34.15l90.29-18.053-5.06-25.3-101.3 20.26c-7.21-14.047-11.3-29.85-11.3-46.45 0-71.943 60.16-132.1 132.1-132.1z"/></svg>',
|
|
LineToolFibTimeZone:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M7 4v22h1V4zm5 0v22h1V4zm10 0v22h1V4z"/></svg>',LineToolFibWedge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M566.4 639.5C530.1 399.6 337.6 207.1 97.7 170.8v-33.5H14V221h27.9v418.5H14v83.7h83.7v-27.9h418.5v27.9h83.7v-83.7h-33.5zM41.9 165.2h27.9v27.9H41.9v-27.9zm27.9 530.1H41.9v-27.9h27.9v27.9zm27.9-27.9v-27.9H69.8v-106c67 16.7 117.2 67 133.9 133.9h-106zm133.9 0c-16.7-80.9-80.9-145.1-161.8-161.8v-83.7c125.5 22.3 223.2 120 245.5 245.5h-83.7zm111.6 0C320.9 527.9 209.3 416.3 69.8 394v-83.7c186.9 22.3 334.8 170.2 359.9 357.1h-86.5zm173 0h-58.6C432.5 466.5 270.7 304.7 69.8 279.6V221h27.9v-19.5c226 36.3 404.5 214.8 438 438h-19.5v27.9zm55.8 27.9h-27.9v-27.9H572v27.9z"/></svg>',
|
|
LineToolFlagMark:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M303.306 426.633v-241.3h189.7l-93.1 120.7 96.5 120.6zM276.9 399.2c-3.4-3.4-6.9-3.4-13.8-3.4H111.4V154.4h148.3c3.4 0 13.8 10.3 17.2 17.2zm-17.2-262.1H94.2V413h169c13.8 0 31 31 31 31V164.7s-13.8-27.6-34.5-27.6zm-172.4 0H52.8v586.2h34.5zm443.606 30.933h-241.4v275.9h241.4l-110.4-138z"/><path d="M107.02 155.182v244.363h172.126V155.182H107.02zm194.423 26.754v251.5h206.91l-108.81-127.534L508.35 181.936H301.44z" opacity=".2"/></svg>',
|
|
LineToolFlatBottom:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M22 4v2.87L7 13.048V13H3v4h4v-2.87l15-6.177V8h4V4h-4zm1 1h2v2h-2V5zM4 14h2v2H4v-2zm-1 8v4h4v-1.5h15V26h4v-4h-4v1.5H7V22H3zm1 1h2v2H4v-2zm19 0h2v2h-2v-2z"/></svg>',LineToolGannComplex:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M4 4v22h22V4zm2.12 1H11v.285l-.303.832c-.85-.32-1.644-.564-2.36-.74C7.474 5.167 6.76 5.065 6.12 5zm6.048 0H18v5.38c-2.16-1.71-4.19-2.907-6-3.72V5.465zM19 5h5.293L19 10.293zm6 .707V11h-5.293zM5 5.91c.69.014 1.72.102 3.098.44.68.167 1.44.4 2.257.71L8.922 11H5zm7 1.856c1.574.743 3.314 1.785 5.172 3.234H12zm-1 .45V11H9.986zM5 12h3.56l-2.183 6H5zm4.623 0H11v6H7.44zM12 12h5.293L12 17.293zm7.848 0H25v5.832l-.465.168h-.97c-.76-2.048-1.93-4.177-3.717-6zm-.848.574c1.636 1.63 2.735 3.547 3.473 5.426H19zm-1 .133V18h-5.293zM5 19h1.014L5 21.785zm2.078 0h3.215L5.24 24.053zM12 19h6v1.377l-6 2.182zm7 0h2.785L19 20.014zm5.715 0H25v6h-.04c-.048-1.186-.233-3.292-.97-5.736zm-1.68.61c.682 2.29.868 4.265.92 5.39H19v-3.922zM11 19.708v3.215L5.947 24.76zm7 1.734V25h-6v-1.377zm-7 2.546V25H8.215z"/></svg>',
|
|
LineToolGannFan:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M14.04 3.303l-.788 1.838.92.4.787-1.84-.92-.39zM5 4.5V25h20.5v-1H7.936l.378-.162-.394-.92-.23.098L23.855 6.854l-.708-.708L6.984 22.31l.098-.23-.92-.394-.162.378V4.5H5zm7.465 2.48l-.787 1.838.918.393.79-1.83-.92-.39zm-1.576 3.676l-.79 1.838.92.395.79-1.84-.92-.4zm-1.58 3.676l-.79 1.84.92.392.78-1.837-.92-.395zm16.99.71l-1.84.786.39.92 1.832-.79-.394-.917zm-3.68 1.573l-1.84.79.39.917 1.84-.787-.397-.92zM7.73 18.01l-.787 1.838.92.394.78-1.84-.918-.392zm11.213.18l-1.84.79.39.918 1.84-.787-.396-.92zm-3.68 1.578l-1.84.787.392.92 1.84-.788-.396-.92zm-3.678 1.576l-1.84.787.393.92 1.84-.78-.393-.92z"/></svg>',
|
|
LineToolGannSquare:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" enable-background="new 0 0 32 32" width="30" height="30"><path d="M5 5v20h20V5H5zm14 1h5v3h-5V6zm0 4h5v4h-5v-4zm-6-4h5v3h-5V6zm0 4h5v4h-5v-4zm5 5v5h-5v-5h5zM9 6h3v3H9V6zm0 4h3v4H9v-4zm3 5v5H9v-5h3zM6 6h2v3H6V6zm0 4h2v4H6v-4zm0 5h2v5H6v-5zm0 9v-3h2v3H6zm3 0v-3h3v3H9zm4 0v-3h5v3h-5zm11 0h-5v-3h5v3zm-5-4v-5h5v5h-5z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',LineToolGannSquare2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M4 4v22h22V4zm2.12 1H11v.285l-.303.832c-.85-.32-1.644-.564-2.36-.74C7.474 5.167 6.76 5.065 6.12 5zm6.048 0H18v5.38c-2.16-1.71-4.19-2.907-6-3.72V5.465zM19 5h5.293L19 10.293zm6 .707V11h-5.293zM5 5.91c.69.014 1.72.102 3.098.44.68.167 1.44.4 2.257.71L8.922 11H5zm7 1.856c1.574.743 3.314 1.785 5.172 3.234H12zm-1 .45V11H9.986zM5 12h3.56l-2.183 6H5zm4.623 0H11v6H7.44zM12 12h5.293L12 17.293zm7.848 0H25v5.832l-.465.168h-.97c-.76-2.048-1.93-4.177-3.717-6zm-.848.574c1.636 1.63 2.735 3.547 3.473 5.426H19zm-1 .133V18h-5.293zM5 19h1.014L5 21.785zm2.078 0h3.215L5.24 24.053zM12 19h6v1.377l-6 2.182zm7 0h2.785L19 20.014zm5.715 0H25v6h-.04c-.048-1.186-.233-3.292-.97-5.736zm-1.68.61c.682 2.29.868 4.265.92 5.39H19v-3.922zM11 19.708v3.215L5.947 24.76zm7 1.734V25h-6v-1.377zm-7 2.546V25H8.215z"/></svg>',
|
|
LineToolHeadAndShoulders:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M13 0v4h1.06l-5.2 13h-.247l-3-6H7V7H3v4h.8l-1.958 8.242-1.91.262.136.992 1.526-.21L.236 26H0v4h4v-4H1.264l1.392-5.86L7 19.546V21h4v-2.002l7-.96V19h4v-1.512l4.043-.554L28.33 24H26v4h4v-4h-.617l-2.332-7.203 3.02-.414-.13-.992-3.19.44-1.9-5.83H26V6h-4v4h.99l-2.898 4.867L15.844 4H17V0zm1 1h2v2h-2zm.95 3.46L19.073 15H18v2.027l-7 .96V17H9.94zM23 7h2v2h-2zM4 8h2v2H4zm19.924 2.39l1.805 5.577-3.73.512V15h-.83zM4.72 11.452L7.495 17H7v1.535l-4.096.56zM21 16v2h-2v-2zm-11 2v2H8v-2zm17 7h2.18v2H27zM1.025 27H3v2H1v-1.893z"/></svg>',
|
|
LineToolHorzLine:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" enable-background="new 0 0 841.9 595.3" width="30" height="30"><path d="M3 17h4v-2h16v2h4v-4h-4v1H7v-1H3zm1-1v-2h2v2zm20 0v-2h2v2z"/></svg>',LineToolHorzRay:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" enable-background="new 0 0 841.9 595.3" width="30" height="30"><path d="M3 13v4h4v-2h21v-1H7v-1zm1 1h2v2H4z"/></svg>',LineToolInsidePitchfork:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M15.646 3.646L8.29 11.002l-.35.352.015 1.308L8.06 22v.006L18.294 22l8.06-7.646-.707-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586L8.89 12.184l-.003-.364 7.467-7.466zm-6.74 9.967L11 15.707v2.586l-2.02 2.02zM12 16h2v2h-2zm-.293 3h2.586l3 3H9z"/></svg>',
|
|
LineToolNote:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M297.7 127.9c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zm0 335c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6z" fill-opacity=".2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M297.7 232.8c-69.3 0-125.5 56.2-125.5 125.5s56.2 125.5 125.5 125.5 125.5-56.2 125.5-125.5-56.1-125.5-125.5-125.5zm0 230.1c-57.8 0-104.6-46.8-104.6-104.6S240 253.7 297.7 253.7s104.6 46.8 104.6 104.6-46.8 104.6-104.6 104.6zm0-335c-127.1 0-230.1 101.6-230.1 227 0 118.4 104.2 240.4 173.8 314.7 26 27.8 56.3 44.2 56.3 44.2s32.5-16.7 60.4-45.3c69.5-71.3 169.6-183.5 169.6-313.7 0-125.2-103-226.9-230-226.9zM352.6 651c-25.4 26.5-54.9 42-54.9 42s-27.5-15.3-51.2-41.1c-63.3-69.1-158-182.3-158-292.3 0-116.4 93.6-210.8 209.1-210.8s209.1 94.4 209.1 210.8c.1 121-90.9 225.2-154.1 291.4z"/></svg>',
|
|
LineToolNoteAbsolute:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M184.1 270C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zm.1 277.5c-53.2 0-96.3-43.8-96.3-97.9 0-54.1 43.1-97.9 96.3-97.9s96.3 43.8 96.3 97.9c-.1 54-43.1 97.9-96.3 97.9z" fill-opacity=".2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M184.2 351.7c-53.2 0-96.3 43.8-96.3 97.9 0 54.1 43.1 97.9 96.3 97.9s96.3-43.8 96.3-97.9c-.1-54.1-43.1-97.9-96.3-97.9zm0 167.6c-40.1 0-72.7-32.5-72.7-72.7s32.5-72.7 72.7-72.7 72.7 32.5 72.7 72.7-32.6 72.7-72.7 72.7zm-.1-249.3C86.7 270 7.7 349.2 7.7 447c0 92.3 79.9 187.4 133.2 245.4 19.9 21.6 43.1 34.5 43.1 34.5s24.9-13 46.3-35.3C283.7 636 360.5 548.5 360.5 447c0-97.8-79-177-176.4-177zM225 674c-18.9 20.3-40.9 32.1-40.9 32.1s-20.5-11.7-38.1-31.4C99 622 28.5 535.6 28.5 451.7c0-88.9 69.7-160.9 155.7-160.9 85.9 0 155.6 72 155.6 160.9 0 92.2-67.8 171.8-114.8 222.3zm343.4-363.4h19.8c-7.1 47.4-54.7 84.1-113.1 84.1s-105.8-36.7-113-84.1h18.7c8.5 31.8 42.3 56.1 83.9 59.5V248.5h-60.4V228h60.4v-21.5c-12.4-4.2-21.5-15.5-21.5-29.2 0-17.2 14.2-31.2 31.7-31.2s31.7 14 31.7 31.2c0 13.9-9.4 25.3-22.2 29.3V228h59.7v20.5h-59.7v121.6c41.7-3.4 75.5-27.6 84-59.5zm-81.5-133.2c0-6.6-5.4-11.9-12.1-11.9s-12.1 5.3-12.1 11.9 5.4 11.9 12.1 11.9 12.1-5.4 12.1-11.9z"/></svg>',
|
|
LineToolParallelChannel:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M17 4v3.293L7.293 17H4v4h4v-3.293L17.707 8H21V4zm1 1h2v2h-2zm7.646 4.646L19.293 16H16v3.293l-6.354 6.353.708.708 6.376-6.377L20 20l.014-3.307 6.34-6.34zM17 17h2v2h-2zM5 18h2v2H5z"/></svg>',LineToolPitchfan:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M5 4v2H4v4h1v12H4v4h4v-1h12v1h4v-1h2v-1h-2v-2h-3.293l-2.816-2.816 9.3-3.72-.37-.93-9.69 3.878L14.71 16l9.646-9.646-.708-.708L14 15.293l-2.414-2.414 3.88-9.7-.93-.37-3.72 9.29L8 9.29V6H6V4zm0 3h2v2H5zm1 3h1.39l3.12 3.12L6.86 22H6zm5.184 3.89l2.11 2.11-4.925 4.924zM14 16.708l2.11 2.11-7.034 2.814zm2.88 2.88l3.12 3.12V24H8v-.86zM5 23h2v2H5zm16 0h2v2h-2z"/></svg>',
|
|
LineToolPitchfork:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M15.646 3.646L7.293 12 11 15.707v2.586l-7.354 7.353.708.708L11.707 19h2.586L18 22.707l8.354-8.353-.708-.708L18 21.293l-3-3v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2z"/></svg>',LineToolPolyline:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M22 4v1H11.793L5 11.793V22H4v4h4v-1h8.207L20 20.707V17h5V8h1V4zm1 1h2v2h-2zM12.207 6H22v2h2v8h-5v4.293L15.793 24H8v-2H6v-9.793zM5 23h2v2H5z"/></svg>',
|
|
LineToolPrediction:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M18 2v4h-2l3.44 4L23 6h-2V2h-3zm-6 7v2h-1v9h1v4h1v-4h1v-9h-1V9h-1zm-4 2v4H7v10h1v2h1v-2h1V15H9v-4H8zm4 1h1v7h-1v-7zm7.5 0a1.5 1.5 0 0 0-1.5 1.5 1.5 1.5 0 0 0 1.5 1.5 1.5 1.5 0 0 0 1.5-1.5 1.5 1.5 0 0 0-1.5-1.5zm-.006.996a.498.498 0 0 1 .498.498.498.498 0 0 1-.498.498.498.498 0 0 1-.498-.498.498.498 0 0 1 .498-.498zM8 15.72h1.19V24H8v-8.28z"/></svg>',
|
|
LineToolPriceLabel:'<svg xmlns="http://www.w3.org/2000/svg" class="text" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M10.17 6.45c-1.145 0-2.077.928-2.077 2.078v6.225c0 .9.575 1.668 1.373 1.953L6.596 20H3v4h4l.057-2.825 6.635-4.35h12.23c1.146 0 2.078-.927 2.078-2.077v-6.22c0-1.15-.927-2.077-2.077-2.077zm.715 1.037h14.163c1.056 0 1.916.87 1.916 1.942v4.39c0 1.07-.86 1.94-1.916 1.94H13.66l-4.013 2.71-.383.026 1.238-2.776c-.83-.18-1.337-.963-1.337-1.9V9.43c0-1.073.663-1.943 1.72-1.943zM4 21h2v2H4z"/><path d="M25.06 7.523H10.894c-1.056 0-1.72.87-1.72 1.943v4.397c0 .937.51 1.72 1.337 1.9L9.28 18.54l.384-.026 4.014-2.71H25.06c1.055 0 1.915-.87 1.915-1.94v-4.4c0-1.072-.86-1.942-1.916-1.942z" clip-rule="evenodd" fill-opacity=".2" fill-rule="evenodd"/></svg>',
|
|
LineToolPriceRange:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M9 4v1h11V4H9zm5.5 1l-3.387 5H14v15H9v1h11v-1h-5V10h3.113L14.5 5z"/></svg>',LineToolProjection:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M3 3v4h1v16H3v4h4v-1h16v1h4v-4h-2l.5-.008c-.155-9.757-4.81-14.485-9.402-16.646C11.553 4.206 7.095 4.496 7 4.502V3zm1 1h2v2H4zm3 1l.033.498s4.31-.285 8.64 1.752C20 9.286 24.346 13.556 24.5 23H23v2H7v-2H5V7h2zM4 24h2v2H4zm20 0h2v2h-2z"/></svg>',
|
|
LineToolRay:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M23.646 5.646L18.293 11H15v3.293L8.293 21H5v4h4v-3.293L15.707 15H19v-3.293l5.354-5.353zM16 12h2v2h-2zM6 22h2v2H6z"/></svg>',LineToolRectangle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M4 4v4h2v16h16v2h4v-4h-2V6H8V4zm1 1h2v2H5zm3 2h15v15h-1v1H7V8h1zm15 16h2v2h-2z"/></svg>',LineToolRegressionTrend:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M537.9 163.6l-14.7-26.4L54.4 400.9l14.7 26.4 468.8-263.7zM57.4 550.4L72 576.8 540.9 313l-14.7-26.4L57.4 550.4zm0 146.5L72 723.3l468.8-263.7-14.7-26.4L57.4 696.9z"/></svg>',
|
|
LineToolRiskRewardLong:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 60 60"><path d="M10 10v2h38v-2H10zm19 2l-6 6h5v14H10v2h18v6h-5l6 6 6-6h-5v-6h18v-2H30V18h5l-6-6zm0 34H10v2h38v-2H29z"/></svg>',LineToolRiskRewardShort:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 60 60"><path d="M10 48v-2h38v2H10zm19-2l-6-6h5V26H10v-2h18v-6h-5l6-6 6 6h-5v6h18v2H30v14h5l-6 6zm0-34H10v-2h38v2H29z"/></svg>',LineToolRotatedRectangle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30"><path d="M10 2v3.293L5.293 10H2v4h3.293L16 24.707V28h4v-3.293L24.707 20H28v-4h-3.293L14 5.293V2h-4zm1 1h2v2h-2V3zm-.293 3h2.586L24 16.707v2.586L19.293 24h-2.586L6 13.293v-2.586L10.707 6zM3 11h2v2H3v-2zm22 6h2v2h-2v-2zm-8 8h2v2h-2v-2z"/></svg>',
|
|
LineToolSchiffPitchfork:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M17 2v10.994h2V7.2l2 5.794h2l2.004-5.8.002 4.89V13l2-.002v-.916L27 2h-2l-3 7.398L19 2h-2zm-1.354 1.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l1-1-.707-.707-1 1h-2.586l-3-3 7.647-7.646-.708-.708zM12 16h2v2h-2v-2zm-.293 3h2.586l2 2H9.707l2-2z"/></svg>',LineToolSchiffPitchfork2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M15.646 3.646L7.293 12 11 15.707v2.586L8.293 21H4v1h14.707l7.647-7.646-.708-.708L18.293 21h-.586L15 18.293v-2.586l6.354-6.353-.708-.708L14.293 15h-2.586l-3-3 7.647-7.646zM12 16h2v2h-2zm-.293 3h2.586l2 2H9.707z"/></svg>',
|
|
LineToolSineLine:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M10 2.5c-1.208 0-2.17.765-2.88 1.775-.706 1.01-1.215 2.3-1.6 3.58-.766 2.56-1.018 5.096-1.018 5.096L5 13H3v4h4v-4H5.504c.008-.076.254-2.453.975-4.855.36-1.22.85-2.43 1.46-3.295.6-.865 1.27-1.35 2.06-1.35.25 0 .59.218 1 .812.4.595.812 1.503 1.21 2.608.798 2.21 1.55 5.2 2.3 8.2.75 3 1.498 6.01 2.326 8.3.413 1.145.843 2.112 1.33 2.83.487.718 1.08 1.25 1.83 1.25 1.206 0 2.17-.765 2.88-1.775.704-1.01 1.213-2.3 1.6-3.58.764-2.56 1.016-5.096 1.016-5.096L25 17h2v-4h-4v4h1.496c-.008.076-.254 2.453-.975 4.855-.36 1.22-.85 2.43-1.46 3.295-.6.865-1.26 1.35-2.06 1.35-.25 0-.59-.218-1-.813-.4-.594-.81-1.502-1.21-2.607-.79-2.21-1.55-5.2-2.3-8.2-.75-3-1.49-6.01-2.32-8.3-.412-1.145-.842-2.112-1.33-2.83-.49-.718-1.08-1.25-1.83-1.25zM4 14h2v2H4v-2zm20 0h2v2h-2v-2z"/></svg>',
|
|
LineToolText:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M129.8 244.3L5 609.7h54.8l42.6-121.8h121.8l39.6 121.8h57.8L190.7 244.3h-60.9zm-18.2 213.1l51.8-155.3 51.8 155.3H111.6zm456.6 115.7c-3 0-9.1 0-9.1-3-3-6.1-3-9.1-3-18.3v-134c0-82.2-91.3-82.2-103.5-82.2-30.4 0-109.6 3-109.6 91.3h39.6c3-39.6 42.6-60.9 70-60.9 30.4 0 54.8 15.2 54.8 45.7 0 18.3-18.3 30.4-36.5 33.5 0 0-67 9.1-82.2 18.3-15.2 3-45.7 21.3-45.7 70 0 42.6 27.4 76.1 76.1 76.1 33.5 0 67-18.3 91.3-42.6 0 12.2 3 24.4 12.2 30.4 6.1 6.1 18.3 9.1 33.5 9.1 6.1 0 21.3-3 33.5-6.1V567c-9.2 3.1-18.3 6.1-21.4 6.1zm-60.9-63.9c0 42.6-36.5 70-76.1 70-30.4 0-48.7-9.1-48.7-51.8 0-21.3 33.5-39.6 42.6-39.6 24.4-3 54.8-6.1 85.2-15.2v36.5h-3z"/></svg>',
|
|
LineToolTextAbsolute:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M567.7 358.1h20c-7.2 47.7-55.1 84.7-113.9 84.7s-106.7-37-113.9-84.7h18.9c8.6 32.1 42.6 56.5 84.5 59.9V295.6h-60.8v-20.7h60.8v-21.6c-12.5-4.2-21.7-15.6-21.7-29.4 0-17.3 14.3-31.4 31.9-31.4 17.6 0 31.9 14.1 31.9 31.4 0 14-9.5 25.5-22.4 29.5v21.5h60.1v20.7H483V418c42-3.4 76.1-27.8 84.7-59.9zm-82.1-134.2c0-6.6-5.4-12-12.1-12-6.7 0-12.1 5.3-12.1 12s5.4 12 12.1 12c6.6 0 12.1-5.4 12.1-12zm-85.5 295.4v92.6c0 5.5 4.2 13.1 6 15.2 1.8 2 4.3 3.1 7.6 3.1 2.4 0 2.2-.5 6.8-1.4v20.9c-7 1.6-10.9 2.4-16 2.4-10.8 0-18-3.4-23-7.7-4.9-4.2-9.2-5.9-10.1-15.5-19.1 20.2-37.9 22.5-65.6 22.5-36.5 0-59.5-22.7-59.5-54.8 0-60.9 75.4-59.9 56.1-57.7 0 0 68.5-5.2 68.5-22.8 0-20.7-11.9-32.3-42.5-32.3-14.3 0-24.9 3-31.8 8.9-6.9 5.9-11 6.7-12.1 18.8h-30c3.6-55.3 70.9-52.6 75.3-52 3.2-.2 23 .1 41.2 9.3 17 8.7 29.1 26.4 29.1 50.5zm-31.5 29.3c-21.8 11.8-38.4 11.5-61.2 17.4-6 1.5-30.9 5.3-30.9 28.2 0 30.4 14.7 37.1 37 37.1 30.5 0 55.1-18.3 55.1-50.5v-32.2zm-204.2 19.2H67.6l-29.1 84.3H1.7l96.4-272.2h41.2l92.9 272.2h-38.8l-29-84.3zM115.9 421L80.5 526.6h71L115.9 421z"/></svg>',
|
|
LineToolTextAbsolute2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M130.6 233.5L2.6 600h54.1l43.7-122.7h121.7L262.9 600h58l-130-366.5h-60.3zm-20.9 212.9l51-156.1 51.2 156.1H109.7zm460.9 116.4c-4.5 0-7.9-1.4-10.4-4.2-2.4-2.8-1.8-7.9-1.8-15.4V407.6c0-82-91.1-83.3-103.5-83.3-30.4 0-110.7 1.9-110.7 92.4h39.1c3.7-38.9 42.8-61.2 69.6-61.2 29.5 0 55.3 16.8 55.3 45.1 0 18.8-18.6 30.9-36.1 33.1 0 0-67.9 10.2-83.2 17-15.3 6.7-44.4 25.5-44.4 71.7 0 43.9 27.6 77.7 77.4 77.7 34.2 0 67.9-17.4 91.5-42.4 1.2 13 4.3 25.9 11.1 31.7 6.7 5.8 17.5 10.6 32.3 10.6 7 0 22.8-3 32.3-5.3v-34c-6 1.4-15.2 2.1-18.5 2.1zM510 500.5c0 44.1-35.6 70.3-77.2 70.3-30.5 0-49.8-10.3-49.8-51.9 0-22.7 33-39.2 41.5-40.3 24.5-3.3 54.8-6.5 85.6-16l-.1 37.9z"/></svg>',
|
|
LineToolThreeDrivers:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M25 2v4h1.387l-2.602 7.145L21 12.005V10h-4v.37l-3-1.23V7h-4v.506L6 5.87V3H2v4h1.072l1.76 11H4v1.664l-2.416-.89-.346.94L4 20.73V22h3.45l2.55.937v1.995h3.828v-.584L18 25.88V28h4v-.646l2.002.736.346-.938L22 26.29V24h-1.102l3.473-9.535 2.44.998.38-.926-2.47-1.014L27.46 6H29V2zm1 1h2v2h-2zM3 4h2v2H3zm3 2.95l4 1.636V11h.287l-4.264 7h-.18L4.083 7H6zM11 8h2v2h-2zm3 2.223l3 1.226V14h.652l-5.502 7h-.318l-.11-10H14zM18 11h2v2h-2zm-7.266 1.19l.098 8.81H10v.873l-2-.736V18h-.805zM21 13.085l2.44.998-3.13 8.602L19.583 14H21zm-2.385 1.307l.8 9.607H18v.81l-4.172-1.54V21h-.406zM7 19v2H5v-2zm6 3v2h-2v-1.996zm6 3h2v2h-2z"/></svg>',
|
|
LineToolTimeCycles:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M1 15.5v1s1.647.007 3.277.822C5.907 18.138 7.5 19.667 7.5 23H6v4h4v-4H8.508c.03-.186.287-1.697 1.176-3.252.946-1.656 2.51-3.248 5.316-3.248 2.267 0 3.876 1.59 4.955 3.27 1.01 1.57 1.456 3.032 1.516 3.23H20v4h4v-4h-1.5c0-3.333 1.592-4.862 3.223-5.678C27.353 16.507 29 16.5 29 16.5v-1s-1.853-.007-3.723.928c-1.488.744-2.984 2.162-3.54 4.552-.25-.544-.545-1.132-.942-1.75-1.17-1.82-3.062-3.73-5.795-3.73-3.194 0-5.13 1.908-6.184 3.752-.26.453-.468.905-.638 1.33-.62-2.158-2.05-3.45-3.455-4.154C2.853 15.493 1 15.5 1 15.5zM7 24h2v2H7zm14 0h2v2h-2z"/></svg>',
|
|
LineToolTrendAngle:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M21 5v3.3L8.3 21H5v4h4v-1h16v-1h-7c0-3.5-1.5-5.5-3.3-7l7-7H25V5zm1 1h2v2h-2zm-8 10.7c1.75 1.3 3 3.55 3 6.3H9v-1.3zM6 22h2v2H6z"/></svg>',LineToolTrendBasedFibExtension:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M25 17H6.05l-.03-3.68 16.187-7.386-.414-.91L5.016 12.68 5.05 17H5v1h.057v.004l.5-.004H25v-1zm0 3H5v1h20v-1zm0 3H5v1h20v-1z"/></svg>',
|
|
LineToolTrendBasedFibTime:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M17 5v18.95l-3.68.03L5.934 7.792l-.91.414 7.656 16.777L17 24.95V25h1v-.057h.004l-.004-.5V5h-1zm3 0v20h1V5h-1zm3 0v20h1V5h-1z"/></svg>',LineToolTrendLine:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M21 5v3.3L8.3 21H5v4h4v-3.3L21.7 9H25V5zm1 1h2v2h-2zM6 22h2v2H6z"/></svg>',LineToolTriangle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M4 3v4h1.012L5 23H4v4h4v-3.373L22.78 7H26V3h-4v1H8V3zm1 1h2v2H5zm18 0h2v2h-2zM8 5h14v1.373L7.22 23H6l.012-16H8zM5 24h2v2H5z"/></svg>',
|
|
LineToolTrianglePattern:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M4.5 3.238V22H3v4h4v-2.05l5-2.24V22h4v-2.08l13.238-5.926L22 10.848V9h-4v.107L14 7.37V5h-4v.63zm1 1.526L10 6.72V9h1.44L5.5 20.883zM11 6h2v2h-2zm3 2.46l4 1.737V13h1.064l-4.755 4.078L12.51 9H14zM19 10h2v2h-2zm-7.184.482L13.488 18H12v2.615l-5 2.24V22h-.94zM22 11.937l4.76 2.07L16 18.823V18h-1.232l5.834-5H22zM13 19h2v2h-2zm-9 4h2v2H4z"/></svg>',
|
|
LineToolVertLine:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.999999 30.000001" enable-background="new 0 0 841.9 595.3" width="30" height="30"><path d="M17 27v-4h-2V7h2V3h-4v4h1v16h-1v4zm-1-1h-2v-2h2zm0-20h-2V4h2z"/></svg>',SyncDrawing:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M11.527 5.975c-1.345 0-2.692.508-3.713 1.53l-.283.282c-2.04 2.04-2.04 5.385 0 7.426l2.18 2.178c-.3-1.1-.26-2.29.17-3.36l-.58-.58c-1.09-1.09-1.09-2.8 0-3.89l.29-.28c1.1-1.09 2.8-1.09 3.89 0l2.76 2.76c1.09 1.096 1.09 2.8 0 3.89l-.28.28c-.318.32-.69.537-1.08.67l1.855 1.857c.353-.21.69-.45.994-.75l.28-.287c2.04-2.043 2.04-5.384 0-7.425l-2.76-2.76c-1.02-1.02-2.368-1.53-3.71-1.53zm1.733 5.285c-.337.208-.655.453-.946.744l-.283.283c-2.04 2.04-2.04 5.385 0 7.426l2.76 2.758c2.04 2.05 5.39 2.05 7.43 0l.29-.28c2.04-2.04 2.04-5.38 0-7.42l-2.18-2.18c.304 1.11.26 2.29-.17 3.37l.58.58c1.09 1.094 1.09 2.8 0 3.89l-.282.285c-1.092 1.093-2.796 1.093-3.89 0l-2.76-2.76c-1.093-1.092-1.093-2.796 0-3.89l.28-.284c.31-.304.666-.513 1.04-.65l-1.86-1.86zM18 13.492v.31l.03.028c-.007-.113-.01-.226-.03-.338z"/></svg>',
|
|
"alarm-clock-plus":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.5 16"><path d="M2.766.016C1.25.016.016 1.25.016 2.766c0 .518.155.992.406 1.406.98-1.57 2.54-2.737 4.375-3.22C4.293.39 3.58.016 2.767.016zm7.78 0c-.812 0-1.526.374-2.03.938 1.84.48 3.39 1.648 4.375 3.22.26-.416.41-.89.41-1.407 0-1.515-1.23-2.75-2.75-2.75zm-3.874 1.72C3.182 1.736.36 4.588.36 8.078c0 1.362.422 2.624 1.155 3.655L.61 12.89a.857.857 0 1 0 1.343 1.064l.75-.97c1.083.876 2.466 1.407 3.97 1.407.667 0 1.297-.12 1.905-.31v-1.72c-.58.26-1.226.41-1.906.41-2.596 0-4.688-2.09-4.688-4.69 0-2.59 2.092-4.72 4.688-4.72 2.26 0 4.147 1.62 4.594 3.75h1.625c-.46-3.03-3.05-5.37-6.21-5.37zM6.61 4.172a.65.65 0 0 0-.095.03.65.65 0 0 0-.5.657v2.93l-1.25 1.32a.652.652 0 1 0 .938.9l1.438-1.5.19-.188V4.86a.65.65 0 0 0-.72-.688zm6.374 4.625v2.687h-2.72v1.813h2.72v2.688h1.78v-2.688h2.72v-1.813h-2.72V8.798h-1.78z"/></svg>',
|
|
area:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M453.8 360.2l-92.1 6L234 517.7l-86.2-86.1L5.2 514.7v118.9h585.3V268.1z" opacity=".3"/><path d="M234 508.8c-156 222.067-78 111.033 0 0zm309-276.3l-71.3 95.1h-101L236.9 488l-92.1-112.9-38.6 41.6-101 98.1 41.6 41.6 95.1-95.1L234 574.2 397.4 387h104l89.1-118.9z"/></svg>',arrow:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-200 -70 1000 1000"><path d="M486.2 398L109.1 120v468.6L246.3 520l106.6 201.9 99.1-49.6-103-205.7z"/></svg>',
|
|
bars:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 4v7h-3v2h3v7h2v-2h3v-2h-3V4h-2zM7 6v12H4v2h3v2h2V10h3V8H9V6H7z"/></svg>',bucket:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M88.3 714H507V295.4H88.3V714zm293.1-544.2v-41.9H213.9v41.9H46.5v83.7h502.4v-83.7H381.4z"/></svg>',bucket2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path d="M0 0v34h40V0H0zm1 29h38v4H1v-4z" fill="#fff" stroke-width="20" stroke-miterlimit="10"/><path fill="#7d7d7d" d="M18.08 12.542c.822.82 1.916-.274 1.095-1.094l-4.923-4.923c-.82-.82-1.914.273-1.094 1.094zm.822-5.744l-6.564 6.564c-.766.766-.766 2.516 0 3.282l4.376 4.376c.766.766 2.516.766 3.282 0l6.564-6.564zm0 2.188l4.923 4.923H13.98z"/><path d="M27.107 15.55c2.735 2.735 3.282 6.017 0 6.017s-2.735-3.282 0-6.017z" fill-opacity=".5"/></svg>',
|
|
bucket2_active:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path fill="#f4f7f9" stroke-width="20" stroke-miterlimit="10" d="M0 0v34h40V0H0zm1 29h38v4H1v-4z"/><path fill="#5EC6E8" d="M18.08 12.542c.822.82 1.916-.274 1.095-1.094l-4.923-4.923c-.82-.82-1.914.273-1.094 1.094zm.822-5.744l-6.564 6.564c-.766.766-.766 2.516 0 3.282l4.376 4.376c.766.766 2.516.766 3.282 0l6.564-6.564zm0 2.188l4.923 4.923H13.98z"/><path fill="#5EC6E8" d="M27.18 14.253c2.734 2.735 3.28 6.017 0 6.017-3.283 0-2.736-3.282 0-6.017z" fill-opacity=".5"/></svg>',
|
|
bucket2_hover:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path fill="#F8FBFD" stroke-width="20" stroke-miterlimit="10" d="M0 0v34h40V0H0zm1 29h38v4H1v-4z"/><path fill="#7d7d7d" d="M18.08 12.542c.822.82 1.916-.274 1.095-1.094l-4.923-4.923c-.82-.82-1.914.273-1.094 1.094zm.822-5.744l-6.564 6.564c-.766.766-.766 2.516 0 3.282l4.376 4.376c.766.766 2.516.766 3.282 0l6.564-6.564zm0 2.188l4.923 4.923H13.98z"/><path d="M27.107 15.55c2.735 2.735 3.282 6.017 0 6.017s-2.735-3.282 0-6.017z" fill-opacity=".5"/></svg>',
|
|
candles:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm-1 6h3v9H8v-9z"/></svg>',"chat-search":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 973.125"><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></svg>',
|
|
compare:'<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17"><path d="M8.5.36L6.45 2H1v1h2l-3 8a3.54 3.5 0 0 0 3.055 2.97 3.5 3.5 0 0 0 .004 0 3.54 3.5 0 0 0 .44.03 3.5 3.5 0 0 0 .35-.018A3.54 3.5 0 0 0 7 11L4 3h9l-3 8a3.54 3.5 0 0 0 3.502 3A3.54 3.5 0 0 0 17 11l-3-8h2V2h-5.45L8.5.36zm0 1.28l.45.36h-.9l.45-.36zm-5 2.694L6 11H1l2.5-6.666zm10 0L16 11h-5l2.5-6.666z"/></svg>',config:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 600 600" enable-background="new -2.4 120.9 600 600"><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></svg>',
|
|
cursor:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path d="M16 15h1V8h-1v7zm2 1v1h7v-1h-7zm-2 9h1v-7h-1v7zm-8-8h7v-1H8v1z"/></svg>',datawindow:'<svg xmlns="http://www.w3.org/2000/svg" height="21" viewBox="5 7 23 21" width="23"><path d="M6 7v18h20V7H6zm18 16H8V9h16v14zm-2-8H10v2h12v-2zm0-4H10v2h12v-2zm0 8H10v2h12v-2z"/></svg>',detach:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 595.3 841.9" viewBox="0 0 586.09999 586.09996" height="586.1" width="586.1"><path d="M0 586.1h117.2l351.7-351.7 117.2 117.3V0H234.4l117.3 117.2L0 468.9z"/></svg>',
|
|
dot:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-750 -750 2095.3 2341.9" enable-background="new 0 0 595.3 841.9"><circle cx="297.6" cy="420.9" r="294.8"/></svg>',drawginmode:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M19.2 6.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zM6 22l2.8-2.7L7.5 18 6 22zm3.3-6.9c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".4"/><path fill-rule="evenodd" clip-rule="evenodd" d="M9 25l2.8-2.7-1.3-1.3L9 25zM22.2 9.6c-.4-.4-1-.4-1.4 0l-1.2 1.2 1.8 1.8 1.9-1.9-1.1-1.1zm-9.9 8.5c-.4.4-1.6 1.7-1.2 2.1l1.3 1.3 8.3-8.3-1.8-1.8-6.6 6.7z" opacity=".75"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15.3 21.1c-.4.4-1.6 1.7-1.2 2.1l2.6 2.6c.4.4 1.7-.8 2.1-1.2l6.6-6.6-3.6-3.5-6.5 6.6zM12 28l4-1.5-2.5-2.5-1.5 4zm15.4-13.2l-2.1-2.1c-.4-.4-1-.4-1.4 0l-1.2 1.2 3.5 3.5 1.2-1.2c.3-.4.3-1 0-1.4z"/></svg>',
|
|
"earnings-calendar":'<svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21"><path d="M6 1.5A4.5 1.5 0 0 0 1.5 3 4.5 1.5 0 0 0 6 4.5 4.5 1.5 0 0 0 10.5 3 4.5 1.5 0 0 0 6 1.5zm8.8 2.7a4.5 1.5 0 0 0-4.5 1.5 4.5 1.5 0 0 0 4.5 1.5 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-4.5-1.5zm-12.6.7a4.5 1.5 0 0 0-.7.8A4.5 1.5 0 0 0 6 7.2a4.5 1.5 0 0 0 3.8-.7v-.8c0-.2.1-.5.2-.7a4.5 1.5 0 0 0-.2-.1 4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-3.8-.7zm0 2.7a4.5 1.5 0 0 0-.7.8 4.5 1.5 0 0 0 3 1.4v-.3c0-.4.2-.7.5-1 .2-.1.3-.1.4-.2a4.5 1.5 0 0 1-3.2-.7zm16.4 0a4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-1.3-.1c.2.1.3.2.5.3.3.3.5.6.5 1v.4a4.5 1.5 0 0 0 .3 0 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8zM9.5 8A4.5 1.5 0 0 0 5 9.5 4.5 1.5 0 0 0 9.5 11 4.5 1.5 0 0 0 14 9.5 4.5 1.5 0 0 0 9.5 8zm-7.3 2.3a4.5 1.5 0 0 0-.7.8 4.5 1.5 0 0 0 3 1.4v-1.6a4.5 1.5 0 0 1-2.3-.6zm16.4 0a4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-.3 0v1.6a4.5 1.5 0 0 0 .3 0 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8zM5.7 11.4a4.5 1.5 0 0 0-.7.8 4.5 1.5 0 0 0 4.5 1.5 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8 4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-3.8-.7zM18.6 13a4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-.3 0v1.6a4.5 1.5 0 0 0 .3 0 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8zM5.7 14.1a4.5 1.5 0 0 0-.7.8 4.5 1.5 0 0 0 4.5 1.5 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8 4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-3.8-.7zm0 2.7a4.5 1.5 0 0 0-.7.8 4.5 1.5 0 0 0 4.5 1.5 4.5 1.5 0 0 0 4.5-1.5 4.5 1.5 0 0 0-.7-.8 4.5 1.5 0 0 1-3.8.7 4.5 1.5 0 0 1-3.8-.7z"/></svg>',
|
|
"economic-calendar":'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 32 32" viewBox="0 0 20 20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 3v15H2V3H0v17h20V3h-2zm-4-3h-2v4h2V0zM8 0H6v4h2V0zM6 8H4v2h2V8zm5 0H9v2h2V8zm5 0h-2v2h2V8zm-2 7h2v-2h-2v2zm-3-2H9v2h2v-2zm-5 0H4v2h2v-2z"/></svg>',eraser:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M17.948 5.54L7.705 15.468s-.942 1.36-1.67 3.24c-1.255 3.03.314 4.6 1.15 5.226.626.418 4.705 1.045 6.376-.524l10.77-10.767.11-3.866-6.49-3.237zm5.333 7.004l-9.61 9.616c-1.773 1.777-5.43 1.36-6.164.836-.42-.315-1.463-1.987-.628-3.764.836-1.986 1.57-3.24 1.57-3.24l9.513-9.407 5.435 3.03-.106 2.93zm-.52-2.822l-9.2 9.095-5.22-3.034-.314.627 5.123 2.928c-.106.524-.627 1.986-1.253 3.03-1.044 1.57-2.612 1.672-2.612 1.672l.94.418s1.153.106 2.09-1.36c.94-1.465 1.57-3.345 1.57-3.345l9.825-9.617-.94-.414zm1.46-.942l-5.02 4.91v3.453l5.02-4.497zm-6.27-3.24l-4.81 4.702 6.17 3.45 5.02-4.81z"/></svg>',
|
|
font:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path d="M0 0v34h40V0H0zm1 29h38v4H1v-4z" fill="#fff" stroke-width="20" stroke-miterlimit="10"/><text style="line-height:125%" x="13.526" y="20.771" font-size="18.94" font-family="sans-serif" letter-spacing="0" word-spacing="0" fill="#7d7d7d"><tspan x="13.526" y="20.771">A</tspan></text></svg>',font_active:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path d="M0 0v34h40V0H0zm1 29h38v4H1v-4z" fill="#F4F7F9" stroke-width="20" stroke-miterlimit="10"/><text style="line-height:125%" x="13.526" y="20.771" font-size="18.94" font-family="sans-serif" letter-spacing="0" word-spacing="0" fill="#5EC6E8"><tspan x="13.526" y="20.771">A</tspan></text></svg>',
|
|
font_hover:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path d="M0 0v34h40V0H0zm1 29h38v4H1v-4z" fill="#F8FBFD" stroke-width="20" stroke-miterlimit="10"/><text style="line-height:125%" x="13.526" y="20.771" font-size="18.94" font-family="sans-serif" letter-spacing="0" word-spacing="0" fill="#7d7d7d"><tspan x="13.526" y="20.771">A</tspan></text></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" height="586.1" width="586.1" enable-background="new 0 0 595.3 841.9" viewBox="0 0 586.09999 586.09996"><path d="M172.6 367.9l-97.7 97.7L0 390.7v195.4h195.4l-74.9-74.9 97.7-97.7-45.6-45.6zM195.4 0H0v195.4l74.9-74.9 97.7 97.7 45.6-45.6-97.7-97.7L195.4 0zm195.3 0l74.9 74.9-97.7 97.7 45.6 45.6 97.7-97.7 74.9 74.9V0H390.7zm22.8 367.9l-45.6 45.6 97.7 97.7-74.9 74.9h195.4V390.7l-74.9 74.9-97.7-97.7z"/></svg>',
|
|
group:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M5.5 13A2.5 2.5 0 0 0 3 15.5 2.5 2.5 0 0 0 5.5 18 2.5 2.5 0 0 0 8 15.5 2.5 2.5 0 0 0 5.5 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 15 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 15 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5z"/></svg>',heikenAshi:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9z"/></svg>',
|
|
help:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M297 127.5c-161.8 0-293 131.2-293 293s131.2 293 293 293 293-131.2 293-293-131.2-293-293-293zm0 537.2c-134.8 0-244.2-109.3-244.2-244.2S162.2 176.3 297 176.3s244.2 109.3 244.2 244.2S431.8 664.7 297 664.7zm-24.4-122.1h48.8v-48.8h-48.8v48.8zM368 319c-17.7-13.9-41.6-20.9-71.5-20.9-28.5 0-51.5 6.9-69 20.6-17.5 13.7-26.8 33.2-28.2 52.9h48.8c3.3-13.7 8.4-21.5 17.3-28.2 8.9-6.7 20-10.1 33.3-10.1 13.7 0 24.7 3.2 32.8 9.6 8.1 6.4 12.2 14.2 12.2 23.2 0 6.5-2.3 12.4-6.9 17.8-3 3.4-12.1 10.6-27.3 21.6-15.2 11-25.4 20.9-30.5 29.7-5.1 8.8-7.6 20-7.6 33.6 0 1.3 1-5.7 1.2.4h48.8c-.2-12.7-1.5-10.9 1.2-15.9 2.7-4.9 9.5-11.5 20.5-19.6 21.3-15.7 35.2-28.1 41.7-37.3 6.5-9.1 9.8-18.8 9.8-29 0-18.3-8.9-34.5-26.6-48.4z"/></svg>',
|
|
hideAllDrawings:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M16.5 14c.1 0 .3 0 .4.1l.7-.7c-.4-.2-.7-.3-1.1-.3-1.6 0-2.9 1.3-2.9 2.9 0 .4.1.8.2 1.1l.8-.8v-.4c0-1 .8-1.9 1.9-1.9zm-4.7 5.2C10.2 18 8.9 16.7 8.3 16c1.1-1.2 4.7-5 8.2-5 .9 0 1.9.3 2.8.7l.7-.7c-1.1-.6-2.3-.9-3.5-.9-4.6 0-9 5.4-9.2 5.6L7 16l.3.4c.1.1 1.6 2 3.8 3.6l.7-.8zm13.9-3.5c-.1-.1-1.5-1.8-3.4-3.2l2.8-2.8-.7-.7L9 24.3l.7.7 3.7-3.7c1 .4 2 .7 3 .7 4.9 0 9-5.4 9.2-5.6l.4-.4-.3-.3zm-7.2.5c-.1.9-.9 1.6-1.7 1.7l1.7-1.7zm-2 4.8c-.7 0-1.5-.2-2.2-.5l1.7-1.7c.2 0 .4.1.6.1 1.5 0 2.9-1.3 2.9-2.9 0-.2 0-.4-.1-.5l2.3-2.3c1.4 1.1 2.6 2.3 3.1 2.9-1.2 1.2-4.6 4.9-8.3 4.9z"/></svg>',
|
|
hollowCandles:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M16 3v3h-2v12h2v5h1v-5h2V6h-2V3h-1zM9 4v5H7v11h2v3h1v-3h2V9h-2V4H9zm6 3h3v10h-3V7zm-7 3h3v9H8v-9z"/></svg>',indicators:'<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17"><path d="M16 0a1 1 0 0 0-1 1 1 1 0 0 0 .127.484L13.017 5A1 1 0 0 0 13 5a1 1 0 0 0-.258.035L10.965 3.26A1 1 0 0 0 11 3a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .082.393L7.12 6.008a1 1 0 0 0-.12-.01 1 1 0 0 0-.44.104l-1.564-1.04A1 1 0 0 0 5 4.998a1 1 0 0 0-1-1 1 1 0 0 0-1 1 1 1 0 0 0 .002.066l-1.56 1.04A1 1 0 0 0 1 5.998a1 1 0 0 0-1 1 1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.002-.064l1.56-1.04A1 1 0 0 0 4 6a1 1 0 0 0 .44-.103l1.564 1.04A1 1 0 0 0 6 7a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.082-.39l1.965-2.62A1 1 0 0 0 10 4a1 1 0 0 0 .258-.035l1.777 1.777A1 1 0 0 0 12 6a1 1 0 0 0 1 1 1 1 0 0 0 1-1 1 1 0 0 0-.127-.482L15.983 2A1 1 0 0 0 16 2a1 1 0 0 0 1-1 1 1 0 0 0-1-1zm-1 5v10h2V5h-2zM9 7v8h2V7H9zM3 9v6h2V9H3zm9 1v5h2v-5h-2zM0 11v4h2v-4H0zm6 0v4h2v-4H6z"/></svg>',
|
|
kagi:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M7 4v17H5v-4H4v5h4V6h2v11h8l-.076-7H20v10h3V7h-8v7h-2V4z"/></svg>',"layout-1":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M6 3v17h17V3H6zm1 1h15v15H7V4z"/><path opacity=".2" d="M7 4h15v15H7z"/></svg>',"layout-2":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path opacity=".2" d="M6 4h7v15H6zm10 0h7v15h-7z"/><path d="M5 3v17h9V3H5zm1 1h7v15H6V4zm9-1v17h9V3h-9zm1 1h7v15h-7V4z"/></svg>',
|
|
"layout-3":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path opacity=".2" d="M7 20v-7h15v7zm0-10V3h15v7z"/><path d="M6 21h17v-9H6v9zm1-1v-7h15v7H7zm-1-9h17V2H6v9zm1-1V3h15v7H7z"/></svg>',"layout-4":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path opacity=".2" d="M7 4h15v3H7zm0 6h15v3H7zm0 6h15v3H7z"/><path d="M6 3v5h17V3H6zm1 1h15v3H7V4zM6 9v5h17V9H6zm1 1h15v3H7v-3zm-1 5v5h17v-5H6zm1 1h15v3H7v-3z"/></svg>',
|
|
"layout-5":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M7 4v15h3V4H7zm6 0v15h3V4h-3zm6 0v15h3V4h-3z" opacity=".2"/><path d="M6 3v17h5V3H6zm6 0v17h5V3h-5zm6 0v17h5V3h-5zM7 4h3v15H7V4zm6 0h3v15h-3V4zm6 0h3v15h-3V4z"/></svg>',"layout-6":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M7 4v15h6V4H7zm9 0v6h6V4h-6zm0 9v6h6v-6h-6z" opacity=".2"/><path d="M6 3v17h8V3H6zm9 0v8h8V3h-8zM7 4h6v15H7V4zm9 0h6v6h-6V4zm-1 8v8h8v-8h-8zm1 1h6v6h-6v-6z"/></svg>',
|
|
"layout-7":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M7 4v6h6V4H7zm9 0v6h6V4h-6zm-9 9v6h6v-6H7zm9 0v6h6v-6h-6z" opacity=".2"/><path d="M6 3v8h8V3H6zm9 0v8h8V3h-8zM7 4h6v6H7V4zm9 0h6v6h-6V4zM6 12v8h8v-8H6zm9 0v8h8v-8h-8zm-8 1h6v6H7v-6zm9 0h6v6h-6v-6z"/></svg>',"layout-8":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M7 4v6h3V4H7zm6 0v6h3V4h-3zm6 0v6h3V4h-3zM7 13v6h3v-6H7zm6 0v6h3v-6h-3zm6 0v6h3v-6h-3z" opacity=".2"/><path d="M6 3v8h5V3H6zm6 0v8h5V3h-5zm6 0v8h5V3h-5zM7 4h3v6H7V4zm6 0h3v6h-3V4zm6 0h3v6h-3V4zM6 12v8h5v-8H6zm6 0v8h5v-8h-5zm6 0v8h5v-8h-5zM7 13h3v6H7v-6zm6 0h3v6h-3v-6zm6 0h3v6h-3v-6z"/></svg>',
|
|
"layout-9":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29.000121 23.00011" height="23" width="29"><path d="M7 4v6h3V4H7zm4 0v6h3V4h-3zm4 0v6h3V4h-3zm4 0v6h3V4h-3zM7 13v6h3v-6H7zm4 0v6h3v-6h-3zm4 0v6h3v-6h-3zm4 0v6h3v-6h-3z" opacity=".2"/><path d="M6 3v8h17V3H6zm1 1h3v6H7V4zm4 0h3v6h-3V4zm4 0h3v6h-3V4zm4 0h3v6h-3V4zM6 12v8h17v-8H6zm1 1h3v6H7v-6zm4 0h3v6h-3v-6zm4 0h3v6h-3v-6zm4 0h3v6h-3v-6z"/></svg>',left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-80 -25 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12L-.7.7-41 43.2l.1.1-.1.1L-.7 85.9l10-10.6-29.7-31.2z"/></svg>',
|
|
"line-dashed":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 12v1h3v-1H5zm4 0v1h3v-1H9zm4 0v1h3v-1h-3zm4 0v1h3v-1h-3zm4 0v1h3v-1h-3zm4 0v1h3v-1h-3z"/></svg>',"line-dotted":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 12v1h1v-1H5zm2 0v1h1v-1H7zm2 0v1h1v-1H9zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1zm2 0v1h1v-1h-1z"/></svg>',
|
|
"line-left-arrow":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M6.867 10.36L5 12.48l1.867 2.122V13H27v-1H6.867v-1.64z"/></svg>',"line-left-extend":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M16 11v1H5v1h11v1h3v-1h5v1h3v-3h-3v1h-5v-1h-3zm1 1h1v1h-1v-1zm8 0h1v1h-1v-1z"/></svg>',"line-left-normal":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 11v3h3v-1h19v-1H8v-1H5zm1 1h1v1H6v-1z"/></svg>',
|
|
"line-right-arrow":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M25.133 10.36L27 12.48l-1.867 2.122V13H5v-1h20.133v-1.64z"/></svg>',"line-right-extend":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M16 11v1h11v1H16v1h-3v-1H8v1H5v-3h3v1h5v-1h3zm-1 1h-1v1h1v-1zm-8 0H6v1h1v-1z"/></svg>',"line-right-normal":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M27 11v3h-3v-1H5v-1h19v-1h3zm-1 1h-1v1h1v-1z"/></svg>',
|
|
"line-width-1":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 13h22v-1H5v1z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',"line-width-2":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 14h22v-2H5v2z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',"line-width-3":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 14h22v-3H5v3z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',
|
|
"line-width-4":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.000001 24.999999" enable-background="new 0 0 595.3 841.9" width="32" height="25"><path d="M5 15h22v-4H5v4z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',line:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M142.5 447.4c-102.74 102.74-83.44 83.44 0 0m399-186.2l-70.9 94.6H370.1l-136 159.6-91.6-112.3-38.5 41.4L6.5 542l41.4 41.4 94.6-94.6 91.6 112.3 162.6-186.2h103.5l88.7-118.2z"/></svg>',
|
|
lineBreak:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M12 2v9h3V2h-3zm3 9v12h3V11h-3zm-3 0H9v9h3v-9zm1-8h1.05v6.95H13V3zm-3 9h1v7h-1v-7z"/></svg>',"linetool-bukkit":'<svg width="16" height="16" viewBox="0 0 16 14" xmlns="http://www.w3.org/2000/svg"><path d="M5.75 5.75c.75.75 1.75-.25 1-1L2.25.25c-.75-.75-1.75.25-1 1zM6.5.5l-6 6c-.7.7-.7 2.3 0 3l4 4c.7.7 2.3.7 3 0l6-6zm0 2L11 7H2z"/><path d="M14 8.5c2.5 2.5 3 5.5 0 5.5s-2.5-3 0-5.5z" fill-opacity=".5"/></svg>',
|
|
"linetool-clone":'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path d="M0 0v11h6v5h11V5h-6V0H0zm2 2h7v3H6v4H2V2zm6 5h1v2H8V7zm3 0h4v7H8v-3h3V7z"/></svg>',"linetool-layers":'<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path d="M0 0v11h6v5h11V5h-6V0zm11 7h4v7H8v-3h3z"/></svg>',"linetool-visibility":'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="10" viewBox="0 0 12 10"><path d="M6 0C2.5 0 0 3.75 0 5s2.5 5 6 5 6-3.75 6-5-2.5-5-6-5zm0 1.75c1.75 0 3.25 1.5 3.25 3.25S7.75 8.25 6 8.25 2.75 6.75 2.75 5 4.25 1.75 6 1.75zM6 3.7c-.75 0-1.3.55-1.3 1.3S5.25 6.3 6 6.3 7.3 5.75 7.3 5 6.75 3.7 6 3.7z"/></svg>',
|
|
list:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 595.3 841.9" viewBox="0 0 585.3 512.2"><path d="M146.3.1v73.1h439V0h-439zm0 219.5h439v-73.2h-439v73.2zM0 219.6h109.7v-73.2H0v73.2zM0 73.2h109.7V0H0v73.2zm0 292.7h109.7v-73.2H0v73.2zm146.3 0h439v-73.2h-439v73.2zm0 146.3h439V439h-439v73.2zM0 512.2h109.7V439H0v73.2z"/></svg>',lockAllDrawings:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 32 32" viewBox="0 0 30 30"><path d="M20 13h-1v-1.5C19 9 17 7 14.5 7S10 9 10 11.5V13H9c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h11c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-8-.9c0-1.7 1.1-3.1 2.5-3.1s2.5 1.4 2.5 3.1v.9h-5v-.9z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',
|
|
magnet:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 32 32" viewBox="0 0 30 30"><path d="M22 14c-.3-3.9-3.5-7-7.5-7S7.3 10.1 7 14v9h5v-9h.1c.2-1.1 1.2-2 2.4-2s2.2.9 2.4 2h.1v9h5v-9zm-11 8H8v-4h3v4zm10 0h-3v-4h3v4z" clip-rule="evenodd" fill-rule="evenodd"/></svg>',maximize:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 595.3 841.9" viewBox="0 0 260.9 586.29997" height="586.3" width="260.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M163 325.7H97.9v130.2H.2v32.6h32.6v32.6h32.6v32.6H98v32.6h65.1v-32.6h32.6v-32.6h32.6v-32.6h32.6v-32.6h-97.7V325.7zm65.1-227.9V65.2h-32.6V32.6h-32.6V0H97.8v32.6H65.2v32.6H32.6v32.6H0v32.6h97.7v130.2h65.1V130.3h97.7V97.7h-32.4z"/></svg>',
|
|
measure:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M15 6v2h-1v6h1v2h1v-2h1V8h-1V6zm5 1v2h-1v6h1v2h1v-2h1V9h-1V7zM4 8v16h23v-5H9V8zm1 1h3v2H6v1h2v2H6v1h2v2H6v1h2v1.293l-3 3zm3.707 11H11v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v2h1v-2h2v3H5.707z"/></svg>',mentios:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 32 32" viewBox="0 0 14.888672 15.336914" height="15.337" width="14.889"><path d="M14.062 7.54q0 1.085-.32 2.1-.313 1.017-.9 1.853H9.406l-.21-.907q-.58.47-1.11.72-.53.25-1.22.25-1.31 0-2.1-.993-.782-.992-.782-2.773 0-1.774.96-2.83.962-1.053 2.298-1.053.572 0 1.01.133.437.125.944.382v-.375h1.243v6.578h1.893q.328-.585.492-1.46.17-.883.17-1.58 0-1.28-.36-2.327-.35-1.047-1.04-1.797-.686-.75-1.702-1.142-1.013-.408-2.3-.408-1.25 0-2.29.452-1.03.454-1.774 1.22-.75.765-1.18 1.836-.42 1.062-.42 2.265 0 1.29.402 2.36.406 1.063 1.148 1.82.775.79 1.814 1.188 1.04.41 2.266.41.67 0 1.383-.085.72-.087 1.375-.275v1.11q-.76.163-1.416.217-.656.063-1.35.063-1.454 0-2.697-.5-1.242-.493-2.132-1.384-.9-.898-1.4-2.156-.5-1.26-.5-2.78 0-1.448.525-2.69.525-1.25 1.43-2.164.908-.914 2.15-1.438Q6.17.852 7.585.852q1.53 0 2.734.484 1.2.485 2.03 1.36.83.875 1.262 2.11.446 1.226.446 2.734zM9.18 9.532V5.485q-.493-.227-.884-.32-.39-.102-.836-.102-1.008 0-1.578.703-.57.703-.57 2 0 1.274.453 1.93.453.648 1.414.648.52 0 1.04-.242.524-.242.954-.57z" font-size="16" font-family="Arial-BoldMT"/></svg>',
|
|
minus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120"><path fill-rule="evenodd" clip-rule="evenodd" d="M28 50h65v17H28z"/></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" fill="#B8BCC2" d="M465.5 453.5L220.2 209.1 89.6 340.3 62 313.9l131.7-131.2-45.8-45.6c-14.6-14.6-38.3-14.6-52.9 0l-79.4 79.1C1 230.8 1 254.4 15.6 269l317.6 316.3c14.6 14.6 64.8 59.6 79.4 45l98.1-97.7c14.6-14.6-30.6-64.6-45.2-79.1zm68.6 107l-93.6 93.2 149.7 57.1-56.1-150.3z"/></svg>',
|
|
pencil2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path fill="#fff" stroke-width="20" stroke-miterlimit="10" d="M0 0v34h40V0H0zm1 29h38v4H1v-4z"/><path d="M24.335 15.167l-6.327-6.312-3.367 3.39-.71-.683 3.4-3.39-1.18-1.177c-.38-.378-.99-.378-1.36 0l-2.05 2.043c-.38.377-.38.986 0 1.364l8.19 8.17c.377.378 1.67 1.54 2.047 1.163l2.53-2.524c.38-.37-.79-1.66-1.163-2.04zm1.77 2.764l-2.415 2.41 3.86 1.48-1.446-3.88z" clip-rule="evenodd" fill="#7d7d7d" fill-rule="evenodd"/></svg>',
|
|
pencil2_active:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path fill="#f4f7f9" stroke-width="20" stroke-miterlimit="10" d="M0 0v34h40V0H0zm1 29h38v4H1v-4z"/><path d="M24.335 15.167l-6.327-6.312-3.367 3.39-.71-.683 3.4-3.39-1.18-1.177c-.38-.378-.99-.378-1.36 0l-2.05 2.043c-.38.377-.38.986 0 1.364l8.19 8.17c.377.378 1.67 1.54 2.047 1.163l2.53-2.524c.38-.37-.79-1.66-1.163-2.04zm1.77 2.764l-2.415 2.41 3.86 1.48-1.446-3.88z" clip-rule="evenodd" fill="#5EC6E8" fill-rule="evenodd"/></svg>',
|
|
pencil2_hover:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40.000001 33.999999" enable-background="new 0 0 595.3 841.9" width="40" height="34"><path fill="#F8FBFD" stroke-width="20" stroke-miterlimit="10" d="M0 0v34h40V0H0zm1 29h38v4H1v-4z"/><path d="M24.335 15.167l-6.327-6.312-3.367 3.39-.71-.683 3.4-3.39-1.18-1.177c-.38-.378-.99-.378-1.36 0l-2.05 2.043c-.38.377-.38.986 0 1.364l8.19 8.17c.377.378 1.67 1.54 2.047 1.163l2.53-2.524c.38-.37-.79-1.66-1.163-2.04zm1.77 2.764l-2.415 2.41 3.86 1.48-1.446-3.88z" clip-rule="evenodd" fill="#7d7d7d" fill-rule="evenodd"/></svg>',
|
|
"plus-bolder":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17"><path d="M7 2h3v13H7M2 7h13v3H2z"/></svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M112 60H78V26H61v34H27v17h34v34h17V77h34z"/></svg>',pointFigure:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M4 4v1h1v1h1v1H5v1H4v1h2V8h1v1h2V8H8V7H7V6h1V5h1V4H7v1H6V4H4zm12 0v1h1v1h1v1h-1v1h-1v1h2V8h1v1h2V8h-1V7h-1V6h1V5h1V4h-2v1h-1V4h-2zM4 10v1h1v1h1v1H5v1H4v1h2v-1h1v1h2v-1H8v-1H7v-1h1v-1h1v-1H7v1H6v-1H4zm7 0v1h-1v3h1v1h3v-1h1v-3h-1v-1h-3zm5 0v1h1v1h1v1h-1v1h-1v1h2v-1h1v1h2v-1h-1v-1h-1v-1h1v-1h1v-1h-2v1h-1v-1h-2zm-4 1h1v1h1v1h-1v1h-1v-1h-1v-1h1v-1zm-8 5v1h1v1h1v1H5v1H4v1h2v-1h1v1h2v-1H8v-1H7v-1h1v-1h1v-1H7v1H6v-1H4zm7 0v1h-1v3h1v1h3v-1h1v-3h-1v-1h-3zm1 1h1v1h1v1h-1v1h-1v-1h-1v-1h1v-1z"/></svg>',
|
|
properties:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 600 600" enable-background="new -2.4 120.9 600 600"><path d="M594 473.5V368.8h-76c-5.7-23.8-15.2-46.4-27.5-66.4l53.8-53.8-73.9-73.9-53.8 53.4c-20.6-12.8-42.7-21.8-66.4-27.5v-75.9H245.5v75.9c-23.8 5.7-46.4 15.2-66.4 27.5l-53.8-53.8-73.9 73.9 53.4 53.8C92 322.6 83 344.7 77.3 368.4h-76V473h75.9c5.7 23.8 15.2 46.4 27.5 66.4L51 593.3l73.9 73.9 53.8-53.4c20.6 12.8 42.7 21.8 66.4 27.5v75.9h104.6v-75.9c23.8-5.7 46.4-15.2 66.4-27.5l53.8 53.8 73.9-73.9-53.4-53.8c12.8-20.6 21.8-42.7 27.5-66.4H594zm-296.4 69.7c-67.3 0-122.3-54.6-122.3-122.3 0-67.3 54.6-122.3 122.3-122.3 67.3 0 122.3 54.6 122.3 122.3-.4 67.4-54.9 122.3-122.3 122.3z"/></svg>',
|
|
"published-timeline":'<svg xmlns="http://www.w3.org/2000/svg" height="587.5" width="553.4" enable-background="new 0 0 595.3 841.9" viewBox="0 0 553.40004 587.49998"><path d="M476.1 83.5l-21.6-21.6-40.2 46.4 21.6 21.6 40.2-46.4zM293.7 0h-30.9v61.8h30.9V0zm259.7 278.3l-3.1-30.9-61.8 3.1 3.1 30.9 61.8-3.1zM142.2 108.2L98.9 61.8 77.3 83.5l43.3 46.4 21.6-21.7zM64.9 454.5l21.6 21.6 46.4-43.3-21.6-21.6-46.4 43.3zM278.2 92.8c-92.8 0-170.1 83.5-170.1 185.5 0 71.1 37.1 132.9 92.8 163.9v83.5c0 34 27.8 61.8 61.8 61.8h30.9c34 0 61.8-27.8 61.8-61.8v-83.5c55.7-30.9 92.8-92.8 92.8-163.9.1-102-77.2-185.5-170-185.5zm0 327.7c-71.1 0-129.9-64.9-129.9-142.2 0-80.4 58.7-142.2 129.9-142.2S408.1 201 408.1 278.3c0 80.4-58.7 142.2-129.9 142.2zM0 281.4l61.8 3.1 3.1-30.9-61.8-3.1L0 281.4zm429.7 151.5l46.4 40.2 21.6-24.7-49.5-40.2-18.5 24.7z"/></svg>',
|
|
redo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M7.5 8.2v3.2L15 6.5 7.5 1.7V5S0 4.1 0 13.4c0-.1 1.7-5.2 7.5-5.2z"/></svg>',"removeAllDrawingTools - Copy":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M14.57 35.667c0 1.84 1.408 3.333 3.144 3.333h12.57c1.737 0 3.144-1.492 3.144-3.333v-20H14.57v20zm20.43-25h-5.5L27.93 9h-7.86l-1.57 1.667H13V14h22v-3.333z"/><path fill="none" d="M0 0h48v48H0z"/></svg>',removeAllDrawingTools:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M12 7v1H9v2h13V8h-3V7h-7zm-2 4v12h11V11H10z"/></svg>',
|
|
renko:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="26" height="26"><path d="M12 4v6h3V4h-3zm3 6v6h3v-6h-3zm3 6v6h3v-6h-3zm-6-6H9v6h3v-6zm-3 6H6v6h3v-6zm4-11h1v4h-1V5zm-3 6h1v4h-1v-4zm-3 6h1v4H7v-4z"/></svg>',restore:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-58 -18 120 120"><path fill-rule="evenodd" clip-rule="evenodd" d="M31 13C23.4 5.3 12.8.5 1.1.5c-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8C13.5 70.4 7.5 72.5 1 72.5c-16.2 0-29.3-13.2-29.3-29.4S-15.2 13.7 1 13.7c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5V.5L31 13z"/></svg>',
|
|
"right-stop":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 13.4" enable-background="new 0 0 14.8 13.4"><path d="M8 6.7L1.7 0 .1 1.7l4.7 4.9-4.8 5 1.7 1.8L8 6.7zm6.8 0L8.4 0 6.8 1.7l4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></svg>',right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="-90 -55 140 140"><path fill-rule="evenodd" clip-rule="evenodd" d="M10 12l-40.3-42.5-10 10.6 29.7 31.2L-41 43.4l10.7 11.3L10 12.2l-.1-.1z"/></svg>',"script-editor":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21.000134 17.000158" height="17" width="21" enable-background="new 0 0 595.3 841.9"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.482 2.042L2.4 2.002c-.764 0-1.385.677-1.385 1.51v7.444c0 .03-.02.05-.05.05l-.88-.01c-.03 0-.05.02-.05.052l-.012.513c-.01.09-.155 1.6.414 2.31.196.25.454.36.764.36l3.53-.02h3.44c.38 0 .72-.16.99-.45.26-.29.405-.68.405-1.08V4.2c0-.556.02-.833.35-1.172.145-.154.228-.226.476-.226l.163-.76h-.062zM6.545 13.41c-.372 0-.724.01-1.83.02H1.398l.02-.01c-.124-.03-.403-.103-.496-.216-.3-.37-.196-.657-.196-1.12 0-.112 0-.215.01-.286 0-.03.02-.04.052-.04.496 0 4.785.04 5.27.04.022 0 .042.02.053.04 0 0 .07 1.11.47 1.5.03.02.01.072-.03.072zM9.16 2.874c-.33.41-.33.75-.33 1.314v8.472c0 .113-.27.76-.62.77 0 0-.91.154-1.262-.842l-.03-.8c0-.175-.012-.75-.177-.75l-4.94-.04c-.03 0-.05-.022-.05-.053V3.5c0-.503.34-.75.62-.75 0 0 5.45.03 6.75.042.04 0 .06.05.04.082zm2.335 8.944l1.344-1.335c.1-.103.1-.277 0-.39l-.23-.226c-.11-.103-.28-.103-.39 0l-1.76 1.746c-.06.06-.09.144-.09.226 0 .06.02.13.07.18l1.79 1.77c.1.1.26.1.36 0l.26-.26c.1-.104.1-.258 0-.36l-1.36-1.365zm5.054-2.896l-3.03 5.67.77.41 3.03-5.67-.78-.41zm1.96 1.2l.26-.256c.1-.102.26-.102.36 0l1.79 1.777c.1.102.1.256 0 .36l-.26.256c-.108.1-.26.1-.36 0l-1.79-1.78c-.105-.1-.105-.27 0-.36zm.26 3.678l-.23-.227c-.11-.103-.11-.277 0-.39l1.752-1.746c.103-.102.28-.102.392 0l.227.226c.106.103.106.277 0 .39L19.16 13.8c-.113.102-.29.102-.392 0z"/></svg>',
|
|
showObjectsTree:'<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30"><path d="M18.827 8.17c-1.227.817-.993 1.49-.993 2.318 0 .703-.29 1.49-.62 1.778-.33.29-.8.965-.8.965l1.168 1.25s.823-.52 1.038-.72c.414-.37 1.407-.66 2.193-.66 1.737 0 2.387-.54 2.454-2.49.017-.503-.07-1.633-.07-1.633L22.402 9c-.458 2.403-1.457 2.526-2.28 1.786-.823-.74-1.13-1.192.386-2.773l-.48-.626-1.2.79zM6.46 7.716c-.29.455 1.2 3.847 1.984 4.468.91.785 1.903.496 2.896-.828.827-1.117.827-1.158.083-1.985-.414-.45-1.158-.82-1.696-.82s-1.034-.17-1.157-.38c-.332-.49-1.863-.86-2.11-.45zm3.983 5.846c0 .372 4.95 4.826 8.467 7.68 2.192 1.78 3.268 2.027 2.77.62-.454-1.24-7.983-10.328-8.81-10.576-.618 1.114-1.67 1.914-2.427 2.276zm-.468 5.778C7.74 21.367 7.74 21.367 8.57 22.194c.826.827.826.827 3.018-1.406 1.383-1.414 2.168-2.514 2.168-2.514l-1.272-1.21s-1.268 1.118-2.51 2.276z"/></svg>',
|
|
smile:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 595.3 841.9" viewBox="0 0 586.70002 595.19999" height="595.2" width="586.7"><path d="M293.4 0C131.8 0 0 131.8 0 297.6s131.8 297.6 293.4 297.6 293.3-131.8 293.3-297.6S454.9 0 293.4 0zm68 182.8h85v93.5h-85v-93.5zm-212.6 0h85v93.5h-85v-93.5zm148.8 306.1c-136 0-187.1-106.3-187.1-106.3h378.4s-55.2 106.3-191.3 106.3z"/></svg>',snapshot:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 11.5"><path d="M7.5 4.8c-1.1 0-1.9.9-1.9 1.9s.9 1.9 1.9 1.9c1.1 0 1.9-.9 1.9-1.9s-.9-1.9-1.9-1.9zM13 1.9h-2.2c0-1-.9-1.9-2-1.9H6.1C5 0 4.2.9 4.2 1.9H1.9c-1 0-1.9.9-1.9 2v5.7c0 1.1.9 1.9 1.9 1.9H13c1.1 0 1.9-.9 1.9-1.9V3.9c.1-1.1-.8-2-1.9-2zm-5.5 8.3C5.6 10.2 4 8.6 4 6.7s1.5-3.4 3.4-3.4 3.4 1.5 3.4 3.4c.1 1.9-1.4 3.5-3.3 3.5z"/></svg>',
|
|
star:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 595.3 841.9" viewBox="0 0 582.90004 554.7" height="554.7" width="582.9"><path d="M438.2 353.7l32.1 201-176.9-96.5-180.8 96.5 32.1-201L0 209l201-28.1L293.4 0l88.5 180.9 201 28.1z"/></svg>',stocktwits:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 9.4"><path d="M3.9 4c-.7-.3-1.1-.5-1.3-.6L2.2 3c-.1-.1-.1-.3-.1-.5 0-.3.1-.5.3-.7.2-.2.5-.3.9-.3.3 0 .7 0 1 .1.3.2.7.4 1.2.5L6.2.6C5.7.4 5.2.2 4.8.1L3.4 0C2.3 0 1.5.2 1 .7S.1 1.8.1 2.6c0 .4.1.8.3 1.1s.4.6.7.8c.3.2.7.5 1.3.8l1.2.6c.2.2.4.3.5.4.1.1.2.3.2.5 0 .3-.1.6-.4.7-.2.2-.6.2-1 .2s-.8-.1-1.2-.2C1.2 7.5.6 7.3 0 7v1.8c.8.4 1.7.6 2.7.6 1.1 0 2-.2 2.6-.7.7-.5 1-1.2 1-2 0-.6-.2-1.1-.5-1.5-.4-.4-1-.8-1.9-1.2zM7 0v1.6h3.1v7.8h1.6V1.6h3.1V0H7z"/></svg>',
|
|
"trading-connect":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 14"><circle cx="5" cy="7" r="3"/></svg>',"trading-options":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 595.3 841.9" enable-background="new 0 0 595.3 841.9"><path d="M540.7 372.3h-38.9c-4.9-24.3-14.6-43.7-24.3-63.2l24.3-24.3c19.4-19.4 19.4-48.6 0-68s-48.6-19.4-68 0l-24.3 24.3c-19.4-9.7-38.9-19.4-63.2-24.3v-38.9c0-29.2-19.4-48.6-48.6-48.6S249 148.8 249 177.9v38.9c-24.3 4.9-43.7 14.6-63.2 24.3l-24.3-24.3c-19.4-19.4-48.6-19.4-68 0s-19.4 48.6 0 68l24.3 24.3c-9.7 19.4-19.4 38.9-24.3 63.2H54.6C25.5 372.3 6 391.8 6 420.9s19.4 48.6 48.6 48.6h38.9c4.9 24.3 14.6 43.7 24.3 63.2L93.5 557c-19.4 19.4-19.4 48.6 0 68s48.6 19.4 68 0l24.3-24.3c19.4 9.7 38.9 19.4 63.2 24.3v39c0 29.2 19.4 48.6 48.6 48.6s48.6-19.4 48.6-48.6v-38.9c24.3-4.9 43.7-14.6 63.2-24.3l24.3 24.3c19.4 19.4 48.6 19.4 68 0s19.4-48.6 0-68l-24.3-24.3c9.7-19.4 19.4-38.9 24.3-63.2h38.9c29.2 0 48.6-19.4 48.6-48.6.1-29.2-19.4-48.7-48.5-48.7zM297.6 566.8c-82.6 0-145.8-63.2-145.8-145.8S215 275.1 297.6 275.1s145.8 63.2 145.8 145.8-63.1 145.9-145.8 145.9zm0-194.5c-29.2 0-48.6 19.4-48.6 48.6s19.4 48.6 48.6 48.6 48.6-19.4 48.6-48.6-19.4-48.6-48.6-48.6z"/></svg>',
|
|
twitter:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 11.6"><path d="M15 1.4c-.3.1-1 .4-1.7.5.4-.2 1.1-1 1.3-1.6-.4.3-1.4.7-1.9.7-.6-.7-1.4-1-2.3-1-1.7 0-3.1 1.3-3.1 3 0 .2 0 .4.1.7C5.1 3.6 2.4 2.5.9.6 0 2.1.8 3.9 1.8 4.5c-.4 0-1 0-1.3-.3 0 1 .5 2.4 2.4 2.9-.4.2-1 .1-1.3.1.1.9 1.4 2 2.8 2-.6.5-2.3 1.4-4.4 1.1 1.4.8 3.1 1.3 4.8 1.3 5 0 8.8-3.9 8.6-8.6.5-.4 1.1-.9 1.6-1.6z"/></svg>',undo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15"><path d="M15 13.4C15 4.1 7.5 5 7.5 5V1.7L0 6.5l7.5 4.9V8.2c5.8 0 7.5 5.1 7.5 5.2z"/></svg>',
|
|
"zoom-out":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" enable-background="new 0 0 32 32"><path fill-rule="evenodd" clip-rule="evenodd" d="M20.8 18.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5S7 10.4 7 14.5s3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zM14.5 20c-3 0-5.5-2.5-5.5-5.5S11.5 9 14.5 9s5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5zM11 15h7v-1h-7v1z"/></svg>',zoom:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 32 32" viewBox="0 0 30 30"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.95 9.95h-1v3h-3v1h3v3h1v-3h3v-1h-3v-3zm5.8 7.5c.7-1.2 1.2-2.5 1.2-4 0-4.1-3.4-7.5-7.5-7.5s-7.5 3.4-7.5 7.5 3.4 7.5 7.5 7.5c1.5 0 2.9-.5 4.1-1.2l4.3 4.3 2.2-2.2-4.3-4.4zm-6.3 1.5c-3 0-5.5-2.5-5.5-5.5s2.5-5.5 5.5-5.5 5.5 2.5 5.5 5.5-2.5 5.5-5.5 5.5z"/></svg>'});(function(a,b){function c(b){return!a(b).parents().andSelf().filter(function(){return"hidden"===a.curCSS(this,"visibility")||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,
|
|
PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({_focus:a.fn.focus,focus:function(b,c){return"number"===typeof b?this.each(function(){var f=this;setTimeout(function(){a(f).focus();c&&c.call(f)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,
|
|
"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){c=a(this[0]);for(var e;c.length&&c[0]!==document;){e=c.css("position");
|
|
if("absolute"===e||"relative"===e||"fixed"===e)if(e=parseInt(c.css("zIndex"),10),!isNaN(e)&&0!==e)return e;c=c.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,e){function f(b,c,d,e){a.each(g,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0;d&&(c-=parseFloat(a.curCSS(b,
|
|
"border"+this+"Width",!0))||0);e&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var g="Width"===e?["Left","Right"]:["Top","Bottom"],h=e.toLowerCase(),k={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+e]=function(c){return c===b?k["inner"+e].call(this):this.each(function(){a(this).css(h,f(this,c)+"px")})};a.fn["outer"+e]=function(b,c){return"number"!==typeof b?k["outer"+e].call(this,b):this.each(function(){a(this).css(h,
|
|
f(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,f){return!!a.data(b,f[3])},focusable:function(b){var e=b.nodeName.toLowerCase(),f=a.attr(b,"tabindex");if("area"===e){e=b.parentNode;f=e.name;if(!b.href||!f||"map"!==e.nodeName.toLowerCase())return!1;b=a("img[usemap=#"+f+"]")[0];return!!b&&c(b)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||!isNaN(f):!isNaN(f))&&c(b)},tabbable:function(b){var c=a.attr(b,"tabindex");return(isNaN(c)||0<=c)&&a(b).is(":focusable")}}),
|
|
a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=100===c.offsetHeight;a.support.selectstart="onselectstart"in c;b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,f){b=a.ui[b].prototype;for(var g in f)b.plugins[g]=b.plugins[g]||[],b.plugins[g].push([c,f[g]])},call:function(a,b,c){if((b=a.plugins[b])&&a.element[0].parentNode)for(var g=0;g<b.length;g++)a.options[b[g][0]]&&
|
|
b[g][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if("hidden"===a(b).css("overflow"))return!1;c=c&&"left"===c?"scrollLeft":"scrollTop";var f=!1;if(0<b[c])return!0;b[c]=1;f=0<b[c];b[c]=0;return f},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,f,g,h,k){return a.ui.isOverAxis(b,f,h)&&a.ui.isOverAxis(c,g,k)}}))})(jQuery);
|
|
(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,g;null!=(g=b[d]);d++)a(g).triggerHandler("remove");c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||b&&!a.filter(b,[this]).length||a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var h=b.split(".")[0],k;b=b.split(".")[1];k=h+"-"+b;d||(d=c,c=a.Widget);a.expr[":"][k]=function(c){return!!a.data(c,b)};
|
|
a[h]=a[h]||{};a[h][b]=function(a,b){arguments.length&&this._createWidget(a,b)};c=new c;c.options=a.extend(!0,{},c.options);a[h][b].prototype=a.extend(!0,c,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:k},d);a.widget.bridge(b,a[h][b])};a.widget.bridge=function(c,d){a.fn[c]=function(g){var h="string"===typeof g,k=Array.prototype.slice.call(arguments,1),l=this;g=!h&&k.length?a.extend.apply(null,[!0,g].concat(k)):g;if(h&&"_"===g.charAt(0))return l;
|
|
h?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[g])?d[g].apply(d,k):d;if(f!==d&&f!==b)return l=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(g||{})._init():a.data(this,c,new d(g,this))});return l}};a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this);this.element=a(c);this.options=a.extend(!0,{},this.options,this._getCreateOptions(),
|
|
b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},
|
|
option:function(c,d){var g=c;if(0===arguments.length)return a.extend({},this.options);if("string"===typeof c){if(d===b)return this.options[c];g={};g[c]=d}this._setOptions(g);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b;"disabled"===a&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",
|
|
!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var h=this.options[b];c=a.Event(c);c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();d=d||{};if(c.originalEvent){b=a.event.props.length;for(var k;b;)k=a.event.props[--b],c[k]=c.originalEvent[k]}this.element.trigger(c,d);return!(a.isFunction(h)&&!1===h.call(this.element[0],c,d)||c.isDefaultPrevented())}}})(jQuery);
|
|
(function(a){a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){b.originalEvent=
|
|
b.originalEvent||{};if(!b.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(b);this._mouseDownEvent=b;var c=this,d=1==b.which,e="string"==typeof this.options.cancel?a(b.target).parents().add(b.target).filter(this.options.cancel).length:!1;if(!d||e||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=
|
|
!1!==this._mouseStart(b),!this._mouseStarted))return b.preventDefault(),!0;!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return c._mouseMove(a)};this._mouseUpDelegate=function(a){return c._mouseUp(a)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);b.preventDefault();return b.originalEvent.mouseHandled=!0}},_mouseMove:function(b){if(a.browser.msie&&
|
|
!(9<=document.documentMode)&&!b.button)return this._mouseUp(b);if(this._mouseStarted)return this._mouseDrag(b),b.preventDefault();this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&((this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,b))?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);this._mouseStarted&&(this._mouseStarted=
|
|
!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
|
|
(function(a){a.ui=a.ui||{};var b=/left|center|right/,c=/top|center|bottom/,d=a.fn.position,e=a.fn.offset;a.fn.position=function(e){if(!e||!e.of)return d.apply(this,arguments);e=a.extend({},e);var g=a(e.of),h=g[0],k=(e.collision||"flip").split(" "),l=e.offset?e.offset.split(" "):[0,0],m,n,p;9===h.nodeType?(m=g.width(),n=g.height(),p={top:0,left:0}):h.setTimeout?(m=g.width(),n=g.height(),p={top:g.scrollTop(),left:g.scrollLeft()}):h.preventDefault?(e.at="left top",m=n=0,p={top:e.of.pageY,left:e.of.pageX}):
|
|
(m=g.outerWidth(),n=g.outerHeight(),p=g.offset());a.each(["my","at"],function(){var a=(e[this]||"").split(" ");1===a.length&&(a=b.test(a[0])?a.concat(["center"]):c.test(a[0])?["center"].concat(a):["center","center"]);a[0]=b.test(a[0])?a[0]:"center";a[1]=c.test(a[1])?a[1]:"center";e[this]=a});1===k.length&&(k[1]=k[0]);l[0]=parseInt(l[0],10)||0;1===l.length&&(l[1]=l[0]);l[1]=parseInt(l[1],10)||0;"right"===e.at[0]?p.left+=m:"center"===e.at[0]&&(p.left+=m/2);"bottom"===e.at[1]?p.top+=n:"center"===e.at[1]&&
|
|
(p.top+=n/2);p.left+=l[0];p.top+=l[1];return this.each(function(){var b=a(this),c=b.outerWidth(),d=b.outerHeight(),g=parseInt(a.curCSS(this,"marginLeft",!0))||0,h=parseInt(a.curCSS(this,"marginTop",!0))||0,x=c+g+(parseInt(a.curCSS(this,"marginRight",!0))||0),C=d+h+(parseInt(a.curCSS(this,"marginBottom",!0))||0),A=a.extend({},p),y;"right"===e.my[0]?A.left-=c:"center"===e.my[0]&&(A.left-=c/2);"bottom"===e.my[1]?A.top-=d:"center"===e.my[1]&&(A.top-=d/2);A.left=Math.round(A.left);A.top=Math.round(A.top);
|
|
y={left:A.left-g,top:A.top-h};a.each(["left","top"],function(b,g){a.ui.position[k[b]]&&a.ui.position[k[b]][g](A,{targetWidth:m,targetHeight:n,elemWidth:c,elemHeight:d,collisionPosition:y,collisionWidth:x,collisionHeight:C,offset:l,my:e.my,at:e.at})});a.fn.bgiframe&&b.bgiframe();b.offset(a.extend(A,{using:e.using}))})};a.ui.position={fit:{left:function(b,c){var d=a(window),d=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=0<d?b.left-d:Math.max(b.left-c.collisionPosition.left,
|
|
b.left)},top:function(b,c){var d=a(window),d=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=0<d?b.top-d:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if("center"!==c.at[0]){var d=a(window),d=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),e="left"===c.my[0]?-c.elemWidth:"right"===c.my[0]?c.elemWidth:0,l="left"===c.at[0]?c.targetWidth:-c.targetWidth,m=-2*c.offset[0];b.left+=0>c.collisionPosition.left?e+l+m:0<d?e+l+m:0}},top:function(b,
|
|
c){if("center"!==c.at[1]){var d=a(window),d=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),e="top"===c.my[1]?-c.elemHeight:"bottom"===c.my[1]?c.elemHeight:0,l="top"===c.at[1]?c.targetHeight:-c.targetHeight,m=-2*c.offset[1];b.top+=0>c.collisionPosition.top?e+l+m:0<d?e+l+m:0}}}};a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),l=parseInt(a.curCSS(b,"top",!0),10)||0,m=parseInt(a.curCSS(b,
|
|
"left",!0),10)||0,e={top:c.top-e.top+l,left:c.left-e.left+m};"using"in c?c.using.call(b,e):d.css(e)},a.fn.offset=function(b){var c=this[0];return c&&c.ownerDocument?b?this.each(function(){a.offset.setOffset(this,b)}):e.call(this):null})})(jQuery);
|
|
(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){"original"!=this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||
|
|
(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable"))return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?
|
|
!1:(this.handle=this._getHandle(b))?!0:!1},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();a.ui.ddmanager&&(a.ui.ddmanager.current=this);this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,
|
|
top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(!1===this._trigger("start",b))return this._clear(),!1;this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");
|
|
this._mouseDrag(b,!0);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(!1===this._trigger("drag",b,c))return this._mouseUp({}),!1;this.position=c.position}this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},
|
|
_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b));this.dropped&&(c=this.dropped,this.dropped=!1);if(!(this.element[0]&&this.element[0].parentNode||"original"!=this.options.helper))return!1;if("invalid"==this.options.revert&&!c||"valid"==this.options.revert&&c||!0===this.options.revert||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
|
|
10),function(){!1!==d._trigger("stop",b)&&d._clear()})}else!1!==this._trigger("stop",b)&&this._clear();return!1},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=this.options.handle&&a(this.options.handle,this.element).length?!1:!0;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],
|
|
[b])):"clone"==c.helper?this.element.clone():this.element;b.parents("body").length||b.appendTo("parent"==c.appendTo?this.element[0].parentNode:c.appendTo);b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" "));a.isArray(b)&&(b={left:+b[0],top:+b[1]||0});"left"in b&&(this.offset.click.left=b.left+this.margins.left);"right"in b&&(this.offset.click.left=this.helperProportions.width-
|
|
b.right+this.margins.left);"top"in b&&(this.offset.click.top=b.top+this.margins.top);"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==
|
|
document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),
|
|
10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;"parent"==b.containment&&
|
|
(b.containment=this.helper[0].parentNode);if("document"==b.containment||"window"==b.containment)this.containment=[("document"==b.containment?0:a(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,("document"==b.containment?0:a(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,("document"==b.containment?0:a(window).scrollLeft())+a("document"==b.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"==b.containment?0:a(window).scrollTop())+
|
|
(a("document"==b.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(/^(document|window|parent)$/.test(b.containment)||b.containment.constructor==Array)b.containment.constructor==Array&&(this.containment=b.containment);else{var c=a(b.containment)[0];if(c){var b=a(b.containment).offset(),d="hidden"!=a(c).css("overflow");this.containment=[b.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),
|
|
10)||0),b.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),b.left+(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,b.top+(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-
|
|
this.margins.top-this.margins.bottom]}}},_convertPositionTo:function(b,c){c||(c=this.position);b="absolute"==b?1:-1;var d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():
|
|
e?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;
|
|
this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top)),c.grid&&(g=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*
|
|
c.grid[1],g=this.containment?g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3]?g-this.offset.click.top<this.containment[1]?g+c.grid[1]:g-c.grid[1]:g:g,f=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0],f=this.containment?f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2]?f-this.offset.click.left<this.containment[0]?f+c.grid[0]:f-c.grid[0]:f:f));return{top:g-this.offset.click.top-this.offset.relative.top-
|
|
this.offset.parent.top+(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&526>a.browser.version&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&
|
|
this.helper.remove();this.helper=null;this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);"drag"==b&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.11"});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,
|
|
c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[];a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=
|
|
!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,"original"==d.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this;a.each(d.sortables,function(){this.instance.positionAbs=d.positionAbs;this.instance.helperProportions=d.helperProportions;this.instance.offset.click=
|
|
d.offset.click;this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=
|
|
d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",
|
|
b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}});a.ui.plugin.add("draggable","cursor",{start:function(){var b=a("body"),c=a(this).data("draggable").options;b.css("cursor")&&(c._cursor=b.css("cursor"));b.css("cursor",c.cursor)},stop:function(){var b=a(this).data("draggable").options;
|
|
b._cursor&&a("body").css("cursor",b._cursor)}});a.ui.plugin.add("draggable","iframeFix",{start:function(){var b=a(this).data("draggable").options;a(!0===b.iframeFix?"iframe":b.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")})},stop:function(){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});
|
|
a.ui.plugin.add("draggable","opacity",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;b.css("opacity")&&(c._opacity=b.css("opacity"));b.css("opacity",c.opacity)},stop:function(b,c){b=a(this).data("draggable").options;b._opacity&&a(c.helper).css("opacity",b._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");b.scrollParent[0]!=document&&"HTML"!=b.scrollParent[0].tagName&&(b.overflowOffset=b.scrollParent.offset())},drag:function(b){var c=
|
|
a(this).data("draggable"),d=c.options,e=!1;c.scrollParent[0]!=document&&"HTML"!=c.scrollParent[0].tagName?(d.axis&&"x"==d.axis||(c.overflowOffset.top+c.scrollParent[0].offsetHeight-b.pageY<d.scrollSensitivity?c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop+d.scrollSpeed:b.pageY-c.overflowOffset.top<d.scrollSensitivity&&(c.scrollParent[0].scrollTop=e=c.scrollParent[0].scrollTop-d.scrollSpeed)),d.axis&&"y"==d.axis||(c.overflowOffset.left+c.scrollParent[0].offsetWidth-b.pageX<d.scrollSensitivity?
|
|
c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft+d.scrollSpeed:b.pageX-c.overflowOffset.left<d.scrollSensitivity&&(c.scrollParent[0].scrollLeft=e=c.scrollParent[0].scrollLeft-d.scrollSpeed))):(d.axis&&"x"==d.axis||(b.pageY-a(document).scrollTop()<d.scrollSensitivity?e=a(document).scrollTop(a(document).scrollTop()-d.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<d.scrollSensitivity&&(e=a(document).scrollTop(a(document).scrollTop()+d.scrollSpeed))),d.axis&&"y"==d.axis||
|
|
(b.pageX-a(document).scrollLeft()<d.scrollSensitivity?e=a(document).scrollLeft(a(document).scrollLeft()-d.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<d.scrollSensitivity&&(e=a(document).scrollLeft(a(document).scrollLeft()+d.scrollSpeed))));!1!==e&&a.ui.ddmanager&&!d.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,b)}});a.ui.plugin.add("draggable","snap",{start:function(){var b=a(this).data("draggable"),c=b.options;b.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":
|
|
c.snap).each(function(){var c=a(this),e=c.offset();this!=b.element[0]&&b.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:e.top,left:e.left})})},drag:function(b,c){for(var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,k=c.offset.top,l=k+d.helperProportions.height,m=d.snapElements.length-1;0<=m;m--){var n=d.snapElements[m].left,p=n+d.snapElements[m].width,r=d.snapElements[m].top,t=r+d.snapElements[m].height;if(n-
|
|
f<g&&g<p+f&&r-f<k&&k<t+f||n-f<g&&g<p+f&&r-f<l&&l<t+f||n-f<h&&h<p+f&&r-f<k&&k<t+f||n-f<h&&h<p+f&&r-f<l&&l<t+f){if("inner"!=e.snapMode){var v=Math.abs(r-l)<=f,w=Math.abs(t-k)<=f,u=Math.abs(n-h)<=f,x=Math.abs(p-g)<=f;v&&(c.position.top=d._convertPositionTo("relative",{top:r-d.helperProportions.height,left:0}).top-d.margins.top);w&&(c.position.top=d._convertPositionTo("relative",{top:t,left:0}).top-d.margins.top);u&&(c.position.left=d._convertPositionTo("relative",{top:0,left:n-d.helperProportions.width}).left-
|
|
d.margins.left);x&&(c.position.left=d._convertPositionTo("relative",{top:0,left:p}).left-d.margins.left)}var C=v||w||u||x;"outer"!=e.snapMode&&(v=Math.abs(r-k)<=f,w=Math.abs(t-l)<=f,u=Math.abs(n-g)<=f,x=Math.abs(p-h)<=f,v&&(c.position.top=d._convertPositionTo("relative",{top:r,left:0}).top-d.margins.top),w&&(c.position.top=d._convertPositionTo("relative",{top:t-d.helperProportions.height,left:0}).top-d.margins.top),u&&(c.position.left=d._convertPositionTo("relative",{top:0,left:n}).left-d.margins.left),
|
|
x&&(c.position.left=d._convertPositionTo("relative",{top:0,left:p-d.helperProportions.width}).left-d.margins.left));!d.snapElements[m].snapping&&(v||w||u||x||C)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item}));d.snapElements[m].snapping=v||w||u||x||C}else d.snapElements[m].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[m].item})),d.snapElements[m].snapping=!1}}});
|
|
a.ui.plugin.add("draggable","stack",{start:function(){var b=a(this).data("draggable").options,b=a.makeArray(a(b.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(b.length){var c=parseInt(b[0].style.zIndex)||0;a(b).each(function(a){this.style.zIndex=c+a});this[0].style.zIndex=c+b.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;b.css("zIndex")&&(c._zIndex=b.css("zIndex"));
|
|
b.css("zIndex",c.zIndex)},stop:function(b,c){b=a(this).data("draggable").options;b._zIndex&&a(c.helper).css("zIndex",b._zIndex)}})})(jQuery);
|
|
(function(a){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],
|
|
_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null});this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"}),this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),
|
|
this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize",
|
|
"none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize());this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){"all"==
|
|
this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw");var f=this.handles.split(",");this.handles={};for(var g=0;g<f.length;g++){var h=a.trim(f[g]),k=a('<div class="ui-resizable-handle ui-resizable-'+h+'"></div>');/sw|se|ne|nw/.test(h)&&k.css({zIndex:++c.zIndex});"se"==h&&k.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[h]=".ui-resizable-"+h;this.element.append(k)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=
|
|
a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0,e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth(),d=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(d,e);this._proportionallyResize()}a(this.handles[c])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();
|
|
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}});c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){a(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())}));this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
|
|
if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var c=!1,f;for(f in this.handles)a(this.handles[f])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(c){var e=this.options,f=this.element.position(),
|
|
g=this.element;this.resizing=!0;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};(g.is(".ui-draggable")||/absolute/.test(g.css("position")))&&g.css({position:"absolute",top:f.top,left:f.left});a.browser.opera&&/relative/.test(g.css("position"))&&g.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();var f=b(this.helper.css("left")),h=b(this.helper.css("top"));e.containment&&(f+=a(e.containment).scrollLeft()||0,h+=a(e.containment).scrollTop()||0);this.offset=
|
|
this.helper.offset();this.position={left:f,top:h};this.size=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalSize=this._helper?{width:g.outerWidth(),height:g.outerHeight()}:{width:g.width(),height:g.height()};this.originalPosition={left:f,top:h};this.sizeDiff={width:g.outerWidth()-g.width(),height:g.outerHeight()-g.height()};this.originalMousePosition={left:c.pageX,top:c.pageY};this.aspectRatio="number"==typeof e.aspectRatio?e.aspectRatio:
|
|
this.originalSize.width/this.originalSize.height||1;e=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor","auto"==e?this.axis+"-resize":e);g.addClass("ui-resizable-resizing");this._propagate("start",c);return!0},_mouseDrag:function(a){var b=this.helper,c=this.originalMousePosition,g=this._change[this.axis];if(!g)return!1;c=g.apply(this,[a,a.pageX-c.left||0,a.pageY-c.top||0]);if(this._aspectRatio||a.shiftKey)c=this._updateRatio(c,a);c=this._respectSize(c,a);this._propagate("resize",
|
|
a);b.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",a,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options;if(this._helper){var f=this._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),f=g&&a.ui.hasScroll(f[0],"left")?0:this.sizeDiff.height,g=g?0:
|
|
this.sizeDiff.width,g={width:this.helper.width()-g,height:this.helper.height()-f},f=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null,h=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;c.animate||this.element.css(a.extend(g,{top:h,left:f}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");
|
|
this._propagate("stop",b);this._helper&&this.helper.remove();return!1},_updateCache:function(a){this.offset=this.helper.offset();c(a.left)&&(this.position.left=a.left);c(a.top)&&(this.position.top=a.top);c(a.height)&&(this.size.height=a.height);c(a.width)&&(this.size.width=a.width)},_updateRatio:function(a){var b=this.position,c=this.size,g=this.axis;a.height?a.width=c.height*this.aspectRatio:a.width&&(a.height=c.width/this.aspectRatio);"sw"==g&&(a.left=b.left+(c.width-a.width),a.top=null);"nw"==
|
|
g&&(a.top=b.top+(c.height-a.height),a.left=b.left+(c.width-a.width));return a},_respectSize:function(a){var b=this.options,f=this.axis,g=c(a.width)&&b.maxWidth&&b.maxWidth<a.width,h=c(a.height)&&b.maxHeight&&b.maxHeight<a.height,k=c(a.width)&&b.minWidth&&b.minWidth>a.width,l=c(a.height)&&b.minHeight&&b.minHeight>a.height;k&&(a.width=b.minWidth);l&&(a.height=b.minHeight);g&&(a.width=b.maxWidth);h&&(a.height=b.maxHeight);var m=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height,
|
|
p=/sw|nw|w/.test(f),f=/nw|ne|n/.test(f);k&&p&&(a.left=m-b.minWidth);g&&p&&(a.left=m-b.maxWidth);l&&f&&(a.top=n-b.minHeight);h&&f&&(a.top=n-b.maxHeight);(b=!a.width&&!a.height)&&!a.left&&a.top?a.top=null:b&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,c=0;c<this._proportionallyResizeElements.length;c++){var f=this._proportionallyResizeElements[c];if(!this.borderDif){var g=[f.css("borderTopWidth"),
|
|
f.css("borderRightWidth"),f.css("borderBottomWidth"),f.css("borderLeftWidth")],h=[f.css("paddingTop"),f.css("paddingRight"),f.css("paddingBottom"),f.css("paddingLeft")];this.borderDif=a.map(g,function(a,b){a=parseInt(a,10)||0;b=parseInt(h[b],10)||0;return a+b})}a.browser.msie&&(a(b).is(":hidden")||a(b).parents(":hidden").length)||f.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=this.options;this.elementOffset=
|
|
this.element.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var c=a.browser.msie&&7>a.browser.version,f=c?1:0,c=c?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+c,height:this.element.outerHeight()+c,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b){return{width:this.originalSize.width+
|
|
b}},w:function(a,b){return{left:this.originalPosition.left+b,width:this.originalSize.width-b}},n:function(a,b,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,f){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,f]))},sw:function(b,c,f){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,f]))},ne:function(b,c,f){return a.extend(this._change.n.apply(this,
|
|
arguments),this._change.e.apply(this,[b,c,f]))},nw:function(b,c,f){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,f]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]);"resize"!=b&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,
|
|
{version:"1.8.11"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var b=a(this).data("resizable").options,c=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10),position:b.css("position")})})};"object"!=typeof b.alsoResize||b.alsoResize.parentNode?c(b.alsoResize):b.alsoResize.length?(b.alsoResize=b.alsoResize[0],c(b.alsoResize)):a.each(b.alsoResize,
|
|
function(a){c(a)})},resize:function(b,c){var f=a(this).data("resizable");b=f.options;var g=f.originalSize,h=f.originalPosition,k={height:f.size.height-g.height||0,width:f.size.width-g.width||0,top:f.position.top-h.top||0,left:f.position.left-h.left||0},l=function(b,d){a(b).each(function(){var b=a(this),g=a(this).data("resizable-alsoresize"),h={},l=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(l,function(a,b){(a=(g[b]||0)+(k[b]||0))&&
|
|
0<=a&&(h[b]=a||null)});a.browser.opera&&/relative/.test(b.css("position"))&&(f._revertToRelativePosition=!0,b.css({position:"absolute",top:"auto",left:"auto"}));b.css(h)})};"object"!=typeof b.alsoResize||b.alsoResize.nodeType?l(b.alsoResize):a.each(b.alsoResize,function(a,b){l(a,b)})},stop:function(){var b=a(this).data("resizable"),c=b.options,f=function(b){a(b).each(function(){var b=a(this);b.css({position:b.data("resizable-alsoresize").position})})};b._revertToRelativePosition&&(b._revertToRelativePosition=
|
|
!1,"object"!=typeof c.alsoResize||c.alsoResize.nodeType?f(c.alsoResize):a.each(c.alsoResize,function(a){f(a)}));a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(b){var c=a(this).data("resizable"),f=c.options,g=c._proportionallyResizeElements,h=g.length&&/textarea/i.test(g[0].nodeName),k=h&&a.ui.hasScroll(g[0],"left")?0:c.sizeDiff.height,h={width:c.size.width-(h?0:c.sizeDiff.width),height:c.size.height-k},k=parseInt(c.element.css("left"),10)+(c.position.left-
|
|
c.originalPosition.left)||null,l=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;c.element.animate(a.extend(h,l&&k?{top:l,left:k}:{}),{duration:f.animateDuration,easing:f.animateEasing,step:function(){var f={width:parseInt(c.element.css("width"),10),height:parseInt(c.element.css("height"),10),top:parseInt(c.element.css("top"),10),left:parseInt(c.element.css("left"),10)};g&&g.length&&a(g[0]).css({width:f.width,height:f.height});c._updateCache(f);c._propagate("resize",
|
|
b)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var c=a(this).data("resizable"),e=c.element,f=c.options.containment;if(e=f instanceof a?f.get(0):/parent/.test(f)?e.parent().get(0):f)if(c.containerElement=a(e),/document/.test(f)||f==document)c.containerOffset={left:0,top:0},c.containerPosition={left:0,top:0},c.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var g=a(e),h=[];a(["Top",
|
|
"Right","Left","Bottom"]).each(function(a,c){h[a]=b(g.css("padding"+c))});c.containerOffset=g.offset();c.containerPosition=g.position();c.containerSize={height:g.innerHeight()-h[3],width:g.innerWidth()-h[1]};var f=c.containerOffset,k=c.containerSize.height,l=c.containerSize.width,l=a.ui.hasScroll(e,"left")?e.scrollWidth:l,k=a.ui.hasScroll(e)?e.scrollHeight:k;c.parentData={element:e,left:f.left,top:f.top,width:l,height:k}}},resize:function(b){var c=a(this).data("resizable"),f=c.options,g=c.containerOffset,
|
|
h=c.position;b=c._aspectRatio||b.shiftKey;var k={top:0,left:0},l=c.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g);h.left<(c._helper?g.left:0)&&(c.size.width+=c._helper?c.position.left-g.left:c.position.left-k.left,b&&(c.size.height=c.size.width/f.aspectRatio),c.position.left=f.helper?g.left:0);h.top<(c._helper?g.top:0)&&(c.size.height+=c._helper?c.position.top-g.top:c.position.top,b&&(c.size.width=c.size.height*f.aspectRatio),c.position.top=c._helper?g.top:0);c.offset.left=
|
|
c.parentData.left+c.position.left;c.offset.top=c.parentData.top+c.position.top;f=Math.abs(c.offset.left-k.left+c.sizeDiff.width);g=Math.abs((c._helper?c.offset.top-k.top:c.offset.top-g.top)+c.sizeDiff.height);h=c.containerElement.get(0)==c.element.parent().get(0);k=/relative|absolute/.test(c.containerElement.css("position"));h&&k&&(f-=c.parentData.left);f+c.size.width>=c.parentData.width&&(c.size.width=c.parentData.width-f,b&&(c.size.height=c.size.width/c.aspectRatio));g+c.size.height>=c.parentData.height&&
|
|
(c.size.height=c.parentData.height-g,b&&(c.size.width=c.size.height*c.aspectRatio))},stop:function(){var b=a(this).data("resizable"),c=b.options,f=b.containerOffset,g=b.containerPosition,h=b.containerElement,k=a(b.helper),l=k.offset(),m=k.outerWidth()-b.sizeDiff.width,k=k.outerHeight()-b.sizeDiff.height;b._helper&&!c.animate&&/relative/.test(h.css("position"))&&a(this).css({left:l.left-g.left-f.left,width:m,height:k});b._helper&&!c.animate&&/static/.test(h.css("position"))&&a(this).css({left:l.left-
|
|
g.left-f.left,width:m,height:k})}});a.ui.plugin.add("resizable","ghost",{start:function(){var b=a(this).data("resizable"),c=b.options,f=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof c.ghost?c.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=a(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,
|
|
width:b.size.width})},stop:function(){var b=a(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var b=a(this).data("resizable"),c=b.options,f=b.size,g=b.originalSize,h=b.originalPosition,k=b.axis;c.grid="number"==typeof c.grid?[c.grid,c.grid]:c.grid;var l=Math.round((f.width-g.width)/(c.grid[0]||1))*(c.grid[0]||1),c=Math.round((f.height-g.height)/(c.grid[1]||1))*(c.grid[1]||1);/^(se|s|e)$/.test(k)?(b.size.width=
|
|
g.width+l,b.size.height=g.height+c):/^(ne)$/.test(k)?(b.size.width=g.width+l,b.size.height=g.height+c,b.position.top=h.top-c):(/^(sw)$/.test(k)?(b.size.width=g.width+l,b.size.height=g.height+c):(b.size.width=g.width+l,b.size.height=g.height+c,b.position.top=h.top-c),b.position.left=h.left-l)}});var b=function(a){return parseInt(a,10)||0},c=function(a){return!isNaN(parseInt(a,10))}})(jQuery);
|
|
(function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=
|
|
this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;0<=a;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(b,c){"disabled"===b?(this.options[b]=c,this.widget()[c?
|
|
"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){if(this.reverting||this.options.disabled||"static"==this.options.type)return!1;this._refreshItems(b);var d=null,e=this;a(b.target).parents().each(function(){if(a.data(this,"sortable-item")==e)return d=a(this),!1});a.data(b.target,"sortable-item")==e&&(d=a(b.target));if(!d)return!1;if(this.options.handle&&!c){var f=!1;a(this.options.handle,d).find("*").andSelf().each(function(){this==
|
|
b.target&&(f=!0)});if(!f)return!1}this.currentItem=d;this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){c=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(b);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=
|
|
this.helper.css("position");a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();
|
|
c.containment&&this._setContainment();c.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",c.cursor));c.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",c.opacity));c.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",c.zIndex));this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset());
|
|
this._trigger("start",b,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;0<=d;d--)this.containers[d]._trigger("activate",b,this._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this);a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");
|
|
this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&"HTML"!=this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+
|
|
this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+
|
|
c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)));!1!==d&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"==this.options.axis||(this.helper[0].style.left=this.position.left+"px");
|
|
this.options.axis&&"x"==this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(c=this.items.length-1;0<=c;c--){var d=this.items[c],e=d.item[0],f=this._intersectsWithPointer(d);if(f&&e!=this.currentItem[0]&&this.placeholder[1==f?"next":"prev"]()[0]!=e&&!a.ui.contains(this.placeholder[0],e)&&("semi-dynamic"==this.options.type?!a.ui.contains(this.element[0],e):1)){this.direction=1==f?"down":"up";if("pointer"==this.options.tolerance||this._intersectsWithSides(d))this._rearrange(b,d);
|
|
else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b);a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this;c=d.placeholder.offset();d.reverting=!0;a(this.helper).animate({left:c.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?
|
|
0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"==this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;0<=b;b--)this.containers[b]._trigger("deactivate",
|
|
null,this._uiHash(this)),this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",null,this._uiHash(this)),this.containers[b].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!=this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):
|
|
a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))});!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||
|
|
"id")||"")});return d},_intersectsWith:function(a){var c=this.positionAbs.left,d=c+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,k=a.top,l=k+a.height,m=this.offset.click.top,n=this.offset.click.left;return"pointer"==this.options.tolerance||this.options.forcePointerForContainers||"pointer"!=this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?e+m>k&&e+m<l&&c+n>g&&c+n<h:g<c+this.helperProportions.width/
|
|
2&&d-this.helperProportions.width/2<h&&k<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<l},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width);c=c&&b;b=this._getDragVerticalDirection();var d=this._getDragHorizontalDirection();return c?this.floating?d&&"right"==d||"down"==b?2:1:b&&("down"==b?2:1):!1},_intersectsWithSides:function(b){var c=
|
|
a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width);var d=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?"right"==e&&b||"left"==e&&!b:d&&("down"==d&&c||"up"==d&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return 0!=a&&(0<a?"down":"up")},_getDragHorizontalDirection:function(){var a=
|
|
this.positionAbs.left-this.lastPositionAbs.left;return 0!=a&&(0<a?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=[],d=[],e=this._connectWith();if(e&&b)for(b=e.length-1;0<=b;b--)for(var f=a(e[b]),g=f.length-1;0<=g;g--){var h=a.data(f[g],"sortable");h&&h!=this&&!h.options.disabled&&d.push([a.isFunction(h.options.items)?
|
|
h.options.items.call(h.element):a(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}d.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(b=d.length-1;0<=b;b--)d[b][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),
|
|
c=0;c<this.items.length;c++)for(var d=0;d<a.length;d++)a[d]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(b){this.items=[];this.containers=[this];var c=this.items,d=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;0<=f;f--)for(var g=a(e[f]),h=g.length-1;0<=h;h--){var k=a.data(g[h],"sortable");k&&k!=this&&!k.options.disabled&&(d.push([a.isFunction(k.options.items)?
|
|
k.options.items.call(k.element[0],b,{item:this.currentItem}):a(k.options.items,k.element),k]),this.containers.push(k))}for(f=d.length-1;0<=f;f--)for(b=d[f][1],e=d[f][0],h=0,g=e.length;h<g;h++)k=a(e[h]),k.data("sortable-item",b),c.push({item:k,instance:b,width:0,height:0,left:0,top:0})},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;0<=c;c--){var d=this.items[c],e=this.options.toleranceElement?a(this.options.toleranceElement,
|
|
d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());e=e.offset();d.left=e.left;d.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;0<=c;c--)e=this.containers[c].element.offset(),this.containers[c].containerCache.left=e.left,this.containers[c].containerCache.top=e.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=
|
|
this.containers[c].element.outerHeight();return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-
|
|
parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){for(var c=null,d=null,e=this.containers.length-1;0<=e;e--)a.ui.contains(this.currentItem[0],
|
|
this.containers[e].element[0])||(this._intersectsWith(this.containers[e].containerCache)?c&&a.ui.contains(this.containers[e].element[0],c.element[0])||(c=this.containers[e],d=e):this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){for(var c=
|
|
1E4,e=null,f=this.positionAbs[this.containers[d].floating?"left":"top"],g=this.items.length-1;0<=g;g--)if(a.ui.contains(this.containers[d].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[d].floating?"left":"top"];Math.abs(h-f)<c&&(c=Math.abs(h-f),e=this.items[g])}if(e||this.options.dropOnEmpty)this.currentContainer=this.containers[d],e?this._rearrange(b,e,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",
|
|
b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):"clone"==c.helper?this.currentItem.clone():this.currentItem;b.parents("body").length||a("parent"!=c.appendTo?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0]);b[0]==this.currentItem[0]&&
|
|
(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(""==b[0].style.width||c.forceHelperSize)&&b.width(this.currentItem.width());(""==b[0].style.height||c.forceHelperSize)&&b.height(this.currentItem.height());return b},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" "));a.isArray(b)&&(b={left:+b[0],top:+b[1]||0});"left"in b&&
|
|
(this.offset.click.left=b.left+this.margins.left);"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left);"top"in b&&(this.offset.click.top=b.top+this.margins.top);"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();"absolute"==this.cssPosition&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&
|
|
(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&"html"==this.offsetParent[0].tagName.toLowerCase()&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"==this.cssPosition){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),
|
|
10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;"parent"==b.containment&&(b.containment=
|
|
this.helper[0].parentNode);if("document"==b.containment||"window"==b.containment)this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a("document"==b.containment?document:window).width()-this.helperProportions.width-this.margins.left,(a("document"==b.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=
|
|
a(b.containment)[0],b=a(b.containment).offset(),d="hidden"!=a(c).css("overflow");this.containment=[b.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,b.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,b.left+(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-
|
|
this.margins.left,b.top+(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);b="absolute"==b?1:-1;var d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);return{top:c.top+
|
|
this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&"fixed"==this.cssPosition?0:("fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d="absolute"!=this.cssPosition||this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],
|
|
this.offsetParent[0])?this.scrollParent:this.offsetParent,e=/(html|body)/i.test(d[0].tagName);"relative"!=this.cssPosition||this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),
|
|
b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top)),c.grid&&(g=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1],g=this.containment?g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3]?g-this.offset.click.top<this.containment[1]?g+c.grid[1]:g-c.grid[1]:g:g,f=this.originalPageX+Math.round((f-this.originalPageX)/
|
|
c.grid[0])*c.grid[0],f=this.containment?f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2]?f-this.offset.click.left<this.containment[0]?f+c.grid[0]:f-c.grid[0]:f:f));return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&
|
|
"fixed"==this.cssPosition?0:"fixed"==this.cssPosition?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,c,d,e){d?d[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],"down"==this.direction?c.item[0]:c.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,g=this.counter;window.setTimeout(function(){g==f.counter&&f.refreshPositions(!e)},0)},_clear:function(b,c){this.reverting=!1;var d=[];!this._noFinalSort&&this.currentItem[0].parentNode&&
|
|
this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if("auto"==this._storedCSS[e]||"static"==this._storedCSS[e])this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))});!this.fromOutside&&this.domPosition.prev==this.currentItem.prev().not(".ui-sortable-helper")[0]&&
|
|
this.domPosition.parent==this.currentItem.parent()[0]||c||d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0]))for(c||d.push(function(a){this._trigger("remove",a,this._uiHash())}),e=this.containers.length-1;0<=e;e--)a.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[e])),d.push(function(a){return function(b){a._trigger("update",
|
|
b,this._uiHash(this))}}.call(this,this.containers[e])));for(e=this.containers.length-1;0<=e;e--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",
|
|
this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex","auto"==this._storedZIndex?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(e=0;e<d.length;e++)d[e].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(e=
|
|
0;e<d.length;e++)d[e].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){!1===a.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}});a.extend(a.ui.sortable,{version:"1.8.11"})})(jQuery);
|
|
(function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,c=this.options;this._mouseSliding=this._keySliding=!1;this._animateOff=!0;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");c.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");
|
|
this.range=a([]);c.range&&(!0===c.range?(this.range=a("<div></div>"),c.values||(c.values=[this._valueMin(),this._valueMin()]),c.values.length&&2!==c.values.length&&(c.values=[c.values[0],c.values[0]])):this.range=a("<div></div>"),this.range.appendTo(this.element).addClass("ui-slider-range"),"min"!==c.range&&"max"!==c.range||this.range.addClass("ui-slider-range-"+c.range),this.range.addClass("ui-widget-header"));0===a(".ui-slider-handle",this.element).length&&a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");
|
|
if(c.values&&c.values.length)for(;a(".ui-slider-handle",this.element).length<c.values.length;)a("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){c.disabled?
|
|
a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)});this.handles.keydown(function(c){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,k;if(!b.options.disabled){switch(c.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(e=
|
|
!1,!b._keySliding&&(b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(c,f),!1===g))return}k=b.options.step;g=b.options.values&&b.options.values.length?h=b.values(f):h=b.value();switch(c.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===
|
|
b._valueMax())return;h=b._trimAlignValue(g+k);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-k)}b._slide(c,f,h);return e}}).keyup(function(c){var e=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,e),b._change(c,e),a(this).removeClass("ui-state-active"))});this._refreshValue();this._animateOff=!1},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");
|
|
this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();d=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;g=this;this.handles.each(function(b){var c=Math.abs(d-g.values(b));e>c&&(e=c,f=a(this),h=b)});!0===c.range&&this.values(1)===c.min&&(h+=1,f=a(this.handles[h]));if(!1===this._start(b,
|
|
h))return!1;this._mouseSliding=!0;g._handleIndex=h;f.addClass("ui-state-active").focus();c=f.offset();this._clickOffset=a(b.target).parents().andSelf().is(".ui-slider-handle")?{left:b.pageX-c.left-f.width()/2,top:b.pageY-c.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)}:{left:0,top:0};this.handles.hasClass("ui-state-hover")||this._slide(b,h,d);return this._animateOff=!0},_mouseStart:function(){return!0},
|
|
_mouseDrag:function(a){var c=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=!1;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(a){var c;"horizontal"===
|
|
this.orientation?(c=this.elementSize.width,a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(c=this.elementSize.height,a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));c=a/c;1<c&&(c=1);0>c&&(c=0);"vertical"===this.orientation&&(c=1-c);a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*a)},_start:function(a,c){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=
|
|
this.values(c),d.values=this.values());return this._trigger("start",a,d)},_slide:function(a,c,d){var e;this.options.values&&this.options.values.length?(e=this.values(c?0:1),2===this.options.values.length&&!0===this.options.range&&(0===c&&d>e||1===c&&d<e)&&(d=e),d!==this.values(c)&&(e=this.values(),e[c]=d,a=this._trigger("slide",a,{handle:this.handles[c],value:d,values:e}),this.values(c?0:1),!1!==a&&this.values(c,d,!0))):d!==this.value()&&(a=this._trigger("slide",a,{handle:this.handles[c],value:d}),
|
|
!1!==a&&this.value(d))},_stop:function(a,c){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(c),d.values=this.values());this._trigger("stop",a,d)},_change:function(a,c){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[c],value:this.value()};this.options.values&&this.options.values.length&&(d.value=this.values(c),d.values=this.values());this._trigger("change",a,d)}},value:function(a){arguments.length&&(this.options.value=
|
|
this._trimAlignValue(a),this._refreshValue(),this._change(null,0));return this._value()},values:function(b,c){var d,e,f;1<arguments.length&&(this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b));if(arguments.length)if(a.isArray(arguments[0])){d=this.options.values;e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):this.value();
|
|
else return this._values()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length);a.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.attr("disabled","disabled"),this.element.addClass("ui-disabled")):(this.handles.removeAttr("disabled"),this.element.removeClass("ui-disabled"));break;case "orientation":this._detectOrientation();
|
|
this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=!0;this._refreshValue();this._change(null,0);this._animateOff=!1;break;case "values":this._animateOff=!0;this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){return this._trimAlignValue(this.options.value)},_values:function(a){var c,d;if(arguments.length)return c=this.options.values[a],this._trimAlignValue(c);
|
|
c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var c=0<this.options.step?this.options.step:1,d=(a-this._valueMin())%c;a-=d;2*Math.abs(d)>=c&&(a+=0<d?c:-c);return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,
|
|
c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,k,l,m;if(this.options.values&&this.options.values.length)this.handles.each(function(b){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100;g["horizontal"===d.orientation?"left":"bottom"]=f+"%";a(this).stop(1,1)[e?"animate":"css"](g,c.animate);if(!0===d.options.range)if("horizontal"===d.orientation){if(0===b)d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate);if(1===b)d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,
|
|
duration:c.animate})}else{if(0===b)d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate);if(1===b)d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate})}h=f});else{k=this.value();l=this._valueMin();m=this._valueMax();f=m!==l?(k-l)/(m-l)*100:0;g["horizontal"===d.orientation?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](g,c.animate);if("min"===b&&"horizontal"===this.orientation)this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate);if("max"===
|
|
b&&"horizontal"===this.orientation)this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate});if("min"===b&&"vertical"===this.orientation)this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate);if("max"===b&&"vertical"===this.orientation)this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.11"})})(jQuery);
|
|
(function(a,b){function c(){this.debug=!1;this._curInst=null;this._keyEvent=!1;this._disabledInputs=[];this._inDialog=this._datepickerShowing=!1;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
|
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:"January February March April May June July August September October November December".split(" "),monthNamesShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),dayNames:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),dayNamesShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),dayNamesMin:"Su Mo Tu We Th Fr Sa".split(" "),
|
|
weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,
|
|
beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1};a.extend(this._defaults,this.regional[""]);this.dpDiv=a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')}function d(c,d){a.extend(c,d);for(var e in d)if(null==d[e]||d[e]==b)c[e]=d[e];return c}a.extend(a.ui,{datepicker:{version:"1.8.11"}});
|
|
var e=(new Date).getTime();a.extend(c.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){d(this._defaults,a||{});return this},_attachDatepicker:function(b,c){var d=null,e;for(e in this._defaults){var l=b.getAttribute("date:"+e);if(l){d=d||{};try{d[e]=eval(l)}catch(m){d[e]=l}}}e=b.nodeName.toLowerCase();l="div"==e||"span"==e;b.id||(this.uuid+=1,b.id="dp"+this.uuid);var n=this._newInst(a(b),
|
|
l);n.settings=a.extend({},c||{},d||{});"input"==e?this._connectDatepicker(b,n):l&&this._inlineDatepicker(b,n)},_newInst:function(b,c){return{id:b[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:b,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:c?a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'):this.dpDiv}},_connectDatepicker:function(b,c){var d=a(b);c.append=a([]);c.trigger=a([]);d.hasClass(this.markerClassName)||
|
|
(this._attachments(d,c),d.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,b,d){c.settings[b]=d}).bind("getData.datepicker",function(a,b){return this._get(c,b)}),this._autoSize(c),a.data(b,"datepicker",c))},_attachments:function(b,c){var d=this._get(c,"appendText"),e=this._get(c,"isRTL");c.append&&c.append.remove();d&&(c.append=a('<span class="'+this._appendClass+'">'+d+"</span>"),b[e?"before":"after"](c.append));
|
|
b.unbind("focus",this._showDatepicker);c.trigger&&c.trigger.remove();d=this._get(c,"showOn");"focus"!=d&&"both"!=d||b.focus(this._showDatepicker);if("button"==d||"both"==d){var d=this._get(c,"buttonText"),l=this._get(c,"buttonImage");c.trigger=a(this._get(c,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:l,alt:d,title:d}):a('<button type="button"></button>').addClass(this._triggerClass).html(""==l?d:a("<img/>").attr({src:l,alt:d,title:d})));b[e?"before":"after"](c.trigger);c.trigger.click(function(){a.datepicker._datepickerShowing&&
|
|
a.datepicker._lastInput==b[0]?a.datepicker._hideDatepicker():a.datepicker._showDatepicker(b[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){for(var b=0,c=0,d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",
|
|
this._formatDate(a,b).length)}},_inlineDatepicker:function(b,c){var d=a(b);d.hasClass(this.markerClassName)||(d.addClass(this.markerClassName).append(c.dpDiv).bind("setData.datepicker",function(a,b,d){c.settings[b]=d}).bind("getData.datepicker",function(a,b){return this._get(c,b)}),a.data(b,"datepicker",c),this._setDate(c,this._getDefaultDate(c),!0),this._updateDatepicker(c),this._updateAlternate(c),c.dpDiv.show())},_dialogDatepicker:function(b,c,e,k,l){b=this._dialogInst;b||(this.uuid+=1,this._dialogInput=
|
|
a('<input type="text" id="dp'+this.uuid+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),a("body").append(this._dialogInput),b=this._dialogInst=this._newInst(this._dialogInput,!1),b.settings={},a.data(this._dialogInput[0],"datepicker",b));d(b.settings,k||{});c=c&&c.constructor==Date?this._formatDate(b,c):c;this._dialogInput.val(c);this._pos=l?l.length?l:[l.pageX,l.pageY]:null;this._pos||(this._pos=[document.documentElement.clientWidth/
|
|
2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)]);this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");b.settings.onSelect=e;this._inDialog=!0;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",b);return this},_destroyDatepicker:function(b){var c=
|
|
a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=b.nodeName.toLowerCase();a.removeData(b,"datepicker");"input"==e?(d.append.remove(),d.trigger.remove(),c.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!=e&&"span"!=e||c.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(b){var c=a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=
|
|
b.nodeName.toLowerCase();"input"==e?(b.disabled=!1,d.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!=e&&"span"!=e||c.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(a){return a==b?null:a})}},_disableDatepicker:function(b){var c=a(b),d=a.data(b,"datepicker");if(c.hasClass(this.markerClassName)){var e=b.nodeName.toLowerCase();"input"==e?(b.disabled=
|
|
!0,d.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!=e&&"span"!=e||c.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=a.map(this._disabledInputs,function(a){return a==b?null:a});this._disabledInputs[this._disabledInputs.length]=b}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(b){try{return a.data(b,
|
|
"datepicker")}catch(c){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(c,e,h){var k=this._getInst(c);if(2==arguments.length&&"string"==typeof e)return"defaults"==e?a.extend({},a.datepicker._defaults):k?"all"==e?a.extend({},k.settings):this._get(k,e):null;var l=e||{};"string"==typeof e&&(l={},l[e]=h);if(k){this._curInst==k&&this._hideDatepicker();var m=this._getDateDatepicker(c,!0),n=this._getMinMaxDate(k,"min"),p=this._getMinMaxDate(k,"max");d(k.settings,l);null!==n&&
|
|
l.dateFormat!==b&&l.minDate===b&&(k.settings.minDate=this._formatDate(k,n));null!==p&&l.dateFormat!==b&&l.maxDate===b&&(k.settings.maxDate=this._formatDate(k,p));this._attachments(a(c),k);this._autoSize(k);this._setDateDatepicker(c,m);this._updateDatepicker(k)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){(a=this._getInst(a))&&this._updateDatepicker(a)},_setDateDatepicker:function(a,b){if(a=this._getInst(a))this._setDate(a,b),this._updateDatepicker(a),
|
|
this._updateAlternate(a)},_getDateDatepicker:function(a,b){(a=this._getInst(a))&&!a.inline&&this._setDateFromField(a,b);return a?this._getDate(a):null},_doKeyDown:function(b){var c=a.datepicker._getInst(b.target),d=!0,e=c.dpDiv.is(".ui-datepicker-rtl");c._keyEvent=!0;if(a.datepicker._datepickerShowing)switch(b.keyCode){case 9:a.datepicker._hideDatepicker();d=!1;break;case 13:return d=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",c.dpDiv),d[0]?a.datepicker._selectDay(b.target,
|
|
c.selectedMonth,c.selectedYear,d[0]):a.datepicker._hideDatepicker(),!1;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(c,"stepBigMonths"):-a.datepicker._get(c,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(c,"stepBigMonths"):+a.datepicker._get(c,"stepMonths"),"M");break;case 35:(b.ctrlKey||b.metaKey)&&a.datepicker._clearDate(b.target);d=b.ctrlKey||b.metaKey;break;case 36:(b.ctrlKey||
|
|
b.metaKey)&&a.datepicker._gotoToday(b.target);d=b.ctrlKey||b.metaKey;break;case 37:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,e?1:-1,"D");d=b.ctrlKey||b.metaKey;b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?-a.datepicker._get(c,"stepBigMonths"):-a.datepicker._get(c,"stepMonths"),"M");break;case 38:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,-7,"D");d=b.ctrlKey||b.metaKey;break;case 39:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,e?-1:
|
|
1,"D");d=b.ctrlKey||b.metaKey;b.originalEvent.altKey&&a.datepicker._adjustDate(b.target,b.ctrlKey?+a.datepicker._get(c,"stepBigMonths"):+a.datepicker._get(c,"stepMonths"),"M");break;case 40:(b.ctrlKey||b.metaKey)&&a.datepicker._adjustDate(b.target,7,"D");d=b.ctrlKey||b.metaKey;break;default:d=!1}else 36==b.keyCode&&b.ctrlKey?a.datepicker._showDatepicker(this):d=!1;d&&(b.preventDefault(),b.stopPropagation())},_doKeyPress:function(c){var d=a.datepicker._getInst(c.target);if(a.datepicker._get(d,"constrainInput")){var d=
|
|
a.datepicker._possibleChars(a.datepicker._get(d,"dateFormat")),e=String.fromCharCode(c.charCode==b?c.keyCode:c.charCode);return c.ctrlKey||c.metaKey||" ">e||!d||-1<d.indexOf(e)}},_doKeyUp:function(b){b=a.datepicker._getInst(b.target);if(b.input.val()!=b.lastVal)try{a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,a.datepicker._getFormatConfig(b))&&(a.datepicker._setDateFromField(b),a.datepicker._updateAlternate(b),a.datepicker._updateDatepicker(b))}catch(c){a.datepicker.log(c)}return!0},
|
|
_showDatepicker:function(b){b=b.target||b;"input"!=b.nodeName.toLowerCase()&&(b=a("input",b.parentNode)[0]);if(!a.datepicker._isDisabledDatepicker(b)&&a.datepicker._lastInput!=b){var c=a.datepicker._getInst(b);a.datepicker._curInst&&a.datepicker._curInst!=c&&a.datepicker._curInst.dpDiv.stop(!0,!0);var e=a.datepicker._get(c,"beforeShow");d(c.settings,e?e.apply(b,[b,c]):{});c.lastVal=null;a.datepicker._lastInput=b;a.datepicker._setDateFromField(c);a.datepicker._inDialog&&(b.value="");a.datepicker._pos||
|
|
(a.datepicker._pos=a.datepicker._findPos(b),a.datepicker._pos[1]+=b.offsetHeight);var k=!1;a(b).parents().each(function(){k|="fixed"==a(this).css("position");return!k});k&&a.browser.opera&&(a.datepicker._pos[0]-=document.documentElement.scrollLeft,a.datepicker._pos[1]-=document.documentElement.scrollTop);e={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;c.dpDiv.empty();c.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(c);e=
|
|
a.datepicker._checkOffset(c,e,k);c.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":k?"fixed":"absolute",display:"none",left:e.left+"px",top:e.top+"px"});if(!c.inline){var e=a.datepicker._get(c,"showAnim"),l=a.datepicker._get(c,"duration"),m=function(){a.datepicker._datepickerShowing=!0;var b=c.dpDiv.find("iframe.ui-datepicker-cover");if(b.length){var d=a.datepicker._getBorders(c.dpDiv);b.css({left:-d[0],top:-d[1],width:c.dpDiv.outerWidth(),height:c.dpDiv.outerHeight()})}};c.dpDiv.zIndex(a(b).zIndex()+
|
|
1);a.effects&&a.effects[e]?c.dpDiv.show(e,a.datepicker._get(c,"showOptions"),l,m):c.dpDiv[e||"show"](e?l:null,m);e&&l||m();c.input.is(":visible")&&!c.input.is(":disabled")&&c.input.focus();a.datepicker._curInst=c}}},_updateDatepicker:function(b){var c=this,d=a.datepicker._getBorders(b.dpDiv);b.dpDiv.empty().append(this._generateHTML(b));var e=b.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-d[0],top:-d[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()});b.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",
|
|
function(){a(this).removeClass("ui-state-hover");-1!=this.className.indexOf("ui-datepicker-prev")&&a(this).removeClass("ui-datepicker-prev-hover");-1!=this.className.indexOf("ui-datepicker-next")&&a(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){c._isDisabledDatepicker(b.inline?b.dpDiv.parent()[0]:b.input[0])||(a(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),a(this).addClass("ui-state-hover"),-1!=this.className.indexOf("ui-datepicker-prev")&&
|
|
a(this).addClass("ui-datepicker-prev-hover"),-1!=this.className.indexOf("ui-datepicker-next")&&a(this).addClass("ui-datepicker-next-hover"))}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();d=this._getNumberOfMonths(b);e=d[1];1<e?b.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):b.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");b.dpDiv[(1!=d[0]||1!=d[1]?"add":"remove")+"Class"]("ui-datepicker-multi");b.dpDiv[(this._get(b,
|
|
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");b==a.datepicker._curInst&&a.datepicker._datepickerShowing&&b.input&&b.input.is(":visible")&&!b.input.is(":disabled")&&b.input[0]!=document.activeElement&&b.input.focus();if(b.yearshtml){var l=b.yearshtml;setTimeout(function(){l===b.yearshtml&&b.dpDiv.find("select.ui-datepicker-year:first").replaceWith(b.yearshtml);l=b.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),
|
|
parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(b,c,d){var e=b.dpDiv.outerWidth(),l=b.dpDiv.outerHeight(),m=b.input?b.input.outerWidth():0,n=b.input?b.input.outerHeight():0,p=document.documentElement.clientWidth+a(document).scrollLeft(),r=document.documentElement.clientHeight+a(document).scrollTop();c.left-=this._get(b,"isRTL")?e-m:0;c.left-=d&&c.left==b.input.offset().left?a(document).scrollLeft():0;c.top-=d&&c.top==b.input.offset().top+n?a(document).scrollTop():0;c.left-=Math.min(c.left,
|
|
c.left+e>p&&p>e?Math.abs(c.left+e-p):0);c.top-=Math.min(c.top,c.top+l>r&&r>l?Math.abs(l+n):0);return c},_findPos:function(b){for(var c=this._get(this._getInst(b),"isRTL");b&&("hidden"==b.type||1!=b.nodeType||a.expr.filters.hidden(b));)b=b[c?"previousSibling":"nextSibling"];b=a(b).offset();return[b.left,b.top]},_hideDatepicker:function(b){var c=this._curInst;if(c&&(!b||c==a.data(b,"datepicker"))&&this._datepickerShowing){b=this._get(c,"showAnim");var d=this._get(c,"duration"),e=function(){a.datepicker._tidyDialog(c);
|
|
this._curInst=null};a.effects&&a.effects[b]?c.dpDiv.hide(b,a.datepicker._get(c,"showOptions"),d,e):c.dpDiv["slideDown"==b?"slideUp":"fadeIn"==b?"fadeOut":"hide"](b?d:null,e);b||e();(b=this._get(c,"onClose"))&&b.apply(c.input?c.input[0]:null,[c.input?c.input.val():"",c]);this._datepickerShowing=!1;this._lastInput=null;this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),a.blockUI&&(a.unblockUI(),a("body").append(this.dpDiv)));this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},
|
|
_checkExternalClick:function(b){a.datepicker._curInst&&(b=a(b.target),b[0].id==a.datepicker._mainDivId||0!=b.parents("#"+a.datepicker._mainDivId).length||b.hasClass(a.datepicker.markerClassName)||b.hasClass(a.datepicker._triggerClass)||!a.datepicker._datepickerShowing||a.datepicker._inDialog&&a.blockUI||a.datepicker._hideDatepicker())},_adjustDate:function(b,c,d){b=a(b);var e=this._getInst(b[0]);this._isDisabledDatepicker(b[0])||(this._adjustInstDate(e,c+("M"==d?this._get(e,"showCurrentAtPos"):0),
|
|
d),this._updateDatepicker(e))},_gotoToday:function(b){b=a(b);var c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate();c.drawMonth=c.selectedMonth=d.getMonth();c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c);this._adjustDate(b)},_selectMonthYear:function(b,c,d){b=a(b);var e=this._getInst(b[0]);e._selectingMonthYear=
|
|
!1;e["selected"+("M"==d?"Month":"Year")]=e["draw"+("M"==d?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(b)},_clickMonthYear:function(b){var c=this._getInst(a(b)[0]);c.input&&c._selectingMonthYear&&setTimeout(function(){c.input.focus()},0);c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(b,c,d,e){var l=a(b);a(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(l[0])||(l=this._getInst(l[0]),l.selectedDay=l.currentDay=
|
|
a("a",e).html(),l.selectedMonth=l.currentMonth=c,l.selectedYear=l.currentYear=d,this._selectDate(b,this._formatDate(l,l.currentDay,l.currentMonth,l.currentYear)))},_clearDate:function(b){b=a(b);this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(b,c){b=this._getInst(a(b)[0]);c=null!=c?c:this._formatDate(b);b.input&&b.input.val(c);this._updateAlternate(b);var d=this._get(b,"onSelect");d?d.apply(b.input?b.input[0]:null,[c,b]):b.input&&b.input.trigger("change");b.inline?this._updateDatepicker(b):
|
|
(this._hideDatepicker(),this._lastInput=b.input[0],"object"!=typeof b.input[0]&&b.input.focus(),this._lastInput=null)},_updateAlternate:function(b){var c=this._get(b,"altField");if(c){var d=this._get(b,"altFormat")||this._get(b,"dateFormat"),e=this._getDate(b),l=this.formatDate(d,e,this._getFormatConfig(b));a(c).each(function(){a(this).val(l)})}},noWeekends:function(a){a=a.getDay();return[0<a&&6>a,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=
|
|
a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(null==a||null==b)throw"Invalid arguments";b="object"==typeof b?b.toString():b+"";if(""==b)return null;for(var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,d="string"!=typeof d?d:(new Date).getFullYear()%100+parseInt(d,10),e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,m=(c?c.dayNames:null)||this._defaults.dayNames,n=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
|
|
p=(c?c.monthNames:null)||this._defaults.monthNames,r=c=-1,t=-1,v=-1,w=!1,u=function(b){(b=D+1<a.length&&a.charAt(D+1)==b)&&D++;return b},x=function(a){var c=u(a);a=new RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}");a=b.substring(y).match(a);if(!a)throw"Missing number at position "+y;y+=a[0].length;return parseInt(a[0],10)},C=function(a,c,d){a=u(a)?d:c;for(c=0;c<a.length;c++)if(b.substr(y,a[c].length).toLowerCase()==a[c].toLowerCase())return y+=a[c].length,c+1;throw"Unknown name at position "+
|
|
y;},A=function(){if(b.charAt(y)!=a.charAt(D))throw"Unexpected literal at position "+y;y++},y=0,D=0;D<a.length;D++)if(w)"'"!=a.charAt(D)||u("'")?A():w=!1;else switch(a.charAt(D)){case "d":t=x("d");break;case "D":C("D",e,m);break;case "o":v=x("o");break;case "m":r=x("m");break;case "M":r=C("M",n,p);break;case "y":c=x("y");break;case "@":var E=new Date(x("@"));c=E.getFullYear();r=E.getMonth()+1;t=E.getDate();break;case "!":E=new Date((x("!")-this._ticksTo1970)/1E4);c=E.getFullYear();r=E.getMonth()+1;
|
|
t=E.getDate();break;case "'":u("'")?A():w=!0;break;default:A()}-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=d?0:-100));if(-1<v){r=1;t=v;do{d=this._getDaysInMonth(c,r-1);if(t<=d)break;r++;t-=d}while(1)}E=this._daylightSavingAdjust(new Date(c,r-1,t));if(E.getFullYear()!=c||E.getMonth()+1!=r||E.getDate()!=t)throw"Invalid date";return E},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",
|
|
RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864E9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,m=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var n=function(b){(b=w+1<a.length&&a.charAt(w+1)==b)&&w++;return b},
|
|
p=function(a,b,c){b=""+b;if(n(a))for(;b.length<c;)b="0"+b;return b},r=function(a,b,c,d){return n(a)?d[b]:c[b]},t="",v=!1;if(b)for(var w=0;w<a.length;w++)if(v)"'"!=a.charAt(w)||n("'")?t+=a.charAt(w):v=!1;else switch(a.charAt(w)){case "d":t+=p("d",b.getDate(),2);break;case "D":t+=r("D",b.getDay(),d,e);break;case "o":t+=p("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":t+=p("m",b.getMonth()+1,2);break;case "M":t+=r("M",b.getMonth(),m,c);break;case "y":t+=n("y")?b.getFullYear():
|
|
(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":t+=b.getTime();break;case "!":t+=1E4*b.getTime()+this._ticksTo1970;break;case "'":n("'")?t+="'":v=!0;break;default:t+=a.charAt(w)}return t},_possibleChars:function(a){for(var b="",c=!1,d=function(b){(b=e+1<a.length&&a.charAt(e+1)==b)&&e++;return b},e=0;e<a.length;e++)if(c)"'"!=a.charAt(e)||d("'")?b+=a.charAt(e):c=!1;else switch(a.charAt(e)){case "d":case "m":case "y":case "@":b+="0123456789";break;case "D":case "M":return null;case "'":d("'")?
|
|
b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,c){return a.settings[c]!==b?a.settings[c]:this._defaults[c]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,m;e=m=this._getDefaultDate(a);var n=this._getFormatConfig(a);try{e=this.parseDate(c,d,n)||m}catch(p){this.log(p),d=b?"":d}a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();a.currentDay=
|
|
d?e.getDate():0;a.currentMonth=d?e.getMonth():0;a.currentYear=d?e.getFullYear():0;this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(b,c,d){var e=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},l=function(c){try{return a.datepicker.parseDate(a.datepicker._get(b,"dateFormat"),c,a.datepicker._getFormatConfig(b))}catch(d){}for(var e=(c.toLowerCase().match(/^c/)?a.datepicker._getDate(b):
|
|
null)||new Date,g=e.getFullYear(),h=e.getMonth(),e=e.getDate(),k=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=k.exec(c);l;){switch(l[2]||"d"){case "d":case "D":e+=parseInt(l[1],10);break;case "w":case "W":e+=7*parseInt(l[1],10);break;case "m":case "M":h+=parseInt(l[1],10);e=Math.min(e,a.datepicker._getDaysInMonth(g,h));break;case "y":case "Y":g+=parseInt(l[1],10),e=Math.min(e,a.datepicker._getDaysInMonth(g,h))}l=k.exec(c)}return new Date(g,h,e)};if(c=(c=null==c||""===c?d:"string"==typeof c?l(c):"number"==
|
|
typeof c?isNaN(c)?d:e(c):new Date(c.getTime()))&&"Invalid Date"==c.toString()?d:c)c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0);return this._daylightSavingAdjust(c)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(12<a.getHours()?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,m=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=
|
|
b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();e==a.selectedMonth&&m==a.selectedYear||c||this._notifyChange(a);this._adjustInstDate(a);a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&""==a.input.val()?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(b){var c=new Date,c=this._daylightSavingAdjust(new Date(c.getFullYear(),c.getMonth(),c.getDate())),d=this._get(b,"isRTL"),
|
|
k=this._get(b,"showButtonPanel"),l=this._get(b,"hideIfNoPrevNext"),m=this._get(b,"navigationAsDateFormat"),n=this._getNumberOfMonths(b),p=this._get(b,"showCurrentAtPos"),r=this._get(b,"stepMonths"),t=1!=n[0]||1!=n[1],v=this._daylightSavingAdjust(b.currentDay?new Date(b.currentYear,b.currentMonth,b.currentDay):new Date(9999,9,9)),w=this._getMinMaxDate(b,"min"),u=this._getMinMaxDate(b,"max"),p=b.drawMonth-p,x=b.drawYear;0>p&&(p+=12,x--);if(u)for(var C=this._daylightSavingAdjust(new Date(u.getFullYear(),
|
|
u.getMonth()-n[0]*n[1]+1,u.getDate())),C=w&&C<w?w:C;this._daylightSavingAdjust(new Date(x,p,1))>C;)p--,0>p&&(p=11,x--);b.drawMonth=p;b.drawYear=x;var C=this._get(b,"prevText"),C=m?this.formatDate(C,this._daylightSavingAdjust(new Date(x,p-r,1)),this._getFormatConfig(b)):C,C=this._canAdjustMonth(b,-1,x,p)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', -"+r+", 'M');\" title=\""+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+
|
|
'">'+C+"</span></a>":l?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+C+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+'">'+C+"</span></a>",A=this._get(b,"nextText"),A=m?this.formatDate(A,this._daylightSavingAdjust(new Date(x,p+r,1)),this._getFormatConfig(b)):A,l=this._canAdjustMonth(b,1,x,p)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', +"+r+", 'M');\" title=\""+A+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
|
(d?"w":"e")+'">'+A+"</span></a>":l?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+A+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"w":"e")+'">'+A+"</span></a>",r=this._get(b,"currentText"),A=this._get(b,"gotoCurrent")&&b.currentDay?v:c,r=m?this.formatDate(r,A,this._getFormatConfig(b)):r,m=b.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+e+'.datepicker._hideDatepicker();">'+this._get(b,
|
|
"closeText")+"</button>",k=k?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(d?m:"")+(this._isInRange(b,A)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._gotoToday('#"+b.id+"');\">"+r+"</button>":"")+(d?"":m)+"</div>":"",m=parseInt(this._get(b,"firstDay"),10),m=isNaN(m)?0:m,r=this._get(b,"showWeek"),A=this._get(b,"dayNames");this._get(b,"dayNamesShort");var y=this._get(b,"dayNamesMin"),D=this._get(b,
|
|
"monthNames"),E=this._get(b,"monthNamesShort"),z=this._get(b,"beforeShowDay"),F=this._get(b,"showOtherMonths"),K=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var Q=this._getDefaultDate(b),B="",J=0;J<n[0];J++){for(var O="",q=0;q<n[1];q++){var T=this._daylightSavingAdjust(new Date(x,p,b.selectedDay)),I=" ui-corner-all",M="";if(t){M+='<div class="ui-datepicker-group';if(1<n[1])switch(q){case 0:M+=" ui-datepicker-group-first";I=" ui-corner-"+(d?"right":"left");break;case n[1]-1:M+=
|
|
" ui-datepicker-group-last";I=" ui-corner-"+(d?"left":"right");break;default:M+=" ui-datepicker-group-middle",I=""}M+='">'}for(var M=M+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+I+'">'+(/all|left/.test(I)&&0==J?d?l:C:"")+(/all|right/.test(I)&&0==J?d?C:l:"")+this._generateMonthYearHeader(b,p,x,w,u,0<J||0<q,D,E)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),S=r?'<th class="ui-datepicker-week-col">'+this._get(b,"weekHeader")+"</th>":"",I=0;7>I;I++)var N=(I+m)%
|
|
7,S=S+("<th"+(5<=(I+m+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+A[N]+'">'+y[N]+"</span></th>");M+=S+"</tr></thead><tbody>";S=this._getDaysInMonth(x,p);x==b.selectedYear&&p==b.selectedMonth&&(b.selectedDay=Math.min(b.selectedDay,S));for(var I=(this._getFirstDayOfMonth(x,p)-m+7)%7,S=t?6:Math.ceil((I+S)/7),N=this._daylightSavingAdjust(new Date(x,p,1-I)),W=0;W<S;W++){for(var M=M+"<tr>",V=r?'<td class="ui-datepicker-week-col">'+this._get(b,"calculateWeek")(N)+"</td>":"",I=0;7>I;I++){var R=
|
|
z?z.apply(b.input?b.input[0]:null,[N]):[!0,""],aa=N.getMonth()!=p,U=aa&&!K||!R[0]||w&&N<w||u&&N>u,V=V+('<td class="'+(5<=(I+m+6)%7?" ui-datepicker-week-end":"")+(aa?" ui-datepicker-other-month":"")+(N.getTime()==T.getTime()&&p==b.selectedMonth&&b._keyEvent||Q.getTime()==N.getTime()&&Q.getTime()==T.getTime()?" "+this._dayOverClass:"")+(U?" "+this._unselectableClass+" ui-state-disabled":"")+(aa&&!F?"":" "+R[1]+(N.getTime()==v.getTime()?" "+this._currentClass:"")+(N.getTime()==c.getTime()?" ui-datepicker-today":
|
|
""))+'"'+(aa&&!F||!R[2]?"":' title="'+R[2]+'"')+(U?"":' onclick="DP_jQuery_'+e+".datepicker._selectDay('#"+b.id+"',"+N.getMonth()+","+N.getFullYear()+', this);return false;"')+">"+(aa&&!F?" ":U?'<span class="ui-state-default">'+N.getDate()+"</span>":'<a class="ui-state-default'+(N.getTime()==c.getTime()?" ui-state-highlight":"")+(N.getTime()==v.getTime()?" ui-state-active":"")+(aa?" ui-priority-secondary":"")+'" href="#">'+N.getDate()+"</a>")+"</td>");N.setDate(N.getDate()+1);N=this._daylightSavingAdjust(N)}M+=
|
|
V+"</tr>"}p++;11<p&&(p=0,x++);M+="</tbody></table>"+(t?"</div>"+(0<n[0]&&q==n[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");O+=M}B+=O}B+=k+(a.browser.msie&&7>parseInt(a.browser.version,10)&&!b.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");b._keyEvent=!1;return B},_generateMonthYearHeader:function(b,c,d,k,l,m,n,p){var r=this._get(b,"changeMonth"),t=this._get(b,"changeYear"),v=this._get(b,"showMonthAfterYear"),w='<div class="ui-datepicker-title">',
|
|
u="";if(m||!r)u+='<span class="ui-datepicker-month">'+n[c]+"</span>";else{n=k&&k.getFullYear()==d;for(var x=l&&l.getFullYear()==d,u=u+('<select class="ui-datepicker-month" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+b.id+"', this, 'M');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+b.id+"');\">"),C=0;12>C;C++)(!n||C>=k.getMonth())&&(!x||C<=l.getMonth())&&(u+='<option value="'+C+'"'+(C==c?' selected="selected"':"")+">"+p[C]+"</option>");u+="</select>"}v||(w+=u+(!m&&r&&t?
|
|
"":" "));b.yearshtml="";if(m||!t)w+='<span class="ui-datepicker-year">'+d+"</span>";else{p=this._get(b,"yearRange").split(":");var A=(new Date).getFullYear();n=function(a){a=a.match(/c[+-].*/)?d+parseInt(a.substring(1),10):a.match(/[+-].*/)?A+parseInt(a,10):parseInt(a,10);return isNaN(a)?A:a};c=n(p[0]);p=Math.max(c,n(p[1]||""));c=k?Math.max(c,k.getFullYear()):c;p=l?Math.min(p,l.getFullYear()):p;for(b.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+
|
|
b.id+"', this, 'Y');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+b.id+"');\">";c<=p;c++)b.yearshtml+='<option value="'+c+'"'+(c==d?' selected="selected"':"")+">"+c+"</option>";b.yearshtml+="</select>";a.browser.mozilla?w+='<select class="ui-datepicker-year"><option value="'+d+'" selected="selected">'+d+"</option></select>":(w+=b.yearshtml,b.yearshtml=null)}w+=this._get(b,"yearSuffix");v&&(w+=(!m&&r&&t?"":" ")+u);return w+"</div>"},_adjustInstDate:function(a,b,c){var d=a.drawYear+
|
|
("Y"==c?b:0),e=a.drawMonth+("M"==c?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+("D"==c?b:0);d=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,b)));a.selectedDay=d.getDate();a.drawMonth=a.selectedMonth=d.getMonth();a.drawYear=a.selectedYear=d.getFullYear();"M"!=c&&"Y"!=c||this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&b<c?c:b;return a&&b>a?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");
|
|
b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return null==a?[1,1]:"number"==typeof a?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a);
|
|
c=this._daylightSavingAdjust(new Date(c,d+(0>b?b:e[0]*e[1]),1));0>b&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff"),b="string"!=typeof b?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,
|
|
"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);b=b?"object"==typeof b?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});a.fn.datepicker=
|
|
function(b){if(!this.length)return this;a.datepicker.initialized||(a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv),a.datepicker.initialized=!0);var c=Array.prototype.slice.call(arguments,1);return"string"==typeof b&&("isDisabled"==b||"getDate"==b||"widget"==b)||"option"==b&&2==arguments.length&&"string"==typeof arguments[1]?a.datepicker["_"+b+"Datepicker"].apply(a.datepicker,[this[0]].concat(c)):this.each(function(){"string"==typeof b?a.datepicker["_"+
|
|
b+"Datepicker"].apply(a.datepicker,[this].concat(c)):a.datepicker._attachDatepicker(this,b)})};a.datepicker=new c;a.datepicker.initialized=!1;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.11";window["DP_jQuery_"+e]=a})(jQuery);
|
|
jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&3==b.length?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[2.55*parseFloat(c[1]),2.55*parseFloat(c[2]),2.55*parseFloat(c[3])]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],
|
|
16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:/rgba\(0, 0, 0, 0\)/.exec(b)?k.transparent:k[a.trim(b).toLowerCase()]}function d(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]])for(var e=a.length;e--;)c=a[e],"string"==typeof a[c]&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c]);else for(c in a)"string"===
|
|
typeof a[c]&&(b[c]=a[c]);return b}function e(b){var c,d;for(c in b)d=b[c],(null==d||a.isFunction(d)||c in m||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function f(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function g(b,c,d,e){"object"==typeof b&&(e=c,d=null,c=b,b=c.effect);a.isFunction(c)&&(e=c,d=null,c={});if("number"==typeof c||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null);c=c||{};d=d||c.duration;d=a.fx.off?0:"number"==typeof d?
|
|
d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default;e=e||c.complete;return[b,c,d,e]}function h(b){return!b||"number"===typeof b||a.fx.speeds[b]||"string"===typeof b&&!a.effects[b]?!0:!1}a.effects={};a.each("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor borderColor color outlineColor".split(" "),function(b,d){a.fx.step[d]=function(b){if(!b.colorInit){var e;e=b.elem;var f=d,g;do{g=a.curCSS(e,f);if(""!=g&&"transparent"!=g||a.nodeName(e,"body"))break;f="backgroundColor"}while(e=
|
|
e.parentNode);e=c(g);b.start=e;b.end=c(b.end);b.colorInit=!0}b.elem.style[d]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var k={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],
|
|
darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],
|
|
maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},l=["add","remove","toggle"],m={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,g,h){a.isFunction(g)&&(h=g,g=null);return this.queue("fx",function(){var k=a(this),m=k.attr("style")||
|
|
" ",u=e(d.call(this)),x,C=k.attr("className");a.each(l,function(a,c){b[c]&&k[c+"Class"](b[c])});x=e(d.call(this));k.attr("className",C);k.animate(f(u,x),c,g,function(){a.each(l,function(a,c){b[c]&&k[c+"Class"](b[c])});"object"==typeof k.attr("style")?(k.attr("style").cssText="",k.attr("style").cssText=m):k.attr("style",m);h&&h.apply(this,arguments)});u=a.queue(this);x=u.splice(u.length-1,1)[0];u.splice(1,0,x);a.dequeue(this)})};a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?
|
|
a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return"boolean"==typeof d||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,
|
|
[{add:c,remove:b},d,e,f])}});a.extend(a.effects,{version:"1.8.11",save:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){"toggle"==b&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c;switch(a[0]){case "top":c=0;break;case "middle":c=.5;break;case "bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case "left":a=
|
|
0;break;case "center":a=.5;break;case "right":a=1;break;default:a=a[1]/b.width}return{x:a,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});b.wrap(d);d=b.parent();"static"==b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):
|
|
(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d);isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(a){return a.parent().is(".ui-effects-wrapper")?a.parent().replaceWith(a):a},setTransition:function(b,c,d,e){e=e||{};a.each(c,function(a,c){unit=b.cssUnit(c);0<unit[0]&&(e[c]=unit[0]*d+unit[1])});return e}});a.fn.extend({effect:function(b){var c=
|
|
g.apply(this,arguments),d={options:c[1],duration:c[2],callback:c[3]},c=d.options.mode,e=a.effects[b];return a.fx.off||!e?c?this[c](d.duration,d.callback):this.each(function(){d.callback&&d.callback.call(this)}):e.call(this,d)},_show:a.fn.show,show:function(a){if(h(a))return this._show.apply(this,arguments);var b=g.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(h(a))return this._hide.apply(this,arguments);var b=g.apply(this,arguments);b[1].mode=
|
|
"hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(h(b)||"boolean"===typeof b||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=g.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){0<c.indexOf(b)&&(d=[parseFloat(c),b])});return d}});a.easing.jswing=a.easing.swing;a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,
|
|
c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*
|
|
((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,
|
|
b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:1>(b/=e/2)?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return 1>
|
|
(b/=e/2)?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=0,g=d;if(0==b)return c;if(1==(b/=e))return c+d;f||(f=.3*e);g<Math.abs(d)?(g=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/g);return-(g*Math.pow(2,10*--b)*Math.sin(2*(b*e-a)*Math.PI/f))+c},easeOutElastic:function(a,b,c,d,e){var f=0,g=d;if(0==b)return c;if(1==(b/=e))return c+d;f||(f=.3*e);g<Math.abs(d)?(g=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/g);return g*Math.pow(2,-10*b)*Math.sin(2*(b*e-a)*Math.PI/f)+
|
|
d+c},easeInOutElastic:function(a,b,c,d,e){var f=0,g=d;if(0==b)return c;if(2==(b/=e/2))return c+d;f||(f=.3*e*1.5);g<Math.abs(d)?(g=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/g);return 1>b?-.5*g*Math.pow(2,10*--b)*Math.sin(2*(b*e-a)*Math.PI/f)+c:g*Math.pow(2,-10*--b)*Math.sin(2*(b*e-a)*Math.PI/f)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,
|
|
d,e,f,g){g==b&&(g=1.70158);return 1>(c/=f/2)?e/2*c*c*(((g*=1.525)+1)*c-g)+d:e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){return c<f/2?.5*a.easing.easeInBounce(b,2*c,0,e,f)+d:.5*a.easing.easeOutBounce(b,
|
|
2*c-f,0,e,f)+.5*e+d}})}(jQuery);(function(a){a.fn.contextMenu=function(b){a(this).bind("contextmenu",function(a){b(a);return!1})}})(jQuery);(function(a){function b(b){if("string"===typeof b.data){var d=b.handler,e=b.data.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&"text"!==b.target.type){var c="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],h=String.fromCharCode(b.which).toLowerCase(),k="",l={};b.ctrlKey&&"ctrl"!==c&&(k+="ctrl+");b.altKey&&"alt"!==c&&(k+="alt+");b.metaKey&&!b.ctrlKey&&"meta"!==c&&(k+="meta+");b.shiftKey&&"shift"!==c&&(k+="shift+");c?l[k+c]=!0:(l[k+
|
|
h]=!0,l[k+a.hotkeys.shiftNums[h]]=!0,"shift+"===k&&(l[a.hotkeys.shiftNums[h]]=!0));c=0;for(h=e.length;c<h;c++)if(l[e[c]])return d.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:/mac/i.test(navigator.platform)?"del":"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",
|
|
104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery);(function(a){a.fn.selectable=function(b){return this.each(function(){var c=a(this);c.css("user-select",b?"text":"none");c.css("-moz-user-select",b?"text":"-moz-none");c.css("-webkit-user-select",b?"auto":"none");(a.browser.msie||a.browser.opera)&&c.attr("unselectable",b?"off":"on")})}})(jQuery);this.JSON||(this.JSON={});
|
|
(function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,r,t,v=f,w,u=d[a];u&&"object"===typeof u&&"function"===typeof u.toJSON&&(u=u.toJSON(a));"function"===typeof k&&(u=k.call(d,a,u));switch(typeof u){case "string":return b(u);case "number":return isFinite(u)?String(u):"null";case "boolean":case "null":return String(u);case "object":if(!u)return"null";
|
|
f+=g;w=[];if("[object Array]"===Object.prototype.toString.apply(u)){t=u.length;for(e=0;e<t;e+=1)w[e]=c(e,u)||"null";r=0===w.length?"[]":f?"[\n"+f+w.join(",\n"+f)+"\n"+v+"]":"["+w.join(",")+"]";f=v;return r}if(k&&"object"===typeof k)for(t=k.length,e=0;e<t;e+=1)h=k[e],"string"===typeof h&&(r=c(h,u))&&w.push(b(h)+(f?": ":":")+r);else for(h in u)Object.hasOwnProperty.call(u,h)&&(r=c(h,u))&&w.push(b(h)+(f?": ":":")+r);r=0===w.length?"{}":f?"{\n"+f+w.join(",\n"+f)+"\n"+v+"}":"{"+w.join(",")+"}";f=v;return r}}
|
|
"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(b){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=
|
|
/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
|
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=String(a);d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
|
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();(function(a,b,c){function d(d,f){function g(b){a(h).each(function(){var c=a(this);this===b.target||c.has(b.target).length||c.triggerHandler(f,[b.target])})}f=f||d+c;var h=a(),k=d+"."+f+"-special-event";a.event.special[f]={setup:function(){h=h.add(this);delete h.prevObject;1===h.length&&a(b).bind(k,g)},teardown:function(){h=h.not(this);delete h.prevObject;0===h.length&&a(b).unbind(k)},add:function(a){var b=a.handler;a.handler=function(a,c){a.target=c;b.apply(this,arguments)}}}}"$:nomunge";a.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),
|
|
function(a){d(a)});d("focusin","focus"+c);d("focusout","blur"+c);Modernizr.touch&&(d("touchstart","mousedown"+c),d("touchmove","mousemove"+c),d("touchend","mouseup"+c));a.addOutsideEvent=d})(jQuery,document,"outside");(function(a){a.fn.mousecapture=function(b){var c=a(document);this.each(function(){var d=a(this),e={};d.mousedown(function(a){var g;b.move&&(g=function(a){b.move.call(d,a,e)},c.mousemove(g));var h,k=function(){b.move&&c.unbind("mousemove",g);c.unbind("mouseup",h)};h=b.up?function(a){k();return b.up.call(d,a,e)}:k;c.mouseup(h);return b.down.call(d,a,e)})});return this}})(jQuery);(function(a){function b(a,b){if(!(1<a.originalEvent.touches.length)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null);a.target.dispatchEvent(d)}}a.support.touch="ontouchend"in document;if(a.support.touch){var c=a.ui.mouse.prototype,d=c._mouseInit,e=c._mouseDestroy,f;c._touchStart=function(a){!f&&this._mouseCapture(a.originalEvent.changedTouches[0])&&(f=!0,this._touchMoved=
|
|
!1,b(a,"mouseover"),b(a,"mousemove"),b(a,"mousedown"))};c._touchMove=function(a){f&&(this._touchMoved=!0,b(a,"mousemove"))};c._touchEnd=function(a){f&&(b(a,"mouseup"),b(a,"mouseout"),this._touchMoved||b(a,"click"),f=!1)};c._mouseInit=function(){this.element.bind({touchstart:a.proxy(this,"_touchStart"),touchmove:a.proxy(this,"_touchMove"),touchend:a.proxy(this,"_touchEnd")});d.call(this)};c._mouseDestroy=function(){this.element.unbind({touchstart:a.proxy(this,"_touchStart"),touchmove:a.proxy(this,
|
|
"_touchMove"),touchend:a.proxy(this,"_touchEnd")});e.call(this)}}})(jQuery);var EventEmitter=function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b=this._getEvents(),c,d;if(a instanceof RegExp)for(d in c={},b)b.hasOwnProperty(d)&&a.test(d)&&(c[d]=b[d]);else c=b[a]||(b[a]=[]);return c};d.flattenListeners=function(a){var b=[],c;for(c=0;c<a.length;c+=1)b.push(a[c].listener);return b};
|
|
d.getListenersAsObject=function(a){var b=this.getListeners(a),c;b instanceof Array&&(c={},c[a]=b);return c||b};d.addListener=function(a,c){var d=this.getListenersAsObject(a),e="object"===typeof c,f;for(f in d)d.hasOwnProperty(f)&&-1===b(d[f],c)&&d[f].push(e?c:{listener:c,once:!1});return this};d.on=c("addListener");d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})};d.once=c("addOnceListener");d.defineEvent=function(a){this.getListeners(a);return this};d.defineEvents=
|
|
function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this};d.removeListener=function(a,c){var d=this.getListenersAsObject(a),e,f;for(f in d)d.hasOwnProperty(f)&&(e=b(d[f],c),-1!==e&&d[f].splice(e,1));return this};d.off=c("removeListener");d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)};d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)};d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener;a=a?this.removeListeners:
|
|
this.addListeners;if("object"!==typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"===typeof e?f.call(this,d,e):a.call(this,d,e));return this};d.removeEvent=function(a){var b=typeof a,c=this._getEvents(),d;if("string"===b)delete c[a];else if(a instanceof RegExp)for(d in c)c.hasOwnProperty(d)&&a.test(d)&&delete c[d];else delete this._events;return this};d.removeAllListeners=c("removeEvent");d.emitEvent=function(a,b){var c=
|
|
this.getListenersAsObject(a),d,e,f,p;for(f in c)if(c.hasOwnProperty(f))for(e=c[f].length;e--;)d=c[f][e],!0===d.once&&this.removeListener(a,d.listener),p=d.listener.apply(this,b||[]),p===this._getOnceReturnValue()&&this.removeListener(a,d.listener);return this};d.trigger=c("emitEvent");d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)};d.setOnceReturnValue=function(a){this._onceReturnValue=a;return this};d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?
|
|
this._onceReturnValue:!0};d._getEvents=function(){return this._events||(this._events={})};a.noConflict=function(){e.EventEmitter=f;return a};"function"===typeof define&&define.amd?define(function(){return a}):"object"===typeof module&&module.exports?module.exports=a:this.EventEmitter=a;return a}.call(this);var R77=function(){var a={};if("undefined"!=typeof R77)return R77;var b={custom_items_in_context_menu:{},websocket_connection:{},countdown:{},extended_hours:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},
|
|
header_fullscreen_button:{},header_symbol_search:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},header_saveload_to_the_right:{},header_widget:{subsets:"header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_settings header_indicators header_compare header_undo_redo header_fullscreen_button".split(" ")},chart_property_page:{subsets:"chart_property_page_style chart_property_page_scales chart_property_page_background chart_property_page_timezone_sessions chart_property_page_evetns_alerts chart_property_page_trading chart_property_page_template_button".split(" ")},
|
|
disable_userlink_popup:{},left_toolbar:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},disable_resolution_rebuild:{},border_around_the_chart:{},
|
|
narrow_chart_enabled:{},charting_library_debug_mode:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},link_to_tradingview:{},right_bar_stays_on_scroll:{},short_name_may_differ_from_fullname:{},
|
|
chart_content_overrides_by_deafults:{},14851:{},show_dialog_on_snapshot_ready:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},datasource_copypaste:{},symbol_info:{},tv_production:{subsets:"show_pro_features countdown extended_hours symbol_search_parser_mixin symbollist_context_menu websocket_connection header_fullscreen_button header_widget left_toolbar control_bar timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings saveload_requires_authentication volume_force_overlay new_chart_creation_available saved_charts_count_restriction create_volume_indicator_by_default charts_auto_save right_bar_stays_on_scroll save_old_chart_before_save_as chart_property_page_trading chart_content_overrides_by_deafults alerts show_dialog_on_snapshot_ready show_extension_popup header_saveload header_layouttoggle datasource_copypaste alerts show_saved_watchlists watchlists_from_to_file chart_property_page support_multicharts display_market_status support_manage_drawings symbol_info".split(" ")},
|
|
browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status"]},widget:{subsets:"show_pro_features countdown extended_hours symbol_search_parser_mixin symbollist_context_menu websocket_connection left_toolbar control_bar timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings saveload_requires_authentication volume_force_overlay create_volume_indicator_by_default right_bar_stays_on_scroll show_dialog_on_snapshot_ready header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_compare header_indicators header_resolutions header_symbol_search header_widget_dom_node left_toolbar saveload_requires_authentication show_dialog_on_snapshot_ready star_some_intervals_by_default symbol_search_parser_mixin symbollist_context_menu timeframes_toolbar use_localstorage_for_settings volume_force_overlay websocket_connection display_market_status symbol_info".split(" ")},
|
|
bovespa_widget:{subsets:["widget","header_settings","extended_hours","chart_property_page_timezone_sessions"]},charting_library_base:{subsets:"14851 adapt_onchart_logo_background allow_supported_resolutions_set_only border_around_the_chart collapsible_header constraint_dialogs_movement context_menus control_bar create_volume_indicator_by_default custom_items_in_context_menu datasource_copypaste daily_timeframe_suffix display_market_status edit_buttons_in_legend graying_disabled_tools_enabled header_widget lean_chart_load left_toolbar link_to_tradingview pay_attention_to_ticker_not_symbol plain_studymarket predefined_items_only_may_be_starred refresh_saved_charts_list_on_dialog_show right_bar_stays_on_scroll saveload_storage_customization short_name_may_differ_from_fullname show_dialog_on_snapshot_ready stop_study_on_restart study_market_minimized timeframes_toolbar update_study_formatter_on_symbol_resolve update_timeframes_set_on_symbol_resolve use_localstorage_for_settings volume_force_overlay widget_logo chart_property_page_style chart_property_page_scales chart_property_page_background chart_property_page_timezone_sessions chart_property_page_evetns_alerts".split(" ")},
|
|
charting_library:{subsets:["charting_library_base","header_screenshot","header_saveload"]},static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{subsets:["charting_library_base","header_screenshot","trading_options","header_saveload_to_the_right","header_saveload"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading"]}},c={},d;for(d in b){for(var e=b[d].subsets||[],f=0;f<e.length;++f)c[e[f]]=
|
|
1;c[d]=1}var g={};for(d in c)for(var h in c)e=b[h],"undefined"!=typeof e&&e.subsets&&0<=e.subsets.indexOf(d)&&(g.hasOwnProperty(d)||(g[d]=[]),g[d].push(h));var k={};a.enabled=function(a){var b=g.hasOwnProperty(a)?g[a]:[];if(0==k[a])return!1;a=k[a];for(var c=0;c<b.length;++c)a|=R77.enabled(b[c]);return a};a._uniqueSets=function(){return Object.keys(c)};a.enable=function(a){k[a]=!0};a.setEnabled=function(a,b){k[a]=b};"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&
|
|
__initialDisabledFeaturesets.map(function(b){a.setEnabled(b,!1)});"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.map(function(b){a.enable(b)});return a}();"undefined"!=typeof module&&(module.exports=R77);var TradingView=TradingView||{},PineAddons={};TradingView.className=function(a){for(var b in this)if(TradingView[b]===a)return b;return null};TradingView.isMobileView=/mobile=1/i.test(window.location.search);TradingView.isOnFeaturePage=/on-features-page=1/i.test(window.location.search);TradingView.wrapUrl=function(a){R77.enabled("charting_library_base")&&(a=a.replace("/static/",""));return a};TradingView.RESOURCES_ROOT=TradingView.wrapUrl("/static/chart-client/css/");
|
|
TradingView.THEME_RESOURCES_ROOT=TradingView.wrapUrl("/static/chart-client/css/images/");TradingView.resourceFullPath=function(a){return TradingView.RESOURCES_ROOT+a};TradingView.themeResourceFullPath=function(a){return TradingView.THEME_RESOURCES_ROOT+a};
|
|
TradingView.isMobile=function(){var a=/Android/i.test(navigator.userAgent),b=/BlackBerry/i.test(navigator.userAgent),c=/iPhone|iPad|iPod/i.test(navigator.userAgent),d=/Opera Mini/i.test(navigator.userAgent),e=TradingView.winMobileMode,f=TradingView.isMobileView||a||b||c||d||e;return{Android:function(){return a},BlackBerry:function(){return b},iOS:function(){return c},Opera:function(){return d},Windows:function(){return e},any:function(){return f}}}();
|
|
TradingView.supportTouch=function(){return Modernizr.touch||TradingView.isMobile.any()};TradingView.onWidget=function(){return/widgetembed|widgetpopup|idea-popup/.test(window.location.pathname)};
|
|
TradingView.availableTimezones=TradingView.availableTimezones||[{id:"Etc/UTC",title:"UTC"},{id:"exchange",title:$.t("Exchange")},{id:"America/Vancouver",title:"(UTC-8) Vancouver"},{id:"America/Los_Angeles",title:"(UTC-8) Los Angeles"},{id:"America/Phoenix",title:"(UTC-7) Phoenix"},{id:"America/Chicago",title:"(UTC-6) Chicago"},{id:"America/El_Salvador",title:"(UTC-6) San Salvador"},{id:"America/Toronto",title:"(UTC-5) Toronto"},{id:"America/New_York",title:"(UTC-5) New York"},{id:"America/Bogota",
|
|
title:"(UTC-5) Bogota"},{id:"America/Argentina/Buenos_Aires",title:"(UTC-3) Buenos Aires"},{id:"Europe/London",title:"(UTC) London"},{id:"Europe/Madrid",title:"(UTC+1) Madrid"},{id:"Europe/Paris",title:"(UTC+1) Paris"},{id:"Europe/Berlin",title:"(UTC+1) Berlin"},{id:"Europe/Warsaw",title:"(UTC+1) Warsaw"},{id:"Europe/Athens",title:"(UTC+2) Athens"},{id:"Europe/Moscow",title:"(UTC+3) Moscow"},{id:"Asia/Tehran",title:"(UTC+3.30) Tehran"},{id:"Asia/Kolkata",title:"(UTC+5.30) Kolkata"},{id:"Asia/Taipei",
|
|
title:"(UTC+8) Taipei"},{id:"Asia/Singapore",title:"(UTC+8) Singapore"},{id:"Asia/Shanghai",title:"(UTC+8) Shanghai"},{id:"Asia/Hong_Kong",title:"(UTC+8) Hong Kong"},{id:"Asia/Seoul",title:"(UTC+9) Seoul"},{id:"Asia/Tokyo",title:"(UTC+9) Tokyo"},{id:"Australia/Sydney",title:"(UTC+10) Sydney"}];TradingView.monthsShort="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");
|
|
TradingView.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}];TradingView.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);e.hasOwnProperty(f)||(e[f]=a.apply(this,arguments));return e[f]};c.cache={};return c};TradingView.cursorCss=function(a,b,c){c||(c="light");a=TradingView.wrapUrl("url("+TradingView.resourceFullPath(c+"/"+a+".cur")+")");return $.browser.msie?a+", default":a+" "+b+", default"};TradingView.guid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;return("x"==a?b:b&3|8).toString(16)})};TradingView.randomHash=function(){return TradingView.randomHashN(12)};TradingView.randomHashN=function(a){for(var b="",c=0;c<a;c++)var d=Math.round(60*Math.random()),b=b+"0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[d];return b};var TradingView=TradingView||{},isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};TradingView.isNaN=function(a){return!(0>=a)&&!(0<a)};TradingView.isInteger=function(a){return"number"===typeof a&&0===a%1};function isNumber(a){return"number"===typeof a&&isFinite(a)}TradingView.parseBool=function(a){return!0===a||"true"===a};TradingView.isBoolean=function(a){return!0===a||!1===a};
|
|
TradingView.isString=function(a){return null===a||void 0===a?!1:a.constructor==String};function isFunction(a){return null===a||void 0===a?!1:a.constructor==Function}function inherit(a,b){a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}});a.prototype.superclass=b}
|
|
TradingView.declareClassAsPureInterface=function(a,b){for(var c in a.prototype)"function"===typeof a.prototype[c]&&a.prototype.hasOwnProperty(c)&&(a.prototype[c]=function(){throw b+"::"+c+" is an interface member declaration and must be overloaded in order to be called";})};
|
|
TradingView.requireFullInterfaceImplementation=function(a,b,c,d){for(var e in c.prototype)if("function"===typeof c.prototype[e]&&!a.prototype[e])throw"Interface implementation assertion failed: "+b+" does not implement "+d+"::"+e+" function";};TradingView.isInherited=function(a,b){return a===b?!0:a&&a.prototype?void 0===a.prototype.superclass||null===a.prototype.superclass?!1:a.prototype.superclass===b?!0:TradingView.isInherited(a.prototype.superclass,b):!1};
|
|
TradingView.TypeValidator=function(a){this.m_type=a};TradingView.TypeValidator.prototype.check=function(a){return a.constructor===this.m_type||TradingView.isInherited(a.constructor,this.m_type)};TradingView.PredicateValidator=function(a){this.m_predicate=a};TradingView.PredicateValidator.prototype.check=function(a){return this.m_predicate(a)};
|
|
TradingView.clone=function(a){if(!a||"object"!==typeof a)return a;var b;b="function"===typeof a.pop?[]:{};var c,d;for(c in a)a.hasOwnProperty(c)&&(d=a[c],b[c]=d&&"object"===typeof d?TradingView.clone(d):d);return b};
|
|
TradingView.deepEquals=function(a,b,c){c||(c="");if(a===b)return[!0,c];isFunction(a)&&(a=void 0);isFunction(b)&&(b=void 0);if(void 0===a&&void 0!==b||void 0===b&&void 0!==a||null===a&&null!==b||null===b&&null!==a)return[!1,c];if(TradingView.isString(a)&&TradingView.isString(b))return[a===b,c];if(Array.isArray(a)&&Array.isArray(b)){var d=a.length;if(d!==b.length)return[!1,c];for(var e=0;e<d;e++){var f=TradingView.deepEquals(a[e],b[e],c+"["+e+"]");if(!f[0])return f}}else{if(isArray(a)||isArray(b))return[!1,
|
|
c];for(d in a)if(f=TradingView.deepEquals(a[d],b[d],c+"["+d+"]"),!f[0])return f}return[!0,c]};TradingView.merge=function(a,b){for(var c in b)"object"===typeof b[c]&&a.hasOwnProperty(c)?TradingView.merge(a[c],b[c]):a[c]=b[c];return a};TradingView.mergeWithRules=function(a,b,c,d){for(var e in b){var f=d?d+"."+e:e;c&&f in c?a[e]=c[f](a[e],b[e]):"object"===typeof b[e]&&a.hasOwnProperty(e)?TradingView.merge(a[e],b[e],c,f):a[e]=b[e]}};
|
|
TradingView.sortMultipleFunction=function(){var a=[].slice.call(arguments),b=a.length;return function(c,d){var e,f,g,h,k;for(k=0;k<b&&(h=0,g=a[k],f="string"===typeof g?g:g.name,e=c[f],f=d[f],"function"===typeof g.fn&&(e=g.fn(e),f=g.fn(f)),g=g.reverse?-1:1,e<f&&(h=-1*g),e>f&&(h=1*g),0===h);k++);return h}};
|
|
"undefined"!=typeof module&&module&&module.exports&&(module.exports={inherit:inherit,merge:TradingView.merge,isNumber:isNumber,isInteger:TradingView.isInteger,isBoolean:TradingView.isBoolean,isString:TradingView.isString,isNaN:TradingView.isNaN});TradingView.OrderedHash=function(a,b){this.array=[];for(var c in a)a[c].key=c,this.array.push(a[c]);this.rearrange(b)};TradingView.OrderedHash.prototype.rearrange=function(a){if("function"!==typeof a)throw Error("sort param is not a function");return this.array.sort(a)};TradingView.OrderedHash.byValue=function(a){return function(a,c){return a-c}};TradingView.OrderedHash.byField=function(a){return function(b,c){if(b[a]>c[a])return 1;if(b[a]<c[a])return-1;if(b[a]==c[a])return 0}};
|
|
TradingView.OrderedHash.byOrder=function(a){return function(b,c){var d=a.indexOf(b.key),e=a.indexOf(c.key);return d-e}};TradingView.HTMLHelper={};
|
|
(function(a){TradingView.HTMLHelper.createLabel=function(b,c,d){return TradingView.HTMLHelper.Element.create("label",a.extend(d,{html:c,"for":b}))};TradingView.HTMLHelper.unbindContextMenu=function(a){a.contextMenu(function(a){return!1})};TradingView.HTMLHelper.offsetX=function(a,c){return a.width()+c.pageX};TradingView.HTMLHelper.offsetY=function(a,c){return a.height()+c.pageY};TradingView.HTMLHelper.checkObjIsOutOfWindowX=function(b,c){var d=a(window).width()-TradingView.HTMLHelper.offsetX(b,c);
|
|
return 0>d?(d=c.pageX+d,0<d?d:0):c.pageX};TradingView.HTMLHelper.checkObjIsOutOfWindowY=function(b,c){var d=a(window).height()-TradingView.HTMLHelper.offsetY(b,c);return 0>d?(d=c.pageY+d,0<d?d:0):c.pageY};TradingView.HTMLHelper.checkObjIsOutOfWindow=function(a,c){return{left:TradingView.HTMLHelper.checkObjIsOutOfWindowX(a,c),top:TradingView.HTMLHelper.checkObjIsOutOfWindowY(a,c)}};TradingView.HTMLHelper.setAttr=function(a,c,d){a.attr?a.attr(c,d):a[c]=d;return a};TradingView.HTMLHelper.removeAttr=
|
|
function(a,c){a.removeAttr?a.removeAttr(c):a.removeAttribute(c);return a};TradingView.HTMLHelper.notNull=function(b){return-1==a.inArray(b,[null,void 0,"false","null","undefined",0])};TradingView.HTMLHelper.hideControl=function(a){return a.css({position:"absolute",top:-1E3,left:-1E3})};TradingView.HTMLHelper.createPopup=function(a,c,d){return(new TradingView.HTMLHelper.Popup(a,c,d)).render()};TradingView.HTMLHelper.Popup=function(b,c,d){this.jqDiv=void 0!==b.selector?b:b.nodeType?a(b):TradingView.HTMLHelper.Element.create("div",
|
|
b);if(d){var e=this;a.each(d,function(a,b){e[a]=b})}TradingView.setMouseEventHandler(this.jqDiv,this);this._callback=c};TradingView.HTMLHelper.Popup.prototype.render=function(){return this.jqDiv};TradingView.HTMLHelper.Popup.prototype.show=function(){this.jqDiv.show()};TradingView.HTMLHelper.Popup.prototype.hide=function(){this.jqDiv.hide()};TradingView.HTMLHelper.Popup.prototype.setVisible=function(a){a?this.show():this.hide()};TradingView.HTMLHelper.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")};
|
|
TradingView.HTMLHelper.Popup.prototype.contextMenuEvent=function(a){return!1};TradingView.HTMLHelper.Popup.prototype.mouseDownOutsideEvent=function(a){!this.isVisible()||this._callback&&!this._callback()||this.hide()}})(jQuery);TradingView.HTMLHelper.Element={};TradingView.HTMLHelper.Element.renderAttributes=function(a){var b="",c;for(c in a)a[c]&&(b+=" "+c+'="'+a[c]+'"');return b};TradingView.HTMLHelper.Element.create=function(a,b){var c=$(document.createElement(a));b&&(b.html&&(c.html(b.html),delete b.html),c.attr(b));return c};TradingView.HTMLHelper.Element.validAttributes="abbr accept-charset accept accesskey action align alink alt archive axis background bgcolor border cellpadding cellspacing char charoff charset checked cite class classid clear code codebase codetype color cols colspan compact content coords data datetime declare defer dir disabled enctype face for frame frameborder headers height href hreflang hspace http-equiv id ismap label lang language link longdesc marginheight marginwidth maxlength media method multiple name nohref noresize noshade nowrap object onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onreset onselect onsubmit onunload profile prompt readonly rel rev rows rowspan rules scheme scope scrolling selected shape size span src standby start style summary tabindex target text title type usemap valign value valuetype version vlink vspace width".split(" ");
|
|
TradingView.HTMLHelper.Element.validAttribute=function(a){return-1!=jQuery.inArray(a,TradingView.HTMLHelper.Element.validAttributes)};TradingView.HTMLHelper.Element.cleanAttributes=function(a){jQuery.each(a,function(b,c){TradingView.HTMLHelper.Element.validAttribute(b)||delete a[b]});return a};TradingView.HTMLHelper.CUSTOM_SELECT_MINIMAL_WIDTH=100;TradingView.HTMLHelper.Input=function(a){this.jqObj=null;this.data=a;this.init();this._prepareValue();this._prepareCallback();this._prepareChildren();this._applyAttributes();return this.jqObj};TradingView.HTMLHelper.Input.selectOptions={type:"option",value:null,html:null};
|
|
TradingView.HTMLHelper.Input.optionsData={radiogroup:{type:"radio",name:null,value:null,label:null},select:TradingView.HTMLHelper.Input.selectOptions,"select-one":TradingView.HTMLHelper.Input.selectOptions,"select-multiple":TradingView.HTMLHelper.Input.selectOptions};TradingView.HTMLHelper.Input.customTypes=["radiogroup","fontpicker","colorpicker","combobox"];TradingView.HTMLHelper.Input.prototype._tagIsInput=function(a){return-1!=jQuery.inArray(this.data.type,"text radio checkbox hidden reset image file".split(" "))};
|
|
TradingView.HTMLHelper.Input.prototype.init=function(){this._tagIsInput()?this.jqObj=TradingView.HTMLHelper.Element.create("input",{name:this.data.name,type:this.data.type}):this.jqObj=TradingView.HTMLHelper.Element.create(this.data.type,{name:this.data.name})};TradingView.HTMLHelper.Input.prototype._eventIsKeyUp=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea"])};
|
|
TradingView.HTMLHelper.Input.prototype._eventIsClick=function(){return-1!=jQuery.inArray(this.data.type,["checkbox","radio","option"])};TradingView.HTMLHelper.Input.prototype._eventIsChange=function(){return-1!=jQuery.inArray(this.data.type,["select","select-one","select-multiple","radiogroup"])};
|
|
TradingView.HTMLHelper.Input.prototype._prepareCallback=function(){this.data.callback&&(this._eventIsKeyUp()?this.jqObj.keyup(this.data.callback):this._eventIsClick()?this.jqObj.click(this.data.callback):this._eventIsChange()&&this.jqObj.bind("change",this.data.callback),delete this.data.callback)};TradingView.HTMLHelper.Input.prototype._childTag=function(){return{select:"option","select-one":"option","select-multiple":"option",radiogroup:"radio"}[this.data.type]};
|
|
TradingView.HTMLHelper.Input.prototype._inheritedProperties=function(){var a={type:this._childTag()};"radiogroup"==this.data.type&&(a.name=this.data.name);return a};TradingView.HTMLHelper.Input.prototype._extendChildProps=function(a){var b=jQuery.extend(this._inheritedProperties(),a);this.data.value==a.value&&(b.selected=!0);return b};TradingView.HTMLHelper.Input.prototype._prepareChildren=function(){if(this.data.options){var a=this;jQuery.each(this.data.options,function(b,c){a.jqObj.append(new TradingView.HTMLHelper.Input(a._extendChildProps(c)))})}};
|
|
TradingView.HTMLHelper.Input.prototype.isCustom=function(){return-1!=jQuery.inArray(this.data.type,this.customTypes)};TradingView.HTMLHelper.Input.prototype._isStoringValue=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea","option","radio","checkbox"])};TradingView.HTMLHelper.Input.prototype._htmlAsValue=function(){return"textarea"==this.data.type};TradingView.HTMLHelper.Input.prototype._valAsValue=function(){return jQuery.inArray(this.data.type,"text checkbox radio option select select-one select-multiple".split(" "))};
|
|
TradingView.HTMLHelper.Input.prototype._getControlValue=function(){return{checkbox:1}[this.data.type]||this.data.value};TradingView.HTMLHelper.Input.prototype._setControlValue=function(){this._valAsValue()?this.jqObj.val(this._getControlValue()):this._htmlAsValue()&&this.jqObj.html(this.data.value)};TradingView.HTMLHelper.Input.prototype._getCheckedAttr=function(){return{option:"selected",radio:"checked",checkbox:"checked"}[this.data.type]};
|
|
TradingView.HTMLHelper.Input.prototype._setChecked=function(){this.data.selected&&this.jqObj.attr(this._getCheckedAttr(),!0)};TradingView.HTMLHelper.Input.prototype._setValue=function(){this._setControlValue();TradingView.HTMLHelper.Input.isCheckable(this.data.type)&&this._setChecked()};TradingView.HTMLHelper.Input.prototype._prepareValue=function(){this._isStoringValue()&&this._setValue()};TradingView.HTMLHelper.Input.prototype._applyAttributes=function(){this.jqObj.attr(TradingView.HTMLHelper.Element.cleanAttributes(this.data))};
|
|
TradingView.HTMLHelper.Input.value=function(a){return TradingView.HTMLHelper.Input.controlCheckable(a)?a.checked:a.value};TradingView.HTMLHelper.Input.isCheckable=function(a){return-1!=jQuery.inArray(a,["checkbox","radio","option"])};TradingView.HTMLHelper.Input.controlType=function(a){if("string"==typeof a)return a;a=jQuery(a);var b=null;return a.attr("type")&&(b=a.attr("type"),jQuery.inArray(b,"textarea text select select-one select-multiple submit".split(" ")))?b:a.attr("tagName")};
|
|
TradingView.HTMLHelper.Input.controlCheckable=function(a){return TradingView.HTMLHelper.Input.isCheckable(TradingView.HTMLHelper.Input.controlType(a))};TradingView.HTMLHelper.Input.controlToggleChecked=function(a,b){return TradingView.HTMLHelper.setAttr(a,"checked",b)};TradingView.HTMLHelper.Input.controlSetValue=function(a,b){return TradingView.HTMLHelper.Input.controlCheckable(a)?TradingView.HTMLHelper.Input.controlToggleChecked(a,b):TradingView.HTMLHelper.setAttr(a,"value",b)};
|
|
TradingView.HTMLHelper.Input.currentOption=function(a){return a.options[a.selectedIndex]};TradingView.HTMLHelper.Input.currentOptionInnerHTML=function(a){return TradingView.HTMLHelper.Input.currentOption(a).innerHTML};TradingView.HTMLHelper.ComboboxItem=function(a,b){this.value=a;this.html=b||"";this.jqItem=this._render()};TradingView.HTMLHelper.ComboboxItem.prototype.eq=function(a){return this.value===a};TradingView.HTMLHelper.ComboboxItem.prototype.width=function(a){return this.jqItem.width()};
|
|
TradingView.HTMLHelper.ComboboxItem.prototype._render=function(a){a=$("<span/>").append($(this.html).clone());return $('<div class="item"></div>').append(a)};TradingView.HTMLHelper.ComboboxItem.prototype.render=function(a){return this.jqItem};TradingView.HTMLHelper.ComboboxItem.prototype.select=function(a){a?this.jqItem.addClass("selected"):this.jqItem.removeClass("selected")};
|
|
TradingView.HTMLHelper.ComboboxItem.prototype.selectAndReturnIfValueMatch=function(a){if(this.eq(a))return this.select(!0),this;this.select(!1);return null};TradingView.HTMLHelper.Combobox=function(a){this._value=null;this.items=[];this.width=0;this.callback=this.jqItems=this.jqIcon=this.jqTitle=this.jqSwitcher=this.jqWrapper=null;this._init();this.addItems(a);this.joinParts()};TradingView.HTMLHelper.Combobox.prototype._init=function(){this._initWrapper();this._initSwitcher();this._initOptions()};
|
|
TradingView.HTMLHelper.Combobox.prototype._initTitle=function(){this.jqTitle=$('<span class="title" />')};TradingView.HTMLHelper.Combobox.prototype._initIcon=function(){this.jqIcon=$('<span class="icon" />')};TradingView.HTMLHelper.Combobox.prototype._initOptions=function(){this.jqItems=TradingView.HTMLHelper.createPopup({"class":"items"})};
|
|
TradingView.HTMLHelper.Combobox.prototype._initWrapper=function(){this.jqWrapper=$('<div class="custom-select" />');this.jqWrapper.data({disable:this.disable.bind(this),enable:this.enable.bind(this)})};
|
|
TradingView.HTMLHelper.Combobox.prototype._initSwitcher=function(){var a=this;this._initTitle();this._initIcon();this.jqSwitcher=$('<div class="switcher" />');this.jqSwitcher.append(this.jqTitle);this.jqSwitcher.append($(this.jqIcon).clone());this.opened=!1;this.jqSwitcher.click(function(b){a.toggleItems()});a=this;$(document).click(function(b){!$(b.target).closest(a.jqSwitcher).length&&(!a.jqSwitcher.is(b.target)&&0===a.jqSwitcher.has(b.target).length||!a.jqItems.is(b.target)&&0===!a.jqItems.has(b.target).length)&&
|
|
a.opened&&(console.log("click"),a.jqItems.hide(),a.opened=!1,a.jqSwitcher.removeClass("open"),b.stopPropagation())})};TradingView.HTMLHelper.Combobox.prototype.toggleItems=function(){this.disabled()||(this.opened?(this.jqItems.hide(),this.jqSwitcher.removeClass("open"),this.opened=!1):(this.jqItems.show(),this.jqSwitcher.addClass("open"),this.opened=!0))};TradingView.HTMLHelper.Combobox.prototype.setWidth=function(){this.jqWrapper.width(this.width)};
|
|
TradingView.HTMLHelper.Combobox.prototype.joinParts=function(){this.jqWrapper.append(this.jqSwitcher);this.jqWrapper.append(this.jqItems);this.jqWrapper.selectable(!1)};TradingView.HTMLHelper.Combobox.prototype.render=function(){return this.jqWrapper};TradingView.HTMLHelper.Combobox.prototype.selectItemByValue=function(a){var b=null;$(this.items).each(function(c,d){var e=d.selectAndReturnIfValueMatch(a);e&&(b=e)});return b};
|
|
TradingView.HTMLHelper.Combobox.prototype.setValue=function(a){if(this._value!=a){var b=this.selectItemByValue(a);this._value=a;this.jqTitle.html(b.html);this.change()}};TradingView.HTMLHelper.Combobox.prototype.change=function(a){a?this.callback=a:this.callback&&this.callback.call(this)};TradingView.HTMLHelper.Combobox.prototype.value=function(){return this._value};TradingView.HTMLHelper.Combobox.prototype.val=function(a){if(void 0!==a)this.setValue(a);else return this.value()};
|
|
TradingView.HTMLHelper.Combobox.prototype.addItems=function(a){var b=this;$(a).each(function(a,d){b.addItem(d.value,d.html)})};TradingView.HTMLHelper.Combobox.prototype.addItem=function(a,b){var c=this,d=new TradingView.HTMLHelper.ComboboxItem(a,b);this.items.push(d);d=d.render();d.click(function(){c.setValue(a);c.toggleItems()});this.jqItems.append(d);null===this.value()&&this.setValue(a)};TradingView.HTMLHelper.Combobox.prototype.disable=function(){this._disabled=!0};
|
|
TradingView.HTMLHelper.Combobox.prototype.enable=function(){this._disabled=!1};TradingView.HTMLHelper.Combobox.prototype.disabled=function(){return this._disabled};Object.defineProperty(Array.prototype,"toArray",{value:valueOf,enumerable:!1,configurable:!0,writabale:!0});function List(a){if(void 0===a)this.m_values=[];else if(Array.isArray(a))this.m_values=a;else throw new TypeError("invalid values");this.m_validator=null}List.prototype.validator=function(){return this.m_validator};List.prototype.setValidator=function(a){this.m_validator=a};List.prototype.item=function(a){return this.m_values[a]};
|
|
List.prototype.setItem=function(a,b){if(!TradingView.isInteger(a))throw new RangeError("incorrect index");if(0>a||a>=this.m_values.length)throw new RangeError("incorrect index");if(null!==this.m_validator&&!this.m_validator.check(b))throw new TypeError("value is of unexpected type");this.m_values[a]=b};List.prototype.first=function(){return this.item(0)};List.prototype.last=function(){return this.item(this.size()-1)};
|
|
List.prototype.append=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");this.m_values.push(a);return this};List.prototype.insert=function(a,b){if(!TradingView.isInteger(b))throw new RangeError("invalid index:"+b);if(0>b||b>this.size())throw new RangeError("invalid index:"+b);this.m_values.splice(b,0,a)};
|
|
List.prototype.appendAll=function(a){if(!(new TradingView.TypeValidator(List)).check(a))throw new TypeError("parameter must be of type List");for(var b=0;b<a.size();++b)this.m_values.push(a.item(b));return this};List.prototype.removeAt=function(a){if(!TradingView.isInteger(a))throw new RangeError("incorrect index");if(0>a||a>=this.m_values.length)throw new RangeError("incorrect index");this.m_values.splice(a,1)};List.prototype.size=function(){return this.m_values.length};
|
|
List.prototype.isEmpty=function(){return 0===this.size()};List.prototype.indexOf=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");return this.m_values.indexOf(a)};List.prototype.contains=function(a){return-1!=this.indexOf(a)};List.prototype.remove=function(a){if(null!==this.m_validator&&!this.m_validator.check(a))throw new TypeError("value is of unexpected type");a=this.indexOf(a);-1!==a&&this.removeAt(a)};
|
|
List.prototype.removeAll=function(a){this.m_values=this.m_values.filter(function(b){return!a(b)})};List.prototype.clear=function(){this.m_values=[]};List.prototype.clone=function(){var a=new List;a.setValidator(this.validator());a.m_values=this.m_values.slice();return a};List.prototype.toArray=function(){return this.m_values};List.prototype.sort=function(a){this.m_values.sort(a)};List.prototype.find=function(a){for(var b=0;b<this.m_values.length;b++)if(a(this.m_values[b],b,this.m_values))return this.m_values[b]};
|
|
List.prototype.count=function(a){for(var b=0,c=0;c<this.m_values.length;c++)a(this.m_values[c],c,this.m_values)&&b++;return b};TradingView.loadScript=function(a){function b(){d.reject()}function c(){if(e.length){var a=e.shift();if(null==a)return c();var g=document.createElement("script");g.addEventListener("load",c,!0);g.addEventListener("error",b,!0);g.async=!0;g.defer=!0;g.src=a;document.body.appendChild(g)}else d.resolve()}var d=$.Deferred(),e=[].concat(a);c();return d.promise()};
|
|
TradingView.loadTVScript=function(){var a=null;return function(){a||(a="undefined"!==typeof TVScript&&Object.keys(TVScript).length?$.Deferred().resolve():TradingView.loadScript(window.TVSCRIPT_FILES));return a.promise()}}();var MathEx={lessThan:function(a,b){return a<=b},greaterThan:function(a,b){return a>=b},clamp:function(a,b,c){return Math.min(Math.max(a,b),c)},sign:function(a){return 0>a?-1:0<a?1:0},isBaseDecimal:function(a){if(0>a)return TradingView.logDebugChart("MathEx.isBaseDecimal: argument less zero"),!1;for(;1<a;a/=10)if(0!==a%10)return!1;return!0},greaterOrEqual:function(a,b,c){return b-a<=c},equal:function(a,b,c){return Math.abs(a-b)<c},log10:function(a){if(0>=a)TradingView.logDebugChart("MathEx.log10: argument less or equal zero");
|
|
else return Math.log(a)/Math.log(10)},defComparator:function(a,b){return a<b?-1:a>b?1:0},min:function(a,b){if(!Array.isArray(a))throw"argument is not array";if(1>a.length)throw"array is empty";b||(b=MathEx.defComparator);for(var c=a[0],d=0;d<a.length;++d)0>b(a[d],c)&&(c=a[d]);return c},max:function(a,b){if(!Array.isArray(a))throw"argument is not array";if(1>a.length)throw"array is empty";b||(b=MathEx.defComparator);for(var c=a[0],d=0;d<a.length;++d)0<b(a[d],c)&&(c=a[d]);return c},Point:function(a,
|
|
b){this.x=a;this.y=b}};MathEx.Point.prototype.add=function(a){return new MathEx.Point(this.x+a.x,this.y+a.y)};MathEx.Point.prototype.addScaled=function(a,b){return new MathEx.Point(this.x+b*a.x,this.y+b*a.y)};MathEx.Point.prototype.substract=function(a){return new MathEx.Point(this.x-a.x,this.y-a.y)};MathEx.Point.prototype.dotProduct=function(a){return this.x*a.x+this.y*a.y};MathEx.Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)};
|
|
MathEx.Point.prototype.scaled=function(a){return new MathEx.Point(this.x*a,this.y*a)};MathEx.Point.prototype.normalized=function(){return this.scaled(1/this.length())};MathEx.Point.prototype.transponed=function(){return new MathEx.Point(-this.y,this.x)};MathEx.Point.prototype.clone=function(){return new MathEx.Point(this.x,this.y)};MathEx.Matrix=function(){this._rows=[[1,0,0],[0,1,0],[0,0,1]]};
|
|
MathEx.Matrix.prototype.mult=function(a){if(a instanceof MathEx.Matrix){for(var b=new MathEx.Matrix,c=0;3>c;c++)for(var d=0;3>d;d++)for(var e=b._rows[c][d]=0;3>e;e++)b._rows[c][d]+=this._rows[c][e]*a._rows[e][d];return b}if(a instanceof MathEx.Point){a=[a.x,a.y,1];b=[0,0,0];for(c=0;3>c;c++)for(d=0;3>d;d++)b[c]+=a[d]*this._rows[c][d];return new MathEx.Point(b[0],b[1])}throw"unsupported type";};
|
|
MathEx.Matrix.rotate=function(a){var b=new MathEx.Matrix;b._rows[0][0]=Math.cos(a);b._rows[1][1]=Math.cos(a);b._rows[0][1]=-Math.sin(a);b._rows[1][0]=Math.sin(a);return b};MathEx.Matrix.scale=function(a,b){var c=new MathEx.Matrix;c._rows[0][0]=a;c._rows[1][1]=b;return c};MathEx.Matrix.translate=function(a,b){var c=new MathEx.Matrix;c._rows[0][2]=a;c._rows[1][2]=b;return c};
|
|
MathEx.distanceToLine=function(a,b,c){b=b.substract(a);var d=c.substract(a).dotProduct(b)/b.dotProduct(b);return{distance:a.addScaled(b,d).substract(c).length(),coeff:d}};MathEx.distanceToSegment=function(a,b,c){var d=MathEx.distanceToLine(a,b,c);if(0<=d.coeff&&1>=d.coeff)return d;a=a.substract(c).length();b=b.substract(c).length();return a<b?{distance:a,coeff:0}:{distance:b,coeff:1}};
|
|
MathEx.intersectLines=function(a,b,c,d){b=b.substract(a);d=d.substract(c);b=b.x*d.y-b.y*d.x;if(1E-6>Math.abs(b))return null;a=a.substract(c);return(a.y*d.x-a.x*d.y)/b};MathEx.intersectSegment=function(a,b,c,d){var e=MathEx.intersectLines(a,b,c,d);if(null===e)return null;a=b.substract(a).scaled(e).add(a);c=MathEx.distanceToSegment(c,d,a);return 1E-6>Math.abs(c.distance)?e:null};MathEx.pointInRect=function(a,b,c){return a.x>=b.x&&a.x<=c.x&&a.y>=b.y&&a.y<=c.y};
|
|
MathEx.pointInTriangle=function(a,b,c,d){var e=a.add(b).scaled(.5).add(c).scaled(.5),f=MathEx.intersectSegment(a,b,e,d);if(null!==f)return!1;f=MathEx.intersectSegment(b,c,e,d);if(null!==f)return!1;f=MathEx.intersectSegment(c,a,e,d);return null!==f?!1:!0};
|
|
MathEx.intersectRayWithRect=function(a,b,c,d){var e=MathEx.intersectLines(a,b,c,new MathEx.Point(d.x,c.y)),f=MathEx.intersectLines(a,b,new MathEx.Point(d.x,c.y),d),g=MathEx.intersectLines(a,b,d,new MathEx.Point(c.x,d.y)),h=MathEx.intersectLines(a,b,new MathEx.Point(c.x,d.y),c),k=[];e&&0<=e&&k.push(e);f&&0<=f&&k.push(f);g&&0<=g&&k.push(g);h&&0<=h&&k.push(h);if(0===k.length)return null;k.sort(function(a,b){return a-b});c=MathEx.pointInRect(a,c,d)?k[0]:k[k.length-1];return a.addScaled(b.substract(a),
|
|
c)};MathEx.isInPolygon=function(a,b){for(var c=0,d=a.length-1,e=!1,f=b.x,g=b.y,c=0;c<a.length;c++){var h=a[c],d=a[d];(h.y<g&&d.y>=g||d.y<g&&h.y>=g)&&h.x+(g-h.y)/(d.y-h.y)*(d.x-h.x)<f&&(e=!e);d=c}return e};MathEx.isInCircle=function(a,b,c){return(c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y)<=b*b};
|
|
MathEx.optionalCorner=function(a,b,c,d){return 1E-6<Math.abs(a.x-b.x)&&1E-6<Math.abs(a.y-b.y)?0===Math.round(a.x)||0===Math.round(b.x)?0===Math.round(a.y)||0===Math.round(b.y)?new MathEx.Point(0,0):new MathEx.Point(0,d):0===Math.round(a.y)||0===Math.round(b.y)?new MathEx.Point(c,0):new MathEx.Point(c,d):null};var CanvasEx={LINESTYLE_SOLID:0,LINESTYLE_DOTTED:1,LINESTYLE_DASHED:2,LINESTYLE_LARGE_DASHED:3,TEXTPOS_TOPLEFT:0,TEXTPOS_TOPCENTER:1,TEXTPOS_TOPRIGHT:2,TEXTPOS_MIDDLELEFT:3,TEXTPOS_MIDDLECENTER:4,TEXTPOS_MIDDLERIGHT:5,TEXTPOS_BOTTOMLEFT:6,TEXTPOS_BOTTOMCENTER:7,TEXTPOS_BOTTOMRIGHT:8,MARKLOC_ABOVEBAR:"AboveBar",MARKLOC_BELOWBAR:"BelowBar",MARKLOC_TOP:"Top",MARKLOC_BOTTOM:"Bottom",MARKLOC_RIGHT:"Right",MARKLOC_LEFT:"Left",MARKLOC_ABSOLUTE:"Absolute",MARKLOC_ABSOLUTEUP:"AbsoluteUp",MARKLOC_ABSOLUTEDOWN:"AbsoluteDown",
|
|
HHISTLOC_RELATIVE:"relative",HHISTLOC_ABSOLUTE:"absolute",HHISTDIR_LEFTTORIGHT:"left_to_right",HHISTDIR_RIGHTTOLEFT:"right_to_left"};"undefined"!=typeof module&&module&&module.exports&&(module.exports=CanvasEx);TradingView.resizeCanvas=function(a,b,c){var d=a.prop("height"),e=a.prop("width");if(d&&e){var f=$("<canvas>").prop("width",e).prop("height",d),g=f.get(0).getContext("2d"),e=Math.min(e,b),d=Math.min(d,c);e&&d&&g.drawImage(a.get(0),0,0,e,d,0,0,e,d);a.prop("height",c).prop("width",b);a=a.get(0).getContext("2d");e&&d&&a.drawImage(f.get(0),0,0,e,d,0,0,e,d);f.remove()}};
|
|
CanvasEx.computeDashPattern=function(a){return[[a.lineWidth,2*a.lineWidth],[3*a.lineWidth,2*a.lineWidth],[6*a.lineWidth,6*a.lineWidth]][a.lineStyle-1]};CanvasEx.drawLine=function(a,b,c,d,e){isFinite(b)&&isFinite(d)&&isFinite(c)&&isFinite(e)&&(a.lineStyle===CanvasEx.LINESTYLE_DASHED||a.lineStyle===CanvasEx.LINESTYLE_DOTTED?a.drawDashedLine(a,b,c,d,e):CanvasEx.drawSolidLine(a,b,c,d,e))};CanvasEx.drawSolidLine=function(a,b,c,d,e){a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()};
|
|
CanvasEx.setLineStyle=function(a,b){a.lineStyle=b;var c=[];b!=CanvasEx.LINESTYLE_SOLID&&(c=CanvasEx.computeDashPattern(a));"function"==typeof a.setLineDash?a.setLineDash(c):void 0!==a.mozDash?a.mozDash=c:void 0!==a.webkitLineDash&&(a.webkitLineDash=c)};CanvasEx.drawPoly=function(a,b,c){a.beginPath();a.moveTo(b[0].x,b[0].y);for(var d=0;d<b.length;d++){var e=b[d];a.lineTo(e.x,e.y)}a.closePath();a.stroke();c&&a.fill()};CanvasEx.lineStyles=[];
|
|
"undefined"!==typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(a){if(this.font!=a)try{this.font=a}catch(b){}},CanvasRenderingContext2D.prototype.lineStyle=CanvasEx.LINESTYLE_SOLID,CanvasEx.originalSave=CanvasRenderingContext2D.prototype.save,CanvasEx.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){CanvasEx.lineStyles.push(this.lineStyle);CanvasEx.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=
|
|
function(){0<CanvasEx.lineStyles.length&&(this.lineStyle=CanvasEx.lineStyles.pop(),CanvasEx.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(a,b,c,d,e){a.save();var f=CanvasEx.computeDashPattern(a);a.beginPath();if("function"==typeof a.setLineDash)a.setLineDash(f);else if(void 0!==a.mozDash)a.mozDash=f;else if(void 0!==a.webkitLineDash)a.webkitLineDash=f;else{a.dashedLineTo(b,c,d,e,f);a.stroke();a.restore();return}a.moveTo(b,c);a.lineTo(d,e);a.stroke();a.restore()},
|
|
CanvasRenderingContext2D.prototype.dashedLineTo=function(a,b,c,d,e){var f={thereYet:MathEx.greaterThan,cap:Math.min},g={thereYet:MathEx.greaterThan,cap:Math.min};0<b-d&&(g.thereYet=MathEx.lessThan,g.cap=Math.max);0<a-c&&(f.thereYet=MathEx.lessThan,f.cap=Math.max);this.moveTo(a,b);for(var h=a,k=b,l=0,m=!0;!f.thereYet(h,c)||!g.thereYet(k,d);){var n=Math.atan2(d-b,c-a),p=e[l],h=f.cap(c,h+Math.cos(n)*p),k=g.cap(d,k+Math.sin(n)*p);m?this.lineTo(h,k):this.moveTo(h,k);l=(l+1)%e.length;m=!m}},CanvasRenderingContext2D.prototype.roundRect=
|
|
function(a,b,c,d,e){this.beginPath();this.moveTo(a+e,b);this.lineTo(a+c-e,b);this.arcTo(a+c,b,a+c,b+e,e);this.lineTo(a+c,b+d-e);this.arcTo(a+c,b+d,a+c-e,b+d,e);this.lineTo(a+e,b+d);this.arcTo(a,b+d,a,b+d-e,e);this.lineTo(a,b+e);this.arcTo(a,b,a+e,b,e)});String.prototype.left=function(a){if(!TradingView.isInteger(a))throw"invalid length";if(a>this.length)throw"invalid length";return this.substring(0,a)};String.prototype.right=function(a){if(!TradingView.isInteger(a))throw"invalid length";if(a>this.length)throw"invalid length";return this.substring(this.length-a,this.length)};String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")};
|
|
String.prototype.startsWith=function(a){return a.length>this.length?!1:this.left(a.length)===a};function Delegate(){this._listeners=[]}Delegate.prototype.subscribe=function(a,b,c){this._listeners.push({object:a,member:b,singleshot:!!c})};Delegate.prototype.unsubscribe=function(a,b){for(var c=0;c<this._listeners.length;++c){var d=this._listeners[c];if(d.object===a&&d.member.prototype===b.prototype){this._listeners.splice(c,1);break}}};
|
|
Delegate.prototype.fire=function(a){for(var b=this._listeners.slice(),c=0;c<b.length;++c){var d=b[c];d.object?d.member.call(d.object,a):d.member(a)}for(c=this._listeners.length-1;0<=c;c--)this._listeners[c].singleshot&&this._listeners.splice(c,1)};/*
|
|
Use it if you like it
|
|
*/
|
|
TradingView.RGBColor=function(a){this.ok=!1;"#"==a.charAt(0)&&(a=a.substr(1,6));a=a.replace(/ /g,"");a=a.toLowerCase();this.parseColor(a)||(this.simple_colors[a]&&(a=this.simple_colors[a]),this.parseColor(a));this.cleanupRGB()};
|
|
TradingView.RGBColor.prototype.color_defs=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+
|
|
a[3],16)]}}];
|
|
TradingView.RGBColor.prototype.simple_colors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",
|
|
darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",
|
|
green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",
|
|
lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",
|
|
orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",
|
|
tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};TradingView.RGBColor.prototype.parseColor=function(a){for(var b=0;b<this.color_defs.length;b++){var c=this.color_defs[b].process,d=this.color_defs[b].re.exec(a);if(d)return a=c(d),this.r=a[0],this.g=a[1],this.b=a[2],this.ok=!0}return!1};
|
|
TradingView.RGBColor.prototype.cleanupRGB=function(){this.r=0>this.r||TradingView.isNaN(this.r)?0:255<this.r?255:this.r;this.g=0>this.g||TradingView.isNaN(this.g)?0:255<this.g?255:this.g;this.b=0>this.b||TradingView.isNaN(this.b)?0:255<this.b?255:this.b};TradingView.RGBColor.prototype.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};
|
|
TradingView.RGBColor.prototype.toHex=function(){var a=this.r.toString(16),b=this.g.toString(16),c=this.b.toString(16);1==a.length&&(a="0"+a);1==b.length&&(b="0"+b);1==c.length&&(c="0"+c);return"#"+a+b+c};TradingView.RGBColor.prototype.grayChannel=function(){var a=[.199,.687,.114];return a[0]*this.r+a[1]*this.g+a[2]*this.b};TradingView.RGBColor.prototype.blackWhiteContrast=function(){return 150>this.grayChannel()?"white":"black"};
|
|
TradingView.RGBColor.prototype.darken=function(a){var b=TradingView.rgbToHsl(this.r,this.g,this.b);a=TradingView.hslToRgb(b[0],b[1],b[2]-a/100);this.r=a[0];this.g=a[1];this.b=a[2];this.cleanupRGB();return this};TradingView.rgbToHsl=function(a,b,c){a/=255;b/=255;c/=255;var d=Math.max(a,b,c),e=Math.min(a,b,c),f,g=(d+e)/2;if(d==e)f=e=0;else{var h=d-e,e=.5<g?h/(2-d-e):h/(d+e);switch(d){case a:f=(b-c)/h+(b<c?6:0);break;case b:f=(c-a)/h+2;break;case c:f=(a-b)/h+4}f/=6}return[f,e,g]};
|
|
TradingView.hslToRgb=function(a,b,c){function d(a,b,c){0>c&&(c+=1);1<c&&--c;return c<1/6?a+6*(b-a)*c:.5>c?b:c<2/3?a+(b-a)*(2/3-c)*6:a}if(0===b)c=b=a=c;else{var e=.5>c?c*(1+b):c+b-c*b,f=2*c-e;c=d(f,e,a+1/3);b=d(f,e,a);a=d(f,e,a-1/3)}return[Math.round(255*c),Math.round(255*b),Math.round(255*a)]};
|
|
TradingView.colorsAreSimilar=function(a,b){var c=parseInt(a.substring(1,3),16),d=parseInt(a.substring(3,5),16),e=parseInt(a.substring(5,7),16),f=parseInt(b.substring(1,3),16),g=parseInt(b.substring(3,5),16),h=parseInt(b.substring(5,7),16),c=f-c,d=d-g,e=e-h;return 16>Math.sqrt(c*c+d*d+e*e)};
|
|
TradingView.invertColor=function(a){var b=parseInt(a.substring(1,3),16),c=parseInt(a.substring(3,5),16);a=parseInt(a.substring(5,7),16);c=255-c;a=255-a;return"#"+("0"+(255-b).toString(16)).right(2)+("0"+c.toString(16)).right(2)+("0"+a.toString(16)).right(2)};TradingView.getImage=function(a,b){var c=document.body,d=c[a];d||(d=document.createElement("img"),d.src=b,c[a]=d);return d};A68=function(){function a(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;return a}function b(){}function c(a){this.value=a}function d(){}function e(){}function f(){}function g(){}function h(){}function k(){}function l(){}function m(){}function n(a){this.value=a}function p(a){this.value=a}function r(a){this.value=a}function t(){n.apply(this,arguments)}function v(){p.apply(this,arguments)}function w(a,b){var d=[],e;a:for(;e=E.exec(a);){for(var f=A.length;f--;)if(e[f+
|
|
1]){A[f].ctor&&(f=new A[f].ctor(e[f+1]),f._offset=e.index,d.push(f));continue a}f=new r(e[0]);f._offset=e.index;d.push(f)}if(b&&b.recover)for(var g,f=d.length;f--;)e=d[f],e instanceof p||e instanceof n?(void 0!==g&&(e=new n(""),g=d.splice(f,g-f+1,e),e.value=g.map(function(a){return a.value}).join("")),g=f):e instanceof c||(g=void 0);return d}function u(a){for(var b=[],d=0;d<a.length;d++)a[d]instanceof c||b.push(a[d]);return b}function x(a){a=u(a);for(var b=[],c=[],g=0;g<a.length;g++){var h=a[g];if(h instanceof
|
|
f)c.length&&c[c.length-1].minPrecedence>h.precedence&&(c[c.length-1].minPrecedence=h.precedence);else if(h instanceof d)c.push({minPrecedence:Infinity,openBraceIndex:g});else if(h instanceof e){var h=c.pop(),k=a[h.openBraceIndex-1],l=a[g+1];l instanceof f&&!(l.precedence<=h.minPrecedence)||k instanceof f&&!(k.precedence<h.minPrecedence||k.precedence===h.minPrecedence&&k.commutative)||(b.unshift(h.openBraceIndex),b.push(g),c.length&&c[c.length-1].minPrecedence>h.minPrecedence&&(c[c.length-1].minPrecedence=
|
|
h.minPrecedence))}}for(g=b.length;g--;)a.splice(b[g],1);return a}function C(a){for(var b=0,g=0,h,k=0;k<a.length;k++){var m=a[k];if(!(m instanceof c))switch(b){case 0:if(m instanceof p&&1===+m.value)b=1;else return!1;break;case 1:if(1===b&&m instanceof l)b=2,h=k+1;else return!1;break;case 2:if(m instanceof d)b=3,g=1;else if(m instanceof f)return!1;break;case 3:m instanceof d?g++:m instanceof e&&(g--,0>=g&&(b=2))}}return a.slice(h)}var A=[{pattern:"(",ctor:d},{pattern:")",ctor:e},{pattern:"+",ctor:g},
|
|
{pattern:"-",ctor:h},{pattern:"*",ctor:k},{pattern:"/",ctor:l},{pattern:"^",ctor:m},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:p},{pattern:/\./,ctor:v},{pattern:R77.enabled("charting_library_base")?/[a-zA-Z0-9_\u4e00-\u9fa5^][a-zA-Z0-9_\u4e00-\u9fa5_!:\.&]*|'.+?'/:/[a-zA-Z0-9][a-zA-Z0-9_!|:\.&]*|'.+?'/,ctor:n},{pattern:/'[^']*/,ctor:t},{pattern:/[\0-\x20\s]+/,ctor:c}];b.prototype.toString=function(){return this.value};a(c,b);a(d,b);d.prototype.value="(";a(e,b);e.prototype.value=
|
|
")";a(f,b);a(g,f);g.prototype.value="+";g.prototype.precedence=0;g.prototype.commutative=!0;a(h,f);h.prototype.value="-";h.prototype.precedence=0;h.prototype.commutative=!1;a(k,f);k.prototype.value="*";k.prototype.precedence=1;k.prototype.commutative=!0;a(l,f);l.prototype.value="/";l.prototype.precedence=1;l.prototype.commutative=!1;a(m,f);m.prototype.value="^";m.prototype.precedence=2;m.prototype.commutative=!1;var y=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,D=/[\+\-\/\*]/;a(n,b);n.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var a=
|
|
D.test(this._ticker)?"'":"";return a+(this._exchange?this._exchange+":":"")+this._ticker+a}return this.value};n.prototype.parse=function(){var a=y.exec(this.value);a[1]&&(this._exchange=a[1]);this._ticker=a[2]};n.prototype.parseAsFutures=function(){if(TradingView.futuresRoots){this.hasOwnProperty("_ticker")||this.parse();for(var a=function(a){return TradingView.futuresRoots.some(function(b){return b.t===a})},b=2;1<=b;--b){var c=this._ticker.slice(0,b);if(a(c)){this._root=c;this._contract=this._ticker.slice(b);
|
|
break}}}};n.prototype.exchange=function(a){this.hasOwnProperty("_ticker")||this.parse();if(0<arguments.length)null===a||void 0===a?delete this._exchange:this._exchange=a+"";else return this._exchange};n.prototype.ticker=function(a){this.hasOwnProperty("_ticker")||this.parse();if(0<arguments.length)null===a||void 0===a?delete this._ticker:this._ticker=a+"",delete this._root,delete this._contract;else return this._ticker};n.prototype.root=function(a){this.hasOwnProperty("_root")||this.parseAsFutures();
|
|
if(0<arguments.length)if(null===a||void 0===a)delete this._root;else{if(this._root=a+"")this._ticker=this._root+(this._contract||"")}else return this._root};n.prototype.contract=function(a){this.hasOwnProperty("_contract")||this.parseAsFutures();if(0<arguments.length)null===a||void 0===a?delete this._contract:(this._contract=a+"",this._root&&(this._ticker=this._root+this._contract));else return this._root};a(p,b);p.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:
|
|
this.value};p.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")};r.prototype.toString=function(){return this.value};a(t,n);t.prototype.isIncomplete=!0;t.prototype.incompleteSuggest=function(){if("'"!==this.value)return new String("'")};a(v,p);v.prototype.isIncomplete=!0;var E=new RegExp(A.map(function(a){return"("+("string"===typeof a.pattern?a.pattern.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&"):a.pattern.source)+
|
|
")"}).concat(".").join("|"),"g");return{tokenize:w,validate:function(a){if(R77.enabled("charting_library_base"))return{currentState:"var"};for(var b="init",g={warnings:[],errors:[],isEmpty:!0},h=[],k=0;k<a.length;k++){var l=a[k];if(!(l instanceof c)){delete g.isEmpty;if(l.isIncomplete){var m={status:"incomplete",reason:"incomplete_token",offset:l._offset,token:l};l.incompleteSuggest&&(m.recover={append:l.incompleteSuggest()});g.warnings.push(m);if(k!==a.length-1){m.status="error";continue}}l instanceof
|
|
n||l instanceof p?"var"==b?g.errors.push({status:"error",reason:"unexpected_token",offset:l._offset,token:l}):b="var":l instanceof f?"var"!=b?g.errors.push({status:"error",reason:"unexpected_token",offset:l._offset,token:l}):b="operator":l instanceof d?"var"==b?g.errors.push({status:"error",reason:"unexpected_token",offset:l._offset,token:l}):(h.push(l),b="init"):l instanceof e?"var"!=b?g.errors.push({status:"error",reason:"unexpected_token",offset:l._offset,token:l}):(h.pop()||g.errors.push({status:"error",
|
|
reason:"unbalanced_brace",offset:l._offset,token:l,recover:{prepend:new d}}),b="var"):l instanceof r&&g.errors.push({status:"error",reason:"unparsed_entity",offset:l._offset,token:l})}}g.braceBalance=h.length;for("var"!==b&&g.warnings.push({status:"incomplete"});h.length;)l=h.pop(),m={status:"incomplete",reason:"unbalanced_brace",offset:l._offset,token:l},"var"==b&&(m.recover={append:new e}),g.warnings.push(m);g.currentState=b;0===g.warnings.length&&delete g.warnings;0===g.errors.length&&delete g.errors;
|
|
return g},factorOutBraces:x,normalizeTokens:function(a){for(var b=0;b<a.length;b++)a[b].parse&&a[b].parse();return a},flip:function(a){var b=C(a);return b?x(b):x([new p("1"),new l,new d].concat(a).concat(new e))},hasBatsSymbols:function(a){if("string"===typeof a)a=w(a);else if(!Array.isArray(a))throw new TypeError("expression must be a string or token array");return a.some(function(a){return a instanceof n&&"BATS"===(a.exchange()||"").toUpperCase()?!0:!1})},hasEodSymbols:function(a){if("string"===
|
|
typeof a)a=w(a);else if(!Array.isArray(a))throw new TypeError("expression must be a string or token array");return a.some(function(a){return a instanceof n&&-1!==(a.exchange()||"").toUpperCase().indexOf("_EOD")?!0:!1})},SymbolToken:n,IncompleteSymbolToken:t,NumberToken:p,BinaryOperatorToken:f,OpenBraceToken:d,CloseBraceToken:e,ticker:function(a){return(new n(a)).ticker()},shortName:function(a){if("string"!==typeof a)throw new TypeError("expression must be a string");a=x(u(w(a)));a.forEach(function(a){a instanceof
|
|
n&&a.exchange(null)});return a.join("")},normalize:function(a){if("string"!==typeof a)throw new TypeError("expression must be a string");return x(u(w(a))).join("")}}}();TradingView.ReadonlyWatchedValue=function(){};function WatchedValue(a){if(!(this instanceof WatchedValue))return new WatchedValue(a);0<arguments.length&&(this._value=a);this._listeners=[]}WatchedValue.prototype.value=function(){return this._owner?this._owner._value:this._value};
|
|
WatchedValue.prototype.setValue=function(a,b){var c=this._owner?this._owner:this;"function"===typeof c.hook&&(a=c.hook(a));if(c.writeLock)return c._value;if(!b&&c._value===a&&c.hasOwnProperty("_value"))return a;c._value=a;for(var d=c._listeners.slice(),e=0,f=0;f<d.length;f++)d[f].once&&(c._listeners.splice(f-e,1),e++),d[f].cb(a);return a};
|
|
WatchedValue.prototype.deleteValue=function(){var a=this._owner?this._owner:this;if(a.hasOwnProperty("_value")){if(a.writeLock)return a._value;delete a._value;for(var b=a._listeners.slice(),c=0,d=0;d<b.length;d++)b[d].once&&(a._listeners.splice(d-c,1),c++),b[d].cb()}};
|
|
WatchedValue.prototype.subscribe=function(a,b){if("function"!==typeof a)throw new TypeError("callback must be a function");var c=!!b&&!!b.once,d=this._owner?this._owner:this;if(b&&b.callWithLast&&d.hasOwnProperty("_value")&&(a(d._value),c))return;d._listeners.push({cb:a,owner:this,once:!!b&&!!b.once})};
|
|
WatchedValue.prototype.unsubscribe=function(a){var b=this._owner?this._owner:this;void 0===a&&(a=null);for(var c=b._listeners,d=c.length;d--;)c[d].owner!==this&&b!==this||c[d].cb!==a&&null!==a||c.splice(d,1)};
|
|
WatchedValue.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var a=this._readonlyInstance=new TradingView.ReadonlyWatchedValue;a.subscribe=this.subscribe.bind(this);a.unsubscribe=this.unsubscribe.bind(this);a.value=this.value.bind(this);a.when=this.when.bind(this);return a};WatchedValue.prototype.spawn=function(){var a=new WatchedValue;delete a._listeners;a._owner=this._owner||this;a.destroy=function(){this.unsubscribe();delete this._owner};return a};
|
|
WatchedValue.prototype.when=function(a){var b=this;if(this.value())a();else{var c=function(d){d&&(b.unsubscribe(c),a())};b.subscribe(c)}};"undefined"!=typeof module&&module&&module.exports&&(module.exports=WatchedValue);var WEB_SOCKET_SWF_LOCATION=TradingView.resourceFullPath("web_socket_main.swf"),WEB_SOCKET_DEBUG=!1;TradingView.WEB_SOCKET_WAS_CONNECTED=!1;TradingView.STUDY_COUNT_LIMIT=120;TradingView.HandlerInfo=function(a,b){this.handler=a;this.customId=b;this.requestHook=null};R98=function(){};R98.prototype.defaultWatchlistSymbols=function(){};R98.prototype.availableTimeFrames=function(a,b){};
|
|
R98.prototype.defaultResolutions=function(){};R98.prototype.supportedSymbolsTypes=function(){};R98.prototype.supportedExchangesList=function(){};R98.prototype.futuresRegex=function(){};R98.prototype.setAuthToken=function(a,b){};R98.prototype.authTokenRequired=function(a){};R98.prototype.quoteCreateSession=function(a){};
|
|
R98.prototype.quoteDeleteSession=function(a){};R98.prototype.quoteSetFields=function(a,b){};R98.prototype.quoteAddSymbols=function(a,b){};R98.prototype.quoteRemoveSymbols=function(a,b){};R98.prototype.quoteFastSymbols=function(a,b){};R98.prototype.depthCreateSession=function(a,b,c){};R98.prototype.depthDeleteSession=function(a){};
|
|
R98.prototype.depthSetSymbol=function(a,b){};R98.prototype.depthClearSymbol=function(a){};R98.prototype.depthSetScale=function(a,b){};R98.prototype.chartCreateSession=function(a,b){};R98.prototype.chartDeleteSession=function(a){};R98.prototype.createSession=function(a,b){};R98.prototype.removeSession=function(a){};
|
|
R98.prototype.connected=function(){};R98.prototype._getHost=function(a){};R98.prototype.connect=function(){};R98.prototype.disconnect=function(){};R98.prototype.switchTimezone=function(a,b){};R98.prototype.resolveSymbol=function(a,b,c,d,e){};R98.prototype.createSeries=function(a,b,c,d,e,f,g){};
|
|
R98.prototype.removeSeries=function(a,b,c){};R98.prototype.modifySeries=function(a,b,c,d,e,f){};R98.prototype.requestMoreData=function(a,b,c,d){};R98.prototype.requestMetadata=function(a,b,c){};R98.prototype.isCanCreateStudy=function(){};R98.prototype.createStudy=function(a,b,c,d,e,f,g){};
|
|
R98.prototype.removeStudy=function(a,b,c){};R98.prototype.modifyStudy=function(a,b,c,d,e){};R98.prototype.createPointset=function(a,b,c,d,e,f,g){};R98.prototype.modifyPointset=function(a,b,c,d,e){};R98.prototype.removePointset=function(a,b,c){};R98.prototype.requestMoreTickmarks=function(a,b,c,d){};
|
|
R98.prototype.requestFirstBarTime=function(a,b,c,d){};R98.prototype._invokeHandler=function(a,b){};R98.prototype._sendRequest=function(a,b){};R98.prototype._onMessage=function(a){};R98.prototype._convertTimescaleResponse=function(a){};R98.prototype._dispathNotification=function(a){};
|
|
R98.prototype._invokeNotificationHandler=function(a,b,c){};R98.prototype._notifySessions=function(a){};R98.prototype.unpack=function(a){};R98.prototype.reconnectTimeout=function(a){};R98.prototype.searchSymbolsByName=function(a){};R98.prototype._isSafari5=function(){};R98.prototype._isIE9=function(){};
|
|
R98.prototype._isIOS5=function(){};R98.prototype._getPort=function(a){};R98.prototype.getMarks=function(a,b,c,d,e){};R98.prototype.getTimescaleMarks=function(a,b,c,d,e){};TradingView.declareClassAsPureInterface(R98,"R98");TradingView.ChartSession=function(a,b){this._chartApi=a;this._sessionid="cs_"+TradingView.randomHash();this._sessionDisabled=!1;this._disableStatistics=!!b};TradingView.ChartSession.prototype.serverTimeOffset=function(){return this._chartApi._serverTimeOffset};TradingView.ChartSession.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled};
|
|
TradingView.ChartSession.prototype.disconnected=function(){var a=this;Object.keys(this).forEach(function(b){/^(s|st|symbol_)\d+$/.test(b)&&delete a[b]})};TradingView.ChartSession.prototype.initSession=function(){this._chartApi.createSession(this._sessionid,this)};TradingView.ChartSession.prototype.stopSession=function(){this._chartApi.removeSession(this._sessionid)};TradingView.ChartSession.prototype.setHandler=function(a){this._globalHandler=a};TradingView.ChartSession.prototype.sessionId=function(){return this._sessionid};
|
|
TradingView.ChartSession.prototype.connect=function(a){this._globalHandler=a;this.initSession();this._chartApi.connect()};TradingView.ChartSession.prototype.disconnect=function(){this._chartApi.disconnect()};TradingView.ChartSession.prototype.switchTimezone=function(a){this._chartApi.switchTimezone(this._sessionid,a)};TradingView.ChartSession.prototype.resolveSymbol=function(a,b,c){this._chartApi.resolveSymbol(this._sessionid,a,b,c)};
|
|
TradingView.ChartSession.prototype.createSeries=function(a,b,c,d,e,f){this._chartApi.createSeries(this._sessionid,a,b,c,d,e,f)};TradingView.ChartSession.prototype.removeSeries=function(a,b){this._chartApi.removeSeries(this._sessionid,a,b)};TradingView.ChartSession.prototype.modifySeries=function(a,b,c,d,e){this._chartApi.modifySeries(this._sessionid,a,b,c,d,e)};TradingView.ChartSession.prototype.requestMoreData=function(a,b,c){this._chartApi.requestMoreData(this._sessionid,a,b,c)};
|
|
TradingView.ChartSession.prototype.requestMetadata=function(a,b){this._chartApi.requestMetadata(this._sessionid,a,b)};TradingView.ChartSession.prototype.createStudy=function(a,b,c,d,e,f){this._chartApi.createStudy(this._sessionid,a,b,c,d,e,f)};TradingView.ChartSession.prototype.removeStudy=function(a,b){this._chartApi.removeStudy(this._sessionid,a,b)};TradingView.ChartSession.prototype.modifyStudy=function(a,b,c,d){this._chartApi.modifyStudy(this._sessionid,a,b,c,d)};
|
|
TradingView.ChartSession.prototype.createPointset=function(a,b,c,d,e,f){this._chartApi.createPointset(this._sessionid,a,b,c,d,e,f)};TradingView.ChartSession.prototype.modifyPointset=function(a,b,c,d){this._chartApi.modifyPointset(this._sessionid,a,b,c,d)};TradingView.ChartSession.prototype.removePointset=function(a,b){this._chartApi.removePointset(this._sessionid,a,b)};TradingView.ChartSession.prototype.requestMoreTickmarks=function(a,b,c){this._chartApi.requestMoreTickmarks(this._sessionid,a,b,c)};
|
|
TradingView.ChartSession.prototype.requestFirstBarTime=function(a,b,c){this._chartApi.requestFirstBarTime(this._sessionid,a,b,c)};TradingView.ChartSession.prototype.setVisibleTimeRange=function(a,b,c){this._chartApi.setVisibleTimeRange(this._sessionid,a,b,c)};TradingView.ChartSession.prototype.onMessage=function(a){switch(a.method){case "connected":this._chartApi.chartCreateSession(this._sessionid,this._disableStatistics);break;case "disconnected":this.disconnected()}this._globalHandler&&this._globalHandler(a)};
|
|
TradingView.ChartSession.prototype.disable=function(){this._sessionDisabled=!0};TradingView.TimeIndexes=function(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null};TradingView.TimeIndexes.prototype.clear=function(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null};TradingView.TimeIndexes.prototype.items=function(){return this._items};TradingView.TimeIndexes.prototype.size=function(){return this._items.length};TradingView.TimeIndexes.prototype.firstTimePointIndex=function(){return this.offsetToIndex(0)};
|
|
TradingView.TimeIndexes.prototype.lastTimePointIndex=function(){return null!==this._lastTimePointIndex&&void 0!==this._lastTimePointIndex?this._lastTimePointIndex:this._lastTimePointIndex=this.offsetToIndex(this.size()-1)};
|
|
TradingView.TimeIndexes.prototype.merge=function(a,b,c){if(0===this._items.length)return this._items=c,this._zoffset=b,[{change:"rebuild",index:0}];var d=a+this._zoffset;if(0>d){var e=Math.abs(d);this._items=Array(e).concat(this._items);this._zoffset=b;for(var f=0;f<c.length;++f)this._items[a+f+b]=c[f];return[{change:"rebuild",index:0}]}a=[];for(f=d;f<this._items.length&&f-d<c.length;++f)this._items[f]=c[f-d],a.push({change:"update",index:f-this._zoffset,value:c[f-d]});e=d+c.length;if(e>this._items.length)for(var e=
|
|
e-this._items.length,g=f;g<f+e;++g){var h=this._items.length;this._items.push(c[g-d]);a.push({change:"append",index:h-this._zoffset,value:c[g-d]})}this._zoffset=b;this._lastTimePointIndex=null;return a};TradingView.TimeIndexes.prototype.addTail=function(a,b){for(var c=b?1:0;c<a.length;c++)this._items.push(a[c]),this._lastTimePointIndex++};TradingView.TimeIndexes.prototype.valueAt=function(a){a=this.indexToOffset(a);if(void 0!==a)return this._items[a]};
|
|
TradingView.TimeIndexes.prototype.indexOf=function(a,b){if(b&&a>this._items[this._items.length-1])return this.offsetToIndex(this._items.length-1);for(var c=0;c<this._items.length&&!(a<this._items[c]);++c)if(!(a>this._items[c]))return this.offsetToIndex(c);return b?this.offsetToIndex(c):void 0};TradingView.TimeIndexes.prototype.offsetToIndex=function(a){if(0<=a&&a<this.size())return a-this._zoffset};TradingView.TimeIndexes.prototype.indexToOffset=function(a){a+=this._zoffset;if(0<=a&&a<this.size())return a};
|
|
TradingView.TimeIndexes.prototype.state=function(){var a={};a.zoffset=this._zoffset;a.items=this._items;return a};TradingView.TimeIndexes.prototype.restoreState=function(a){a&&(this._zoffset=a.zoffset,this._items=a.items,this._lastTimePointIndex=null)};
|
|
TradingView.TimeIndexes.prototype.roughTime=function(a){var b=this.valueAt(a);if(void 0===b){var c=this._items;if(!c.length||2>c.length)return;var d=this.firstTimePointIndex(),e=this.lastTimePointIndex(),c=this.valueAt(d),f=this.valueAt(e),g=(f-c)/(e-d);if(a<d)return a=(d-a)*g,c-a;a>e&&(a=(a-e)*g,b=f+a)}return b};
|
|
TradingView.TimeIndexes.prototype.roughIndex=function(a){var b=this._items;if(b.length&&!(2>b.length)){var b=this.firstTimePointIndex(),c=this.lastTimePointIndex(),d=this.valueAt(b),e=this.valueAt(c);if(a>=d&&a<=e)return this.closestIndexLeft(a);var f=(e-d)/(c-b);if(a<d)return a=Math.round((d-a)/f),b-a;if(a>e)return a=Math.round((a-e)/f),c+a}};
|
|
TradingView.TimeIndexes.prototype.closestIndexLeft=function(a){var b=this._items;if(b.length&&a===a){var c=b.length-1;if(a>=b[c])return c-this._zoffset;var d=0,e=b[d];if(!(a<e)){if(a==e)return d-this._zoffset;for(;c>d+1;){var e=d+c>>1,f=b[e];if(f>a)c=e;else if(f<a)d=e;else{if(f===a)return e-this._zoffset;return}}return d-this._zoffset}}};TradingView.PlotCache=function(){this._chunks={}};TradingView.PlotCache.CHUNK_SIZE=30;TradingView.PlotList=function(a){this._items=[];this._columns=a?a:[];this._end=this._start=0;this._shareread=!1;this._plotCaches={};for(a=0;a<this._columns.length;a++)this._plotCaches[this._columns[a]]=new TradingView.PlotCache};TradingView.PlotList.prototype.clear=function(){this._items=[];this._columns=[];this._end=this._start=0;this._shareread=!1;this._plotCaches={}};TradingView.PlotList.prototype.columns=function(){return this._columns};
|
|
TradingView.PlotList.prototype.last=function(){return this._items[this._end-this._start-1]};TradingView.PlotList.prototype.first=function(){return this._items[0]};TradingView.PlotList.prototype.firstIndex=function(){return this._start};TradingView.PlotList.prototype.lastIndex=function(){return this._end-this._start-1};TradingView.PlotList.prototype.size=function(){return this._end-this._start};TradingView.PlotList.prototype.isEmpty=function(){return 0===this.size()};
|
|
TradingView.PlotList.prototype.contains=function(a){return-1!=this._search(a)};TradingView.PlotList.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
|
|
TradingView.PlotList.prototype.add=function(a,b){if(this._shareread)return TradingView.logDebugChart("PlotList.add: readonly collection modification attempt"),!1;var c=this._createPair(a,b),d=this._search(a);if(0>d)return d=this._lowerbound(a,-1),this._items.splice(d,0,c),this._start=0,this._end=this._items.length,!0;this._items[d]=c;return!1};TradingView.SEARCH_NEAREST_LEFT=-1;TradingView.SEARCH_EXACT=0;TradingView.SEARCH_NEAREST_RIGHT=1;
|
|
TradingView.PlotList.prototype.search=function(a,b){var c=this._search(a,b);return 0>c?void 0:{index:this._indexAt(c),value:this._valueAt(c)}};TradingView.PlotList.prototype.fold=function(a,b){for(var c=b,d=this._start;d<this._end;++d)c=a(this._indexAt(d),this._valueAt(d),c);return c};TradingView.PlotList.prototype.each=function(a){for(var b=this._start;b<this._end&&!a(this._indexAt(b),this._valueAt(b));++b);};
|
|
TradingView.PlotList.prototype.reduce=function(a,b){for(var c=b,d=this._start;d<this._end;++d)c=a(c,this._indexAt(d),this._valueAt(d));return c};TradingView.PlotList.prototype.range=function(a,b){var c=new TradingView.PlotList;c._items=this._items;c._start=this._lowerbound(a);c._end=Math.min(this._lowerbound(b)+1,c._items.length);c._shareread=!0;return c};
|
|
TradingView.PlotList.prototype.minMaxOnRange2=function(a,b,c){var d=null,e=null;if(0===this._items.length)return{min:d,max:e};for(var f=this._items[0],g=0;g<c.length;g++){var h=c[g],k=a-h.offset,l=b-h.offset,k=Math.max(k,f),l=Math.min(l,f+this._items.length-1),m=Math.ceil(k/TradingView.PlotCache.CHUNK_SIZE)*TradingView.PlotCache.CHUNK_SIZE,n=Math.max(m,Math.floor(l/TradingView.PlotCache.CHUNK_SIZE)*TradingView.PlotCache.CHUNK_SIZE);this._plotCaches[h.index]||(this._plotCaches[h.index]={});for(var p=
|
|
this._plotCaches[h.index],r=k;r<=Math.min(l,m)&&r<=b;r++){var t=this._items[r-f].value,t=t[h.index];if(void 0!==t&&null!==t){if(null===d||t<d)d=t;if(null==e||t>e)e=t}}for(k=Math.max(m+1,k);k<n;k+=TradingView.PlotCache.CHUNK_SIZE)m=Math.floor(k/TradingView.PlotCache.CHUNK_SIZE),r=p[m],r||(r=this.minMaxOnRange(m*TradingView.PlotCache.CHUNK_SIZE,(m+1)*TradingView.PlotCache.CHUNK_SIZE-1,[h]),p[m]=r),null!==r.min&&(r.min<d||null===d)&&(d=r.min),null!==r.max&&(r.max>e||null===e)&&(e=r.max);for(r=n;r<=l;r++)if(t=
|
|
this._items[r-f].value,t=t[h.index],void 0!==t&&null!==t){if(null===d||t<d)d=t;if(null==e||t>e)e=t}void 0!==h.baseValue&&(d=Math.min(h.baseValue,d),e=Math.max(h.baseValue,e))}return{min:d,max:e}};
|
|
TradingView.PlotList.prototype.minMaxOnRange=function(a,b,c){for(var d=this._lowerbound(a),e=Math.min(this._lowerbound(b)+1,this._items.length),f=null,g=null,h=0;h<c.length;h++){var k=c[h],d=this._lowerbound(a-k.offset),e=Math.min(this._lowerbound(b-k.offset)+1,this._items.length);for(this._items[e-1]>b-k.offset&&(e=d);d<e;d++){var l=this._items[d].value[k.index];if(void 0!==l&&null!==l){if(null===f||l<f)f=l;if(null==g||l>g)g=l}}void 0!==k.baseValue&&(f=Math.min(k.baseValue,f),g=Math.max(k.baseValue,
|
|
g))}return{min:f,max:g}};TradingView.PlotList.prototype.merge=function(a){if(this._shareread)return TradingView.logDebugChart("PlotList.merge: shared collection modification attempt"),[];var b=[];b.earliestRow=null;for(var c=0;c<a.length;++c){for(var d=a[c],e=Math.floor(d.index/TradingView.PlotCache.CHUNK_SIZE),f=0;f<this._columns.length;f++)this._plotCaches[f]&&delete this._plotCaches[f][e];if(null===b.earliestRow||b.earliestRow>d)b.earliestRow=d;this.add(d.index,d.value)?b.push({insert:d}):b.push({update:d})}return b};
|
|
TradingView.PlotList.prototype.addTail=function(a,b){var c=0;b&&0<this._end-this._start&&(c=1,this._items[this._end-this._start-1].value=a[0].value);for(;c<a.length;++c){var d=a[c];this.add(parseInt(this.last(),10)+1,d.value)}};TradingView.PlotList.prototype._createPair=function(a,b){var c=new Number(a);c.value=b;return c};TradingView.PlotList.prototype._valueAt=function(a){return this._items[a].value};TradingView.PlotList.prototype._length=function(a){return this._items.length};
|
|
TradingView.PlotList.prototype._indexAt=function(a){return this._items[a].valueOf()};TradingView.PlotList.prototype._search=function(a,b){var c=this._bsearch(a);if(-1!=c||!b)return c;if(0>b)return c=this._lowerbound(a),c>this._start&&--c,c!=this._end&&this._indexAt(c)<a?c:-1;c=this._upperbound(a);return c!=this._end&&a<this._indexAt(c)?c:-1};TradingView.PlotList.prototype._bsearch=function(a){var b=this._lowerbound(a);return b==this._end||a<this._items[b]?-1:b};
|
|
TradingView.PlotList.prototype._lowerbound=function(a){for(var b=this._start,c=this._end-b;0<c;){var d=c>>1,e=b+d;this._items[e]<a?(b=e+1,c-=d+1):c=d}return b};TradingView.PlotList.prototype._upperbound=function(a){for(var b=this._start,c=this._end-b;0<c;){var d=c>>1,e=b+d;a<this._items[e]?c=d:(b=e+1,c-=d+1)}return b};
|
|
TradingView.PlotList.prototype.state=function(){var a={};a.columns=this._columns;a.start=this._start;a.end=this._end;a.shareread=this._shareread;a.data=[];for(var b in this._items)a.data.push({index:new Number(this._items[b]),value:this._items[b].value});return a};
|
|
TradingView.PlotList.prototype.restoreState=function(a){if(a){this._columns=a.columns;this._start=a.start;this._end=a.end;this._shareread=a.shareread;this._items=[];for(var b=0;b<a.data.length;b++){var c=new Number(a.data[b].index);c.value=a.data[b].value;this._items.push(c)}}else this.clear()};TradingView.PlotList.prototype.firstTimeIndex=function(){return this._indexAt(this._start)};TradingView.PlotList.prototype.lastTimeIndex=function(){return this._indexAt(this._end-1)};TradingView.StudyMetaInfo=function(a){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}});TradingView.merge(this,a);TradingView.merge(this,TradingView.StudyMetaInfo.parseIdString(a.id));this.name=this.id};TradingView.StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION=34;TradingView.StudyMetaInfo.FilledArea={};TradingView.StudyMetaInfo.FilledArea.TYPE_PLOTS="plot_plot";TradingView.StudyMetaInfo.FilledArea.TYPE_HLINES="hline_hline";
|
|
TradingView.StudyMetaInfo.versionOf=function(a){a="_metainfoVersion"in a&&isNumber(a._metainfoVersion)?a._metainfoVersion:0;0>a&&console.error("Metainfo format version cannot be negative: "+a);a>TradingView.StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION&&console.warn("Client doesn't support this version of metainfo format: "+a);return a};
|
|
TradingView.StudyMetaInfo.parseIdString=function(a){var b={};if(-1==a.indexOf("@"))b.shortId=a,b.packageId="tv-basicstudies",b.id=a+"@"+b.packageId,b.version=1;else{var c=a.split("@");b.shortId=c[0];c=c[1].split("-");if(3===c.length)b.packageId=c.slice(0,2).join("-"),b.id=b.shortId+"@"+b.packageId,b.version=c[2];else if(1===c.length&&"decisionbar"===c[0])b.packageId="les-"+c[0],b.id=b.shortId+"@"+b.packageId,b.version=1;else if(1===c.length)b.packageId="tv-"+c[0],b.id=b.shortId+"@"+b.packageId,b.version=
|
|
1;else throw Error("unexpected study id:"+a);}b.fullId=b.id+"-"+b.version;"tv-scripting"===b.packageId?(a=b.shortId,0===a.indexOf("Script$")?(c=a.indexOf("_"),b.productId=0<=c?a.substring(0,c):b.packageId):b.productId=b.packageId):b.productId=b.packageId;return b};TradingView.StudyMetaInfo.getPackageName=function(a){return(/^[^@]+@([^-]+-[^-]+)/.exec(a||"")||[0,"tv-basicstudies"])[1]};TradingView.StudyMetaInfo.cutFullId=function(a){return a.replace(/(@[^-]+-[^-]+).*$/,"$1")};
|
|
TradingView.StudyMetaInfo.cutDollarHash=function(a){var b=a.indexOf("$"),c=a.indexOf("@");if(-1==b)return a;b=a.substr(0,b);a=0<=c?a.substr(c):"";return b+a};TradingView.StudyMetaInfo.prototype.parseValue=function(a,b){return"bool"===a?TradingView.parseBool(b):b};TradingView.StudyMetaInfo.prototype.defaultInputs=function(){for(var a=new List,b=0;b<this.inputs.length;b++)a.append(this.inputs[b].defval);return a};
|
|
TradingView.StudyMetaInfo.prototype.state=function(){var a={},b;for(b in this)this.hasOwnProperty(b)&&(a[b]=this[b],"id"===b&&(a[b]+="-"+this.version));return a};TradingView.StudyMetaInfo.findStudyMetaInfoByDescription=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).description.toLowerCase()===b.toLowerCase())return a.item(c);throw Error("unexpected study id:"+b);}throw Error("There is no studies metainfo");};
|
|
TradingView.StudyMetaInfo.findStudyMetaInfo=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.item(c);throw Error("unexpected study id:"+b);}throw Error("There is no studies metainfo");};TradingView.StudyMetaInfo.removeStudyMetaInfo=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.removeAt(c),defaults.remove("study_"+b),!0;return!1}throw Error("There is no studies metainfo");};
|
|
TradingView.StudyMetaInfo.addStudyMetaInfo=function(a,b){var c=new TradingView.StudyMetaInfo(b);assert(!1===TradingView.StudyMetaInfo.removeStudyMetaInfo(a,c.id),"Study with id="+b.id+" already exists in the model");a.append(c);if(b.defaults){var d=TradingView.clone(b.defaults);d.precision="default";defaults.create("study_"+b.id,d)}return c};
|
|
TradingView.StudyMetaInfo.addOrReplaceStudyMetaInfo=function(a,b){var c=new TradingView.StudyMetaInfo(b);TradingView.StudyMetaInfo.removeStudyMetaInfo(a,c.id);a.append(c);if(b.defaults){var d=TradingView.clone(b.defaults);d.precision="default";defaults.createOrReplace("study_"+b.id,d)}return c};TradingView.StudyMetaInfo.sortStudiesMetainfo=function(a){a.sort(function(a,c){var d=defaults("study_"+a.id).description,e=defaults("study_"+c.id).description;return d<e?-1:d>e?1:0})};
|
|
TradingView.StudyMetaInfo.setStudyHidden=function(a,b){if(!a)throw Error("There is no studies metainfo");for(var c=0;c<a.size();++c)if(a.item(c).id===b)return a.is_hidden_study=!0;return!1};
|
|
TradingView.StudyMetaInfo.createMetaInfoStub=function(a,b){a.scriptIdPart||TVScript.createScriptIdPart();var c={isTVScriptStubToCompile:!0,id:TVScript.createScriptStudyId(a.scriptIdPart,b),scriptIdPart:a.scriptIdPart,description:a.scriptName,TVScriptSourceCode:a.scriptSource,version:b};!0===a.isTVScriptStrategy&&(c.isTVScriptStrategy=!0);return c};TradingView.StudyMetaInfo.isScriptStrategy=function(a){if(!0===a.isTVScriptStrategy)return!0;a=a.TVScriptSourceCode||a.scriptSource;return!!a&&TVScript.isStrategy(a)};
|
|
TradingView.StudyMetaInfo.replaceWithFullStudyMetaInfoAsync=function(a,b){var c=$.Deferred();if(b.isTVScriptStubToCompile){try{var d=TradingView.StudyMetaInfo.findStudyMetaInfo(a,b.id);d.isTVScriptStubToCompile||c.resolve(d)}catch(e){}A57.translateScriptAsync(b.TVScriptSourceCode,null,b.scriptIdPart,b.version).done(function(b){b=TradingView.StudyMetaInfo.addOrReplaceStudyMetaInfo(a,b);c.resolve(b)}).fail(function(d){d=A57.createScriptStub(b.TVScriptSourceCode,b.description,
|
|
b.scriptIdPart);d=TradingView.StudyMetaInfo.addOrReplaceStudyMetaInfo(a,d);c.resolve(d)})}else c.resolve(b);return c.promise()};TradingView.StudyMetaInfo.getOrderedInputIds=function(a){var b=[];a=a.inputs;for(var c=0;c<a.length;++c)b.push(a[c].id);return b};"undefined"!=typeof module&&module&&module.exports&&(module.exports=TradingView.StudyMetaInfo);TradingView.drawingState=function(){function a(a){return"cursor"===a||"arrow"===a||"dot"===a}function b(a,b){return function(b){a.inFire||(a.inFire=!0,a.fire(b),a.inFire=!1)}}var c=null,d=null,e=null,f=null,g=null,h=new WatchedValue,k=new WatchedValue,l=new WatchedValue,m=new Delegate,n=new Delegate,p=new Delegate,r=new Delegate,t=new Delegate,v=new Delegate,w=new Delegate,u=new Delegate,x=new Delegate,C=new Delegate,A=new Delegate,y=new Delegate,D=new Delegate,E=b(m),z=b(n),F=b(p),K=b(r),Q=b(t),
|
|
B=b(v),J=b(w),O=b(u),q=b(x),T=b(C),I=b(A),M=b(y),S=b(D),N=!1;return{tool:k,cursorTool:l,toolIsCursor:a,resetToCursor:function(a){!a&&c&&c.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())},init:function(){N||(k.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),k.subscribe(function(b){a(b)&&l.setValue(b)},{callWithLast:!0}),l.subscribe(function(a){a&&TVSettings.setValue("chart.cursorPreference",a)}),c=new J52("drawings"),d=new Property,e=
|
|
new Property,f=new Property,g=new Property,d.setValue(!1),e.setValue(!1),f.setValue(!1),g.setValue(!1),N=!0)},createdLineTool:m,continuedLineTool:n,cancelledLineTool:p,createLineTool:E,continueLineTool:z,cancelLineTool:F,startedMovingLineTool:r,movedLineTool:t,finishedMovingLineTool:v,startMovingLineTool:K,moveLineTool:Q,finishMovingLineTool:B,startedChangingLineTool:w,changedLineTool:u,finishedChangingLineTool:x,startChangingLineTool:J,changeLineTool:O,finishChangingLineTool:q,removedLineTool:C,
|
|
removeLineTool:T,finishedLineTool:A,finishLineTool:I,changedLineStyle:y,changeLineStyle:M,copiedLineTool:D,copyLineTool:S,properties:function(){return c},hideAllDrawings:function(){return d},hideMarksOnBars:function(){return f},lockDrawings:function(){return e},drawOnAllCharts:function(){return c.drawOnAllCharts},lockTimeAxis:function(){return g},lockTimeAxisTime:h}}();TradingView.HitTestResult=function(a,b,c){this._result=a;this._data=b;this._eraseMarker=c};TradingView.HitTestResult.MOVEPOINT_BACKGROUND=1;TradingView.HitTestResult.REGULAR=2;TradingView.HitTestResult.MOVEPOINT=3;TradingView.HitTestResult.CHANGEPOINT=4;TradingView.HitTestResult.CUSTOM=5;TradingView.HitTestResult.prototype.result=function(){return this._result};TradingView.HitTestResult.prototype.data=function(){return this._data};TradingView.HitTestResult.prototype.eraseMarker=function(){return this._eraseMarker};function DataSource(){this._zorder=0;this.m_priceScale=null;this._id=TradingView.guid();this._ownerSource=null;this._userEditEnabled=!0;this.hasAlert=new WatchedValue(!1)}DataSource.prototype.id=function(){return this._id};DataSource.prototype.uniqueId=function(){return this._id};DataSource.prototype.setId=function(a){this._id=a};DataSource.prototype.zorder=function(){return this._zorder};DataSource.prototype.setZorder=function(a){"number"==typeof a&&this._zorder!=a&&(this._zorder=a)};
|
|
DataSource.prototype.title=function(){throw Error("Implement this fun in a subclass");};DataSource.prototype.priceScale=function(){return this.m_priceScale};DataSource.prototype.setPriceScale=function(a){this.m_priceScale=a};DataSource.prototype.ownerSource=function(){return this._ownerSource};DataSource.prototype.setOwnerSource=function(a){(this._ownerSource=a)&&this.setPriceScale(a.priceScale())};DataSource.prototype.isSavedInChart=function(a){return!0};
|
|
DataSource.prototype.isSavedInStudyTemplates=function(){return!0};DataSource.prototype.isRemovedByStudyTemplates=function(){return!0};DataSource.prototype.hasContextMenu=function(){return!0};DataSource.prototype.showInObjectTree=function(){return!0};DataSource.prototype.setUserEditEnabled=function(a){this._userEditEnabled=a};DataSource.prototype.userEditEnabled=function(){return this._userEditEnabled};DataSource.prototype.isUserDeletable=function(){return this.userEditEnabled()};
|
|
DataSource.prototype.canHasAlert=function(){return!1};DataSource.prototype.properties=function(){throw Error("Implement this fun in a subclass");};DataSource.prototype.statusView=function(){return null};DataSource.prototype.dataWindowView=function(){return null};DataSource.prototype.priceAxisViews=function(a,b){return null};DataSource.prototype.updateAllViews=function(){};DataSource.prototype.paneViews=function(a){return null};
|
|
TradingView.PriceDataSource=function(a){DataSource.call(this);this._isOverlay=null;this.D0=a};inherit(TradingView.PriceDataSource,DataSource);TradingView.PriceDataSource.prototype.isNoScale=function(){return!!this._isOverlay};TradingView.PriceDataSource.prototype.base=function(){return 0};TradingView.PriceDataSource.prototype.formatter=function(){return null};TradingView.PriceDataSource.prototype.model=function(){return this.D0};
|
|
TradingView.PriceDataSource.prototype.priceRange=function(a,b){return null};function Property(a){this._listeners=new Delegate;this._childs=[];if(void 0!==a&&null!==a)if(this.isPrimitiveType(a))this._value=a;else for(var b in a)this.addProperty(b,a[b])}Property.prototype.merge=function(a){if(null!=a)if(this.isPrimitiveType(a))this._value=a;else if(Array.isArray(a))for(var b=0;b<a.length;b++)this[b]?this[b].merge(a[b]):this.addProperty(b,a[b]);else for(b in a)this[b]?this[b].merge(a[b]):this.addProperty(b,a[b])};
|
|
Property.prototype.state=function(a){var b=this._value;void 0===b&&(b={});for(var c=0;c<this._childs.length;c++){var d=this._childs[c];if(!a||-1===a.indexOf(d))if(a){for(var e=[],f=0;f<a.length;f++){var g=a[f];g.startsWith(d+".")&&e.push(g.substr(d.length+1))}b[d]=this[d].state(e)}else b[d]=this[d].state()}return b};Property.prototype.isPrimitiveType=function(a){return isNumber(a)||(new TradingView.TypeValidator(String)).check(a)||TradingView.isBoolean(a)?!0:!1};Property.prototype.value=function(){return this._value};
|
|
Property.prototype.listeners=function(){return this._listeners};Property.prototype.childCount=function(){return this._childs.length};Property.prototype.setValue=function(a,b){if(this._value!==a||b)this._value=a,this._listeners.fire(this)};Property.prototype.addProperty=function(a,b){var c=new Property(b);this[a]=c;this._childs.push(a);c.listeners().subscribe(this,Property.prototype.childChanged)};
|
|
Property.prototype.removeProperty=function(a){delete this[a];this._childs=this._childs.filter(function(b){return b!=a})};Property.prototype.addChild=function(a,b){this[a]=b;-1==$.inArray(a,this._childs)&&this._childs.push(a);b.listeners().subscribe(this,Property.prototype.childChanged)};Property.prototype.childChanged=function(a,b){this.listeners().fire(this)};Property.prototype.subscribe=function(a,b){this.listeners().subscribe(a,b)};
|
|
Property.prototype.unsubscribe=function(a,b){this.listeners().unsubscribe(a,b)};J52=function(a,b,c){this._defaultName=a;c?c=b:(c=TradingView.clone(defaults(a)),b&&TradingView.merge(c,b));Property.call(this,c);this._defaultName=a;this.listeners().subscribe(this,J52.prototype.onPropertyChanged);this._exclusions=[]};inherit(J52,Property);J52._saveDefaults=!1;
|
|
TradingView.saveDefaultProperties=function(a){J52._saveDefaults=a};J52.prototype.addExclusion=function(a){this._exclusions.push(a)};
|
|
J52.prototype.restoreFactoryDefaults=function(){var a={};this._defaultName.startsWith("study_")&&(a=TradingView.clone(TradingView.factoryDefaults("study")));var b=TradingView.clone(TradingView.factoryDefaults(this._defaultName));this._defaultName.startsWith("study_")&&b.inputs&&delete b.inputs.symbol;"linetoolicon"===this._defaultName&&(b.icon=defaults(this._defaultName).icon);~"linetooltext linetooltextabsolute linetoolnote linetoolnoteabsolute linetoolcallout linetoolballoon linetoolarrowmark linetoolarrowmarkleft linetoolarrowmarkup linetoolarrowmarkright linetoolarrowmarkdown linetoolhorzline linetoolhorzray".split(" ").indexOf(this._defaultName)&&
|
|
delete b.text;this._exclusions.forEach(function(a){delete b[a]});TradingView.merge(a,b);this.merge(a);this._defaultName.startsWith("study_")||TradingView.saveDefaults(this._defaultName,this.state(this._exclusions));this.listeners().fire(this)};J52.prototype.cleanupFactoryDefaults=function(){TradingView.saveDefaults(this._defaultName,{});this.listeners().fire(this)};
|
|
J52.prototype.onPropertyChanged=function(){J52._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()};J52.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions))};TradingView.factoryDefaults=function(a){if("undefined"==typeof TradingView.defaultProperties){var b=function(a,b,c){return{visible:c,color:b,coeff:a}};TradingView.defaultProperties={chartproperties:{timezone:"UTC",timeScale:{barSpacing:TradingView.DEFAULT_BAR_SPACING,rightOffset:TradingView.DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"#FFFECE",border:"#606090",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",vertGridProperties:{color:"#E6E6E6",
|
|
style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"#E6E6E6",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"#B7B7B7",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},overlayPropreties:{autoScale:!0,
|
|
autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",scaleSeriesOnly:!1,showSeriesLastValue:!0,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},mainSeriesProperties:{style:TradingView.Series.STYLE_CANDLES,esdShowDividends:!0,
|
|
esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"#E2745B",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,lockScale:!1,minTick:"default",extendedHours:!1,sessVis:!1,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",wickUpColor:"#737375",wickDownColor:"#737375",
|
|
barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",wickUpColor:"#737375",wickDownColor:"#737375"},haStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",wickUpColor:"#737375",wickDownColor:"#737375",barColorsOnPrevClose:!1},barStyle:{upColor:"#6ba583",
|
|
downColor:"#d75442",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"#3C78D8",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:TradingView.Series.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"#606090",color2:"#01F6F5",linecolor:"#0094FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"#6ba583",
|
|
downColor:"#d75442",borderUpColor:"#225437",borderDownColor:"#5b1a13",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",borderUpColorProjection:"#225437",borderDownColorProjection:"#5b1a13",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},pbStyle:{upColor:"#6ba583",downColor:"#d75442",borderUpColor:"#225437",borderDownColor:"#5b1a13",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",
|
|
borderUpColorProjection:"#225437",borderDownColorProjection:"#5b1a13",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"#6ba583",downColor:"#d75442",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",inputs:{source:"close",reversalAmount:1},inputInfo:{source:{name:"Source"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"#6ba583",downColor:"#d75442",upColorProjection:"#4ad6be",downColorProjection:"#d649cf",inputs:{sources:"HL",
|
|
reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}}},symbolWatermarkProperties:{color:"#555",transparency:85},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"#d75442",highlightColor:"#ffff33",hoverColor:"#f5e387",
|
|
line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"#777",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"#AAA"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"#B7B7B7",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"#F00",
|
|
lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"#F00",bodyBorderTransparency:0,bodyBackgroundColor:"#FFF",bodyBackgroundTransparency:25,bodyTextColor:"#F00",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"#F00",quantityBorderTransparency:0,quantityBackgroundColor:"#F00",quantityBackgroundTransparency:25,quantityTextColor:"#FFF",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,
|
|
quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"#F00",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"#FFF",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"#F00",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"#0071E0",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"#0071E0",bodyBorderTransparency:0,bodyBackgroundColor:"#FFF",bodyBackgroundTransparency:25,
|
|
bodyTextColor:"#0071E0",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"#0071E0",quantityBorderTransparency:0,quantityBackgroundColor:"#0071E0",quantityBackgroundTransparency:25,quantityTextColor:"#FFF",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"#0071E0",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"#FFF",reverseButtonBackgroundTransparency:25,
|
|
reverseButtonIconColor:"#0071E0",reverseButtonIconTransparency:0,closeButtonBorderColor:"#0071E0",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"#FFF",closeButtonBackgroundTransparency:25,closeButtonIconColor:"#0071E0",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"#00F",arrowTransparency:0,text:"",textColor:"#000",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,tooltip:""},
|
|
linetoolicon:{singleChartOnly:!0,clonable:!0,color:"#3D85C6",snapTo45Degrees:!0,size:40,icon:9786,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"#159980",linewidth:1,fillBackground:!1,backgroundColor:"#153899",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL},linetoolbeziercubic:{clonable:!0,linecolor:"#159980",linewidth:1,fillBackground:!1,backgroundColor:"#153899",
|
|
transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL},linetooltrendline:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,
|
|
showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltimecycles:{clonable:!0,linecolor:"#159980",linewidth:1,fillBackground:!0,backgroundColor:"#6AA84F",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"#157760",
|
|
fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"#129f5c",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#6AA84F",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL,font:"Verdana",textcolor:"#129f5c",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,
|
|
showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"#4985e7",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#153899",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL,font:"Verdana",textcolor:"#4985e7",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{clonable:!0,linecolor:"#159980",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"#FFFFFF",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#000000",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"#BADAFF",backgroundTransparency:60,drawBorder:!1,borderColor:"#667B8B"},linetoolpricerange:{clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"#FFFFFF",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#000000",
|
|
labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"#BADAFF",backgroundTransparency:60,drawBorder:!1,borderColor:"#667B8B"},linetoolriskrewardshort:{isShort:!0,clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"white",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"#FF0000",profitBackground:"#00A000",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667B8B"},
|
|
linetoolriskrewardlong:{isShort:!1,clonable:!0,linecolor:"#585858",linewidth:1,font:"Verdana",textcolor:"white",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"#FF0000",profitBackground:"#00A000",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667B8B"},linetoolarrow:{clonable:!0,linecolor:"#6F88C6",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:R47.LINEEND_NORMAL,
|
|
rightEnd:R47.LINEEND_ARROW,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolray:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,
|
|
alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolextended:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL,font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},
|
|
linetoolhorzline:{clonable:!0,linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"#157760",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,
|
|
linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"#80CCDB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"#808080",linecolor:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,
|
|
trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level3:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2},level4:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3},level5:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:5},level6:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:8},level7:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:13},level8:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:21},level9:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:34},level10:{visible:!0,color:"#0055DB",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:55},level11:{visible:!0,color:"#0055DB",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:89}},linetooltext:{clonable:!0,color:"#667B8B",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"#9BBED5",backgroundTransparency:70,drawBorder:!1,borderColor:"#667B8B",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"#667B8B",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"#9BBED5",backgroundTransparency:70,
|
|
drawBorder:!1,borderColor:"#667B8B",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"#667b8b",backgroundColor:"#fffece",borderColor:"#8c8c8c",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30,text:$.t("Comment")},linetoolbrush:{clonable:!0,linecolor:"#353535",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"#153899",transparency:50,leftEnd:R47.LINEEND_NORMAL,rightEnd:R47.LINEEND_NORMAL},
|
|
linetoolpolyline:{clonable:!0,linecolor:"#353535",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"#153899",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},
|
|
linetoolarrowmarkdown:{clonable:!0,color:"#787878",text:"",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"#ff0000"},linetoolnote:{clonable:!0,markerColor:"#2E66FF",textColor:"#000000",backgroundColor:"#FFFFFF",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"#2E66FF",textColor:"#000000",backgroundColor:"#FFFFFF",backgroundTransparency:0,text:$.t("Text"),font:"Arial",
|
|
fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"#008000"},linetoolthumbdown:{clonable:!0,color:"#FF0000"},linetoolpricelabel:{clonable:!0,color:"#667b8b",backgroundColor:"#ffffff",borderColor:"#8c8c8c",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"#153899",fillBackground:!0,backgroundColor:"#153899",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolrotatedrectangle:{clonable:!0,color:"#9800ff",fillBackground:!0,
|
|
backgroundColor:"#8e7cc3",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"#999915",fillBackground:!0,backgroundColor:"#999915",transparency:50,linewidth:1},linetoolarc:{clonable:!0,color:"#999915",fillBackground:!0,backgroundColor:"#999915",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"#1c73db",linewidth:2,sourceBackColor:"#f1f1f1",sourceTextColor:"#6e6e6e",sourceStrokeColor:"#6e6e6e",targetStrokeColor:"#2fa8ff",targetBackColor:"#0b6fde",
|
|
targetTextColor:"#ffffff",successBackground:"#36a02a",successTextColor:"#ffffff",failureBackground:"#e74545",failureTextColor:"#ffffff",intermediateBackColor:"#ead289",intermediateTextColor:"#6d4d22",transparency:10,centersColor:"#202020"},linetooltriangle:{clonable:!0,color:"#991515",fillBackground:!0,backgroundColor:"#991515",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"#FFFFFF",backgroundColor:"#991515",transparency:50,linewidth:2,fontsize:12,font:"Verdana",text:$.t("Text"),
|
|
bordercolor:"#991515",bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"#773499",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"#b4a7d6",transparency:50,showMidline:!1,midlinecolor:"#773499",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"#3d85c6",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,
|
|
color:"#ff9800",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"#6aa84f",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"#3d85c6",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"#6aa84f",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"#5091CC",clonable:!0,mode:TradingView.LineToolBarsPattern.BARS_MODE,mirrored:!1,flipped:!1},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},
|
|
showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_ORIGINAL,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},
|
|
level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:{visible:!0,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:8},level2:{visible:!0,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:4},level3:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:3},level4:{visible:!0,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff1:1,coeff2:2},level5:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:1,coeff2:1},level6:{visible:!0,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:2,coeff2:1},level7:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:3,coeff2:1},level8:{visible:!0,color:"#660099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff1:4,coeff2:1},level9:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff1:8,coeff2:1}},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:50},levels:[{width:1,color:"#808080",visible:!0},{width:1,color:"#A06B00",visible:!0},{width:1,color:"#699E00",visible:!0},{width:1,color:"#009B00",visible:!0},{width:1,color:"#009965",visible:!0},{width:1,color:"#808080",visible:!0}],fanlines:[{width:1,color:"#A500FF",visible:!1,x:8,y:1},{width:1,color:"#A50000",visible:!1,x:5,y:1},{width:1,color:"#808080",visible:!1,x:4,y:1},{width:1,
|
|
color:"#A06B00",visible:!1,x:3,y:1},{width:1,color:"#699E00",visible:!0,x:2,y:1},{width:1,color:"#009B00",visible:!0,x:1,y:1},{width:1,color:"#009965",visible:!0,x:1,y:2},{width:1,color:"#009965",visible:!1,x:1,y:3},{width:1,color:"#000099",visible:!1,x:1,y:4},{width:1,color:"#660099",visible:!1,x:1,y:5},{width:1,color:"#A500FF",visible:!1,x:1,y:8}],arcs:[{width:1,color:"#A06B00",visible:!0,x:1,y:0},{width:1,color:"#A06B00",visible:!0,x:1,y:1},{width:1,color:"#A06B00",visible:!0,x:1.5,y:0},{width:1,
|
|
color:"#699E00",visible:!0,x:2,y:0},{width:1,color:"#699E00",visible:!0,x:2,y:1},{width:1,color:"#009B00",visible:!0,x:3,y:0},{width:1,color:"#009B00",visible:!0,x:3,y:1},{width:1,color:"#009965",visible:!0,x:4,y:0},{width:1,color:"#009965",visible:!0,x:4,y:1},{width:1,color:"#000099",visible:!0,x:5,y:0},{width:1,color:"#000099",visible:!0,x:5,y:1}]},linetoolgannsquare:{clonable:!0,color:"#153899",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,
|
|
showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,hlevel1:{color:"#808080",coeff:0,visible:!0},hlevel2:{color:"#A06B00",coeff:.25,visible:!0},hlevel3:{color:"#699E00",coeff:.382,visible:!0},hlevel4:{color:"#009B00",coeff:.5,visible:!0},hlevel5:{color:"#009965",coeff:.618,visible:!0},hlevel6:{color:"#006599",coeff:.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:.25,
|
|
visible:!0},vlevel3:{color:"#699E00",coeff:.382,visible:!0},vlevel4:{color:"#009B00",coeff:.5,visible:!0},vlevel5:{color:"#009965",coeff:.618,visible:!0},vlevel6:{color:"#006599",coeff:.75,visible:!0},vlevel7:{color:"#808080",coeff:1,visible:!0}},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,
|
|
showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:{color:"#808080",coeff:0,visible:!0},hlevel2:{color:"#A06B00",coeff:.25,visible:!0},hlevel3:{color:"#699E00",coeff:.382,visible:!0},hlevel4:{color:"#009B00",coeff:.5,visible:!0},hlevel5:{color:"#009965",coeff:.618,visible:!0},hlevel6:{color:"#006599",coeff:.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:.25,visible:!0},vlevel3:{color:"#699E00",coeff:.382,
|
|
visible:!0},vlevel4:{color:"#009B00",coeff:.5,visible:!0},vlevel5:{color:"#009965",coeff:.618,visible:!0},vlevel6:{color:"#006599",coeff:.75,visible:!0},vlevel7:{color:"#808080",coeff:1,visible:!0}},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,
|
|
linestyle:CanvasEx.LINESTYLE_SOLID},level1:b(0,"#808080",!0),level2:b(.236,"#CC2828",!0),level3:b(.382,"#95CC28",!0),level4:b(.5,"#28CC28",!0),level5:b(.618,"#28CC95",!0),level6:b(.764,"#2895CC",!0),level7:b(1,"#808080",!0),level8:b(1.618,"#2828CC",!0),level9:b(2.618,"#CC2828",!0),level10:b(3.618,"#9528CC",!0),level11:b(4.236,"#CC2895",!0),level12:b(1.272,"#95CC28",!1),level13:b(1.414,"#CC2828",!1),level16:b(2,"#28CC95",!1),level14:b(2.272,"#95CC28",!1),level15:b(2.414,"#28CC28",!1),level17:b(3,"#2895CC",
|
|
!1),level18:b(3.272,"#808080",!1),level19:b(3.414,"#2828CC",!1),level20:b(4,"#CC2828",!1),level21:b(4.272,"#9528CC",!1),level22:b(4.414,"#CC2895",!1),level23:b(4.618,"#95CC28",!1),level24:b(4.764,"#28CC95",!1)},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:b(0,"#808080",!0),
|
|
level2:b(.236,"#CC2828",!0),level3:b(.382,"#95CC28",!0),level4:b(.5,"#28CC28",!0),level5:b(.618,"#28CC95",!0),level6:b(.764,"#2895CC",!0),level7:b(1,"#808080",!0),level8:b(1.618,"#2828CC",!0),level9:b(2.618,"#CC2828",!0),level10:b(3.618,"#9528CC",!0),level11:b(4.236,"#CC2895",!0),level12:b(1.272,"#95CC28",!1),level13:b(1.414,"#CC2828",!1),level16:b(2,"#28CC95",!1),level14:b(2.272,"#95CC28",!1),level15:b(2.414,"#28CC28",!1),level17:b(3,"#2895CC",!1),level18:b(3.272,"#808080",!1),level19:b(3.414,"#2828CC",
|
|
!1),level20:b(4,"#CC2828",!1),level21:b(4.272,"#9528CC",!1),level22:b(4.414,"#CC2895",!1),level23:b(4.618,"#95CC28",!1),level24:b(4.764,"#28CC95",!1)},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"#008000",color2:"#FF0000",linewidth:1,trendline:{visible:!0,color:"#808080",linestyle:CanvasEx.LINESTYLE_SOLID},level1:{color:"#808080",visible:!0,linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1}},linetool5pointspattern:{clonable:!0,color:"#CC2895",
|
|
textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"#9528FF",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#9528CC",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"#009B00",textcolor:"#FFFFFF",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"#9528FF",textcolor:"#FFFFFF",
|
|
fillBackground:!0,backgroundColor:"#9528CC",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"#45682F",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#45A82F",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},
|
|
level1:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level6:{visible:!0,color:"#808080",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level7:{visible:!1,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!1,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level9:{visible:!1,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!1,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!1,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:4.618}},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level6:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level7:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level9:{visible:!0,color:"#9528CC",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.618}},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#CC2828",linewidth:1,
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.764},level6:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:1},level7:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level9:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level10:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.618}},linetooltrendbasedfibextension:{clonable:!0,
|
|
showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:b(0,"#808080",!0),level2:b(.236,"#CC2828",!0),level3:b(.382,"#95CC28",!0),level4:b(.5,"#28CC28",!0),level5:b(.618,"#28CC95",!0),level6:b(.764,"#2895CC",!0),level7:b(1,"#808080",
|
|
!0),level8:b(1.618,"#2828CC",!0),level9:b(2.618,"#CC2828",!0),level10:b(3.618,"#9528CC",!0),level11:b(4.236,"#CC2895",!0),level12:b(1.272,"#95CC28",!1),level13:b(1.414,"#CC2828",!1),level16:b(2,"#28CC95",!1),level14:b(2.272,"#95CC28",!1),level15:b(2.414,"#28CC28",!1),level17:b(3,"#2895CC",!1),level18:b(3.272,"#808080",!1),level19:b(3.414,"#2828CC",!1),level20:b(4,"#CC2828",!1),level21:b(4.272,"#9528CC",!1),level22:b(4.414,"#CC2895",!1),level23:b(4.618,"#95CC28",!1),level24:b(4.764,"#28CC95",!1)},
|
|
linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0},level2:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level3:{visible:!1,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.5},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.382},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2},level9:{visible:!0,color:"#CC2828",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.382},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3}},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_SCHIFF,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_SCHIFF2,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:TradingView.LineToolPitchfork.STYLE_INSIDE,median:{visible:!0,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:{visible:!1,color:"#A06B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:.75},level5:{visible:!0,color:"#000099",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level6:{visible:!1,color:"#660099",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.5},level7:{visible:!1,color:"#990066",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.75},level8:{visible:!1,color:"#A50000",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2}},linetool:{frozen:!1,visible:!0}};applyDefaultsOverrides(TradingView.defaultProperties.chartproperties)}"undefined"==typeof TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",
|
|
shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"MA"}}});"undefined"==typeof TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]={description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,
|
|
plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});"undefined"==typeof TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"#00ff00",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});"undefined"==typeof TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&
|
|
(TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0}}});"undefined"==typeof TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"#538F1F",backColor:"#F0FFCC",textColor:"#000000"});
|
|
"undefined"==typeof TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:!0,"S1/R1":!0,"S2/R2":!0,"S3/R3":!0,"S4/R4":!0,"S5/R5":!0},colors:{P:"#D47928","S1/R1":"#D47928","S2/R2":"#D47928","S3/R3":"#D47928","S4/R4":"#D47928","S5/R5":"#D47928"},widths:{P:1,"S1/R1":1,"S2/R2":1,"S3/R3":1,"S4/R4":1,"S5/R5":1}}});
|
|
"undefined"==typeof TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"#56871D",linewidth:2});"undefined"==typeof TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:{visible:!1,color:"#ff0000"},level1:{visible:!1,color:"#008000"},level2:{visible:!1,color:"#0000ff"},level3:{visible:!1,color:"#ff00ff"},level4:{visible:!0,
|
|
color:"#0080ff"},level5:{visible:!0,color:"#ff0000"},level6:{visible:!0,color:"#008000"},level7:{visible:!0,color:"#0000ff"},level8:{visible:!0,color:"#ff00ff"}});"undefined"==typeof TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},
|
|
baseLine:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"#991515",transparency:70}});"undefined"==typeof TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"#0000FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"#0000FF",
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"#FF0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}});"undefined"==typeof TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"});"undefined"==typeof TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(TradingView.defaultProperties["study_Overlay@tv-basicstudies"]={style:TradingView.Series.STYLE_BARS,
|
|
showPriceLine:!1,minTick:"default",candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375",barColorsOnPrevClose:!1},barStyle:{upColor:"#6ba583",downColor:"#d75442",barColorsOnPrevClose:!1,
|
|
dontDrawOpen:!1},lineStyle:{color:"#0303F7",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:TradingView.Series.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"#606090",color2:"#01F6F5",linecolor:"#0094FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},styles:{open:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"open"},high:{visible:!0,color:"#ff0000",
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"high"},low:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"low"},close:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,title:"close"}}});a=a.split(".");for(var b=TradingView.defaultProperties,c=0;c<a.length;c++)b&&
|
|
(b=b[a[c]]);return b?TradingView.clone(b):{}};function applyDefaultsOverrides(a,b,c){function d(a,c,e){var f=c.split(".");c=f[0];b&&b[c]&&(c=b[c]);if(!a.hasOwnProperty(c))throw"illegal path";1<f.length?(f=f.splice(1).join("."),d(a[c],f,e)):a[c]&&a[c].setValue?a[c].setValue(e):a[c]=e}if("undefined"!=typeof __defaultsOverrides&&__defaultsOverrides)for(var e in __defaultsOverrides)try{d(a,e,__defaultsOverrides[e])}catch(f){"undefined"!=typeof c&&c||console.warn("Path `"+e+"` does not exist.")}}
|
|
function defaults(a,b){return b?_defaultsUpdated(a,b):_defaultsAsIs(a)}function _defaultsAsIs(a){var b=TradingView.factoryDefaults(a);window._UNIT_TESTS||(a=TradingView.clone(TVSettings.getJSON(a,null)))&&TradingView.merge(b,a);return b}
|
|
function _defaultsUpdated(a,b){var c=TradingView.factoryDefaults(a);if(!window._UNIT_TESTS){var d=TradingView.clone(TVSettings.getJSON(a,null));a.startsWith("study_")&&d&&A0.isVersionHead(d.version)&&(d=b.updateStudyState(d,d));TradingView.merge(c,d)}return c}TradingView.saveDefaults=function(a,b){TVSettings.setJSON(a,b)};
|
|
defaults.create=function(a,b){if(b){var c=TradingView.StudyMetaInfo.parseIdString(a),d=TradingView.factoryDefaults(c.id);TradingView.defaultProperties[c.id]=$.extend(b,d)}};defaults.createOrReplace=function(a,b){if(b){var c=TradingView.StudyMetaInfo.parseIdString(a);TradingView.defaultProperties[c.id]=b}};defaults.remove=function(a){TradingView.defaultProperties[a]=void 0};TradingView.PriceFormatter=function(a,b,c,d){b||(b=1);TradingView.isInteger(a)||(a=100);if(0>a)throw new TypeError("invalid base");this._priceScale=a;this._minMove=b;this._minMove2=d;0<d&&2!==d&&4!==d?TradingView.logDebugChart("invalid minmove2"):(this._fractional=c,this.calculateDecimal())};TradingView.PriceFormatter.prototype.isFractional=function(){return this._fractional};TradingView.PriceFormatter.prototype.decimalSign=".";TradingView.PriceFormatter.prototype.decimalSignFractional="'";
|
|
TradingView.PriceFormatter.prototype.southandDelimeter="`";TradingView.PriceFormatter.prototype.fullPrecision=!1;TradingView.PriceFormatter.prototype.state=function(){return{minMove:this._minMove,minMove2:this._minMove2,fractional:this._fractional,fractionalLength:this._fractionalLength}};TradingView.PriceFormatter.prototype.calculateDecimal=function(){this._fractionalLength=0;if(0<this._priceScale&&0<this._minMove){var a=this._priceScale;for(this._minMove2&&(a/=this._minMove2);1<a;)a/=10,this._fractionalLength++}};
|
|
TradingView.numberToStringWithLeadingZero=function(a,b){if(!isNumber(a))return"n/a";if(!TradingView.isInteger(b))throw new TypeError("invalid length");if(0>b||16<b)throw new TypeError("invalid length");return 0===b?a.toString():("0000000000000000"+a.toString()).right(b)};TradingView.PriceFormatter.prototype.format=function(a,b,c){var d="";0>a?(d=!0===b?"\u2212":"-",a=-a):a&&!0===b&&(d="+");return this._fractional?d+this.formatAsFractional(a,c):d+this.formatAsDecimal(a,c)};
|
|
TradingView.PriceFormatter.prototype._removeEndingZeros=function(a,b){for(var c=0;c<b;c++)if("0"==a[a.length-1])a=a.substr(0,a.length-1);else break;return a};
|
|
TradingView.PriceFormatter.prototype.formatAsDecimal=function(a,b){var c;b=b||0;c=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,b)*this._priceScale/this._minMove;var d=Math.floor(a),e=+(Math.round(a*c)-d*c).toFixed(this._fractionalLength);e>=c&&(e-=c,d+=1);var f="";1!==c&&(f=this.decimalSign+TradingView.numberToStringWithLeadingZero(e.toFixed(this._fractionalLength)*this._minMove,this._fractionalLength+b),f=this._removeEndingZeros(f,b));return d.toString()+f};
|
|
TradingView.PriceFormatter.prototype.formatAsFractional=function(a,b){var c=this._priceScale/this._minMove,d=Math.floor(a),e=b?Math.floor(a*c)-d*c:Math.round(a*c)-d*c;e===c&&(e=0,d+=1);var f="";b&&(f=Math.round((a-d-e/c)*c*Math.pow(10,b)),f=TradingView.numberToStringWithLeadingZero(f,b),f=this._removeEndingZeros(f,b));c="";if(this._minMove2)var c=["0","5"],g=["0","2","5","7"],h=e%this._minMove2,e=(e-h)/this._minMove2,c=TradingView.numberToStringWithLeadingZero(e,this._fractionalLength)+this.decimalSignFractional+
|
|
(2===this._minMove2?c[h]:g[h]);else c=TradingView.numberToStringWithLeadingZero(e*this._minMove,this._fractionalLength);return d.toString()+this.decimalSignFractional+c+f};TradingView.PriceFormatter.prototype._parseAsDecimal=function(a){var b=(new RegExp(/^[0-9]+$/)).exec(a);return b||(b=(new RegExp("^[0-9]+\\"+TradingView.PriceFormatter.prototype.decimalSign+"[0-9]+$")).exec(a))?(a=parseFloat(a),{res:!0,suggest:this.format(a),price:a}):{res:!1,error:"not a number"}};
|
|
TradingView.PriceFormatter.prototype._patchFractPart=function(a,b){var c={0:0,5:1},d={0:0,2:1,5:2,7:3};return 2==b?void 0===c[a]?-1:c[a]:4==b?void 0===d[a]?-1:d[a]:a};
|
|
TradingView.PriceFormatter.prototype._parseAsSingleFractional=function(a){var b=(new RegExp(/^[0-9]+$/)).exec(a);if(b)return b=parseFloat(a),{res:!0,suggest:this.format(b),price:b};if(b=(new RegExp("^([0-9]+)\\"+this.decimalSignFractional+"([0-9]+)$")).exec(a)){a=parseInt(b[1]);var c=this._priceScale,b=this._patchFractPart(parseInt(b[2]),c);if(b>=c||0>b)return{res:!1,error:"fraction part is invalid"};b=a+b/c;return{res:!0,suggest:this.format(b),price:b}}return{res:!1,error:"not a number"}};
|
|
TradingView.PriceFormatter.prototype._parseAsDoubleFractional=function(a){var b=(new RegExp(/^[0-9]+$/)).exec(a);if(b)return b=parseFloat(a),{res:!0,suggest:this.format(b),price:b};if(b=(new RegExp("^([0-9]+)\\"+this.decimalSignFractional+"([0-9]+)\\"+this.decimalSignFractional+"([0-9]+)$")).exec(a)){a=parseInt(b[1]);var c=this._priceScale/this._minMove2,d=this._minMove2,e=this._patchFractPart(parseInt(b[2]),c),b=this._patchFractPart(parseInt(b[3]),d);if(e>=c||0>e)return{res:!1,error:"fraction part is invalid"};
|
|
if(b>=d||0>b)return{res:!1,error:"second fraction part is invalid"};b=a+e/c+b/(c*d);return{res:!0,suggest:this.format(b),price:b}}return{res:!1,error:"not a number"}};TradingView.PriceFormatter.prototype.parse=function(a){return this._fractional?this._minMove2?this._parseAsDoubleFractional(a):this._parseAsSingleFractional(a):this._parseAsDecimal(a)};TradingView.PercentageFormatter=function(){TradingView.PriceFormatter.call(this,100)};inherit(TradingView.PercentageFormatter,TradingView.PriceFormatter);
|
|
TradingView.PercentageFormatter.prototype.state=function(){TradingView.PriceFormatter.prototype.state.call(this).percent=!0};TradingView.PercentageFormatter.prototype.format=function(a,b){return TradingView.PriceFormatter.prototype.format.call(this,a,b)+"%"};TradingView.DateFormatter=function(){};
|
|
TradingView.DateFormatter.prototype.format=function(a){return TradingView.numberToStringWithLeadingZero(a.getUTCFullYear(),4)+"-"+TradingView.numberToStringWithLeadingZero(a.getUTCMonth()+1,2)+"-"+TradingView.numberToStringWithLeadingZero(a.getUTCDate(),2)};TradingView.TimeFormatter=function(a){this._format_str=a||"%h:%m:%s"};
|
|
TradingView.TimeFormatter.prototype.format=function(a){return this._format_str.replace("%h",TradingView.numberToStringWithLeadingZero(a.getUTCHours(),2)).replace("%m",TradingView.numberToStringWithLeadingZero(a.getUTCMinutes(),2)).replace("%s",TradingView.numberToStringWithLeadingZero(a.getUTCSeconds(),2))};TradingView.DateTimeFormatter=function(a){this._dwm=a};
|
|
TradingView.DateTimeFormatter.prototype.format=function(a){var b=(new TradingView.DateFormatter).format(a);this._dwm||(b+=" "+(new TradingView.TimeFormatter).format(a));return b};TradingView.VolumeFormatter=function(a){this._precision=a;this._fractionalValues=0<a};
|
|
TradingView.VolumeFormatter.prototype.format=function(a){function b(a){return c._fractionalValues?(a.toFixed(c._precision)+"").replace(/\.?0+$/,""):a}if(!isNumber(a))return"---";var c=this,d="";0>a&&(d="-",a=-a);if(1E100<=a)return"N/A";if(!this._fractionalValues||995<=a)a=Math.round(a);if(995>a)return d+b(a);if(999995>a)return d+b(a/1E3)+"K";if(999999995>a)return a=1E3*Math.round(a/1E3),d+b(a/1E6)+"M";a=1E6*Math.round(a/1E6);return d+b(a/1E9)+"B"};TradingView.TimeSpanFormatter=function(){};
|
|
TradingView.TimeSpanFormatter.prototype.format=function(a){var b=0>a;a=Math.abs(a);var c=Math.floor(a/86400);a-=86400*c;var d=Math.floor(a/3600);a-=3600*d;var e=Math.floor(a/60);a-=60*e;var f="";c&&(f+=c+" "+$.t("d",{context:"dates"})+" ");d&&(f+=d+" "+$.t("h",{context:"dates"})+" ");e&&(f+=e+" "+$.t("m",{context:"dates"})+" ");a&&(f+=a+" "+$.t("s",{context:"dates"})+" ");b&&(f="-"+f);return f.trimmed()};TradingView.PriceColorer=function(){this._prev=null};
|
|
TradingView.PriceColorer.formatSign=function(a){return 0===a?"#5A5D66":0<a?"#27AC66":"#DA563E"};TradingView.PriceColorer.formatDiff=function(a,b){TradingView.PriceColorer.signFormat(b-a)};TradingView.PriceColorer.prototype.format=function(a){try{return null===this._prev?TradingView.PriceColorer.formatSign(a):TradingView.PriceColorer.formatDiff(this._prev,a)}finally{this._prev=a}};TradingView.FormattedLabelsCache=function(a,b){this._formatter=a;this._maxSize=b||50;this._actualSize=0;this._cache={};this._oldestTick=this._usageTick=1;this._tick2Labels={}};
|
|
TradingView.FormattedLabelsCache.prototype.format=function(a){if(this._cache[a])return this._cache[a].string;if(this._actualSize==this._maxSize){var b=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick];delete this._cache[b];this._oldestTick++;this._actualSize--}b=this._formatter(a);this._cache[a]={string:b,tick:this._usageTick};this._tick2Labels[this._usageTick]=a;this._actualSize++;this._usageTick++;return b};TradingView.AbstractBarColorer=function(){this.backColorers=[]};TradingView.AbstractBarColorer.prototype.barStyle=function(a,b,c){for(var d={},e=this.backColorers.length-1;0<=e;e--)this.backColorers[e].applyBarStyle(a,b,d,c);this.applyBarStyle(a,b,d,c);return d};TradingView.AbstractBarColorer.prototype.pushBackBarColorer=function(a){this.backColorers.push(a)};
|
|
TradingView.AbstractBarColorer.prototype.applyBarStyle=function(a,b,c){throw Error("This function is supposed to be reimplemented in a subclass");};TradingView.SeriesBarColorer=function(a){TradingView.AbstractBarColorer.call(this);this._series=a};inherit(TradingView.SeriesBarColorer,TradingView.AbstractBarColorer);
|
|
TradingView.SeriesBarColorer.prototype.applyBarStyle=function(a,b,c,d){c||(c={});c.barColor=null;c.barBorderColor=null;c.barWickColor=null;c.isBarHollow=null;c.isBarUp=null;c.upColor=null;c.downColor=null;c.isTwoColorBar=null;var e=this._series.properties();switch(e.style.value()){case TradingView.Series.STYLE_LINE:c.barColor=e.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:c.barColor=e.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:var f=e.barStyle.upColor.value(),
|
|
g=e.barStyle.downColor.value(),h=f,k=g,l=this.findBar(a,!1,d);e.barStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,!1,d),c.barColor=b[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?f:g,c.barBorderColor=b[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?h:k):(c.barColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?f:g,c.barBorderColor=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?h:k);break;case TradingView.Series.STYLE_CANDLES:var f=e.candleStyle.upColor.value(),g=e.candleStyle.downColor.value(),
|
|
h=e.candleStyle.borderUpColor?e.candleStyle.borderUpColor.value():e.candleStyle.borderColor.value(),k=e.candleStyle.borderDownColor?e.candleStyle.borderDownColor.value():e.candleStyle.borderColor.value(),m=e.candleStyle.wickUpColor?e.candleStyle.wickUpColor.value():e.candleStyle.wickColor.value(),n=e.candleStyle.wickDownColor?e.candleStyle.wickDownColor.value():e.candleStyle.wickColor.value(),l=this.findBar(a,!1,d);e.candleStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,!1,d),l=b[TradingView.CLOSE_PLOT]<=
|
|
l[TradingView.CLOSE_PLOT]):l=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT];c.barColor=l?f:g;c.barBorderColor=l?h:k;c.barWickColor=l?m:n;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:f=e.hollowCandleStyle.upColor.value();g=e.hollowCandleStyle.downColor.value();h=e.hollowCandleStyle.borderUpColor?e.hollowCandleStyle.borderUpColor.value():e.hollowCandleStyle.borderColor.value();k=e.hollowCandleStyle.borderDownColor?e.hollowCandleStyle.borderDownColor.value():e.hollowCandleStyle.borderColor.value();
|
|
m=e.hollowCandleStyle.wickUpColor?e.hollowCandleStyle.wickUpColor.value():e.hollowCandleStyle.wickColor.value();n=e.hollowCandleStyle.wickDownColor?e.hollowCandleStyle.wickDownColor.value():e.hollowCandleStyle.wickColor.value();l=this.findBar(a,!1,d);b=this.findPrevBar(a,!1,d);b[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?(c.barColor=f,c.barBorderColor=h,c.barWickColor=m):(c.barColor=g,c.barBorderColor=k,c.barWickColor=n);c.isBarHollow=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?!0:
|
|
!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:f=e.haStyle.upColor.value();g=e.haStyle.downColor.value();h=e.haStyle.borderUpColor.value();k=e.haStyle.borderDownColor.value();m=e.haStyle.wickUpColor.value();n=e.haStyle.wickDownColor.value();l=this.findBar(a,b,d);e.haStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,b,d),l=b[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]):l=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT];c.barColor=l?f:g;c.barBorderColor=l?h:k;c.barWickColor=l?m:
|
|
n;break;case TradingView.Series.STYLE_RENKO:l=this.findBar(a,b,d);l=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT];f=b?e.renkoStyle.upColorProjection.value():e.renkoStyle.upColor.value();g=b?e.renkoStyle.downColorProjection.value():e.renkoStyle.downColor.value();h=b?e.renkoStyle.borderUpColorProjection.value():e.renkoStyle.borderUpColor.value();k=b?e.renkoStyle.borderDownColorProjection.value():e.renkoStyle.borderDownColor.value();c.barColor=l?f:g;c.barBorderColor=l?h:k;c.isBarUp=l;break;case TradingView.Series.STYLE_PB:l=
|
|
this.findBar(a,b,d);l=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT];f=b?e.pbStyle.upColorProjection.value():e.pbStyle.upColor.value();g=b?e.pbStyle.downColorProjection.value():e.pbStyle.downColor.value();h=b?e.pbStyle.borderUpColorProjection.value():e.pbStyle.borderUpColor.value();k=b?e.pbStyle.borderDownColorProjection.value():e.pbStyle.borderDownColor.value();c.barColor=l?f:g;c.barBorderColor=l?h:k;c.isBarUp=l;break;case TradingView.Series.STYLE_KAGI:c.upColor=b?e.kagiStyle.upColorProjection.value():
|
|
e.kagiStyle.upColor.value();c.downColor=b?e.kagiStyle.downColorProjection.value():e.kagiStyle.downColor.value();f=null;l=this.findBar(a,b,d);l[TradingView.LOW_PLOT]<l[TradingView.ADT_PLOT]&&l[TradingView.ADT_PLOT]<l[TradingView.HIGH_PLOT]?(f=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT],c.isTwoColorBar=!0):(f=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?l[TradingView.OPEN_PLOT]==l[TradingView.ADT_PLOT]?!0:!1:l[TradingView.OPEN_PLOT]==l[TradingView.ADT_PLOT]?!1:!0,c.isTwoColorBar=!1);
|
|
c.barColor=f?c.upColor:c.downColor;c.isBarUp=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:l=this.findBar(a,b,d),l=0<l[TradingView.ADT_PLOT],f=b?e.pnfStyle.upColorProjection.value():e.pnfStyle.upColor.value(),g=b?e.pnfStyle.downColorProjection.value():e.pnfStyle.downColor.value(),c.isBarUp=l,c.barColor=l?f:g}return c};TradingView.SeriesBarColorer.prototype.getSeriesBars=function(a){return a?this._series.nsBars():this._series.bars()};
|
|
TradingView.SeriesBarColorer.prototype._findBarFieldValue=function(a,b,c){a=this.getSeriesBars(c).valueAt(a);if(void 0!==a)return a[b]};TradingView.SeriesBarColorer.prototype.findBar=function(a,b,c){return c?c.value:this.getSeriesBars(b).valueAt(a)||[]};TradingView.SeriesBarColorer.prototype.findPrevBar=function(a,b,c){if(c)return c.previousValue||[];a=this._series.bars()._search(a,TradingView.SEARCH_EXACT);return 0<a?this._series.bars()._valueAt(a-1):[]};
|
|
TradingView.StudyBarColorer=function(a,b){TradingView.AbstractBarColorer.call(this);this.D1=a;this._plotIndex=b};inherit(TradingView.StudyBarColorer,TradingView.AbstractBarColorer);
|
|
TradingView.StudyBarColorer.prototype.applyBarStyle=function(a,b,c){c||(c={});if(b)return c;b=this.D1.properties();if(!b.visible.value())return c;var d=this.D1.metaInfo(),e=this.D1.data();if(!e||0===e.size())return c;var f=this.D1.offset(d.plots[this._plotIndex].id);a=e.valueAt(a-f);if(!a)return c;a=a[this._plotIndex+1];if(null==a)return c;a=Math.round(a);e=d.plots[this._plotIndex].palette;b=b.palettes[e].colors[d.palettes[e].valToIndex?d.palettes[e].valToIndex[a]:a].color.value();
|
|
c.barColor=b;c.upColor=b.color;c.downColor=b.color;return c};function BarsRange(a,b){null===a||TradingView.isInteger(a)?null===b||TradingView.isInteger(b)?(this.m_firstBar=a,this.m_lastBar=b):TradingView.logDebugChart("BarsRange: incorrect lastBar"):TradingView.logDebugChart("BarsRange: incorrect firstBar")}BarsRange.prototype.isEmpty=function(){return null===this.m_firstBar||null===this.m_lastBar};BarsRange.prototype.clone=function(){return new BarsRange(this.m_firstBar,this.m_lastBar)};BarsRange.prototype.firstBar=function(){return this.m_firstBar};
|
|
BarsRange.prototype.lastBar=function(){return this.m_lastBar};BarsRange.prototype.count=function(){return this.m_lastBar-this.m_firstBar+1};BarsRange.prototype.resizeRight=function(a){!TradingView.isInteger(a)||0>a?TradingView.logDebugChart("BarsRange: incorrect newWidth"):this.m_firstBar=this.m_lastBar-a+1};BarsRange.prototype.shift=function(a){isNumber(a)?(this.m_firstBar=Math.round(this.m_firstBar+a),this.m_lastBar=Math.round(this.m_lastBar+a)):TradingView.logDebugChart("BarsRange.shift: incorrect coeff")};
|
|
BarsRange.prototype.contains=function(a){return this.m_firstBar<=a&&this.m_lastBar>=a};A47=function(a,b,c){this._magnetProperty=a;this._timeScale=b};
|
|
A47.prototype.align=function(a,b,c){var d=c.defaultPriceScale(),e=d.priceToCoordinate(a);if(!this._magnetProperty.value())return a;d=d.D19();c=null;for(var f=0;f<d.length;f++)if(d[f]instanceof TradingView.Series){c=d[f];break}if(c&&(d=c.bars(),d.contains(b)&&(b=d.valueAt(b),b=[b[TradingView.OPEN_PLOT],b[TradingView.HIGH_PLOT],b[TradingView.LOW_PLOT],b[TradingView.CLOSE_PLOT]],d=c.priceScale(),!d.isEmpty()))){var g=[];if(d.isPercent())for(c=c.firstValue(),f=0;f<b.length;f++)b[f]=
|
|
d.priceRange().convertToPercent(b[f],c);for(f=0;f<b.length;f++)g.push({y:d.priceToCoordinate(b[f]),price:b[f]});g.sort(function(a,b){var c=Math.abs(a.y-e),d=Math.abs(b.y-e);return c-d});c=g[0];50>Math.abs(c.y-e)&&(a=c.price)}return a};A77=function(){function a(){if(c){var a=c;c=null;a.isEmpty()||b(a)}}function b(a){c?c.addCommand(a):(e.clear(),d.push(a))}var c=null,d=new UndoStack,e=new UndoStack;return{beginUndoMacro:function(b){c&&a();c=new TradingView.UndoMacroCommand(b)},endUndoMacro:a,undo:function(){if(d.isEmpty())return!1;var a=d.pop();a.undo();e.push(a);return!0},redo:function(){if(e.isEmpty())return!1;var a=e.pop();a.redo();d.push(a);return!0},pushUndoCommand:b,createUndoCheckpoint:function(){return{lastActualCommand:d.isEmpty()?
|
|
null:d.head()}},undoToCheckpoint:function(a){for(;!d.isEmpty()&&a.lastActualCommand!==d.head();)d.pop().undo();e.clear()},undoStack:function(){return d},redoStack:function(){return e},clearStack:function(){d.clear();e.clear()}}}();A77.setChartLayout=function(a,b){if(a.layout.value()===b)return!1;var c=new TradingView.SetChartLayoutCommand(a,b);c.redo();this.pushUndoCommand(c)};
|
|
TradingView.SetChartLayoutCommand=function(a,b){UndoCommand.call(this,"Change Chart Layout to "+A8.LayoutTemplates[b].title);this.D5=a;this._newLayoutId=b;this._oldLayoutId=a.layout.value()};inherit(TradingView.SetChartLayoutCommand,UndoCommand);TradingView.SetChartLayoutCommand.prototype.redo=function(){this.D5.layout.setValue(this._newLayoutId)};TradingView.SetChartLayoutCommand.prototype.undo=function(){this.D5.layout.setValue(this._oldLayoutId)};
|
|
R78=function(a,b,c,d,e,f,g,h){this.D4=h;this.m_model=new TradingView.ChartModel(a,b,c,d,e,f,g,this,!!h._containsData);this.m_undoStack=new UndoStack;this.m_redoStack=new UndoStack;this.m_zoomStack=new UndoStack;this._onSimpleZoomIn=new Delegate;this._onSimpleZoomOut=new Delegate};inherit(R78,EventEmitter);R78.prototype.version=function(){return this.m_model._version};
|
|
R78.prototype.onData=function(a){switch(a.method){case "timescale_update":a=a.params,this.m_model.updateTimeScale(a.index,a.zoffset,a.changes,a.marks,a.clear)}};R78.prototype.paneForSource=function(a){return this.m_model.paneForSource(a)};R78.prototype.createPane=function(a){return this.m_model.createPane(a)};R78.prototype.dumpViews=function(){return this.m_model.dumpViews()};
|
|
R78.prototype.readOnly=function(){return this.m_model.readOnly()};R78.prototype.restart=function(){this.m_model.restart()};R78.prototype.disconnect=function(){this.m_model.disconnect()};R78.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()};R78.prototype.studyVersioning=function(){return this.m_model.studyVersioning()};
|
|
R78.prototype.chartModel=function(){return this.m_model};R78.prototype.undoStack=A77.undoStack;R78.prototype.redoStack=A77.redoStack;R78.prototype.undo=A77.undo;R78.prototype.redo=A77.redo;R78.prototype.pushUndoCommand=A77.pushUndoCommand;
|
|
R78.prototype.startScalePrice=function(a,b,c){this.pushUndoCommand(new R89(this.m_model,a,b,b.state()));this.chartModel().startScalePrice(a,b,c)};R78.prototype.scalePriceTo=function(a,b,c){this.chartModel().scalePriceTo(a,b,c)};R78.prototype.endScalePrice=function(a,b){this.chartModel().endScalePrice(a,b)};
|
|
R78.prototype.startScrollPrice=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollState=b.state(),this._initialPriceScrollPos=c,this.chartModel().startScrollPrice(a,b,c))};
|
|
R78.prototype.scrollPriceTo=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollPos&&20<Math.abs(this._initialPriceScrollPos-c)&&(this.pushUndoCommand(new R89(this.m_model,a,b,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(a,b,c))};
|
|
R78.prototype.endScrollPrice=function(a,b){b.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(a,b))};R78.prototype.setPriceAutoScale=function(a,b,c){this.pushUndoCommand(new R89(this.m_model,a,b,b.state()));this.chartModel().setPriceAutoScale(a,b,c)};
|
|
R78.prototype.resetPriceScale=function(a,b){this.pushUndoCommand(new R89(this.m_model,a,b,b.state()));this.chartModel().resetPriceScale(a,b)};R78.prototype.startScaleTime=function(a){this.pushUndoCommand(new R94(this.m_model,this.m_model.timeScale().state(),"scale time"));this.chartModel().startScaleTime(a)};R78.prototype.scaleTimeTo=function(a){this.chartModel().scaleTimeTo(a)};
|
|
R78.prototype.endScaleTime=function(){this.chartModel().endScaleTime()};R78.prototype.startScrollTime=function(a){this._initialTimeScrollState=this.m_model.timeScale().state();this._initialTimeScrollPos=a;this.chartModel().startScrollTime(a)};
|
|
R78.prototype.scrollTimeTo=function(a){this._initialTimeScrollPos&&20<Math.abs(a-this._initialTimeScrollPos)&&(this.pushUndoCommand(new R94(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState);this.chartModel().scrollTimeTo(a)};R78.prototype.endScrollTime=function(){this.chartModel().endScrollTime();delete this._initialTimeScrollPos;delete this._initialTimeScrollState};
|
|
R78.prototype.resetTimeScale=function(){this.pushUndoCommand(new R94(this.m_model,this.m_model.timeScale().state()));this.chartModel().resetTimeScale()};R78.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()};R78.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()};R78.prototype.setWidth=function(a){this.m_model.setWidth(a)};
|
|
R78.prototype.setPaneHeight=function(a,b){this.m_model.setPaneHeight(a,b)};R78.prototype.gridSource=function(){return this.m_model.gridSource()};R78.prototype.watermarkSource=function(){return this.m_model.watermarkSource()};R78.prototype.addAlertsSource=function(a){return this.m_model.addAlertsSource(a)};R78.prototype.alertsSources=function(){return this.m_model.alertsSources()};
|
|
R78.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()};R78.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()};R78.prototype.crossHairSource=function(){return this.m_model.crossHairSource()};R78.prototype.model=function(){return this.m_model};R78.prototype.mainSeries=function(){return this.m_model.m_mainSeries};
|
|
R78.prototype.panes=function(){return this.m_model.m_panes};R78.prototype.timeScale=function(){return this.m_model.timeScale()};R78.prototype.setSelectedSource=function(a,b){this.m_model.setSelectedSource(a,b)};R78.prototype.setHoveredSource=function(a,b){this.m_model.setHoveredSource(a,b)};R78.prototype.selectedSource=function(){return this.m_model.selectedSource()};
|
|
R78.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()};R78.prototype.hoveredSource=function(){return this.m_model.hoveredSource()};R78.prototype.getActiveStrategySource=function(){return this.m_model.getActiveStrategySource()};R78.prototype.D20=function(a){this.m_model.D20(a)};
|
|
R78.prototype.setCurrentPosition=function(a,b,c,d){this.m_model.setCurrentPosition(a,b,c,d)};R78.prototype.modifySeries=function(a,b,c){a=new R86(this.m_model,a,b,c);this.pushUndoCommand(a);a.redo()};
|
|
R78.prototype.insertStudy=function(a,b,c){if(this.model()._chartApi._chartApi.isCanCreateStudy())if(TradingView.D18("indicators_limit")&&!user.is_pro&&this.m_model.countUserStudies()>=A7.FREE_STUDY_LIMIT)A83.showGoProDialog({feature:"studyLimit"});else return a=new TradingView.InsertStudyCommand(this.m_model,a,b,c),this.pushUndoCommand(a),a.redo();else A83.showNotice("Error","Exceeded the limit of studies")};
|
|
R78.prototype.setProperty=function(a,b,c){a&&a.value()!==b&&(a=new TradingView.SetPropertyCommand(a,b,c,this.m_model),this.pushUndoCommand(a),a.redo(),this.emitEvent("setProperty"))};R78.prototype.setPercentProperty=function(a,b,c,d){a.value()!==b&&(a=new TradingView.SetPercentagePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
|
|
R78.prototype.setLogProperty=function(a,b,c,d){a.value()!==b&&(a=new TradingView.SetLogPropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};R78.prototype.setAutoScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new TradingView.SetAutoScalePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
|
|
R78.prototype.setChartStyleProperty=function(a,b,c){a.value()!==b&&(a=new TradingView.SetChartStyleCommand(a,b,this.mainSeries(),c,this.m_model,this.D4),this.pushUndoCommand(a),a.redo(),this.emitEvent("setChartStyleProperty"))};R78.prototype.setLockScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new TradingView.SetLockScaleCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
|
|
R78.prototype.setScreenChartProperty=function(a,b,c,d,e){if(e||a.value()!==b)a=new R92(d,a,b,c,e),this.pushUndoCommand(a),a.redo()};R78.prototype.beginUndoMacro=A77.beginUndoMacro;R78.prototype.endUndoMacro=A77.endUndoMacro;R78.prototype.createUndoCheckpoint=A77.createUndoCheckpoint;
|
|
R78.prototype.undoToCheckpoint=A77.undoToCheckpoint;R78.prototype.removeSource=function(a){if(a.isUserDeletable()){var b=new TradingView.RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};
|
|
R78.prototype.removeSelectedSource=function(){var a=this.m_model.selectedSource();if(a&&a.isUserDeletable()){this.setSelectedSource(null);var b=new TradingView.RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};R78.prototype.move=function(a,b,c){var d=this.m_model.paneForSource(a);b=new R88(this.m_model,a,d,b,c);this.pushUndoCommand(b);b.redo();this.emitEvent("moveSource",[a])};
|
|
R78.prototype.createLineTool=function(a,b,c,d,e){if("LineToolRegressionTrend"!=c||this.model()._chartApi._chartApi.isCanCreateStudy())return c=this.m_model.createLineTool(a,b,c,d,e),this._createLineCommand=new R83(this.m_model,c,a,b),this.m_model.lineBeingCreated()||(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),c;A83.showNotice("Error","Exceeded the limit of studies")};
|
|
R78.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()};R78.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()};
|
|
R78.prototype.coninueCreatingLine=function(a,b,c){this.m_model.lineBeingCreated();this.m_model.paneBeingCreatedLineOn();c=this.m_model.coninueCreatingLine(a,b,c);this._createLineCommand.coninueCreatingLine(a,b);c&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand);return c};R78.prototype.finishLineTool=function(a){this.m_model.finishLineTool(a)};R78.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()};
|
|
R78.prototype.lineCancelled=function(){return this.m_model.lineCancelled()};R78.prototype.startChangingLinetool=function(a,b,c,d){this._currentLineChangeCommand=new R80(this.m_model,a,c,d);this.m_model.startChangingLinetool(a,b,c,d)};R78.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()};
|
|
R78.prototype.changeLinePoint=function(a,b){this._currentLineChangeCommand.setPoint(a,b);this.m_model.changeLinePoint(a,b)};R78.prototype.endChangingLinetool=function(a){this.m_model.endChangingLinetool(a);this._currentLineChangeCommand.endChanging();this.pushUndoCommand(this._currentLineChangeCommand);this._currentLineChangeCommand=null};
|
|
R78.prototype.startMovingSource=function(a,b,c){this._currentLineMoveCommand=new R87(this.m_model,a,b,c);this.m_model.startMovingSource(a,b,c)};R78.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()};R78.prototype.moveSource=function(a){this._currentLineMoveCommand.setPoint(a);this.m_model.moveSource(a)};
|
|
R78.prototype.endMovingSource=function(a){this.m_model.endMovingSource(a);this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null)};R78.prototype.D19=function(){return this.m_model.D19()};R78.prototype.state=function(a){return this.m_model.state(a)};R78.prototype.asyncState=function(a){return this.m_model.asyncState(a)};
|
|
R78.prototype.restoreState=function(a,b){this.m_model.restoreState(a,b)};R78.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()};R78.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()};R78.prototype.changeZOrder=function(a,b){var c=new TradingView.ChangeZOrderCommand(this.m_model,a,b);this.pushUndoCommand(c);c.redo();this.emitEvent("changeZOrder",[a])};
|
|
R78.prototype.sendToBack=function(a){var b=new TradingView.SendToBackCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};R78.prototype.bringToFront=function(a){var b=new TradingView.BringToFrontCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};
|
|
R78.prototype.removeAllStudies=function(){this.beginUndoMacro("remove all studies");for(var a=this.m_model.D19(),b=0;b<a.length;b++){var c=a[b];TradingView.isInherited(c.constructor,TradingView.Study)&&c.removeByRemoveAllStudies()&&this.removeSource(c)}this.endUndoMacro()};
|
|
R78.prototype.removeAllDrawingTools=function(a){this.beginUndoMacro("remove all drawing tools");for(var b=this.m_model.D19(),c=0;c<b.length;c++){var d=b[c];TradingView.isInherited(d.constructor,R47)&&d.isActualSymbol()&&d.isUserDeletable()&&(a&&a!=d._constructor||this.removeSource(d))}this.endUndoMacro()};
|
|
R78.prototype.unlinkLine=function(a){a=new TradingView.UnlinkLineToolCommand(this.m_model,a);this.pushUndoCommand(a);a.redo()};R78.prototype.copyToOtherCharts=function(a){this.m_model.copyToOtherCharts(a)};
|
|
R78.prototype.moveDown=function(){try{this.beginUndoMacro("Move Down")}catch(a){return}var b=this,c=this.m_model.mainSeries(),d=this.m_model.paneForSource(c),e=d.priceScaleForSource(c);e.setAutoScale(!1);c=e.height();TradingView.animate(c/5,function(a){b.startScrollPrice(d,e,0);b.scrollPriceTo(d,e,a);b.endScrollPrice(d,e)},function(){b.endUndoMacro()})};
|
|
R78.prototype.moveUp=function(){try{this.beginUndoMacro("Move Up")}catch(a){return}var b=this,c=this.m_model.mainSeries(),d=this.m_model.paneForSource(c),e=d.priceScaleForSource(c);e.setAutoScale(!1);c=e.height();TradingView.animate(c/5,function(a){b.startScrollPrice(d,e,a);b.scrollPriceTo(d,e,0);b.endScrollPrice(d,e)},function(){b.endUndoMacro()})};
|
|
R78.prototype.moveLeft=function(){try{this.beginUndoMacro("Move Left")}catch(a){return}var b=this.m_model.timeScale().width(),c=this;TradingView.animate(b/5,function(a){c.startScrollTime(a);c.scrollTimeTo(0);c.endScrollTime()},function(){c.endUndoMacro()})};
|
|
R78.prototype.moveRight=function(){try{this.beginUndoMacro("Move Right")}catch(a){return}var b=this.m_model.timeScale().width(),c=this;TradingView.animate(b/5,function(a){c.startScrollTime(0);c.scrollTimeTo(a);c.endScrollTime()},function(){c.endUndoMacro()})};R78.prototype.scrollChart=function(a){this.startScrollTime(0);this.scrollTimeTo(a);this.endScrollTime()};
|
|
R78.prototype.scrollChartByBar=function(a){a*=this.m_model.timeScale().barSpacing();this.startScrollTime(0);this.scrollTimeTo(a);this.endScrollTime()};
|
|
R78.prototype.zoomIn=function(a,b){var c=this.m_model.timeScale().width(),d=this;b=b||1;if(this.canZoomIn())if(a){var c=b*c/10,e=(a+1)/2*c;this.startScaleTime(c);this.scaleTimeTo(0);this.endScaleTime();this.startScrollTime(0);this.scrollTimeTo(c-e);this.endScrollTime();this._onSimpleZoomIn.fire()}else{try{this.beginUndoMacro("Zoom In")}catch(f){return}TradingView.animate(c/5,function(a){d.startScaleTime(a);d.scaleTimeTo(0);d.endScaleTime()},function(){d.endUndoMacro();d._onSimpleZoomIn.fire()})}};
|
|
R78.prototype.zoomOut=function(a,b){var c=this.m_model.timeScale().width(),d=this;b=b||1;if(this.canZoomOut())if(a)this.startScaleTime(0),this.scaleTimeTo(b*c/10),this.endScaleTime(),this.startScrollTime(b*(c/20-c/20*a)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(e){return}TradingView.animate(c/5,function(a){d.startScaleTime(0);d.scaleTimeTo(a);d.endScaleTime()},function(){d.endUndoMacro();d._onSimpleZoomOut.fire()})}};
|
|
R78.prototype.resetScales=function(){this.beginUndoMacro("Reset scales");this.resetTimeScale();for(var a=0;a<this.panes().length;a++){var b=this.panes()[a];this.resetPriceScale(b,b.leftPriceScale());this.resetPriceScale(b,b.rightPriceScale())}this.endUndoMacro();this.m_model.recalculateAllPanes()};
|
|
R78.prototype.zoomToViewport=function(a,b,c,d,e){a=new TradingView.ZoomCommand(this.m_model,a,b,c,d,e);a=new R95(a,this.m_zoomStack,!0);a.redo();this.pushUndoCommand(a)};R78.prototype.zoomFromViewport=function(){var a=new R95(this.m_zoomStack.head(),this.m_zoomStack,!1);a.redo();this.pushUndoCommand(a)};R78.prototype.zoomStack=function(){return this.m_zoomStack};
|
|
R78.prototype.addPaneStretchFactorUndoCommand=function(a,b,c,d){a=new R91(this.m_model,a,b,c,d);this.pushUndoCommand(a)};R78.prototype.restoreFactoryDefaults=function(a){a=new R90(this.m_model,a);a.redo();this.pushUndoCommand(a)};R78.prototype.chartLoadTheme=function(a,b){var c=new R81(a,b);c.redo();this.pushUndoCommand(c)};
|
|
R78.prototype.drawingLoadTemplate=function(a,b){var c=new R84(a,b);c.redo();this.pushUndoCommand(c)};R78.prototype.studyLoadTemplate=function(a,b,c,d){a=new R93(a,b,c,d);a.redo();this.pushUndoCommand(a)};R78.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn};R78.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut};
|
|
R78.prototype.loadRange=function(a){a.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries()._pendingInterval=a.val,this.setProperty(this.m_model.mainSeries().properties().interval,a.res,"Change date range")):this.m_model.mainSeries().loadDataTo(a.val)};R78.prototype.cloneLineTool=function(a){a=new R82(this.m_model,a);a.redo();this.pushUndoCommand(a);this.emitEvent("cloneLineTool")};
|
|
R78.prototype._preparePriceAxisProperties=function(a,b){var c=a.lockScale.value(),d=a.style.value()==TradingView.Series.STYLE_PNF;if(d||c)b.log.setValue(!1),b.percentage.setValue(!1);b.logDisabled.setValue(!(!d&&!c));b.percentageDisabled.setValue(!(!d&&!c))};R78.prototype.alertsList=function(){return this.m_model.alertsList()};R78.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()};
|
|
R78.prototype.insertStudyStub=function(a){return this.m_model.insertStudyStub(a)};R78.prototype.removeStudyStub=function(a){return this.m_model.removeStudyStub(a)};R78.prototype.isJustClonedChart=function(){return this.D4.isJustClonedChart()};
|
|
R78.prototype.copySourceToClip=function(a){if(a&&!a.properties().blockCopying){var b={};if(a instanceof R47)b.type="drawing",b.geometry=a.geometry();else if(a instanceof TradingView.Study)b.type="study";else return!1;b.source=a.state&&a.state();delete b.source.alertId;delete b.source.linkKey;if(!b.source)return!1;b.title=a.title&&a.title();b.modelId=this.m_model._id;TradingView.AppClipboard.set(b);return!0}};
|
|
R78.prototype.cutSourceToClip=function(a){if(!this.copySourceToClip(a))return!1;this.removeSource(a)};R78.prototype.pasteLineTool=function(a,b){var c=new TradingView.PasteLineToolUndoCommand(this,b,a);this.pushUndoCommand(c);c.redo()};R78.prototype.pasteStudy=function(a){a=new TradingView.PasteStudyUndoCommand(this,a);this.pushUndoCommand(a);a.redo()};
|
|
R78.prototype.pasteSourceFromClip=function(a,b){var c=TradingView.AppClipboard.get();if(!c)return!1;"drawing"==c.type&&this.pasteLineTool(a,c);"study"==c.type&&this.pasteStudy(c)};function UndoCommand(a){this._text=a}UndoCommand.prototype.text=function(){return this._text};UndoCommand.prototype.undo=function(){throw"pure virtual call ;)";};UndoCommand.prototype.redo=function(){throw"pure virtual call ;)";};
|
|
function UndoStack(){this.m_commands=[];this._onChange=new Delegate}UndoStack.prototype.onChange=function(){return this._onChange};UndoStack.prototype.isEmpty=function(){return 0===this.m_commands.length};UndoStack.prototype.clear=function(){this.m_commands.length=0;this._onChange.fire()};UndoStack.prototype.push=function(a){if(!(a instanceof UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this.m_commands.push(a);this._onChange.fire()};
|
|
UndoStack.prototype.pop=function(){if(this.isEmpty())TradingView.logDebugChart("UndoStack.pop: undo stack is empty");else{var a=this.m_commands.pop();this._onChange.fire();return a}};UndoStack.prototype.head=function(){if(this.isEmpty())TradingView.logDebugChart("UndoStack.head: undo stack is empty");else return this.m_commands[this.m_commands.length-1]};TradingView.UndoMacroCommand=function(a){UndoCommand.call(this,a);this._subcommands=[]};inherit(TradingView.UndoMacroCommand,UndoCommand);
|
|
TradingView.UndoMacroCommand.prototype.addCommand=function(a){this._subcommands.push(a)};TradingView.UndoMacroCommand.prototype.isEmpty=function(){return 0===this._subcommands.length};TradingView.UndoMacroCommand.prototype.redo=function(){for(var a=0;a<this._subcommands.length;a++)this._subcommands[a].redo()};TradingView.UndoMacroCommand.prototype.undo=function(){for(var a=this._subcommands.length-1;0<=a;a--)this._subcommands[a].undo()};
|
|
TradingView.SetPropertyCommand=function(a,b,c,d){UndoCommand.call(this,c);this._targetObj=a;this._newValue=b;this.D0=d};inherit(TradingView.SetPropertyCommand,UndoCommand);TradingView.SetPropertyCommand.prototype.redo=function(){this._oldValue=this._targetObj.value();TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._newValue);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
TradingView.SetPropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._oldValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};TradingView.SetAutoScalePropertyCommand=function(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._priceScale=c;this._newValue=b;this.D0=e};
|
|
inherit(TradingView.SetAutoScalePropertyCommand,UndoCommand);
|
|
TradingView.SetAutoScalePropertyCommand.prototype.redo=function(){this._oldValue=this._property.value();this._oldLockScaleValue=this._priceScale.mainSource()instanceof TradingView.Series?this._priceScale.mainSource().properties().lockScale.value():void 0;TradingView.saveDefaultProperties(!0);this._property.setValue(this._newValue);this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(!1);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),
|
|
this.D0.D20(new A22(A22.LIGHT_UPDATE)))};TradingView.SetAutoScalePropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._property.setValue(this._oldValue);this._oldLockScaleValue&&this._newValue&&this._priceScale.mainSource().properties().lockScale.setValue(this._oldLockScaleValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
TradingView.SetPercentagePropertyCommand=function(a,b,c,d,e){UndoCommand.call(this,d);this._percentage=a;this._priceScale=c;this._newValue=b;this.D0=e};inherit(TradingView.SetPercentagePropertyCommand,UndoCommand);
|
|
TradingView.SetPercentagePropertyCommand.prototype.redo=function(){this._oldValue=this._percentage.value();this._oldAutoScaleValue=this._priceScale.properties().autoScale.value();this._oldLogValue=this._priceScale.properties().log.value();this._oldLogDisabled=this._priceScale.properties().logDisabled.value();TradingView.saveDefaultProperties(!0);this._percentage.setValue(this._newValue);this._priceScale.properties().autoScaleDisabled.setValue(this._newValue);this._priceScale.properties().log.setValue(!1);
|
|
TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
TradingView.SetPercentagePropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._percentage.setValue(this._oldValue);this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue);this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue);this._priceScale.properties().log.setValue(this._oldLogValue);if(!(this._oldAutoScaleValue||this._priceScale.mainSource()instanceof TradingView.Series&&this._priceScale.mainSource().isLockScale())){var a=this.D0.timeScale().visibleBars();
|
|
this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(a.firstBar())))}TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};TradingView.SetLogPropertyCommand=function(a,b,c,d,e){UndoCommand.call(this,d);this._log=a;this._priceScale=c;this._newValue=b;this.D0=e};
|
|
inherit(TradingView.SetLogPropertyCommand,UndoCommand);
|
|
TradingView.SetLogPropertyCommand.prototype.redo=function(){this._oldValue=this._log.value();this._oldPercValue=this._priceScale.properties().percentage.value();this._oldPercDisabled=this._priceScale.properties().percentageDisabled.value();TradingView.saveDefaultProperties(!0);this._log.setValue(this._newValue);this._priceScale.properties().percentage.setValue(!1);this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value());TradingView.saveDefaultProperties(!1);
|
|
this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};TradingView.SetLogPropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._log.setValue(this._oldValue);this._priceScale.properties().percentage.setValue(this._oldPercValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
TradingView.SetChartStyleCommand=function(a,b,c,d,e,f){UndoCommand.call(this,d);this._style=a;this._mainSeries=c;this._priceAxisProperties=c.properties().priceAxisProperties;this._newValue=b;this.D0=e;this.D4=f};inherit(TradingView.SetChartStyleCommand,UndoCommand);
|
|
TradingView.SetChartStyleCommand.prototype.redo=function(){var a=$.Deferred().resolve();this._mainSeries.D2.style===this._style&&this.D0.mainSeries().isNeedRestart(this._newValue)&&(a=this.D4.screen.show());a.done(function(){this._oldValue=this._style.value();this._oldAutoScale=this._priceAxisProperties.autoScale.value();this._oldLogValue=this._priceAxisProperties.log.value();this._oldLogDisabled=this._priceAxisProperties.logDisabled.value();this._oldPercentageValue=this._priceAxisProperties.percentage.value();
|
|
this._oldPercentageDisabled=this._priceAxisProperties.percentageDisabled.value();TradingView.saveDefaultProperties(!0);this._style.setValue(this._newValue);this.D4.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))}.bind(this))};
|
|
TradingView.SetChartStyleCommand.prototype.undo=function(){var a=$.Deferred().resolve();this._mainSeries.D2.style===this._style&&this.D0.mainSeries().isNeedRestart(this._newValue)&&(a=this.D4.screen.show());a.done(function(){TradingView.saveDefaultProperties(!0);this._style.setValue(this._oldValue);this._priceAxisProperties.log.setValue(this._oldLogValue);this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled);this._priceAxisProperties.percentage.setValue(this._oldPercentageValue);
|
|
this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled);this._priceAxisProperties.autoScale.setValue(this._oldAutoScale);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))}.bind(this))};
|
|
TradingView.SetLockScaleCommand=function(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._mainSeries=c;this._priceAxisProperties=c.properties().priceAxisProperties;this._newValue=b;this.D0=e};inherit(TradingView.SetLockScaleCommand,UndoCommand);
|
|
TradingView.SetLockScaleCommand.prototype.redo=function(){this._oldValue=this._property.value();this._oldAutoScale=this._priceAxisProperties.autoScale.value();this._oldPercentage=this._priceAxisProperties.percentage.value();this._oldLog=this._priceAxisProperties.log.value();TradingView.saveDefaultProperties(!0);this._newValue&&(this._priceAxisProperties.percentage.setValue(!1),this._priceAxisProperties.log.setValue(!1),this._priceAxisProperties.autoScale.setValue(!1));var a=this._mainSeries.properties().style.value();
|
|
a!==TradingView.Series.STYLE_RENKO&&a!==TradingView.Series.STYLE_KAGI&&a!==TradingView.Series.STYLE_PNF&&a!==TradingView.Series.STYLE_PB&&this._mainSeries.fixBoxSize();this._property.setValue(this._newValue);TradingView.saveDefaultProperties(!1);this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
TradingView.SetLockScaleCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._priceAxisProperties.percentage.setValue(this._oldPercentage);this._priceAxisProperties.log.setValue(this._oldLog);this._priceAxisProperties.autoScale.setValue(this._oldAutoScale);this._property.setValue(this._oldValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D0&&(this.D0.recalculateAllPanes(),this.D0.D20(new A22(A22.LIGHT_UPDATE)))};
|
|
R89=function(a,b,c,d){this.m_model=a;this.m_pane=b;this.m_priceScale=c;this.m_state=d;this.m_newPriceScaleState=null};inherit(R89,UndoCommand);
|
|
R89.prototype.undo=function(){null!==this.m_newPriceScaleState?TradingView.logDebugChart("R89.undo: Command is already undone"):(this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state),this.m_priceScale.recalcLockedScale(null))};
|
|
R89.prototype.redo=function(){null===this.m_newPriceScaleState?TradingView.logDebugChart("R89.redo: Command is not undone"):(this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null)};R94=function(a,b,c){UndoCommand.call(this,c);this.m_model=a;this.m_state=b;this.m_newTimeScaleState=null};
|
|
inherit(R94,UndoCommand);R94.prototype.undo=function(){null!==this.m_newTimeScaleState?TradingView.logDebugChart("R94.undo: Command is already undone"):(this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state),this.m_model.timeScale().recalcLockedScale())};
|
|
R94.prototype.redo=function(){null===this.m_newTimeScaleState?TradingView.logDebugChart("R94.redo: Command is not undone"):(this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null)};R86=function(a,b,c,d){this.D0=a;this._series=b;this._oldSymbol=b.symbol();this._oldInterval=b.interval();this._symbol=c;this._interval=d};
|
|
inherit(R86,UndoCommand);R86.prototype.redo=function(){this.D0.modifySeries(this._series,this._symbol,this._interval)};R86.prototype.undo=function(){this.D0.modifySeries(this._series,this._oldSymbol,this._oldInterval)};TradingView.InsertStudyCommand=function(a,b,c,d){UndoCommand.call(this,"Insert "+b.id);this.D0=a;this._studyMetaInfo=b;this._props=c;this._isOverlay=d};
|
|
inherit(TradingView.InsertStudyCommand,UndoCommand);TradingView.InsertStudyCommand.prototype.redo=function(){return this.D1=this.D0.insertStudy(this._studyMetaInfo,this._props,this._isOverlay)};TradingView.InsertStudyCommand.prototype.undo=function(){this.D0.removeSource(this.D1)};TradingView.RemoveSourceCommand=function(a,b){this.D0=a;this.R99=b};inherit(TradingView.RemoveSourceCommand,UndoCommand);
|
|
TradingView.RemoveSourceCommand.prototype.redo=function(){this._sourceState=this.R99.state();var a=this.D0.paneForSource(this.R99);this._paneIndex=this.D0.panes().indexOf(a);this._priceScaleName=a.priceScaleName(this.R99.priceScale());var b=this.D0.children(this.R99);this._removeChildUndoCommands=[];for(var c=0;c<b.length;c++){var d=new TradingView.RemoveSourceCommand(this.D0,b[c]);this._removeChildUndoCommands.push(d);d.redo()}this._paneState=a.state();this._restorePane=
|
|
this.D0.removeSource(this.R99);this.D0.recalculateAllPanes();this.D0.D20(new A22(A22.FULL_UPDATE,!0));delete this.R99};
|
|
TradingView.RemoveSourceCommand.prototype.undo=function(){var a;a=this._restorePane?this.D0.createPane(this._paneIndex):this.D0.panes()[this._paneIndex];this._sourceState.type.toLowerCase().startsWith("study")?this.R99=a._restoreStudy(this._sourceState):this.R99=a._restoreLineTool(this._sourceState);var b=this.R99.ownerSource()?this.R99.ownerSource().priceScale():a.priceScaleByName(this._priceScaleName);b?(this.R99.setPriceScale(b),b.addDataSource(this.R99)):(b=new R76(a.D2.overlayPropreties),
|
|
b.setHeight(a.m_height),b.setTopMargin(a.m_rightPriceScale.topMargin()),b.setBottomMargin(a.m_rightPriceScale.bottomMargin()),b.addDataSource(this.R99),this.R99.setPriceScale(b),this.R99._isOverlay=!0);var c=null;this._sourceState.ownerSource&&(c=a.dataSourceForId(this._sourceState.ownerSource));this.R99.setOwnerSource(c);this.R99.setPriceScale(b);this.R99.start();this.R99.restore&&this.R99.restore();this._restorePane&&a.restoreState(this._paneState);for(a=this._removeChildUndoCommands.length-
|
|
1;0<=a;a--)this._removeChildUndoCommands[a].undo();this._removeChildUndoCommands.length=0;this.D0.recalculateAllPanes();this.D0.mainSeries().invalidateBarColorerCache();this.D0.D20(new A22(A22.FULL_UPDATE,!0))};
|
|
R88=function(a,b,c,d,e){this.D0=a;this.R99=b;this._scale=e;this._sources=[b].concat(this.D0.children(b));this._oldPane=c;this._oldPaneIndex=a.panes().indexOf(c);this._oldPaneState=this._oldPane.state();this._oldScaleName=c.priceScaleName(b.priceScale());this._pane=d;this._samePane=this._pane===this._oldPane};inherit(R88,UndoCommand);R88.prototype.redo=function(){this.D0.move(this.R99,this._pane,this._scale)};
|
|
R88.prototype.undo=function(){var a=!1;if(this._samePane)this._oldPane.restoreState(this._oldPaneState);else{for(var b=0;b<this._sources.length;b++)this.D0.detachSource(this._sources[b]);if(-1!==this.D0.panes().indexOf(this._oldPane)){for(var c=this._oldPane.priceScaleByName(this._oldScaleName),b=0;b<this._sources.length;b++)this._oldPane.addDataSource(this._sources[b],c);this._oldPane.restoreState(this._oldPaneState)}else{this._oldPane=this.D0.createPane(this._oldPaneIndex);
|
|
c=this._oldPane.priceScaleByName(this._oldScaleName);for(b=0;b<this._sources.length;b++)this._oldPane.addDataSource(this._sources[b],c);a=!0}}this.D0.recalculateAllPanes();a&&this.D0.D20(new A22(A7.FULL_UPDATE))};R83=function(a,b,c,d){UndoCommand.call(this,"Create line "+b.toolname);this.D0=a;this._line=b;this._paneIndex=a.panes().indexOf(c);this._points=[{point:d}]};
|
|
inherit(R83,UndoCommand);R83.prototype.coninueCreatingLine=function(a,b){this._points.push({point:a,envState:b})};R83.prototype.undo=function(){this.D0.removeSource(this._line)};
|
|
R83.prototype.redo=function(){var a=this.D0.panes()[this._paneIndex];this._line=this.D0.createLineTool(a,this._points[0].point,this._line.toolname);for(a=1;a<this._points.length;a++)this.D0.coninueCreatingLine(this._points[a].point,this._points[a].envState)};R80=function(a,b,c,d){this.D0=a;this.R99=b;this._nextState=this._prevState=b.state(!0)};inherit(R80,UndoCommand);
|
|
R80.prototype.setPoint=function(a){this._nextState=this.R99.state(!0)};R80.prototype.endChanging=function(){this._nextState=this.R99.state(!0)};R80.prototype.undo=function(){var a=this.R99,b=this._prevState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D0.D20(new A22(A22.FULL_UPDATE))};
|
|
R80.prototype.redo=function(){var a=this.R99,b=this._nextState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D0.D20(new A22(A22.FULL_UPDATE))};R87=function(a,b,c,d){this.D0=a;this.R99=b;this._origPoint=c instanceof MathEx.Point?c.clone():TradingView.clone(c);this._pointIndex=d};
|
|
inherit(R87,UndoCommand);R87.prototype.setPoint=function(a){this._point=a instanceof MathEx.Point?a.clone():TradingView.clone(a)};R87.prototype.undo=function(){this.D0.startMovingSource(this.R99,this._point,this._pointIndex);this.D0.moveSource(this._origPoint);this.D0.endMovingSource()};
|
|
R87.prototype.redo=function(){this.D0.startMovingSource(this.R99,this._origPoint,this._pointIndex);this.D0.moveSource(this._point);this.D0.endMovingSource()};TradingView.ChangeZOrderCommand=function(a,b,c){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.R99=b;this._shift=c};inherit(TradingView.ChangeZOrderCommand,UndoCommand);TradingView.ChangeZOrderCommand.prototype.undo=function(){this.D0.changeZOrder(this.R99,-this._shift)};
|
|
TradingView.ChangeZOrderCommand.prototype.redo=function(){this.D0.changeZOrder(this.R99,this._shift)};TradingView.SendToBackCommand=function(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.R99=b};inherit(TradingView.SendToBackCommand,UndoCommand);TradingView.SendToBackCommand.prototype.undo=function(){this.D0.bringToFront(this.R99)};TradingView.SendToBackCommand.prototype.redo=function(){this.D0.sendToBack(this.R99)};
|
|
TradingView.BringToFrontCommand=function(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D0=a;this.R99=b};inherit(TradingView.BringToFrontCommand,UndoCommand);TradingView.BringToFrontCommand.prototype.undo=function(){this.D0.sendToBack(this.R99)};TradingView.BringToFrontCommand.prototype.redo=function(){this.D0.bringToFront(this.R99)};
|
|
R78.prototype.removePane=function(a,b){var c=new TradingView.RemovePaneCommand(this,b,a);this.pushUndoCommand(c);c.redo()};TradingView.RemovePaneCommand=function(a,b,c){UndoCommand.call(this,"Remove pane");this.D0=a;this._index=b;this._pane=this.D0.panes()[b];this._chart=c};inherit(TradingView.RemovePaneCommand,UndoCommand);TradingView.RemovePaneCommand.prototype.redo=function(){this.D0.panes().splice(this._index,1);this._chart._updateGui()};
|
|
TradingView.RemovePaneCommand.prototype.undo=function(){this.D0.panes().splice(this._index,0,this._pane);this._chart._updateGui()};R78.prototype.rearrangePanes=function(a,b,c){a=new TradingView.RearrangePanesCommand(this,b,c,a);this.pushUndoCommand(a);a.redo()};TradingView.RearrangePanesCommand=function(a,b,c,d){UndoCommand.call(this,"Rearrange panes");this.D0=a;this._index=b;this._direction=c;this._chart=d};inherit(TradingView.RearrangePanesCommand,UndoCommand);
|
|
TradingView.RearrangePanesCommand.prototype.redo=function(){var a=this.D0.panes()[this._index];"up"===this._direction&&0<this._index&&(this.D0.panes().splice(this._index,1),this.D0.panes().splice(this._index-1,0,a));"down"===this._direction&&this._index<this.D0.panes().length-1&&(this.D0.panes().splice(this._index,1),this.D0.panes().splice(this._index+1,0,a));this.D0.D20(new A22(A22.FULL_UPDATE))};
|
|
TradingView.RearrangePanesCommand.prototype.undo=function(){if("up"===this._direction){var a=this.D0.panes()[this._index-1];this.D0.panes().splice(this._index-1,1);this.D0.panes().splice(this._index,0,a)}"down"===this._direction&&(a=this.D0.panes()[this._index+1],this.D0.panes().splice(this._index+1,1),this.D0.panes().splice(this._index,0,a));this.D0.D20(new A22(A22.FULL_UPDATE))};
|
|
TradingView.ZoomCommand=function(a,b,c,d,e,f){this.D0=a;this._startBar=b;this._endBar=c;this._startPrice=d;this._endPrice=e;this._pane=f};inherit(TradingView.ZoomCommand,UndoCommand);TradingView.ZoomCommand.prototype.redo=function(){this._timeScaleState=this.D0.timeScale().state();this._priceScaleState=this._pane.defaultPriceScale().state();this.D0.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)};
|
|
TradingView.ZoomCommand.prototype.undo=function(){this.D0.timeScale().restoreState(this._timeScaleState);this._pane.defaultPriceScale().restoreState(this._priceScaleState);this.D0.recalculateAllPanes();this.D0.D20(new A22(A22.LIGHT_UPDATE))};R95=function(a,b,c){this._baseCmd=a;this._zoomStack=b;this._inOut=c};inherit(R95,UndoCommand);
|
|
R95.prototype.undo=function(){this._inOut?this._baseCmd!==this._zoomStack.head()?TradingView.logDebugChart("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop()):(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd))};
|
|
R95.prototype.redo=function(){this._inOut?(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)):this._baseCmd!==this._zoomStack.head()?TradingView.logDebugChart("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop())};R91=function(a,b,c,d,e){this.D0=a;this._paneA=b;this._paneB=c;this._prevStretchA=d;this._currStretchA=e};inherit(R91,UndoCommand);
|
|
R91.prototype.redo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA;this._paneB._stretchFactor=a-this._currStretchA;this.D0.D20(new A22(A22.FULL_UPDATE))};
|
|
R91.prototype.undo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA;this._paneB._stretchFactor=a-this._prevStretchA;this.D0.D20(new A22(A22.FULL_UPDATE))};
|
|
R90=function(a,b){UndoCommand.call(this,"Restore Defaults");this.D0=a;this._defaultProperty=b;this._state=b.state(b._exclusions);this.D4=a._undoModel.D4};inherit(R90,UndoCommand);R90.prototype.redo=function(){this.D0.restoreFactoryDefaults(this._defaultProperty);this.D4.adaptOnChartLogo()};
|
|
R90.prototype.undo=function(){this._defaultProperty.merge(this._state);this._defaultProperty.listeners().fire(this._defaultProperty);this.D0.mainSeries().onChartStyleChanged();this.D4.adaptOnChartLogo()};
|
|
R81=function(a,b){UndoCommand.call(this,"Apply Chart Theme");this.D0=a;this._newChartProps=TradingView.factoryDefaults("chartproperties");["candleStyle","hollowCandleStyle","haStyle"].forEach(function(a){b.mainSourceProperties[a].wickUpColor=b.mainSourceProperties[a].wickUpColor||b.mainSourceProperties[a].wickColor;b.mainSourceProperties[a].wickDownColor=b.mainSourceProperties[a].wickDownColor||b.mainSourceProperties[a].wickColor});b.chartProperties.paneProperties.vertGridProperties=
|
|
b.chartProperties.paneProperties.vertGridProperties||b.chartProperties.paneProperties.gridProperties;b.chartProperties.paneProperties.horzGridProperties=b.chartProperties.paneProperties.horzGridProperties||b.chartProperties.paneProperties.gridProperties;this._newChartProps=$.extend(!0,{},this._newChartProps,b.chartProperties);delete this._newChartProps.scalesProperties.showLeftScale;delete this._newChartProps.scalesProperties.showRightScale;delete this._newChartProps.scalesProperties.scaleSeriesOnly;
|
|
delete this._newChartProps.scalesProperties.showSeriesLastValue;delete this._newChartProps.scalesProperties.showStudyLastValue;delete this._newChartProps.scalesProperties.showSymbolLabels;delete this._newChartProps.scalesProperties.showStudyPlotLabels;this._newSeriesProps=b.mainSourceProperties;this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor);
|
|
this._oldChartProps=a.properties().state();delete this._oldChartProps.paneProperties.topMargin;delete this._oldChartProps.paneProperties.bottomMargin;this._oldSeriesProps=a.properties().state().mainSeriesProperties};inherit(R81,UndoCommand);
|
|
R81.prototype._merge=function(a,b){var c=this.D0;TradingView.saveDefaultProperties(!0);a&&(c.properties().paneProperties.merge(a.paneProperties),c.properties().scalesProperties.merge(a.scalesProperties),c.properties().symbolWatermarkProperties.merge(a.symbolWatermarkProperties));c.mainSeries().properties().merge(b);c.mainSeries().properties().saveDefaults();c.mainSeries().J63();c.mainSeries().invalidateBarStylesCache();c._version=b.version;c.recalculateAllPanes();
|
|
c.D20(new A22(A22.FULL_UPDATE));c.properties().saveDefaults();c.properties().listeners().fire(this.D2);c.properties().scalesProperties.textColor.listeners().fire(c.properties().scalesProperties.textColor);TradingView.saveDefaultProperties(!1)};R81.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps);this.D0.mainSeries().onChartStyleChanged();this.D0.updateScales()};
|
|
R81.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps);this.D0.mainSeries().onChartStyleChanged();this.D0.updateScales()};R84=function(a,b){UndoCommand.call(this,"Apply Drawing Template");this.R99=a;this._oldProps=a.properties().state();this._newProps=b};inherit(R84,UndoCommand);
|
|
R84.prototype._merge=function(a){var b=this.R99;b.properties().merge(a);b.properties().saveDefaults();b.propertiesChanged();b.updateAllViews();b.D0.D20(new A22(A22.LIGHT_UPDATE))};R84.prototype.undo=function(){this._merge(this._oldProps)};R84.prototype.redo=function(){this._merge(this._newProps)};
|
|
R93=function(a,b,c,d){UndoCommand.call(this,(" "+d||"")+" Study template");this.D0=a;this._oldProps=b;this._newProps=c};inherit(R93,UndoCommand);
|
|
R93.prototype._merge=function(a){var b=this.D0.model(),c=b.mainSeries();c.properties().lockScale.setValue(!1);a.interval&&c.properties().interval.setValue(a.interval);for(var d=[],e=b.panes(),f=e.length;f--;)for(var g=e[f],h=g.containsMainSeries(),k=g.D19(),g=k.length;g--;){var l=k[g];if(!h||l instanceof TradingView.Study||l instanceof TradingView.AlertLabel)l.isRemovedByStudyTemplates()||d.push(l),b.removeSource(l)}h=a.panes;k=function(a,b){return a.D19().some(function(a){return a.alert&&
|
|
a.alert().id()===b.alert.id()})};for(f=0;f<h.length;f++){for(var m=!1,n=h[f],g=0;g<n.sources.length;g++)l=n.sources[g],"MainSeries"===l.type&&(delete l.state,m=!0);g=null;g=m?e[f]:b.createPane(f);g.restoreState(h[f],!1,a.version);if(m)for(l=0;l<d.length;l++)d[l].restore&&d[l].restore(),m=d[l],m instanceof TradingView.AlertLabel&&!k(g,m)||g.D19().push(m);g.updateAlertLabelsSources()}c.priceScale().setAutoScale(!0);b._version=a.version;b.startNotStartedStudies();b.recalculateAllPanes();b.D20(new A22(A22.FULL_UPDATE))};
|
|
R93.prototype.undo=function(){this._merge(this._oldProps);this.D0.model().mainSeries().onChartStyleChanged()};R93.prototype.redo=function(){this._merge(this._newProps);this.D0.model().mainSeries().onChartStyleChanged();var a=this.D0.model().mainSeries().properties(),b=this.D0.model().mainSeries().properties().priceAxisProperties;this.D0._preparePriceAxisProperties(a,b)};
|
|
TradingView.SetPriceScaleMarginsCommand=function(a,b,c,d,e){this.D0=a;this._pane=b;this._priceScale=c;this._topMargin=d;this._bottomMargin=e;this._oldTopMargin=c.topMargin();this._oldBottomMargin=c.bottomMargin()};inherit(TradingView.SetPriceScaleMarginsCommand,UndoCommand);TradingView.SetPriceScaleMarginsCommand.prototype.redo=function(){this._priceScale.setTopMargin(this._topMargin);this._priceScale.setBottomMargin(this._bottomMargin);this.D0.recalculatePane(this._pane,!1)};
|
|
TradingView.SetPriceScaleMarginsCommand.prototype.undo=function(){this._priceScale.setTopMargin(this._oldTopMargin);this._priceScale.setBottomMargin(this._oldBottomMargin);this.D0.recalculatePane(this._pane,!1)};R85=function(a,b){this.D0=a;this._range=b};inherit(R85,UndoCommand);R85.prototype.redo=function(){this.D0.mainSeries().loadDataTo(this._range)};
|
|
R92=function(a,b,c,d,e){UndoCommand.call(this,a);this._property=b;this._value=c;this._forceSetProperty=e;this._prevValue=b.value();this._cw=d};inherit(R92,UndoCommand);R92.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))};
|
|
R92.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))};
|
|
TradingView.shiftLineToolOnClone=function(a,b){var c=b.priceScale(),d=[],e;c.isPercent()&&(e=b.firstValue());for(var f=0;f<a.length;f++){var g={offset:a[f].offset,time_t:a[f].time_t},h=a[f].price;c.isPercent()&&(h=c.priceRange().convertToPercent(h,e));h=c.priceToCoordinate(h);h-=40;h=c.coordinateToPrice(h);c.isPercent()&&(h=c.priceRange().convertFromPercent(h,e));g.price=h;d.push(g)}return d};
|
|
R82=function(a,b){UndoCommand.call(this,"clone "+b.title());this.D0=a;this.R99=b;this._points=new List};inherit(R82,UndoCommand);
|
|
R82.prototype.redo=function(){if(this.R99){var a=this.R99,b=a.priceScale(),c=this.D0.paneForSource(a),d=TradingView.className(a.constructor),e=new J52(d.toLowerCase(),a.properties().state());this._line=TradingView.LineDataSourceFactory.create(d,this.D0,e,null,a.ownerSource());this._line.setOwnerSource(a.ownerSource());this._line.properties().visible._value=!0;this._line._fixedPoints.appendAll(a._fixedPoints);for(d=0;d<this._line._fixedPoints.size();d++)this._line._fixedPoints.setItem(d,
|
|
this._line._fixedPoints.item(d).add(new MathEx.Point(20,20)));d=a._timePoint.toArray();d=TradingView.shiftLineToolOnClone(d,a.ownerSource());e=a._points.toArray();this._line.restorePoints(d,e);this._line.cloneData&&this._line.cloneData(a);c.addDataSource(this._line,b);this.D0.updateSource(this._line);this._line.checkAlert&&this._line.checkAlert();this._points=this._line.points();this._paneIndex=this.D0.panes().indexOf(c);this._toolname=a._constructor;TradingView.drawingState.drawOnAllCharts().value()&&
|
|
this.D0.copyToOtherCharts(this._line);delete this.R99}else for(c=this.D0.panes()[this._paneIndex],this._line=this.D0.createLineTool(c,this._points.item(0),this._toolname),d=1;d<this._points.size();d++)this.D0.coninueCreatingLine(this._points.item(d))};R82.prototype.undo=function(){this.D0.removeSource(this._line);this.D0.D20(new A22(A22.LIGHT_UPDATE,!0))};
|
|
A77.setWatchedValue=function(a,b,c){a.value()!==b&&(a=new TradingView.SetWatchedValueCommand(a,b,c),this.pushUndoCommand(a),a.redo())};TradingView.SetWatchedValueCommand=function(a,b,c){UndoCommand.call(this,c);this._wv=a;this._newValue=b;this._oldValue=a.value()};inherit(TradingView.SetWatchedValueCommand,UndoCommand);TradingView.SetWatchedValueCommand.prototype.redo=function(){this._wv.setValue(this._newValue)};TradingView.SetWatchedValueCommand.prototype.undo=function(){this._wv.setValue(this._oldValue)};
|
|
TradingView.UnlinkLineToolCommand=function(a,b){this.D0=a;this.R99=b.id();this._linkKey=b.linkKey};inherit(TradingView.UnlinkLineToolCommand,UndoCommand);TradingView.UnlinkLineToolCommand.prototype.redo=function(){delete this.D0.dataSourceForId(this.R99).linkKey};TradingView.UnlinkLineToolCommand.prototype.undo=function(){this.D0.dataSourceForId(this.R99).linkKey=this._linkKey};
|
|
TradingView.PasteLineToolUndoCommand=function(a,b,c){UndoCommand.call(this,"Paste");this._chartModel=a;this._sourceState=b;this._paneIndex=this._chartModel.panes().indexOf(c||this._chartModel.paneForSource(this._chartModel.mainSeries()))};inherit(TradingView.PasteLineToolUndoCommand,UndoCommand);
|
|
TradingView.PasteLineToolUndoCommand.prototype.redo=function(){var a=this._chartModel.panes()[this._paneIndex],b=a.dataSourceForId(this._sourceState.ownerId)||a.mainDataSource(),c=!0,d=this._sourceState.source.state.symbol,e=this._chartModel.mainSeries().symbol();d==e&&(b instanceof TradingView.Series&&(c=!1),b instanceof TradingView.Study&&(c=!b.metaInfo().isPriceStudy));b.id()===this._sourceState.source.ownerSource&&this._chartModel.model()._id==this._sourceState.modelId&&(this._sourceState.source.points=
|
|
TradingView.shiftLineToolOnClone(this._sourceState.source.points,b));delete this._sourceState.source.state.symbol;d=TradingView.clone(this._sourceState.source);if(c){var f=this._chartModel;d.points=this._sourceState.geometry.map(function(a){var c;c=a.x*f.timeScale().width();a=a.y*b.priceScale().height();c=new MathEx.Point(c,a);a=f.timeScale().coordinateToIndex(c.x);a=f.timeScale().normalizeBarIndex(a);a.price=b.priceScale().coordinateToPrice(c.y);b.priceScale().isPercent()&&(c=b.firstValue(),a.price=
|
|
b.priceScale().priceRange().convertFromPercent(a.price,c));return a})}d.id=TradingView.guid();a=a._restoreLineTool(d);a.calcIsActualSymbol();a.setOwnerSource(b);a.setPriceScale(b.priceScale());b.priceScale().addDataSource(a);this._sourceId=a.id();a.createServerPoints();this._chartModel.D20(new A22(A22.LIGHT_UPDATE,!0))};
|
|
TradingView.PasteLineToolUndoCommand.prototype.undo=function(){var a=this._chartModel.panes()[this._paneIndex].dataSourceForId(this._sourceId);this._chartModel.removeSource(a);this._chartModel.D20(new A22(A22.LIGHT_UPDATE,!0))};TradingView.PasteStudyUndoCommand=function(a,b){this._chartModel=a;this._sourceState=b};inherit(TradingView.PasteStudyUndoCommand,UndoCommand);
|
|
TradingView.PasteStudyUndoCommand.prototype.redo=function(){var a=null,b=null;this._sourceState.source.metaInfo.is_price_study?(a=this._chartModel.paneForSource(this._chartModel.mainSeries()),b=this._chartModel.mainSeries().priceScale()):(a=this._chartModel.createPane(),b=a.defaultPriceScale());var c=a._restoreStudy(this._sourceState.source);c.start();c.setPriceScale(b);a.move(c,b);this._sourceId=c.id()};
|
|
TradingView.PasteStudyUndoCommand.prototype.undo=function(){var a=this._chartModel.panes()[this._paneIndex].dataSourceForId(this._sourceId);this._chartModel.removeSource(a);this._chartModel.D20(new A22(A22.LIGHT_UPDATE,!0))};TradingView.ChartModel=function(a,b,c,d,e,f,g,h,k){this._version=TradingView.ChartModel.version;this._readOnly=d;this._undoModel=h;this._isSnapshot=k;this._studiesMetaData=f;this._studyVersioning=new A0(this._studiesMetaData,g);this.m_timeScale=new R49(this,c.timeScale);this.m_panes=[];this.m_gridSource=new TradingView.Grid;this.m_crossHairSource=new TradingView.CrossHair(this,TradingView.drawingState.properties());this.m_width=0;this._tagsChanged=new Delegate;this.D2=
|
|
c;this._lineCancelled=new Delegate;this._magnet=new A47(TradingView.drawingState.properties().magnet,this.m_timeScale,c.paneProperties.magnetSensivity);this._alertsList=new List;var l=new J52("chartproperties.mainSeriesProperties");l.addExclusion("lockScale");l.addExclusion("minTick");l.addExclusion("priceAxisProperties.percentage");l.addExclusion("priceAxisProperties.log");this.createPane(void 0,!1,{rightAxisProperties:l.priceAxisProperties.state(["autoScale"])});
|
|
this.m_panes[0]._stretchFactor=2*R75.DEFAULT_STRETCH_FACTOR;this.m_panes[0]._isMainPane=!0;this.m_selectedSource=null;this._selectedSourceChanged=new Delegate;this._chartApi=a;this._invalidateHandler=b;this.m_hoveredSource=null;this.D2.listeners().subscribe(this,TradingView.ChartModel.prototype.propertyChangeHandler);var m=this;this.D2.timezone.listeners().subscribe(null,function(){m._chartApi&&m._chartApi.connected()&&m._chartApi.switchTimezone(m.timezone())});this.D2.timeScale.rightOffset.listeners().subscribe(null,
|
|
function(){m.m_timeScale.setOffset(m.D2.timeScale.rightOffset.value());m.recalculateAllPanes()});l.merge(c.mainSeriesProperties.state());this.m_mainSeries=new TradingView.Series(this,l,e);this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale());this.m_mainSeries.onCompleted().subscribe(this,function(){m.clearCurrentPosition()});d||(l.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),l.lockScale.listeners().subscribe(this,function(a){if(a=
|
|
a.value())l.priceAxisProperties.percentage.setValue(!1),l.priceAxisProperties.logDisabled.setValue(!1);l.priceAxisProperties.percentageDisabled.setValue(a);l.priceAxisProperties.logDisabled.setValue(a)}),this.D2.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(a){a.value()||this.D2.paneProperties.legendProperties.showStudyArguments.setValue(!1)}));this._barsMarksSources=[];R77.enabled("charting_library_base")?(a=new TradingView.UserDefinedBarsMarks(this),
|
|
a.setOwnerSource(this.m_mainSeries),this._barsMarksSources.push(a),a=new TradingView.UserDefinedTimescaleMarks(this)):a=new TradingView.PublishedChartsTimeline(this);a.setOwnerSource(this.m_mainSeries);this._barsMarksSources.push(a);this.m_watermarkSource=new TradingView.Watermark(this.m_mainSeries);var n=this._undoModel.D4;R77.enabled("alerts")&&!this.readOnly()&&(this._alertsList.setValidator(new TradingView.PredicateValidator(function(a){return a instanceof TradingView.Alert?
|
|
a.fake()||a===TradingView.alertsDispatcher.stash.getAlert(a.id())?!0:(console.error("[Alerts] item need to be fake or in alertsDispatcher stash"),!1):(console.error("[Alerts] item should be instance of TradingView.Alert"),!1)})),this._alertsList.onAdd=new Delegate,this._alertsList.onRemove=new Delegate,this._alertsList.onChange=new Delegate,this._alertsList.onAdd.subscribe(this,function(a){function b(d){if(d){var e=d.mainDataSource();if(e=d.priceScaleForSource(e)||d.rightPriceScale()||d.leftPriceScale()){var f=
|
|
new TradingView.AlertLabel(c,a);d.addDataSource(f,e)}}}var c=this;if(a.isOHLC())b(c.paneForSource(c.m_mainSeries));else for(var d=c.m_panes.length-1;0<=d;d--)b(c.m_panes[d]);n.update();c._alertsList.onChange.fire()}),this._alertsList.onRemove.subscribe(this,function(a){for(var b=function(b){return b.alert&&b.alert()&&b.alert().id()===a.id()},c=this.m_panes.length-1;0<=c;c--){var d=this.m_panes[c],e=d.D19().filter(b)[0];e&&d.removeDataSource&&d.removeDataSource(e)}n.update();this._alertsList.onChange.fire()}),
|
|
this._prepareAlertsList());this.strategySources=[];this.strategySources.change=new Delegate;this._activeStrategySource=new WatchedValue(null);this._oldEndVisibleIndex=this._oldStartVisibleIndex=-1;this._currentTool="";TradingView.drawingState.hideAllDrawings().subscribe(this,TradingView.ChartModel.prototype.visibilityChangeHandler);this.D2.scalesProperties.listeners().subscribe(this,TradingView.ChartModel.prototype.fullUpdate);this._id=TradingView.guid()};
|
|
TradingView.ChartModel.prototype.isSnapshot=function(){return this._isSnapshot};TradingView.ChartModel.prototype.currentTool=function(){return this._currentTool};TradingView.ChartModel.prototype.setCurrentTool=function(a){this._currentTool=a};TradingView.ChartModel.prototype.timezone=function(){return this.D2.timezone.value()};TradingView.ChartModel.prototype.version=function(){return this._version};TradingView.ChartModel.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())};
|
|
TradingView.ChartModel.prototype.dumpViews=function(){for(var a={panes:[]},b=0;b<this.m_panes.length;b++)a.panes.push(this.m_panes[b].dumpViews());a.dataWindow=[];for(var c=this.D19(),b=0;b<c.length;b++){var d=c[b].dataWindowView();d&&a.dataWindow.push(d.dump())}return a};TradingView.ChartModel.prototype._paneInvalidationMask=function(a,b){var c=new A22,d=this.m_panes.indexOf(a);void 0===b&&(b=A22.LIGHT_UPDATE);c.invalidatePane(d,b);return c};
|
|
TradingView.ChartModel.prototype.updatePane=function(a){a=this._paneInvalidationMask(a);this.D20(a)};TradingView.ChartModel.prototype.fullUpdate=function(a){this.D20(new A22(A22.FULL_UPDATE))};TradingView.ChartModel.prototype.updateSource=function(a){a=this.paneForSource(a);a=this._paneInvalidationMask(a);this.D20(a)};TradingView.ChartModel.prototype.studiesMetaData=function(){return this._studiesMetaData};
|
|
TradingView.ChartModel.prototype.studyVersioning=function(){return this._studyVersioning};TradingView.ChartModel.prototype.disconnect=function(){for(var a=this.D19(),b=0;b<a.length;b++)a[b].disconnect&&a[b].disconnect()};TradingView.ChartModel.prototype.restart=function(){this.initConnection();this.m_timeScale.reset();this.m_mainSeries.restart();for(var a=this.D19(),b=0,c;b<a.length;b++)c=a[b],c.restart&&c!==this.m_mainSeries&&c.restart(),c instanceof TradingView.StudyStrategy&&this.addStrategySource(c)};
|
|
TradingView.ChartModel.prototype.startNotStartedStudies=function(){if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(var a=this.D19(),b=0;b<a.length;b++)a[b]instanceof TradingView.Study&&!a[b].isStarted()&&a[b].restart&&a[b]!==this.m_mainSeries&&a[b].restart()};
|
|
TradingView.ChartModel.prototype.updateLineTools=function(){for(var a=this.D19(),b=0;b<a.length;b++)if(TradingView.isInherited(a[b].constructor,R47)){var c=a[b];c.tryCreateServerPoints();c.checkAlert&&c.checkAlert()}};TradingView.ChartModel.prototype.realignLineTools=function(){for(var a=this.D19(),b=0;b<a.length;b++)TradingView.isInherited(a[b].constructor,R47)&&a[b].calcIsActualSymbol();for(b=0;b<this.m_panes.length;b++)this.m_panes[b].invalidateSourcesCache()};
|
|
TradingView.ChartModel.prototype.readOnly=function(){return this._readOnly};TradingView.ChartModel.prototype.properties=function(){return this.D2};TradingView.ChartModel.prototype.lineCancelled=function(){return this._lineCancelled};TradingView.ChartModel.prototype.chartApi=function(){return this._chartApi};TradingView.ChartModel.prototype.propertyChangeHandler=function(){this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.visibilityChangeHandler=function(){this.setSelectedSource();this.D20(new A22(A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.updateAllPaneViews=function(){for(var a=0;a<this.m_panes.length;a++)this.m_panes[a].updateAllViews()};TradingView.ChartModel.prototype.mainSeries=function(){return this.m_mainSeries};TradingView.ChartModel.prototype.timeScale=function(){return this.m_timeScale};
|
|
TradingView.ChartModel.prototype.panes=function(){return this.m_panes};TradingView.ChartModel.prototype.gridSource=function(){return this.m_gridSource};TradingView.ChartModel.prototype.watermarkSource=function(){return this.m_watermarkSource};TradingView.ChartModel.prototype.crossHairSource=function(){return this.m_crossHairSource};TradingView.ChartModel.prototype.publishedChartsTimelineSource=function(){for(var a=0;a<this._barsMarksSources.length;++a)if(this._barsMarksSources[a]instanceof TradingView.PublishedChartsTimeline)return this._barsMarksSources[a]};
|
|
TradingView.ChartModel.prototype.barsMarksSources=function(){return this._barsMarksSources};TradingView.ChartModel.prototype.width=function(){return this.m_width};TradingView.ChartModel.prototype.setPaneHeight=function(a,b){a.setHeight(b);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.setWidth=function(a){this.m_width=a;this.m_timeScale.setWidth(this.m_width);for(var b=0;b<this.m_panes.length;++b)this.m_panes[b].setWidth(a);this.recalculateAllPanes()};
|
|
TradingView.ChartModel.prototype.createPane=function(a,b,c){var d=this.D2.paneProperties;c&&d.merge(c);b=new R75(this.m_timeScale,d,this,b);if("number"==typeof a&&isFinite(a)){if(0>a||a>this.m_panes.length){TradingView.logDebugChart("TradingView.ChartModel.createPane: invalid index: "+a);return}this.m_panes.splice(a,0,b)}else this.m_panes.push(b);b.onTagsChanged().subscribe(this,TradingView.ChartModel.prototype.onPaneTagsChanged);return b};
|
|
TradingView.ChartModel.prototype.removePane=function(a){a.destroy();a=this.m_panes.indexOf(a);-1!==a&&this.m_panes.splice(a,1);this.D20(new A22(A22.FULL_UPDATE))};TradingView.ChartModel.prototype.startScalePrice=function(a,b,c){a.startScalePrice(b,c)};
|
|
TradingView.ChartModel.prototype.scalePriceTo=function(a,b,c){a.scalePriceTo(b,c);this.mainSeries().properties().lockScale.value()?this.D20(new A22(A22.LIGHT_UPDATE)):this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.endScalePrice=function(a,b){a.endScalePrice(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.startScrollPrice=function(a,b,c){a.startScrollPrice(b,c)};TradingView.ChartModel.prototype.scrollPriceTo=function(a,b,c){a.scrollPriceTo(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.endScrollPrice=function(a,b){a.endScrollPrice(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.setPriceAutoScale=function(a,b,c){a.setPriceAutoScale(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.restorePriceScaleState=function(a,b,c){a.restorePriceScaleState(b,c);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.resetPriceScale=function(a,b){a.resetPriceScale(b);this.D20(this._paneInvalidationMask(a,A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.updateScales=function(a,b){this._undoModel.D4._updateScalesActions()};TradingView.ChartModel.prototype.startScaleTime=function(a){this.m_timeScale.startScale(a)};TradingView.ChartModel.prototype.scaleTimeTo=function(a){this.m_timeScale.scaleTo(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.endScaleTime=function(){this.m_timeScale.endScale();this.D20(new A22(A22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19())};TradingView.ChartModel.prototype.startScrollTime=function(a){this.m_timeScale.startScroll(a);this._isTimeScrolling=!0};TradingView.ChartModel.prototype.scrollTimeTo=function(a){this.m_timeScale.scrollTo(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.endScrollTime=function(){this.m_timeScale.endScroll();this.D20(new A22(A22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19());this._isTimeScrolling=!1};TradingView.ChartModel.prototype.recalcStudyBasedLineTools=function(){this.D19().forEach(function(a){a instanceof A63&&a.recalcStudyIfNeeded&&a.recalcStudyIfNeeded()})};
|
|
TradingView.ChartModel.prototype.recalcVisibleRangeStudy=function(a,b){if(!this.timeScale().isEmpty()){var c=this.timeScale().visibleBars(),d=this.mainSeries().nearestData(c.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),c=this.mainSeries().nearestData(c.lastBar(),TradingView.SEARCH_NEAREST_LEFT),e=d?d.index:void 0,f=c?c.index:void 0;if(e!=this._oldStartVisibleIndex||f!=this._oldEndVisibleIndex||b)for(this._oldStartVisibleIndex=e,this._oldEndVisibleIndex=f,e=0;e<a.length;e++)if(a[e]instanceof TradingView.Study)for(var f=
|
|
a[e],g=f.metaInfo().inputs,h=0;h<g.length;h++){if("first_visible_bar_time"==g[h].id){var k=d&&d.value?d.value[TradingView.TIME_PLOT]:0;f.properties().inputs.first_visible_bar_time.setValue(1E3*Math.floor(k))}"last_visible_bar_time"==g[h].id&&(k=c&&c.value?c.value[TradingView.TIME_PLOT]:0,f.properties().inputs.last_visible_bar_time.setValue(1E3*Math.floor(k)))}}};
|
|
TradingView.ChartModel.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault();this.recalculateAllPanes();this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.D19());this.D20(new A22(A22.LIGHT_UPDATE))};TradingView.ChartModel.prototype.restoreTimeScaleState=function(a){this.m_timeScale.restoreState(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.restoreFactoryDefaults=function(a){a.restoreFactoryDefaults();this.recalcVisibleRangeStudy(this.D19(),!0);this.mainSeries().onChartStyleChanged()};
|
|
TradingView.ChartModel.prototype.setSelectedSource=function(a,b){if(!(this.m_selectedSource===a&&this._lastHittestData===b||a&&a.customization&&a.customization.disableSelection)){this._lastHittestData=b;var c=new A22;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),this.paneForSource(this.m_selectedSource));this.m_selectedSource=a;this._selectedSourceChanged.fire(a);a&&(a.updateAllViews(),this.paneForSource(a),a.hasAlert.value()&&TradingView.alertsDispatcher&&
|
|
a.getAlert(function(a){TradingView.alertsDispatcher.alertSelected.setValue(a)},!0));c.force=!0;this.D20(new A22(A22.LIGHT_UPDATE));this.setHoveredSource(a,b)}};TradingView.ChartModel.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof R47&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))};
|
|
TradingView.ChartModel.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged};
|
|
TradingView.ChartModel.prototype.setHoveredSource=function(a,b){if(this.m_hoveredSource!==a||this._lastHittestData!==b){this._lastHittestData=b;var c=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),c||(c=new A22),c.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),A22.LIGHT_UPDATE)));if(this.m_hoveredSource=a)a.updateAllViews(),c||(c=new A22),c.merge(this._paneInvalidationMask(this.paneForSource(a),
|
|
A22.LIGHT_UPDATE));c&&this.D20(c)}};TradingView.ChartModel.prototype.selectedSource=function(){return this.m_selectedSource};TradingView.ChartModel.prototype.hoveredSource=function(){return this.m_hoveredSource};TradingView.ChartModel.prototype.lastHittestData=function(){return this._lastHittestData};TradingView.ChartModel.prototype.D20=function(a){this._invalidateHandler&&this._invalidateHandler(a)};
|
|
TradingView.ChartModel.prototype.D19=function(){var a=[];a.push(this.m_crossHairSource);for(var b=0;b<this.m_panes.length;++b)for(var c=this.m_panes[b].D19(),d=0;d<c.length;d++)a.push(c[d]);return a};TradingView.ChartModel.prototype.dataSourceForId=function(a){for(var b,c=0;c<this.m_panes.length;++c)if(b=this.m_panes[c].dataSourceForId(a))return b;return null};
|
|
TradingView.ChartModel.prototype.children=function(a){for(var b=this.D19(),c=[],d=0;d<b.length;d++){var e=b[d];e.ownerSource()===a&&c.push(e)}return c};
|
|
TradingView.ChartModel.prototype.setCurrentPosition=function(a,b,c,d){var e=NaN;a=Math.round(this.m_timeScale.coordinateToIndex(a));if(c){var f=c.defaultPriceScale();f.isEmpty()||(e=f.coordinateToPrice(b))}if(this._lineBeingCreated||R47.isLineTool(this.currentTool()))e=this._magnet.align(e,a,c);if(this._isTimeScrolling)this.m_crossHairSource.setPosition(this.m_crossHairSource.index,e,c);else{this.m_crossHairSource.setPosition(a,e,c);this.m_crossHairSource.dataWindowView().update();
|
|
b=this.m_panes;for(f=b.length;f--;)for(var g=b[f].D19(),h=g.length;h--;){var k=g[h].dataWindowView();k&&k.update()}this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:a,price:e},d),this._lineBeingCreated.updateAllViews(),this.D20(new A22(A22.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.D20(new A22(A22.LIGHT_UPDATE)):this.D20(new A22(A22.UPDATE_CURSOR_ONLY));
|
|
this._isSettingsExternalPosition||(d=this._undoModel.D4,d.D5&&(a={timeStamp:this.m_timeScale.points().roughTime(a)},c=c.mainDataSource(),c instanceof TradingView.Series&&(a.price=e,a.symbol=c.symbol()),e=(e=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved)&&TradingView.drawingState.drawOnAllCharts().value(),d.D5.syncCrosshair(a,d,e)))}};
|
|
TradingView.ChartModel.prototype.clearCurrentPosition=function(){var a=this.crossHairSource();a.clearPosition();a.dataWindowView().update();for(var a=this.m_panes,b=a.length;b--;)for(var c=a[b].D19(),d=c.length;d--;){var e=c[d].dataWindowView();e&&e.update()}this.D20(new A22(A22.UPDATE_CURSOR_ONLY));a=this._undoModel.D4;a.D5&&a.D5.syncCrosshair(NaN,a)};
|
|
TradingView.ChartModel.prototype.setExternalPosition=function(a){var b=this.m_timeScale.points().roughIndex(a.timeStamp);if(this.mainSeries().symbol()==a.symbol){this._isSettingsExternalPosition=!0;var c=this.paneForSource(this.mainSeries()),b=this.m_timeScale.indexToCoordinate(b);a=this.mainSeries().priceScale().priceToCoordinate(a.price,!0);this.setCurrentPosition(b,a,c,{});delete this._isSettingsExternalPosition}else{isFinite(b)?this.crossHairSource().setPosition(b,NaN,null):(c=this.crossHairSource(),
|
|
c.clearPosition(),c.dataWindowView().update());c=this.D19();for(a=c.length;a--;)(b=c[a].dataWindowView())&&b.update();this.D20(new A22(A22.UPDATE_CURSOR_ONLY))}};
|
|
TradingView.ChartModel.prototype.updateTimeScale=function(a,b,c,d,e){if(e){this.m_timeScale.reset();for(var f=this.D19(),g=0;g<f.length;g++)f[g].clearData&&f[g].clearData()}this.m_timeScale.update(a,b,c,d);a="TradingView.ChartModel.prototype.updateTimeScale("+a+","+b+","+c.length+","+d.length+","+e+")";a+="R49: {first:"+this.m_timeScale.m_points.firstTimePointIndex()+",last:"+this.m_timeScale.m_points.lastTimePointIndex()+"}";TradingView.logDebugChart(a);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.recalculatePane=function(a,b){a&&a.recalculate(b)};TradingView.ChartModel.prototype.paneForSource=function(a){for(var b=this.m_panes.length-1;0<=b;b--)if(-1!==this.m_panes[b].D19().indexOf(a))return this.m_panes[b];return a instanceof R96?this.paneForSource(this.m_mainSeries):null};
|
|
TradingView.ChartModel.prototype.recalculateAllPanes=function(){for(var a=0;a<this.m_panes.length;++a)this.m_panes[a].recalculate();this.timeScale().recalcLockedScale();this.updateAllPaneViews()};TradingView.ChartModel.prototype._invalidateBarColorerCaches=function(){for(var a=this.D19(),b=0;b<a.length;++b){var c=a[b];c instanceof TradingView.Series&&c.invalidateBarColorerCache()}};
|
|
TradingView.ChartModel.prototype.addStrategySource=function(a){~this.strategySources.indexOf(a)||this.strategySources.push(a);this.strategySources.change.fire()};TradingView.ChartModel.prototype.setActiveStrategySource=function(a){~this.strategySources.indexOf(a)&&this._activeStrategySource.setValue(a)};TradingView.ChartModel.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)};TradingView.ChartModel.prototype.getActiveStrategySource=function(){return this._activeStrategySource.value()};
|
|
TradingView.ChartModel.prototype.insertStudy=function(a,b,c){var d=null;TradingView.trackEvent("studies","Study_"+a.id);c||a.is_price_study?d=this.paneForSource(this.m_mainSeries):(d=this.createPane(void 0,!0),b&&b.paneSize&&d.setPaneSize(b.paneSize));"Compare@tv-basicstudies"==a.id&&(TradingView.trackEvent("compare","symbol:"+b.inputs.symbol),this.m_mainSeries.priceScale().properties().log.setValue(!1),this.m_mainSeries.priceScale().properties().percentage.setValue(!0));b=TradingView.prepareStudyProperties(a,
|
|
b,d,this.studyVersioning());b=TradingView.createStudy(this,b,this.mainSeries(),a);b.start();var e=b.metaInfo().priceScale||TradingView.StudyConsts.SCALE_RIGHT;e===TradingView.StudyConsts.SCALE_RIGHT?a=d.rightPriceScale():e===TradingView.StudyConsts.SCALE_LEFT?a=d.leftPriceScale():a.is_price_study?a=null:(console.warn("Cannot add study "+b.metaInfo().id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),a=d.rightPriceScale());c?d.addDataSource(b,null):d.addDataSource(b,
|
|
a);b.properties().linkedToSeries&&b.properties().linkedToSeries.value()&&b.setOwnerSource(this.mainSeries());b instanceof TradingView.StudyStrategy&&this.addStrategySource(b);this.recalculatePane(d);this.D20(new A22(A22.FULL_UPDATE));this._invalidateBarColorerCaches();this.recalcVisibleRangeStudy(this.D19(),!0);return b};
|
|
TradingView.ChartModel.prototype.replaceStudyStub=function(a,b){var c=this.paneForSource(a);if(null===c)return!1;var d=a.isNoScale()?null:a.priceScale(),e=a.zorder(),f=a.ownerSource();c.insertDataSource(b,d,e);b.setOwnerSource(f);this.removeSource(a);b.start();this.recalculatePane(c);this.D20(new A22(A22.FULL_UPDATE));return!0};
|
|
TradingView.ChartModel.prototype.insertStudyStub=function(a){var b=this.mainSeries(),b=this.paneForSource(b);a=new TradingView.StudyStub(this,null,a);b.addDataSource(a,null);this.recalculatePane(b);this.D20(new A22(A22.FULL_UPDATE));return a};TradingView.ChartModel.prototype.removeStudyStub=function(a){var b=this.dataSourceForId(a);if(void 0===b)return console.info("StudyStub id="+a+" is not found in chart model"),!1;this.removeSource(b);return!0};
|
|
TradingView.ChartModel.prototype.detachSource=function(a,b){var c=this.paneForSource(a);if(c){c.removeDataSource(a);if(c.isEmpty())return this._lineBeingCreated&&c==this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(c,b),!0;this.D20(new A22(A22.FULL_UPDATE));return!1}};
|
|
TradingView.ChartModel.prototype.removeSource=function(a,b){a===this.m_selectedSource&&this.setSelectedSource(null);a.stop&&a.stop();var c=this.detachSource(a,b);if(a.metaInfo&&a.metaInfo()&&"Compare@tv-basicstudies"===a.metaInfo().id){for(var d=this.paneForSource(this.m_mainSeries).D19(),e=0;e<d.length;e++)if(d[e].metaInfo&&"Compare@tv-basicstudies"===d[e].metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}this.D20(new A22(A22.FULL_UPDATE));
|
|
this._invalidateBarColorerCaches();a.linkKey&&TradingView.drawingState.removeLineTool({model:this,linkKey:a.linkKey});return c};
|
|
TradingView.ChartModel.prototype.move=function(a,b,c){var d=this.children(a),e=[a].concat(d),f=this.paneForSource(a);this.m_panes.indexOf(f);f.state();f.priceScaleName(a.priceScale());this.m_panes.indexOf(b);b&&b.state();c=b?b.priceScaleName(c):"right";if(f===b)for(b.move(a,b.priceScaleByName(c)),e=a.priceScale(),a=0;a<d.length;a++)b.move(d[a],e);else{for(a=0;a<e.length;a++)this.detachSource(e[a]);b=b?b:this.createPane();for(a=0;a<e.length;a++)b.addDataSource(e[a],b.priceScaleByName(c));this.D20(new A22(A22.FULL_UPDATE))}this.recalculateAllPanes()};
|
|
TradingView.ChartModel.prototype.isSingleInstanceLineTool=function(a){return"LineStudyMtpRiskReward"==a||"LineStudyMtpAnalysis"==a?!0:!1};TradingView.ChartModel.prototype._externalTimeStamp=function(a){return this.m_timeScale.points().roughTime(a)};
|
|
TradingView.ChartModel.prototype.createLineTool=function(a,b,c,d,e){TradingView.trackEvent("GUI","Add Line Tool");if(!TradingView.LineDataSourceFactory.isValid(c))return null;this.isSingleInstanceLineTool(c)&&this._undoModel.removeAllDrawingTools(c);TradingView.trackEvent("drawings","Study_Drawing_"+c);var f=TradingView.LineDataSourceFactory.create(c,this,d,null,a.mainDataSource());TradingView.drawingState.drawOnAllCharts().value()?f.linkKey=e||TradingView.randomHash():f.linkKey=e;f.toolname=c;f.setOwnerSource(a.mainDataSource());
|
|
var g=a.defaultPriceScale();a.addDataSource(f,g);var h;h=this.m_timeScale.indexToCoordinate(b.index);g=g.priceToCoordinate(b.price);f.isFixed()?h=f.addFixedPoint(new MathEx.Point(h,g)):(f.constructor.skipMagnetting||(b.price=this._magnet.align(b.price,b.index,a)),h=f.addPoint(b));h||(this._lineBeingCreated=f,this._paneBeingCreatedLineOn=a);this.D20(new A22(A22.FULL_UPDATE));e||!TradingView.drawingState.drawOnAllCharts().value()||f.properties().singleChartOnly||
|
|
(a=this._externalTimeStamp(b.index),TradingView.drawingState.createLineTool({point:{price:b.price,timeStamp:a},linetool:c,properties:d,symbol:this.mainSeries().symbol(),model:this,linkKey:f.linkKey}));return f};TradingView.ChartModel.prototype.lineBeingCreated=function(){return this._lineBeingCreated};TradingView.ChartModel.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn};
|
|
TradingView.ChartModel.prototype.coninueCreatingLine=function(a,b,c,d){var e=this.paneForSource(this._lineBeingCreated);e.defaultPriceScale();a.price=this._magnet.align(a.price,a.index,e);c=this._lineBeingCreated.addPoint(a,b,c);var f=this._lineBeingCreated;this._lineBeingCreated.updateAllViews();var g=new A22(A22.LIGHT_UPDATE),e=null;c&&(e={points:this._lineBeingCreated._timePoint.toArray(),interval:this.mainSeries().interval()},this._lineBeingCreated=
|
|
this._paneBeingCreatedLineOn=null,g.force=!0);this.D20(g);d||!TradingView.drawingState.drawOnAllCharts().value()||f.properties().singleChartOnly||(d=this._externalTimeStamp(a.index),TradingView.drawingState.continueLineTool({point:{price:a.price,timeStamp:d},envState:b,finalState:e,model:this}));return c};
|
|
TradingView.ChartModel.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var a=this._lineBeingCreated;this.removeSource(this._lineBeingCreated);this._lineBeingCreated=null;this._lineCancelled.fire();TradingView.drawingState.drawOnAllCharts().value()&&!a.properties().singleChartOnly&&TradingView.drawingState.cancelLineTool({model:this})}};
|
|
TradingView.ChartModel.prototype.startChangingLinetool=function(a,b,c,d){this._lineBeingEdited=a;this._linePointBeingEdited=c;this._lineBeingEdited.startChanging(c,b);var e=this.paneForSource(a);b.price=this._magnet.align(b.price,b.index,e);this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(c,b);this._lineBeingEdited.setPoint(c,b,d);this._lineBeingEdited.updateAllViews();d=this._paneInvalidationMask(e,A22.LIGHT_UPDATE);d.force=!0;this.D20(d);a.linkKey&&
|
|
!a.properties().singleChartOnly&&(d=this._externalTimeStamp(b.index),TradingView.drawingState.startChangingLineTool({linkKey:a.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:b.price,timeStamp:d},pointIndex:c}))};TradingView.ChartModel.prototype.lineBeingEdited=function(){return this._lineBeingEdited};TradingView.ChartModel.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited};
|
|
TradingView.ChartModel.prototype.changeLinePoint=function(a,b){var c=this.paneForSource(this._lineBeingEdited),d,e;void 0!==a.x&&void 0!==a.y?(d=this._lineBeingEdited.priceScale().coordinateToPrice(a.y),e=Math.round(this.timeScale().coordinateToIndex(a.x)),d=this._magnet.align(d,e,c),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:d,index:e},b)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,a,b);this._lineBeingEdited.updateAllViews();this.D20(new A22(A22.LIGHT_UPDATE));
|
|
this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(c=this._externalTimeStamp(e),TradingView.drawingState.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:d,timeStamp:c}}))};
|
|
TradingView.ChartModel.prototype.endChangingLinetool=function(a){this.paneForSource(this._lineBeingEdited);var b=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,a);this._linePointBeingEdited=this._lineBeingEdited=null;a=new A22(A22.LIGHT_UPDATE);a.force=!0;this.D20(a);a={points:b._timePoint.toArray(),interval:this.mainSeries().interval()};b.linkKey&&!b.properties().singleChartOnly&&TradingView.drawingState.finishChangingLineTool({model:this,
|
|
linkKey:b.linkKey,symbol:this.mainSeries().symbol(),finalState:a})};
|
|
TradingView.ChartModel.prototype.startMovingSource=function(a,b,c){this._sourceBeingMoved=a;this._linePointBeingMoved=c;this._sourceBeingMoved.startMoving(b,c);c=this.paneForSource(this._sourceBeingMoved);c=this._paneInvalidationMask(c,A22.LIGHT_UPDATE);c.force=!0;this.D20(c);a.linkKey&&!a.properties().singleChartOnly&&(c=this._externalTimeStamp(b.index),TradingView.drawingState.startMovingLineTool({linkKey:a.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:b.price,
|
|
timeStamp:c}}))};TradingView.ChartModel.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved};
|
|
TradingView.ChartModel.prototype.moveSource=function(a){this._sourceBeingMoved.move(a,this._linePointBeingMoved);this.paneForSource(this._sourceBeingMoved);this.D20(new A22(A22.LIGHT_UPDATE));if(this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var b=this._externalTimeStamp(a.index);TradingView.drawingState.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:a.price,timeStamp:b}})}};
|
|
TradingView.ChartModel.prototype.endMovingSource=function(a){var b=this._sourceBeingMoved,c=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(a);this._linePointBeingMoved=this._sourceBeingMoved=null;a=this._paneInvalidationMask(c,A22.LIGHT_UPDATE);a.invalidateAll(A22.LIGHT_UPDATE);a.force=!0;this.D20(a);b instanceof R47&&(a={points:b._timePoint.toArray(),interval:this.mainSeries().interval()},b.linkKey&&
|
|
!b.properties().singleChartOnly&&TradingView.drawingState.finishMovingLineTool({linkKey:b.linkKey,model:this,finalState:a}))};TradingView.ChartModel.prototype.finishLineTool=function(a){var b=this.lineBeingCreated();this.lineBeingCreated().finish();!a&&TradingView.drawingState.drawOnAllCharts().value()&&b.linkKey&&!b.properties().singleChartOnly&&TradingView.drawingState.finishLineTool({linkKey:b.linkKey,model:this})};
|
|
TradingView.ChartModel.prototype.calculateDefaultTags=function(){for(var a=[],b=this.D19(),c=0;c<b.length;c++){var d=b[c];d.tags&&(a=a.concat(d.tags()))}return a};TradingView.ChartModel.prototype.changeZOrder=function(a,b){this.paneForSource(a).changeZOrder(a,b);this.D20(new A22(A22.FULL_UPDATE))};TradingView.ChartModel.prototype.sendToBack=function(a){this.paneForSource(a).sendToBack(a);this.D20(new A22(A22.FULL_UPDATE))};
|
|
TradingView.ChartModel.prototype.bringToFront=function(a){this.paneForSource(a).bringToFront(a);this.D20(new A22(A22.FULL_UPDATE))};TradingView.ChartModel.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.ChartModel.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()};TradingView.ChartModel.prototype.setTimeViewport=function(a,b){this.timeScale().zoomToBarsRange(a,b);this.recalculateAllPanes();this.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.zoomToViewport=function(a,b,c,d,e){this.setTimeViewport(a,b);a=Math.min(c,d);c=Math.max(c,d);d=e.defaultPriceScale();d.setAutoScale(!1);d.isLog()&&(a=d.priceToLogical(a),c=d.priceToLogical(c));d.setPriceRange(new PriceRange(a,c));this.recalculateAllPanes();this.D20(this._paneInvalidationMask(e,A22.LIGHT_UPDATE))};
|
|
TradingView.ChartModel.prototype.clearAllStudies=function(){for(var a=this.D19(),b=0;b<a.length;b++)a[b].clearData&&a[b].clearData()};TradingView.ChartModel.prototype.allLineTools=function(){for(var a=[],b=this.m_panes,c=b.length,d=0;d<c;++d)for(var e=b[d].D19(),f=e.length,g=0;g<f;++g){var h=e[g];TradingView.isInherited(h.constructor,R47)&&a.push(h)}return a};TradingView.ChartModel.prototype.backgroundColor=function(){return this.D2.paneProperties.background._value};
|
|
TradingView.ChartModel.prototype.backgroundCounterColor=function(){return(new TradingView.RGBColor(this.backgroundColor())).blackWhiteContrast()};TradingView.ChartModel.prototype.isDark=function(){return"white"===this.backgroundCounterColor()};TradingView.ChartModel.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()};TradingView.ChartModel.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()};
|
|
TradingView.ChartModel.prototype.updateAllVolumeStudies=function(){for(var a=this.m_panes,b=a.length;b--;)for(var c=!1,d=a[b],e=d.D19(),f=e.length;f--;){var g=e[f];g instanceof TradingView.Study&&"Volume"===g.metaInfo().shortId&&(g.updateAllViews(),c||(this.updatePane(d),c=!0))}};
|
|
TradingView.ChartModel.prototype._prepareAlertsList=function(){function a(){for(var a=f._alertsList.toArray(),b=0;b<a.length;b++)d(a[b].id())}function b(){var b=f.mainSeries().symbolInfo()?f.mainSeries().symbolInfo().full_name:null,d=f.mainSeries().properties().interval.value();b&&d&&is_authenticated?TradingView.alertsDispatcher.requestList({success:function(b){a();for(var d=0;d<b.length;d++)c(b[d])},error:a,symbol:b,resolution:d,activeOnly:!0}):a()}function c(a){a instanceof TradingView.Alert&&(d(a),
|
|
(a.active()||a.fake())&&(f.mainSeries().symbolInfo()?f.mainSeries().symbolInfo().full_name:null)===a.symbol()&&(f._alertsList.append(a),f._alertsList.onAdd.fire(a)))}function d(a){var b=a instanceof TradingView.Alert?a.id():a;if(a=f._alertsList.find(function(a){return a.id()===b}))f._alertsList.removeAll(function(a){return a.id()===b}),f._alertsList.onRemove.fire(a)}function e(e){TradingView.alertsDispatcher.alertCreatingStarted[e](f,c);TradingView.alertsDispatcher.alertRunning[e](f,c);TradingView.alertsDispatcher.alertDeletingStarted[e](f,
|
|
d);TradingView.alertsDispatcher.alertDeletingAllStarted[e](f,b);TradingView.alertsDispatcher.alertDeleted[e](f,d);TradingView.alertsDispatcher.alertStoppingStarted[e](f,d);TradingView.alertsDispatcher.alertStoppingAllStarted[e](f,b);TradingView.alertsDispatcher.alertStopped[e](f,d);f.mainSeries().onSymbolResolved()[e](f,b);f.mainSeries().onSymbolError()[e](f,a);f.mainSeries().properties().interval[e](f,b)}var f=this;f._alertsList.add=c;f._alertsList.remove=d;loginStateChange.subscribe(f,function(){is_authenticated?
|
|
(b(),e("subscribe")):(a(),e("unsubscribe"))});is_authenticated&&(b(),e("subscribe"))};TradingView.ChartModel.prototype.alertsList=function(){return this._alertsList};TradingView.ChartModel.prototype._modelIntervals=[];TradingView.ChartModel.prototype.setInterval=function(a,b){var c=setInterval(a,b);this._modelIntervals.push(c);return c};TradingView.ChartModel.prototype.clearInterval=function(a){clearInterval(a);a=this._modelIntervals.indexOf(a);-1<a&&this._modelIntervals.splice(a,1)};
|
|
TradingView.ChartModel.prototype.clearIntervals=function(){for(var a=0;a<this._modelIntervals.length;a++)clearInterval(this._modelIntervals[a]);this._modelIntervals=[]};TradingView.ChartModel.prototype.destroy=function(){this.clearIntervals()};TradingView.ChartModel.prototype.countUserStudies=function(){for(var a=0,b=0;b<this.m_panes.length;b++)for(var c=this.m_panes[b].D19(),d=0;d<c.length;d++){var e=c[d];e instanceof TradingView.Study&&e.showInObjectTree()&&a++}return a};
|
|
TradingView.ChartModel.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()};
|
|
TradingView.ChartModel.prototype.copyToOtherCharts=function(a){a.linkKey=a.linkKey||TradingView.randomHash();var b=this;a={props:a.properties().state(),points:a._timePoint.toArray().map(function(a){var d=b.timeScale().timePointToIndex(a.time_t)+a.offset;return{price:a.price,time_t:a.time_t,offset:a.offset,absolute_time:b.timeScale().points().roughTime(d)}}),linkKey:a.linkKey,linetool:a.getType(),model:this,symbol:this.mainSeries().symbol()};TradingView.drawingState.copyLineTool(a)};TradingView.DataWindowItem=function(a,b){this.m_title=a;this.m_value=b;this._visible=!0;this._color=void 0};TradingView.DataWindowItem.prototype.title=function(){return this.m_title};TradingView.DataWindowItem.prototype.text=function(){return this.m_value};TradingView.DataWindowItem.prototype.visible=function(){return this._visible};TradingView.DataWindowItem.prototype.color=function(){return this._color};TradingView.DataWindowItem.prototype.setVisible=function(a){this._visible=a};
|
|
TradingView.DataWindowItem.prototype.setValue=function(a){this.m_value=a};TradingView.DataWindowItem.prototype.setColor=function(a){this._color=a};TradingView.DataWindowItem.prototype.value=function(){return this.m_value};TradingView.DataWindowView=function(){this._title=this._header="";this._items=new List};TradingView.DataWindowView.prototype.header=function(){return this._header};TradingView.DataWindowView.prototype.title=function(){return this._title};
|
|
TradingView.DataWindowView.prototype.items=function(){return this._items};TradingView.DataWindowView.prototype.update=function(){};TradingView.StatusView=function(a){this._props=a;this._text="";this._size="12px";this._bold=!1};TradingView.StatusView.prototype.text=function(){return this._text};TradingView.StatusView.prototype.setText=function(a){this._text=a};TradingView.StatusView.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#444"};TradingView.StatusView.prototype.bold=function(){return this._bold};TradingView.StatusView.prototype.size=function(){return this._size};function PriceAxisView(){this._text="";this._background="#585858";this._coordinate=0}PriceAxisView.prototype.text=function(){return this._text};PriceAxisView.prototype.background=function(){return this._background};PriceAxisView.prototype.color=function(){return(new TradingView.RGBColor(this._background)).blackWhiteContrast()};PriceAxisView.prototype.coordinate=function(){return this._coordinate};TradingView.PriceAxisViewRenderer=function(a,b){this._data=a;this._data.borderColor||(this._data.borderColor=this._data.background);this._textWidthCache=b};TradingView.PriceAxisViewRenderer.prototype.height=function(a){return this._data.secondLine&&a?2.2*this._data.textHeight+2:1.1*this._data.textHeight};TradingView.PriceAxisViewRenderer.prototype.measureText=function(a,b){return this._textWidthCache?this._textWidthCache.measureText(a,b):a.measureText(b).width};
|
|
TradingView.PriceAxisViewRenderer.prototype.draw=function(a,b,c,d){function e(a,b,c,d){$.browser.webkit?--d:$.browser.mozilla?d+=1:$.browser.jsdom&&(d+=.5);a.fillText(b,c,d)}if(this._data.visible){var f;this._data.font&&(f=a.font,a.setFont(this._data.font));var g=this.measureText(a,this._data.text);a.strokeStyle=this._data.borderColor;a.fillStyle=this._data.background;a.lineWidth=1;d=Math.round(1.1*this._data.textHeight);var h=this._data.coordinate,k=Math.round(h-.5*d)-.5,l=k,m=l+d+1,n=m,p,r,t,v,
|
|
w;if(this._data.text){if(b){p=c-1.5;t=r=p-g-9-2;w=v=p;var u=w-3;a.beginPath();a.moveTo(p,k);a.lineTo(r,l);a.lineTo(t,m);a.lineTo(v,n);a.fill();a.beginPath();a.strokeStyle=this._data.color;a.moveTo(w,h);a.lineTo(u,h);a.stroke();a.textBaseline="middle";a.textAlign="left";a.fillStyle=this._data.color;w=p-g-.4*d}else p=.5,t=r=p+g+9+2,w=v=p,u=w+3,a.beginPath(),a.moveTo(p,k),a.lineTo(r,l),a.lineTo(t,m),a.lineTo(v,n),a.fill(),a.beginPath(),a.strokeStyle=this._data.color,a.moveTo(w,h),a.lineTo(u,h),a.stroke(),
|
|
a.textBaseline="middle",a.textAlign="left",a.fillStyle=this._data.color,w=p+.4*d;e(a,this._data.text,w,h+1);this._data.font&&a.setFont(f)}this._data.secondLine&&(f=this.measureText(a,this._data.secondLine),a.fillStyle=this._data.background,this._data.text&&(k=m+1,l=n+1,m=k+d,n=l+d),b?this._data.text?(p=p-g-9-2,r=p+f+4+3):(p=c-f-4-3,r=p+f+2+3):0<g-f?(p=.5+g-f+4,r=g+9+2+.5):(p=.5,r=f+3+5),v=p,t=r,w=p+2,a.beginPath(),a.moveTo(p,k),a.lineTo(r,l),a.lineTo(t,m),a.lineTo(v,n),a.fill(),a.textBaseline="middle",
|
|
a.textAlign="left",a.fillStyle=this._data.color,b=this._data.coordinate,this._data.text&&(b+=d+2),e(a,this._data.secondLine,w,b))}};TradingView.TimeAxisView=function(){this._text="";this._background="#585858";this._coordinate=0};TradingView.TimeAxisView.prototype.text=function(){return this._text};TradingView.TimeAxisView.prototype.background=function(){return this._background};TradingView.TimeAxisView.prototype.color=function(){return(new TradingView.RGBColor(this._background)).blackWhiteContrast()};TradingView.TimeAxisView.prototype.coordinate=function(){return this._coordinate};TradingView.TimeAxisViewRenderer=function(a){this._data=a};
|
|
TradingView.TimeAxisViewRenderer.prototype.draw=function(a,b,c){if(!1!==this._data.visible&&(this._cacheFont!=a.font&&(this._cacheFont=a.font,this._cache=new TradingView.TextWidthCache),b=this._cache.measureText(a,this._data.text),!(0>=b))){c=b+6;b=Math.round(this._data.coordinate-.5*c-1.5)+1.5;c=b+c+3;var d=Math.round(this._data.coordinate+1),e=this._data.textHeight+6+.5;a.fillStyle=this._data.background;a.lineWidth=1;a.beginPath();a.moveTo(b,.5);a.lineTo(b,e);a.lineTo(c,e);a.lineTo(c,.5);a.fill();
|
|
a.strokeStyle=this._data.color;a.beginPath();a.moveTo(d,.5);a.lineTo(d,3.5);a.stroke();a.textBaseline="middle";a.textAlign="left";a.fillStyle=this._data.color;$.browser.webkit?a.fillText(this._data.text,b+3+1,.5*(.5+e)+1):a.fillText(this._data.text,b+3+1,.5*(.5+e)+2)}};TradingView.CrossHair=function(a,b){var c=this;DataSource.call(this);this.D2=b;this.D0=a;this._dataWindowView=new TradingView.CrossHairDataWindowView(this,a);this._priceAxisView=new TradingView.CrossHairPriceAxisView(this,a);this._startMeasurePriceAxisView=new TradingView.CrossHairPriceAxisView(this,a,"measureStartY");this._endMeasurePriceAxisView=new TradingView.CrossHairPriceAxisView(this,a,"measureEndY");this._timeAxisView=new TradingView.CrossHairTimeAxisView(this,a);this._startMeasureTimeAxisView=
|
|
new TradingView.CrossHairTimeAxisView(this,a,"measureStartX");this._endMeasureTimeAxisView=new TradingView.CrossHairTimeAxisView(this,a,"measureEndX");this.visible=!0;a.readOnly()?this.areLinesVisible=!0:TradingView.drawingState.cursorTool.subscribe(function(a){c.areLinesVisible="arrow"!==a},{callWithLast:!0});this._subscribed=!1};inherit(TradingView.CrossHair,DataSource);TradingView.CrossHair.prototype.index=0;TradingView.CrossHair.prototype.price=NaN;TradingView.CrossHair.prototype.pane=null;
|
|
TradingView.CrossHair.prototype.color="white";TradingView.CrossHair.prototype.style="";TradingView.CrossHair.prototype.properties=function(){return this.D2};
|
|
TradingView.CrossHair.prototype.setPosition=function(a,b,c){this._subscribed||(this.D0.mainSeries().onRestarted().subscribe(this,TradingView.CrossHair.prototype.clearMeasure),this._subscribed=!0);this.setLockedPosition(c);this.index=a;this.x=this.D0.timeScale().indexToCoordinate(a);c&&!c.defaultPriceScale().isEmpty()?(this.price=b,this.y=c.defaultPriceScale().priceToCoordinate(b),this.pane=c):(this.y=this.price=NaN,this.pane=null);this.visible=!0;this.updateAllViews()};
|
|
TradingView.CrossHair.prototype.setLockedPosition=function(a){delete this.lockedIndex;delete this.lockedX;a!==this._measurePane&&TradingView.drawingState.lockTimeAxis().value()&&(this.lockedIndex=this.D0.timeScale().points().roughIndex(TradingView.drawingState.lockTimeAxisTime.value()),this.lockedX=this.D0.timeScale().indexToCoordinate(this.lockedIndex))};
|
|
TradingView.CrossHair.prototype.clearPosition=function(){this.visible=!1;this.index=parseInt(this.D0.mainSeries().data().bars().last());this.y=this.price=NaN;this.pane=null};TradingView.CrossHair.prototype.measureStartY=function(){var a=this._startMeasurePoint.price,b=this._measurePane;if(b.defaultPriceScale().isPercent())var c=b.mainDataSource().firstValue(),a=b.defaultPriceScale().priceRange().convertToPercent(a,c);return b.defaultPriceScale().priceToCoordinate(a)};
|
|
TradingView.CrossHair.prototype.measureStartX=function(){return this.D0.timeScale().indexToCoordinate(this._startMeasurePoint.index)};TradingView.CrossHair.prototype.measureEndY=function(){var a=this._endMeasurePoint.price,b=this._measurePane;if(b.defaultPriceScale().isPercent())var c=b.mainDataSource().firstValue(),a=b.defaultPriceScale().priceRange().convertToPercent(a,c);return b.defaultPriceScale().priceToCoordinate(a)};TradingView.CrossHair.prototype.measureEndX=function(){return this.D0.timeScale().indexToCoordinate(this._endMeasurePoint.index)};
|
|
TradingView.CrossHair.prototype.paneViews=function(a){var b=[new J65(this,a,a===this.pane)];a===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new J64(this,a)),this._measurePaneView.update(),b.push(this._measurePaneView));TradingView.drawingState.lockTimeAxis().value()&&b.push(this._timeLockPaneView=this._timeLockPaneView||new TradingView.CrossHairLockPaneView(this,a));return b};
|
|
TradingView.CrossHair.prototype.dataWindowView=function(){return this._dataWindowView};TradingView.CrossHair.prototype.priceAxisViews=function(a,b){if(!this.visible||this.pane!==a||b!==a.defaultPriceScale())return null;var c=[this._priceAxisView];this._startMeasurePoint&&c.push(this._startMeasurePriceAxisView);this._endMeasurePoint&&c.push(this._endMeasurePriceAxisView);return c};
|
|
TradingView.CrossHair.prototype.timeAxisView=function(){if(!this.visible&&!TradingView.drawingState.lockTimeAxis().value())return null;var a=[this._timeAxisView];this._startMeasurePoint&&a.push(this._startMeasureTimeAxisView);this._endMeasurePoint&&a.push(this._endMeasureTimeAxisView);return a};
|
|
TradingView.CrossHair.prototype.updateAllViews=function(){this._priceAxisView.update();this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),this._startMeasureTimeAxisView.update());this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update());this._timeAxisView.update()};TradingView.CrossHair.prototype.startMeasurePoint=function(){return this._startMeasurePoint};
|
|
TradingView.CrossHair.prototype.startMeasuring=function(a,b){if(b.defaultPriceScale().isPercent()){var c=b.mainDataSource().firstValue();a.price=b.defaultPriceScale().priceRange().convertFromPercent(a.price,c)}this._startMeasurePoint=a;this._measurePane=b};
|
|
TradingView.CrossHair.prototype.finishMeasure=function(a){var b=this._measurePane;if(b.defaultPriceScale().isPercent()){var c=b.mainDataSource().firstValue();a.price=b.defaultPriceScale().priceRange().convertFromPercent(a.price,c)}this._endMeasurePoint=a};TradingView.CrossHair.prototype.endMeasurePoint=function(){return this._endMeasurePoint};
|
|
TradingView.CrossHair.prototype.clearMeasure=function(a){delete this._measurePane;delete this._startMeasurePoint;delete this._endMeasurePoint;delete this._lastValidMeasurePoint;this.D0.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.CrossHair.prototype.measurePoints=function(){this.updateAllViews();var a=new List;a.append(this._startMeasurePoint);if(this._endMeasurePoint)a.append(this._endMeasurePoint);else{this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index});var b=this._lastValidMeasurePoint.rawPrice,c=this._measurePane,d=c.defaultPriceScale();d.isPercent()&&!d.isEmpty()&&(c=c.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=
|
|
d.priceRange().convertFromPercent(b,c));a.append(this._lastValidMeasurePoint)}return a};TradingView.CrossHair.prototype.currentPoint=function(){return new MathEx.Point(this.x,this.y)};TradingView.CrossHair.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index};TradingView.CrossHair.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x};
|
|
J64=function(a,b){this.R99=a;this._pane=b;this._rendererCache={}};
|
|
J64.prototype.update=function(){var a,b;if(this.R99._endMeasurePoint)a=this.R99._endMeasurePoint.price,b=this.R99._endMeasurePoint.index;else if(this.R99._measurePane===this.R99.pane)a=this.R99.price,b=this.R99.index;else if(this.R99._lastValidMeasurePoint)a=this.R99._lastValidMeasurePoint.rawPrice,b=this.R99._lastValidMeasurePoint.index;else return;var c=a-this.R99._startMeasurePoint.price,d=b-this.R99._startMeasurePoint.index,
|
|
e=this.R99._startMeasurePoint.price,f=this.R99._measurePane;if(f.defaultPriceScale().isPercent()){var g=f.mainDataSource().firstValue();this.R99._endMeasurePoint&&(a=f.defaultPriceScale().priceRange().convertToPercent(a,g));e=f.defaultPriceScale().priceRange().convertToPercent(e,g)}f=this.R99._measurePane.defaultPriceScale().formatter().format(c);this.R99._startMeasurePoint.price&&(g=c/this.R99._startMeasurePoint.price,f+=" ("+(new TradingView.PercentageFormatter).format(100*
|
|
g)+")");this._label=""+f+"\n"+$.t("{0} bars").format(d);e=this.R99.D0._magnet.align(e,this.R99._startMeasurePoint.index,this.R99._measurePane);a=this.R99.D0._magnet.align(a,b,this.R99._measurePane);var g=this.R99.D0.timeScale().indexToCoordinate(this.R99._startMeasurePoint.index),h=this.R99.D0.timeScale().indexToCoordinate(b),e=this.R99._measurePane.defaultPriceScale().priceToCoordinate(e);a=this.R99._measurePane.defaultPriceScale().priceToCoordinate(a);
|
|
this._p1=new MathEx.Point(g,e);this._p2=new MathEx.Point(h,a);a=this.R99.D0.timeScale().indexToUserTime(this.R99._startMeasurePoint.index);e=this.R99.D0.timeScale().indexToUserTime(b);b=this.R99._measurePane.mainDataSource().base();if(a&&e||b)a=(e.valueOf()-a.valueOf())/1E3,c=Math.round(c*b),this._label=""+f+" , "+c+"\n"+$.t("{0} bars").format(d)+", "+(new TradingView.TimeSpanFormatter).format(a)};
|
|
J64.prototype.renderer=function(){var a=new TradingView.CompositeRenderer,b={};b.points=(new List).append(this._p1).append(this._p2);b.width=this.R99.D0.timeScale().width();b.height=this.R99._measurePane.defaultPriceScale().height();b.color="#D3E7FF";b.linewidth=0;b.fillBackground=!0;b.transparency=60;b.backcolor="#BADAFF";a.append(new TradingView.RectangleRenderer(b));var c=this._p1.add(this._p2).scaled(.5),d=new MathEx.Point(this._p1.x,c.y),e=new MathEx.Point(this._p2.x,
|
|
c.y),d={points:(new List).append(d).append(e),width:b.width,height:b.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_ARROW};a.append(new TradingView.TrendLineRenderer(d));d=new MathEx.Point(c.x,this._p1.y);e=new MathEx.Point(c.x,this._p2.y);d={points:(new List).append(d).append(e),width:b.width,height:b.height,color:"#646668",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,
|
|
extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_ARROW};a.append(new TradingView.TrendLineRenderer(d));c=this._p1.x>this._p2.x?this._p1.x:this._p2.x;c=new MathEx.Point(c,.5*(this._p1.y+this._p2.y)-15);b=this._label;b={points:(new List).append(c),text:b,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:10,offsetY:0,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:TradingView.generateColor("#000000",
|
|
30),backgroundTransparency:20,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4};a.append(new TextRenderer(b,this._rendererCache));return a};J65=function(a,b,c){this.source=a;this.pane=b;this._horzVisible=c};J65.prototype.update=function(){};
|
|
J65.prototype.renderer=function(){var a={},b=this.source.visible&&this.source.areLinesVisible,c=TradingView.drawingState.lockTimeAxis().value();a.horzLinesVisible=b&&this._horzVisible;a.vertLinesVisible=b||c;var c=(b=this.pane.D0.readOnly())?defaults("chartproperties.paneProperties.crossHairProperties"):null,d=TradingView.isMobile.any()&&R47.isLineTool(this.source.D0.currentTool()),e=d?"#a000a0":b?c.color:this.pane.D0.properties().paneProperties.crossHairProperties.color.value(),
|
|
f=b?c.transparency:this.pane.D0.properties().paneProperties.crossHairProperties.transparency.value();!d&&0<f&&(e=TradingView.generateColor(e,f));a.color=e;a.lineWidth=b?c.width:this.pane.D0.properties().paneProperties.crossHairProperties.width.value();a.lineStyle=b?c.style:this.pane.D0.properties().paneProperties.crossHairProperties.style.value();a.drawCenter=d&&this.pane==this.source.pane;a.w=this.pane.width();a.h=this.pane.height();a.x=isFinite(this.source.lockedX)&&this.source.lockedX||
|
|
this.source.x;a.y=this.source.y;return new R62(a)};TradingView.CrossHairLockPaneView=function(a,b,c){this.source=a;this.pane=b;this._axis=c||"x"};TradingView.CrossHairLockPaneView.prototype.update=function(){};
|
|
TradingView.CrossHairLockPaneView.prototype.renderer=function(){var a=this.source.visible&&this.source.areLinesVisible,b=TradingView.drawingState.lockTimeAxis().value(),c=a&&this._horzVisible;if(("y"!=this._axis||c)&&(a||b))return a="y"==this._axis?this.pane.width()-4.5:this.source.lockedX+1,b="y"==this._axis?this.source.y:this.pane.height()-5.5-1,new TradingView.PaneRendererCrossHairLock({x:a,y:b,width:9,height:11,bodyHeight:7})};TradingView.CrossHairPriceAxisView=function(a,b){this._crossHair=a;this.D0=b;this._rendererData={background:"#585858",color:"white",textHeight:14,visible:!0};this._defaultFormatter=new TradingView.PriceFormatter(100)};inherit(TradingView.CrossHairPriceAxisView,PriceAxisView);
|
|
TradingView.CrossHairPriceAxisView.prototype.update=function(){var a=this._rendererData,b=this._crossHair.pane;a.coordinate=this._crossHair.y;this.text="";if(b&&this._crossHair.visible&&(b=b.defaultPriceScale(),!b.isEmpty())){var c;c=(c=b.mainSource())?c.formatter():this._defaultFormatter;a.text=c.format(this._crossHair.price);a.textHeight=b.m_markBuilder.fontHeight()}};
|
|
TradingView.CrossHairPriceAxisView.prototype.renderer=function(){this._renderer||(this._renderer=new TradingView.PriceAxisViewRenderer(this._rendererData));return this._renderer};TradingView.CrossHairTimeAxisView=function(a,b){TradingView.TimeAxisView.call(this);this._crosshair=a;this.D0=b;this._rendererData={visible:!1,background:"#585858",color:"white",textHeight:14,text:""}};inherit(TradingView.CrossHairTimeAxisView,TradingView.TimeAxisView);
|
|
TradingView.CrossHairTimeAxisView.prototype.update=function(){var a=this._rendererData,b=this.D0.timeScale();a.coordinate=this._crosshair.appliedX();(b=b.indexToUserTime(this._crosshair.appliedIndex()))?(a.visible=!0,a.text=(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(b)):(a.visible=!1,a.text="")};TradingView.CrossHairTimeAxisView.prototype.renderer=function(){var a=this._rendererData;this._renderer||(this._renderer=new TradingView.TimeAxisViewRenderer(a));return this._renderer};TradingView.CrossHairDataWindowView=function(a,b){TradingView.DataWindowView.call(this);this._header=null;this._crossHair=a;this.D0=b;this._items.append(new TradingView.DataWindowItem("Date",""));this._items.append(new TradingView.DataWindowItem("Time",""));this._items.append(new TradingView.DataWindowItem("Price",""));this._defaultFormatter=new TradingView.PriceFormatter(100)};inherit(TradingView.CrossHairDataWindowView,TradingView.DataWindowView);
|
|
TradingView.CrossHairDataWindowView.prototype.update=function(){var a=this.D0.mainSeries().isDWM();this._items.item(1).setVisible(!a);this._items.item(0).setValue("n/a");this._items.item(1).setValue("n/a");this._items.item(2).setValue("n/a");if(!this.D0.timeScale().isEmpty()){var b=this._crossHair.appliedIndex(),b=this.D0.timeScale().indexToUserTime(b);null===b?(this._items.item(0).setValue("n/a"),a||this._items.item(1).setValue("n/a")):(this._items.item(0).setValue((new TradingView.DateFormatter).format(b)),
|
|
a||this._items.item(1).setValue((new TradingView.TimeFormatter).format(b)));if(a=this._crossHair.pane)a=a.defaultPriceScale(),a.isEmpty()||(a=(a=a.mainSource())?a.formatter():this._defaultFormatter,this._items.item(2).setValue(a.format(this._crossHair.price)))}};TradingView.MAMetaInfo=function(){return new TradingView.StudyMetaInfo({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})};
|
|
TradingView.VolumeMetaInfo=function(){return new TradingView.StudyMetaInfo({id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}})};
|
|
TradingView.DMMetaInfo=function(){return new TradingView.StudyMetaInfo({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})};
|
|
TradingView.RSIMetaInfo=function(){return new TradingView.StudyMetaInfo({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})};TradingView.makeDefaultChartModel=function(a,b,c,d,e,f,g,h){a=new R78(a,b,c,d,e,f,g,h);a.model().D20(new A22(A22.FULL_UPDATE));return a};TradingView.Grid=function(){this.horzLinesVisible=this.visible=!0;this.horzLinesColor="white";this.horzLinesStyle="";this.vertLinesVisible=!0;this.vertLinesColor="white";this.vertLinesStyle=""};TradingView.Grid.prototype.paneViews=function(a){return[new J83(this,a)]};J83=function(a,b){this.source=a;this.pane=b};J83.prototype.update=function(){};
|
|
J83.prototype.renderer=function(){var a={};if(this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty())return null;a.horzLinesVisible=!0;a.vertLinesVisible=!0;a.horzLinesColor=this.pane.D0.properties().paneProperties.horzGridProperties.color.value();a.vertLinesColor=this.pane.D0.properties().paneProperties.vertGridProperties.color.value();a.horzLineStyle=this.pane.D0.properties().paneProperties.horzGridProperties.style.value();a.vertLineStyle=this.pane.D0.properties().paneProperties.vertGridProperties.style.value();
|
|
a.priceMarks=this.pane.defaultPriceScale().marks();a.timeMarks=this.pane.timeScale().marks();a.w=this.pane.width();a.h=this.pane.height();return new R65(a)};R65=function(a){this.data=a};
|
|
R65.prototype.draw=function(a){a.lineWidth=1;if(this.data.vertLinesVisible){a.strokeStyle=this.data.vertLinesColor;CanvasEx.setLineStyle(a,this.data.vertLineStyle);a.beginPath();for(var b=0;b<this.data.timeMarks.length;b++)a.moveTo(this.data.timeMarks[b].coord+1,0),a.lineTo(this.data.timeMarks[b].coord+1,this.data.h);a.stroke()}if(this.data.horzLinesVisible){a.strokeStyle=this.data.horzLinesColor;CanvasEx.setLineStyle(a,this.data.horzLineStyle);a.beginPath();for(b=0;b<this.data.priceMarks.length;b++)a.moveTo(0,
|
|
this.data.priceMarks[b].coord),a.lineTo(this.data.w,this.data.priceMarks[b].coord);a.stroke()}};TradingView.Watermark=function(a){var b=null,c={},d=a.model().properties().symbolWatermarkProperties,e={renderer:function(){var e=b.width(),g=b.height();return{draw:function(b){var k=a.symbolInfo();if(k){b.fillStyle=d.color.value();var l=(100-d.transparency.value())/100;if(0!==l){b.globalAlpha=l;for(var k=[{text:k.name?k.name+", "+TradingView.translatedIntervalString(a.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:k.description||"",font:"48px Verdana, Arial, sans-serif",
|
|
lineHeight:57,baselineOffset:43.5}],m=l=0;m<k.length;m++){var n=k[m];if(n.text){b.font=n.font;var p;p=b;var r=n.text,t=p.font;c.hasOwnProperty(t)||(c[t]={});c[t].hasOwnProperty(r)||(c[t][r]=p.measureText(r).width);p=c[t][r];p>e?(n.zoom=e/p,p=e):n.zoom=1;n.offsetLeft=(e-p)/2;l+=n.lineHeight*n.zoom}}l=Math.max((g-l)/2,0);for(m=0;m<k.length;m++)n=k[m],n.text&&(b.save(),b.font=n.font,b.translate(n.offsetLeft,l),b.scale(n.zoom,n.zoom),b.fillText(n.text,0,n.baselineOffset),b.restore(),l+=n.lineHeight*n.zoom)}}}}},
|
|
update:function(){}};this.paneViews=function(a){if(!a.containsMainSeries())return[];b=a;return[e]}};function R75(a,b,c){var d=this;this.m_timeScale=a;a=b.rightAxisProperties.state();a.autoScale=!0;this.m_rightPriceScale=new R76(new Property(a));this.m_rightPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});this.m_rightPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});
|
|
a=b.leftAxisProperties.state();a.autoScale=!0;this.m_leftPriceScale=new R76(new Property(a));this.m_leftPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});this.m_leftPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.D20(new A22(A22.LIGHT_UPDATE))});
|
|
this.m_dataSources=[];this.m_width=this.m_height=0;this.m_mainDataSource=null;this.D2=b;this.D0=c;this._tagsChanged=new Delegate;b.topMargin.listeners().subscribe(this,R75.prototype._updateMargins);b.bottomMargin.listeners().subscribe(this,R75.prototype._updateMargins);this._updateMargins();this._stretchFactor=R75.DEFAULT_STRETCH_FACTOR}R75.DEFAULT_STRETCH_FACTOR=1E3;R75.PANE_ANIMATION_DURATION=500;R75.alwaysTopSources=["LineToolOrder","LineToolPosition","LineToolExecution"];
|
|
R75.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,"Script$TV_DIVIDENDS@tv-scripting":1,"Script$TV_SPLITS@tv-scripting":2,"Script$TV_EARNINGS@tv-scripting":3};R75.prototype.destroy=function(){this.D2.topMargin.listeners().unsubscribe(this,R75.prototype._updateMargins);this.D2.bottomMargin.listeners().unsubscribe(this,R75.prototype._updateMargins)};
|
|
R75.prototype.setPaneSize=function(a){var b={large:1,medium:.6,small:.3,tiny:.15};if(!b[a])throw"Unknown size enum value: "+a;this._stretchFactor=b[a]*R75.DEFAULT_STRETCH_FACTOR};
|
|
R75.sortSources=function(a){a.sort(function(a,b){if(0<=R75.alwaysTopSources.indexOf(a._constructor))return 1;if(0<=R75.alwaysTopSources.indexOf(b._constructor))return-1;var c=a.zorder(),d=b.zorder();d==c&&(c=d-1,a.setZorder(c));return c-d});var b=[],c=[],d;for(d in R75.sortSourcesPreOrdered)c.push(null);d=0;for(var e=a.length;d<e;d++){var f=a[d];if(isFunction(f.metaInfo)){var g=f.metaInfo().id,g=R75.sortSourcesPreOrdered[g];0<g?c[g]=f:b.push(f)}else b.push(f)}d=0;for(e=c.length;d<e;d++)(f=c[d])&&
|
|
b.push(f);return b};
|
|
R75.prototype._updateMargins=function(){var a=.01*this.D2.topMargin.value(),b=.01*this.D2.bottomMargin.value();this.m_leftPriceScale.setTopMargin(a);this.m_leftPriceScale.setBottomMargin(b);this.m_rightPriceScale.setTopMargin(a);this.m_rightPriceScale.setBottomMargin(b);for(var c=0;c<this.m_dataSources.length;c++){var d=this.m_dataSources[c];d instanceof TradingView.Study&&this.isOverlay(d)&&"Volume"!==d.metaInfo().shortId&&d.priceScale()&&d.priceScale()!==this.m_leftPriceScale&&d.priceScale()==
|
|
this.m_rightPriceScale&&(d.priceScale().setTopMargin(a),d.priceScale().setBottomMargin(b),this.recalculatePriceScale(d.priceScale()))}this.recalculatePriceScale(this.m_leftPriceScale);this.recalculatePriceScale(this.m_rightPriceScale);this.updateAllViews()};R75.prototype.model=function(){return this.D0};R75.prototype.width=function(){return this.m_width};R75.prototype.height=function(){return this.m_height};R75.prototype.setWidth=function(a){this.m_width=a;this.updateAllViews()};
|
|
R75.prototype.setHeight=function(a){this.m_height=a;this.m_leftPriceScale.setHeight(a);this.m_rightPriceScale.setHeight(a);for(var b=0;b<this.m_dataSources.length;b++){var c=this.m_dataSources[b];this.isOverlay(c)&&c.priceScale()&&c.priceScale().setHeight(a)}this.updateAllViews()};R75.prototype.leftPriceScale=function(){return this.m_leftPriceScale};R75.prototype.rightPriceScale=function(){return this.m_rightPriceScale};R75.prototype.timeScale=function(){return this.m_timeScale};
|
|
R75.prototype.D19=function(){return this.m_dataSources};R75.prototype.isOverlay=function(a){return a._isOverlay};
|
|
R75.prototype._processMainSourceChange=function(){var a;if(null===this.m_mainDataSource)for(var b=0;b<this.m_dataSources.length;b++){var c=this.m_dataSources[b];if(!(!TradingView.isInherited(c.constructor,TradingView.PriceDataSource)||this.isOverlay(c)||c.properties().linkedToSeries&&c.properties().linkedToSeries.value()||c instanceof TradingView.AlertLabel)){this.m_mainDataSource=c;a=!0;break}}if(this.m_mainDataSource&&a){a=[];for(b=0;b<this.m_dataSources.length;b++)c=this.m_dataSources[b],TradingView.isInherited(c.constructor,
|
|
R47)&&a.push(c);a=R75.sortSources(a);for(b=0;b<a.length;b++)this.move(a[b],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource)for(b=0;b<this.m_dataSources.length;b++)if(c=this.m_dataSources[b],TradingView.isInherited(c.constructor,TradingView.PriceDataSource)&&this.isOverlay(c)&&c.showInObjectTree()){this.m_mainDataSource=c;this.m_rightPriceScale.addDataSource(c);c.setPriceScale(this.m_rightPriceScale);for(var b=this.D0.children(c),d=0;d<b.length;d++)a=
|
|
b[d],this.m_rightPriceScale.addDataSource(a),a.setPriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_rightPriceScale);c._isOverlay=!1;break}};
|
|
R75.prototype.addDataSource=function(a,b,c){var d;a instanceof R47&&!c?(d=this.m_dataSources.reduce(function(a,b){return b instanceof R47?Math.max(a,b.zorder()):a},this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(a){a.zorder()>d&&a.setZorder(a.zorder()+1)}),d+=1):d=this.getZOrderMinMax().minZOrder-1;this.insertDataSource(a,b,d)};
|
|
R75.prototype.insertDataSource=function(a,b,c){this.m_dataSources.push(a);var d=!1;null!==this.m_mainDataSource||a instanceof TradingView.AlertLabel||(this.m_mainDataSource=a,d=!0);a._isOverlay=!1;if(null===b){var e=this.m_rightPriceScale.topMargin(),f=this.m_rightPriceScale.bottomMargin();a.metaInfo&&"Volume@tv-basicstudies"==a.metaInfo().id&&(e=.75,f=0);b=new R76(new Property(this.D2.overlayPropreties.state()));b.setHeight(this.m_height);b.setTopMargin(e);b.setBottomMargin(f);a._isOverlay=
|
|
!0}b.addDataSource(a);a.setPriceScale(b);a.onTagsChanged&&a.onTagsChanged().subscribe(this,R75.prototype.onSourceTagsChanged);a.setZorder(c);d&&this._processMainSourceChange();a instanceof TradingView.AlertLabel||this.updateAlertLabelsSources();this._tagsChanged.fire();TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&this.recalculatePriceScale(b);this.invalidateSourcesCache()};
|
|
R75.prototype.removeDataSource=function(a,b){var c=this.m_dataSources.indexOf(a);-1===c?TradingView.logDebugChart("removeDataSource: invalid data source"):(a._isOverlay=!1,this.m_dataSources.splice(c,1),a!==this.m_mainDataSource||b||(this.m_mainDataSource=null),c=null,-1!==this.m_leftPriceScale.D19().indexOf(a)?(this.m_leftPriceScale.removeDataSource(a),c=this.m_leftPriceScale):-1!==this.m_rightPriceScale.D19().indexOf(a)&&(this.m_rightPriceScale.removeDataSource(a),c=this.m_rightPriceScale),
|
|
a.onTagsChanged&&a.onTagsChanged().unsubscribe(this,R75.prototype.onSourceTagsChanged),TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&this._processMainSourceChange(),a instanceof TradingView.AlertLabel||this.D0.mainSeries()!==a||this.updateAlertLabelsSources(),this._tagsChanged.fire(),c&&TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&this.recalculatePriceScale(c),this.invalidateSourcesCache())};
|
|
R75.prototype.updateAlertLabelsSources=function(){for(var a=this.containsMainSeries(),b=this.D0.alertsList(),c=$.map($.grep(this.D19(),function(a){return a instanceof TradingView.AlertLabel}),function(a){return a.alert().id()}),d=this,e=function(a){return d.D19().filter(function(b){return b instanceof TradingView.AlertLabel?b.data==a:!1})[0]},f=b.size()-1;0<=f;f--){var g=b.item(f),h=-1!==c.indexOf(g.id());if(!h&&(a||!g.isOHLC())){var k=new TradingView.AlertLabel(this.D0,g),
|
|
l=this.rightPriceScale()||this.leftPriceScale();this.addDataSource(k,l)}h&&!a&&g.isOHLC()&&(k=e(g))&&this.removeDataSource(k)}};R75.prototype.startScalePrice=function(a,b){a.startScale(b)};R75.prototype.scalePriceTo=function(a,b){a.scaleTo(b);this.updateAllViews()};R75.prototype.endScalePrice=function(a){a.endScale()};R75.prototype.startScrollPrice=function(a,b){a.startScroll(b)};R75.prototype.scrollPriceTo=function(a,b){a.scrollTo(b);this.updateAllViews()};R75.prototype.endScrollPrice=function(a){a.endScroll()};
|
|
R75.prototype.setPriceAutoScale=function(a,b){a.setAutoScale(b);this.timeScale().isEmpty()?a.setPriceRange(null):this.recalculatePriceScale(a)};R75.prototype.restorePriceScaleState=function(a,b){a.restoreState(b);this.updateAllViews()};R75.prototype.updateAllViews=function(){for(var a=0;a<this.m_dataSources.length;a++)this.m_dataSources[a].updateAllViews()};
|
|
R75.prototype.defaultPriceScale=function(){var a=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();void 0===a&&(a=new Property(this.D2.overlayPropreties.state()),a=new R76(a));return a};R75.prototype._priceScaleIsPrice=function(a){return(a=a.mainSource())?TradingView.isInherited(a.constructor,TradingView.Series)?!0:TradingView.isInherited(a.constructor,TradingView.Study)?a.metaInfo().is_price_study:!1:!1};
|
|
R75.prototype.findSuitableScale=function(a){if(TradingView.isInherited(a.constructor,TradingView.Study)&&"Volume@tv-basicstudies"==a.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var b=!1;TradingView.isInherited(a.constructor,TradingView.Study)?b=a.metaInfo().is_price_study:TradingView.isInherited(a.constructor,TradingView.Series)&&(b=!0);if(b){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;
|
|
if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale};R75.prototype.mainDataSource=function(){return this.m_mainDataSource};R75.prototype.recalculatePriceScale=function(a){if(a){if(a.isAutoScale()&&!this.timeScale().isEmpty()){var b=this.timeScale().visibleBars();a.recalculatePriceRange(b)}a.updatePaneViews()}};
|
|
R75.prototype.resetPriceScale=function(a){var b=this.timeScale().visibleBars();a.mainSource()instanceof TradingView.Series&&a.mainSource().isLockScale()||a.setAutoScale(!0);a.recalculatePriceRange(b);this.updateAllViews()};
|
|
R75.prototype._recalculateImpl=function(){if(this._needRecalc){this.recalculatePriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_leftPriceScale);for(var a=0;a<this.m_dataSources.length;a++){var b=this.m_dataSources[a];this.isOverlay(b)&&this.recalculatePriceScale(b.priceScale())}this.updateAllViews();this.D0.updatePane(this);this._needRecalc=!1}};R75.prototype.recalculate=function(a){this._needRecalc=!0;a&&this._recalculateImpl()};
|
|
R75.prototype.isEmpty=function(){return null===this.m_mainDataSource};R75.prototype.move=function(a,b,c){var d=this.m_dataSources.slice();this.removeDataSource(a,null!==b);this.addDataSource(a,b,c);this.m_dataSources=d;this.invalidateSourcesCache()};R75.prototype.dataSourceForId=function(a){for(var b=0;b<this.m_dataSources.length;b++)if(this.m_dataSources[b].id()===a)return this.m_dataSources[b];return null};
|
|
R75.prototype.priceScaleForSource=function(a){return-1!==this.rightPriceScale().D19().indexOf(a)?this.rightPriceScale():-1!==this.leftPriceScale().D19().indexOf(a)?this.leftPriceScale():null};R75.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.length;b++)if(this.m_dataSources[b].id()===a)return this.m_dataSources[b];return null};R75.prototype.containsMainSeries=function(){return-1!==this.m_dataSources.indexOf(this.D0.mainSeries())};
|
|
R75.prototype.priceScaleByName=function(a){return"left"===a?this.m_leftPriceScale:"right"===a?this.m_rightPriceScale:null};R75.prototype.priceScaleName=function(a){return a===this.m_leftPriceScale?"left":a===this.m_rightPriceScale?"right":""};
|
|
R75.prototype.hitTestSources=function(){if(this._cachedHitTestSources)return this._cachedHitTestSources;for(var a=this.orderedSources(),b=[],c=[],d=0;d<a.length;d++){var e=a[d];TradingView.isInherited(e.constructor,R47)?b.push(e):c.push(e)}return this._cachedHitTestSources=c.concat(b)};
|
|
R75.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0,c=this.m_dataSources.length;b<c;b++){var d=this.m_dataSources[b];TradingView.isInherited(d.constructor,R47)&&!d.isActualSymbol()||a.push(d)}return this._cachedOrderedSoruces=a=R75.sortSources(a)};R75.prototype.invalidateSourcesCache=function(){this._cachedHitTestSources=this._cachedOrderedSoruces=null;this.m_leftPriceScale.invalidateSourcesCache();this.m_rightPriceScale.invalidateSourcesCache()};
|
|
R75.prototype.getZOrderMinMax=function(){var a=this.orderedSources();if(0===a.length)return{minZOrder:0,maxZOrder:0};for(var b=a[0].zorder(),c=a[0].zorder(),d=1;d<a.length;d++){var e=a[d];e.zorder()<b&&(b=e.zorder());e.zorder()>c&&(c=e.zorder())}return{minZOrder:b,maxZOrder:c}};R75.prototype.sendToBack=function(a){for(var b=this.getZOrderMinMax().minZOrder,b=Math.abs(a.zorder()-b),c=0;c<b;c++)this.changeZOrder(a,-1)};
|
|
R75.prototype.bringToFront=function(a){for(var b=this.getZOrderMinMax().maxZOrder,b=Math.abs(a.zorder()-b),c=0;c<b;c++)this.changeZOrder(a,1)};R75.prototype.changeZOrder=function(a,b){for(var c=this.orderedSources().filter(function(a){return a.showInObjectTree()}),d=0,e=0,f=c.length;e<f;e++)if(c[e]===a){d=e;break}0<d&&0>b?(f=c[d-1].zorder(),e=a.zorder(),c[d-1].setZorder(e),a.setZorder(f)):d<c.length-1&&0<b&&(f=c[d+1].zorder(),e=a.zorder(),c[d+1].setZorder(e),a.setZorder(f));this.invalidateSourcesCache()};
|
|
R75.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()};R75.prototype.onTagsChanged=function(){return this._tagsChanged};R75.prototype.dumpPriceScale=function(a){for(var b=a.D19(),c=[],d=0;d<b.length;d++){var e=b[d].priceAxisViews(this,a);if(e)for(var f=0;f<e.length;f++)c.push(e[f].dump())}return c};
|
|
R75.prototype.dumpViews=function(){for(var a={paneViews:{}},b=this.orderedSources(),c=0;c<b.length;c++){var d=b[c];a.paneViews[c]=[];if(d=d.paneViews())for(var e=0;e<d.size();e++)a.paneViews[c].push(d.item(c).dump())}a.leftAxis=this.dumpPriceScale(this.m_leftPriceScale);a.rightAxis=this.dumpPriceScale(this.m_rightPriceScale);return a};
|
|
R75.prototype.clearSeries=function(){for(var a=this.m_dataSources.length-1;0<=a;a--)TradingView.isInherited(this.m_dataSources[a].constructor,TradingView.Series)&&this.m_dataSources.splice(a,1)};
|
|
R75.prototype.actionNoScaleIsEnabled=function(a){return this.isOverlay(a)||!TradingView.isInherited(a.constructor,TradingView.PriceDataSource)?!0:1<this.m_dataSources.filter(function(a){return a.properties().linkedToSeries&&a.properties().linkedToSeries.value()?!1:TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&a.showInObjectTree()&&!a.isNoScale()}).length};
|
|
R75.prototype.executionsPositionController=function(){this._executionsPositionController||(this._executionsPositionController=new TradingView.ExecutionsPositionController(this,this.D0.timeScale()));return this._executionsPositionController};function optimalBarWidth(a){return.3*a}TradingView.selectionTolerance=function(a){return 2+.5*a};TradingView.paneRendererCoordinateIsValid=function(a){return null!==a&&void 0!==a&&!TradingView.isNaN(a)};R56=function(a){this.bars=a.bars.toArray();this.barSpacing=a.barSpacing;this.barWidth=optimalBarWidth(a.barSpacing);this.barLineWidth=Math.max(1,Math.round(this.barWidth));this.dontDrawOpen=a.dontDrawOpen};
|
|
R56.prototype.draw=function(a){a.save();a.translate(.5,.5);for(var b,c=0;c<this.bars.length;++c){var d=this.bars[c];b!==d.color&&(b=a.fillStyle=d.color);a.fillRect(Math.round(d.time-this.barLineWidth/2),Math.round(d.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(d.low-d.high+this.barWidth));this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||a.fillRect(Math.round(d.time-1.5*this.barWidth),Math.round(d.open-this.barWidth/2),Math.round(1.5*this.barWidth),
|
|
Math.round(this.barWidth)),a.fillRect(Math.round(d.time),Math.round(d.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)))}a.restore()};
|
|
R56.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barSpacing;if(0===b.length||a.x<b[0].time-c||a.x>b[b.length-1].time+c)return null;for(var d=null,e=0;e<b.length;++e){var f=b[e];if(a.x<=f.time+c){d=f;break}}b=TradingView.selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
R70=function(a){this.bars=a.bars.toArray();this.barWidth=a.barWidth;this.barLineWidth=1};
|
|
R70.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(.5,.5);a.lineWidth=this.barLineWidth;for(var b=this.barWidth/2,c=0,d;c<this.bars.length;++c){d=this.bars[c];var e=d.exactTime-b,f=d.exactTime+b-e,g=Math.round(d.high),h=0===d.low-d.high?1:Math.round(d.low-d.high);a.fillStyle=d.borderColor;a.fillRect(e,g,f,h);a.fillStyle=d.color;a.fillRect(e+this.barLineWidth,g+this.barLineWidth,f-2*this.barLineWidth,h-2*this.barLineWidth)}a.restore()};
|
|
R70.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barWidth;if(0===b.length||a.x<b[0].time-c||a.x>b[b.length-1].time+c)return null;for(var d=null,e=0;e<b.length;++e){var f=b[e];if(a.x<=f.time+c){d=f;break}}b=TradingView.selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
R67=function(a){this.bars=a.bars.toArray();this.barSpacing=a.barSpacing;this.barLineWidth=Math.max(1,optimalBarWidth(a.barSpacing))};
|
|
R67.prototype.draw=function(a){a.save();a.lineCap="square";a.translate(.5,.5);for(var b=0;b<this.bars.length;++b){var c=this.bars[b],d=Math.round(.5*this.barLineWidth);c.isTwoColorBar?(a.fillStyle=c.upColor,a.fillRect(Math.round(c.exactTime-d),Math.round(c.high-d),Math.round(2*d),Math.round(c.additionalPrice-c.high+d)),a.fillStyle=c.downColor,a.fillRect(Math.round(c.exactTime-d),Math.round(c.additionalPrice),Math.round(2*d),Math.round(c.low-c.additionalPrice+d))):(a.fillStyle=
|
|
c.color,a.fillRect(Math.round(c.exactTime-d),Math.round(c.high-d),Math.round(2*d),Math.round(c.low-c.high)+2*d));c.combinedWithProjection||(a.fillStyle=c.isTwoColorBar?c.isUp?c.downColor:c.upColor:c.color,a.fillRect(Math.round(c.exactTime-this.barSpacing+d),Math.round(c.open-d),Math.round(this.barSpacing-2*d+1),Math.round(2*d)))}a.restore()};
|
|
R67.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barLineWidth;if(0===b.length||a.x<b[0].time-c||a.x>b[b.length-1].time+c)return null;for(var d=null,e=0;e<b.length;++e){var f=b[e];if(a.x<=f.time+c){d=f;break}}b=TradingView.selectionTolerance(.5*this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
R69=function(a){this.bars=a.bars.toArray();this.barSpacing=a.barSpacing;this.blockSize=a.blockSize;this.barWidth=a.barSpacing};
|
|
R69.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(.5,.5);for(var b=0;b<this.bars.length;++b){var c=this.bars[b],d=(c.low-c.high)/c.additionalNum;a.beginPath();for(var e=0;e<c.additionalNum;e++)c.isUp?(a.moveTo(Math.round(c.time-.5*this.barWidth)+.5,c.high+e*d),a.lineTo(Math.round(c.time+.5*this.barWidth)-.5,c.high+(e+1)*d),a.moveTo(Math.round(c.time+.5*this.barWidth)-.5,c.high+e*d),a.lineTo(Math.round(c.time-.5*this.barWidth)+.5,c.high+(e+1)*d)):this.drawEllipse(a,
|
|
c.time-.45*this.barWidth+.5,c.high+e*d,Math.round(.9*this.barWidth),Math.round(d));a.strokeStyle=c.color;a.lineWidth=1;a.stroke()}a.restore()};R69.prototype.drawEllipse=function(a,b,c,d,e){a.save();a.translate(b+d/2,c+e/2);a.scale(d/2,e/2);a.moveTo(1,0);a.arc(0,0,.95,0,2*Math.PI,!1);a.restore()};
|
|
R69.prototype.hitTest=function(a){var b=this.bars,c=.5*this.barSpacing;if(0===b.length||a.x<b[0].time-c||a.x>b[b.length-1].time+c)return null;for(var d=null,e=0;e<b.length;++e){var f=b[e];if(a.x<=f.time+c){d=f;break}}b=TradingView.selectionTolerance(this.barWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
R66=function(a){this.items=a.items.toArray();this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth};R66.prototype.draw=function(a){a.translate(.5,.5);a.fillStyle=this.lineColor;for(var b=this.lineWidth,c=0;c<this.items.length;++c){var d=this.items[c],e=d.x,f=d.y;d.style&&(a.fillStyle=d.style.color,b=d.style.width);a.fillRect(Math.round(e-.5*b),f,b,this.histogramBase-f)}};
|
|
R66.prototype.hitTest=function(a){for(var b=TradingView.selectionTolerance(this.lineWidth),c,d,e=0;e<this.items.length;++e)if(c=this.items[e],d=c.x,c=c.y,d=MathEx.distanceToSegment(new MathEx.Point(d,c),new MathEx.Point(d,this.histogramBase),new MathEx.Point(a.x,a.y)),d.distance<=b)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);return null};
|
|
R60=function(a){this.items=a.items.toArray();this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth};
|
|
R60.prototype.draw=function(a){if(0!==this.items.length){var b=this.barSpacing,c=this.lineColor,d=this.histogramBase;a.translate(.5,.5);for(var e={},f=this.items,g=0;g<f.length;++g){var h=f[g],k=0===g?null:f[g-1],l;l=h.style?h.style.color:c;var m=e[l]||[];m.push({item:h,prev:k});e[l]=m}for(l in e){m=e[l];a.fillStyle=l;a.strokeStyle=l;a.lineWidth=1;a.beginPath();for(g=0;g<m.length;g++)h=m[g].item,c=Math.ceil(h.x-.5*b),f=Math.ceil(c+b),h=h.y,a.rect(c,h,f-c,d-h);a.fill();
|
|
a.beginPath();for(g=0;g<m.length;g++)h=m[g].item,c=Math.ceil(h.x-.5*b),f=Math.ceil(c+b),h=h.y,k=m[g].prev,a.moveTo(f-.5,d),a.lineTo(f-.5,h+.5),a.lineTo(c+.5,h+.5),k&&k.y>h&&a.lineTo(c+.5,k.y);a.stroke()}}};R60.prototype.hitTest=function(a){for(var b=.5*this.barSpacing+this.lineWidth,c=a.x-b,b=a.x+b,d=this.items,e=d.length;e--;){var f=d[e].x;if(f>=c&&f<=b&&(f=d[e].y,a.y>=Math.min(f,this.histogramBase)&&a.y<=Math.max(f,this.histogramBase)))return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)}return null};
|
|
R68=function(a){this.items=a.items.toArray();this._simpleMode=a.simpleMode;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth;this.lineStyle=a.lineStyle;this.withMarkers=a.withMarkers;this.withSteps=a.withSteps;this.hittest=a.hittest;this.ignorePaletteLineWidth=a.ignorePaletteLineWidth;this.forceLineColor=!!a.forceLineColor};
|
|
R68.prototype.draw=function(a){a.lineCap="square";a.lineJoin=this.withMarkers?"round":"miter";a.strokeStyle=this.lineColor;a.fillStyle=this.lineColor;a.lineWidth=this.lineWidth;a.lineStyle=this.lineStyle;this._simpleMode?this._drawSimpleMode(a):this._drawLines(a)};
|
|
R68.prototype._drawSimpleMode=function(a){a.beginPath();this.walkLine(a,this.items);a.stroke();if(this.withMarkers){var b=this.lineWidth+2,c=2*Math.PI,d;a.beginPath();for(var e=this.items.length;e--;)if(d=this.items[e])a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,0,c);a.fill()}};
|
|
R68.prototype.walkLine=function(a,b,c,d){if(b){for(var e=.25*this.barSpacing,f,g,h,k,l=TradingView.paneRendererCoordinateIsValid,m=0,n=b.length;m<n;m++)if(k=b[m],l(k.y)){g=k;f=m;break}if("undefined"!==typeof f&&g)for(var p=this.withSteps&&this.lineWidth&&0===this.lineWidth%2?.5:0,m=f,n=b.length;m<n;m++){g=b[m];k=b[m+1]||{};if(l(g.y))if(h&&l(h.y))this.withSteps&&a.lineTo(h.x+p,g.y+p),a.lineTo(g.x+p,g.y+p),c&&!l(k.y)&&a.lineTo(g.x+p,d);else if(k&&l(k.y))c?(m!=f&&a.lineTo(g.x+
|
|
p,d),a.lineTo(g.x+p,g.y+p)):a.moveTo(g.x+p,g.y+p);else if(c){if(0===m)continue;m!=f&&a.lineTo(g.x-e+p,d);a.lineTo(g.x-e+p,g.y+p);a.lineTo(g.x+e+p,g.y+p);a.lineTo(g.x+e+p,d)}else a.moveTo(g.x-e+p,g.y+p),a.lineTo(g.x+e+p,g.y+p);h=g}}};
|
|
R68.prototype._drawLines=function(a){function b(b,c,d){g(c.y)&&(g(b.y)?a.lineTo(c.x,c.y):d&&g(d.y)?a.moveTo(c.x,c.y):(a.moveTo(c.x-f,c.y),a.lineTo(c.x+f,c.y)))}if(this.items.length){var c,d,e,f=.25*this.barSpacing,g=TradingView.paneRendererCoordinateIsValid;a.beginPath();(c=this.items[0])&&a.moveTo(c.x,c.y);for(var h=a.strokeStyle,k=a.lineWidth,l=a.lineStyle,m=1;m<this.items.length;++m){c=this.items[m-1];d=this.items[m];e=this.items[m+1];var n,p,r;d.style&&!this.forceLineColor?
|
|
(n=d.style.color,p=d.style.width,r=d.style.style):(n=this.lineColor,p=this.lineWidth,r=this.lineStyle);this.ignorePaletteLineWidth&&(p=this.lineWidth);n!=h||p!=k||r!=l?(h=n,k=p,l=r,a.stroke(),a.beginPath(),a.strokeStyle=n,a.lineWidth=p,a.lineStyle=r,r===CanvasEx.LINESTYLE_SOLID?(a.moveTo(c.x,c.y),b(c,d,e)):CanvasEx.drawLine(a,c.x,c.y,d.x,d.y)):b(c,d,e)}a.stroke()}};
|
|
R68.prototype.hitTest=function(a){for(var b=TradingView.selectionTolerance(this.lineWidth),c,d,e,f,g=0,h=this.items.length-1;2<h-g;)c=Math.round((h+g)/2),this.items[c].x<=a.x?g=c:h=c;g=Math.max(1,g-1);for(h=Math.min(this.items.length-1,h+1);g<=h;++g)if(c=this.items[g-1],d=this.items[g],e=c.x,f=d.x,c=MathEx.distanceToSegment(new MathEx.Point(e,c.y),new MathEx.Point(f,d.y),new MathEx.Point(a.x,a.y)),c.distance<=b)return this.hittest?this.hittest:new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);
|
|
return null};R53=function(a){a.forceLineColor=!0;R68.call(this,a);this.color1=a.color1;this.color2=a.color2;this.bottom=a.bottom;this._simpleMode=a.simpleMode};inherit(R53,R68);
|
|
R53.prototype.draw=function(a){if(0!==this.items.length){a.lineCap="square";a.strokeStyle=this.lineColor;a.lineWidth=this.lineWidth;a.lineStyle=this.lineStyle;a.lineWidth=1;a.beginPath();for(var b,c=0,d=this.items.length;c<d;c++){var e=this.items[c];if(TradingView.paneRendererCoordinateIsValid(e.y)){b=e;break}}if(b){a.moveTo(b.x,this.bottom);this.walkLine(a,this.items,!0,this.bottom);for(var f,c=this.items.length-1;0<=c;c--)if(e=this.items[c],TradingView.paneRendererCoordinateIsValid(e.y)){f=
|
|
e;break}a.moveTo(f.x,this.bottom);a.closePath();b=a.createLinearGradient(0,0,0,this.bottom);b.addColorStop(0,this.color1);b.addColorStop(1,this.color2);a.fillStyle=b;a.fill();a.lineWidth=this.lineWidth;R68.prototype.draw.call(this,a)}}};R57=function(a){this._data=a;this.bars=a.bars.toArray();this._barWidth=optimalBarWidth(a.barSpacing);this._barBorderWidth=1};
|
|
R57.prototype.draw=function(a){var b=this.bars,c=this._data.barSpacing,d=this._data.drawWick,e=this._data.drawBorder,f=this._data.wickColor,g=this._barBorderWidth,h=this._barWidth,k,l,m,n,p;a.lineCap="square";a.lineStyle=this._data.lineStyle;if(1>c){if(d){a.strokeStyle=f;a.lineWidth=1;a.beginPath();for(f=b.length;0<f--;)c=b[f],a.moveTo(c.time,c.low),a.lineTo(c.time,c.high);a.stroke()}a.lineWidth=1;e="";h=!1;a.beginPath();for(f=b.length;0<f--;)c=b[f],d=c.time,e!==c.color&&
|
|
(h&&(a.stroke(),a.beginPath(),h=!1),e=a.strokeStyle=c.color),a.moveTo(c.time,c.open),a.lineTo(c.time,c.close),h=!0;h&&a.stroke()}else{b=b.slice().sort(function(a,b){return a.color>b.color?-1:a.color<b.color?1:0});a.translate(.5,.5);a.lineWidth=g;if(d)for(p=f,a.fillStyle=f,f=b.length;f--;)c=b[f],d=c.time,k=c.open,l=c.high,m=c.low,n=c.close,c.wickColor&&c.wickColor!==p&&(p=a.fillStyle=c.wickColor),g=Math.min(k,n),k=Math.max(k,n),c.hollow?(a.fillRect(d,l,1,g-l),a.fillRect(d,k,1,m-k)):a.fillRect(d,l,
|
|
1,m-l);if(e)for(f=b.length;f--;)c=b[f],b[f+1]&&c.borderColor==b[f+1].borderColor||(a.fillStyle=c.borderColor),c.hollow||(d=c.time,k=c.open,n=c.close,p=Math.round(d-h),d=Math.round(d+h),g=Math.min(k,n),k=Math.max(k,n),a.fillRect(p,g,d-p+1,k-g+1));for(f=b.length;f--;)c=b[f],d=c.time,k=c.open,l=c.high,m=c.low,n=c.close,p=Math.round(d-h),d=Math.round(d+h),g=Math.min(k,n),k=Math.max(k,n),b[f+1]&&c.color==b[f+1].color||(a.fillStyle=c.color,a.strokeStyle=c.color),c.hollow?(a.translate(-.5,-.5),a.strokeRect(p+
|
|
1,g+1,d-p,k-g),a.translate(.5,.5)):(e&&(p+=1,g+=1,--d,--k),a.fillRect(p,g,d-p+1,k-g+1))}};R57.prototype.hitTest=function(a){var b=this.bars,c=.5*this._data.barSpacing;if(0===b.length||a.x<b[0].time-c||a.x>b[b.length-1].time+c)return null;for(var d=null,e=0;e<b.length;++e){var f=b[e];if(a.x<=f.time+c){d=f;break}}b=TradingView.selectionTolerance(this._barBorderWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
R61=function(a){this.items=a.items.toArray();this.barSpacing=a.barSpacing;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth;this.lineStyle=a.lineStyle};
|
|
R61.prototype.draw=function(a){for(var b=this.lineWidth,c=3*this.lineWidth,d,e=!1,f=0;f<this.items.length;++f){var g=this.items[f],h=g.x,k=g.y;TradingView.isNaN(h)||TradingView.isNaN(k)||(g=null!=g.style?g.style.color:this.lineColor,g!==d&&(d=g,e&&a.fill(),a.beginPath(),a.fillStyle=g),a.rect(h-c/2,k-b/2,c,b),a.rect(h-b/2,k-c/2,b,c),e=!0)}e&&a.fill()};
|
|
R61.prototype.hitTest=function(a){for(var b=TradingView.selectionTolerance(this.lineWidth),c,d,e,f,g=1;g<this.items.length;++g)if(c=this.items[g-1],d=this.items[g],e=c.x,f=d.x,c=MathEx.distanceToSegment(new MathEx.Point(e,c.y),new MathEx.Point(f,d.y),new MathEx.Point(a.x,a.y)),c.distance<=b)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);return null};
|
|
R58=function(a){this.items=a.items.toArray();this.barSpacing=a.barSpacing;this.lineColor=a.lineColor||a.color;this.radius=a.lineWidth||a.height/2;this.vertOffset=a.vertOffset||0};
|
|
R58.prototype.draw=function(a){for(var b=2*Math.PI,c=this.radius,d,e=!1,f=0;f<this.items.length;++f){var g=this.items[f],h=g.x,k=g.y+this.vertOffset;TradingView.isNaN(h)||TradingView.isNaN(k)||(g=null!=g.style?g.style.color:this.lineColor,g!==d&&(d=g,e&&a.fill(),a.beginPath(),a.fillStyle=g),a.moveTo(h+c,k),a.arc(h,k,c,0,b,!1),e=!0)}e&&a.fill()};
|
|
R58.prototype.hitTest=function(a){for(var b=this.vertOffset,c=TradingView.selectionTolerance(2*this.radius),d=0;d<this.items.length;++d){var e=this.items[d];if(e&&(new MathEx.Point(e.x,e.y+b)).substract(a).length()+this.radius<=c)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)}return null};TradingView.PaneRendererArrowsUpDownItem=function(a,b,c,d){this.x=a;this.y=b;this.height=c;this.isUp=d};inherit(TradingView.PaneRendererArrowsUpDownItem,MathEx.Point);
|
|
R54=function(a){this.items=a.items.toArray();this.barSpacing=a.barSpacing;this.colorUp=a.colorup;this.colorDn=a.colordown;this.colorBorder=a.colorBorder;this.width=this._calculateWidth(a.barSpacing);this.minHeight=a.minHeight;this.vertOffset=this._calculateVerticalOffset(a.barSpacing)};R54.prototype._calculateVerticalOffset=function(a){return Math.round((a||0)/4)};
|
|
R54.prototype._calculateMinHeight=function(a){return this.width||this._calculateWidth(a)};R54.prototype._calculateWidth=function(a){a=a||this.barSpacing;return Math.round(a/2)};
|
|
R54.prototype.draw=function(a){var b=this.width,c=4>b,d=Math.max(parseInt(b/2),1),e=Math.round(this.width/2),f=Math.round(this.width);a.translate(1,1);for(var g=0,h=this.items.length;g<h;g++){var k=this.items[g],l=k.isUp?-1:1,m=Math.abs(k.height),n=k.y-l*this.vertOffset;a.beginPath();a.translate(k.x,n);c?(a.moveTo(0,0),a.lineTo(-e,-e*l),a.moveTo(0,0),a.lineTo(e,-e*l),a.moveTo(0,0),a.lineTo(0,-m*l),a.moveTo(-e,-m*l),a.lineTo(e,-m*l),a.lineWidth=d,a.strokeStyle=k.isUp?
|
|
this.colorUp:this.colorDn,a.stroke()):(a.moveTo(0,0),m<f?(a.lineTo(b,-m*l),a.lineTo(-b,-m*l)):(a.lineTo(b,-f*l),a.lineTo(e,-f*l),a.lineTo(e,-m*l),a.lineTo(-e,-m*l),a.lineTo(-e,-f*l),a.lineTo(-b,-f*l)),a.lineTo(0,0),a.strokeStyle=this.colorBorder,a.stroke(),a.fillStyle=k.isUp?this.colorUp:this.colorDn,a.fill());a.translate(-k.x,-n)}a.translate(-1,-1)};
|
|
R54.prototype.hitTest=function(a){for(var b=Math.round(this.width/2),c=Math.round(this.width),d=0;d<this.items.length;++d){var e=this.items[d];if(e&&void 0!==e.x&&null!==e.x&&!TradingView.isNaN(e.x)&&void 0!==e.y&&null!==e.y&&!TradingView.isNaN(e.y)){var f=Math.abs(e.height),g=e.isUp?-1:1,h=e.y-g*this.vertOffset,f=h-g*(f+c),g=e.x+b;if(e.x-b<a.x&&a.x<g&&(e.isUp?h<a.y&&a.y<f:f<a.y&&a.y<h))return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)}}};
|
|
R52=function(a){this.items=a.items.toArray();this.height=a.height||a.width;this.width=a.width||a.height;this._color=a.color;this._borderColor=a.borderColor;this._vertOffset=a.vertOffset||0;a.textCache&&(this._textCache=a.textCache,this._textColor=a.textColor,this._textVertOffset=0<this._vertOffset?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,this._textImageHeight=this._textCache.textImageHeight)};
|
|
R52.prototype.draw=function(a){this.drawShape(a);this.drawText(a)};R52.prototype.drawShape=function(a){throw Error("Not implemented");};
|
|
R52.prototype.drawText=function(a){if(this._textCache)for(var b=0,c=this.items.length;b<c;b++){var d=this.items[b];this._textCache.paintTo(a,d.style&&null!=d.style.textColor?d.style.textColor:this._textColor,d.x,d.y+this._vertOffset+this._textVertOffset,"center",0<this._vertOffset?"top":"bottom")}};
|
|
R52.prototype.hitTest=function(a,b){var c=Math.max(this.height,this.width),d=this._vertOffset,e=this._textVertOffset;b=b||TradingView.HitTestResult.REGULAR;for(var f,g=0;g<this.items.length;++g){var h=this.items[g];if(h){f=new MathEx.Point(h.x,h.y+d);f=f.substract(a).length();if(f<=c)return new TradingView.HitTestResult(b);if(this._textCache){f=this._textImageWidth/2;var k=h.y+d+e,l=a.x,m=a.y,n=k+(0<d?0:-this._textImageHeight),p=h.x+f,k=k+(0<d?this._textImageHeight:
|
|
0);if(l>h.x-f&&l<p&&m>n&&m<k)return new TradingView.HitTestResult(b)}}}return null};R73=function(a){R52.call(this,a);this.ch=a["char"][0];this.fontFamily=a.fontFamily||"Arial";this._charCache=new TradingView.TextImageCache(this.ch,!1,!1,this.fontFamily,this.height)};inherit(R73,R52);
|
|
R73.prototype.drawShape=function(a){for(var b=0<this._vertOffset?1:-1,c=0,d=this.items.length;c<d;c++){var e=this.items[c],f=e.x,g=e.y+this._vertOffset-b*Math.round(this.height/2);this._charCache.paintTo(a,e.style&&null!=e.style.color?e.style.color:this._color,f,g,"center",0<this._vertOffset?"middle":"bottom")}};
|
|
R73.prototype.hitTest=function(a){for(var b=this._vertOffset,c=TradingView.selectionTolerance(this.height),d=0;d<this.items.length;++d){var e=this.items[d];if(e&&(new MathEx.Point(e.x,e.y+b)).substract(a).length()<=c)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)}return null};R74=function(a){R52.call(this,a)};inherit(R74,R52);
|
|
R74.prototype.drawShape=function(a){a.lineWidth=2;for(var b=this.width,c=this.height,d=this._vertOffset,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l;l=k.style&&null!=k.style.color?k.style.color:this._color;l!==e&&(e=l,f&&a.stroke(),a.beginPath(),a.strokeStyle=l);f=k.x-b/2;k=k.y-c/2+d;a.moveTo(f,k);a.lineTo(f+b,k+c);a.moveTo(f,k+c);a.lineTo(f+b,k);f=!0}f&&a.stroke()};
|
|
R72=function(a){R52.call(this,a)};inherit(R72,R52);
|
|
R72.prototype.drawShape=function(a){for(var b=this.width,c=this.height,d=Math.round(c/3),d=this._vertOffset-2*d,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l,m;k.style&&null!=k.style.color?(l=k.style.color,m=k.style.borderColor):(l=this._color,m=this._borderColor);l!==e&&(e=l,f&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=l,a.strokeStyle=m);f=k.x;k=k.y+d;a.moveTo(f,k);a.lineTo(f+b/2,k+c);a.lineTo(f-b/2,k+c);a.lineTo(f,k);f=!0}f&&(a.fill(),a.stroke())};
|
|
R71=function(a){R52.call(this,a)};inherit(R71,R52);
|
|
R71.prototype.drawShape=function(a){for(var b=this.width,c=this.height,d=Math.round(c/3),d=this._vertOffset-d,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l,m;k.style&&null!=k.style.color?(l=k.style.color,m=k.style.borderColor):(l=this._color,m=this._borderColor);l!==e&&(e=l,f&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=l,a.strokeStyle=m);f=k.x-b/2;k=k.y+d;a.moveTo(f,k);a.lineTo(f+b,k);a.lineTo(f+b/2,k+c);a.lineTo(f,k);f=!0}f&&(a.fill(),a.stroke())};
|
|
TradingView.PaneRendererTriangleApexLeft=function(a){R52.call(this,a)};inherit(TradingView.PaneRendererTriangleApexLeft,R52);
|
|
TradingView.PaneRendererTriangleApexLeft.prototype.drawShape=function(a){for(var b=this.width,c=this.height,d=this._vertOffset,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l;l=k.style&&null!=k.style.color?k.style.color:this._color;l!==e&&(e=l,f&&a.fill(),a.beginPath(),a.fillStyle=l);f=k.x+b/2;k=k.y-c/2+d;a.moveTo(f,k);a.lineTo(f,k+c);a.lineTo(f-b,k+c/2);a.lineTo(f,k);f=!0}f&&a.fill()};R64=function(a){R52.call(this,a)};
|
|
inherit(R64,R52);
|
|
R64.prototype.drawShape=function(a){for(var b=this.width,c=this.height,d=c/2,e=this._vertOffset,f=(b-3)/3,g,h=!1,k=0,l=this.items.length;k<l;k++){var m=this.items[k],n,p;m.style&&null!=m.style.color?(n=m.style.color,p=m.style.borderColor):(n=this._color,p=this._borderColor);n!==g&&(g=n,h&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=n,a.strokeStyle=p);h=m.x-b/2;m=m.y-d+e;a.moveTo(h,m);a.lineTo(h+3,m);a.bezierCurveTo(h+f,m-f,h+2*f,m+f,h+b,m);a.lineTo(h+b,m+d);a.bezierCurveTo(h+
|
|
b-f,m+d+f,h+b-2*f,m+d-f,h+3,m+d);a.lineTo(h+3,m+c);a.lineTo(h,m+c);a.lineTo(h,m);h=!0}h&&(a.fill(),a.stroke())};R63=function(a){R52.call(this,a)};inherit(R63,R52);
|
|
R63.prototype.drawShape=function(a){a.lineWidth=2;for(var b=this.width,c=this.height,d=this._vertOffset,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l;l=k.style&&null!=k.style.color?k.style.color:this._color;l!==e&&(e=l,f&&a.stroke(),a.beginPath(),a.strokeStyle=l);f=k.x-b/2;k=k.y-c/2+d;a.moveTo(f+b/2,k);a.lineTo(f+b/2,k+c);a.moveTo(f,k+c/2);a.lineTo(f+b,k+c/2);f=!0}f&&a.stroke()};
|
|
R59=function(a){R52.call(this,a)};inherit(R59,R52);
|
|
R59.prototype.drawShape=function(a){for(var b=Math.max(this.width,this.height)/2,c=this._vertOffset,d=2*Math.PI,e,f=!1,g=0,h=this.items.length;g<h;g++){var k=this.items[g],l,m;k.style&&null!=k.style.color?(l=k.style.color,m=k.style.borderColor):(l=this._color,m=this._borderColor);l!==e&&(e=l,f&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=l,a.strokeStyle=m);f=k.x;k=k.y+c;a.moveTo(f+b,k);a.arc(f,k,b,0,d,!1);f=!0}f&&(a.fill(),a.stroke())};
|
|
TradingView.PaneRendererArrowsBase=function(a){R52.call(this,a);this.width=this._calculateWidth(a.barSpacing);this._isUp=!1};inherit(TradingView.PaneRendererArrowsBase,R52);TradingView.PaneRendererArrowsBase.prototype._calculateWidth=function(a){a=a||this.barSpacing;return Math.round(a/4)};
|
|
TradingView.PaneRendererArrowsBase.prototype.drawShape=function(a){for(var b,c=!1,d=this.width,e=Math.abs(this.height),f=4>d,g=Math.max(parseInt(d/2),1),h=Math.round(this.width/2),k=Math.round(this.width),l=this._isUp?-1:1,m=0,n=this.items.length;m<n;m++){var p=this.items[m],r=p.x,t=p.y+this._vertOffset+l*Math.round(e/2),v;p.style&&null!=p.style.color?(v=p.style.color,p=p.style.borderColor):(v=this._color,p=this._borderColor);v!==b&&(b=v,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=v,a.strokeStyle=
|
|
p);a.translate(r,t);f?(a.moveTo(0,0),a.lineTo(-h,-h*l),a.moveTo(0,0),a.lineTo(h,-h*l),a.moveTo(0,0),a.lineTo(0,-e*l),a.moveTo(-h,-e*l),a.lineTo(h,-e*l),a.lineWidth=g):(a.moveTo(0,0),e<k?(a.lineTo(d,-e*l),a.lineTo(-d,-e*l)):(a.lineTo(d,-k*l),a.lineTo(h,-k*l),a.lineTo(h,-e*l),a.lineTo(-h,-e*l),a.lineTo(-h,-k*l),a.lineTo(-d,-k*l)),a.lineTo(0,0));a.translate(-r,-t);c=!0}c&&(a.fill(),a.stroke())};TradingView.PaneRendererArrowUp=function(a){TradingView.PaneRendererArrowsBase.call(this,a);this._isUp=!0};
|
|
inherit(TradingView.PaneRendererArrowUp,TradingView.PaneRendererArrowsBase);TradingView.PaneRendererArrowDown=function(a){TradingView.PaneRendererArrowsBase.call(this,a);this._isUp=!1};inherit(TradingView.PaneRendererArrowDown,TradingView.PaneRendererArrowsBase);
|
|
TradingView.PaneRendererLabelsBase=function(a,b){R52.call(this,a);this._isUp=b;this._stepX=Math.round(this.height/2*.65)+.5;this._stepY=Math.round(this.height/2)+.5;this._textCache?(this._padding=this._stepX/2,this._shapeWidth=this._textImageWidth+2*this._stepX,this._shapeHeight=this._textImageHeight+2*this._padding+this._stepY,this._textVertOffset=0===this._vertOffset?this._isUp?this._stepY+this._padding+this._textImageHeight:-this._stepY-this._padding:0<this._vertOffset?
|
|
this._stepY+this._padding:-this._stepY-this._padding):(this._padding=0,this._shapeWidth=2*this._stepX,this._shapeHeight=2.5*this._stepY)};inherit(TradingView.PaneRendererLabelsBase,R52);
|
|
TradingView.PaneRendererLabelsBase.prototype.drawShape=function(a){var b,c=!1,d=this._isUp?1:-1,e=Math.round(this._shapeWidth/2)-.5,f=Math.round(this._shapeHeight)-.5,g=0;0!==this._vertOffset&&0>this._vertOffset==this._isUp&&(g=-d*Math.round(f+this._stepY));for(var h=0,k=this.items.length;h<k;h++){var l=this.items[h],m=l.x+.5,n=l.y+this._vertOffset+g+.5,p;l.style&&null!=l.style.color?(p=l.style.color,l=l.style.borderColor):(p=this._color,l=this._borderColor);p!==b&&(b=p,c&&(a.fill(),a.stroke()),a.beginPath(),
|
|
a.fillStyle=p,a.strokeStyle=l);a.translate(m,n);a.moveTo(0,0);a.lineTo(this._stepX,this._stepY*d);a.lineTo(e,this._stepY*d);a.lineTo(e,f*d);a.lineTo(-e,f*d);a.lineTo(-e,this._stepY*d);a.lineTo(-this._stepX,this._stepY*d);a.lineTo(0,0);a.translate(-m,-n);c=!0}c&&(a.fill(),a.stroke())};
|
|
TradingView.PaneRendererLabelsBase.prototype.hitTest=function(a,b){for(var c=this._stepY/2,d=this._vertOffset,e,f=this._isUp?1:-1,g=0;g<this.items.length;++g){var h=this.items[g];if(h){var k=f*c;0!==this._vertOffset&&0>this._vertOffset==this._isUp&&(k=-f*(this._shapeHeight+c));e=new MathEx.Point(h.x,h.y+d+k);e=e.substract(a).length();if(e<=c)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);e=this._shapeWidth/2;k=0;0!==this._vertOffset&&0>this._vertOffset==this._isUp&&(k=-f*
|
|
(this._shapeHeight+this._stepY));var l=h.y+d+k,k=a.x,m=a.y,n=l+(this._isUp?this._stepY:-this._shapeHeight),p=h.x+e,l=l+(this._isUp?this._shapeHeight:-this._stepY);if(k>h.x-e&&k<p&&m>n&&m<l)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)}}return null};TradingView.PaneRendererLabelUp=function(a){TradingView.PaneRendererLabelsBase.call(this,a,!0)};inherit(TradingView.PaneRendererLabelUp,TradingView.PaneRendererLabelsBase);
|
|
TradingView.PaneRendererLabelDown=function(a){TradingView.PaneRendererLabelsBase.call(this,a,!1)};inherit(TradingView.PaneRendererLabelDown,TradingView.PaneRendererLabelsBase);TradingView.PaneRendererSquare=function(a){R52.call(this,a)};inherit(TradingView.PaneRendererSquare,R52);
|
|
TradingView.PaneRendererSquare.prototype.drawShape=function(a){for(var b,c=!1,d=Math.round(this.height/2),e=0,f=this.items.length;e<f;e++){var g=this.items[e],h,k;g.style&&null!=g.style.color?(h=g.style.color,k=g.style.borderColor):(h=this._color,k=this._borderColor);h!==b&&(b=h,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=h,a.strokeStyle=k);a.rect(g.x-d,g.y+this._vertOffset-d,this.height,this.height);c=!0}c&&(a.fill(),a.stroke())};
|
|
TradingView.PaneRendererDiamond=function(a){R52.call(this,a)};inherit(TradingView.PaneRendererDiamond,R52);
|
|
TradingView.PaneRendererDiamond.prototype.drawShape=function(a){for(var b,c=!1,d=Math.round(this.height/2),e=0,f=this.items.length;e<f;e++){var g=this.items[e],h,k;g.style&&null!=g.style.color?(h=g.style.color,k=g.style.borderColor):(h=this._color,k=this._borderColor);h!==b&&(b=h,c&&(a.fill(),a.stroke()),a.beginPath(),a.fillStyle=h,a.strokeStyle=k);c=g.x;g=g.y+this._vertOffset;a.moveTo(c,g-d);a.lineTo(c+d,g);a.lineTo(c,g+d);a.lineTo(c-d,g);a.lineTo(c,g-d);c=!0}c&&(a.fill(),a.stroke())};
|
|
R55=function(a){this._items=a.items.toArray();this._y=a.y;this._h=a.h;this._w=a.w};R55.prototype.draw=function(a){};R55.prototype.drawBackground=function(a){a.save();"undefined"==typeof FlashCanvas&&a.translate(-.5,-.5);for(var b=0;b<this._items.length;++b){var c=this._items[b];null!=c.color&&(a.fillStyle=c.color,a.fillRect(c.x,this._y,b==this._items.length-1?this._w:this._items[b+1].x-c.x,this._h))}a.restore()};
|
|
R55.prototype.hitTest=function(a){return null};TradingView.PaneRendererClockIcon=function(a){a.point2||(a.point2=a.point1);var b=a.point1.x,c=a.point1.y,b=b<=a.point2.x?b-10:b+10,c=c<=a.point2.y?c+10:c-10;a={items:[new MathEx.Point(b-1,c-3)],"char":[String.fromCharCode("0xF017").toUpperCase()],color:a.color,vertOffset:0,height:16,fontFamily:"FontAwesome"};R73.call(this,a)};inherit(TradingView.PaneRendererClockIcon,R73);
|
|
TradingView.PaneRendererStudyStrategyOrders=function(a,b){this._items=a.items.toArray();this._color=a.color;this._orderArrow=a.orderArrow;this._exitLineWidth=a.exitLineWidth;this._priceArrow=a.priceArrow;this._text=a.text;this._textWidths=b};
|
|
TradingView.PaneRendererStudyStrategyOrders.prototype._drawOrderArrow=function(a,b,c,d){var e=b.x;b=b.y;d?(a.rotate(Math.PI),e=-e-this._orderArrow.width/2,b=-b-this._orderArrow.height):(e-=this._orderArrow.width/2,b-=this._orderArrow.height);c&&(b-=c);var f=d?"floor":"ceil",e=Math[f](e)+(d?-.5:.5);b=Math[f](b)+.5;a.translate(e,b);a.moveTo(.25*this._orderArrow.width,0);a.lineTo(.75*this._orderArrow.width,0);a.lineTo(.75*this._orderArrow.width,.45*this._orderArrow.height);a.lineTo(this._orderArrow.width,
|
|
.45*this._orderArrow.height);a.lineTo(.5*this._orderArrow.width,this._orderArrow.height);c&&(a.lineTo(this._orderArrow.width,this._orderArrow.height),a.lineTo(this._orderArrow.width,this._orderArrow.height+c),a.lineTo(0,this._orderArrow.height+c),a.lineTo(0,this._orderArrow.height),a.lineTo(.5*this._orderArrow.width,this._orderArrow.height));a.lineTo(0,.45*this._orderArrow.height);a.lineTo(.25*this._orderArrow.width,.45*this._orderArrow.height)};
|
|
TradingView.PaneRendererStudyStrategyOrders.prototype._drawPriceArrow=function(a,b,c){var d=b.x;b=b.y;c?(a.rotate(Math.PI),d=-d-this._priceArrow.width,b=-b-this._priceArrow.height/2):(d-=this._priceArrow.width,b-=this._priceArrow.height/2);d=Math.round(d)+(c?-1.5:.5);b=Math.floor(b)+.5;a.translate(d,b);a.moveTo(0,0);a.lineTo(this._priceArrow.width,.5*this._priceArrow.height);a.lineTo(0,this._priceArrow.height)};
|
|
TradingView.PaneRendererStudyStrategyOrders.prototype.draw=function(a){a.beginPath();for(var b=0,c,d;b<this._items.length;b++)c=this._items[b],d="lower"==c.pos,a.save(),a.translate(0,d?this._orderArrow.vMargin:-this._orderArrow.vMargin),this._drawOrderArrow(a,c.orderPoint,this._exitLineWidth,d),a.restore(),a.save(),this._drawPriceArrow(a,c.pricePoint,!d),a.restore();a.closePath();a.fillStyle=this._color;a.fill();if(this._text)for(a.font=this._text.fontSize+"px "+this._text.font,a.textAlign="center",
|
|
a.textBaseline="top",b=0;b<this._items.length;b++)c=this._items[b],d="lower"==c.pos,a.save(),a.translate(0,d?this._orderArrow.vMargin:-this._orderArrow.height-this._orderArrow.vMargin),c.label&&(a.translate(0,d?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),a.fillText(c.label,Math.ceil(c.orderPoint.x),c.orderPoint.y),"number"!=typeof this._textWidths[c.label]&&(this._textWidths[c.label]=a.measureText(c.label).width)),c.qty&&
|
|
(a.translate(0,d?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),a.fillText(c.qty,Math.ceil(c.orderPoint.x),c.orderPoint.y),"number"!=typeof this._textWidths[c.qty]&&(this._textWidths[c.qty]=a.measureText(c.qty).width)),a.restore()};
|
|
TradingView.PaneRendererStudyStrategyOrders.prototype._testOrderArrows=function(a){for(var b=0,c=this._orderArrow.width/2,d,e,f;b<this._items.length;b++)if(d=this._items[b].orderPoint,!(a.x<d.x-c||a.x>d.x+c||(e=this._items[b],f="lower"==e.pos,e=this._orderArrow.height+this._exitLineWidth,f||(e=-e),f=d.y+(f?this._orderArrow.vMargin:-this._orderArrow.vMargin),d=Math.min(f,f+e),e=Math.max(f,f+e),a.y<d||a.y>e)))return!0;return!1};
|
|
TradingView.PaneRendererStudyStrategyOrders.prototype._testText=function(a){for(var b=0,c,d,e,f,g,h;b<this._items.length;b++)if(c=this._items[b],d=c.orderPoint,e="lower"==c.pos,f=this._orderArrow.vMargin+this._orderArrow.height+this._exitLineWidth,e||(f=-f),f=d.y+f,g=this._text.vMargin+this._text.fontSize*(!!c.label+!!c.qty),e||(g=-g),h=Math.min(f,f+g),g=Math.max(f,f+g),!(a.y<h||a.y>g||(c=c.label&&c.qty?e&&a.y<f+this._text.fontSize||!e&&a.y>f-this._text.fontSize:c.label||c.qty,e=(c=this._textWidths[c])&&
|
|
c/2,!c||a.x<d.x-e||a.x>d.x+e)))return!0;return!1};TradingView.PaneRendererStudyStrategyOrders.prototype.hitTest=function(a){var b=this._testOrderArrows(a);a=!b&&this._text&&this._testText(a);if(b||a)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)};R62=function(a){this.data=a};
|
|
R62.prototype.draw=function(a){var b=this.data.vertLinesVisible,c=this.data.horzLinesVisible;if((b||c)&&this.data){a.lineStyle=this.data.lineStyle;a.lineWidth=this.data.lineWidth;a.strokeStyle=this.data.color;var d=0===this.data.lineWidth%2?.5:0,e=this.data.x+1+d,d=this.data.y+d,f=this.data.w,g=this.data.h;b&&0<=e&&CanvasEx.drawLine(a,e,0,e,g);c&&0<=d&&CanvasEx.drawLine(a,0,d,f,d);this.data.drawCenter&&(a.beginPath(),a.arc(e,d,3,0,2*Math.PI,!0),a.fillStyle=this.data.color,
|
|
a.fill())}};TradingView.PaneRendererCrossHairLock=function(a){this._data=a};TradingView.PaneRendererCrossHairLock.prototype._drawShackle=function(a){var b=(this._data.width-3)/2,c=this._data.height-this._data.bodyHeight;a.moveTo(1.5,b);a.arc(this._data.width/2,b,b,Math.PI,2*Math.PI);c>b&&(a.moveTo(1.5,b),a.lineTo(1.5,c),a.moveTo(this._data.width-1.5,b),a.lineTo(this._data.width-1.5,c))};
|
|
TradingView.PaneRendererCrossHairLock.prototype.draw=function(a){a.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2);a.strokeStyle="rgba(153,153,153,.3)";a.lineWidth=2;a.beginPath();this._drawShackle(a);a.stroke();a.closePath();a.strokeStyle="rgba(153,153,153,.7)";a.lineWidth=1;a.beginPath();a.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight);a.closePath();a.stroke();a.translate(0,-1);a.strokeStyle="#777";a.beginPath();this._drawShackle(a);
|
|
a.stroke();a.closePath();a.fillStyle="rgba(255,255,255,.7)";a.beginPath();a.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2);a.fill();a.beginPath();a.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1);a.stroke();a.closePath();a.fillStyle="#777";a.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)};TradingView.PaneRendererCachedImage=function(a,b,c){this._cache=a;this._cacheRect=b;this._targetRect=c};TradingView.PaneRendererCachedImage.prototype.draw=function(a){a.translate(.5,.5);a.drawImage(this._cache,this._cacheRect.left,this._cacheRect.top,this._cacheRect.width,this._cacheRect.height,this._targetRect.left,this._targetRect.top,this._targetRect.width,this._targetRect.height);a.translate(-.5,-.5)};
|
|
TradingView.PaneRendererCachedImage.prototype.hitTest=function(a){var b=new MathEx.Point(this._targetRect.left,this._targetRect.top),c=b.add(new MathEx.Point(this._targetRect.width,this._targetRect.height));return MathEx.pointInRect(a,b,c)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};function PriceRange(a,b){this.m_minValue=a;this.m_maxValue=b}PriceRange.prototype.equals=function(a){return this.m_minValue==a.m_minValue&&this.m_maxValue==a.m_maxValue};PriceRange.prototype.clone=function(){return new PriceRange(this.m_minValue,this.m_maxValue)};PriceRange.prototype.minValue=function(){return this.m_minValue};PriceRange.prototype.maxValue=function(){return this.m_maxValue};PriceRange.prototype.length=function(){return this.m_maxValue-this.m_minValue};
|
|
PriceRange.prototype.isEmpty=function(){return this.m_maxValue===this.m_minValue||this.m_maxValue!=this.m_maxValue||this.m_minValue!=this.m_minValue};PriceRange.prototype.state=function(){return{min:this.m_minValue,max:this.m_maxValue}};PriceRange.prototype.merge=function(a){return new PriceRange(Math.min(this.minValue(),a.minValue()),Math.max(this.maxValue(),a.maxValue()))};
|
|
PriceRange.prototype.apply=function(a,b){this.m_minValue=Math.min(this.m_minValue,a);this.m_maxValue=Math.max(this.m_maxValue,b)};PriceRange.prototype.scaleAroundCenter=function(a){if(!isNumber(a))TradingView.logDebugChart("PriceRange.scaleAroundCenter: invalid coeff");else if(0!==this.m_maxValue-this.m_minValue){var b=.5*(this.m_maxValue+this.m_minValue),c=this.m_maxValue-b,d=this.m_minValue-b;this.m_maxValue=b+c*a;this.m_minValue=b+d*a}};
|
|
PriceRange.prototype.shift=function(a){isNumber(a)?(this.m_maxValue+=a,this.m_minValue+=a):TradingView.logDebugChart("PriceRange.shift: invalid coeff")};PriceRange.prototype.convertToPercent=function(a,b){return 100*(a-b)/b};PriceRange.prototype.convertFromPercent=function(a,b){return a/100*b+b};PriceRange.prototype.convertToPercents=function(a){return new PriceRange(100*(this.m_minValue-a)/a,100*(this.m_maxValue-a)/a)};
|
|
PriceRange.prototype.convertFromPercents=function(a){return new PriceRange(this.m_minValue/100*a+a,this.m_maxValue/100*a+a)};TradingView.TickMark=function(a,b,c){this.coord=a;this.label=b;this.major=c};
|
|
TradingView.PriceTickSpanCalculator=function(a,b){this.m_base=a;this.m_integralDividers=b;this.m_fractionalDividers=[];if(MathEx.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var c=this.m_base;1!==c;){if(0===c%2)this.m_fractionalDividers.push(2),c/=2;else if(0===c%5)this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),c/=5;else throw new RangeError("unexpected base");if(100<this.m_fractionalDividers.length)throw Error("something wrong with base");}};
|
|
TradingView.PriceTickSpanCalculator.prototype.TICK_SPAN_EPSILON=1E-9;
|
|
TradingView.PriceTickSpanCalculator.prototype.tickSpan=function(a,b,c){var d=0===this.m_base?0:1/this.m_base,e=this.TICK_SPAN_EPSILON;a=Math.pow(10,Math.max(0,Math.ceil(MathEx.log10(a-b))));b=0;var f;b=0;for(f=this.m_integralDividers[0];a>d+e&&MathEx.greaterOrEqual(a,d,e)&&MathEx.greaterOrEqual(a,c*f,e)&&MathEx.greaterOrEqual(a,1,e);++b,f=this.m_integralDividers[b%this.m_integralDividers.length])a/=f;a<=d+e&&(a=d);a=Math.max(1,a);if(0<this.m_fractionalDividers.length&&MathEx.equal(a,1,e))for(b=0,
|
|
f=this.m_fractionalDividers[0];a>d+e&&MathEx.greaterOrEqual(a,c*f,e);++b,f=this.m_fractionalDividers[b%this.m_fractionalDividers.length])a/=f;return a};TradingView.PriceTickMarkBuilder=function(a,b,c){this.m_marks=[];this.m_base=b;this.m_priceScale=a;this.m_fontHeight=14;if(this._formatter=c)this._cache=new TradingView.FormattedLabelsCache(function(a){return c.format(a)});this._currentFormatBase=0};TradingView.PriceTickMarkBuilder.prototype.TICK_DENSITY=2;
|
|
TradingView.PriceTickMarkBuilder.prototype.base=function(){return this.m_base};TradingView.PriceTickMarkBuilder.prototype.setBase=function(a){if(0>a)throw new RangeError("base < 0");this.m_base=a};TradingView.PriceTickMarkBuilder.prototype.fontHeight=function(){return this.m_fontHeight};TradingView.PriceTickMarkBuilder.prototype.setFontHeight=function(a){this.m_fontHeight!==a&&(this.m_fontHeight=a)};
|
|
TradingView.PriceTickMarkBuilder.prototype.tickSpan=function(a,b){if(a<b)throw new RangeError("high < low");var c=this.m_priceScale.height(),d=this.tickMarkHeight(),c=(a-b)*d/c,d=new TradingView.PriceTickSpanCalculator(this.m_base,[2,2.5,2]),e=new TradingView.PriceTickSpanCalculator(this.m_base,[2,2,2.5]),f=new TradingView.PriceTickSpanCalculator(this.m_base,[2.5,2,2]),g=[];g.push(d.tickSpan(a,b,c));g.push(e.tickSpan(a,b,c));g.push(f.tickSpan(a,b,c));return MathEx.min(g)};
|
|
TradingView.PriceTickMarkBuilder.prototype.tickMarkHeight=function(){return this.m_fontHeight*this.TICK_DENSITY};function calculateBaseForTickSpan(a){for(var b=1;a*b!==Math.round(a*b);)b*=10;return b}
|
|
TradingView.PriceTickMarkBuilder.prototype.rebuildTickMarks=function(){if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())this.m_marks=[];else{var a=this.m_priceScale.height(),b=this.m_priceScale.coordinateToPrice(a-1),c=this.m_priceScale.coordinateToPrice(0),a=c>=b?1:-1,d=Math.max(c,b),b=Math.min(c,b),c=d;if(c!=b){var d=this.tickSpan(c,b),e=c%d,e=e+(0>e?d:0);this.m_marks=[];if(!this._formatter){var f=calculateBaseForTickSpan(d);if(!this._cache||this._currentFormatBase!=
|
|
f){var g=new TradingView.PriceFormatter(f);this._cache=new TradingView.FormattedLabelsCache(function(a){return g.format(a)})}}f=null;for(c-=e;c>b;c-=d)e=this.m_priceScale.priceToCoordinate(c),null!==f&&Math.abs(e-f)<this.tickMarkHeight()||(f=new TradingView.TickMark(e,this._cache.format(c),0),this.m_marks.push(f),f=e,this.m_priceScale.isLog()&&(d=this.tickSpan(c*a,b)))}}};TradingView.PriceTickMarkBuilder.prototype.marks=function(){return this.m_marks};
|
|
function R76(a){function b(){for(var a=c.m_dataSources,b=0;b<a.length;b++){var f=a[b];f.priceScaleChanged&&f.priceScaleChanged.fire(c)}}this.D2=a;this.m_height=0;this.m_priceRange=null;this.m_dataSources=[];this._studyBottomMargin=this._studyTopMargin=this.m_bottomMargin=this.m_topMargin=0;this.m_priceRangeSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_markBuilder=new TradingView.PriceTickMarkBuilder(this,100,new TradingView.PriceFormatter(100));this.D2.percentage.listeners().subscribe(this,
|
|
R76.prototype.updateFormatter);var c=this;this.D2.log.listeners().subscribe(null,function(a){if(c.m_priceRange){var b=c.m_priceRange;a.value()?c.m_priceRange=new PriceRange(c._toLog(b.minValue()),c._toLog(b.maxValue())):c.m_priceRange=new PriceRange(c._fromLog(b.minValue()),c._fromLog(b.maxValue()))}});this.D2.percentage.listeners().subscribe(null,function(){c.D2.autoScale.setValue(!0)});this.D2.percentage.listeners().subscribe(null,function(){c.D2.autoScaleDisabled.setValue(c.D2.percentage.value());
|
|
var a=c.priceRange();if(!(!c.mainSource()||c.mainSource().model().timeScale().isEmpty()||c.mainSource().data().isEmpty()||c.mainSource()instanceof TradingView.Series&&!c.mainSource().properties().lockScale.value())&&a){var b=c.mainSource().model().timeScale().visibleBars(),b=c.mainSource().data().search(b.firstBar(),TradingView.SEARCH_NEAREST_RIGHT).value[TradingView.CLOSE_PLOT];null!=a&&void 0!==b&&(c.D2.percentage.value()?c.setPriceRange(a.convertToPercents(b)):c.setPriceRange(a.convertFromPercents(b)))}});
|
|
this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this._hasSeries=!1;this.D2.percentage.listeners().subscribe(null,b);this.D2.log.listeners().subscribe(null,b);this.D2.listeners().subscribe(null,function(){c.mainSource()&&c.mainSource().model()&&c.mainSource().model().fullUpdate()})}R76.prototype.isLog=function(){return this.D2.log.value()};R76.prototype.isPercent=function(){return this.D2.percentage.value()};
|
|
R76.prototype.properties=function(){return this.D2};R76.prototype.height=function(){return this.m_height};R76.prototype.setHeight=function(a){var b=this.m_height;this.m_height=a;this._internalHeightCache=void 0;this._marksCache=null;b!=a&&this.mainSource()instanceof TradingView.Series&&this.mainSource().isLockScale()&&this.mainSource().model().timeScale().recalcLockedScale()};R76.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)};
|
|
R76.prototype.setTopMargin=function(a){if(!isNumber(a))throw new TypeError("invalid margin");if(0>a||30<a)throw new RangeError("invalid margin");this.m_topMargin=a;this._internalHeightCache=void 0;this._marksCache=null};R76.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)};
|
|
R76.prototype.setBottomMargin=function(a){if(!isNumber(a))throw new TypeError("invalid margin");if(0>a||30<a)throw new RangeError("invalid margin");this.m_bottomMargin=a;this._internalHeightCache=void 0;this._marksCache=null};R76.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var a=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=a};R76.prototype.priceRange=function(){return this.m_priceRange};
|
|
R76.prototype.setPriceRange=function(a){if(!a instanceof PriceRange)throw new TypeError("incorrect price range");this.m_priceRange&&this.m_priceRange.equals(a)||(this.m_priceRange=a,this._marksCache=null)};R76.prototype.isEmpty=function(){return 0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()};R76.prototype.invertedCoordinate=function(a){return this.height()-1-a};R76._logicalOffset=4;R76._coordOffset=1E-4;
|
|
R76.prototype.log10=function(a){return Math.log(a)/Math.log(10)};R76.prototype._toLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=this.log10(b+R76._coordOffset)+R76._logicalOffset;return 0>a?-b:b};R76.prototype.priceToLogical=function(a){return this.isLog()&&a?this._toLog(a):a};R76.prototype._fromLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=Math.pow(10,b-R76._logicalOffset)-R76._coordOffset;return 0>a?-b:b};
|
|
R76.prototype.logicalToPrice=function(a){return this.isLog()?this._fromLog(a):a};R76.prototype.priceToCoordinate=function(a,b){if(this.isEmpty())return 0;a=this.priceToLogical(a);var c=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(a-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),c=this.invertedCoordinate(c);return b?c:Math.round(c)};
|
|
R76.prototype.pricesToCoordinates=function(a){this.pricesToCoordinatesEx(a.toArray(),function(a){return a.y},function(a,c){a.y=c})};
|
|
R76.prototype.pricesToCoordinatesEx=function(a,b,c){var d=this.bottomMargin()*this.height(),e=this.priceRange().minValue(),f=this.priceRange().maxValue(),f=(this.internalHeight()-1)/(f-e);if(this.isLog())for(var g=0;g<a.length;g++){var h=b(a[g]);c(a[g],this.priceToLogical(h))}for(g=0;g<a.length;g++)h=b(a[g]),TradingView.isNaN(h)||void 0===h||null===h||c(a[g],Math.round(this.m_height-1-(d+f*(h-e))))};
|
|
R76.prototype.pointsArrayToCoordinates=function(a){var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e].y=this.priceToLogical(a[e].y);for(e=0;e<a.length;e++){var f=a[e].y;TradingView.isNaN(f)||void 0===f||null===f||(a[e].y=Math.round(this.m_height-1-(b+d*(f-c))))}};
|
|
R76.prototype.pricesArrayToCoordinates=function(a){var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e]=this.priceToLogical(a[e]);for(e=0;e<a.length;e++){var f=a[e];void 0!==f&&null!==f&&(a[e]=Math.round(this.m_height-1-(b+d*(f-c))))}};
|
|
R76.prototype.barPricesToCoordinates=function(a){a=a.toArray();var b=this.bottomMargin()*this.height(),c=this.priceRange().minValue(),d=this.priceRange().maxValue(),d=(this.internalHeight()-1)/(d-c);if(this.isLog())for(var e=0;e<a.length;e++)a[e]&&(a[e].open=this.priceToLogical(a[e].open),a[e].high=this.priceToLogical(a[e].high),a[e].low=this.priceToLogical(a[e].low),a[e].close=this.priceToLogical(a[e].close),a[e].additionalPrice&&(a[e].additionalPrice=this.priceToLogical(a[e].additionalPrice)));
|
|
for(e=0;e<a.length;e++){var f=a[e];if(f){var g=f.open,g=b+d*(g-c),g=this.m_height-1-g;f.open=Math.round(g);g=f.high;g=b+d*(g-c);g=this.m_height-1-g;f.high=Math.round(g);g=f.low;g=b+d*(g-c);g=this.m_height-1-g;f.low=Math.round(g);g=f.close;g=b+d*(g-c);g=this.m_height-1-g;f.close=Math.round(g);f.additionalPrice&&(g=f.additionalPrice,g=b+d*(g-c),g=this.m_height-1-g,f.additionalPrice=Math.round(g))}}};
|
|
R76.prototype.coordinateToPrice=function(a){if(this.isEmpty())return 0;a=this.invertedCoordinate(a);a=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((a-this.bottomMargin()*this.height())/(this.internalHeight()-1));return this.logicalToPrice(a)};R76.prototype.isAutoScale=function(){return this.D2.autoScale.value()&&!(this.mainSource()instanceof TradingView.Series&&this.mainSource().isLockScale())};R76.prototype.isPercentage=function(){return this.D2.percentage.value()};
|
|
R76.prototype.D19=function(){return this.m_dataSources};R76.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0;b<this.m_dataSources.length;b++){var c=this.m_dataSources[b];null==c.zorder()&&c.setZorder(b+1);a.push(c)}return this._cachedOrderedSoruces=a=R75.sortSources(a)};R76.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null};
|
|
R76.prototype.addDataSource=function(a){if(-1===this.m_dataSources.indexOf(a)){TradingView.isInherited(a.constructor,TradingView.Series)&&(this._hasSeries=!0);var b=this;a.properties().visible.listeners().subscribe(null,function(){b._sourcesForAutoscale=null});this.m_dataSources.push(a);this._mainSource=void 0;this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this.updateFormatter();this.initScaleProperties();this.invalidateSourcesCache()}};
|
|
R76.prototype.initScaleProperties=function(){var a=this.mainSource()instanceof TradingView.Series&&this.mainSource().properties().lockScale.value();a&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1));this.properties().percentageDisabled.setValue(a);this.properties().logDisabled.setValue(a);this.properties().autoScaleDisabled.setValue(this.properties().percentage.value());this.properties().percentage.value()&&this.properties().log.setValue(!1)};
|
|
R76.prototype.removeDataSource=function(a){var b=this.m_dataSources.indexOf(a);if(-1===b)throw Error("source is not attached to scale");this.m_dataSources.splice(b,1);TradingView.isInherited(a.constructor,TradingView.Series)&&(this._hasSeries=!1);this.mainSource()||this.setAutoScale(!0);this._mainSource=void 0;this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this.updateFormatter();this.invalidateSourcesCache()};R76.prototype.setAutoScale=function(a){this.D2.autoScale.setValue(a)};
|
|
R76.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint};R76.prototype.startScale=function(a){this.isPercentage()||null!==this.m_scaleStartPoint||null!==this.m_priceRangeSnapshot||this.isEmpty()||(this.m_scaleStartPoint=this.m_height-a,this.m_priceRangeSnapshot=this.priceRange().clone())};R76.prototype.marks=function(){if(this._marksCache)return this._marksCache;this.m_markBuilder.rebuildTickMarks();return this._marksCache=this.m_markBuilder.marks()};
|
|
R76.prototype.scaleTo=function(a){if(!this.isPercentage()&&(this._marksCache=null,null!==this.m_scaleStartPoint)){this.setAutoScale(!1);var b=this.m_priceRange.clone();a=this.m_height-a;0>a&&(a=0);a=(this.m_scaleStartPoint+.2*(this.m_height-1))/(a+.2*(this.m_height-1));a=Math.max(a,.1);this.m_priceRange=this.m_priceRangeSnapshot.clone();this.m_priceRange.scaleAroundCenter(a);this.recalcLockedScale(b)}};
|
|
R76.prototype.recalcLockedScale=function(a){if(this.mainSource()instanceof TradingView.Series&&this.mainSource().properties().lockScale.value()){var b=this.mainSource().model().timeScale(),c=this.mainSource().data().boxSize;void 0===c&&this.mainSource().fixBoxSize();if(void 0!==c){if(this.properties().percentage.value())var d=this.mainSource().data().search(this.mainSource().getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],c=PriceRange.prototype.convertToPercent.call(null,d+
|
|
c,d)-PriceRange.prototype.convertToPercent.call(null,d,d);c*=this.internalHeight()/this.priceRange().length();.5>c||50<c?this.m_priceRange=a:(b.setBarSpacing(c),b._correctOffset());this.mainSource().model().mainSeries().requestMoreData()}}};R76.prototype.endScale=function(){this.isPercentage()||null===this.m_scaleStartPoint||(this.m_priceRangeSnapshot=this.m_scaleStartPoint=null)};
|
|
R76.prototype.startScroll=function(a){this.isAutoScale()||null!==this.m_scrollStartPoint||null!==this.m_priceRangeSnapshot||this.isEmpty()||(this.m_scrollStartPoint=a,this.m_priceRangeSnapshot=this.priceRange().clone())};R76.prototype.scrollTo=function(a){this._marksCache=null;if(!this.isAutoScale()&&null!==this.m_scrollStartPoint){var b=this.priceRange().length()/(this.height()-1);a=(a-this.m_scrollStartPoint)*b;this.m_priceRange=this.m_priceRangeSnapshot.clone();this.m_priceRange.shift(a)}};
|
|
R76.prototype.endScroll=function(){this.isAutoScale()||null===this.m_scrollStartPoint||(this.m_priceRangeSnapshot=this.m_scrollStartPoint=null)};R76.prototype.state=function(){var a={};a.m_priceRange=this.priceRange()?this.priceRange().clone():null;a.m_isAutoScale=this.isAutoScale();a.m_isPercentage=this.D2.percentage.value();a.m_isLog=this.D2.log.value();a.m_height=this.m_height;a.m_topMargin=this.m_topMargin;a.m_bottomMargin=this.m_bottomMargin;return a};
|
|
R76.prototype.restoreState=function(a){var b=a.m_priceRange;if(void 0===b)throw new TypeError("invalid state");if(void 0===a.m_isAutoScale)throw new TypeError("invalid state");void 0!==a.m_isPercentage&&this.D2.percentage.setValue(a.m_isPercentage);void 0!==a.m_isLog&&this.D2.log.setValue(a.m_isLog);this.m_priceRange=b?new PriceRange(b.m_minValue,b.m_maxValue):null;void 0!==a.m_height&&(this.m_height=a.m_height);this.setAutoScale(a.m_isAutoScale);void 0!==a.m_topMargin&&(this.m_topMargin=
|
|
a.m_topMargin);void 0!==a.m_bottomMargin&&(this.m_bottomMargin=a.m_bottomMargin);this._mainSource=void 0;this._scaleSeriesOnly=!1};R76.prototype.mainSource=function(){if(void 0!==this._mainSource)return this._mainSource;for(var a=0;a<this.m_dataSources.length;a++)if(TradingView.isInherited(this.m_dataSources[a].constructor,TradingView.PriceDataSource))return this._mainSource=a=this.m_dataSources[a];this._mainSource=void 0;return null};
|
|
R76.prototype.formatter=function(){this._formatter||this.updateFormatter();return this._formatter};R76.prototype.updateFormatter=function(){this._marksCache=null;var a=this.mainSource(),b=100;a&&(b=a.base());this._formatter=null;this.properties().percentage.value()?this._formatter=new TradingView.PercentageFormatter:this._formatter=a?a.formatter():new TradingView.PriceFormatter(100,1);this.m_markBuilder=new TradingView.PriceTickMarkBuilder(this,b,this._formatter);this.m_markBuilder.rebuildTickMarks()};
|
|
R76.prototype._recalculateSourcesForAutoscale=function(){this._mainSource&&(this._scaleSeriesOnly=this._mainSource.model().properties().scalesProperties.scaleSeriesOnly.value());var a=this._scaleSeriesOnly&&this._hasSeries;this._sourcesForAutoscale=this.m_dataSources.filter(function(b){return!(b.properties().visible.value()||b instanceof TradingView.Series)||b instanceof TradingView.study_Script$TV_DIVIDENDS||b instanceof TradingView.study_Script$TV_SPLITS||b instanceof TradingView.study_Script$TV_EARNINGS?
|
|
!1:a?TradingView.isInherited(b.constructor,TradingView.Series):TradingView.isInherited(b.constructor,TradingView.PriceDataSource)})};R76.prototype.sourcesForAutoscale=function(){if(this._mainSource){var a=this._mainSource.model().properties();this._scaleSeriesOnly!=a.scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null)}this._sourcesForAutoscale||this._recalculateSourcesForAutoscale();return this._sourcesForAutoscale};
|
|
R76.prototype.recalculatePriceRange=function(a){var b=null,c=this.sourcesForAutoscale();this.mainSource();for(var d=0,e=0,f=0;f<c.length;f++){var g=c[f];if(g.properties().visible.value()){var h=a.firstBar(),k=a.lastBar(),h=g.priceRange(h,k);null===b&&h?b=h:h&&(b=b.merge(h));g.margins&&(g=g.margins(),d=Math.max(g[0],d),e=Math.max(g[1],e))}}if(.01<Math.abs(e-this._studyBottomMargin)||.01<Math.abs(d-this._studyTopMargin))this._studyBottomMargin=e,this._studyTopMargin=d,this._internalHeightCache=
|
|
this._marksCache=null;b?(b.minValue()==b.maxValue()&&(b=new PriceRange(b.minValue()-.5,b.maxValue()+.5)),this.setPriceRange(b)):this.m_priceRange||this.setPriceRange(new PriceRange(-.5,.5))};R76.prototype.sourcesToUpdateViews=function(){if(!this._sourcesToUpdateViews){this._sourcesToUpdateViews=[];for(var a=0;a<this.m_dataSources.length;a++){var b=this.m_dataSources[a];TradingView.isInherited(b.constructor,R47)&&!b.isActualSymbol()||this._sourcesToUpdateViews.push(b)}}return this._sourcesToUpdateViews};
|
|
R76.prototype.updatePaneViews=function(){for(var a=this.sourcesToUpdateViews(),b=0;b<a.length;b++)a[b].updateAllViews()};A58=function(a,b){this.m_bars=new TradingView.PlotList("time open high low close adt style".split(" "));this.m_nsBars=new TradingView.PlotList("time open high low close adt style".split(" "));this.m_series=a;this.m_model=b;this.boxSize=this.lastProjectionPrice=void 0};A58.prototype.bars=function(){return this.m_bars};A58.prototype.nsBars=function(){return this.m_nsBars};
|
|
A58.prototype.size=function(){return this.m_nsBars._end-this.m_nsBars._start+(this.m_bars._end-this.m_bars._start)};A58.prototype.each=function(a){for(var b=this.m_bars._start;b<this.m_bars._end&&!a(this.m_bars._indexAt(b),this.m_bars._valueAt(b));++b);for(b=this.m_nsBars._start;b<this.m_nsBars._end&&!a(this.m_nsBars._indexAt(b),this.m_nsBars._valueAt(b));++b);};
|
|
A58.prototype.clear=function(){this.m_bars=new TradingView.PlotList("time open high low close adt style".split(" "));this.m_nsBars=new TradingView.PlotList("time open high low close adt style".split(" "));this.boxSize=this.lastProjectionPrice=void 0};A58.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars._items[0]:this.m_bars._items[0]};A58.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()};
|
|
A58.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars._items[this.m_bars._end-1]:this.m_nsBars._items[this.m_nsBars._end-1]};A58.prototype.search=function(a,b){return this.nsBars().isEmpty()?this.bars().search(a,b):this.bars().isEmpty()?this.nsBars().search(a,b):this.nsBars().firstTimeIndex()<=a?this.nsBars().search(a,b):this.bars().search(a,b)};A58.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
|
|
A58.prototype.firstBar=function(){if(this.m_model.timeScale().isEmpty())return null;var a=this.m_model.timeScale().visibleBars().firstBar();return(a=this.search(a,TradingView.SEARCH_NEAREST_RIGHT))?a.value:null};A58.prototype.firstValue=function(){var a=this.firstBar();return a?a[TradingView.CLOSE_PLOT]:null};
|
|
A58.prototype.timeToBarIndex=function(a,b){if(null===a)return TradingView.logDebugChart("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"),0;if(b===TradingView.SEARCH_FROM_RIGHT){for(var c=this.m_bars.lastIndex();c>=this.m_bars.firstIndex();c--){var d=this.m_bars._valueAt(c);if(a>=d[TradingView.TIME_PLOT])return c}for(c=this.m_nsBars.lastIndex();c>=this.m_nsBars.firstIndex();c--)if(d=this.m_nsBars._valueAt(c),a>=d[TradingView.TIME_PLOT])return c;
|
|
return this.m_bars.firstIndex()}if(b===TradingView.SEARCH_FROM_LEFT){for(c=this.m_bars.firstIndex();c<=this.m_bars.lastIndex();c++)if(d=this.m_bars._valueAt(c),a<=d[TradingView.TIME_PLOT])return c;for(c=this.m_nsBars.firstIndex();c<=this.m_nsBars.lastIndex();c++)if(d=this.m_nsBars._valueAt(c),a<=d[TradingView.TIME_PLOT])return c;return this.m_bars.lastIndex()}TradingView.logDebugChart("SeriesData.timeToBarIndex: Incorrect options value");return 0};TradingView.DEFAULT_BAR_COUNT=300;TradingView.TIME_PLOT=0;TradingView.OPEN_PLOT=1;TradingView.HIGH_PLOT=2;TradingView.LOW_PLOT=3;TradingView.CLOSE_PLOT=4;TradingView.ADT_PLOT=6;TradingView.STYLE_PLOT=7;TradingView.SEARCH_FROM_LEFT=-1;TradingView.SEARCH_FROM_RIGHT=1;R23=function(a){this._series=a;this.D0=a.m_model;this._points=(new List).append(new MathEx.Point(0,0));this._invalidated=!0};
|
|
R23.prototype.update=function(){this._invalidated=!0};R23.prototype.updateImpl=function(){this._visible=!1;if(this._series.properties().showPriceLine.value()){var a=this._series.lastValueData(TradingView.CLOSE_PLOT,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
|
|
R23.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a={};a.points=this._points;a.color=this._color;a.linewidth=this._series.properties().priceLineWidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=TradingView.HitTestResult.REGULAR;a.visible=this._visible;return new TradingView.HorzLineRenderer(a)};TradingView.defaultRequestOption=function(){return{count:TradingView.DEFAULT_BAR_COUNT}};
|
|
TradingView.Series=function(a,b,c){TradingView.PriceDataSource.call(this,a);this._boxSizeChanged=new Delegate;this._tagsChanged=new Delegate;this._symbolIntervalChanged=new Delegate;this._symbolResolved=new Delegate;this._symbolError=new Delegate;this._symbolNotPermitted=new Delegate;this._extendedHoursChanged=new Delegate;this._extendedHoursNotPermitted=new Delegate;this.chartTypeNotPermitted=new Delegate;this.intradaySpreadNotPermitted=new Delegate;this.intradayExchangeNotPermitted=new Delegate;
|
|
this.customIntervalNotPermitted=new Delegate;this.chartWidgetInitialized=new Delegate;this._startLoading=new Delegate;this._dataLoaded=new Delegate;this._tickmarksRangeChanged=new Delegate;this._barReceived=new Delegate;this._onChangedStyle=new Delegate;this._onCompleted=new Delegate;this._onStatusChanged=new Delegate;this._onRestarted=new Delegate;this._onSessionsStudyCreated=new Delegate;this.requestingIntradayWhenNotSupported=new Delegate;this.requestingResolutionWhenNotSupported=new Delegate;
|
|
this.priceScaleChanged=new Delegate;this._requestOptions=c?c:TradingView.defaultRequestOption();this.m_model=a;this._chartApi=a._chartApi;this.m_data=new A58(this,a);this.setProperties(b);this._prevChartStyle=b.style.value();this.J63();this._dataWindowView=new TradingView.SeriesDataWindowView(this,a);this._statusView=new TradingView.SeriesStatusView(this,a.properties());this._priceAxisViews=[new TradingView.SeriesPriceAxisView(this,a),new TradingView.ProjectionSeriesPriceAxisView(this,
|
|
a)];this._symbolInfo=null;this._status=TradingView.Series.STATUS_OFFLINE;var d=this;this._turnaroundCounter=1;this._turnaround="s"+this._turnaroundCounter;this._handler=function(a){d.onData(a)};this.D2.addExclusion&&this.D2.addExclusion("visible");this._base=100;this._formatter=new TradingView.PriceFormatter(this._base);this._predictBars=0;this._futureBarsPaneView=null;this.D2.showInDataWindow.listeners().subscribe(a,TradingView.ChartModel.prototype.fullUpdate);this.marketStatus=
|
|
new WatchedValue;this._seriesLoaded=!1;this.properties().minTick.listeners().subscribe(this,TradingView.Series.prototype._recreateFormatter);d=this;this.properties().minTick.listeners().subscribe(null,function(){d.m_model.D20(new A22(A22.FULL_UPDATE))});this._priceLineView=new R23(this);this.bindStyleChange();this.bindJapChartsInputs();this.createExtendedHoursProperty();this.extendedHours.listeners().subscribe(this,
|
|
function(){this._extendedHoursChanged.fire()});this._extendedHoursNotPermitted.subscribe(this,function(){this.D2.extendedHours.setValue(!1)});this._extendedHoursChanged.subscribe(this,function(){this._status!==TradingView.Series.STATUS_SNAPSHOT&&this.restart()});this._symbolIntervalChanged.subscribe(this,this.checkInterval);this.properties().showCountdown.listeners().subscribe(this,TradingView.Series.prototype._onChangeShowCountdown);this._onChangeShowCountdown(this.properties().showCountdown);
|
|
this._recreateFormatter()};inherit(TradingView.Series,TradingView.PriceDataSource);TradingView.Series.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()};
|
|
TradingView.Series.prototype._onChangeShowCountdown=function(a){var b=this;a.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){b._priceAxisViews[0].update();b.m_model.D20(new A22(A22.LIGHT_UPDATE))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)};
|
|
TradingView.Series.prototype.lastValueData=function(a,b,c){a={};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return null;var d=this.m_model.timeScale().visibleBars();if(d.isEmpty())return null;var e;if(b){b=this.data().bars().last();if(null==b)return null;e=b.value;b=parseInt(b)}else{b=this.data().bars().search(d.lastBar(),TradingView.SEARCH_NEAREST_LEFT);if(void 0===b)return null;e=this.data().bars().valueAt(b.index);b=b.index}e=e[TradingView.CLOSE_PLOT];
|
|
c&&(a.price=e);this.priceScale().properties().percentage.value()&&(c=this.nearestIndex(d.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),this.data().valueAt(c),c=this.firstValue(),e=this.priceScale().priceRange().convertToPercent(e,c));a.text=this.priceScale().formatter().format(e);c=this.barColorer().barStyle(b,!1);a.color=c.barColor;a.floatCoordinate=this.priceScale().priceToCoordinate(e,!0);a.coordinate=Math.round(a.floatCoordinate);return a};
|
|
TradingView.Series.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT};
|
|
TradingView.Series.prototype._nextSymbolId=1;TradingView.Series.prototype._nextSeriesId=1;TradingView.Series.STYLE_BARS=0;TradingView.Series.STYLE_CANDLES=1;TradingView.Series.STYLE_LINE=2;TradingView.Series.STYLE_LINE_TYPE_MARKERS=0;TradingView.Series.STYLE_LINE_TYPE_STEP=1;TradingView.Series.STYLE_LINE_TYPE_SIMPLE=2;TradingView.Series.STYLE_AREA=3;TradingView.Series.STYLE_RENKO=4;TradingView.Series.STYLE_KAGI=5;TradingView.Series.STYLE_PNF=6;TradingView.Series.STYLE_PB=7;
|
|
TradingView.Series.STYLE_HEIKEN_ASHI=8;TradingView.Series.STYLE_HOLLOW_CANDLES=9;TradingView.Series.STATUS_OFFLINE=0;TradingView.Series.STATUS_RESOLVING=1;TradingView.Series.STATUS_LOADING=2;TradingView.Series.STATUS_READY=3;TradingView.Series.STATUS_INVALID_SYMBOL=4;TradingView.Series.STATUS_SNAPSHOT=5;TradingView.Series.STATUS_EOD=6;TradingView.Series.STATUS_PULSE=7;TradingView.Series.STATUS_DELAYED=8;TradingView.Series.STATUS_DELAYED_STREAMING=9;TradingView.Series.PERMISSION_DENIED="permission denied";
|
|
TradingView.Series.PD_REASON_SYMBOL="symbol";TradingView.Series.PD_REASON_EXTENDED_HOURS="extended_hours";TradingView.Series.STUDY_NOT_AUTH="study_not_auth";TradingView.Series.prototype.model=function(){return this.m_model};TradingView.Series.prototype.fixLastBar=function(a){this._futureBarsPaneView||(this._futureBarsPaneView=new TradingView.J79(this,this.data().bars().lastTimeIndex()+1,a))};TradingView.Series.prototype.clearData=function(){this.data().clear()};
|
|
TradingView.Series.prototype.data=function(){return this.m_data};TradingView.Series.prototype.symbolId=function(){return this._symbolId};TradingView.Series.prototype.isPulse=function(){return this._symbolInfo&&0<this._symbolInfo.resolutions.length};TradingView.Series.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.Series.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged};TradingView.Series.prototype.onSymbolResolved=function(){return this._symbolResolved};
|
|
TradingView.Series.prototype.onSymbolError=function(){return this._symbolError};TradingView.Series.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted};TradingView.Series.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted};TradingView.Series.prototype.onStartLoading=function(){return this._startLoading};TradingView.Series.prototype.onDataLoaded=function(){return this._dataLoaded};TradingView.Series.prototype.onStatusChanged=function(){return this._onStatusChanged};
|
|
TradingView.Series.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged};TradingView.Series.prototype.onBarReceived=function(){return this._barReceived};TradingView.Series.prototype.onChangedStyle=function(){return this._onChangedStyle};TradingView.Series.prototype.onCompleted=function(){return this._onCompleted};TradingView.Series.prototype.onRestarted=function(){return this._onRestarted};TradingView.Series.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged};
|
|
TradingView.Series.prototype.status=function(){return this._status};TradingView.Series.prototype.isDWM=function(){return!(3600>+this.D2.interval.value())};TradingView.Series.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate};
|
|
TradingView.Series.prototype.J63=function(){this._projectionBarsPaneView=this._paneView=null;this._symbolLabelView=new TradingView.R38(this.m_model,this,TradingView.CLOSE_PLOT,"firstShortName","showSymbolLabels");var a=this.D2.style.value();switch(a){case TradingView.Series.STYLE_BARS:this._paneView=new R15(this,this.m_model);break;case TradingView.Series.STYLE_CANDLES:this._paneView=new R16(this,this.m_model);
|
|
break;case TradingView.Series.STYLE_LINE:this._paneView=new R20(this,this.D2.lineStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_AREA:this._paneView=new R13(this,this.D2.areaStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_RENKO:this._paneView=new R28(this,this.m_model);this._projectionBarsPaneView=new R27(this,
|
|
this.m_model);break;case TradingView.Series.STYLE_PB:this._paneView=new R22(this,this.m_model);this._projectionBarsPaneView=new R26(this,this.m_model);break;case TradingView.Series.STYLE_KAGI:this._paneView=new R19(this,this.m_model);this._projectionBarsPaneView=new R24(this,this.m_model);break;case TradingView.Series.STYLE_PNF:this._paneView=new R21(this,
|
|
this.m_model);this._projectionBarsPaneView=new R25(this,this.m_model);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._paneView=new R17(this,this.m_model);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._paneView=new R18(this,this.m_model);break;default:throw"Unknown chart style assigned: "+a;}};
|
|
TradingView.Series.prototype._clearStylePlot=function(a,b){if(a.size()){var c=b||+a.first(),d=+a.last()+1;a.range(c,d).each(function(a,b){b[TradingView.STYLE_PLOT]=null})}};TradingView.Series.prototype.invalidateBarStylesCache=function(a){TradingView.logDebugChart("Invalidate style cache starting from "+a);this._clearStylePlot(this.m_data.m_bars,a);this._clearStylePlot(this.m_data.m_nsBars)};TradingView.Series.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache;this.invalidateBarStylesCache()};
|
|
TradingView.Series.prototype.barColorer=function(){if(this._barColorerCache)return this._barColorerCache;for(var a=null,b=this.m_model.D19().length-1;0<=b;b--){var c=this.m_model.D19()[b];c.metaInfo&&TradingView.isInherited(c.constructor,TradingView.Study)&&c.hasBarColorer()&&c.properties().visible.value()&&(c=c.barColorer(),null===a?a=c:a.pushBackBarColorer(c))}null===a?a=new TradingView.SeriesBarColorer(this):a.pushBackBarColorer(new TradingView.SeriesBarColorer(this));return this._barColorerCache=
|
|
a};TradingView.Series.prototype.properties=function(){return this.D2};TradingView.Series.prototype._barsState=function(a){a=a.state();a.columns=a.columns.filter(function(a){return"style"!==a});a.data.forEach(function(a){a.value.splice(7,1)});return a};
|
|
TradingView.Series.prototype.state=function(a){var b={type:this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};b.state.symbol=this._symbolInfo.ticker||b.state.symbol;a&&(b.bars=this._barsState(this.m_data.m_bars),b.nsBars=this._barsState(this.m_data.m_nsBars),b.symbolInfo=this._symbolInfo,b.rtPrice=this.data().lastProjectionPrice);b.boxSize=this.data().boxSize;return b};
|
|
TradingView.Series.prototype.uniqueId=function(){return this.actualSymbol()+"|"+this.interval()};TradingView.Series.prototype.stateForAlert=function(){var a=this.state();a.uniqueId=this.uniqueId();a.state.actualSymbol=this.actualSymbol();return a};
|
|
TradingView.Series.prototype.restoreData=function(a,b,c,d,e){this._status=TradingView.Series.STATUS_SNAPSHOT;this.m_data.m_bars.restoreState(a);this.m_data.m_nsBars.restoreState(b);this.updateSymbolInfo(c);this.m_data.lastProjectionPrice=d;this.m_data.boxSize=e;e||(this.properties().style.value()==TradingView.Series.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()==TradingView.Series.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value()))};
|
|
TradingView.Series.prototype.setProperties=function(a){a.timeframe||a.merge({timeframe:""});a.shortName||a.merge({shortName:""});this.D2=a;this.D2.symbol.listeners().subscribe(this,TradingView.Series.prototype.changeSymbol);this.D2.interval.listeners().subscribe(this,TradingView.Series.prototype.changeInterval);this.D2.timeframe.listeners().subscribe(this,TradingView.Series.prototype.changeTimeFrame);this.D2.listeners().subscribe(this,TradingView.Series.prototype.changeProperties)};
|
|
TradingView.Series.prototype.changeSymbol=function(){TradingView.trackEvent("GUI","Change symbol");this.setSymbolIntervalDelayed();this.m_model.checkLineToolSelection()};TradingView.Series.prototype.changeInterval=function(){TradingView.trackEvent("GUI","Change interval");this.setSymbolIntervalDelayed()};TradingView.Series.prototype.changeTimeFrame=function(){TradingView.trackEvent("GUI","Change timeframe")};
|
|
TradingView.Series.prototype.title=function(){return this.properties().symbol.value()+", "+TradingView.translatedIntervalString(this.properties().interval.value())};TradingView.Series.prototype.changeProperties=function(a){a!==this.D2.symbol&&a!==this.D2.interval&&a!==this.D2.timeframe&&(this._tagsChanged.fire(),this.J63(),this.updateAllViews(),this.m_model.updateSource(this))};TradingView.Series.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++};
|
|
TradingView.Series.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++};TradingView.Series.prototype._clearLoadingTimer=function(){this.loadingTimer&&(clearTimeout(this.loadingTimer),this.loadingTimer=null)};
|
|
TradingView.Series.prototype.onData=function(a){var b=this;switch(a.method){case "symbol_resolved":if(a.params[0]!==this._symbolId){TradingView.logNormalChart("command for old symbol. Expected:"+this._symbolId+", actual"+a.params[0]);break}this.updateSymbolInfo(a.params[1]);this.m_model.updateSource(this);this._symbolResolved.fire(this._symbolInfo);this.m_model.realignLineTools();var c=this.symbolInfo().minmov/this.symbolInfo().pricescale,d=this.properties();d.style.value()==TradingView.Series.STYLE_RENKO&&
|
|
d.renkoStyle.inputs.boxSize.value()<c?d.renkoStyle.inputs.merge({boxSize:c}):d.style.value()==TradingView.Series.STYLE_PNF&&d.pnfStyle.inputs.boxSize.value()<c?d.pnfStyle.inputs.merge({boxSize:c}):d.style.value()==TradingView.Series.STYLE_KAGI&&d.kagiStyle.inputs.reversalAmount.value()<c&&d.kagiStyle.inputs.merge({reversalAmount:c});break;case "symbol_error":if(a.params[0]!==this._symbolId){TradingView.logNormalChart("command for old symbol. Expected:"+this._symbolId+", actual"+a.params[0]);break}this._clearLoadingTimer();
|
|
this._setStatus(TradingView.Series.STATUS_INVALID_SYMBOL);this.D2.shortName.setValue(this.D2.symbol.value());this.m_model.clearAllStudies();this.updateAllViews();this.m_model.updateSource(this);if(a.params[1]==TradingView.Series.PERMISSION_DENIED)switch(a.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case TradingView.Series.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(a.params[3]);break;default:this._symbolNotPermitted.fire(a.params[2])}else this.m_model.resetTimeScale(),
|
|
this._symbolError.fire(),A72.sendReport("symbol_error",{chartSession:b._chartApi._sessionid,symbol:b.getSymbolString()});this.m_model.realignLineTools();break;case "series_timeframe":if(a.params[1]!==this._turnaround)break;c=a.params[3];d=a.params[4];this.m_model.setTimeViewport(a.params[2],"undefined"!==typeof d&&d?c:c+10);break;case "series_error":c=a.params[2];this._clearLoadingTimer();delete this._loadingStartTime;R77.enabled("charting_library_debug_mode")&&console.log("Error reason: "+
|
|
c);c&&c.startsWith("study_not_auth:")?(c=c.split(":",2)[1].split("@",2)[0],c in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(c):"BarSetSpread"===c&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"==c?this.intradayExchangeNotPermitted.fire():"custom_resolution"==c&&this.customIntervalNotPermitted.fire();this._setStatus(TradingView.Series.STATUS_INVALID_SYMBOL);break;case "series_loading":if(a.params[1]!==this._turnaround)break;if(a.params[0]!==
|
|
this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);break}this._setStatus(TradingView.Series.STATUS_LOADING);b._loadingStartTime=(new Date).getTime();b.loadingTimer=setTimeout(function(){var a={chartSession:b._chartApi._sessionid,symbol:b.getSymbolString(),interval:b.interval()};A72.sendReport("series_loading",a)},15E3);break;case "series_completed":if(a.params[2]!==this._turnaround)break;if(a.params[0]!==this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+
|
|
this._seriesId+", actual"+a.params.customId);break}TradingView.logDebugChart("chartSession:"+b._chartApi._sessionid+", Series loading took "+((new Date).getTime()-this._loadingStartTime)+" ms");delete this._loadingStartTime;c=a.params[1];"pulsed"==c&&(c="delayed");switch(c){case "streaming":this._setStatus(TradingView.Series.STATUS_READY);break;case "endofday":this._setStatus(TradingView.Series.STATUS_EOD);break;case "delayed":this._setStatus(TradingView.Series.STATUS_DELAYED);break;case "pulsed":this._setStatus(TradingView.Series.STATUS_PULSE)}c.match(/delayed_streaming/)&&
|
|
this._setStatus(TradingView.Series.STATUS_DELAYED_STREAMING);this.requestMoreData();c=this.m_model.paneForSource(this);c.recalculatePriceScale(this.priceScale());this.m_model.D20(new A22(A22.FULL_UPDATE));this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TradingView.TIME_PLOT],end:this.data().last().value[TradingView.TIME_PLOT]});this.model().recalcVisibleRangeStudy(this.model().D19(),!0);this.model().recalcStudyBasedLineTools();
|
|
!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),c=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(c.firstBar(),c.lastBar())));this._seriesLoaded=!0;this._onCompleted.fire();break;case "data_update":if(a.params.customId!==this._seriesId){TradingView.logNormalChart("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);
|
|
break}if(this.status()===TradingView.Series.STATUS_INVALID_SYMBOL)break;this._clearLoadingTimer();0<a.params.plots.length&&(this._endOfData=!1);a.params.plots.length?(c=this.m_data.m_bars.size(),d=this.m_data.m_bars.merge(a.params.plots),d="Merge bars. Changes:{length:"+d.length+", earliestRow:"+d.earliestRow.index+"} ",d+="bars state:{firstBar:"+this.m_data.m_bars.first()+",lastBar:"+this.m_data.m_bars.last()+",size:"+this.m_data.m_bars.size()+"}",TradingView.logDebugChart(d),c!=this.bars().size()&&
|
|
(this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().D19(),!0))):(this.m_data.clear(),this._startLoading.fire());c=this.properties().style.value();!a.params.nonseries||c!==TradingView.Series.STYLE_RENKO&&c!==TradingView.Series.STYLE_KAGI&&c!==TradingView.Series.STYLE_PNF&&c!==TradingView.Series.STYLE_PB?a.params.nonseries||(this.m_data.m_nsBars.clear(),this.m_data.lastProjectionPrice=void 0):(c=this.parseJapProjBars(a.params.nonseries),this.m_data.m_nsBars=
|
|
c.nsBars,this.m_data.lastProjectionPrice=c.lastPrice,d=this.m_data.boxSize!==c.boxSize,this.m_data.boxSize=c.boxSize,d&&this._boxSizeChanged.fire(this.m_data.boxSize));c=this.m_model.paneForSource(this);this.m_model.updateAllVolumeStudies();this.m_model.recalculatePane(c);this.m_model.updateSource(this);this.m_model.updateLineTools()}this._dataLoaded.fire(a)};
|
|
TradingView.Series.prototype.fixBoxSize=function(){var a=this.model().timeScale(),b=this.priceScale();b.isEmpty()||a.isEmpty()||(this.m_data.boxSize=Math.abs(b.coordinateToPrice(a.barSpacing())-b.coordinateToPrice(0)))};
|
|
TradingView.Series.prototype.parseJapProjBars=function(a){var b=new TradingView.PlotList("time open high low close adt style".split(" ")),c=this.model().timeScale(),d=this.properties().style.value(),e,f;if(a.d&&""!==a.d){var g=JSON.parse(a.d).data;e=g.price;f=g.boxSize;for(var g=g.bars,h=0;g&&h<g.length;h++){var k=[],l=a.indexes[g[h].time];k.push(c.points().valueAt(l));k.push(g[h].open);k.push(g[h].high);k.push(g[h].low);k.push(g[h].close);k.push(g[h].volume);d===TradingView.Series.STYLE_KAGI?k.push(g[h].additionalPrice):
|
|
d===TradingView.Series.STYLE_PNF&&k.push(g[h].factor);b.add(l,k)}}return{nsBars:b,lastPrice:e,boxSize:f}};TradingView.Series.prototype.disconnect=function(){this._seriesId=this._symbolId=null;this._status=TradingView.Series.STATUS_OFFLINE};TradingView.Series.prototype.isStarted=function(){return!!this._symbolId};
|
|
TradingView.Series.prototype.restart=function(){this._onRestarted.fire();this._setStatus(TradingView.Series.STATUS_RESOLVING);this.m_data=new A58(this,this.model());this._prevSymbolId=this._symbolId;this._symbolId=this._makeNextSymbolId();this._chartApi.resolveSymbol(this._symbolId,this.getSymbolString(),this._handler);this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,this.D2.interval.value(),
|
|
this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,this.D2.interval.value(),this._prepareChartApiParams(),this._handler));this.D2.showInDataWindow.listeners().subscribe(this.m_model,TradingView.ChartModel.prototype.fullUpdate);this.m_symbol=this.D2.symbol.value();this.m_interval=this.D2.interval.value();this._seriesLoaded=!1};
|
|
TradingView.Series.prototype._generateTimeframe=function(a,b){var c=b.right(1),d=a;"ytd"===b?d+=",YTD":"d"===c?(c=b.left(b.length-1),d+=","+c,R77.enabled("daily_timeframe_suffix")&&(d+="D")):"m"===c?(c=b.left(b.length-1),d+=","+c+"M"):"all"===b&&(d+=",ALL");return d};TradingView.Series.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay};
|
|
TradingView.Series.prototype.setSymbolIntervalDelayed=function(){this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay);this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay;this.setSymbolInterval(this.D2.symbol.value(),this.D2.interval.value())}.bind(this),10)};
|
|
TradingView.Series.prototype.setSymbolInterval=function(a,b){var c=(b+"").split(","),d=0,e=b;2==c.length&&(e=c[0],d=c[1]);var c=!this.symbolSameAsCurrent(a)||R77.enabled("same_data_requery"),f=this.m_interval!==e||R77.enabled("same_data_requery");if(c||f)if(this.m_model.realignLineTools(),this.m_symbol=a,this.m_interval=e,this.m_timeframe=d,this._status!==TradingView.Series.STATUS_SNAPSHOT){this._setStatus(TradingView.Series.STATUS_RESOLVING);this._symbolId&&!c||this.updateSymbolInfo(null);
|
|
this._symbolIntervalChanged.fire();this._onRestarted.fire();if(this._chartApi&&this._chartApi.connected()){if(!this._symbolId||c)this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),d=this.getSymbolString(),this._chartApi.resolveSymbol(this._symbolId,d,this._handler);if(this._seriesId){this._modifyTimer&&clearTimeout(this._modifyTimer);var g=this;g._turnaround="s"+ ++g._turnaroundCounter;this._pendingInterval&&(b=this._generateTimeframe(b,this._pendingInterval),delete this._pendingInterval);
|
|
this._modifyTimer=setTimeout(function(){g._predictBars=0;g._chartApi.modifySeries(g._seriesId,g._turnaround,g._symbolId,b,g._handler,this._prevSymbolId);g._modifyTimer=null},30)}else this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,b,this._prepareChartApiParams(),this._handler)}this._seriesLoaded=!1;this._haveToScroll=!0}};
|
|
TradingView.Series.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().ticker||this.symbolInfo().full_name:this.symbol()};TradingView.Series.prototype.symbol=function(){return this.properties().symbol.value()};TradingView.Series.prototype.interval=function(){return this.properties().interval.value()};TradingView.Series.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&1440>=this.interval()};TradingView.Series.prototype.bars=function(){return this.m_data.m_bars};
|
|
TradingView.Series.prototype.nsBars=function(){return this.m_data.m_nsBars};TradingView.Series.prototype.open=function(a){return this.m_data.valueAt(a)[TradingView.OPEN_PLOT]};TradingView.Series.prototype.high=function(a){return this.m_data.valueAt(a)[TradingView.HIGH_PLOT]};TradingView.Series.prototype.low=function(a){return this.m_data.valueAt(a)[TradingView.LOW_PLOT]};TradingView.Series.prototype.close=function(a){return this.m_data.valueAt(a)[TradingView.CLOSE_PLOT]};
|
|
TradingView.Series.prototype.hl2=function(a){return(this.high(a)+this.low(a))/2};TradingView.Series.prototype.hlc3=function(a){return(this.high(a)+this.low(a)+this.close(a))/3};TradingView.Series.prototype.ohlc4=function(a){return(this.open(a)+this.high(a)+this.low(a)+this.close(a))/4};
|
|
TradingView.Series.prototype.priceRange=function(a,b){if(!TradingView.isInteger(a))return TradingView.logDebugChart("Series.priceRange: incorrect startBar"),null;if(!TradingView.isInteger(b))return TradingView.logDebugChart("Series.priceRange: incorrect endBar"),null;if(this.data().isEmpty())return null;if(this.isLockScale()){void 0===this.data().boxSize&&this.fixBoxSize();var c=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),d=this.data().search(b,TradingView.SEARCH_NEAREST_LEFT),
|
|
d=(d.value[TradingView.HIGH_PLOT]+d.value[TradingView.LOW_PLOT])/2,c=new PriceRange(d-.5*c,d+.5*c),d=this.data().search(a,TradingView.SEARCH_NEAREST_RIGHT);return this.priceScale().properties().percentage.value()&&c?c.convertToPercents(d.value[TradingView.CLOSE_PLOT]):c}c=this.data().bars().minMaxOnRange2(a,b,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]);d=this.data().nsBars().minMaxOnRange(a,b,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]);
|
|
null!=d.min&&(c.min=Math.min(c.min,d.min));null!=d.max&&(c.max=Math.max(c.max,d.max));(c=new PriceRange(c.min,c.max))&&c.minValue()===c.maxValue()&&(c=new PriceRange(c.minValue()-.5,c.maxValue()+.5));return this.priceScale().properties().percentage.value()&&c?(d=this.data().search(a,TradingView.SEARCH_NEAREST_RIGHT),c.convertToPercents(d.value[TradingView.CLOSE_PLOT])):this.priceScale().isLog()&&c?new PriceRange(this.priceScale().priceToLogical(c.minValue()),this.priceScale().priceToLogical(c.maxValue())):
|
|
c};TradingView.Series.prototype.nearestData=function(a,b){if(TradingView.isInteger(a)){var c=this.data().search(a,b);return c?c:void 0}TradingView.logDebugChart("Series.nearestData: incorrect logicalPoint")};TradingView.Series.prototype.nearestIndex=function(a,b){var c=this.nearestData(a,b);return c?c.index:void 0};
|
|
TradingView.Series.prototype.paneViews=function(a){if(!this.properties().visible.value())return null;a=[this._paneView];this._futureBarsPaneView&&a.push(this._futureBarsPaneView);this._projectionBarsPaneView&&a.push(this._projectionBarsPaneView);a.push(this._priceLineView);a.push(this._symbolLabelView);return a};TradingView.Series.prototype.dataWindowView=function(){return this._dataWindowView};TradingView.Series.prototype.statusView=function(){return this._statusView};
|
|
TradingView.Series.prototype.priceAxisViews=function(a,b){return this.m_model.paneForSource(this)===a&&b===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null};TradingView.Series.prototype.base=function(){return this._base};TradingView.Series.prototype.formatter=function(){return this._formatter};TradingView.Series.prototype.purgeSymbolInfo=function(){this._symbolInfo=null};
|
|
TradingView.Series.prototype.symbolInfo=function(){return this._symbolInfo};
|
|
TradingView.Series.prototype._recreateFormatter=function(){if("default"==this.properties().minTick.value())this._formatter=new TradingView.PriceFormatter(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,this._symbolInfo?this._symbolInfo.fractional:!1,this._symbolInfo?this._symbolInfo.minmove2:void 0);else{var a=this.properties().minTick.value().split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new TradingView.PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&
|
|
this.priceScale().updateFormatter()};
|
|
TradingView.Series.prototype.updateSymbolInfo=function(a){var b=this,c=a&&(a.ticker||a.pro_name||a.full_name);if(this._symbolInfo=a)this.D2.shortName.setValue(a.name),c&&this.D2.symbol.value().toUpperCase()!==c.toUpperCase()&&this.D2.symbol.setValue(c);this._base=a?a.pricescale/a.minmov:100;this._recreateFormatter();this._statusView.update();this.priceScale().updateFormatter();"undefined"!==typeof quoteSessionMultiplexerInstance&&(this._quoteSessionClientId||(this._quoteSessionClientId=
|
|
"series-"+TradingView.guid()),this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.simple.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0),c&&(this._quoteSessionSymbol=c,quoteSessionMultiplexerInstance.simple.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(a,c){b.quoteData=a&&a.values||null;c&&c.values&&c.values.current_session&&b.marketStatus.setValue(c.values.current_session)})));this.checkInterval();this.dataPoweredBy=
|
|
TradingView.getDataVendorString(a)};TradingView.Series.prototype.symbolSameAsCurrent=function(a){if(this.m_symbol===a)return!0;var b=this._symbolInfo;return!b||b.full_name!==a&&b.pro_name!==a?!1:!0};
|
|
TradingView.Series.prototype.updateAllViews=function(){this._paneView.update();this._dataWindowView.update();this._statusView.update();this._priceAxisViews[0].update();this._priceAxisViews[1].update();this._futureBarsPaneView&&this._futureBarsPaneView.update();this._projectionBarsPaneView&&this._projectionBarsPaneView.update();this._priceLineView.update();this._symbolInfo&&this._symbolLabelView.update()};
|
|
TradingView.Series.prototype.tags=function(){var a=[this.D2.symbol.value(),this.D2.interval.value()+"minutes"];if(this._symbolInfo&&this._symbolInfo.description){var b=this._symbolInfo.description.replace(",","").split(" ");a.push(b)}return a};TradingView.Series.prototype._setStatus=function(a){this._status=a;this._statusView.update();this.m_model.updateSource(this);this._onStatusChanged.fire()};
|
|
TradingView.Series.prototype.requestMoreData=function(){if((this._status===TradingView.Series.STATUS_READY||this._status===TradingView.Series.STATUS_PULSE||this._status===TradingView.Series.STATUS_DELAYED||this._status===TradingView.Series.STATUS_DELAYED_STREAMING||this._status===TradingView.Series.STATUS_EOD)&&!this.m_model.timeScale().isEmpty()){var a=this.m_model.timeScale().visibleBars();if(!a.isEmpty()&&0!==this.bars().size()){var b=a.lastBar()-this.data().last();this._predictBars<b&&(this._predictBars=
|
|
b,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,b,this._handler));this._endOfData||(a=this.bars()._indexAt(0)-a.firstBar(),0>=a||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,a,this._handler),R77.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(TradingView.Series.STATUS_LOADING)))}}};
|
|
TradingView.Series.prototype.bindStyleChange=function(){var a=this;"candleStyle hollowCandleStyle haStyle barStyle lineStyle areaStyle renkoStyle pbStyle kagiStyle pnfStyle".split(" ").forEach(function(b){a.D2[b].listeners().subscribe(a,TradingView.Series.prototype.invalidateBarStylesCache)})};
|
|
TradingView.Series.prototype.bindJapChartsInputs=function(){this.D2.style.listeners().subscribe(this,this.onChartStyleChanged);this.D2.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.D2.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);this.D2.pbStyle.inputs.lb.listeners().subscribe(this,
|
|
this.onInputChanged);this.D2.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.D2.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.sources.listeners().subscribe(this,
|
|
this.onInputChanged);this.D2.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.D2.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var a=this;this.D2.lockScale.listeners().subscribe(this,function(b){b.value()&&a.model().timeScale().recalcLockedScale()})};
|
|
TradingView.Series.prototype.createExtendedHoursProperty=function(){function a(){var a=window.user?!!user.extended_session:!1,d=b.model().readOnly(),e=b.D2.extendedHours.value(),f=R77.enabled("widget");!e||f||d||a||(b._extendedHoursNotPermitted.fire(),e=!1);e&&!b.isIntradayInterval()&&(e=!1);b.extendedHours.setValue(e)}var b=this;b.extendedHours=new Property;b.D2.extendedHours.listeners().subscribe(null,a);b.D2.interval.listeners().subscribe(null,a);b.chartWidgetInitialized.subscribe(null,
|
|
a);a()};TradingView.Series.prototype.isNeedRestart=function(a){void 0===a&&(a=this.properties().style.value());if(this._prevChartStyle!=a){var b=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA];if(!(-1<b.indexOf(this._prevChartStyle)&&-1<b.indexOf(a)))return!0}return!1};
|
|
TradingView.Series.prototype.onChartStyleChanged=function(){this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart());this._prevChartStyle=this.properties().style.value();this._onChangedStyle.fire(this.properties().style.value());this.invalidateBarStylesCache()};TradingView.Series.prototype.onInputChanged=function(){this.restart()};TradingView.Series.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged};
|
|
TradingView.Series.prototype.getSymbolString=function(){var a;a=R77.enabled("pay_attention_to_ticker_not_symbol")?this._symbolInfo?this._symbolInfo.ticker:this.D2.symbol.value():this.D2.symbol.value();this.extendedHours.value()&&(a={symbol:a,session:"extended"});switch(this.D2.style.value()){case TradingView.Series.STYLE_RENKO:var b=this.D2.renkoStyle.inputs;a={symbol:a,type:"BarSetRenko@tv-prostudies-1!",inputs:[b.source.value(),b.style.value(),b.boxSize.value(),
|
|
b.atrLength.value()]};break;case TradingView.Series.STYLE_PB:b=this.D2.pbStyle.inputs;a={symbol:a,type:"BarSetPriceBreak@tv-prostudies-1!",inputs:[b.source.value(),b.lb.value()]};break;case TradingView.Series.STYLE_KAGI:b=this.D2.kagiStyle.inputs;a={symbol:a,type:"BarSetKagi@tv-prostudies-1!",inputs:[b.source.value(),b.reversalAmount.value()]};break;case TradingView.Series.STYLE_PNF:b=this.D2.pnfStyle.inputs;a={symbol:a,type:"BarSetPnF@tv-prostudies-1!",inputs:[b.sources.value(),
|
|
b.style.value(),b.boxSize.value(),b.atrLength.value(),b.reversalAmount.value()]};break;case TradingView.Series.STYLE_HEIKEN_ASHI:a={symbol:a,type:"BarSetHeikenAshi@tv-basicstudies-1!",inputs:[]}}"string"!==typeof a&&(a="="+JSON.stringify(a));return a};
|
|
TradingView.Series.prototype.getStyleShortName=function(){switch(this.D2.style.value()){case TradingView.Series.STYLE_BARS:return"bar";case TradingView.Series.STYLE_CANDLES:return"candle";case TradingView.Series.STYLE_HOLLOW_CANDLES:return"hollowCandle";case TradingView.Series.STYLE_LINE:return"line";case TradingView.Series.STYLE_AREA:return"area";case TradingView.Series.STYLE_RENKO:return"renko";case TradingView.Series.STYLE_PB:return"pb";case TradingView.Series.STYLE_KAGI:return"kagi";
|
|
case TradingView.Series.STYLE_PNF:return"pnf";case TradingView.Series.STYLE_HEIKEN_ASHI:return"ha";default:throw Error("Missed short name for style "+this.D2.style.value());}};TradingView.Series.prototype.getInputsProperties=function(){var a=this.D2[this.getStyleShortName()+"Style"];a.inputs||a.addProperty("inputs");return a.inputs};
|
|
TradingView.Series.prototype.getRealVisibleRange=function(){var a=this.model().timeScale().visibleBars(),b;b=this.data().search(a.m_firstBar,TradingView.SEARCH_NEAREST_RIGHT);a=this.data().search(a.m_lastBar,TradingView.SEARCH_NEAREST_LEFT);return void 0===b||void 0===a?null:new BarsRange(b.index,a.index)};TradingView.Series.prototype.isLockScale=function(){return this.properties().lockScale.value()};TradingView.Series.prototype.firstValue=function(){return this.data().firstValue()};
|
|
TradingView.Series.prototype.firstBar=function(){return this.data().firstBar()};TradingView.Series.prototype.sessionsStudy=function(){if(this._sessionsStudy)return this._sessionsStudy;for(var a=this.model().paneForSource(this).D19(),b=0;b<a.length;b++){var c=a[b];if(c instanceof TradingView.Study&&"Sessions"==c.metaInfo().shortId)return this._sessionsStudy=c}return!1};
|
|
TradingView.Series.prototype.createSessStudy=function(){if(!R77.enabled("charting_library_base")&&!this.sessionsStudy()){var a=TradingView.StudyMetaInfo.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(a,!1,!0);this._onSessionsStudyCreated.fire()}};TradingView.Series.prototype.checkSessStudy=function(){R77.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())};
|
|
TradingView.Series.prototype.isSpread=function(){return 1<this._symbolInfo.legs.length};TradingView.Series.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""};TradingView.Series.prototype.firstShortName=function(){return A68.ticker(this.firstSymbol())};TradingView.Series.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated};
|
|
TradingView.Series.prototype.loadDataTo=function(a){a.right(1);this._turnaround="s"+ ++this._turnaroundCounter;var b=this.D2.interval.value(),b=this._generateTimeframe(b,a);this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,b,this._handler)};
|
|
TradingView.Series.prototype.checkInterval=function(){if(this._symbolInfo&&(this.isDWM()||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var a=this.D2.interval.value();-1==this._symbolInfo.supported_resolutions.indexOf(a)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}};
|
|
TradingView.Series.prototype.setPriceScale=function(a){this.m_priceScale!=a&&(this.m_priceScale=a,this.priceScaleChanged.fire(a))};TradingView.SeriesDataWindowView=function(a,b){TradingView.DataWindowView.call(this);this._series=a;this.D0=b;this._items.append(new TradingView.DataWindowItem($.t("Open",{context:"in_legend"}),""));this._items.append(new TradingView.DataWindowItem($.t("High",{context:"in_legend"}),""));this._items.append(new TradingView.DataWindowItem($.t("Low",{context:"in_legend"}),""));this._items.append(new TradingView.DataWindowItem($.t("Close",{context:"in_legend"}),""));this._invalidated=!0;this.update()};
|
|
inherit(TradingView.SeriesDataWindowView,TradingView.DataWindowView);TradingView.SeriesDataWindowView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.SeriesDataWindowView.prototype._updateImpl=function(){this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,TradingView.translatedIntervalString(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol();this._items.item(0).setValue($.t("n/a"));this._items.item(1).setValue($.t("n/a"));this._items.item(2).setValue($.t("n/a"));this._items.item(3).setValue($.t("n/a"));if(!this.D0.timeScale().isEmpty()&&
|
|
0!==this._series.bars().size()){var a=this._series.barColorer(),b=this.D0.crossHairSource().appliedIndex(),b=this._series.nearestIndex(b,TradingView.SEARCH_NEAREST_LEFT);if(void 0!==b){var c=this._series.data().valueAt(b),d=this._series.formatter();this._items.item(0).setValue(d.format(c[TradingView.OPEN_PLOT]));this._items.item(1).setValue(d.format(c[TradingView.HIGH_PLOT]));this._items.item(2).setValue(d.format(c[TradingView.LOW_PLOT]));this._items.item(3).setValue(d.format(c[TradingView.CLOSE_PLOT]));
|
|
a=a.barStyle(b,!1).barColor;b=this._series.model().paneForSource(this._series).D2.background.value();TradingView.colorsAreSimilar(a,b)&&(a=TradingView.invertColor(a));for(b=0;4>b;b++)this._items.item(b).setColor(a)}}};TradingView.SeriesDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};TradingView.SeriesDataWindowView.prototype.dump=function(){return{header:this._header,items:this._items}};
|
|
TradingView.SeriesDataWindowView.prototype.additional=function(){if(this._series.dataPoweredBy)return"(Data Provided by "+this._series.dataPoweredBy+")"};R14=function(a,b){this.m_series=a;this.m_model=b;this.m_bars=new List;this._invalidated=!0};R14.prototype.update=function(){this._invalidated=!0};
|
|
R14.prototype._updateImpl=function(){var a=this;this.m_bars.clear();if(!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()){var b=this.m_model.timeScale().visibleBars();if(!b.isEmpty()&&0!==this.m_series.bars().size()){for(var c=this.m_series.nearestIndex(b.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(b.lastBar(),TradingView.SEARCH_NEAREST_LEFT);c<=d&&void 0===this.m_series.bars().valueAt(c);c++);if(!(c>d)){var b=
|
|
this.m_series.bars().range(c,d),e;this.m_series.bars().first();var f=this.m_series.priceScale(),g=f.properties().percentage.value(),h=this.m_series.barColorer(),k={};b.each(function(b,c){if(void 0!==c[TradingView.OPEN_PLOT]&&void 0!==c[TradingView.HIGH_PLOT]&&void 0!==c[TradingView.LOW_PLOT]&&void 0!==c[TradingView.CLOSE_PLOT]){void 0===e&&(e=c[TradingView.CLOSE_PLOT]);var d={};d.time=Math.round(b);g?(d.open=100*(c[TradingView.OPEN_PLOT]-e)/e,d.high=100*(c[TradingView.HIGH_PLOT]-e)/e,d.low=100*(c[TradingView.LOW_PLOT]-
|
|
e)/e,d.close=100*(c[TradingView.CLOSE_PLOT]-e)/e):(d.open=c[TradingView.OPEN_PLOT],d.high=c[TradingView.HIGH_PLOT],d.low=c[TradingView.LOW_PLOT],d.close=c[TradingView.CLOSE_PLOT]);k.value=c;var f=c[TradingView.STYLE_PLOT]||h.barStyle(b,!1,k);c[TradingView.STYLE_PLOT]=f;k.previousValue=c;d.color=f.barColor;d.borderColor=f.barBorderColor;d.wickColor=f.barWickColor;d.hollow=f.isBarHollow;a.m_bars.append(d)}},this);f.barPricesToCoordinates(this.m_bars);this.m_model.timeScale().barIndexesToCoordinates(this.m_bars);
|
|
if(this.m_series===this.m_model.selectedSource())for(b=TradingView.selectionIndexes(c,d),this._selectionData={points:[]},this._selectionData.hittestResult=TradingView.HitTestResult.REGULAR,c=0;c<b.length;c++){var d=b[c],l=this.m_series.bars().valueAt(d);l&&(l=.5*(l[TradingView.OPEN_PLOT]+l[TradingView.CLOSE_PLOT]),f.properties().percentage.value()&&(l=100*(l-e)/e),d=this.m_model.timeScale().indexToCoordinate(d),l=this.m_series.priceScale().priceToCoordinate(l),this._selectionData.points.push(new MathEx.Point(d,
|
|
l)))}}}}};R14.prototype.items=function(){return this.m_bars};R14.prototype.dump=function(){var a={};a.bars=this.m_bars;return a};R15=function(a,b){R14.call(this,a,b)};inherit(R15,R14);
|
|
R15.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value();var b=new TradingView.CompositeRenderer;b.append(new R56(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));return b};
|
|
R16=function(a,b){R14.call(this,a,b)};inherit(R16,R14);
|
|
R16.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().candleStyle.drawWick.value();a.drawBorder=this.m_series.properties().candleStyle.drawBorder.value();a.borderColor=this.m_series.properties().candleStyle.borderColor.value();a.wickColor=this.m_series.properties().candleStyle.wickColor.value();var b=new TradingView.CompositeRenderer;
|
|
b.append(new R57(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));return b};R17=function(a,b){R14.call(this,a,b)};inherit(R17,R14);
|
|
R17.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().haStyle.drawWick.value();a.drawBorder=this.m_series.properties().haStyle.drawBorder.value();a.borderColor=this.m_series.properties().haStyle.borderColor.value();a.wickColor=this.m_series.properties().haStyle.wickColor.value();var b=new TradingView.CompositeRenderer;
|
|
b.append(new R57(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));return b};R18=function(a,b){R14.call(this,a,b)};inherit(R18,R14);
|
|
R18.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value();a.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value();a.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value();a.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value();
|
|
var b=new TradingView.CompositeRenderer;b.append(new R57(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));return b};
|
|
R29=function(a,b,c){this.m_series=a;this.m_priceSource=b;this.m_model=c;this.m_items=new List;this._barGetter={open:function(a){return a[TradingView.OPEN_PLOT]},high:function(a){return a[TradingView.HIGH_PLOT]},low:function(a){return a[TradingView.LOW_PLOT]},close:function(a){return a[TradingView.CLOSE_PLOT]},hl2:function(a){return(a[TradingView.HIGH_PLOT]+a[TradingView.LOW_PLOT])/2},hlc3:function(a){return(a[TradingView.HIGH_PLOT]+a[TradingView.LOW_PLOT]+a[TradingView.CLOSE_PLOT])/
|
|
3},ohlc4:function(a){return(a[TradingView.OPEN_PLOT]+a[TradingView.HIGH_PLOT]+a[TradingView.LOW_PLOT]+a[TradingView.CLOSE_PLOT])/4}}[this.m_priceSource]};
|
|
R29.prototype.update=function(){this.m_items.clear();if(!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()){var a=this.m_model.timeScale().visibleBars();if(!a.isEmpty()&&0!==this.m_series.bars().size()){var b=this.m_series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT),a=this.m_series.bars().range(b,c);this.m_series.bars();var d,
|
|
e=this.m_series.priceScale();this.m_series.barColorer();for(var f={color:this.m_series.properties().lineStyle.color.value()},g=e.properties().percentage.value(),h=a._start;h<a._end;++h){var k=a._indexAt(h),l=a._valueAt(h),l=this._barGetter(l);void 0!==l&&null!==l&&(void 0===d&&(d=l),g&&(l=100*(l-d)/d),k=new MathEx.Point(k,l),k.style=f,this.m_items.append(k))}e.pointsArrayToCoordinates(this.m_items.toArray());this.m_model.timeScale().indexesToCoordinates(this.m_items);if(this.m_series===this.m_model.selectedSource())for(a=
|
|
TradingView.selectionIndexes(b,c),this._selectionData={points:[]},this._selectionData.hittestResult=TradingView.HitTestResult.REGULAR,h=0;h<a.length;h++)k=a[h],b=this.m_series.data().valueAt(k),l=this._barGetter(b),e.properties().percentage.value()&&(l=100*(l-d)/d),k=this.m_model.timeScale().indexToCoordinate(k),b=this.m_series.priceScale().priceToCoordinate(l),this._selectionData.points.push(new MathEx.Point(k,b))}}};
|
|
R20=function(a,b,c){R29.call(this,a,b,c);this._invaidated=!0};inherit(R20,R29);R20.prototype.update=function(){this._invalidated=!0};
|
|
R20.prototype.renderer=function(){this._invalidated&&(R29.prototype.update.call(this),this._invalidated=!1);var a=this.m_series.properties().lineStyle,a={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:a.color.value(),lineStyle:a.linestyle.value(),withMarkers:a.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:a.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:a.linewidth.value(),
|
|
simpleMode:!0},a=new R68(a),b;this.m_series===this.m_model.selectedSource()?(b=new TradingView.CompositeRenderer,b.append(a),b.append(new TradingView.SelectionRenderer(this._selectionData))):b=a;return b};R13=function(a,b,c){R29.call(this,a,b,c);this._invaidated=!0};inherit(R13,R29);
|
|
R13.prototype.update=function(){this._invalidated=!0};
|
|
R13.prototype.renderer=function(){this._invalidated&&(R29.prototype.update.call(this),this._invalidated=!1);var a={simpleMode:!1};a.barSpacing=this.m_model.timeScale().barSpacing();a.items=this.m_items;a.lineColor=this.m_series.properties().areaStyle.linecolor.value();a.lineStyle=this.m_series.properties().areaStyle.linestyle.value();a.lineWidth=this.m_series.properties().areaStyle.linewidth.value();var b=this.m_series.properties().areaStyle.transparency.value();
|
|
a.color1=TradingView.generateColor(this.m_series.properties().areaStyle.color1.value(),b);a.color2=TradingView.generateColor(this.m_series.properties().areaStyle.color2.value(),b);a.bottom=this.m_series.priceScale().height();b=new TradingView.CompositeRenderer;b.append(new R53(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));return b};TradingView.SeriesStatusView=function(a,b){TradingView.StatusView.call(this,b);this._series=a;this._series.onRestarted().subscribe(this,TradingView.SeriesStatusView.prototype.D20);this._series.onSymbolResolved().subscribe(this,TradingView.SeriesStatusView.prototype.D20);this._series.onBoxSizeChanged().subscribe(this,TradingView.SeriesStatusView.prototype.D20)};inherit(TradingView.SeriesStatusView,TradingView.StatusView);
|
|
TradingView.SeriesStatusView.prototype.D20=function(){delete this._text;this.update()};TradingView.SeriesStatusView.prototype.round=function(a,b){var c=Math.round(a*Math.pow(10,b))/Math.pow(10,b);return c?c:""};
|
|
TradingView.SeriesStatusView.prototype.update=function(){if(!("_text"in this)){this._series.symbolInfo()?this._text=this._series.symbolInfo().description:this._text=this._series.symbol();this._text+=", "+TradingView.translatedIntervalString(this._series.interval());if(this._series.symbolInfo()&&this._series.symbolInfo().exchange){var a=this._series.symbolInfo().exchange;this._text+=", "+a}a=this._series.D2;switch(a.style.value()){case TradingView.Series.STYLE_RENKO:var b=a.renkoStyle.inputs.style.value()+
|
|
("ATR"===a.renkoStyle.inputs.style.value()?"("+a.renkoStyle.inputs.atrLength.value()+")":"");this._text+=", Renko ["+a.renkoStyle.inputs.source.value()+", "+b+", "+this.round(this._series.data().boxSize,4)+"]";break;case TradingView.Series.STYLE_PB:this._text+=", Line Break ["+a.pbStyle.inputs.source.value()+", "+a.pbStyle.inputs.lb.value()+"]";break;case TradingView.Series.STYLE_KAGI:this._text+=", Kagi ["+a.kagiStyle.inputs.source.value()+", "+a.kagiStyle.inputs.reversalAmount.value()+"]";break;
|
|
case TradingView.Series.STYLE_PNF:b=a.pnfStyle.inputs.style.value()+("ATR"===a.pnfStyle.inputs.style.value()?"("+a.pnfStyle.inputs.atrLength.value()+")":"");this._text+=", PnF ["+a.pnfStyle.inputs.sources.value()+", "+b+", "+this.round(this._series.data().boxSize,4)+", "+a.pnfStyle.inputs.reversalAmount.value()+"]";break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._text+=", "+$.t("Heiken Ashi")}this._bold=!1;this._size="17px"}};TradingView.SeriesPriceAxisView=function(a,b){this._series=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invalidated=!0};inherit(TradingView.SeriesPriceAxisView,PriceAxisView);TradingView.SeriesPriceAxisView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.SeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(a=this._series.lastValueData())if(this._visible=!0,this._text=this.D0.properties().scalesProperties.showSeriesLastValue.value()?a.text:"",a.color!=this._background&&(this._background=a.color,this._color=this.color()),this._coordinate=a.coordinate,this._floatCoordinate=a.floatCoordinate,this._textHeight=this._series.priceScale().m_markBuilder.fontHeight(),this._countdown=null,R77.enabled("countdown")&&
|
|
this._series.properties().showCountdown.value()&&(a=[TradingView.Series.STYLE_BARS,TradingView.Series.STYLE_CANDLES,TradingView.Series.STYLE_LINE,TradingView.Series.STYLE_AREA,TradingView.Series.STYLE_HOLLOW_CANDLES,TradingView.Series.STYLE_HEIKEN_ASHI],!this._series.isDWM()&&-1!=a.indexOf(this._series.properties().style.value()))){var b=1E3*this._series.data().bars().last().value[0];(new Date).getTimezoneOffset();var c=1E3*this._series.serverTimeOffset();a=this._series.interval();b=Math.round((b.valueOf()+
|
|
6E4*a-((new Date).valueOf()+c))/1E3);0<b&&(b=Math.min(b,60*a),a="",3600<=b&&(a=""+Math.floor(b/3600)+":"),b%=3600,c=("0"+Math.floor(b/60)).right(2),b=("0"+Math.floor(b%60)).right(2),this._countdown=a+c+":"+b)}};TradingView.SeriesPriceAxisView.prototype.font=function(){return"11px Arial"};TradingView.SeriesPriceAxisView.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
|
|
TradingView.SeriesPriceAxisView.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);this._cacheFont!=this.font()&&(this._cacheFont=this.font(),this._cache=new TradingView.TextWidthCache);var a={text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible,font:this.font(),secondLine:this._countdown};return new TradingView.PriceAxisViewRenderer(a,this._cache)};
|
|
TradingView.SeriesPriceAxisView.prototype.dump=function(){return{text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible}};TradingView.SeriesPriceAxisView.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};TradingView.ProjectionSeriesPriceAxisView=function(a,b){TradingView.SeriesPriceAxisView.call(this,a,b)};inherit(TradingView.ProjectionSeriesPriceAxisView,TradingView.SeriesPriceAxisView);TradingView.ProjectionSeriesPriceAxisView.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice};
|
|
TradingView.ProjectionSeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(!this.D0.timeScale().isEmpty()&&!this._series.priceScale().isEmpty()&&this.lastPrice()&&(a=this.D0.timeScale().visibleBars(),!a.isEmpty())){var b=this._series.data().search(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT);if(void 0!==b){a=this._series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT);a=this._series.data().valueAt(a)[TradingView.CLOSE_PLOT];this._visible=!0;this._series.data().last();
|
|
var c=this.lastPrice();this._series.priceScale().properties().percentage.value()&&(c=100*(c-a)/a);this._text=this._series.priceScale().formatter().format(c);this._background=this._series.barColorer().barStyle(b.index,!0).barColor;this._coordinate=this._series.priceScale().priceToCoordinate(c);this._textHeight=this._series.priceScale().m_markBuilder.fontHeight()}}};TradingView.StudyConsts={PLOT_TYPE_LINE:"line",PLOT_TYPE_COLORER:"colorer",PLOT_TYPE_BAR_COLORER:"bar_colorer",PLOT_TYPE_BG_COLORER:"bg_colorer",PLOT_TYPE_TEXT_COLORER:"text_colorer",PLOT_TYPE_OHLC_COLORER:"ohlc_colorer",PLOT_TYPE_SHAPES:"shapes",PLOT_TYPE_CHARS:"chars",PLOT_TYPE_ARROWS:"arrows",PLOT_TYPE_DATAOFFSET:"dataoffset",PLOT_TYPE_OHLC_OPEN:"ohlc_open",PLOT_TYPE_OHLC_HIGH:"ohlc_high",PLOT_TYPE_OHLC_LOW:"ohlc_low",PLOT_TYPE_OHLC_CLOSE:"ohlc_close",OHLC_TYPE_BARS:"ohlc_bars",OHLC_TYPE_CANDLES:"ohlc_candles",
|
|
PLOT_LINE:0,PLOT_HISTOGRAM:1,PLOT_CROSS:3,PLOT_AREA:4,PLOT_COLUMNS:5,PLOT_CIRCLES:6,PLOT_LINE_WITH_BREAKS:7,PLOT_AREA_WITH_BREAKS:8,SCALE_RIGHT:0,SCALE_LEFT:1,SCALE_NONE:2};TradingView.StudyPlotShapes={};TradingView.StudyPlotShapes.Data={};TradingView.StudyPlotShapes.registerPlotShape=function(a,b,c,d){if(a in TradingView.StudyPlotShapes.Data)throw Error("Plot shape "+a+" already registered!");TradingView.StudyPlotShapes.Data[a]={id:a,pineName:b,guiName:c,paneRendererClass:d}};
|
|
TradingView.StudyPlotShapes.SHAPE_CROSS="shape_cross";TradingView.StudyPlotShapes.SHAPE_XCROSS="shape_xcross";TradingView.StudyPlotShapes.SHAPE_CIRCLE="shape_circle";TradingView.StudyPlotShapes.SHAPE_TRIANGLE_UP="shape_triangle_up";TradingView.StudyPlotShapes.SHAPE_TRIANGLE_DOWN="shape_triangle_down";TradingView.StudyPlotShapes.SHAPE_FLAG="shape_flag";TradingView.StudyPlotShapes.SHAPE_ARROW_UP="shape_arrow_up";TradingView.StudyPlotShapes.SHAPE_ARROW_DOWN="shape_arrow_down";
|
|
TradingView.StudyPlotShapes.SHAPE_SQUARE="shape_square";TradingView.StudyPlotShapes.SHAPE_DIAMOND="shape_diamond";TradingView.StudyPlotShapes.SHAPE_LABEL_UP="shape_label_up";TradingView.StudyPlotShapes.SHAPE_LABEL_DOWN="shape_label_down";TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CROSS,"shape.cross","Cross","PaneRendererCrossShape");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_XCROSS,"shape.xcross","X Cross","PaneRendererXCross");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CIRCLE,"shape.circle","Circle","PaneRendererCircleShape");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_UP,"shape.triangleup","Triangle Up","PaneRendererTriangleApexUp");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_DOWN,"shape.triangledown","Triangle Down","PaneRendererTriangleApexDown");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_FLAG,"shape.flag","Flag","PaneRendererFlagShape");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_ARROW_UP,"shape.arrowup","Arrow Up","PaneRendererArrowUp");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_ARROW_DOWN,"shape.arrowdown","Arrow Down","PaneRendererArrowDown");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_SQUARE,"shape.square","Square","PaneRendererSquare");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_DIAMOND,"shape.diamond","Diamond","PaneRendererDiamond");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_LABEL_UP,"shape.labelup","Label Up","PaneRendererLabelUp");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_LABEL_DOWN,"shape.labeldown","Label Down","PaneRendererLabelDown");R37=function(a,b,c,d){this.D1=a;this.m_series=b;this.m_model=c;this._plotName=d;this._visible=!1;this._points=(new List).append(new MathEx.Point(0,0))};R37.prototype.update=function(){this._visible=!1;var a=this.D1.lastValueData(this._plotName,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)};
|
|
R37.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=this.D1.properties().styles[this._plotName].linewidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=TradingView.HitTestResult.REGULAR;a.visible=this._visible;return new TradingView.HorzLineRenderer(a)};
|
|
function defaultPlotOptions(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:TradingView.StudyConsts.PLOT_LINE,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}TradingView.createStudy=function(a,b,c,d){var e;d.isTVScriptStrategy?e="StudyStrategy":(e="study_"+(d.classId||d.shortId),e=e in TradingView?e:"Study");return new TradingView[e](a,b,c,d)};
|
|
TradingView.prepareStudyProperties=function(a,b,c,d){return TradingView.prepareStudyPropertiesWithRoot(a,b,c,d,"study_"+a.id)};TradingView.prepareStudyPropertiesWithRoot=function(a,b,c,d,e){b=TradingView.prepareStudyPropsState(a,b,c,d);e=new J52(e,b,!0);e.addExclusion("visible");e.addExclusion("precision");e.addExclusion("minTick");for(b=0;b<a.inputs.length;++b)c=a.inputs[b],c.isHidden&&(e.addExclusion("inputs."+b.toString()),e.addExclusion("inputs."+c.id));return e};
|
|
TradingView.prepareStudyPropertiesForLoadChart=function(a,b,c,d,e){return TradingView.prepareStudyPropertiesForLoadChartWithRoot(a,b,c,d,e,"study_"+a.id)};
|
|
TradingView.prepareStudyPropertiesForLoadChartWithRoot=function(a,b,c,d,e,f){c=TradingView.prepareStudyPropsStateForLoadChart(a,b,c,d,e);f=new J52(f,c,!0);f.addExclusion("visible");f.addExclusion("precision");f.addExclusion("minTick");a=b||a;for(b=0;b<a.inputs.length;++b)c=a.inputs[b],c.isHidden&&(f.addExclusion("inputs."+b.toString()),f.addExclusion("inputs."+c.id));return f};
|
|
TradingView.prepareStudyPropsState=function(a,b,c,d){if(1>TradingView.StudyMetaInfo.versionOf(a))throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");var e=TradingView.clone(defaults("study"));TradingView.preparePlotStyles(e,a);var f=TradingView.clone(defaults("study_"+a.id,d));a.isTVScript&&a.TVScriptSourceCode!==f.TVScriptSourceCode&&(f=TradingView.clone(TradingView.factoryDefaults("study_"+a.id,d)));TradingView.merge(e,f);b&&(assert(!(b instanceof
|
|
Property),"propsState should not be an instance of Property"),TradingView.merge(e,b));d=TradingView.convertMetainfoInputsArrayToObject(a);f={};A0.mergeInputs(f,d.defaults.inputs);A0.mergeInputsObjPart(f,e.inputs);A0.mergeInputsArrPart(f,d.inputs);e.inputs=f;delete d.inputs;delete d.defaults.inputs;f={};TradingView.merge(f,d.defaults);TradingView.merge(f,TradingView.factoryDefaults("study_"+d.id));TradingView.merge(f,e);TradingView.merge(f,
|
|
d);delete f.defaults;e=f;a=TradingView.calcDefaultColorsOffset(c,a);TradingView.merge(e,TradingView.shiftDefaultColors(e,a));b&&TradingView.merge(e.styles,b.styles);return e};
|
|
TradingView.prepareStudyPropsStateForLoadChart=function(a,b,c,d,e){var f=TradingView.StudyMetaInfo.versionOf(a);a.version&&c.version&&a.version!==c.version&&"undefined"!==typeof console&&console.warn("Serialized metaInfo version "+a.version+" is not equal to the saved state version "+c.version);var g=TradingView.clone(defaults("study"));if(0===f){TradingView.merge(g,TradingView.clone(a));var h=TradingView.convertMetainfoInputsArrayToObject(a);TradingView.merge(g.inputs,h.inputs)}else 1<=f&&TradingView.merge(g,
|
|
TradingView.clone(a.defaults));TradingView.merge(g,TradingView.factoryDefaults("study_"+a.id));TradingView.preparePlotStyles(g,a);TradingView.merge(g,c);1<=f&&(TradingView.merge(g,TradingView.clone(a)),delete g.defaults);g=e.updateStudyState(g,a,b);(a=b||a)&&1<=TradingView.StudyMetaInfo.versionOf(a)&&(a=TradingView.convertMetainfoInputsArrayToObject(a),b={},A0.mergeInputs(b,a.defaults.inputs),A0.mergeInputs(b,g.inputs),A0.mergeInputsArrPart(b,
|
|
a.inputs),g.inputs=b,delete a.inputs,delete a.defaults.inputs,b={},TradingView.merge(b,a.defaults),TradingView.merge(b,TradingView.factoryDefaults("study_"+a.id)),TradingView.merge(b,g),TradingView.merge(b,a),delete b.defaults,g=b);d=TradingView.calcDefaultColorsOffset(d,a);TradingView.merge(g,TradingView.shiftDefaultColors(g,d));return g};
|
|
TradingView.preparePlotStyles=function(a,b){if(b.plots)for(var c=0;c<b.plots.length;c++){var d=b.plots[c].id,e=b.plots[c].type;if(e!==TradingView.StudyConsts.PLOT_TYPE_COLORER){var f=defaultPlotOptions();f.plottype=e;f.title=d;a.styles&&d in a.styles&&TradingView.merge(f,a.styles[d]);a.styles[d]=f}}};
|
|
TradingView.convertMetainfoInputsArrayToObject=function(a){var b=TradingView.clone(a);b.inputs={};if(a.inputs)for(var c=0;c<a.inputs.length;c++)b.inputs[a.inputs[c].id]=a.inputs[c].defval,b.inputs[c]=a.inputs[c];return b};TradingView.calcDefaultColorsOffset=function(a,b){var c=0;if(a)for(var d=0;d<a.D19().length;d++){var e=a.D19()[d];e.metaInfo&&e.metaInfo()&&e.metaInfo().id==b.id&&c++}return c};
|
|
TradingView.shiftDefaultColors=function(a,b){if(!b)return a;for(var c in a.styles){var d=a.styles[c].color;d&&(a.styles[c].color=TradingView.shiftColor(d,b))}return a};TradingView.shiftColor=function(a,b){a=new TradingView.RGBColor(a);var c=TradingView.rgbToHsl(a.r,a.g,a.b),d=c[0]+.05*b;c[0]=d-Math.floor(d);c=TradingView.hslToRgb(c[0],c[1],c[2]);a.r=c[0];a.g=c[1];a.b=c[2];return a.toHex()};
|
|
TradingView.Study=function(a,b,c,d){this._titleCache={};this._resolvedSymbols={};this._priceAxisViewsBase=[];this._paneViews=[];this._hlinesPriceAsisViews=[];this._horizlinesPriceAsisViews=[];TradingView.PriceDataSource.call(this,a);this.m_data=new TradingView.PlotList;this._graphics=new A62(d);this._plotOffsets={};this._plotOffsetsMetaInfoOverride={};this.D0=a;this._chartApi=a._chartApi;this._series=c;this._metaInfo=d;this.D2=b;this.D2.listeners().subscribe(this,
|
|
TradingView.Study.prototype.changeStyles);void 0!==this.D2.inputs&&this.D2.inputs.listeners().subscribe(this,TradingView.Study.prototype.inputsChanged);this.D2.visible.listeners().subscribe(this,TradingView.Study.prototype.visibleChanged);this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments;this._turnaroundCounter=1;this._turnaround="st"+this._turnaroundCounter;this._status="";this._plotFields=[];if(b=this.metaInfo().plots){c=
|
|
0;for(var e=b.length;c<e;c++)this._plotFields.push(b[c].id)}this.clearData();this._studyModified=!1;this._tagsChanged=new Delegate;this.createViews();var f=this;this._handler=function(a){f.onData(a)};this._createFormatter();f=this;this.D2.precision.listeners().subscribe(null,function(){f._createFormatter();f.D0.D20(new A22(A22.FULL_UPDATE))});this._showStudyArgumentsProperty.listeners().subscribe(null,function(){f._titleCache={}});
|
|
this.D2.description.listeners().subscribe(null,function(){f._titleCache={}});this.D2.shortDescription&&this.D2.shortDescription.listeners().subscribe(null,function(){f._titleCache={}});R77.enabled("update_study_formatter_on_symbol_resolve")&&a.mainSeries().onSymbolResolved().subscribe(this,TradingView.Study.prototype._createFormatter);var f=this,g={};this._simplePlotsCount=d.plots.filter(function(a,b){if(f.isLinePlot(b))return!0;if(f.isOHLCSeriesPlot(b)){var c=f.metaInfo().plots[b].target;
|
|
if(g[c])return!1;g[c]=c;return!0}return!1}).length;this.D2.showInDataWindow.listeners().subscribe(a,TradingView.ChartModel.prototype.fullUpdate);this.hasBarColorer()&&this.D2.visible.listeners().subscribe(a.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache)};inherit(TradingView.Study,TradingView.PriceDataSource);
|
|
TradingView.Study.prototype.lastValueData=function(a,b,c){var d={};if(this.D0.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return null;var e=this.D0.timeScale().visibleBars();if(e.isEmpty()||!this.properties().visible.value())return null;var f=this.properties().styles,g=this.properties().ohlcPlots,h;f&&f[a]&&(h=f[a]);g&&g[a]&&(h=g[a]);if(!h||!h.visible.value())return null;f=this.offset(a);e=this.nearestIndex(e.lastBar()-f,TradingView.SEARCH_NEAREST_LEFT);
|
|
if(void 0===e)return null;for(var k=this.metaInfo().plots,g=0;g<k.length&&!(k[g].id===a||this.isOHLCClosePlot(g)&&k[g].target===a);g++);this.data();b=b?this.data().last().value:this.data().valueAt(e);if(!b||!isNumber(b[g+1]))return null;for(var e=f=null,l,m=0;m<k.length;m++)k[m].target===a&&(this.isSelfColorerPlot(m)||this.isOHLCColorerPlot(m))&&(f=m,e=this.metaInfo().palettes[k[m].palette],l=this.properties().palettes[k[m].palette]);a=b[g+1];c&&(d.price=a);if(this.priceScale().properties().percentage.value()){c=
|
|
this.firstValue(!0);if(!c)return null;a=this.priceScale().priceRange().convertToPercent(a,c)}d.text=this.priceScale().formatter().format(a);h=h.color.value();f&&b.length>f+1?(c=b[f+1],d.color=void 0!==c&&null!==c?l.colors[e.valToIndex?e.valToIndex[c]:c].color.value():h):d.color=h;d.floatCoordinate=this.priceScale().priceToCoordinate(a,!0);d.coordinate=Math.round(d.floatCoordinate);d.item=b;return d};TradingView.Study.prototype.series=function(){return this._series};
|
|
TradingView.Study.prototype.model=function(){return this.D0};TradingView.Study.prototype.clearData=function(){this.m_data=new TradingView.PlotList(this._plotFields);this._graphics=new A62(this._metaInfo);this._plotOffsets={}};TradingView.Study.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.Study.prototype.properties=function(){return this.D2};
|
|
TradingView.Study.prototype.state=function(a){var b={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),zorder:this.zorder()};this.metaInfo()instanceof TradingView.StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=TradingView.StudyMetaInfo.parseIdString(b.metaInfo.id+(b.metaInfo.version?"-"+b.metaInfo.version:"")).fullId);a&&(b.data=this.m_data.state(),b.data.symbols=this._resolvedSymbols,b.data.graphics=
|
|
this._graphics.graphics(),b.data.plotOffsets=this._plotOffsets);this.ownerSource()&&(b.ownerSource=this.ownerSource().id());for(a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type){var c=this._metaInfo.inputs[a].id,d=b.state.inputs[c];0>d&&(d=this._rightOffsetToUnixTime(-d),b.state.inputs[c]=d&&0<=d?d:0)}return b};TradingView.Study.prototype.uniqueId=function(){return this.id()+"|"+JSON.stringify(this.inputsForAlert())};
|
|
TradingView.Study.prototype.stateForAlert=function(){var a=this.state();a.data=a.data||{};a.data.completePlotOffsets={};for(var b=0;b<this._metaInfo.plots.length;++b){var c=this._metaInfo.plots[b].id;a.data.completePlotOffsets[c]=this.offset(c)}a.uniqueId=this.uniqueId();return a};TradingView.Study.prototype.isSavedInStudyTemplates=function(){for(var a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type)return!1;return!0};
|
|
TradingView.Study.prototype.restoreData=function(a){this.m_data.restoreState(a);this._resolvedSymbols=a.symbols;this._graphics.setGraphics(a.graphics);this._postProcessGraphics();this._plotOffsets=a.plotOffsets};TradingView.Study.prototype.restart=function(){this.clearData();this._restarting=!0;R77.enabled("stop_study_on_restart")&&this.stop();this._clearLoadingTimer();this.start()};
|
|
TradingView.Study.prototype._clearLoadingTimer=function(){this.loadingTimer&&(clearTimeout(this.loadingTimer),this.loadingTimer=null)};
|
|
TradingView.Study.prototype.stop=function(){this._clearLoadingTimer();this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler);R77.enabled("update_study_formatter_on_symbol_resolve")&&this.D0.mainSeries().onSymbolResolved().unsubscribe(this,TradingView.Study.prototype._createFormatter);this._studyId=null;this.clearData();this._unsubscribeExtendedHours();this.recalculate()};
|
|
TradingView.Study.prototype._resolveSymbol=function(a,b){function c(b){d._chartApi.resolveSymbol(d._makeNextSymbolId(),b,function(b){switch(b.method){case "symbol_resolved":d._resolvedSymbols[a]=b.params[1];0!==d._studyId&&d.stop();d.start();break;case "symbol_error":if("permission denied"===b.params[1]&&b.params[2])switch(b.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(b.params[3])return c(b.params[3]);break;default:return c(b.params[2])}d._status=
|
|
$.t("Invalid Symbol");d.stop();d.D0.updateSource(d)}})}var d=this;c(a)};TradingView.Study.prototype._allSymbolsAreResolved=function(){for(var a=!0,b=0;b<this._metaInfo.inputs.length;b++)if("symbol"==this._metaInfo.inputs[b].type){var c=this._metaInfo.inputs[b].id,d=this.D2.inputs[c].value();this._resolvedSymbols[d]||(a=!1,this._resolveSymbol(d,this.D2.inputs[c]))}return a};
|
|
TradingView.Study.prototype._allInputsAreValid=function(){for(var a=0;a<this._metaInfo.inputs.length;a++)if("bar_time"==this._metaInfo.inputs[a].type){var b=this.D2.inputs[this._metaInfo.inputs[a].id].value();if(void 0===b||null===b)return!1}return!0};TradingView.Study.prototype.sourceId=function(){return this._studyId};TradingView.Study.prototype.isStarted=function(){return!!this._studyId};
|
|
TradingView.Study.prototype.start=function(){if(this._chartApi&&this._chartApi.connected()&&this._allSymbolsAreResolved()&&(!this.isStarted()||this._restarting)&&(this._studyId=TradingView.Study.makeNextStudyId(),this._restarting=!1,this._allInputsAreValid())){this._inputs=this.inputs();var a=this._metaInfo.id;if("MA"===this._metaInfo.id)switch(this._inputs[2]){case "exp":a="MAExp@tv-basicstudies";break;case "simple":a="MASimple@tv-basicstudies";break;case "weighted":a="MAWeighted@tv-basicstudies";
|
|
break;case "volume weighted":a="MAVolumeWeighted@tv-basicstudies"}a+="-"+(this._metaInfo.version||"1");a=TradingView.StudyMetaInfo.cutDollarHash(a);if(a.startsWith("Script@tv-scripting")||a.startsWith("StrategyScript@tv-scripting"))a+="!";this._chartApi.createStudy(this._studyId,this._turnaround,this._series._seriesId,a,this._inputs,this._handler);this._subscribeExtendedHours()}};TradingView.Study._nextSymbolId=0;
|
|
TradingView.Study.prototype._makeNextSymbolId=function(){TradingView.Study._nextSymbolId++;return"ss_"+TradingView.Study._nextSymbolId};TradingView.Study._nextStudyId=0;TradingView.Study.makeNextStudyId=function(){TradingView.Study._nextStudyId++;return"st"+TradingView.Study._nextStudyId};TradingView.Study.prototype._rightOffsetToUnixTime=function(a){var b=null;this._series.bars().size()>=a&&(b=this._series.bars()._valueAt(this._series.bars().lastIndex()-a)[TradingView.TIME_PLOT]);return b};
|
|
TradingView.Study.prototype.getSymbolString=function(a){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:a,session:"extended"}):a};TradingView.Study.prototype.inputsForGUI=function(a){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1})};TradingView.Study.prototype.inputsForAlert=function(){var a=this.offset(),b=this.inputs({symbolsForDisplay:!0,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1});a&&b.push(a);return b};
|
|
TradingView.Study.prototype.inputs=function(a){var b={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0};TradingView.merge(b,a);return this._buildInputs(b)};
|
|
TradingView.Study.prototype._buildInputs=function(a){assert(!!a,"options not set");var b={};try{b=this._prepareInputs(a)}catch(c){console.warn("Failed to prepare study inputs: "+c)}if(!a.symbolsForDisplay&&this._metaInfo.isTVScript)return 0===Object.keys(b).length||this._metaInfo.isTVScriptStub?[this._metaInfo.defaults.inputs.text]:[A57.patchILTemplate(this._metaInfo.defaults.inputs.text,this._metaInfo,b)];if(a.asObject){var d={};Object.keys(b).forEach(function(a){null!=b[a]&&(d[a]=
|
|
b[a])});d=$.isEmptyObject(d)?null:d}else d=[],Object.keys(b).forEach(function(a){null!=b[a]&&d.push(b[a])});return d};TradingView.Study.prototype._prepareInputs=function(a){assert(!!a,"options not set");for(var b={},c=0;c<this._metaInfo.inputs.length;c++){var d=this._metaInfo.inputs[c];if(!d.isFake||!a.skipFakeInputs||this._metaInfo.isTVScript)if(!d.isHidden||!a.skipHiddenInputs){var e=this._prepareInput(d,a);b[d.id]=e}}return b};
|
|
TradingView.Study.prototype._prepareInput=function(a,b){var c=a.id;if("symbol"==a.type)return c=this.D2.inputs[c].value(),b&&b.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[c]&&(c=this._resolvedSymbols[c].name+", "+this._resolvedSymbols[c].exchange):(this._resolvedSymbols&&this._resolvedSymbols[c]&&(c=this._resolvedSymbols[c],c=c.ticker||c.full_name),b&&b.symbolsForChartApi&&(c=this.getSymbolString(c))),c;if("bar_time"==a.type){c=this.D2.inputs[c].value();if(0>c)var d=
|
|
this._rightOffsetToUnixTime(-c),c=d&&0<=d?d:c;return c}return this.D2.inputs[c].value()};TradingView.Study.prototype._changeInputs=function(a){this._studyId&&this._chartApi.connected()?(this._turnaround="st"+ ++this._turnaroundCounter,this._allInputsAreValid())?this._allSymbolsAreResolved()&&(this._studyModified=!0,this._chartApi.modifyStudy(this._studyId,this._turnaround,a,this._handler)):this.stop():(this.stop(),this.start());this._inputs=a;this._tagsChanged.fire();this._titleCache={}};
|
|
TradingView.Study.prototype.changeStyles=function(){if(this._inputs)for(var a=this.inputs(),b=0;b<a.length;b++){if(a[b]!==this._inputs[b]){this._changeInputs(a);break}}else this._chartApi&&this._chartApi.connected()&&this.restart();this.hasBarColorer()&&this.D0.mainSeries().invalidateBarStylesCache();this.createViews();this.recalculate(!0);this.updateAllViews()};
|
|
TradingView.Study.prototype.inputsChanged=function(){this._metaInfo.isTVScript&&(void 0!==this._pinePatchPropsTimerId&&clearTimeout(this._pinePatchPropsTimerId),this._pinePatchPropsTimerId=setTimeout(this._pinePatchProps.bind(this),250))};
|
|
TradingView.Study.prototype._pinePatchProps=function(){var a=this._prepareInputs({symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0});A57.patchPropertiesAsync(this.D2,this._metaInfo,a).done(function(){this.createViews();this.recalculate(!0);this.updateAllViews()}.bind(this)).fail(function(a){console.error(a)});this._pinePatchPropsTimerId=null};
|
|
TradingView.Study.prototype.visibleChanged=function(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()};TradingView.Study.prototype.lastPriceLabelFixedCoordinate=function(a){return this._priceAxisViewsCache[a]._fixedCoordinate};
|
|
TradingView.Study.prototype.priceLabelText=function(a){if(1==this._simplePlotsCount)return this._metaInfo.shortDescription;var b=this._metaInfo.styles,c=this._metaInfo.ohlcPlots,d;b&&b[a]&&(d=b[a]);c&&c[a]&&(d=c[a]);a=d.title;return this._metaInfo.is_price_study?this._metaInfo.shortDescription+":"+a:a};TradingView.Study.prototype.createPlotLabels=function(a){for(var b=0;b<a.length;b++)this._paneViews.push(new TradingView.R38(this.D0,this,a[b],"priceLabelText","showStudyPlotLabels"))};
|
|
TradingView.Study.prototype.createViews=function(){this._priceAxisViewsBase=[];this._paneViews=[];var a={};this._priceAxisViewsCache={};var b=[];if(this.metaInfo().plots)for(var c=0;c<this.metaInfo().plots.length;c++)if(!(this.isSelfColorerPlot(c)||this.isBarColorerPlot(c)||this.isBarColorerPlot(c)||this.isOHLCColorerPlot(c))){var d=this.metaInfo().plots[c].id;if(this.isBgColorerPlot(c))this._paneViews.push(new R30(this,this._series,this.D0,d));else if(this.isPlotShapesPlot(c))this._paneViews.push(new R36(this,
|
|
this._series,this.D0,d));else if(this.isPlotCharsPlot(c))this._paneViews.push(new R35(this,this._series,this.D0,d));else if(this.isPlotArrowsPlot(c))this._paneViews.push(new R34(this,this._series,this.D0,d));else if(this.isOHLCSeriesPlot(c)){if(d=this.metaInfo().plots[c].target,!a[d]){a[d]=d;this.isOHLCBarsPlot(c)?this._paneViews.push(new TradingView.StudyPlotBarsPaneView(this,this._series,this.D0,d)):this.isOHLCCandlesPlot(c)&&
|
|
this._paneViews.push(new TradingView.StudyPlotCandlesPaneView(this,this._series,this.D0,d));var e=new R51(this,this.D0,d);this._priceAxisViewsCache[d]=e;this._priceAxisViewsBase.push(e);b.push(d)}}else e=new R51(this,this.D0,d),this._priceAxisViewsCache[d]=e,this._priceAxisViewsBase.push(e),this._paneViews.push(new R33(this,this._series,this.D0,d)),this.properties().styles[d].trackPrice.value()&&this._paneViews.push(new R37(this,
|
|
this._series,this.D0,d)),b.push(d)}if(this.D2.bands)for(c=0;c<this.D2.bands.childCount();c++)this.D2.bands[c].visible.value()&&this._paneViews.push(new TradingView.J58(this.D2.bands[c],this));this.D2.bandsBackground&&this._paneViews.push(new TradingView.J57(this));c=[];this.metaInfo().graphics&&(c=Object.keys(this.metaInfo().graphics),c.sort(function(a,b){return TradingView.Study.graphicsZOrderPriority(a)-TradingView.Study.graphicsZOrderPriority(b)}));
|
|
for(var f in c)a=c[f],e="_paneView"+a,d="StudyPaneView_"+a,TradingView.Study[d]&&(this[e]=new TradingView.Study[d](this,this.D0),this._paneViews.push(this[e])),this._dataWindowView||"hhists"!==a||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this.D0));this.D2.areaBackground&&this._paneViews.push(new TradingView.J55(this));if(this.D2.filledAreas&&this._metaInfo.filledAreas)for(c=0;c<this._metaInfo.filledAreas.length;++c)f=this._metaInfo.filledAreas[c],
|
|
a=this.D2.filledAreasStyle[f.id],f.type===TradingView.StudyMetaInfo.FilledArea.TYPE_PLOTS?this._paneViews.push(new TradingView.R2(this,f,a)):f.type===TradingView.StudyMetaInfo.FilledArea.TYPE_HLINES?this._paneViews.push(new TradingView.J84(this,f,a)):console.warn("Unsupported filledArea type: "+f.type);this.createPlotLabels(b);this._dataWindowView||(this._dataWindowView=new TradingView.StudyDataWindowView(this,this.D0));this._statusView||(this._statusView=
|
|
new TradingView.StudyStatusView(this,this.D0.properties()));this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)};TradingView.Study.prototype.recalculate=function(a){var b=this.D0.paneForSource(this);this.D0.recalculatePane(b,a);this.D0.updateSource(this)};TradingView.Study.prototype.data=function(){return this.m_data};TradingView.Study.prototype.metaInfo=function(){return this._metaInfo};
|
|
TradingView.Study.prototype.status=function(){return this._status};
|
|
TradingView.Study.prototype.title=function(a){if(this._titleCache[a])return this._titleCache[a];var b;b=a?this._metaInfo.shortDescription||this.D2.shortDescription&&this.D2.shortDescription.value()||"Study":this._metaInfo.description||this.D2.description&&this.D2.description.value()||"Study";b=$.t(b);var c=this._showStudyArgumentsProperty.value(),d=this.inputsForGUI()||[];c&&0<d.length&&(b+=" ("+d.join(", ")+")");return this._titleCache[a]=b};
|
|
TradingView.Study.prototype.graphics=function(){return this._graphics.graphics()};TradingView.Study.prototype._checkTurnaround=function(a){return a===this._turnaround||a===this.D0.mainSeries()._turnaround||a===this.D0.mainSeries()._turnaround+"_"+this._turnaround};
|
|
TradingView.Study.prototype.onData=function(a){var b=this;switch(a.method){case "study_loading":this._status=$.t("loading...");this._failed=!1;this._statusView.update();this.D0.updateSource(this);this._clearLoadingTimer();-1==["Plot splits","Plot earnings","Plot dividends"].indexOf(b._metaInfo.description)&&(b._loadingStartTime=(new Date).getTime(),b.loadingTimer=setTimeout(function(){var a={chartSession:b._chartApi._sessionid,studyName:b._metaInfo.description,arguments:b.inputs()};A72.sendReport("study_loading",
|
|
a)},15E3));break;case "study_error":this._clearLoadingTimer();delete this._loadingStartTime;this._failed=!0;this.clearData();this._status=a.params[2]?$.t(a.params[2].split(":",2)[0]):"";-1==["Sessions"].indexOf(b._metaInfo.description)&&A72.sendReport("study_error",{chartSession:b._chartApi._sessionid,studyName:b._metaInfo.description,arguments:b.inputs()});this._statusView.update();this.D0.updateSource(this);break;case "study_completed":if(!this._checkTurnaround(a.params[1]))break;
|
|
TradingView.logDebugChart("chartSession:"+b._chartApi._sessionid+", Study "+this._metaInfo.description+" loading took "+((new Date).getTime()-this._loadingStartTime)+" ms");this._clearLoadingTimer();delete this._loadingStartTime;this._status="";this._statusView.update();a=this.D0.paneForSource(this);this.D0.recalculatePane(a,!0);this._updateSources();this.D0.D20(new A22(A22.FULL_UPDATE));break;case "data_update":if(!this._checkTurnaround(a.params.turnaround))break;
|
|
b._clearLoadingTimer();this._studyModified&&(this.clearData(),this._studyModified=!1);var c=0===this.m_data.size()&&0<this._metaInfo.plots.length;assert(!!a.params.nonseries,"data.params.nonseries is missing");a.params.nonseries.d=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"";this._processPlotOffsets(a.params);this.transformData(a.params.plots);var d=this._mergeData(a.params.plots).earliestRow;this.hasBarColorer()&&this.D0.mainSeries().invalidateBarStylesCache(d.index);this._graphics.process(a.params.nonseries);
|
|
this._postProcessGraphics();a=this.D0.paneForSource(this);this.D0.recalculatePane(a,c);this._updateSources()}};TradingView.Study.prototype.transformData=function(a){};TradingView.Study.prototype._updateSources=function(){this.D0.updateSource(this);this.hasBarColorer()&&this.D0.updateSource(this.D0.mainSeries())};TradingView.Study.processPlotOffsets=function(a,b){var c=b.nonseries.d;c&&c.indexes_replace||(a._plotOffsets=c&&c.offsets?c.offsets:{})};
|
|
TradingView.Study.prototype._processPlotOffsets=function(a){TradingView.Study.processPlotOffsets(this,a)};TradingView.Study.prototype._mergeData=function(a){return this.m_data.merge(a)};
|
|
TradingView.Study.prototype._postProcessGraphics=function(){var a=this,b=function(b){var d=a._graphics.graphics(),e=[],f;if(d&&d[b])for(var g=d[b],d=0;d<g.length;d+=1)if(g[d].data)for(f=0;f<g[d].data.length;f+=1)e.push(new TradingView.Study.StudyPriceAxisView_hlines(a,a.D0,g[d].data[f],g[d].styleId,b));return e};this._hlinesPriceAsisViews=b("hlines");this._horizlinesPriceAsisViews=b("horizlines");this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)};
|
|
TradingView.Study.prototype.firstValue=function(a){if(this._metaInfo.is_price_study&&"Compare@tv-basicstudies"!==this._metaInfo.id)return this._series.data().firstValue();var b=this.D0.timeScale().visibleBars(),c=b.firstBar(),b=b.lastBar();if(0===this.m_data.size())return null;var d,e=this;this.m_data.range(c,b).each(function(b,c){for(var h=1;h<c.length;++h)if(!e.isSelfColorerPlot(h-1)){var k=e._metaInfo.plots[h-1].id,k=e.properties().styles[k];if(k.visible&&k.visible.value()&&!(a&&1E-10>Math.abs(c[h])||
|
|
void 0===c[h]||null===c[h]||d))return d=c[h],!0}});return d};TradingView.Study.offset=function(a,b){var c=0;a._plotOffsets&&void 0!==a._plotOffsets[b]&&(c+=a._plotOffsets[b]);void 0!==a._plotOffsetsMetaInfoOverride[b]?c+=a._plotOffsetsMetaInfoOverride[b]:a.properties().offsets&&void 0!==a.properties().offsets[b]&&(c+=a.properties().offsets[b].val.value());a.properties().offset&&(c+=a.properties().offset.val.value());return c};
|
|
TradingView.Study.prototype.offset=function(a){return TradingView.Study.offset(this,a)};
|
|
TradingView.Study.prototype.priceRange=function(a,b){if(TradingView.isInteger(a)){if(TradingView.isInteger(b)){if(0===this.m_data.size())return null;var c=null,d=this._metaInfo;if(0===d.plots.length)return null;for(var e,f=[],g,h=0;h<d.plots.length;++h)if(!(this.isSelfColorerPlot(h)||this.isTextColorerPlot(h)||this.isBarColorerPlot(h)||this.isBgColorerPlot(h)||this.isOHLCColorerPlot(h))){var k=d.plots[h].id,l;this.isOHLCSeriesPlot(h)?(l=d.plots[h].target,l=this.properties().ohlcPlots[l]):l=this.properties().styles[k];
|
|
if(l.visible.value()&&(g=null,l.location&&(g=l.location.value()),e||(e=0>[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(g),e=(this.isPlotShapesPlot(h)||this.isPlotCharsPlot(h))&&e||this.isPlotArrowsPlot(h)),this.isLinePlot(h)||(this.isPlotShapesPlot(h)||this.isPlotCharsPlot(h))&&l.location.value()==CanvasEx.MARKLOC_ABSOLUTE||this.isOHLCSeriesPlot(h))){l={index:h+1,offset:this.offset(k)};g=this.properties().styles[k].plottype.value();if(!this.properties().skipHistogramBaseOnAutoScale&&
|
|
0<=[TradingView.StudyConsts.PLOT_HISTOGRAM,TradingView.StudyConsts.PLOT_COLUMNS,TradingView.StudyConsts.PLOT_AREA].indexOf(g)){k=this.properties().styles[k].histogramBase.value();if(!isNumber(k))continue;l.baseValue=k}f.push(l)}}h=this.m_data.minMaxOnRange2(a,b,f);e&&(f=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],f=this.series().data().bars().minMaxOnRange2(a,b,f),h.min=null==h.min||void 0===h.min?f.min:Math.min(h.min,f.min),h.max=null==h.max||void 0===h.max?f.max:
|
|
Math.max(h.max,f.max));null!==h.min&&(c=new PriceRange(h.min,h.max));if(d.bands)for(h=0;h<d.bands.length;h++)this.properties().bands[h].visible.value()&&(k=this.properties().bands[h].value.value(),isNumber(k)&&(c?c.apply(k,k):c=new PriceRange(k,k)));c&&c.minValue()===c.maxValue()&&(d=.005*c.minValue(),c=new PriceRange(c.minValue()-d,c.maxValue()+d));return this.priceScale().properties().percentage.value()&&c?(d=this.firstValue())?c.convertToPercents(d):null:this.priceScale().isLog()&&c?new PriceRange(this.priceScale().priceToLogical(c.minValue()),
|
|
this.priceScale().priceToLogical(c.maxValue())):c}TradingView.logDebugChart("Study.priceRange: incorrect endBar")}else TradingView.logDebugChart("Study.priceRange: incorrect startBar")};TradingView.Study.prototype.paneViews=function(a){return this.properties().visible.value()?this._paneViews:null};TradingView.Study.prototype.dataWindowView=function(){return this._dataWindowView};TradingView.Study.prototype.statusView=function(){return this._statusView};
|
|
TradingView.Study.prototype.priceAxisViews=function(a,b){return this.D0.paneForSource(this)===a&&b===this.priceScale()&&(this.D0.properties().scalesProperties.showStudyLastValue.value()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null};TradingView.Study.prototype.isLinePlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_LINE};
|
|
TradingView.Study.isSelfColorerPlot=function(a,b){return a._metaInfo.plots[b].type==TradingView.StudyConsts.PLOT_TYPE_COLORER};TradingView.Study.prototype.isSelfColorerPlot=function(a){return TradingView.Study.isSelfColorerPlot(this,a)};TradingView.Study.prototype.isTextColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_TEXT_COLORER};TradingView.Study.prototype.isBarColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_BAR_COLORER};
|
|
TradingView.Study.prototype.isBgColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_BG_COLORER};TradingView.Study.prototype.isPlotShapesPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_SHAPES};TradingView.Study.prototype.isPlotCharsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_CHARS};
|
|
TradingView.Study.prototype.isPlotArrowsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_ARROWS};TradingView.Study.prototype.isOHLCBarsPlot=function(a){var b=this._metaInfo.plots[a].target;return(b=this.metaInfo().defaults.ohlcPlots[b])&&this.isOHLCSeriesPlot(a)&&b.plottype==TradingView.StudyConsts.OHLC_TYPE_BARS};
|
|
TradingView.Study.prototype.isOHLCCandlesPlot=function(a){var b=this._metaInfo.plots[a].target;return(b=this.metaInfo().defaults.ohlcPlots[b])&&this.isOHLCSeriesPlot(a)&&b.plottype==TradingView.StudyConsts.OHLC_TYPE_CANDLES};TradingView.Study.prototype.isOHLCSeriesPlot=function(a){a=this._metaInfo.plots[a].type;return a==TradingView.StudyConsts.PLOT_TYPE_OHLC_OPEN||a==TradingView.StudyConsts.PLOT_TYPE_OHLC_HIGH||a==TradingView.StudyConsts.PLOT_TYPE_OHLC_LOW||a==TradingView.StudyConsts.PLOT_TYPE_OHLC_CLOSE};
|
|
TradingView.Study.prototype.isOHLCOpenPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_OHLC_OPEN};TradingView.Study.prototype.isOHLCHighPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_OHLC_HIGH};TradingView.Study.prototype.isOHLCLowPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_OHLC_LOW};
|
|
TradingView.Study.prototype.isOHLCClosePlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_OHLC_CLOSE};TradingView.Study.prototype.isOHLCColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_OHLC_COLORER};TradingView.Study.prototype.isDataOffsetPlot=function(a){return this._metaInfo.plots[a].type==TradingView.StudyConsts.PLOT_TYPE_DATAOFFSET};
|
|
TradingView.Study.prototype.hasBarColorer=function(){for(var a=0;a<this._metaInfo.plots.length;++a)if(this.isBarColorerPlot(a))return!0;return!1};TradingView.Study.prototype.barColorer=function(){for(var a=null,b=0;b<this._metaInfo.plots.length;++b)if(this.isBarColorerPlot(b)){var c=new TradingView.StudyBarColorer(this,b);null===a?a=c:a.pushBackBarColorer(c)}if(null===a)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return a};
|
|
TradingView.Study.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0};
|
|
TradingView.Study.prototype._createFormatter=function(){var a;"default"==this.properties().precision.value()?this.metaInfo().defaults&&(a=parseInt(this.metaInfo().defaults.precision)):a=parseInt(this.properties().precision.value());isFinite(a)||(a=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1E4);var b=this.series().symbolInfo();0===a?(a=0,b&&(a=b.volume_precision?b.volume_precision:b.has_fractional_volume?2:0),this._formatter=
|
|
new TradingView.VolumeFormatter(a)):this._formatter=new TradingView.PriceFormatter(Math.pow(10,a));this.priceScale()&&this.priceScale().updateFormatter()};TradingView.Study.prototype.formatter=function(){return this._formatter};TradingView.Study.prototype.nearestIndex=function(a,b){if(TradingView.isInteger(a)){var c=this._series.data().bars().search(a,b);return c?c.index:void 0}TradingView.logDebugChart("Study.nearestIndex: incorrect logicalPoint")};
|
|
TradingView.Study.prototype.updateAllViews=function(){for(var a=0;a<this._paneViews.length;a++)this._paneViews[a].update();this._dataWindowView.update();this._statusView.update();for(a=0;a<this._priceAxisViews.length;a++)this._priceAxisViews[a].update()};TradingView.Study.prototype.tags=function(){var a=[];a.push(this._metaInfo.id);var b=this.inputsForGUI();if(0<b.length){for(var c=this._metaInfo.id,d=0;d<b.length;d++)c+="_"+b[d];a.push(c)}return a};
|
|
TradingView.Study.isPointsBasedStudy=function(a){switch(a){case "VbPFixed@tv-volumebyprice":case "mtp_tsanalysis@mtp-mtpredictor":case "mtp_riskreward@mtp-mtpredictor":case "mtp_decisionpoint@mtp-mtpredictor":case "mtp_ew_main@mtp-mtpredictor":case "mtp_ew_major@mtp-mtpredictor":case "mtp_ew_minor@mtp-mtpredictor":case "mtp_wpt_down1ora@mtp-mtpredictor":case "mtp_wpt_down2orb@mtp-mtpredictor":case "mtp_wpt_down3@mtp-mtpredictor":case "mtp_wpt_down4@mtp-mtpredictor":case "mtp_wpt_down5@mtp-mtpredictor":case "mtp_wpt_downc@mtp-mtpredictor":case "mtp_wpt_up1ora@mtp-mtpredictor":case "mtp_wpt_up2orb@mtp-mtpredictor":case "mtp_wpt_up3@mtp-mtpredictor":case "mtp_wpt_up4@mtp-mtpredictor":case "mtp_wpt_up5@mtp-mtpredictor":case "mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}};
|
|
TradingView.Study.lineToolNameForPointsBasedStudy=function(a){switch(a){case "VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case "RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case "mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case "mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case "mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case "mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case "mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";
|
|
case "mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case "mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case "mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case "mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case "mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case "mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case "mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case "mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";
|
|
case "mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case "mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case "mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case "mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case "mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+a);}};
|
|
TradingView.Study.isStudyLineTool=function(a){a=TradingView[a];return"function"===typeof a&&a.prototype instanceof A63};TradingView.Study.prototype.onExtendedHoursChanged=function(){this.restart()};TradingView.Study.prototype.hasSymbolInputs=function(){for(var a=this._metaInfo.inputs.length;a--;)if("symbol"===this._metaInfo.inputs[a].type)return!0;return!1};
|
|
TradingView.Study.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)};TradingView.Study.prototype._unsubscribeExtendedHours=function(){this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)};
|
|
TradingView.Study.prototype.removeByRemoveAllStudies=function(){return!0};TradingView.StudyStub=function(a,b,c){TradingView.PriceDataSource.call(this,a);this._origState=b;this._title=c;this.D2=new Property({visible:!0});this._statusView=new TradingView.StudyStatusView(this,a.properties());this._status=$.t("compiling...");this._statusView.setText(this._title+" "+this._status);this._formatter=new TradingView.PriceFormatter(Math.pow(10,2));this._failed=!1};inherit(TradingView.StudyStub,TradingView.PriceDataSource);TradingView.StudyStub.prototype.properties=function(){return this.D2};
|
|
TradingView.StudyStub.prototype.statusView=function(){return this._statusView};TradingView.StudyStub.prototype.state=function(a){return this._origState};TradingView.StudyStub.prototype.setStatus=function(a){this._status=a;this._statusView.setText(this._title+" "+this._status)};TradingView.StudyStub.prototype.formatter=function(){return this._formatter};TradingView.StudyStub.prototype.title=function(){return this._title};TradingView.StudyStub.prototype.setFailed=function(a){this._failed=a};A62=function(a){this._graphics=A62.emptyGraphics();assert(!!a,"Study metaInfo is absent!");this._metaInfo=a};A62.emptyGraphics=function(){return{indexes:[]}};A62.prototype.isEmpty=function(){var a=1<Object.keys(this._graphics).length;return 0===this._graphics.indexes.length&&!a};A62.prototype.graphics=function(){return this._graphics};
|
|
A62.prototype.setGraphics=function(a){this._graphics=a;this._postProcessGraphicsData()};A62.prototype.process=function(a){""!==a.d&&(TradingView.logDebugChart("nonseries.d is "+JSON.stringify(a.d)),a.d.indexes_replace?this.replaceIndexes(a):a.d.graphicsCmds&&(this.processEraseCmds(a.d.graphicsCmds.erase),this.processCreateCmds(a.d.graphicsCmds.create,a.indexes)))};
|
|
A62.prototype.replaceIndexes=function(a){""!==a.d&&(assert(!!a.d.indexes_replace),this._graphics.indexes=a.indexes,TradingView.logDebugChart("timescale has been replaced with a new one (replaceIndexes)"))};
|
|
A62.prototype.processEraseCmds=function(a){if(a){assert(!!this._graphics,"_graphics object doesn't exist in the study!");assert(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(var b=0;b<a.length;++b){var c=a[b];if("all"===c.action)this._graphics=A62.emptyGraphics(),TradingView.logDebugChart("erased ALL the graphics");else if("one"===c.action)for(var d in this._graphics[c.type]){var e=this._graphics[c.type][d],f=A62._findGraphicsObjIndexById(e.data,
|
|
c.id);0<=f?(e.data.splice(f,1),TradingView.logDebugChart("erased one the graphics obj with id="+c.id)):TradingView.logDebugChart("cannot erase obj with id="+c.id+" because it doesn't exist")}else Error("Unknown graphics command "+c.action)}}};A62._findGraphicsObjIndexById=function(a,b){for(var c=0;c<a.length;++c)if(a[c].id===b)return c;return-1};
|
|
A62.prototype.processCreateCmds=function(a,b){if(a){assert(!!b,"indexes are missing in the study nonseries response!");assert(!!this._graphics,"_graphics object doesn't exist in the study!");assert(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(var c in a){assert(c in this._metaInfo.graphics,"There is a '"+c+"' in study response, but it doesn't present in metaInfo!");for(var d=0;d<a[c].length;++d){var e=a[c][d],f=e.styleId;assert(f in this._metaInfo.graphics[c]);
|
|
this._graphics[c]||(this._graphics[c]=[]);for(var g=null,h=0;h<this._graphics[c].length;++h)if(this._graphics[c][h].styleId===f){g=this._graphics[c][h];break}null===g&&(g={styleId:f,data:[]},this._graphics[c].push(g));g.data=g.data.concat(e.data);TradingView.logDebugChart("created "+e.data.length+" graphics objects")}}"nochange"===b?TradingView.logDebugChart("timescale hasn't changed"):(assert(Array.isArray(b)),this._graphics.indexes=b,TradingView.logDebugChart("timescale has been replaced with a new one"));
|
|
this._postProcessGraphicsData()}};A62.prototype._postProcessGraphicsData=function(){if(this._graphics)for(var a in this._graphics.hhists){var b=this._graphics.hhists[a];A62._sortHHistItemsByPrice(b.data);b.dataObj=A62._splitHHistItemsBySession(b.data,this._graphics.indexes)}};A62._sortHHistItemsByPrice=function(a){a.sort(function(a,c){return a.priceLow-c.priceLow})};
|
|
A62._splitHHistItemsBySession=function(a,b){for(var c={},d=0;d<a.length;++d){var e=a[d],f=b[e.firstBarTime];void 0===f?console.error("Cannot find index "+e.firstBarTime+" in study timescale indexes"):(f in c||(c[f]=[]),c[f].push(e))}return c};A64=function(a){this._studyId=a;this._maxFromVers=this._maxToVers="0";this._migrs=[]};A64.prototype.addMigration=function(a,b,c){A0.isGreater(a,this._maxFromVers)&&(this._maxFromVers=a);A0.isGreater(b,this._maxToVers)&&(this._maxToVers=b);this._migrs.push({fromVers:a,toVers:b,rules:c})};
|
|
A64.prototype.updateInputs=function(a,b){if(!b)return b;for(var c=TradingView.clone(b),d=a;A0.isLess(d,this._maxToVers);){var e=this._findMigration(d),c=this._applyMigration(c,e);if(!A0.isLess(d,e.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");d=e.toVers;TradingView.logDebugChart("Applied migration rule to study: "+this._studyId+" from vers: "+e.fromVers+" to vers: "+
|
|
e.toVers)}return c};A64.prototype._findMigration=function(a){for(var b=-1,c=this._maxFromVers,d=0;d<this._migrs.length;d++){var e=this._migrs[d];!A0.isLess(e.fromVers,a)&&A0.isLessOrEqual(e.fromVers,c)&&(c=e.fromVers,b=d)}if(0>b)throw Error("Could not find matching migration for study: "+this._studyId+" vers: "+a);return this._migrs[b]};
|
|
A64.prototype._applyMigration=function(a,b){for(var c=a,d=0;d<b.rules.length;d++)var e=b.rules[d],c=this._getApplyRuleFun(e.type)(c,e);return c};A64.prototype._getApplyRuleFun=function(a){if("inputRemoved"==a)return A64._applyInputRemovedRule;if("inputChangedType"==a)return A64._applyInputChangedTypeRule;throw Error("Unknown migration rule type: "+a);};
|
|
A64._applyInputRemovedRule=function(a,b){if(!(b.inputId in a))return a;var c=A0.findInputKeyById(a,b.inputId);if(!c)return a;delete a[c];delete a[b.inputId];var c={},d=0,e;for(e in a)isNumber(parseInt(e,10))?(c[d]=a[e],d++):c[e]=a[e];return c};
|
|
A64._applyInputChangedTypeRule=function(a,b){var c=A0.getInputKeyById(a,b.inputId);if("resetToDefVal"==b.action)a[b.inputId]=b.defVal,a[c].defval=b.defVal,a[c].type=b.inputType;else throw Error("Unknown action "+b.action+" for rule with type "+b.type);return a};A0=function(a,b){if(!a)throw Error("No studies metainfo");this._studiesMetainfo=a;if(!b)throw Error("No studies migrations");this._studiesMigrations=b;this._migrations={};for(var c=0;c<this._studiesMigrations.size();c++)for(var d=this._studiesMigrations.item(c),e=0;e<d.length;e++)for(var f=d[e],g=f.versFrom,h=f.versTo,k=0;k<f.studyMigrations.length;k++){var l=f.studyMigrations[k],m=l.studyId;if(0===l.rules.length)throw Error("Study Migration should have at least one convertion rule");
|
|
var n=m in this._migrations?this._migrations[m]:new A64(m);n.addMigration(g,h,l.rules);this._migrations[m]=n}this._clientMigrations=[function(a,b){if(this._studiesMetainfo.isEmpty()||!a.isTVScript||22<=a.version)return b;for(var c={},d=0,e=0;;){var f=b[e];if(void 0===f)break;var g=b[f.id];f.isFake&&(f.id="in_"+d++);c[e]=f;c[f.id]=g;e++}return c}]};
|
|
A0.prototype.updateMetaInfo=function(a){if(!a)return a;assert(!a.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync");for(var b=null,c=this._studiesMetainfo,d=0;d<c.size();d++)if(c.item(d).id===a.id){b=c.item(d);break}return TradingView.clone(b)};
|
|
A0.prototype.updateMetaInfoAsync=function(a,b){var c=$.Deferred(),d=c.promise();if(!a)return c.reject("No old metaInfo was given"),d;if(b)return c.resolve(null),d;if(a.isTVScript&&void 0!==a.TVScriptSourceCode)if(TradingView.StudyMetaInfo.versionOf(a)!=TradingView.StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION){var e=this._studiesMetainfo.isEmpty()?"1":A57.tvScriptingPkgVersion(this._studiesMetainfo),f=a.scriptIdPart||TVScript.createScriptIdPart();A57.translateScriptAsync(a.TVScriptSourceCode,
|
|
null,f,e).done(function(a){a=TradingView.StudyMetaInfo.addOrReplaceStudyMetaInfo(this._studiesMetainfo,a);c.resolve(a)}.bind(this)).fail(function(b){console.warn("Could not compile Pine script (skipping): "+a.description+" "+b);c.reject(b)})}else c.resolve(a);else{for(var e=null,f=this._studiesMetainfo,g=0;g<f.size();g++)if(f.item(g).id===a.id){e=f.item(g);break}e?c.resolve(TradingView.clone(e)):c.resolve(null)}return d};
|
|
A0.prototype.updateStudyState=function(a,b,c){if(a){a=TradingView.clone(a);var d=b.id;if(d in this._migrations){var e=this._migrations[d].updateInputs(b.version,a.inputs);a.inputs=e}for(d=0;d<this._clientMigrations.length;++d)e=this._clientMigrations[d].call(this,b,a.inputs),Object.keys(e).length==Object.keys(a.inputs).length?a.inputs=e:console.warn("StudyVersioning._clientMigrations application returned bad result. Skipping it...")}if(c&&a&&(d={},A0.mergeInputs(d,
|
|
c.inputs),A0.mergeInputs(d,c.defaults.inputs),A0.mergeInputs(d,a.inputs),a.inputs=d,d=TradingView.StudyMetaInfo.versionOf(b),b.isTVScript&&b.TVScriptSourceCode&&12<=d&&26>=d)){e={};for(d=0;d<b.plots.length;++d)e[b.plots[d].id]=c.plots[d].id;c=Object.keys(a.styles);for(d=0;d<c.length;++d){b=c[d];var f=a.styles[b];delete a.styles[b];a.styles[e[b]]=f}c=Object.keys(a.plots);for(d=0;d<c.length;++d)f=c[d],b=a.plots[f].id,a.plots[f].id=e[b]}return a};
|
|
A0.prototype.patchPointsBasedStudyState=function(a){A0._fixInputsMaxValue(a.state,a.metaInfo);"LineToolRegressionTrend"===a.type&&(a=TradingView.LineToolRegressionTrend.patchSourceState(a));return a};
|
|
A0.prototype.patchPointsBasedStudyData=function(a,b){if("battle"!=A13()||!a||!b)return b;var c=TradingView.clone(b);"VbPFixed@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,c);return c};
|
|
A0.prototype.patchStudyData=function(a,b,c,d){if("battle"!=A13())return{data:b,nsData:c,indexes:d};b=TradingView.clone(b);c=TradingView.clone(c);d=TradingView.clone(d);"VbPVisible@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,b.graphics);"VbPSessions@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&A0._patchOldVolumeProfiles(0,b.graphics);var e=TradingView.StudyMetaInfo.versionOf(a);
|
|
if(a.isTVScript&&a.TVScriptSourceCode&&12<=e&&26>=e)for(a=b.columns,b.columns=[],e=0;e<a.length;++e)b.columns.push("plot_"+e);return{data:b,nsData:c,indexes:d}};A0._patchOldVolumeProfiles=function(a,b){var c=b.hhists[a].data,d=[],e;for(e in c)d=d.concat(c[e]);b.hhists[0].data=d};
|
|
A0._fixInputsOrder=function(a,b){for(var c=TradingView.StudyMetaInfo.getOrderedInputIds(b),d=A0.splitInputs(a.inputs),e=d.arr,d=TradingView.merge({},d.obj),f=0;f<c.length;++f){var g=A0.findInputKeyById(e,c[f]);null!==g&&(d[f]=e[g])}a.inputs=d};A0.INPUT_MAX_VALUE=253370764800;
|
|
A0._verifyInputsMaxValue=function(a){var b=A0.INPUT_MAX_VALUE;if(a.inputs)for(var c=0;c<a.inputs.length;c++){var d=a.inputs[c];"integer"===d.type&&d.max&&d.max>b&&console.warn("Bad integer input max value in metaInfo id="+a.id+" title="+a.description)}};
|
|
A0._fixInputsMaxValue=function(a,b){var c=A0.INPUT_MAX_VALUE;if(b.inputs)for(var d=0;d<b.inputs.length;d++){var e=b.inputs[d];"integer"===e.type&&e.max&&e.max>c&&(e.max=c)}if(a&&a.inputs){var d=A0.splitInputs(a.inputs),f=d.arr,g;for(g in f)e=f[g],"integer"===e.type&&e.max&&e.max>c&&(e.max=c);a.inputs=TradingView.merge(d.obj,d.arr)}};
|
|
A0.prototype.patchPropsStateAndMetaInfo=function(a,b,c){A0._fixInputsOrder(a,b);A0._fixInputsMaxValue(a,b);b.isTVScript&&"undefined"!==typeof TVScript&&TVScript.createScriptIdPart&&(b.scriptIdPart=b.scriptIdPart||TVScript.createScriptIdPart());b.isTVScript&&("Script$TV_EARNINGS@tv-scripting"!==b.id&&"Script$TV_DIVIDENDS@tv-scripting"!==b.id&&"Script$TV_SPLITS@tv-scripting"!==b.id||delete b.TVScriptSourceCode);"Volume"!==b.id&&
|
|
"Volume@tv-basicstudies"!==b.id||0!==b.inputs.length||(b.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1E3}],b.plots.push({id:"vol_ma",type:"line"}));if("PivotPointsStandard@tv-basicstudies"===b.id&&(0===b.inputs.length?(a.inputs={kind:"Traditional",showHistoricalPivots:!0},b.inputs=[{defval:"Traditional",id:"kind",type:"text",options:"Traditional Fibonacci Woodie Classic DeMark Camarilla".split(" ")},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===b.inputs.length&&(a.inputs={kind:"Traditional"},
|
|
b.inputs=[{defval:"Traditional",id:"kind",type:"text",options:"Traditional Fibonacci Woodie Classic DeMark Camarilla".split(" ")},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===a._hardCodedDefaultsVersion)){a._hardCodedDefaultsVersion=1;var d=a.color;delete a.color;a.levelsStyle={colors:{P:d,"S1/R1":d,"S2/R2":d,"S3/R3":d,"S4/R4":d,"S5/R5":d}}}"CMF"===b.shortId&&2===b.inputs.length&&(a.inputs={length:a.inputs["length fast"]},b.inputs=b.inputs.splice(0,1),b.inputs[0].id="length");b.defaults&&
|
|
void 0===b.defaults.precision&&(-1!=["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(b.id)?b.defaults.precision=0:b.defaults.precision=4);if("MA"===b.id){var d=new TradingView.StudyMetaInfo({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),
|
|
e=new TradingView.StudyMetaInfo({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),f=new TradingView.StudyMetaInfo({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",
|
|
defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),g=new TradingView.StudyMetaInfo({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}});switch(a.inputs.type){case "exp":b=d;break;case "simple":b=e;break;case "weighted":b=
|
|
g;break;case "volume weighted":b=f}a.styles[b.plots[0].id]=a.styles.MovAvg;delete a.styles.MovAvg;delete a.inputs.type}c.oldShowStudyLastValueProperty&&(a.oldShowLastValue=a.showLastValue);delete a.showLastValue;delete a.showStudyArguments;return{propsState:a,metaInfo:b}};
|
|
A0.compareStudyVersions=function(a,b){a=a.toString();b=b.toString();var c=a.split("."),d=c[0],d=parseInt(d,10),c=1<c.length?c[1]:"0",c=parseInt(c,10),e=b.split("."),f=e[0],f=parseInt(f,10),e=1<e.length?e[1]:"0",e=parseInt(e,10);return d<f?-1:d>f?1:c<e?-1:c>e?1:0};A0.isLess=function(a,b){return 0>A0.compareStudyVersions(a,b)};
|
|
A0.isLessOrEqual=function(a,b){return 0>=A0.compareStudyVersions(a,b)};A0.isEqual=function(a,b){return 0===A0.compareStudyVersions(a,b)};A0.isGreater=function(a,b){return 0<A0.compareStudyVersions(a,b)};A0.isGreaterOrEqual=function(a,b){return 0<=A0.compareStudyVersions(a,b)};
|
|
A0.isVersionTesting=function(a){if(!a)return!1;a=a.toString();return/\d+.\d+/.exec(a)==a};A0.isVersionHead=function(a){if(!a)return!1;a=a.toString();return/\d+/.exec(a)==a};A0.mergeInputs=function(a,b){A0.mergeInputsArrPart(a,b);A0.mergeInputsObjPart(a,b)};
|
|
A0.mergeInputsArrPart=function(a,b){var c=A0.splitInputs(b),d;for(d in c.arr){var e=A0.findInputKeyById(a,c.arr[d].id);e?TradingView.merge(a[e],c.arr[d]):A0.appendInputInfoToArr(a,c.arr[d])}};A0.mergeInputsObjPart=function(a,b){var c=A0.splitInputs(b);TradingView.merge(a,c.obj)};
|
|
A0.appendInputInfoToArr=function(a,b){var c=-1,d;for(d in a){var e=parseInt(d,10);isNumber(e)&&e>c&&(c=e)}a[c+1]=b};A0.splitInputs=function(a){var b={},c={},d;for(d in a)isNumber(parseInt(d,10))?b[d]=a[d]:c[d]=a[d];return{arr:b,obj:c}};A0.findInputKeyById=function(a,b){var c=null,d;for(d in a)if(isNumber(parseInt(d,10))&&a[d].id==b){c=d;break}return c};
|
|
A0.getInputKeyById=function(a,b){var c=A0.findInputKeyById(a,b);if(!c)throw Error("Cannot find input with id: "+b);return c};A48=function(a,b,c,d,e){this._paneView=e;TradingView.Study.call(this,a,b,c,d)};inherit(A48,TradingView.Study);
|
|
A48.prototype.onData=function(a){switch(a.method){case "data_update":var b=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):{};b.indexes_replace||(this._nonseriesdata=b.data);this._indexes=a.params.nonseries.indexes;a=this.D0.paneForSource(this);this.D0.recalculatePane(a);this.D0.updateSource(this);break;default:return TradingView.Study.prototype.onData.call(this,a)}};
|
|
A48.prototype.updateAllViews=function(){this._paneView.update();this._dataWindowView.update();this._statusView.update()};A48.prototype.paneViews=function(a){return[this._paneView]};A48.prototype.state=function(a){var b=TradingView.Study.prototype.state.call(this,a);a&&(b.nonSeriesData=this._nonseriesdata,b.indexes=this._indexes);return b};
|
|
A48.prototype.restoreData=function(a,b,c){TradingView.Study.prototype.restoreData.call(this,a);this._nonseriesdata=b;this._indexes=c};A48.prototype.clearData=function(){this._indexes=this._nonseriesdata=null};TradingView.StudyStrategy=function(a,b,c,d){this.ordersVisible=new WatchedValue("1"==TVSettings.getValue("studyStrategy.ordersVisible","1"));this.ordersVisible.subscribe(function(a){TVSettings.setValue("studyStrategy.ordersVisible",a?"1":"0")});this.ordersLabelsVisible=new WatchedValue("1"==TVSettings.getValue("studyStrategy.ordersLabelsVisible","1"));this.ordersLabelsVisible.subscribe(function(a){TVSettings.setValue("studyStrategy.ordersLabelsVisible",a?"1":"0")});this.ordersQtyVisible=new WatchedValue("1"==
|
|
TVSettings.getValue("studyStrategy.ordersQtyVisible","1"));this.ordersQtyVisible.subscribe(function(a){TVSettings.setValue("studyStrategy.ordersQtyVisible",a?"1":"0")});TradingView.Study.call(this,a,b,c,d);this.watchedData=new WatchedValue;this._reportData={};var e=this,f;this._handler=function(a){e.onData(a);if(a.method&&"data_update"==a.method){var b=a.params&&a.params.nonseries&&a.params.nonseries.d&&a.params.nonseries.d.data&&a.params.nonseries.d.data.report;b?f=e._reportData=$.extend(f||{},b):
|
|
(a=$.extend({},a),$.extend(!0,a,{params:{nonseries:{d:{data:{report:f}}}}}))}e.watchedData.setValue(a)}};inherit(TradingView.StudyStrategy,TradingView.Study);TradingView.StudyStrategy.prototype.stop=function(){TradingView.Study.prototype.stop.call(this);var a=this.model(),b=a.strategySources.indexOf(this);~b&&(a.strategySources.splice(b,1),a.strategySources.change.fire())};TradingView.StudyStrategy.prototype.reportData=function(){return this._reportData};
|
|
TradingView.StudyStrategy.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders};TradingView.StudyStrategy.prototype.updateAllViews=function(){TradingView.Study.prototype.updateAllViews.call(this);this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()};TradingView.StudyStrategy.prototype.createViews=function(){TradingView.Study.prototype.createViews.call(this);this._strategyOrdersPaneView=new TradingView.StudyStrategyOrdersPaneView(this,this._series,this.D0)};TradingView.LocationToYMixin=function(){};
|
|
TradingView.LocationToYMixin.prototype._locationToY=function(a,b,c){c||(c=0);var d=[],e=this.D1.priceScale(),f;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:f=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:f=TradingView.LOW_PLOT}var g=this.D1.firstValue();1<=c&&--c;for(var h=-c;h<=c;h++){var k=this.D1.series().bars().valueAt(b+h);k&&(k=k[f],e.isPercent()&&(k=e.priceRange().convertToPercent(k,g)),d.push(e.priceToCoordinate(k)))}switch(a){case CanvasEx.MARKLOC_ABOVEBAR:return MathEx.min(d)-15;
|
|
case CanvasEx.MARKLOC_BELOWBAR:return MathEx.max(d)+15}};R33=function(a,b,c,d){this.m_study=a;this.m_series=b;this.m_model=c;this._plotName=d;this.m_items=new List;this._invalidated=!0;a=this.m_study.metaInfo().plots;this._paletterProps=this._palette=this._colorer=null;for(b=this._plotIndex=0;b<a.length;b++)a[b].id===this._plotName&&(this._plotIndex=b),this.m_study.isSelfColorerPlot(b)&&a[b].target===this._plotName&&(this._colorer=b,this._palette=this.m_study.metaInfo().palettes[a[b].palette],this._paletterProps=this.m_study.properties().palettes[a[b].palette])};
|
|
R33.isIndexValid=function(a,b){return 0<=a&&a<b._length()};R33.prototype.items=function(){return this.m_items};R33.prototype.update=function(){this._invalidated=!0};
|
|
R33.prototype._updateImpl=function(){this.m_items.clear();this._histogramBase=null;if(!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()){var a=this.m_model.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.m_series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT),a=this.m_study.offset(this._plotName);0<a?(b-=a,c+=a):(b+=a,c-=a);var d=this.m_study.properties().styles[this._plotName].plottype.value(),
|
|
e=0<=[TradingView.StudyConsts.PLOT_LINE,TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_CIRCLES,TradingView.StudyConsts.PLOT_CROSS].indexOf(d),f=this.m_study.data(),d=this.m_study.firstValue();if(e&&0<f._length()){for(var g=f._bsearch(b);R33.isIndexValid(g,f)&&void 0===f._valueAt(g)[this._plotIndex+1];)--g;b=R33.isIndexValid(g,f)?f._indexAt(g):b;for(g=f._bsearch(c);R33.isIndexValid(g,f)&&void 0===f._valueAt(g)[this._plotIndex+
|
|
1];)g+=1;c=R33.isIndexValid(g,f)?f._indexAt(g):c}for(var h=f.range(b,c),g=this.m_study.priceScale(),k=g.properties().percentage.value(),f=this._getTranspValue(),l={},m=function(a,b){var c=a+"@"+b;l[c]||(l[c]=TradingView.generateColor(a,b));return l[c]},n=h._start;n<h._end;++n){var p=h._indexAt(n),p=p+a,p=Math.floor(p),r=h._valueAt(n),t=r[this._plotIndex+1],v=void 0===t||null===t,t=v?NaN:t;k&&!v&&(t=100*(t-d)/d);if(!e||!v){p=new MathEx.Point(p,t);t=void 0!==r[this._colorer+1]||
|
|
this._palette&&this._palette.addDefaultColor;if(this._colorer&&t){t=r[this._colorer+1];p.style={};var r=this.m_study.properties().styles[this._plotName],w,u;void 0!==t&&null!==t?(w=this._palette.valToIndex?this._palette.valToIndex[t]:t,u=this._paletterProps.colors[w],t=u.color.value(),p.style.color=m(t,f)):(t=r.color.value(),p.style.color=m(t,100));t=void 0!==w?u.width.value():r.linewidth.value();r=void 0!==w?u.style.value():r.linestyle.value();p.style.width=t;p.style.style=r}this.m_items.append(p)}}g.pricesToCoordinates(this.m_items);
|
|
this.m_model.timeScale().indexesToCoordinates(this.m_items);this.m_study.properties().styles[this._plotName].histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(this.m_study.properties().styles[this._plotName].histogramBase.value()));if(this.m_study===this.m_model.selectedSource())for(b=TradingView.selectionIndexes(b,c),this._selectionData={points:[]},this._selectionData.hittestResult=TradingView.HitTestResult.REGULAR,n=0;n<b.length;n++)p=b[n],r=this.m_study.data().valueAt(p),
|
|
p+=a,void 0!==r&&(t=r[this._plotIndex+1],g.properties().percentage.value()&&(t=100*(t-d)/d),w=this.m_model.timeScale().indexToCoordinate(Math.floor(p)),u=this.m_study.priceScale().priceToCoordinate(t),this._selectionData.points.push(new MathEx.Point(w,u)));a=this.m_study.properties().styles[this._plotName];this._lineColor=TradingView.generateColor(a.color.value(),f);this._lineWidth=a.linewidth.value();a=a.color.value();this._colorer&&(a=this._paletterProps.colors[0].color.value(),this._lineWidth=
|
|
this._paletterProps.colors[0].width.value(),this._lineColor=TradingView.generateColor(this._paletterProps.colors[0].color.value(),f));this._color2=TradingView.generateColor(a,f);this._color1=TradingView.generateColor(this.addHueForColor(a),f)}}};R33.prototype.addHueForColor=TradingView.memoize(function(a){a=new TradingView.RGBColor(a);var b=TradingView.rgbToHsl(a.r,a.g,a.b),c=b[0]+.05;b[0]=c-Math.floor(c);b=TradingView.hslToRgb(b[0],b[1],b[2]);a.r=b[0];a.g=b[1];a.b=b[2];return a.toHex()});
|
|
R33.prototype._getTranspValue=function(){var a=0;this.m_study.properties().transparency&&(a=this.m_study.properties().transparency.value(),a=isNumber(a)?a:50);var b=this.m_study.properties().styles[this._plotName],c=b.plottype.value();if("Volume@tv-basicstudies"===this.m_study.metaInfo().id&&c===TradingView.StudyConsts.PLOT_COLUMNS)return a;0<=[TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS,TradingView.StudyConsts.PLOT_COLUMNS].indexOf(c)&&b.transparency&&
|
|
(a=b.transparency.value(),a=isNumber(a)?a:50);return a};
|
|
R33.prototype.renderer=function(){var a=this.m_study.properties().styles[this._plotName];if(a.visible.value()&&this.m_study.priceScale()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var b={};this._getTranspValue();a.color.value();b.barSpacing=this.m_model.timeScale().barSpacing();b.items=this.m_items;b.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height();b.lineIndex=0;b.lineStyle=a.linestyle.value();b.lineColor=this._lineColor;
|
|
b.lineWidth=this._lineWidth;b.lineWidth=isNumber(b.lineWidth)?b.lineWidth:1;b.color1=this._color1;b.color2=this._color2;b.bottom=b.histogramBase;this._colorer||(b.simpleMode=!0);var c=new TradingView.CompositeRenderer,d=a.joinPoints?a.joinPoints.value():!1;switch(a.plottype.value()){case TradingView.StudyConsts.PLOT_LINE:case TradingView.StudyConsts.PLOT_LINE_WITH_BREAKS:c.append(new R68(b));break;case TradingView.StudyConsts.PLOT_AREA:case TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS:c.append(new R53(b));
|
|
break;case TradingView.StudyConsts.PLOT_HISTOGRAM:c.append(new R66(b));break;case TradingView.StudyConsts.PLOT_COLUMNS:c.append(new R60(b));break;case TradingView.StudyConsts.PLOT_CROSS:c.append(new R61(b));d&&(a=TradingView.merge({},b),a.lineWidth=1,a.forceLineWidth=!0,c.append(new R68(a)));break;case TradingView.StudyConsts.PLOT_CIRCLES:c.append(new R58(b));d&&
|
|
(a=TradingView.merge({},b),a.lineWidth=1,a.ignorePaletteLineWidth=!0,c.append(new R68(a)));break;default:c.append(new R68(b))}this.m_study===this.m_model.selectedSource()&&c.append(new TradingView.SelectionRenderer(this._selectionData));return c}};
|
|
R30=function(a,b,c,d){this.D1=a;this._series=b;this.D0=c;this._plotName=d;this._items=new List;this._invalidated=!0;a=this.D1.metaInfo().plots;for(b=0;b<a.length;b++)a[b].id===this._plotName&&(this._plotIndex=b,assert(this.D1.isBgColorerPlot(b),"Plot '"+this._plotName+"' is not a background colorer!"))};R30.prototype.items=function(){return this._items};
|
|
R30.prototype.update=function(){this._invalidated=!0};R30.prototype._scalesReady=function(){var a=this.D0.timeScale(),b=this.D1.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
|
|
R30.prototype._updateImpl=function(){this._items.clear();assert(this._scalesReady(),"Scales must be ready!");var a=this.D0.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.D1.metaInfo().plots[this._plotIndex].palette,c=this.D1.properties().palettes[b].colors,b=this.D1.metaInfo().palettes[b],d=this.D1.properties().styles[this._plotName].transparency.value(),e=this._series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),f=
|
|
this._series.nearestIndex(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT),a=this.D1.offset(this._plotName);0<a?(e-=a,f+=a):(e+=a,f-=a);e=this.D1.data().range(e,f);for(f=e._start;f<e._end;++f){var g=e._indexAt(f),g=g+a,h=e._valueAt(f)[this._plotIndex+1],g=new MathEx.Point(Math.floor(g)-.5),k=isNumber(d)?d:50,k=Math.min(k,100),k=Math.max(k,0);g.color=void 0!==h&&null!==h?TradingView.generateColor(c[b.valToIndex?b.valToIndex[h]:h].color.value(),k):null;this._items.append(g)}this.D0.timeScale().indexesToCoordinates(this._items)}};
|
|
R30.prototype.renderer=function(){if(this.D1.properties().styles[this._plotName].visible&&this.D1.properties().styles[this._plotName].visible.value()&&this._scalesReady()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={items:this._items,y:0,h:this.D1.priceScale().height(),w:Math.ceil(this.D0.timeScale().barSpacing())},b=new TradingView.CompositeRenderer;b.append(new R55(a));return b}};
|
|
TradingView.StudyPlotShapesPaneViewBase=function(a,b,c,d){this.m_study=a;this.m_series=b;this.m_model=c;this.m_plotName=d;this.m_items=new List;this.m_invalidated=!0;this.m_plotIndex=null;a=this.m_study.metaInfo().plots;for(b=0;b<a.length;b++)if(a[b].id===this.m_plotName){this.m_plotIndex=b;break}a=this.m_study.metaInfo().plots;this._textPaletterProps=this._paletterProps=this._textPalette=this._palette=this._textColorer=this._colorer=null;for(b=this._plotIndex=0;b<a.length;b++)a[b].id===this.m_plotName&&
|
|
(this._plotIndex=b),this.m_study.isSelfColorerPlot(b)&&a[b].target===this.m_plotName&&(this._colorer=b,this._palette=this.m_study.metaInfo().palettes[a[b].palette],this._paletterProps=this.m_study.properties().palettes[a[b].palette]),this.m_study.isTextColorerPlot(b)&&a[b].target===this.m_plotName&&(this._textColorer=b,this._textPalette=this.m_study.metaInfo().palettes[a[b].palette],this._textPaletterProps=this.m_study.properties().palettes[a[b].palette])};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype.items=function(){return this.m_items};TradingView.StudyPlotShapesPaneViewBase.prototype.update=function(){this.m_invalidated=!0};TradingView.StudyPlotShapesPaneViewBase.prototype._scalesReady=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype._updateImpl=function(){this.m_items.clear();if(this._scalesReady()){var a=this.m_model.timeScale(),b=this.m_study.priceScale(),a=a.visibleBars().clone();if(!a.isEmpty()){var c=this.m_series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT),a=this.m_study.offset(this.m_plotName);0<a?(c-=a,d+=a):(c+=a,d-=a);var e=this.m_study.data(),f=this.m_study.firstValue(),e=e.range(c,
|
|
d),g=b.properties().percentage.value();b.priceRange();var h=this._getTranspValue(),c=TradingView.selectionIndexes(c,d);if(d=this.m_study===this.m_model.selectedSource())this.m_selectionData={points:[],hittestResult:TradingView.HitTestResult.REGULAR,vertOffset:0};var k=this.m_series.properties().style.value(),k=k===TradingView.Series.STYLE_LINE?"lineStyle":k===TradingView.Series.STYLE_AREA?"areaStyle":null,l;k?l=k=this.m_series.properties()[k].priceSource.value():(k="high",l="low");this._topCoord=
|
|
b.coordinateToPrice(b.height()*b.topMargin());this._bottomCoord=b.coordinateToPrice(b.height()*(1-b.bottomMargin()));for(b=e._start;b<e._end;++b){var m=e._indexAt(b),n=Math.floor(m+a),p=e._valueAt(b),r=p[this.m_plotIndex+1];if(null!==r&&void 0!==r){g&&(r=100*(r-f)/f);var t=this._createItem(n,r,k,l);void 0!==t&&null!==t&&(r=void 0!==p[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&r&&(r=p[this._colorer+1],t.style={},void 0!==r&&null!==r?(r=this._palette.valToIndex?this._palette.valToIndex[r]:
|
|
r,r=this._paletterProps.colors[r].color.value(),t.style.color=TradingView.generateColor(r,h)):(r=this.m_study.properties().styles[this.m_plotName].color.value(),t.style.color=TradingView.generateColor(r,100)),t.style.borderColor=TradingView.generateColor(r,9<h?h-10:0)),r=void 0!==p[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&r&&(r=p[this._textColorer+1],t.style||(t.style={}),void 0!==r&&null!==r?(r=this._textPalette.valToIndex?this._textPalette.valToIndex[r]:
|
|
r,r=this._textPaletterProps.colors[r].color.value(),t.style.textColor=TradingView.generateColor(r,h)):(r=this.m_study.properties().styles[this.m_plotName].textColor.value(),t.style.textColor=TradingView.generateColor(r,100))),this.m_model.timeScale().indexToCoordinate(Math.floor(n)),this.m_study.priceScale().priceToCoordinate(p),d&&-1!==c.indexOf(m)&&this.m_selectionData.points.push(t),this.m_items.append(t))}}this._convertItemsToCoordinates()}}};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype._getSeriesVal=function(a,b){var c;try{c=this.m_series[a||"close"](b)}catch(d){c=null}return c};TradingView.StudyPlotShapesPaneViewBase.prototype._getTranspValue=function(){var a=0;this.m_study.properties().transparency&&(a=this.m_study.properties().transparency.value(),a=isNumber(a)?a:50);var b=this.m_study.properties().styles[this.m_plotName];b.transparency&&(a=b.transparency.value(),a=isNumber(a)?a:50);return a};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype._createItem=function(a,b,c,d){var e=this.m_study.properties().styles[this.m_plotName].location.value();if(!b&&e!=CanvasEx.MARKLOC_ABSOLUTE)return null;switch(e){case CanvasEx.MARKLOC_ABOVEBAR:b=this._getSeriesVal(c,a);if(void 0===b||null==b)return null;break;case CanvasEx.MARKLOC_BELOWBAR:b=this._getSeriesVal(d,a);if(void 0===b||null==b)return null;break;case CanvasEx.MARKLOC_TOP:b=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:b=this._bottomCoord;
|
|
break;case CanvasEx.MARKLOC_ABSOLUTE:break;default:throw Error("Bad value: "+e);}return new MathEx.Point(a,b)};TradingView.StudyPlotShapesPaneViewBase.prototype._convertItemsToCoordinates=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();a.indexesToCoordinates(this.m_items);b.pricesToCoordinatesEx(this.m_items.toArray(),function(a){return a.y},function(a,b){a.y=b})};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype._calculateVerticalOffset=function(a,b){var c;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:c=-b;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:c=b;break;case CanvasEx.MARKLOC_ABSOLUTE:c=0;break;default:c=0}return c};TradingView.StudyPlotShapesPaneViewBase.prototype._calculateShapeHeight=function(a){return Math.round(a/2)};
|
|
TradingView.StudyPlotShapesPaneViewBase.prototype.renderer=function(){if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady()){var a=this.m_model.timeScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var b={},c=this._getTranspValue(),d=a.barSpacing(),e=this._calculateShapeHeight(d),a=this.m_study.properties().styles[this.m_plotName].location.value(),a=this._calculateVerticalOffset(a,e+
|
|
e/2);b.barSpacing=d;b.items=this.m_items;b.color=TradingView.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),c);b.height=e;b.vertOffset=a;d=this.m_study.properties().styles[this.m_plotName].plottype.value();c=TradingView.StudyPlotShapes.Data[d];void 0===c&&console.error("Unknown style "+d);d=new TradingView.CompositeRenderer;d.append(new TradingView[c.paneRendererClass](b));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=a,d.append(new TradingView.SelectionRenderer(this.m_selectionData)));
|
|
return d}};R36=function(a,b,c,d){TradingView.StudyPlotShapesPaneViewBase.call(this,a,b,c,d)};inherit(R36,TradingView.StudyPlotShapesPaneViewBase);
|
|
R36.prototype.renderer=function(){var a=this.m_study.properties().styles[this.m_plotName];if(a.visible&&a.visible.value()&&this._scalesReady()){var b=this.m_model.timeScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var c={},d=this._getTranspValue(),e=b.barSpacing(),f=this._calculateShapeHeight(e),g=a.location.value(),b=TradingView.generateColor(a.color.value(),d),h=19<d?d-10:0,g=this._calculateVerticalOffset(g,Math.round(1.5*f));c.barSpacing=
|
|
e;c.items=this.items();c.color=b;c.borderColor=TradingView.generateColor(a.color.value(),h);c.height=f;c.vertOffset=g;f=a.plottype.value();e=TradingView.StudyPlotShapes.Data[f];void 0===e&&console.error("Unknown style "+f);f=new TradingView.CompositeRenderer;h=a.text?a.text.value():void 0;void 0!==h&&""!==h.trim()&&(h=h.trim().replace(/\\n/gm,"\n"),c.textCache=new TradingView.TextImageCache(h,!1,!1,"Arial",12),a=a.textColor?a.textColor.value():void 0,c.textColor=a?TradingView.generateColor(a,d):b);
|
|
f.append(new TradingView[e.paneRendererClass](c));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=g,f.append(new TradingView.SelectionRenderer(this.m_selectionData)));return f}};R35=function(a,b,c,d){R36.call(this,a,b,c,d)};inherit(R35,R36);R35.prototype._calculateShapeHeight=function(a){return Math.round(a)};
|
|
R35.prototype.renderer=function(){var a=this.m_study.properties().styles[this.m_plotName];if(a.visible&&a.visible.value()&&this._scalesReady()){var b=this.m_model.timeScale();this.m_study.priceScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var c={},d=this._getTranspValue(),b=b.barSpacing(),e=this._calculateShapeHeight(b),f=a.location.value(),b=TradingView.generateColor(a.color.value(),d),f=this._calculateVerticalOffset(f,e);c.items=this.items();
|
|
c["char"]=a["char"].value();c.height=e;c.vertOffset=f;c.color=b;var e=new TradingView.CompositeRenderer,g=a.text?a.text.value():void 0;void 0!==g&&""!==g.trim()&&(g=g.trim().replace(/\\n/gm,"\n"),c.textCache=new TradingView.TextImageCache(g,!1,!1,"Arial",12),a=a.textColor?a.textColor.value():void 0,c.textColor=a?TradingView.generateColor(a,d):b);e.append(new R73(c));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=f,e.append(new TradingView.SelectionRenderer(this.m_selectionData)));
|
|
return e}};R34=function(a,b,c,d){TradingView.StudyPlotShapesPaneViewBase.call(this,a,b,c,d);this._maxAbsValue=0};inherit(R34,TradingView.StudyPlotShapesPaneViewBase);
|
|
R34.prototype.renderer=function(){if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady()){this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var a={},b=this._getTranspValue(),c=this.m_model.timeScale().barSpacing();a.items=this.m_items;a.barSpacing=c;a.colorup=TradingView.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),b);a.colordown=
|
|
TradingView.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),b);a.colorBorder=TradingView.generateColor("#000000",b);a.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value();a.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value();b=new TradingView.CompositeRenderer;b.append(new R54(a));this.m_study===this.m_model.selectedSource()&&(a=this.m_selectionData,a.barSpacing=c,b.append(new TradingView.SelectionRendererArrowsUpDown(a)));
|
|
return b}};R34.prototype._createItem=function(a,b,c,d){if(0!==b){Math.abs(b)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(b));var e=0<b;c=e?this._getSeriesVal(d,a):this._getSeriesVal(c,a);return void 0===c||null==c?null:new TradingView.PaneRendererArrowsUpDownItem(a,c,b,e)}};
|
|
R34.prototype._convertItemsToCoordinates=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();a.indexesToCoordinates(this.m_items);b.pricesToCoordinatesEx(this.m_items.toArray(),function(a){return a.y},function(a,b){a.y=b});a=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value());b=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value());if(a>b)var c=a,a=b,b=c;for(var b=(b-a)/this._maxAbsValue,c=this.m_items.toArray(),
|
|
d=0;d<c.length;d++){var e=c[d],f=Math.abs(e.height);e.height=f*b+a}};
|
|
TradingView.StudyPlotBarCandlesPaneView=function(a,b,c,d){this.m_study=a;this.m_series=b;this.m_model=c;this.m_plotName=d;this.m_bars=new List;this._invalidated=!0;a=this.m_study.metaInfo().plots;this._paletterProps=this._palette=this._colorer=null;this._ohlcPlotIndexes={};for(b=0;b<a.length;b++)a[b].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(b)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=b),this.m_study.isOHLCHighPlot(b)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=b),this.m_study.isOHLCLowPlot(b)&&
|
|
(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=b),this.m_study.isOHLCClosePlot(b)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=b),this.m_study.isOHLCColorerPlot(b)&&(this._colorer=b,this._palette=this.m_study.metaInfo().palettes[a[b].palette],this._paletterProps=this.m_study.properties().palettes[a[b].palette]))};TradingView.StudyPlotBarCandlesPaneView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.StudyPlotBarCandlesPaneView.prototype._updateImpl=function(){this.m_bars.clear();if(!this.m_model.timeScale().isEmpty()&&!this.m_study.priceScale().isEmpty()){var a=this.m_model.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.m_series.nearestIndex(a.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),TradingView.SEARCH_NEAREST_LEFT),d=this.m_study.data(),a=this.m_study.firstValue(),e=d.range(b,c),d=this.m_study.priceScale(),f=d.properties().percentage.value(),
|
|
g=this.m_study.properties().ohlcPlots[this.m_plotName];g.wickColor&&g.wickColor.value();for(var h={},k=function(a,b){var c=a+"@"+b;h[c]||(h[c]=TradingView.generateColor(a,b));return h[c]},l=e._start;l<e._end;++l){for(var m=e._indexAt(l),m=Math.floor(m),n=e._valueAt(l),p=!0,r={},t=TradingView.OPEN_PLOT;t<=TradingView.CLOSE_PLOT;++t){var v=n[this._ohlcPlotIndexes[t]+1];if(void 0===v||null===v){p=!1;break}r[t]=v}if(p){var v=r[TradingView.OPEN_PLOT],p=r[TradingView.CLOSE_PLOT],t=Math.max(v,r[TradingView.HIGH_PLOT],
|
|
r[TradingView.LOW_PLOT],p),w=Math.min(v,r[TradingView.HIGH_PLOT],r[TradingView.LOW_PLOT],p),r={};r.time=Math.round(m);f?(r.open=100*(v-a)/a,r.high=100*(t-a)/a,r.low=100*(w-a)/a,r.close=100*(p-a)/a):(r.open=v,r.high=t,r.low=w,r.close=p);m=g.color.value();v=void 0!==n[this._colorer+1]||this._palette&&this._palette.addDefaultColor;this._colorer&&v&&(v=n[this._colorer+1],void 0!==v&&null!==v&&(m=this._paletterProps.colors[this._palette.valToIndex?this._palette.valToIndex[v]:v].color.value()));r.color=
|
|
k(m,0);n=new TradingView.RGBColor(m);m=TradingView.rgbToHsl(n.r,n.g,n.b);m=TradingView.hslToRgb(m[0],m[1],.25<m[2]?m[2]-.26:m[2]+.75);n.r=m[0];n.g=m[1];n.b=m[2];r.borderColor=k(n.toHex(),0);r.hollow=null;this.m_bars.append(r)}}d.barPricesToCoordinates(this.m_bars);this.m_model.timeScale().barIndexesToCoordinates(this.m_bars);if(this.m_study===this.m_model.selectedSource())for(b=TradingView.selectionIndexes(b,c),this._selectionData={points:new List},this._selectionData.hittestResult=TradingView.HitTestResult.REGULAR,
|
|
l=0;l<b.length;l++)m=b[l],n=this.m_study.data().valueAt(m),void 0!==n&&(v=n[this._plotIndex+1],d.properties().percentage.value()&&(v=100*(v-a)/a),c=this.m_model.timeScale().indexToCoordinate(Math.floor(m)),e=this.m_study.priceScale().priceToCoordinate(v),this._selectionData.points.append(new MathEx.Point(c,e)))}}};TradingView.StudyPlotBarCandlesPaneView.prototype.items=function(){return this.m_bars};
|
|
TradingView.StudyPlotBarsPaneView=function(a,b,c,d){TradingView.StudyPlotBarCandlesPaneView.call(this,a,b,c,d)};inherit(TradingView.StudyPlotBarsPaneView,TradingView.StudyPlotBarCandlesPaneView);
|
|
TradingView.StudyPlotBarsPaneView.prototype.renderer=function(){if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.bars=this.m_bars;a.barSpacing=this.m_model.timeScale().barSpacing();a.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value();var b=new TradingView.CompositeRenderer;b.append(new R56(a));this.m_series===this.m_model.selectedSource()&&b.append(new TradingView.SelectionRenderer(this._selectionData));
|
|
return b}};TradingView.StudyPlotCandlesPaneView=function(a,b,c,d){TradingView.StudyPlotBarCandlesPaneView.call(this,a,b,c,d)};inherit(TradingView.StudyPlotCandlesPaneView,TradingView.StudyPlotBarCandlesPaneView);
|
|
TradingView.StudyPlotCandlesPaneView.prototype.renderer=function(){var a=this.m_study.properties().ohlcPlots[this.m_plotName];if(a.visible.value()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var b={};b.bars=this.m_bars;b.barSpacing=this.m_model.timeScale().barSpacing();b.drawWick=a.drawWick.value();b.drawBorder=a.drawBorder.value();a=a.wickColor.value();b.borderColor=a;b.wickColor=a;a=new TradingView.CompositeRenderer;a.append(new R57(b));this.m_series===
|
|
this.m_model.selectedSource()&&a.append(new TradingView.SelectionRenderer(this._selectionData));return a}};TradingView.StudyStrategyOrdersPaneView=function(a,b,c){this.D1=a;this._series=b;this.D0=c;this._invalidated=!0;this._orderArrow={vMargin:TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_VMARGIN,width:TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_WIDTH,height:TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_HEIGHT};this._exitLineWidth=TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH;this._priceArrow={width:TradingView.StudyStrategyOrdersPaneView.DEFAULT_PRICE_ARROW_WIDTH,
|
|
height:TradingView.StudyStrategyOrdersPaneView.DEFAULT_PRICE_ARROW_HEIGHT};this._text={vMargin:TradingView.StudyStrategyOrdersPaneView.DEFAULT_TEXT_VMARGIN,font:TradingView.StudyStrategyOrdersPaneView.DEFAULT_FONT,fontSize:TradingView.StudyStrategyOrdersPaneView.DEFAULT_FONT_SIZE};this._checkHideTextIfBarSpacingLT=TradingView.StudyStrategyOrdersPaneView.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT;this._textIsVisible=!0;this._colors={entryBuy:TradingView.StudyStrategyOrdersPaneView.DEFAULT_ENTRY_BUY_COLOR,
|
|
entrySell:TradingView.StudyStrategyOrdersPaneView.DEFAULT_ENTRY_SELL_COLOR,exit:TradingView.StudyStrategyOrdersPaneView.DEFAULT_EXIT_COLOR};this._items={entryBuy:[],entrySell:[],exit:[]};this._textWidths={};this.D1.ordersVisible.subscribe(this.update.bind(this));this.D1.ordersLabelsVisible.subscribe(this.update.bind(this));this.D1.ordersQtyVisible.subscribe(this.update.bind(this))};TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_VMARGIN=7;
|
|
TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_WIDTH=9;TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_HEIGHT=11;TradingView.StudyStrategyOrdersPaneView.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH=2;TradingView.StudyStrategyOrdersPaneView.DEFAULT_PRICE_ARROW_WIDTH=5;TradingView.StudyStrategyOrdersPaneView.DEFAULT_PRICE_ARROW_HEIGHT=9;TradingView.StudyStrategyOrdersPaneView.DEFAULT_TEXT_VMARGIN=2;TradingView.StudyStrategyOrdersPaneView.DEFAULT_FONT="Arial";
|
|
TradingView.StudyStrategyOrdersPaneView.DEFAULT_FONT_SIZE=10;TradingView.StudyStrategyOrdersPaneView.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT=10;TradingView.StudyStrategyOrdersPaneView.DEFAULT_ENTRY_BUY_COLOR="#008fff";TradingView.StudyStrategyOrdersPaneView.DEFAULT_ENTRY_SELL_COLOR="#f00";TradingView.StudyStrategyOrdersPaneView.DEFAULT_EXIT_COLOR="#cc47ed";
|
|
TradingView.StudyStrategyOrdersPaneView.prototype._updateImpl=function(){this._items.entryBuy.length=this._items.entrySell.length=this._items.exit.length=0;var a=this.D1.ordersData();if(a&&a.length){var b=this.D0.timeScale(),c=this._series.priceScale();if(!(!b||!c||b&&b.isEmpty()||c&&c.isEmpty())){var d=b.visibleBars().clone();if(!d.isEmpty()){for(var e=this._series.nearestIndex(d.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),f=this._series.nearestIndex(d.lastBar(),TradingView.SEARCH_NEAREST_LEFT),
|
|
g=b.points(),h=0,d=[],k=[],l,m;h<a.length;h++)l=a[h],m=g.indexOf(Math.floor(l.time/1E3)),"number"==typeof m&&m>=e&&m<=f&&(d.push(l),k.push(m));a=this.D1.ordersLabelsVisible.value();e=this.D1.ordersQtyVisible.value();(f=a||e)&&b.barSpacing()<this._checkHideTextIfBarSpacingLT&&this._orderArrow.width*d.length*2>b.width()&&(f=!1);for(var g=(l=f&&this._text.fontSize+this._text.vMargin||0)&&l*(a+e),h=0,n={upper:[],lower:[]},p,r,t,v;h<d.length;h++)l=d[h],m=k[h],p=b.indexToCoordinate(m,!0),r=c.priceToCoordinate(this._series[l.isBuy?
|
|
"low":"high"](m),!0),t=l.isBuy?"lower":"upper",v="number"==typeof n[t][m]&&n[t][m]||0,r+=l.isBuy?v:-v,"number"!=typeof n[t][m]&&(n[t][m]=0),n[t][m]+=(l.isEntry?0:this._exitLineWidth)+this._orderArrow.vMargin+this._orderArrow.height+g,m=c.priceToCoordinate(l.price,!0),v=l.isEntry?!l.isBuy&&l.isEntry?"entrySell":"entryBuy":"exit",this._items[v].push({orderPoint:new MathEx.Point(p,r),pricePoint:new MathEx.Point(p,m),label:a&&(l.commentary||l.id||"Untitled")||null,qty:e&&(l.isBuy?"+":"-")+~~l.qty||null,
|
|
pos:t});this._textLabelIsVisible=a;this._textQtyIsVisible=e;this._textIsVisible=f}}}};TradingView.StudyStrategyOrdersPaneView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.StudyStrategyOrdersPaneView.prototype.renderer=function(){if(this.D1.ordersVisible.value()){var a=this._series.priceScale();if(this._invalidated||a&&a.isScaled())this._updateImpl(),this._invalidated=!1;var a=new TradingView.CompositeRenderer,b;for(b in this._items)a.append(new TradingView.PaneRendererStudyStrategyOrders({items:this._items[b],color:this._colors[b],orderArrow:this._orderArrow,exitLineWidth:"exit"==b&&this._exitLineWidth||0,priceArrow:this._priceArrow,text:this._textIsVisible&&
|
|
this._text||null},this._textWidths));return a}};R51=function(a,b,c){this.D1=a;this.D0=b;this._plotIndex=c;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invalidated=!0;this._cache=new TradingView.TextWidthCache};inherit(R51,PriceAxisView);R51.prototype.update=function(){this._invalidated=!0};
|
|
R51.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.D1.lastValueData(this._plotIndex);a&&(this._visible=!0,this._text=a.text,this._coordinate=a.coordinate,this._floatCoordinate=a.floatCoordinate,this._background!=a.color&&(this._background=a.color,this._color=this.color()),this._textHeight=this.D1.priceScale().m_markBuilder.fontHeight())};
|
|
R51.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};R51.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return new TradingView.PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:this._visible},this._cache)};
|
|
R51.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};TradingView.StudyDataWindowView=function(a,b){TradingView.DataWindowView.call(this);this.D1=a;this.D0=b;var c=a.metaInfo().plots;if(c){for(var d=0;d<c.length;++d)if(!(this.D1.isSelfColorerPlot(d)||this.D1.isBarColorerPlot(d)||this.D1.isBgColorerPlot(d)||this.D1.isDataOffsetPlot(d)||this.D1.isOHLCColorerPlot(d))){var e=c[d].id,f;if("Compare@tv-basicstudies"===this.D1.metaInfo().id)f=new TradingView.DataWindowItem(this.D1.inputsForGUI()[1],"");else{f=this.D1.title();
|
|
try{f=this.D1.properties().styles[e].title.value()}catch(g){}f=new TradingView.DataWindowItem(f,"")}f.plotId=e;f.plotIndex=d;this._items.append(f)}this.update();this._invalidated=!0}};inherit(TradingView.StudyDataWindowView,TradingView.DataWindowView);TradingView.StudyDataWindowView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.StudyDataWindowView.prototype._updateImpl=function(){this._header=this.D1.title(!0);this._title=this.D1.title();for(var a=$.t("n/a"),b=0;b<this._items.size();++b)this._items.item(b).setValue(a);if(!this.D0.timeScale().isEmpty()){var a=this.D1.metaInfo().plots,c=null,d={};if(a)for(b=0;b<a.length;b++)if(this.D1.isSelfColorerPlot(b)||this.D1.isOHLCColorerPlot(b))d[a[b].target]={index:b},d[a[b].target].palette=this.D1.metaInfo().palettes[a[b].palette],d[a[b].target].paletterProps=
|
|
this.D1.properties().palettes[a[b].palette];for(var e=this.D0.crossHairSource().appliedIndex(),f=this.D1.formatter(),b=0;b<this._items.size();++b){var c=this._items.item(b),g=c.plotId,h=c.plotIndex,k=this.D1.offset(g),k=this.D1.nearestIndex(e-k,TradingView.SEARCH_NEAREST_LEFT);if(void 0!==k&&(k=this.D1.data().valueAt(k)||this.D1.data().last())){var l=k[h+1];isNumber(l)&&(c.setValue(f.format(l)),c=this.D1.properties().styles[g].color.value(),this.D1.isOHLCSeriesPlot(h)&&
|
|
(g=a[h].target,c=this.D1.properties().ohlcPlots[g].color.value()),d[g]&&k.length>d[g].index+1?(h=k[d[g].index+1],void 0!==h&&null!==h?(c=d[g].palette,g=d[g].paletterProps,h=c.valToIndex?c.valToIndex[h]:h,this._items.item(b).setColor(g.colors[h].color.value())):this._items.item(b).setColor(c)):this._items.item(b).setColor(c))}}}};TradingView.StudyDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};
|
|
TradingView.DataVendorStudyDataWindowView=function(a,b){TradingView.StudyDataWindowView.call(this,a,b)};inherit(TradingView.DataVendorStudyDataWindowView,TradingView.StudyDataWindowView);TradingView.DataVendorStudyDataWindowView.prototype.additional=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._additional};
|
|
TradingView.DataVendorStudyDataWindowView.prototype._updateImpl=function(){var a=TradingView.getDataVendorString(this.D1.symbolInfo());this._additional=a?"(Data Provided by "+a+")":void 0;return TradingView.StudyDataWindowView.prototype._updateImpl.call(this)};TradingView.StudyStatusView=function(a,b){TradingView.StatusView.call(this,b);this.D1=a};inherit(TradingView.StudyStatusView,TradingView.StatusView);TradingView.StudyStatusView.prototype.color=function(){return this.D1._failed||this.D1.metaInfo&&this.D1.metaInfo().isTVScriptStub?"#ff0000":TradingView.StatusView.prototype.color.call(this)};
|
|
TradingView.StudyStatusView.prototype.update=function(){this._text=this.D1._failed?this.D1.title(!0)+": "+this.D1.status():this.D1.title(!0)+" "+this.D1.status()};J90=function(a,b){this.R99=a;this.D0=b;this._points=new List;this._floatPoints=new List};J90.prototype.addAnchors=function(a){if(this.isAnchorsRequired()){var b=this._points.toArray();this.D0.lineBeingCreated()==this.R99&&(b=b.slice(0,-1));a.append(this.createLineAnchor({points:b}))}};
|
|
J90.prototype.update=function(){var a=this.R99.priceScale(),b=this.D0.timeScale();if(a&&!a.isEmpty()&&!b.isEmpty())for(this._points=new List,this._floatPoints=new List,a=this.R99.points(),b=0;b<a.size();b++){var c=a.item(b),d=this.R99.pointToScreenPoint(c);if(!d)break;c=d[0];c.data=b;d=d[1];d.data=b;this._floatPoints.append(c);this._points.append(d)}};
|
|
J90.prototype.currentPoint=function(){var a=this.D0.crossHairSource();return new MathEx.Point(a.x,a.y)};J90.prototype.anchorColor=function(){return this.R99.isBeingEdited()?"#D61AD3":this.D0.isDark()?"#FFFFFF":"#606060"};J90.prototype.isHoveredSource=function(){return this.R99===this.D0.hoveredSource()};J90.prototype.isSelectedSource=function(){return this.R99===this.D0.selectedSource()};
|
|
J90.prototype.isAnchorsRequired=function(){return(this.isHoveredSource()||this.isSelectedSource())&&!this.D0.isSnapshot()};
|
|
J90.prototype.createLineAnchor=function(a){return new TradingView.LineAnchor($.extend({color:this.anchorColor(),backgroundColor:this.D0.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this.D0.linePointBeingEdited(),hittestResult:TradingView.HitTestResult.CHANGEPOINT,radius:(TradingView.isMobile.any()?15:7)+(this.isSelectedSource()?1:0),strokeWidth:(TradingView.isMobile.any()?3:1)+(this.isSelectedSource()?1:0)},a))};TradingView.study_Compare=function(a,b,c,d){this._symbolLabelView=new TradingView.R38(a,this,"compare","symbol","showSymbolLabels");TradingView.Study.call(this,a,b,c,d);var e=this;this.D2.minTick.listeners().subscribe(null,function(){e._createFormatter()});this.properties().minTick.listeners().subscribe(null,function(){e.D0.D20(new A22(A22.FULL_UPDATE))});this.D2.merge({skipHistogramBaseOnAutoScale:!0})};
|
|
inherit(TradingView.study_Compare,TradingView.Study);TradingView.study_Compare.prototype.createPlotLabels=function(a){};TradingView.study_Compare.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new TradingView.DataVendorStudyDataWindowView(this,this.D0));TradingView.Study.prototype.createViews.call(this);this._paneViews.push(this._symbolLabelView)};
|
|
TradingView.study_Compare.prototype._createFormatter=function(){var a=this.properties().inputs.symbol.value(),a=this._resolvedSymbols?this._resolvedSymbols[a]:null;if("default"==this.properties().minTick.value())this._formatter=new TradingView.PriceFormatter(a?a.pricescale:100,a?a.minmov:1,a?a.fractional:!1);else{var a=this.properties().minTick.value(),a=isNumber(a)?["100","1","false"]:a.split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new TradingView.PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&
|
|
this.priceScale().updateFormatter()};TradingView.study_Compare.prototype.symbol=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name:a).toUpperCase()};TradingView.study_Compare.prototype.title=function(a){a=this.properties().inputs.symbol.value();var b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name+", "+b.exchange:a).toUpperCase()};
|
|
TradingView.study_Compare.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var a=this.D2.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};TradingView.study_Compare.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate};TradingView.AreaBackgroundRenderer=function(a){this._data=a};TradingView.AreaBackgroundRenderer.prototype.hitTest=function(a){TradingView.selectionTolerance(this.lineWidth);for(var b,c,d,e=1;e<this._data.points1.length;++e)if(b=this._data.points1[e],c=this._data.points2[e],d=this._data.timePoints[e],d==a.x&&(a.y>=b&&a.y<=c||a.y<=b&&a.y>=c))return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);return null};
|
|
TradingView.AreaBackgroundRenderer.prototype.draw=function(a){if(0!==this._data.points1.length&&0!==this._data.points2.length)for(var b=this._data.timePoints,c=this._data.points1,d=this._data.points2,e=this._data.getBarSpacing()/4,f=TradingView.paneRendererCoordinateIsValid,g=isNumber(this._data.transparency)?this._data.transparency:50,g=Math.min(g,100),g=Math.max(g,0),g=TradingView.generateColor(this._data.backcolor,g),h,k,l,m,n,p,r=0;r<this._data.timePoints.length;r++)if(k=b[r],l=c[r],m=d[r],n=
|
|
c[r+1],p=d[r+1],f(l)&&f(m)&&(h||(h={points1:[],points2:[],timePoints:[]}),h.points1.push(l),h.points2.push(m),h.timePoints.push(k)),h&&(!f(n)||!f(p))){1===h.timePoints.length&&(h.timePoints=[h.timePoints[0]-e,h.timePoints[0]+e],h.points1.push(h.points1[0]),h.points2.push(h.points2[0]));a.beginPath();a.moveTo(h.timePoints[0],h.points1[0]);for(k=1;k<h.timePoints.length;k++)a.lineTo(h.timePoints[k],h.points1[k]);0<h.timePoints.length&&0<h.points2.length&&a.lineTo(h.timePoints[h.timePoints.length-1],
|
|
h.points2[h.timePoints.length-1]);for(k=h.timePoints.length-2;0<=k;k--)a.lineTo(h.timePoints[k],h.points2[k]);a.closePath();a.fillStyle=g;a.fill();h=null}};TradingView.J53=function(a){this.R99=a;this._points1=[];this._points2=[];this._timePoints=[];this._getBarSpacing=a.model().timeScale().barSpacing.bind(a.model().timeScale());this._invalidated=!0};TradingView.J53.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.J53.prototype._updateImpl=function(){this._points1=[];this._points2=[];this._timePoints=[];if(this._visible()){var a=this.R99.priceScale(),b=this.R99.D0.timeScale();if(a&&!a.isEmpty()&&!this.R99.D0.timeScale().isEmpty()&&!this.R99._series.bars().isEmpty()){var c=this.R99.data()._columns.indexOf(this._plotAId())+1,d=this.R99.data()._columns.indexOf(this._plotBId())+1,e=this.R99.D0.timeScale().visibleBars();if(!e.isEmpty()){var f=
|
|
this.R99.offset(this._plotAId()),g=this.R99._series.nearestIndex(e.firstBar(),TradingView.SEARCH_NEAREST_RIGHT),e=this.R99._series.nearestIndex(e.lastBar(),TradingView.SEARCH_NEAREST_LEFT);0<f?(g-=f,e+=f):(g+=f,e-=f);g=this.R99.data().range(g,e);if(0<this.R99.data()._items.length){this.R99.data();for(var e=this.R99.firstValue(),h=g._start;h<g._end;++h){var k=g._indexAt(h),l=g._valueAt(h),k=k+f,m=l[c];a.properties().percentage.value()&&(m=100*(m-e)/e);this._points1.push(m);
|
|
l=l[d];a.properties().percentage.value()&&(l=100*(l-e)/e);this._points2.push(l);this._timePoints.push(b.indexToCoordinate(k))}}a.pricesArrayToCoordinates(this._points1);a.pricesArrayToCoordinates(this._points2)}}}};
|
|
TradingView.J53.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={};a.points1=this._points1;a.points2=this._points2;a.timePoints=this._timePoints;a.getBarSpacing=this._getBarSpacing;a.backcolor=this._color();a.transparency=this._transparency();return new TradingView.AreaBackgroundRenderer(a)};TradingView.J53.prototype._plotAId=function(){assert(!1,"Pure virtual call!")};
|
|
TradingView.J53.prototype._plotBId=function(){assert(!1,"Pure virtual call!")};TradingView.J53.prototype._color=function(){assert(!1,"Pure virtual call!")};TradingView.J53.prototype._transparency=function(){assert(!1,"Pure virtual call!")};TradingView.J53.prototype._visible=function(){assert(!1,"Pure virtual call!")};
|
|
TradingView.J55=function(a){TradingView.J53.call(this,a)};inherit(TradingView.J55,TradingView.J53);TradingView.J55.prototype._plotAId=function(){return this.R99.properties().area[0].name.value()};TradingView.J55.prototype._plotBId=function(){return this.R99.properties().area[1].name.value()};TradingView.J55.prototype._color=function(){return this.R99.properties().areaBackground.backgroundColor.value()};
|
|
TradingView.J55.prototype._transparency=function(){return this.R99.properties().areaBackground.transparency.value()};TradingView.J55.prototype._visible=function(){return this.R99.properties().areaBackground.fillBackground.value()};
|
|
TradingView.R2=function(a,b,c){TradingView.J53.call(this,a);assert(b.type===TradingView.StudyMetaInfo.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+b.type);this._fillMetaInfo=b;this._fillStyleProps=c};inherit(TradingView.R2,TradingView.J53);TradingView.R2.prototype._plotAId=function(){return this._fillMetaInfo.objAId};TradingView.R2.prototype._plotBId=function(){return this._fillMetaInfo.objBId};
|
|
TradingView.R2.prototype._color=function(){return this._fillStyleProps.color.value()};TradingView.R2.prototype._transparency=function(){return this._fillStyleProps.transparency.value()};TradingView.R2.prototype._visible=function(){return this._fillStyleProps.visible.value()};TradingView.J58=function(a,b){this.R99=b;this.D2=a;this._points=new List;this._points.append(new MathEx.Point(-1,-1))};TradingView.J58.prototype.update=function(){var a=this.R99.priceScale();if(!a||a.isEmpty())this._points.setItem(0,new MathEx.Point(-1,-1));else{var b=this.D2.value.value();isNumber(b)?this._points.setItem(0,new MathEx.Point(-1,a.priceToCoordinate(b))):this._points.setItem(0,new MathEx.Point(-1,NaN))}};
|
|
TradingView.J58.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D2.color.value();a.linewidth=this.D2.linewidth.value();a.linestyle=this.D2.linestyle.value();a.hitTestResult=TradingView.HitTestResult.REGULAR;return new TradingView.HorzLineRenderer(a)};TradingView.BandBackgroundRenderer=function(a){this._data=a};
|
|
TradingView.BandBackgroundRenderer.prototype.draw=function(a){if(0!==this._data.points.length){var b=a.canvas.width;a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency);var c=Math.min(this._data.points[0],this._data.points[1]),d=Math.max(this._data.points[0],this._data.points[1]);a.fillRect(0,c,b,d-c)}};TradingView.BandBackgroundRenderer.prototype.hitTest=function(a){return null};TradingView.J57=function(a){this.R99=a;this._points=[]};
|
|
TradingView.J57.prototype.update=function(){this._points=[];if(this.R99.properties().bandsBackground.fillBackground.value()){var a=this.R99.properties().bands[0],b=this.R99.properties().bands[1],c=this.R99.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
|
|
TradingView.J57.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this.R99.properties().bandsBackground.backgroundColor.value();a.transparency=this.R99.properties().bandsBackground.transparency.value();return new TradingView.BandBackgroundRenderer(a)};
|
|
TradingView.J84=function(a,b,c){this.R99=a;this._points=[];assert(b.type===TradingView.StudyMetaInfo.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+b.type);this._initBandIndexes(b.objAId,b.objBId);this._fillStyleProps=c};
|
|
TradingView.J84.prototype._initBandIndexes=function(a,b){this._bandBKey=this._bandAKey=null;for(var c=0;c<this.R99.metaInfo().bands.length;++c){var d=this.R99.metaInfo().bands[c];null===this._bandAKey&&d.id===a?this._bandAKey=c:null===this._bandBKey&&d.id===b&&(this._bandBKey=c)}};
|
|
TradingView.J84.prototype.update=function(){this._points=[];if(this._fillStyleProps.visible.value()){var a=this.R99.properties().bands[this._bandAKey],b=this.R99.properties().bands[this._bandBKey],c=this.R99.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
|
|
TradingView.J84.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this._fillStyleProps.color.value();a.transparency=this._fillStyleProps.transparency.value();return new TradingView.BandBackgroundRenderer(a)};R50=function(){this._marksByIndex={};this._marksBySpan=[]};R50.prototype.minIndex=void 0;R50.prototype.maxIndex=void 0;
|
|
R50.prototype.merge=function(a){for(var b=this._marksBySpan,c={},d=0;d<a.length;d++){var e=a[d],f=e.index,g=e.span,h=this._marksByIndex[e.index];if(h){if(h.index===e.index&&h.span===e.span){h.time=e.time;continue}this._removeTickmark(h)}this._marksByIndex[f]=e;this.minIndex<=f||(this.minIndex=f);this.maxIndex>=f||(this.maxIndex=f);b[g]||(b[g]=[]);b[g].push(e);c[g]=!0}for(g=b.length;g--;)b[g]&&(b[g].length||delete b[g],c[g]&&b[g].sort(this._sortByIndexAsc));delete this._cache};
|
|
R50.prototype._removeTickmark=function(a){var b=a.index;this._marksByIndex[b]===a&&(delete this._marksByIndex[b],b<=this.minIndex&&this.minIndex++,b>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),b=this._marksBySpan[a.span],a=b.indexOf(a),-1!==a&&b.splice(a,1))};R50.prototype._sortByIndexAsc=function(a,b){return a.index-b.index};
|
|
R50.prototype.removeTail=function(a){var b={};this.maxIndex=0;for(var c in this._marksByIndex)this._marksByIndex[c].time<a&&(b[c]=this._marksByIndex[c],this.maxIndex=Math.max(this.maxIndex,c));this._marksByIndex=b};R50.prototype.addTail=function(a){for(var b=0;b<a.length;b++)a[b].index=this.maxIndex+b+1;this.merge(a)};R50.prototype.indexToTime=function(a){return(a=this._marksByIndex[a])?new Date(1E3*a.time):null};
|
|
R50.prototype.build=function(a,b){var c=Math.ceil(b/a);if(this._maxbar===c&&this._cache)return this._cache;this._maxbar=c;for(var d=[],e=this._marksBySpan.length;e--;)if(this._marksBySpan[e]){for(var f=d,d=[],g=f.length,h=0,k=this._marksBySpan[e],l=k.length,m=Infinity,n=-Infinity,p=0;p<l;p++){for(var r=k[p],t=r.index;h<g;){var m=f[h],v=m.index;if(v<t)h++,d.push(m),n=v,m=Infinity;else{m=v;break}}m-t>=c&&t-n>=c&&(d.push(r),n=t)}for(;h<g;h++)d.push(f[h])}return this._cache=d};
|
|
R50.prototype.state=function(){for(var a=[],b=this._marksBySpan.length;b--;)this._marksBySpan[b]&&(a=a.concat(this._marksBySpan[b]));a=a.map(function(a){return[a.span,a.time,a.index]});return{marks:a,version:2}};R50.prototype.restoreState=function(a){this._marksByIndex={};this._marksBySpan=[];delete this.maxIndex;delete this.minIndex;a&&a.marks&&a.marks.length&&(2===a.version?(a=a.marks.map(function(a){return{span:a[0],time:a[1],index:a[2]}}),this.merge(a)):this.merge(a.marks))};TradingView.MONTH_NAMES;TradingView.MINUTE_SPAN=20;TradingView.HOUR_SPAN=30;TradingView.DAY_SPAN=40;TradingView.WEEK_SPAN=50;TradingView.MONTH_SPAN=60;TradingView.YEAR_SPAN=70;TradingView.DEFAULT_BAR_SPACING=6;TradingView.MAX_BAR_SPACING=50;TradingView.MIN_BAR_SPACING=.5;TradingView.DEFAULT_RIGHT_OFFSET=5;function _createMonthNames(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}
|
|
function R49(a,b){this.D0=a;this.D2=b;this.m_width=0;this._defaultRightOffset=this.D2.rightOffset.value();this.m_rightOffset=this.D2.rightOffset.value();this.m_points=new TradingView.TimeIndexes;this.m_barSpacing=this.D2.barSpacing.value();this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new R50;this._locked=!1;this._formattedBySpan={}}
|
|
R49.prototype.reset=function(){this._visibleBarsCache=null;this.m_points=new TradingView.TimeIndexes;this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new R50};R49.prototype.restoreDefault=function(){this._visibleBarsCache=null;this.m_barSpacing=TradingView.DEFAULT_BAR_SPACING;this.m_rightOffset=this.D2.rightOffset.value();this.saveDefault("barSpacing");this._correctOffset();this.recalcLockedScale()};
|
|
R49.prototype.rightOffset=function(){return this.m_rightOffset};
|
|
R49.prototype.scrollToRealtime=function(a){var b=this.D2.rightOffset.value();if(a){var c=this;a=this.m_rightOffset;var d=this.m_width/this.m_barSpacing-10;0<d&&b>d&&(b=d);var e=this.D0;$({offset:a}).animate({offset:b},{duration:1E3,easing:"easeInOutQuint",step:function(a){c._visibleBarsCache=null;c.m_rightOffset=a;e.recalculateAllPanes();e.D20(new A22(A22.LIGHT_UPDATE));e.recalcVisibleRangeStudy(e.D19())}})}else this._visibleBarsCache=
|
|
null,this.m_rightOffset=b,this._correctOffset()};R49.prototype.points=function(){return this.m_points};R49.prototype.width=function(){return this.m_width};R49.prototype.barSpacing=function(){return this.m_barSpacing};R49.prototype.setWidth=function(a){this._visibleBarsCache=null;!isFinite(a)||0>=a||(this._locked&&this.m_width&&(this.m_barSpacing*=a/this.m_width),this.m_width=a,this._correctOffset())};
|
|
R49.prototype.visibleBars=function(){if(this._visibleBarsCache)return this._visibleBarsCache;if(!this.isEmpty()){var a=Math.ceil(this.m_width/this.m_barSpacing)-1,b=Math.round(this.m_rightOffset+this.m_points.lastTimePointIndex());return this._visibleBarsCache=a=new BarsRange(b-a,b)}};R49.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()};
|
|
R49.prototype.indexToCoordinate=function(a,b){if(this.isEmpty()||!TradingView.isInteger(a))return 0;var c=this.m_points.lastTimePointIndex()+this.m_rightOffset-a,c=this.m_width-(c+.5)*this.m_barSpacing;return b?c:Math.round(c)};R49.prototype.barIndexesToCoordinates=function(a){a=a.toArray();for(var b=0;b<a.length;b++){var c=a[b].time,c=this.m_points.lastTimePointIndex()+this.m_rightOffset-c,c=this.m_width-(c+.5)*this.m_barSpacing;a[b].time=Math.round(c);a[b].exactTime=c}};
|
|
R49.prototype.indexesToCoordinates=function(a){a=a.toArray();for(var b=this.m_points.lastTimePointIndex()+this.m_rightOffset,b=this.m_width-b*this.m_barSpacing-.5*this.m_barSpacing,c=0;c<a.length;c++)a[c].x=Math.round(b+a[c].x*this.m_barSpacing)};R49.prototype.coordinateToIndex=function(a){a=(this.m_width+1-a)/this.m_barSpacing;a=this.m_points.lastTimePointIndex()+this.m_rightOffset-a;a=Math.round(1E6*a)/1E6;return Math.ceil(a)};
|
|
R49.prototype.timeToCoordinate=function(a){var b=this.m_points.closestIndexLeft(a),c=this.m_points.valueAt(b),b=this.indexToCoordinate(b,!0);if(0>=b||b>=this.m_width)return null;var d=this.barSpacing(),e;e=this.m_points.lastTimePointIndex();e=this.m_points.valueAt(e)-this.m_points.valueAt(e-1);a=Math.round(b+(a-c)/e*d)+1;return 0>=a||a>=this.m_width?null:a};R49.prototype.alignCoordinate=function(a){if(this.isEmpty())return a;a=this.coordinateToIndex(a);return this.indexToCoordinate(a)};
|
|
R49.prototype.timePointToIndex=function(a){return this.m_points.indexOf(a,!0)};R49.prototype.indexToTimePoint=function(a){return(a=this.m_points.valueAt(a))?new Date(1E3*a):null};R49.prototype.indexToUserTime=function(a){return this.m_tickmarks.indexToTime(a)};
|
|
R49.prototype.marks=function(){if(this.isEmpty())return null;for(var a=this.m_barSpacing,b=Math.round(75/a),c=this.visibleBars(),d=Math.max(c.firstBar(),c.firstBar()-b),b=Math.max(c.lastBar(),c.lastBar()-b),a=this.m_tickmarks.build(a,75),c=[],e=0;e<a.length;++e){var f=a[e];if(d<=f.index&&f.index<=b){var g=this.m_tickmarks.indexToTime(f.index);null!==g&&c.push({coord:this.indexToCoordinate(f.index),label:this.formatLabel(g,f.span),span:f.span,major:f.label>=TradingView.DAY_SPAN?1:0})}}return c};
|
|
R49.prototype.state=function(a){var b={};b.m_barSpacing=this.barSpacing();b.m_rightOffset=this.m_rightOffset;a&&(0<this.m_points.size()&&(b.m_lastVisibleBar=this.m_points.valueAt(this.m_points.lastTimePointIndex())),b.points=this.m_points.state(),b.tickmarks=this.m_tickmarks.state(),b.width=this.m_width);return b};
|
|
R49.prototype.restoreState=function(a,b,c){this._visibleBarsCache=null;void 0===a.m_barSpacing?TradingView.logDebugChart("R49.restoreState: invalid state"):void 0===a.m_rightOffset?TradingView.logDebugChart("R49.restoreState: invalid state"):(this.m_barSpacing=a.m_barSpacing,this.m_rightOffset=a.m_rightOffset,this.m_restoredLastTimePoint=a.m_lastVisibleBar,c&&this.m_restoredLastTimePoint&&(c=this.m_points.indexOf(this.m_restoredLastTimePoint),this.m_rightOffset=-(this.m_points.lastTimePointIndex()-
|
|
c)+a.m_rightOffset),b&&(this.m_points.restoreState(a.points),this.m_tickmarks.restoreState(a.tickmarks),a.width&&(this._locked=!0,0<this.m_width&&(this.m_barSpacing*=this.m_width/a.width))),this._correctOffset())};R49.prototype.setOffset=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebugChart("R49.setOffset: invalid state"):(this.m_rightOffset=a,this._correctOffset())};
|
|
R49.prototype.setBarSpacing=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebugChart("R49.setBarSpacing: invalid state"):this.m_barSpacing=a};R49.prototype._correctOffset=function(){if(!this.isEmpty()){var a=this.m_width/this.m_barSpacing-10;0<a&&this.m_rightOffset>a&&(this.m_rightOffset=a,this._visibleBarsCache=null);a=this.m_points.size()-10;this.m_rightOffset<-a&&(this.m_rightOffset=-a,this._visibleBarsCache=null)}};
|
|
R49.prototype.maxOffset=function(){return this.m_width/this.m_barSpacing-10};R49.prototype.startScale=function(a){this.m_scrollStartPoint&&this.endScroll();null!==this.m_scaleStartPoint||null!==this.m_stateSnapshot||this.isEmpty()||(this.m_scaleStartPoint=a,this.m_stateSnapshot=this.state())};
|
|
R49.prototype.scaleTo=function(a){this._visibleBarsCache=null;delete this.m_restoredLastTimePoint;if(null!==this.m_stateSnapshot){a=MathEx.clamp(this.m_width-a,0,this.m_width);var b=MathEx.clamp(this.m_width-this.m_scaleStartPoint,0,this.m_width);0!==a&&0!==b&&(this.m_barSpacing=this.m_stateSnapshot.m_barSpacing*a/b,this.m_barSpacing<TradingView.MIN_BAR_SPACING?this.m_barSpacing=TradingView.MIN_BAR_SPACING:this.m_barSpacing>TradingView.MAX_BAR_SPACING&&(this.m_barSpacing=TradingView.MAX_BAR_SPACING),
|
|
this._correctOffset(),this.recalcLockedScale())}};R49.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_stateSnapshot=this.m_scaleStartPoint=null,this.saveDefault("barSpacing"))};R49.prototype.saveDefault=function(a){TradingView.saveDefaultProperties(!0);this.D2[a].setValue(this["m_"+a]);TradingView.saveDefaultProperties(!1)};
|
|
R49.prototype.startScroll=function(a){null!==this.m_scrollStartPoint||null!==this.m_stateSnapshot||this.isEmpty()||(this.m_scrollStartPoint=a,this.m_stateSnapshot=this.state())};
|
|
R49.prototype.scrollTo=function(a){this._visibleBarsCache=null;delete this.m_restoredLastTimePoint;null!==this.m_scrollStartPoint&&(a=(this.m_scrollStartPoint-a)/this.barSpacing(),this.m_rightOffset=this.m_stateSnapshot.m_rightOffset+a,this._correctOffset(),this.D0.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale())};
|
|
R49.prototype.scrollToOffsetAnimated=function(a,b){if(!isFinite(a))throw new RangeError("offset is required and must be finite number");void 0===b&&(b=400);if(!isFinite(b)||0>=b)throw new RangeError("animationDuration (optional) must be finite positive number");var c=this,d=this.m_rightOffset,e=+new Date,f=this.D0;(function h(){c._visibleBarsCache=null;var k=(new Date-e)/b;1<=k?(c.m_rightOffset=a,c._visibleBarsCache=null,f.recalculateAllPanes(),f.D20(new A22(A22.LIGHT_UPDATE))):
|
|
(c.m_rightOffset=d+(a-d)*k,f.recalculateAllPanes(),setTimeout(h,20))})()};R49.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_stateSnapshot=this.m_scrollStartPoint=null)};R49.prototype._currentSavedPosition=function(){if(!this.isEmpty()){var a=this.m_points.indexOf(this.m_restoredLastTimePoint,!0);TradingView.isInteger(a)&&(a=this.m_points.lastTimePointIndex()-a,this.m_rightOffset-=a);delete this.m_restoredLastTimePoint}};
|
|
R49.prototype.update=function(a,b,c,d){this._visibleBarsCache=null;this.m_tickmarks.merge(d);this.m_points.merge(a,b,c);this.m_restoredLastTimePoint&&this._currentSavedPosition()};R49.prototype.addTail=function(a,b,c){this.m_tickmarks.removeTail(b);a=a.params;b=this.m_tickmarks.maxIndex+(c?0:1);for(var d=0;d<a.marks.length;d++)a.marks[d].index=b+d;this.m_tickmarks.addTail(a.marks);this.m_points.addTail(a.changes,c);this.m_rightOffset-=a.changes.length};
|
|
R49.prototype.formatLabel=function(a,b){if(this._formattedBySpan[b])return this._formattedBySpan[b].format(a.valueOf());var c=this;this._formattedBySpan[b]=new TradingView.FormattedLabelsCache(function(a){return c.formatLabelImpl(new Date(a),b)});return this._formattedBySpan[b].format(a)};
|
|
R49.prototype.formatLabelImpl=function(a,b){if(!(a&&a instanceof Date))return"incorrect time";var c=this.D0.mainSeries().isDWM();return b<TradingView.MINUTE_SPAN&&!c?TradingView.numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+TradingView.numberToStringWithLeadingZero(a.getUTCMinutes(),2)+":"+TradingView.numberToStringWithLeadingZero(a.getUTCSeconds(),2):b<TradingView.DAY_SPAN&&!c?TradingView.numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+TradingView.numberToStringWithLeadingZero(a.getUTCMinutes(),
|
|
2):b<TradingView.WEEK_SPAN||b<TradingView.MONTH_SPAN?a.getUTCDate():b<TradingView.YEAR_SPAN?(TradingView.MONTH_NAMES||(TradingView.MONTH_NAMES=_createMonthNames()),TradingView.MONTH_NAMES[a.getUTCMonth()]):a.getUTCFullYear()};
|
|
R49.prototype.normalizeBarIndex=function(a){var b=0,c=0;a<this.m_points.firstTimePointIndex()?(b=this.m_points.valueAt(this.m_points.firstTimePointIndex()),c=a-this.m_points.firstTimePointIndex()):a>this.m_points.lastTimePointIndex()?(b=this.m_points.valueAt(this.m_points.lastTimePointIndex()),c=a-this.m_points.lastTimePointIndex()):(b=this.m_points.valueAt(a),c=0);return{time_t:b,offset:c}};
|
|
R49.prototype.denormalizeTimePoint=function(a){var b=this.m_points.closestIndexLeft(a.time_t);return void 0===b?void 0:b+a.offset};R49.prototype.zoomToBarsRange=function(a,b){if(!(b<=a)){var c=this.m_points.lastTimePointIndex();c&&(this.m_rightOffset=b-c);this.m_barSpacing=this.width()/(b-a+1);this._visibleBarsCache=null}};
|
|
R49.prototype.recalcLockedScale=function(){if(this.D0.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()){var a=this.D0.m_mainSeries.priceScale(),b=this.D0.m_mainSeries,c=b.data().boxSize;c||(b.fixBoxSize(),c=b.data().boxSize);if(c){if(a.properties().percentage.value())var d=b.data().search(b.getRealVisibleRange().m_firstBar).value[TradingView.CLOSE_PLOT],c=PriceRange.prototype.convertToPercent.call(null,d+c,d)-PriceRange.prototype.convertToPercent.call(null,d,d);c=a.internalHeight()/
|
|
(this.barSpacing()/c);a=b.priceScale().priceRange();a&&c==a.length()||(!a||a.isEmpty()?(a=this.visibleBars(),a=b.priceRange(a.firstBar(),a.lastBar())):(c=(c-a.length())/2,a.m_minValue-=c,a.m_maxValue+=c),b.priceScale().setPriceRange(a))}}};R49.prototype.correctBarSpacing=function(){!this.isEmpty()&&this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(TradingView.DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),TradingView.MAX_BAR_SPACING)))};
|
|
R49.prototype.canZoomIn=function(){return this.m_barSpacing<TradingView.MAX_BAR_SPACING};R49.prototype.canZoomOut=function(){return this.m_barSpacing>TradingView.MIN_BAR_SPACING};TradingView.SelectionRenderer=function(a){this._data=a};TradingView.SelectionRenderer.RADIUS=3.5;TradingView.SelectionRenderer.prototype.tolerance=2;TradingView.SelectionRenderer.prototype.draw=function(a){if(this._data){a.strokeStyle="#6B6B6B";a.fillStyle="#D6D6D6";for(var b=this._data.vertOffset||0,c=0;c<this._data.points.length;c++){var d=this._data.points[c],e=d;void 0===e.x||TradingView.isNaN(e.x)||null===e.x||void 0===e.y||TradingView.isNaN(e.y)||null===e.y||this._drawMarker(a,d,b)}}};
|
|
TradingView.SelectionRenderer.prototype._drawMarker=function(a,b,c){a.beginPath();a.arc(b.x+.5,b.y+.5+c,TradingView.SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};TradingView.SelectionRenderer.prototype.hitTest=function(a){if(!this._data)return null;for(var b=0;b<this._data.points.length;b++){var c=this._data.points[b];if(c.substract(a).length()<=TradingView.SelectionRenderer.RADIUS+this.tolerance)return new TradingView.HitTestResult(this._data.hittestResult,c.data)}return null};
|
|
TradingView.LineAnchor=function(a,b){this._data=a;this.D0=b;this.radius=this._data.radius||TradingView.LineAnchor.OUTER_RADIUS};TradingView.LineAnchor.OUTER_RADIUS=TradingView.isMobile.any()?16:8;TradingView.LineAnchor.prototype.tolerance=2;
|
|
TradingView.LineAnchor.prototype.draw=function(a){for(var b=this._data.currentPoint,c=this._data.outerStrokeWidth||1,d=0;d<this._data.points.length;d++){var e=this._data.points[d],f=e.substract(b).length(),g=TradingView.isInteger(e.data)&&this._data.linePointBeingEdited===e.data,h=this.radius,k=this._data.strokeWidth||2,f=f<=h+this.tolerance?1:0,h=h+f,k=k+f;g||(e.square?(a.fillStyle=this._data.backgroundColor,a.fillRect(e.x-h,e.y-h,2*h,2*h),a.fillStyle=this._data.color,g=h-c,a.fillRect(e.x-g,e.y-
|
|
g,2*g,2*g),g=h-c-k,a.fillStyle=this._data.backgroundColor,a.fillRect(e.x-g,e.y-g,2*g,2*g)):(a.beginPath(),a.arc(e.x,e.y,h,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.backgroundColor,a.fill(),a.beginPath(),a.arc(e.x,e.y,h-c,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.color,a.fill(),a.beginPath(),a.arc(e.x,e.y,h-c-k,0,2*Math.PI,!0),a.closePath(),a.fillStyle=this._data.backgroundColor,a.fill()))}};
|
|
TradingView.LineAnchor.prototype.hitTest=function(a){for(var b=0;b<this._data.points.length;b++){var c=this._data.points[b];if(c.substract(a).length()<=this.radius+this.tolerance)return new TradingView.HitTestResult(this._data.hittestResult,c.data)}return null};TradingView.SelectionRendererArrowsUpDown=function(a){TradingView.SelectionRenderer.call(this,a)};inherit(TradingView.SelectionRendererArrowsUpDown,TradingView.SelectionRenderer);
|
|
TradingView.SelectionRendererArrowsUpDown.prototype._drawMarker=function(a,b,c){var d=b.isUp?1:-1,e=R54.prototype._calculateVerticalOffset(this._data.barSpacing),f=R54.prototype._calculateMinHeight(this._data.barSpacing);c=c+d*e+d*f;a.beginPath();a.arc(b.x+.5,b.y+.5+c,TradingView.SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};TradingView.CompositeRenderer=function(){this._renderers=[]};TradingView.CompositeRenderer.prototype.append=function(a){this._renderers.push(a)};TradingView.CompositeRenderer.prototype.insert=function(a,b){this._renderers.splice(b,0,a)};TradingView.CompositeRenderer.prototype.draw=function(a){for(var b=0;b<this._renderers.length;b++)a.save(),this._renderers[b].draw(a),a.restore()};
|
|
TradingView.CompositeRenderer.prototype.drawBackground=function(a){for(var b=0;b<this._renderers.length;b++)this._renderers[b].drawBackground&&this._renderers[b].drawBackground(a)};TradingView.CompositeRenderer.prototype.hitTest=function(a){for(var b=null,c=this._renderers.length-1;0<=c;c--){var d=this._renderers[c].hitTest(a);d&&(null==b||d.result()>b.result())&&(b=d)}return b};TradingView.selectionIndexes=function(a,b){var c=a%10;c&&(a=a-c+10);for(c=[];a<=b;a+=10)c.push(a);return c};R48=function(a,b){PriceAxisView.call(this,a,b);this._linetool=a;this._pointIndex=b;this._text="";this._coordinate=0;this._background="#5592C9";this._activeBackground="#0F6DBF";this._borderColor="#2E84A6";this._color="white";this._textHeight=14;this._invalidated=!0;this.D0=a.D0};inherit(R48,PriceAxisView);R48.prototype.update=function(){this._invalidated=!0};
|
|
R48.prototype.setActive=function(a){this._active=a};
|
|
R48.prototype._updateImpl=function(){this._visible=!1;this._text="";if(this.D0.timeScale()&&!this.D0.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&(this.D0.selectedSource()===this._linetool||this._linetool.customization.forcePriceAxisLabel)&&!this.D0.timeScale().visibleBars().isEmpty()){var a=this._linetool.axisPoints();if(!(a.size()<=this._pointIndex)&&(a=a.item(this._pointIndex),isFinite(a.price))){var b=
|
|
this._linetool.priceScale();if(b.isPercent()){var c=this._linetool.ownerSource().firstValue();if(!isNumber(c))return;a.price=b.priceRange().convertToPercent(a.price,c)}this._text=b.formatter().format(a.price);this._coordinate=b.priceToCoordinate(a.price);this._textHeight=b.m_markBuilder.fontHeight();this._visible=!0}}};
|
|
R48.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return new TradingView.PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,borderColor:this._borderColor,background:this._active?this._activeBackground:this._background,textHeight:this._textHeight,visible:this._visible})};
|
|
R48.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};
|
|
TradingView.LineToolTimeAxisView=function(a,b){TradingView.TimeAxisView.call(this);this._linetool=a;this._pointindex=b;this.D0=a.D0;this._text="";this._coordinate=0;this._background="#5592C9";this._activeBackground="#0F6DBF";this._borderColor="#2E84A6";this._color="white";this._visible=!1;this._textHeight=14;this._invalidated=!0};inherit(TradingView.LineToolTimeAxisView,TradingView.TimeAxisView);TradingView.LineToolTimeAxisView.prototype.setActive=function(a){this._active=a};
|
|
TradingView.LineToolTimeAxisView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.LineToolTimeAxisView.prototype.updateImpl=function(){this._visible=!1;if(!this.D0.timeScale().isEmpty()){var a=this._linetool.axisPoints();if(!(a.size()<=this._pointindex)&&this._linetool===this.D0.selectedSource()){this._text="";a=a.item(this._pointindex).index;this._coordinate=this.D0.timeScale().indexToCoordinate(a);if(a=this.D0.timeScale().indexToUserTime(a))this._text=(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(a);this._visible=!0;
|
|
this._invalidated=!1}}};TradingView.LineToolTimeAxisView.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);return new TradingView.TimeAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,textHeight:this._textHeight,visible:this._visible})};
|
|
R47=function(a,b,c){DataSource.call(this);this.D0=a;this.D2=c;c.visible&&c.frozen||this.D2.merge(defaults("linetool"));$.isArray(b)?this._paneViews=b:this._paneViews=[b];this._points=new List;this._fixedPoints=new List;this._timePoint=new List;this.D2.symbol||(this.D2.merge({symbol:a.mainSeries().symbol()}),(b=a.mainSeries().symbolInfo())&&this.D2.merge({symbolInfo:{listed_exchange:b.listed_exchange,short_name:b.name}}));this.D2.interval||
|
|
this.D2.merge({interval:a.mainSeries().interval()});this.D2.addExclusion&&(this.D2.addExclusion("symbol"),this.D2.addExclusion("symbolInfo"),this.D2.addExclusion("points"),this.D2.addExclusion("interval"),this.D2.addExclusion("visible"));this.calcIsActualSymbol();this.D2.listeners().subscribe(this,R47.prototype.propertiesChanged);this._createPointsProperties();"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&
|
|
(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash));this.m_priceAxisViews=[];this.m_timeAxisViews=[];if(0<this.pointsCount())for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.push(this.createPriceAxisView(a)),this.m_timeAxisViews.push(new TradingView.LineToolTimeAxisView(this,a));this.D2.visible.listeners().subscribe(this,function(a){a.value()||this.D0.selectedSource()!=this||this.D0.setSelectedSource(null)});this.customization=this.customization||{forcePriceAxisLabel:!1,
|
|
disableSelection:!1,disableErasing:!1,disableSave:!1};$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this))};inherit(R47,DataSource);R47.LINEEND_NORMAL=0;R47.LINEEND_ARROW=1;R47.LINEEND_CIRCLE=2;R47.PointPriceProperty=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(R47.PointPriceProperty,Property);
|
|
R47.prototype.getType=function(){return TradingView.className(this.constructor)};R47.prototype.getConstructor=function(){return this._constructor||null};R47.prototype.isActualSymbol=function(){return this._isActualSymbol};R47.prototype.isSavedInChart=function(a){return!this.customization.disableSave};
|
|
R47.prototype.calcIsActualSymbol=function(){var a=this.D2,b=this.D0.mainSeries(),c=b.symbolInfo();this._isActualSymbol=c&&a.symbolInfo?a.symbolInfo.listed_exchange.value()===c.listed_exchange&&a.symbolInfo.short_name.value()===c.name:a.symbol.value()===b.symbol()||a.symbol.value().split(":").slice(-1)[0]===b.symbol().split(":").slice(-1)[0]};R47.PointPriceProperty.prototype.value=function(){return this._lineSource.points().item(this._pointIndex).price};
|
|
R47.PointPriceProperty.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.price=parseFloat(a);a=this._lineSource.priceScale();if(a.isPercent()){var c=this._lineSource.ownerSource().firstValue();b.price=a.priceRange().convertToPercent(b.price,c)}this._lineSource.setPoint(this._pointIndex,b);this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging(!0);this._lineSource._syncMultichartState()};
|
|
R46=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(R46,Property);R46.prototype.value=function(){return this._lineSource.points().item(this._pointIndex).index};
|
|
R46.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.index=a;a=this._lineSource.priceScale();if(a.isPercent()){var c=this._lineSource.ownerSource().firstValue();b.price=a.priceRange().convertToPercent(b.price,c)}this._lineSource.setPoint(this._pointIndex,b);this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging(!0);this._lineSource._syncMultichartState()};
|
|
R47.prototype._syncMultichartState=function(){var a={points:this._timePoint.toArray(),interval:this.D0.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&TradingView.drawingState.finishChangingLineTool({model:this.D0,linkKey:this.linkKey,symbol:this.D0.mainSeries().symbol(),finalState:a})};
|
|
R47.prototype._createPointProperty=function(a){var b=this.D2.points;b.addProperty(a);b=b[a];b.addProperty("price");b.price=new R47.PointPriceProperty(this,a);b.addProperty("bar");b.bar=new R46(this,a)};R47.prototype._createPointsProperties=function(){this.D2.addProperty("points");for(var a=0;a<this.pointsCount();a++)this._createPointProperty(a)};
|
|
R47.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null};R47.prototype.symbol=function(){return this.D2.symbol.value()};R47.prototype.properties=function(){return this.D2};R47.prototype.isSavedInStudyTemplates=function(){return!1};
|
|
R47.prototype.state=function(a){var b={type:TradingView.className(this.constructor),id:this.id(),state:this.properties().state(),points:this._timePoint.toArray(),zorder:this.zorder(),linkKey:this.linkKey};delete b.state.points;a&&(b.indexes=this._points.toArray());this.ownerSource()&&(b.ownerSource=this.ownerSource().id());this.isFixed()&&(b.positionPercents=(this._positionPercents||this.calcPositionPercents()).toArray());"version"in this&&1!==this.version&&(b.version=this.version);
|
|
this.hasAlert.value()&&(b.alertId=this._alertId);return b};R47.prototype.template=function(){var a=this.properties().state();delete a.points;delete a.symbol;delete a.symbolInfo;return a};R47.prototype.restoreTemplate=function(a){delete a.symbolInfo;this.D0._undoModel.drawingLoadTemplate(this,a)};R47.prototype.clearData=function(){this._points=new List};
|
|
R47.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId};R47.prototype.stop=function(){this._currentPointsetId&&(this.D0.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null);this.hasAlert.value()&&TradingView.alertsDispatcher.deleteAlert(this._alertId)};R47.prototype.isStarted=function(){return!!this._currentPointsetId};
|
|
R47.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=0,this.createServerPoints())};R47.prototype.tryCreateServerPoints=function(){this.isFixed()||this._currentPointsetId||this.createServerPoints()};R47.prototype.normalizePoint=function(a){var b=this.D0.timeScale().normalizeBarIndex(a.index);b.price=a.price;return b};
|
|
R47.prototype.normalizePoints=function(){this._timePoint.clear();for(var a=0;a<this._points.size();a++){var b=this.D0.timeScale().normalizeBarIndex(this._points.item(a).index);if(!b.time_t){this._timePoint.clear();break}b.price=this._points.item(a).price;this._timePoint.append(b)}};
|
|
R47.prototype.denormalizeTimePoints=function(){for(var a=[],b=0;b<this._timePoint.size();b++){var c=this.D0.timeScale().denormalizeTimePoint(this._timePoint.item(b));if(void 0===c){a=[];break}else a.push({index:c,price:this._timePoint.item(b).price})}0<a.length&&(this._points=new List(a))};R47.prototype.restorePoints=function(a,b,c){this._timePoint=new List(a);this._points=new List(b);c||this.denormalizeTimePoints()};
|
|
R47.prototype.restoreExternalPoints=function(a){this.properties().interval.setValue(a.interval);this._timePoint=new List(a.points);this.denormalizeTimePoints();this.createServerPoints()};R47.prototype.restorePositionPercents=function(a){this._positionPercents=new List(a)};R47.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews();this.D0.updateSource(this)};
|
|
R47.prototype.propertiesChanged=function(){this.updateAllViewsAndRedraw();if(this.linkKey){var a=this.properties().state();delete a.interval;TradingView.drawingState.changeLineStyle({linkKey:this.linkKey,state:a,model:this.D0})}};
|
|
R47.prototype.points=function(){for(var a=[],b=0;b<this._points.size();b++){var c=this._points.item(b);a.push({index:c.index,price:c.price,time:c.time})}this._lastPoint&&a.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time});a=new List(a);this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(a);return a};R47.prototype.axisPoints=function(){return this.points()};
|
|
R47.prototype.fixedPoints=function(){var a=new List;if(this._positionPercents&&!this.priceScale().isEmpty())for(var b=0;b<this._positionPercents.size();b++){var c=this._positionPercents.item(b),d=this.D0.timeScale().width()*c.x,c=this.priceScale().height()*c.y;a.append(new MathEx.Point(d,c))}else for(b=0;b<this._fixedPoints.size();b++)a.append(this._fixedPoints.item(b).clone());this._lastPoint&&a.append(this._lastPoint.clone());this._currentMovingPoint&&this._startMovingPoint&&
|
|
this.correctFixedPoints(a);return a};
|
|
R47.prototype.addPoint=function(a,b,c){b&&b.shift&&2<=this.points().size()&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));b=this.priceScale();if(b.isPercent()){var d=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,d)}this._points.append(a);(b=this._points.size()==this.pointsCount())?(this._lastPoint=null,c||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=a;return b};
|
|
R47.prototype.addFixedPoint=function(a){this._fixedPoints.append(a);(a=this._fixedPoints.size()==this.pointsCount())&&this.calcPositionPercents();return a};
|
|
R47.prototype.calcPositionPercents=function(){if(!this.priceScale()||this.priceScale().isEmpty())return new List;this._positionPercents=new List;for(var a=0;a<this._fixedPoints.size();a++){var b=this._fixedPoints.item(0),c=b.x/this.D0.timeScale().width(),b=b.y/this.priceScale().height();this._positionPercents.append({x:c,y:b})}return this._positionPercents};R47.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()};
|
|
R47.prototype.onData=function(a){if(a.params.customId===this.currentPointsetId()&&0!==a.params.plots.length){for(var b=0;b<a.params.plots.length;b++){var c=a.params.plots[b],d=this._timePoint.item(c.index),d={index:c.value[0],time:new Date(1E3*c.value[1]),price:d.price};this._points.size()<=c.index?this._points.append(d):this._points.setItem(c.index,d)}this.checkAlert&&this.checkAlert();this.updateAllViewsAndRedraw()}};
|
|
R47.prototype.correctPricesToPercents=function(){for(var a=this.priceScale(),b=this.ownerSource().firstValue(),c=0;c<this._points.size();c++){var d=this._points.item(c);d.price=a.priceRange().convertFromPercent(d.price,b)}};R47.prototype.startChanging=function(a,b){a<this.m_priceAxisViews.length&&this.m_priceAxisViews[a].setActive(!0);a<this.m_timeAxisViews.length&&this.m_timeAxisViews[a].setActive(!0)};
|
|
R47.prototype.setPoint=function(a,b,c){c&&c.shift&&this.D2.snapTo45Degrees&&(c=0===a?1:a-1,this._snapPoint45Degree(b,this.points().item(c)));c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();b.price=c.priceRange().convertFromPercent(b.price,d)}this._points.setItem(a,b);this.normalizePoints()};
|
|
R47.prototype.startMoving=function(a){this.isFixed()&&this.restoreFixedPoints();var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}this._startMovingPoint=a};R47.prototype.move=function(a){var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}this._currentMovingPoint=a;this.updateAllViews()};
|
|
R47.prototype.correctPoints=function(a){for(var b=this._currentMovingPoint.index-this._startMovingPoint.index,c=this._currentMovingPoint.price-this._startMovingPoint.price,d=0;d<a.size();d++){var e=a.item(d);e.index+=b;e.price+=c;a.setItem(d,e)}};R47.prototype.correctFixedPoints=function(a){for(var b=this._currentMovingPoint.substract(this._startMovingPoint),c=0;c<a.size();c++)a.setItem(c,a.item(c).add(b))};
|
|
R47.prototype.endMoving=function(a){this.D2.interval.setValue(this.D0.mainSeries().interval());var b=!1,c=!1;this._currentMovingPoint&&this._startMovingPoint&&(b=this._currentMovingPoint.index!=this._startMovingPoint.index,c=this._currentMovingPoint.price!=this._startMovingPoint.price,this.isFixed()?this.correctFixedPoints(this._fixedPoints):this.correctPoints(this._points),this._currentMovingPoint=this._startMovingPoint=null);this.isFixed()?(this.calcPositionPercents(),
|
|
this.updateAllViews()):(this.normalizePoints(),this.updateAllViews(),b&&!a&&this.createServerPoints(),(c||b)&&this.synchronizeAlert(!0))};R47.prototype.endChanging=function(a,b){this.D2.interval.setValue(this.D0.mainSeries().interval());b||(this.normalizePoints(),this.createServerPoints());for(var c=0;c<this.m_priceAxisViews.length;c++)this.m_priceAxisViews[c].setActive(!1);for(c=0;c<this.m_timeAxisViews.length;c++)this.m_timeAxisViews[c].setActive(!1);this.synchronizeAlert(!a)};
|
|
R47.prototype.paneViews=function(a){if(!this._isActualSymbol||!this.D2.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled())return null;a=[];for(var b=this._paneViews.length-1;0<=b;--b)a.push(this._paneViews[b]);return a};R47.prototype.dataWindowView=function(){return null};R47.prototype.statusView=function(){return null};
|
|
R47.prototype.priceAxisViews=function(a,b){if(this._isActualSymbol&&-1!==a.D19().indexOf(this)&&b===this.priceScale()){if(this.D0.lineBeingEdited()===this){var c=this.D0.linePointBeingEdited();if(c<this.m_priceAxisViews.length){var d=this.m_priceAxisViews.slice(),e=d[c];d.splice(c,1);d.push(e);return d}}return this.m_priceAxisViews}return null};
|
|
R47.prototype.timeAxisViews=function(){if(this.D0.lineBeingEdited()===this){var a=this.D0.linePointBeingEdited();if(a<this.m_timeAxisViews.length){var b=this.m_timeAxisViews.slice(),c=b[a];b.splice(a,1);b.push(c);return b}}return this.m_timeAxisViews};
|
|
R47.prototype.updateAllViews=function(){if(!this._isActualSymbol||!this.D2.visible.value())return null;var a=this.paneViews();if(null!==a)for(var b=0;b<a.length;b++)a[b].update();a=this.m_priceAxisViews;for(b=0;b<a.length;b++)a[b].update();a=this.m_timeAxisViews;for(b=0;b<a.length;b++)a[b].update()};
|
|
R47.prototype.setLastPoint=function(a,b){b&&b.shift&&2<=this.points().size()&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));var c=this.priceScale();if(c.isPercent()){var d=this.ownerSource().firstValue();a.price=c.priceRange().convertFromPercent(a.price,d)}this._lastPoint=a;this.updateAllViews()};R47.prototype.setLastFixedPoint=function(a){this._lastFixedPoint=a;this.updateAllViews()};
|
|
R47.prototype.title=function(){return"Line Tool"};R47._pointSetId=1;R47.prototype.start=function(){this.createServerPoints()};
|
|
R47.prototype.tryRemoveOffsetFromPoints=function(){var a=this.D0.timeScale();if(a&&!a.isEmpty())for(var b=a.points().lastTimePointIndex(),c=a.points().valueAt(b),d=0;d<this._timePoint.size();d++){var e=this._timePoint.item(d);if(0!==e.offset&&!(e.time_t>=c)){var f=a.points().indexOf(e.time_t,!0);f+e.offset<=b?(e.time_t=a.points().valueAt(f+e.offset),e.offset=0):(e.time_t=c,e.offset-=b-f)}}};
|
|
R47.prototype.createServerPoints=function(){if(!this._recursiveGuard&&this._isActualSymbol&&this.D0.chartApi().connected()&&(this._currentPointsetId&&this.D0.chartApi().removePointset(this.currentPointsetId()),!this.D0.timeScale().isEmpty()&&(0===this._timePoint.size()&&this.normalizePoints(),0!==this._timePoint.size()))){this.tryRemoveOffsetFromPoints();this._currentPointsetId=++R47._pointSetId;for(var a=this.D0.mainSeries().symbolId(),
|
|
b=this.properties().interval.value(),c=[],d=0;d<this._timePoint.size();d++){var e=this._timePoint.item(d);c.push([e.time_t,e.offset])}var f=this;this.D0.chartApi().createPointset(this.currentPointsetId(),"turnaround",a,b,c,function(a){f.onData(a)})}};R47.prototype.isBeingEdited=function(){return this===this.D0.lineBeingEdited()||this===this.D0.sourceBeingMoved};R47.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()};
|
|
R47.prototype.isLocked=R47.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()};R47.prototype._tooltipFieldsHash={};R47.prototype._tooltipFieldsOrder="time price index time0 price0 time1 price1 time2 price2 time3 price3 time4 price4 distance term pointsPerBar".split(" ");R47.prototype._tooltipFieldsOrdered=null;
|
|
R47.prototype._formatTooltip=function(){null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new TradingView.OrderedHash(this._tooltipFieldsHash,TradingView.OrderedHash.byOrder(this._tooltipFieldsOrder)));return this._tooltipFieldsOrdered.array.filter(function(a){return null!==a.value&&""!==a.value}).map(function(a){return"<span>"+a.title+":</span> "+a.value}).join("<br />")};
|
|
R47.prototype.pointToScreenPoint=function(a){var b=this.D0.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||b.isEmpty())return[new MathEx.Point(0,0),new MathEx.Point(0,0)];var d=null;if(c.isPercent()){if(!this.ownerSource())return;d=this.ownerSource().firstValue();if(null===d||!isFinite(d))return}var e=b.indexToCoordinate(a.index,!0),f=a.price;c.isPercent()&&(f=c.priceRange().convertToPercent(f,d));var g=c.priceToCoordinate(f,!0),d=new MathEx.Point(e,g),e=b.indexToCoordinate(a.index,
|
|
!1),g=c.priceToCoordinate(f,!1);a=new MathEx.Point(e,g);return[d,a]};R47.prototype.screenPointToPoint=function(a){var b=this.D0.timeScale(),c=this.priceScale(),b=b.coordinateToIndex(a.x);a=c.coordinateToPrice(a.y);var d=null;if(c.isPercent()){if(!this.ownerSource())return;d=this.ownerSource().firstValue();if(null===d||!isFinite(d))return}c.isPercent()&&(a=c.priceRange().convertFromPercent(a,d));return{price:a,index:b}};R47.prototype.tags=function(){return[this._constructor]};
|
|
R47.prototype._snapPoint45Degree=function(a,b,c){var d=this.D0.timeScale(),e=d.indexToCoordinate(b.index),f=d.indexToCoordinate(a.index)-e,g=this.m_priceScale,h=b.price,k=a.price,l=this.ownerSource().firstValue();g.isPercent()&&(h=g.priceRange().convertToPercent(h,l));var l=g.priceToCoordinate(h),k=g.priceToCoordinate(k)-l,m=Math.round(Math.atan2(f,k)/Math.PI*4);2==Math.abs(m)?c||(a.price=h):0===Math.abs(m)||4===Math.abs(m)?c||(a.index=b.index):(h=Math.sqrt(f*f+k*k),c=0>
|
|
f?-1:1,b=0>k?-1:1,f=Math.max(Math.abs(k),Math.abs(f)),k=f*Math.sqrt(2)/h,f=Math.round(d.coordinateToIndex(e+f/k*c)),d=Math.abs(d.indexToCoordinate(f)-e),g=g.coordinateToPrice(l+d*b),a.index=f,a.price=g)};R47.prototype.createPriceAxisView=function(a){return new R48(this,a)};R47.prototype.version=1;
|
|
R47.isLineTool=function(a){return(a=TradingView[a])?TradingView.isInherited(a,R47):!1};R47.prototype.alertId=function(){return this._alertId};
|
|
R47.prototype.setAlert=function(a,b,c,d){if(this.canHasAlert()&&(a=a instanceof TradingView.Alert?a.id():parseInt(a),!TradingView.isNaN(a))){b="function"===typeof b?b:function(){};var e=function(){A83.showGoProDialog({feature:"savedChartsForAlertLimit"});"function"===typeof c&&c()};this._alertId=a;this._alert=null;this.hasAlert.setValue(!0);this._processAlertHanders("unsubscribe");this._processAlertHanders("subscribe");d?b():window.saver?window.saver.saveChartSilently(b,
|
|
!1,e,{noDefaultOnFail:!0}):b()}};
|
|
R47.prototype._processAlertHanders=function(a){function b(a){this.synchronizeAlert(!1)}a="subscribe"===a?"subscribe":"unsubscribe";TradingView.alertsDispatcher.alertDeleted[a](this,this.removeAlert);TradingView.alertsDispatcher.alertDeletingStarted[a](this,this.removeAlert);TradingView.alertsDispatcher.alertHovered[a](function(){var a=this.D0.hoveredSource(),a=a&&a.canHasAlert()&&a.alertId(),b=TradingView.alertsDispatcher.alertHovered.value(),b=b&&b.id();b===this._alertId&&
|
|
b!==a?this.D0.setHoveredSource(this):b!==this._alertId&&this._alertId===a&&this.D0.setHoveredSource(null)}.bind(this));TradingView.alertsDispatcher.alertSelected[a](function(){var a=this.D0.selectedSource(),a=a&&a.canHasAlert()&&a.alertId(),b=TradingView.alertsDispatcher.alertSelected.value(),b=b&&b.id();b===this._alertId&&b!==a?this.D0.setSelectedSource(this):b!==this._alertId&&this._alertId===a&&this.D0.setSelectedSource(null)}.bind(this));this.properties().extendLeft&&this.properties().extendRight&&
|
|
(this.properties().extendLeft[a](this,b),this.properties().extendRight[a](this,b))};R47.prototype.removeAlert=function(a){a&&a!==this._alertId||(delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1),this._processAlertHanders("unsubscribe"))};
|
|
R47.prototype.getAlert=function(a,b,c){this.hasAlert.value()?TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(this._alertId,{success:a,cacheOnly:!!b,error:c}):console.error("[Alerts] Can't get alert without alerts dispatcher"):a&&a(null)};
|
|
R47.prototype.synchronizeAlert=function(a){var b=this;b.hasAlert.value()&&setTimeout(function(){function c(){b._alertUndoMode=!0;e.undoToCheckpoint(b._undoCheckpointAlert);setTimeout(function(){b._alertUndoMode=!1},0)}function d(a){a.generateScript(!0);TradingView.Alert.restartAlert(a,e.D4||null,function(){b.needSynchronizeAlertWithServer=!1},function(){delete b._undoCheckpointAlert},c)}var e=b.D0._undoModel;if(!b._undoCheckpointAlert&&!b._alertUndoMode){var f=
|
|
e.undoStack().pop();b._undoCheckpointAlert=e.createUndoCheckpoint();e.undoStack().push(f)}b.getAlert(function(c){var e=b.D2.interval.value();e!==c.resolution()&&c.resolution(e);c.extra().drawing(b);b.needSynchronizeAlertWithServer=!0;a&&!b._alertUndoMode&&d(c)},!1,c)},0)};R47.prototype.stateForAlert=function(){if(this.canHasAlert()){var a=this.state();a.uniqueId=this.uniqueId();a.title=this.title();var b=this._getAlertPlots();b&&(a.plots=b);return a}};
|
|
R47.prototype._getAlertPlots=function(){return null};R47.prototype._linePointsToAlertPlot=function(a,b,c,d){if(2!==a.length)return console.error("[Drawing Alert] Wrong points"),null;var e=this.D0.timeScale();return!e||e.isEmpty()?null:{type:"LinePlot",title:b||this.title(),timestamp:Math.round(e.indexToTimePoint(0).getTime()/1E3),offset1:a[0].index,offset2:a[1].index,price1:a[0].price,price2:a[1].price,extendBackward:c||!1,extendForward:d||!1}};
|
|
R47.prototype.getAlertIsActive=function(a){this.getAlert(function(b){a(b?b.active():!1)},!0)};R47.prototype.geometry=function(){var a=this;return this.points().toArray().map(function(b){var c=a.pointToScreenPoint(b)[0];b=c.x/a.D0.timeScale().width();c=c.y/a.priceScale().height();return new MathEx.Point(b,c)})};A63=function(a,b,c,d){var e=new J92(this,a);b.push(e);R47.call(this,a,b,c);this.properties().listeners().subscribe(this,A63.prototype.changeStyles);this._constructor=d;this._inputs=this._graphics=this._metaInfo=this._indexes=this._nonseriesdata=this._studyId=null};inherit(A63,R47);
|
|
A63.prototype.pointsCount=function(){throw Error("Reimplement this in a child class");};A63.prototype.title=function(){return this._metaInfo.description};A63.prototype.studyId=function(){return this._metaInfo.id};A63.prototype._requestStudy=function(){throw Error("Reimplement this in a child class");};
|
|
A63.prototype.changeStyles=function(){if(this._inputs){var a=A0.splitInputs(this.properties().inputs.state()),a=a.obj,b;for(b in a)if(a[b]!==this._inputs[b]){this._inputs=a;this._requestStudy();break}}else{var a=A0.splitInputs(this.properties().inputs.state());this._inputs=TradingView.clone(a.obj);this._requestStudy()}};
|
|
A63.prototype._checkTurnaround=function(a){return a===this._turnaround||a==this.D0.mainSeries()._turnaround||a===this.D0.mainSeries()._turnaround+"_"+this._turnaround};A63.prototype.stop=function(){R47.prototype.stop.call(this);this._studyId&&this.D0.chartApi().removeStudy(this._studyId)};A63.prototype.onData=function(a){throw Error("Reimplement this in a child class");};
|
|
A63.prototype._correctedPoint=function(a){var b=parseInt(this.D0.mainSeries().bars().first(),10),c=parseInt(this.D0.mainSeries().bars().last(),10);a.index=Math.max(a.index,b);a.index=Math.min(a.index,c);return a};A63.prototype.addPoint=function(a){return R47.prototype.addPoint.call(this,this._correctedPoint(a))};
|
|
A63.prototype.setLastPoint=function(a){return R47.prototype.setLastPoint.call(this,this._correctedPoint(a))};A63.prototype.move=function(a){};A63.prototype.clearData=function(){void 0!==this.m_data&&(this.m_data=new TradingView.PlotList(this._plotFields));this._indexes=this._nonseriesdata=null;this._graphics=new A62(this._metaInfo);this.updateAllViews()};
|
|
A63.prototype.state=function(a){var b=R47.prototype.state.call(this,a);a&&(void 0!==this.m_data&&(b.data=this.m_data.state()),b.nonseriesdata=this._nonseriesdata,b.nonseriesindexes=this._indexes,b.graphics=this._graphics.graphics());this.metaInfo()instanceof TradingView.StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=TradingView.StudyMetaInfo.parseIdString(b.metaInfo.id+(b.metaInfo.version?"-"+
|
|
b.metaInfo.version:"")).fullId);return b};A63.prototype.restoreData=function(a){void 0!==this.m_data&&void 0!==a.data&&this.m_data.restoreState(a.data);this._nonseriesdata=a.nonseriesdata?a.nonseriesdata:null;this._indexes=a.nonseriesindexes?a.nonseriesindexes:null;this._graphics.setGraphics(a.graphics?a.graphics:A62.emptyGraphics())};
|
|
A63.prototype.setPoint=function(a,b){this._indexes=this._nonseriesdata=null;R47.prototype.setPoint.call(this,a,this._correctedPoint(b))};A63.prototype.disconnect=function(){this._studyId=0};A63.prototype.graphics=function(){return this._graphics.graphics()};A63.prototype.firstValue=function(){return this.D0.mainSeries().data().firstValue()};
|
|
A63.prototype.formatter=function(){return this.D0.mainSeries().data().formatter()};A63.prototype.metaInfo=function(){return this._metaInfo};J92=function(a,b){J90.call(this,a,b)};inherit(J92,J90);
|
|
J92.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size()||this.R99._nonseriesdata||this.R99._graphics&&!this.R99._graphics.isEmpty())return a;var b=this._points.item(0),c=this._points.item(1);Math.min(b.x,c.x);Math.max(b.x,c.x);var d={};d.points=(new List).append(b);d.color="#808080";d.linewidth=this.R99._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new TradingView.VertLineRenderer(d));
|
|
d={};d.points=(new List).append(c);d.color="#808080";d.linewidth=this.R99._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new TradingView.VertLineRenderer(d));b={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:"#808080",linewidth:this.R99._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};
|
|
a.append(new TradingView.TrendLineRenderer(b));return a};R31=function(a,b){J90.call(this,a,b)};inherit(R31,J90);
|
|
R31.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;this.isAnchorsRequired()&&(a.append(new TradingView.SelectionRenderer({points:this._points.toArray()})),a.append(this.createLineAnchor({points:this._points.toArray()})));return a};A67=function(a){this._data=a};A67.prototype.hitTest=function(a){return null};
|
|
A67.prototype.draw=function(a){a.font=this._data.textHeight+" Arial";a.fillStyle=this._data.backColor;var b=a.measureText(this._data.text).width,c=this._data.pos,d=Math.round(1.1*this._data.textHeight);"left"==this._data.align&&(c=b+4+4-1);a.fillRect(c-4-4-b-.5,Math.round(this._data.coordinate-.5*d)-.5,b+4+4,d+1);a.fillStyle=this._data.color;a.textBaseline="middle";a.fillText(this._data.text,c-4-b,this._data.coordinate)};
|
|
TradingView.R38=function(a,b,c,d,e){this.D0=a;this.R99=b;this._plotIndex=c;this._getterName=d?d:"symbol";this._propertyName=e;this._cache={};this._invalidated=!0};TradingView.R38.prototype.isPropertyEnabled=function(){return this.D0.properties().scalesProperties[this._propertyName].value()};TradingView.R38.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.R38.prototype.updateImpl=function(){this._visible=!1;if(this.isPropertyEnabled()&&this.R99.properties().visible.value()){var a=this.R99.lastValueData(this._plotIndex,!1);a&&(this._visible=!0,this._coordinate=a.coordinate,this._color=a.color,this._text=this.R99[this._getterName](this._plotIndex),this._textHeight=this.R99.priceScale().m_markBuilder.fontHeight())}};
|
|
TradingView.R38.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);if(!this._visible)return new TradingView.CompositeRenderer;var a=this.D0.paneForSource(this.R99),b="right";a.leftPriceScale()==this.R99.priceScale()&&(b="left");var c=this.D0.properties();(a=!a.leftPriceScale().mainSource()||!a.rightPriceScale().mainSource())&&c.scalesProperties.showLeftScale.value()&&!c.scalesProperties.showRightScale.value()&&(b="left");if(!a&&
|
|
("left"==b&&!c.scalesProperties.showLeftScale.value()||"right"==b&&!c.scalesProperties.showRightScale.value()))return new TradingView.CompositeRenderer;c=this._coordinate;this.R99.lastPriceLabelFixedCoordinate&&(c=this.R99.lastPriceLabelFixedCoordinate(this._plotIndex)||c);b={coordinate:c,backColor:this._color,color:(new TradingView.RGBColor(this._color)).blackWhiteContrast(),text:this._text,pos:this.D0.timeScale().width(),textHeight:this._textHeight,align:b};return new A67(b)};TradingView.PoligonRenderer=function(a,b,c){this._data=a;this._hittest=b?b:new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittest=c?c:new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND);this._points=a.points.toArray()};
|
|
TradingView.PoligonRenderer.prototype.draw=function(a){if(0!==this._points.length){a.beginPath();a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._points[0];a.moveTo(b.x,b.y);for(b=0;b<this._points.length;b++){var c=this._points[b];a.lineTo(c.x,c.y)}this._data.filled&&this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill());this._data.filled&&!this._data.skipClosePath&&
|
|
a.closePath();0<this._data.linewidth&&a.stroke();1<this._points.length&&(this._data.leftend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(this._points[1],this._points[0],a,a.lineWidth),this._data.rightend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],a,a.lineWidth))}};
|
|
TradingView.PoligonRenderer.prototype.hitTest=function(a){if(void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(var b=TradingView.isMobile.any()?24:3,c=1;c<this._points.length;c++){var d=this._points[c-1],e=this._points[c],d=MathEx.distanceToSegment(d,e,a);if(d.distance<=b)return this._hittest}return this._data.filled&&this._data.fillBackground&&0<this._points.length&&(d=this._points[0],e=this._points[this._points.length-1],d=MathEx.distanceToSegment(d,e,a),d.distance<=
|
|
b)?this._hittest:this._data.filled&&this._data.fillBackground&&MathEx.isInPolygon(this._data.points,a)?this._backHittest:null};TradingView.ESDPaneView=function(a,b){this.D0=a;this.D1=b;this._metaInfo=b.metaInfo();this.lollipops=[];this._textCache={};this.templatesCache={};this.templatesCache.hovered=this.createTemplate(this.hoveredStyle);this.templatesCache["default"]=this.createTemplate(this.defaultStyle)};TradingView.ESDPaneView.prototype._getY=function(){for(var a=0,b=this.D0.panes(),c=b.length;c--;){var d=b[c];d.containsMainSeries()&&(a+=d.height())}return a};
|
|
TradingView.ESDPaneView.prototype.update=function(){this.lollipops=[];var a=this,b=this.D1.data(),c=this.D0.timeScale(),d=c.visibleBars(),e=this.D0.mainSeries().bars(),f=this.D1.priceScale(),g=this.D0.mainSeries().firstBar();if(f&&!f.isEmpty()&&!c.isEmpty()&&g&&b){var h=this._getY();b.range(d.firstBar(),d.lastBar()).each(function(b,d){a.addLollipop(h,e,c,f,b,d)});this.afterUpdate(h,e,c,f)}};
|
|
TradingView.ESDPaneView.prototype.addLollipop=function(a,b,c,d,e,f){var g=f[0],h=null,g=this.D1.metaInfo().id+"_"+g,k=this.D0.lastHittestData();if(k=k&&k.id==g)if(b=b.valueAt(e))h=b[TradingView.LOW_PLOT],d.isPercent()&&(b=this.D0.mainSeries().firstValue(),h=d.priceRange().convertToPercent(h,b)),h=d.priceToCoordinate(h);a=$.extend({id:g,basePoint:new MathEx.Point(c.indexToCoordinate(e)+1,a),hovered:k,barY:h},this.extraData(f));this.lollipops.push(a)};
|
|
TradingView.ESDPaneView.prototype.afterUpdate=function(a,b,c){};TradingView.ESDPaneView.prototype.extraData=function(a){throw Error("Not Implemented");};TradingView.ESDPaneView.prototype.createText=function(a,b){throw Error("Not Implemented");};TradingView.ESDPaneView.prototype.showBarLine=function(){return!0};TradingView.ESDPaneView.prototype.getStyle=function(a,b){return"hovered"==a?this.hoveredStyle:this.defaultStyle};TradingView.ESDPaneView.prototype.hasTooltip=function(a){return!0};
|
|
TradingView.ESDPaneView.prototype.renderer=function(){for(var a=new TradingView.CompositeRenderer,b=0;b<this.lollipops.length;b++){var c=this.lollipops[b],d=this.getStyle(c.hovered?"hovered":"default",c);if(c.hovered&&this.hasTooltip(c)){if(c.barY&&this.showBarLine()){var e={style:{lineStyle:d.barLine.lineStyle,strokeStyle:d.strokeStyle,lineWidth:d.lineWidth},startPoint:new MathEx.Point(c.basePoint.x,c.basePoint.y-d.lollipop.circleHeight),endPoint:new MathEx.Point(c.basePoint.x,c.barY)};a.append(new TradingView.BreakLineRenderer(e))}e=
|
|
$.extend({tooltipPoint:new MathEx.Point(c.basePoint.x,c.basePoint.y-d.lollipop.circleHeight-15),style:d,createText:this.createText},c);a.append(new TradingView.LollipopTooltipRenderer(e))}e=this.getTemplate(c.hovered?"hovered":"default",c);c={circlePoint:new MathEx.Point(c.basePoint.x,c.basePoint.y-d.lollipop.circleHeight),style:d,template:e,basePoint:c.basePoint,id:c.id};a.append(new TradingView.LollipopRenderer(c))}return a};TradingView.ESDPaneView.prototype.getTemplate=function(a){return this.templatesCache[a]};
|
|
TradingView.ESDPaneView.prototype.createTemplate=function(a){var b=document.createElement("canvas"),c=b.getContext("2d"),d=new MathEx.Point(a.lollipop.width/2,a.lollipop.height),e=new MathEx.Point(a.lollipop.width/2,a.lollipop.height-a.lollipop.circleHeight);this.drawStick(c,a,d,e);this.drawCircle(c,a,e);this.drawLabel(c,a,e);return b};
|
|
TradingView.ESDPaneView.prototype.drawCircle=function(a,b,c){a.fillStyle=b.lollipop.fillStyle;a.lineWidth=b.lollipop.lineWidth;CanvasEx.setLineStyle(a,CanvasEx.LINESTYLE_SOLID);a.beginPath();a.arc(c.x,c.y,b.lollipop.radius,0,2*Math.PI,!1);a.closePath();a.stroke();a.fill()};TradingView.ESDPaneView.prototype.drawLabel=function(a,b,c){a.textAlign="center";a.textBaseline="middle";a.fillStyle=b.lollipop.text.strokeStyle;a.font=b.lollipop.text.font;a.fillText(b.lollipop.text.label,c.x,c.y)};
|
|
TradingView.ESDPaneView.prototype.drawStick=function(a,b,c,d){a.strokeStyle=b.strokeStyle;a.lineWidth=b.lineWidth;CanvasEx.setLineStyle(a,CanvasEx.LINESTYLE_DASHED);CanvasEx.drawLine(a,c.x,c.y,d.x,d.y)};TradingView.BreakLineRenderer=function(a){this.data=a};
|
|
TradingView.BreakLineRenderer.prototype.draw=function(a){a.strokeStyle=this.data.style.strokeStyle;a.lineWidth=this.data.style.lineWidth;CanvasEx.setLineStyle(a,this.data.style.lineStyle);CanvasEx.drawLine(a,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)};TradingView.BreakLineRenderer.prototype.hitTest=function(a){return null};
|
|
TradingView.LollipopRenderer=function(a){this.data=a;this._hittest=new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR,a)};TradingView.LollipopRenderer.prototype.hitTest=function(a){return MathEx.isInCircle(this.data.circlePoint,this.data.style.lollipop.radius,a)?this._hittest:null};
|
|
TradingView.LollipopRenderer.prototype.draw=function(a){a.drawImage(this.data.template,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)};TradingView.LollipopTooltipRenderer=function(a){this._data=a;this.textRenderer=new TradingView.LollipopTooltipRenderer.TextRenderer};
|
|
TradingView.LollipopTooltipRenderer.prototype.draw=function(a){var b=this._data.tooltipPoint;this._data.createText(this._data,this.textRenderer);this.drawFrame(a,b);this.drawTip(a,b)};TradingView.LollipopTooltipRenderer.prototype.hitTest=function(a){return null};
|
|
TradingView.LollipopTooltipRenderer.prototype.drawTip=function(a,b){var c=this.calcMarginX(a,b.x,5),c=b.x+c;a.lineWidth=this._data.style.lineWidth;a.strokeStyle=this._data.style.fillStyle;a.fillStyle=this._data.style.fillStyle;a.beginPath();a.moveTo(b.x,b.y);a.lineTo(c-5,b.y-5);a.lineTo(c+5,b.y-5);a.fill();a.closePath();a.stroke();a.strokeStyle=this._data.style.strokeStyle;a.beginPath();a.moveTo(b.x,b.y);a.lineTo(c-5,b.y-5);a.moveTo(b.x,b.y);a.lineTo(c+5,b.y-5);a.closePath();a.stroke()};
|
|
TradingView.LollipopTooltipRenderer.prototype.drawFrame=function(a,b){var c=this.textRenderer.measure()+12+7,d=this.calcMarginX(a,b.x,100);a.lineWidth=this._data.style.lineWidth;CanvasEx.setLineStyle(a,CanvasEx.LINESTYLE_SOLID);a.strokeStyle=this._data.style.strokeStyle;a.fillStyle=this._data.style.fillStyle;a.beginPath();a.rect(b.x-100+d,b.y-5-c,200,c);a.closePath();a.stroke();a.fill();this.textRenderer.draw(a,new MathEx.Point(b.x-100+16+d,b.y-5-c+7+this.textRenderer.fontHeight))};
|
|
TradingView.LollipopTooltipRenderer.prototype.calcMarginX=function(a,b,c){var d=0;a=a.canvas.clientWidth;5>b-c?d=Math.abs(b-(c+5)):b+c>a-5&&(d=-Math.abs(a-(c+b+5)));return d};TradingView.LollipopTooltipRenderer.TextRenderer=function(){this.lines=[];this.fontHeight=12;this.font=this.fontHeight+"px Open Sans, sans-serif";this.lineSpacing=8;this.fillStyle="black"};
|
|
TradingView.LollipopTooltipRenderer.TextRenderer.prototype.draw=function(a,b){for(var c=b.y,d=0;d<this.lines.length;d++){var e=this.lines[d];a.font=this.font;e.options.fontWeight&&(a.font=e.options.fontWeight+" "+this.font);a.fillStyle=this.fillStyle;e.renderer(a,e.line,{x:b.x,y:c});c+=this.lineSpacing+this.fontHeight}};TradingView.LollipopTooltipRenderer.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing};
|
|
TradingView.LollipopTooltipRenderer.TextRenderer.prototype.basicRenderer=function(a,b,c){a.fillText(b,c.x,c.y)};TradingView.LollipopTooltipRenderer.TextRenderer.prototype.addMulticolorTextLine=function(a,b){this.addTextLine(a,b,this.multicolorRenderer)};TradingView.LollipopTooltipRenderer.TextRenderer.prototype.addTextLine=function(a,b,c){c||(c=this.basicRenderer);b||(b={});this.lines.push({line:a,renderer:c,options:b})};
|
|
TradingView.LollipopTooltipRenderer.TextRenderer.prototype.multicolorRenderer=function(a,b,c){for(var d=c.x,e=0;e<b.length;++e){var f=b[e];a.fillStyle=f.color;a.fillText(f.text,d,c.y);d+=a.measureText(f.text).width}};
|
|
TradingView.EarningsPaneView=function(a,b){this.defaultStyle={strokeStyle:"#E2745B",lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:64,circleHeight:35,radius:11,lineWidth:2,fillStyle:"white",strokeStyle:"#E2745B",text:{label:"E",strokeStyle:"#E2745B",font:"normal 12px Verdana, Arial, sans-serif"}}};this.hoveredStyle=$.extend(!0,{},this.defaultStyle,{lollipop:{fillStyle:"#E2745B",text:{strokeStyle:"white"}}});TradingView.ESDPaneView.call(this,a,
|
|
b)};inherit(TradingView.EarningsPaneView,TradingView.ESDPaneView);TradingView.EarningsPaneView.prototype.extraData=function(a){return{reported:a[1],estimate:a[2],period:a[3],date:a[4]}};TradingView.EarningsPaneView.prototype.afterUpdate=function(a,b,c,d){var e=this.D1.getEstimate();if(e){var f=e.value.slice();f[4]*=1E3;this.addLollipop(a,b,c,d,e.index,f)}};
|
|
TradingView.EarningsPaneView.prototype.createText=function(a,b){$.isNumeric(a.reported)&&b.addTextLine($.t("Earnings")+": "+accounting.formatMoney(a.reported),{fontWeight:"bold"});$.isNumeric(a.estimate)&&($.isNumeric(a.reported)?b.addTextLine($.t("Estimate")+": "+accounting.formatMoney(a.estimate)):b.addTextLine($.t("Estimate")+": "+accounting.formatMoney(a.estimate),{fontWeight:"bold"}));if($.isNumeric(a.reported)&&$.isNumeric(a.estimate)){var c=a.reported-a.estimate,d=0<c?"#238853":"#DD5538",e=
|
|
100*Math.abs(c/a.estimate),c=c.toFixed(2);isFinite(e)&&(c+=" ("+e.toFixed(2)+"%)");b.addMulticolorTextLine([{text:$.t("Surprise")+": ",color:"black"},{text:c,color:d}])}b.addTextLine($.t("Date")+": "+moment(a.date).format("l"));b.addTextLine($.t("Period Ending")+": "+moment.unix(a.period).format("M/YYYY"))};TradingView.EarningsPaneView.prototype.showBarLine=function(){return!this.D0.mainSeries().properties().esdShowBreaks.value()};
|
|
TradingView.EarningsPaneView.prototype.renderer=function(){var a=TradingView.ESDPaneView.prototype.renderer.call(this),b=this.D0.mainSeries().properties();if(b.esdShowBreaks.value())for(var c=b.esdBreaksStyle.color.value(),d=b.esdBreaksStyle.style.value(),b=b.esdBreaksStyle.width.value(),e=0;e<this.lollipops.length;e++){var f=this.lollipops[e],g=this.defaultStyle;f.hovered&&(g=this.hoveredStyle);f=$.extend({startPoint:new MathEx.Point(f.basePoint.x,f.basePoint.y-g.lollipop.circleHeight),endPoint:new MathEx.Point(f.basePoint.x,
|
|
0),style:{strokeStyle:c,lineWidth:b,lineStyle:d}},f);a.insert(new TradingView.BreakLineRenderer(f),0)}return a};
|
|
TradingView.SplitsPaneView=function(a,b){this.defaultStyle={strokeStyle:"#58B986",lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:64,circleHeight:35,radius:11,lineWidth:2,fillStyle:"white",strokeStyle:"#58B986",text:{label:"S",strokeStyle:"#58B986",font:"normal 12px Verdana, Arial, sans-serif"}}};this.hoveredStyle=$.extend(!0,{},this.defaultStyle,{lollipop:{fillStyle:"#58B986",text:{strokeStyle:"white"}}});TradingView.ESDPaneView.call(this,a,b)};
|
|
inherit(TradingView.SplitsPaneView,TradingView.ESDPaneView);TradingView.SplitsPaneView.prototype.extraData=function(a){return{numerator:a[2],denominator:a[1],date:a[3]}};TradingView.SplitsPaneView.prototype.createText=function(a,b){$.isNumeric(a.numerator)&&$.isNumeric(a.denominator)&&b.addTextLine($.t("Split")+": "+a.numerator+"/"+a.denominator,{fontWeight:"bold"});b.addTextLine($.t("Date")+": "+moment(a.date).format("l"))};
|
|
TradingView.DividendsPaneView=function(a,b){this.defaultStyle={strokeStyle:"#4E89CB",lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:64,circleHeight:35,radius:11,lineWidth:2,fillStyle:"white",strokeStyle:"#4E89CB",text:{label:"D",strokeStyle:"#4E89CB",font:"normal 12px Verdana, Arial, sans-serif"}}};this.hoveredStyle=$.extend(!0,{},this.defaultStyle,{lollipop:{fillStyle:"#4E89CB",text:{strokeStyle:"white"}}});TradingView.ESDPaneView.call(this,
|
|
a,b)};inherit(TradingView.DividendsPaneView,TradingView.ESDPaneView);TradingView.DividendsPaneView.prototype.extraData=function(a){return{value:a[1],date:a[2]}};TradingView.DividendsPaneView.prototype.createText=function(a,b){$.isNumeric(a.value)&&b.addTextLine($.t("Dividends")+": "+accounting.formatMoney(a.value),{fontWeight:"bold"});b.addTextLine($.t("Date")+": "+moment(a.date).format("l"))};TradingView.LevelledLineToolLabelsCache=function(){this._registeredSources={};this._sourcesToRow={};this._rowsToSources={};this._currentSymbol="";this._actualCapacity=0;this._actualWidth=1};TradingView.LevelledLineToolLabelsCache.prototype.levelsCount=function(){return 0};TradingView.LevelledLineToolLabelsCache.prototype.topByRow=function(a){return a*TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT};TradingView.LevelledLineToolLabelsCache.prototype.rowHeight=function(a){return TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT};
|
|
TradingView.LevelledLineToolLabelsCache.prototype.canvas=function(){this._canvas||(this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1E3).css("left",0),this._canvas.get(0).getContext("2d").font="12px Verdana");return this._canvas};TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT=14;TradingView.LevelledLineToolLabelsCache.prototype.points=function(a){return[a.points().item(0),a.points().item(1)]};
|
|
TradingView.LevelledLineToolLabelsCache.prototype.startPoint=function(a,b){return b?a.points().item(0):a.points().item(1)};TradingView.LevelledLineToolLabelsCache.prototype.priceRange=function(a,b){var c=this.points(a),d=c[0],c=c[1];return b?c.price-d.price:d.price-c.price};TradingView.LevelledLineToolLabelsCache.prototype.sourceIsReady=function(a){return 2<=a.points().size()};
|
|
TradingView.LevelledLineToolLabelsCache.prototype._calculateWidth=function(a){if(!this.sourceIsReady(a))return null;var b=this.canvas().get(0).getContext("2d");b.font="12px Verdana";var c=a.properties().showPrices?a.properties().showPrices.value():!1,d=a.properties().coeffsAsPercents?a.properties().coeffsAsPercents.value():!1,e=a.properties().showCoeffs.value(),f=a.priceScale().formatter(),g=this.points(a),h=g[1];if(!g[0]||!h)return null;var k=!1,g=a.properties();g.reverse&&g.reverse.value()&&(k=
|
|
g.reverse.value());var h=this.priceRange(a,k),k=this.startPoint(a,k).price,l;if(a.priceScale().isPercent()&&(l=a.ownerSource().firstValue(),null===l))return 0;for(var m=0,n=[],p=1;p<=this.levelsCount();p++){var r=g["level"+p].coeff.value(),t=k+r*h;a.priceScale().isPercent()&&(t=a.priceScale().priceRange().convertToPercent(t,l));var v="";e&&(v=d?v+(""+Math.round(1E4*r)/100+"%"):v+(""+r));c&&(v+="("+f.format(t)+")");r=b.measureText(v).width;v={text:v,left:m,width:r+4};n.push(v);m+=v.width}return{totalWidth:m,
|
|
cells:n}};
|
|
TradingView.LevelledLineToolLabelsCache.prototype._effectiveState=function(a){var b={},c=a.properties();c.showPrices&&(b.showPrices=c.showPrices.value());c.coeffsAsPercents&&(b.coeffsAsPercents=c.coeffsAsPercents.value());b.showCoeffs=c.showCoeffs.value();a.priceScale()&&a.priceScale().formatter().state&&(b.formatter=a.priceScale().formatter().state());c.reverse&&(b.reverse=c.reverse.value());b.p1=a.points().item(0);b.p2=a.points().item(1);3==a.points().size()&&(b.p3=a.points().item(2));b.items=[];
|
|
for(a=1;a<=this.levelsCount();a++){var d=c["level"+a],e=d.coeff.value(),d=d.color.value();b.items.push({coeff:e,color:d})}return b};TradingView.LevelledLineToolLabelsCache.prototype._findEmptyRow=function(a){for(var b=0;this._rowsToSources[b];)b++;this._rowsToSources[b]=a;b>=this._actualCapacity&&(this._actualCapacity++,a=this.canvas(),TradingView.resizeCanvas(a,this._actualWidth,TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT*this._actualCapacity));return b};
|
|
TradingView.LevelledLineToolLabelsCache.prototype._repaintSource=function(a,b,c){c=TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT*c.row;var d=this.canvas().get(0).getContext("2d");d.clearRect(0,c,this._actualWidth,TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT);d.textBaseline="bottom";d.font="12px Verdana";c+=TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT;for(var e=0;e<a.cells.length;e++){var f=a.cells[e];d.fillStyle=b.items[e].color;d.fillText(f.text,f.left,c)}};
|
|
TradingView.LevelledLineToolLabelsCache.prototype.removeSource=function(a){if(this._sourcesToRow[a]){var b=this._sourcesToRow[a].row,c=this.canvas().get(0).getContext("2d");c.save();c.clearRect(0,this.topByRow(b),this._actualWidth,TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT);c.restore();delete this._sourcesToRow[a];delete this._rowsToSources[b]}};
|
|
TradingView.LevelledLineToolLabelsCache.prototype._effectiveStatesEquals=function(a,b){var c=function(a,b){return a||b?a&&!b||!a&&b?!0:a.index!=b.index||a.price!=b.price:!1},d=function(a,b){return a.coeff!=b.coeff||a.color!=b.color?!0:!1};if(a&&!b||!a&&b||a.showPrices!=b.showPrices||a.coeffsAsPercents!=b.coeffsAsPercents||a.showCoeffs!=b.showCoeffs||a.reverse!=b.reverse||function(a,b){return a||b?a&&!b||!a&&b||a.minMove!=b.minMove||a.minMove2!=b.minMove2||a.fractional!=b.fractional||a.fractionalLength!=
|
|
b.fractionalLength?!0:!1:!1}(a.formatter,b.formatter)||c(a.p1,b.p1)||c(a.p2,b.p2)||c(a.p3,b.p3)||a.items.length!=b.items.length)return!1;for(c=0;c<a.items.length;c++)if(d(a.items[c],b.items[c]))return!1;return!0};
|
|
TradingView.LevelledLineToolLabelsCache.prototype.updateSource=function(a){var b=a.properties().symbol.value();this._currentSymbol!=b&&(this._currentSymbol=b,this._sourcesToRow={},this._rowsToSources={});if(!this._sourcesToRow[a.id()]){var c=this._findEmptyRow(a.id());this._sourcesToRow[a.id()]={effectiveState:null,row:c}}c=this._sourcesToRow[a.id()].effectiveState;b=this._effectiveState(a);if(!this._effectiveStatesEquals(c,b)){var d=this._calculateWidth(a);d?(this._sourcesToRow[a.id()].effectiveState=
|
|
b,d.totalWidth>this._actualWidth&&(TradingView.resizeCanvas(this.canvas(),d.totalWidth,TradingView.LevelledLineToolLabelsCache.ROW_HEIGHT*this._actualCapacity),this._actualWidth=d.totalWidth),c=this._sourcesToRow[a.id()],this._repaintSource(d,b,c),this._sourcesToRow[a.id()].effectiveState=b,this._sourcesToRow[a.id()].preparedCells=d):this._sourcesToRow[a.id()].effectiveState=null}return this._sourcesToRow[a.id()]};TradingView.LineDataSourceFactory=function(){};TradingView.LineDataSourceFactory.isValid=function(a){return TradingView[a]?!0:!1};
|
|
TradingView.LineDataSourceFactory.create=function(a,b,c,d,e){assert(TradingView.LineDataSourceFactory.isValid(a),"Unknown line tool: "+a);var f=TradingView[a];return"LineToolVbPFixed"==a?new f(b,c,d,e):"LineToolRegressionTrend"==a?new f(b,c,d):0<="LineStudyMtpAnalysis LineStudyMtpDecisionPoint LineStudyMtpRiskReward LineStudyMtpElliotWaveMain LineStudyMtpElliotWaveMajor LineStudyMtpElliotWaveMinor LineStudyMtpDownWave1OrA LineStudyMtpDownWave2OrB LineStudyMtpDownWave3 LineStudyMtpDownWave4 LineStudyMtpDownWave5 LineStudyMtpDownWaveC LineStudyMtpUpWave1OrA LineStudyMtpUpWave2OrB LineStudyMtpUpWave3 LineStudyMtpUpWave4 LineStudyMtpUpWave5 LineStudyMtpUpWaveC".split(" ").indexOf(a)?new f(b,
|
|
c,d):new f(b,c)};TradingView.J60=function(a,b){J90.call(this,a,b);this._invalidated=!0};inherit(TradingView.J60,J90);
|
|
TradingView.J60.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);if(this._pattern&&2==this.R99.points().size()){var a=this.R99.points().item(0).index,b=this.R99.points().item(1).index,b=a<b?this._points.item(0):this._points.item(1);if(!b)return new TradingView.CompositeRenderer;var c=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this._pattern.length-1));if(this.R99.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE||
|
|
this.R99.properties().mode.value()==TradingView.LineToolBarsPattern.OPENCLOSE_MODE)for(var a=new TradingView.CompositeRenderer,d=this.R99.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE?["high","low"]:["open","close"],e=d[0],d=d[1],f=0;f<this._pattern.length;f++){var g=Math.round(b.x+f*c+.5),h=b.y+Math.round(this._pattern[f][e]),k=b.y+Math.round(this._pattern[f][d]),l={};l.points=(new List).append(new MathEx.Point(g-1,h)).append(new MathEx.Point(g+1,k));l.color=this.R99.properties().color.value();
|
|
l.linewidth=1;l.backcolor=this.R99.properties().color.value();l.fillBackground=!0;l.transparency=10;a.append(new TradingView.RectangleRenderer(l))}else a=new TradingView.CompositeRenderer,l={},l.barSpacing=c,l.items=new List(this._pattern),l.histogramBase=0,l.lineIndex=0,l.lineColor=TradingView.generateColor(this.R99.properties().color.value(),10),l.lineStyle=CanvasEx.LINESTYLE_SOLID,l.lineWidth=2,l.hittest=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT),a.append(new R68(l));
|
|
this.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points.toArray()}))}else{a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;b=this._points.item(0);c=this._points.item(1);Math.min(b.x,c.x);Math.max(b.x,c.x);e={};e.points=(new List).append(b);e.color="#808080";e.linewidth=1;e.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new TradingView.VertLineRenderer(e));e={};e.points=(new List).append(c);e.color="#808080";e.linewidth=1;e.linestyle=CanvasEx.LINESTYLE_SOLID;
|
|
a.append(new TradingView.VertLineRenderer(e));b={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b))}return a};
|
|
TradingView.J60.prototype.update=function(){J90.prototype.update.call(this);this._invalidated=!0};
|
|
TradingView.J60.prototype.updateImpl=function(){if(!(!this.R99.priceScale()||this.R99.priceScale().isEmpty()||2>this._points.size()))if(this.R99._pattern&&0<this.R99._pattern.length&&2==this.R99.points().size()){var a=this.R99.priceScale(),b=this.R99.firstPatternPrice();this.R99.lastPatternPrice();this.R99.points().item(0);this.R99.points().item(1);var c=this.R99.pressCoeff(),a=this.R99.priceScale(),d=this.R99.ownerSource().firstValue(),
|
|
e=a.priceRange(),f;if(a.isPercent()){var g=e.convertToPercent(b,d);f=a.priceToCoordinate(g)}else f=a.priceToCoordinate(b);var h=function(g){g=(g-b)*c+b;a.isPercent()&&(g=e.convertToPercent(g,d));return a.priceToCoordinate(g)-f},g=parseInt(this.R99.properties().mode.value()),k=this.R99.points().item(0).index,l=this.R99.points().item(1).index,m=this._points.item(k>l?1:0),n=m.x,p=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this.R99._pattern.length-1));this._pattern=this.R99._pattern.map({0:function(a){return{high:h(a[TradingView.HIGH_PLOT]),
|
|
low:h(a[TradingView.LOW_PLOT])}},1:function(a,b){return new MathEx.Point(n+b*p,h(a[TradingView.CLOSE_PLOT])+m.y)},2:function(a){return{open:h(a[TradingView.OPEN_PLOT]),close:h(a[TradingView.CLOSE_PLOT])}},3:function(a,b){return new MathEx.Point(n+b*p,h(a[TradingView.OPEN_PLOT])+m.y)},4:function(a,b){return new MathEx.Point(n+b*p,h(a[TradingView.HIGH_PLOT])+m.y)},5:function(a,b){return new MathEx.Point(n+b*p,h(a[TradingView.LOW_PLOT])+m.y)},6:function(a,b){return new MathEx.Point(n+b*p,h((a[TradingView.HIGH_PLOT]+
|
|
a[TradingView.LOW_PLOT])/2)+m.y)}}[g])}else delete this._pattern};
|
|
TradingView.LineToolBarsPattern=function(a,b){this._constructor="LineToolBarsPattern";var c=b?b:new J52("linetoolbarspattern");R47.call(this,a,new TradingView.J60(this,a),c);c.mirrored.listeners().subscribe(this,TradingView.LineToolBarsPattern.prototype.mirror);c.flipped.listeners().subscribe(this,TradingView.LineToolBarsPattern.prototype.flip);c.addExclusion("mirrored");c.addExclusion("flipped");this._scaleCoeff=1;this.version=TradingView.LineToolBarsPattern.version;
|
|
this._pattern=[];this.D2.mode.listeners().subscribe(this,TradingView.LineToolBarsPattern.prototype.onModeChanged)};inherit(TradingView.LineToolBarsPattern,R47);TradingView.LineToolBarsPattern.version=2;TradingView.LineToolBarsPattern.BARS_MODE=0;TradingView.LineToolBarsPattern.LINE_MODE=1;TradingView.LineToolBarsPattern.OPENCLOSE_MODE=2;TradingView.LineToolBarsPattern.LINEOPEN_MODE=3;TradingView.LineToolBarsPattern.LINEHIGH_MODE=4;
|
|
TradingView.LineToolBarsPattern.LINELOW_MODE=5;TradingView.LineToolBarsPattern.LINEHL2_MODE=6;TradingView.LineToolBarsPattern.prototype.onModeChanged=function(){var a=this.patternPriceDiff(),a=a*this._pressCoeff;this._points.item(1).price=this._timePoint.item(1).price=this._points.item(0).price+a};
|
|
TradingView.LineToolBarsPattern.prototype.additionalActions=function(a){var b=new TradingView.Action({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),c=new TradingView.Action({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});b.callbacks().subscribe(null,function(b){b=b.callbackContext().target;a.setProperty(b.properties().mirrored,!b.properties().mirrored.value(),"Bats Pattern Mirroring");
|
|
b.updateAllViews();b.D0.updateSource(b)});c.callbacks().subscribe(null,function(b){b=b.callbackContext().target;a.setProperty(b.properties().flipped,!b.properties().flipped.value(),"Bats Pattern Flipping");b.updateAllViews();b.D0.updateSource(b)});var d=new TradingView.Action({checkable:!0,text:$.t("Restore Size")}),e=this;d.callbacks().subscribe(null,function(b){b=e.points().item(0);var c=e.patternPriceDiff(),c=b.price+c;b=b.index+e._pattern.length-1;a.startChangingLinetool(e,{price:c,index:b},
|
|
1,{});a.changeLinePoint({price:c,index:b},{});a.endChangingLinetool()});return[b,c,d]};TradingView.LineToolBarsPattern.prototype.pointsCount=function(){return 2};TradingView.LineToolBarsPattern.prototype.state=function(a){a=R47.prototype.state.call(this,a);a.pattern=this._pattern;return a};TradingView.LineToolBarsPattern.prototype.restoreData=function(a){a.pattern&&(this._pattern=a.pattern)};TradingView.LineToolBarsPattern.prototype.title=function(){return"Bars Pattern"};
|
|
TradingView.LineToolBarsPattern.prototype.cloneData=function(a){this._pattern=TradingView.clone(a._pattern)};
|
|
TradingView.LineToolBarsPattern.prototype.mirror=function(){for(var a=this._pattern,b=a[0][TradingView.HIGH_PLOT],c=Math.min(a[0][TradingView.LOW_PLOT],a[0][TradingView.HIGH_PLOT]),d=Math.max(a[0][TradingView.LOW_PLOT],a[0][TradingView.HIGH_PLOT]),e=1;e<a.length;e++)c=Math.min(c,a[e][TradingView.LOW_PLOT]),d=Math.max(d,a[e][TradingView.HIGH_PLOT]);if(c<d)for(c=(c+d)/2,e=0;e<a.length;e++)a[e][TradingView.HIGH_PLOT]=c-(a[e][TradingView.HIGH_PLOT]-c),a[e][TradingView.LOW_PLOT]=c-(a[e][TradingView.LOW_PLOT]-
|
|
c),a[e][TradingView.OPEN_PLOT]=c-(a[e][TradingView.OPEN_PLOT]-c),a[e][TradingView.CLOSE_PLOT]=c-(a[e][TradingView.CLOSE_PLOT]-c);b=a[0][TradingView.HIGH_PLOT]-b;a=a[a.length-1][TradingView.LOW_PLOT]-a[0][TradingView.HIGH_PLOT];this._points.item(0).price+=b;this._points.item(1).price=this._points.item(0).price+a;this.updateAllViews()};
|
|
TradingView.LineToolBarsPattern.prototype.flip=function(){this._points.item(0).price=this._points.item(1).price;for(var a=0;a<this._pattern.length/2;a++){var b=this._pattern[a];this._pattern[a]=this._pattern[this._pattern.length-a-1];this._pattern[this._pattern.length-a-1]=b}a=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT];this._points.item(1).price=this._points.item(0).price+a;this.updateAllViews()};
|
|
TradingView.LineToolBarsPattern.prototype.firstPatternPrice=function(){var a=parseInt(this.properties().mode.value(),10);return a==TradingView.LineToolBarsPattern.LINEHL2_MODE?a=(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:a=this._pattern[0][{0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT}[a]]};
|
|
TradingView.LineToolBarsPattern.prototype.lastPatternPrice=function(){var a=parseInt(this.properties().mode.value(),10);return a==TradingView.LineToolBarsPattern.LINEHL2_MODE?a=(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:a=this._pattern[this._pattern.length-1][{0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT}[a]]};
|
|
TradingView.LineToolBarsPattern.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()};TradingView.LineToolBarsPattern.prototype.pressCoeff=function(){var a=this.patternPriceDiff(),b=this.points().item(0).price;return this._pressCoeff=a=(this.points().item(1).price-b)/a};
|
|
TradingView.LineToolBarsPattern.prototype.addPoint=function(a,b){var c=this.D0.mainSeries(),d=c.nearestIndex(a.index,TradingView.SEARCH_NEAREST_RIGHT);this.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE?a.price=c.bars().valueAt(d)[TradingView.HIGH_PLOT]:a.price=c.bars().valueAt(d)[TradingView.CLOSE_PLOT];d=this.priceScale().priceRange().length();a.price+=.05*d;d=c.priceScale();d.isPercent()&&(c=c.firstValue(),a.price=d.priceRange().convertToPercent(a.price,c));if(c=R47.prototype.addPoint.call(this,
|
|
a,b,!0)){var d=Math.min(this.points().item(0).index,this.points().item(1).index),e=Math.max(this.points().item(0).index,this.points().item(1).index),d=this.D0.mainSeries().nearestIndex(d,TradingView.SEARCH_NEAREST_RIGHT),e=this.D0.mainSeries().nearestIndex(e,TradingView.SEARCH_NEAREST_LEFT);this.points().item(0).index>this.points().item(1).index&&(this._points.item(0).price=this._points.item(1).price);this._pattern=[];for(var f=d;f<=e;f++){var g=this.D0.mainSeries().data().valueAt(f);
|
|
this._pattern.push(TradingView.clone(g))}0<this._pattern.length&&(f=this.patternPriceDiff(),this._points.item(1).price=this._points.item(0).price+f,this._points.item(1).index=this._points.item(0).index+(e-d),this.normalizePoints(),this.createServerPoints())}return c};
|
|
TradingView.LineToolBarsPattern.prototype.migrateVersion=function(a,b,c){1==a&&0<this._pattern.length&&(a=this.patternPriceDiff(),2==this._timePoint.size()&&(this._timePoint.item(1).price=this._timePoint.item(0).price+a),2==this._points.size()&&(this._points.item(1).price=this._points.item(0).price+a))};J66=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J66,J90);
|
|
J66.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size()||2>this.R99.points().size())return a;var b=this.R99.properties();if(b.fillBackground&&b.fillBackground.value()){var c={};c.points=this._points;c.color="white";c.linewidth=0;c.backcolor=b.backgroundColor.value();c.fillBackground=!0;c.transparency=b.backgroundTransparency.value();a.append(new TradingView.RectangleRenderer(c))}var d=this,e=function(b,c){var e={};e.points=
|
|
(new List).append(b).append(c);e.width=d.D0.timeScale().width();e.height=d.R99.priceScale().height();e.color=d.R99.properties().linecolor.value();e.linewidth=d.R99.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=R47.LINEEND_NORMAL;e.rightend=R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(e))},f=this._points.item(0),g=this._points.item(1),g=new MathEx.Point(f.x,
|
|
g.y);e(f,g);f=this._points.item(0);g=this._points.item(1);f=new MathEx.Point(g.x,f.y);e(f,g);var f=this._points.item(0),g=this._points.item(1),c=(f.y+g.y)/2,e=new MathEx.Point(f.x,c),h=new MathEx.Point(g.x,c),c={};c.points=(new List).append(e).append(h);c.width=d.D0.timeScale().width();c.height=d.R99.priceScale().height();c.color=d.R99.properties().linecolor.value();c.linewidth=d.R99.properties().linewidth.value();c.linestyle=CanvasEx.LINESTYLE_DASHED;c.extendleft=!1;c.extendright=
|
|
!1;c.leftend=R47.LINEEND_NORMAL;c.rightend=R47.LINEEND_ARROW;a.append(new TradingView.TrendLineRenderer(c));var c=this.R99.points().item(0).index,h=this.R99.points().item(1).index,e=h-c,c=this.D0.timeScale().indexToUserTime(c),k=this.D0.timeScale().indexToUserTime(h),h="";c&&k&&(c=(k.valueOf()-c.valueOf())/1E3,h=", "+(new TradingView.TimeSpanFormatter).format(c));k=f.x>g.x?f.x:g.x;k=new MathEx.Point(k+30,.5*(f.y+g.y));c={};c.points=(new List).append(k);
|
|
c.text=$.t("{0} bars").format(e)+h;c.color=b.textcolor.value();c.font=b.font.value();c.offsetX=b.fontsize.value()*c.text.length*.2;c.offsetY=-13;c.vertAlign="top";c.horzAlign="center";c.backgroundRoundRect=4;c.backgroundHorzInflate=.4*b.fontsize.value();c.backgroundVertInflate=.2*b.fontsize.value();c.fontsize=b.fontsize.value();b.fillLabelBackground&&b.fillLabelBackground.value()&&(c.backgroundColor=b.labelBackgroundColor.value(),c.backgroundTransparency=1-b.labelBackgroundTransparency.value()/100||
|
|
0);b.drawBorder&&b.drawBorder.value()&&(c.borderColor=b.borderColor.value());a.append(new TextRenderer(c,this._rendererCache));this.addAnchors(a);return a};TradingView.LineToolDateRange=function(a,b){this._constructor="LineToolDateRange";var c=b?b:new J52("linetooldaterange");R47.call(this,a,new J66(this,a),c)};inherit(TradingView.LineToolDateRange,R47);
|
|
TradingView.LineToolDateRange.prototype.pointsCount=function(){return 2};TradingView.LineToolDateRange.prototype.title=function(){return"Date Range"};R6=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(R6,J90);R6.prototype.update=function(){this._invalidated=!0};R6.prototype.updateImpl=function(){J90.prototype.update.call(this)};
|
|
R6.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size()||2>this.R99.points().size())return a;var b=this.R99.properties(),c,d;if(b.fillBackground&&b.fillBackground.value()){var e={};e.points=this._points;e.color="white";e.linewidth=0;e.backcolor=b.backgroundColor.value();e.fillBackground=!0;e.transparency=b.backgroundTransparency.value();a.append(new TradingView.RectangleRenderer(e))}var f=
|
|
this,e=function(b,c){var d={};d.points=(new List).append(b).append(c);d.width=f.D0.timeScale().width();d.height=f.R99.priceScale().height();d.color=f.R99.properties().linecolor.value();d.linewidth=f.R99.properties().linewidth.value();d.linestyle=CanvasEx.LINESTYLE_SOLID;d.extendleft=!1;d.extendright=!1;d.leftend=R47.LINEEND_NORMAL;d.rightend=R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(d))};c=this._points.item(0);d=this._points.item(1);
|
|
d=new MathEx.Point(d.x,c.y);e(c,d);c=this._points.item(0);d=this._points.item(1);c=new MathEx.Point(c.x,d.y);e(c,d);c=this._points.item(0);d=this._points.item(1);var e=(c.x+d.x)/2,g=new MathEx.Point(e,c.y),h=new MathEx.Point(e,d.y),e={};e.points=(new List).append(g).append(h);e.width=f.D0.timeScale().width();e.height=f.R99.priceScale().height();e.color=f.R99.properties().linecolor.value();e.linewidth=f.R99.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_DASHED;e.extendleft=
|
|
!1;e.extendright=!1;e.leftend=R47.LINEEND_NORMAL;e.rightend=R47.LINEEND_ARROW;a.append(new TradingView.TrendLineRenderer(e));var g=this.R99.points().item(0).price,h=this.R99.points().item(1).price,e=h-g,k=100*e/g,k=this.R99.priceScale().formatter().format(e)+" ("+Math.round(100*k)/100+"%)",e={};h>g?(g=d.clone(),g.y-=2*b.fontsize.value(),g.x=.5*(c.x+d.x)):(g=d.clone(),g.x=.5*(c.x+d.x),g.y+=.7*b.fontsize.value());e.points=(new List).append(g);
|
|
e.text=k;e.color=b.textcolor.value();e.font=b.font.value();e.offsetX=0;e.offsetY=0;e.vertAlign="middle";e.horzAlign="center";e.fontsize=b.fontsize.value();e.backgroundRoundRect=4;e.backgroundHorzInflate=.4*b.fontsize.value();e.backgroundVertInflate=.2*b.fontsize.value();b.fillLabelBackground&&b.fillLabelBackground.value()&&(e.backgroundColor=b.labelBackgroundColor.value(),e.backgroundTransparency=1-b.labelBackgroundTransparency.value()/100||0);b.drawBorder&&b.drawBorder.value()&&(e.borderColor=b.borderColor.value());
|
|
a.append(new TextRenderer(e,this._rendererCache));this.addAnchors(a);return a};TradingView.LineToolPriceRange=function(a,b){this._constructor="LineToolPriceRange";var c=b?b:new J52("linetoolpricerange");R47.call(this,a,new R6(this,a),c)};inherit(TradingView.LineToolPriceRange,R47);TradingView.LineToolPriceRange.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolPriceRange.prototype.title=function(){return"Price Range"};TradingView.ParallelChannelRenderer=function(a,b,c){this._data=a;this._hittestResult=b||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittestResult=c||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND)};
|
|
TradingView.ParallelChannelRenderer.prototype.extendPoints=function(a,b,c,d){var e=new MathEx.Point(0,0);c=new MathEx.Point(c,d);this._data.extendleft&&(d=a.substract(b),(d=MathEx.intersectRayWithRect(a,a.add(d),e,c))&&(a=d));this._data.extendright&&(d=b.substract(a),(d=MathEx.intersectRayWithRect(b,b.add(d),e,c))&&(b=d));this._data.extendleft&&!MathEx.pointInRect(a,e,c)&&MathEx.pointInRect(b,e,c)&&(d=MathEx.intersectRayWithRect(b,a,e,c))&&(a=d);this._data.extendright&&!MathEx.pointInRect(b,e,c)&&
|
|
MathEx.pointInRect(a,e,c)&&(d=MathEx.intersectRayWithRect(a,b,e,c))&&(b=d);return[a,b]};
|
|
TradingView.ParallelChannelRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),b=this.extendPoints(b,c,this._data.width,this._data.height);this._data.skipLines||CanvasEx.drawLine(a,b[0].x,b[0].y,b[1].x,b[1].y);var d;if(4==this._data.points.size()&&(c=this._data.points.item(2),d=this._data.points.item(3),c&&d)){c=
|
|
this.extendPoints(c,d,this._data.width,this._data.height);this._data.skipLines||this._data.skipTopLine||CanvasEx.drawLine(a,c[0].x,c[0].y,c[1].x,c[1].y);if(this._data.fillBackground){d=Math.max(b[1].x,c[1].x);var e=Math.max(b[1].y,c[1].y),f=Math.min(c[0].x,b[0].x),g=Math.min(c[0].y,b[0].y);if(!(isFinite(d)&&isFinite(e)&&isFinite(f)&&isFinite(g)))return;a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency);a.beginPath();a.moveTo(b[0].x,b[0].y);a.lineTo(b[1].x,b[1].y);
|
|
this._data.extendright&&(d=MathEx.optionalCorner(b[1],c[1],this._data.width,this._data.height))&&a.lineTo(d.x,d.y);a.lineTo(c[1].x,c[1].y);a.lineTo(c[0].x,c[0].y);this._data.extendleft&&(d=MathEx.optionalCorner(c[0],b[0],this._data.width,this._data.height))&&a.lineTo(d.x,d.y);a.lineTo(b[0].x,b[0].y);a.fill()}this._data.showMidline&&!this._data.skipLines&&(a.strokeStyle=this._data.midcolor,a.lineWidth=this._data.midlinewidth,a.lineStyle=this._data.midlinestyle,b=this._data.points.item(0).add(this._data.points.item(2)).scaled(.5),
|
|
c=this._data.points.item(1).add(this._data.points.item(3)).scaled(.5),c=this.extendPoints(b,c,this._data.width,this._data.height),(b=TradingView.TrendLineRenderer.prototype.lineClipping(c[0],c[1],this._data.width,this._data.height))&&CanvasEx.drawLine(a,Math.round(b[0].x),Math.round(b[0].y),Math.round(b[1].x),Math.round(b[1].y)))}}};
|
|
TradingView.ParallelChannelRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b,c,d,e;this._data.floatPoints?(b=this._data.floatPoints.item(0),c=this._data.floatPoints.item(1)):(b=this._data.points.item(0),c=this._data.points.item(1));e=this.extendPoints(b,c,this._data.width,this._data.height);e=MathEx.distanceToSegment(e[0],e[1],a);if(3>=e.distance)return this._hittestResult;this._data.floatPoints?(d=this._data.floatPoints.item(2),e=this._data.floatPoints.item(3)):
|
|
(d=this._data.points.item(2),e=this._data.points.item(3));if(4==this._data.points.size()&&!this._data.skipTopLine){if(!d||!e)return null;e=this.extendPoints(d,e,this._data.width,this._data.height);e=MathEx.distanceToSegment(e[0],e[1],a);if(3>=e.distance)return this._hittestResult;if(this._data.showMidline&&!this._data.skipLines){e=this._data.points.item(0).add(this._data.points.item(2)).scaled(.5);var f=this._data.points.item(1).add(this._data.points.item(3)).scaled(.5);e=this.extendPoints(e,f,this._data.width,
|
|
this._data.height);e=MathEx.distanceToSegment(e[0],e[1],a);if(3>=e.distance)return this._hittestResult}}if(this._data.hittestOnBackground&&this._data.fillBackground&&4==this._data.points.size()){f=(c.y-b.y)/(c.x-b.x);e=b.y+f*(a.x-b.x);f=d.y+f*(a.x-d.x);d=Math.max(e,f);e=Math.min(e,f);f=Math.min(b.x,c.x);b=Math.max(b.x,c.x);if(!this._data.extendleft&&a.x<f||!this._data.extendright&&a.x>b)return null;if(a.y>=e&&a.y<=d)return this._backHittestResult}return null};
|
|
J98=function(a,b){J90.call(this,a,b);this._invalidated=!0};inherit(J98,J90);J98.prototype.update=function(){this._invalidated=!0};
|
|
J98.prototype.updateImpl=function(){J90.prototype.update.call(this);if(this.R99.priceScale()&&!this.R99.priceScale().isEmpty()&&0!==this.R99.points().size()&&(this.R99._priceOffset||this.R99.calculatePriceDiff(),3===this._points.size()&&this.R99._priceOffset)){var a=this._points.item(0),b=this._points.item(1),c=this.R99._priceOffset+this.R99.points().item(0).price,d=this.R99._priceOffset+this.R99.points().item(1).price;
|
|
this._p3=a.clone();this._p4=b.clone();a=this.R99.priceScale();a.isLog()?(a=.5*(c+d)-this.R99._priceOffset,c=.5*(c+d),d=this.R99.priceScale().priceToCoordinate(a),c=this.R99.priceScale().priceToCoordinate(c)-d,this._p3.y+=c,this._p4.y+=c):(a.isPercent()&&(b=this.R99.ownerSource().firstValue(),c=a.priceRange().convertToPercent(c,b),d=a.priceRange().convertToPercent(d,b)),this._p3.y=this.R99.priceScale().priceToCoordinate(c),this._p4.y=this.R99.priceScale().priceToCoordinate(d))}};
|
|
J98.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a={};a.points=new List;1<this._points.size()&&(a.points.append(this._points.item(0)),a.points.append(this._points.item(1)));2<this._points.size()&&(a.points.append(this._p3),a.points.append(this._p4));a.color=this.R99.properties().linecolor.value();a.width=this.D0.timeScale().width();a.height=this.R99.priceScale().height();var b=this.R99.properties();a.linewidth=
|
|
b.linewidth.value();a.linestyle=b.linestyle.value();a.extendleft=b.extendLeft.value();a.extendright=b.extendRight.value();a.fillBackground=b.fillBackground.value();a.backcolor=b.backgroundColor.value();a.transparency=b.transparency.value();a.showMidline=b.showMidline.value();a.midlinewidth=b.midlinewidth.value();a.midlinestyle=b.midlinestyle.value();a.midcolor=b.midlinecolor.value();a.fillBackground=b.fillBackground.value();a.hittestOnBackground=!0;var c=new TradingView.CompositeRenderer;c.append(new TradingView.ParallelChannelRenderer(a));
|
|
if(this.isAnchorsRequired()){a=[];a.push(this._points.item(0));this._points.item(1)&&a.push(this._points.item(1));this._p3&&(a.push(this._p3.add(this._p4).scaled(.5)),a[2].data=2);var d=3==this._points.size()&&!this._p3;this.D0.lineBeingCreated()!=this.R99||d||a.pop();c.append(this.createLineAnchor({points:a}))}if(!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&2<=this._points.size()){var e=this._points;this.R99.getAlertIsActive(function(a){c.append(new TradingView.PaneRendererClockIcon({point1:e.item(0),
|
|
point2:e.item(1),color:a?b.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return c};TradingView.LineToolParallelChannel=function(a,b){this._constructor="LineToolParallelChannel";var c=b?b:new J52("linetoolparallelchannel");R47.call(this,a,new J98(this,a),c)};inherit(TradingView.LineToolParallelChannel,R47);
|
|
TradingView.LineToolParallelChannel.prototype.addPoint=function(a){if(a=R47.prototype.addPoint.call(this,a)){var b=this.points().item(0);this._points.item(2).index=b.index;this._points.item(2).price=b.price+this._priceOffset}return a};
|
|
TradingView.LineToolParallelChannel.prototype.calculatePriceDiff=function(){if(3===this.points().size()){var a=this.points().item(0),b=this.points().item(1),c=this.points().item(2);if(a.index!==b.index){var d=this.priceScale();if(null!==d)if(d.isLog()){var e=this.D0.timeScale();if(!e.isEmpty()){var f=e.indexToCoordinate(a.index),g=e.indexToCoordinate(b.index),a=d.priceToCoordinate(a.price),b=d.priceToCoordinate(b.price),e=e.indexToCoordinate(c.index);d.priceToCoordinate(c.price);f=a+(b-a)/(g-
|
|
f)*(e-f);c=d.priceToCoordinate(c.price)-f;a=.5*(a+b);f=d.coordinateToPrice(a);this._priceOffset=d.coordinateToPrice(a+c)-f}}else d=(b.price-a.price)/(b.index-a.index),this._priceOffset=c.price-(a.price+d*(c.index-a.index))}}};TradingView.LineToolParallelChannel.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(0));R47.prototype.setLastPoint.call(this,a);this.calculatePriceDiff()};
|
|
TradingView.LineToolParallelChannel.prototype.restorePoints=function(a,b,c){R47.prototype.restorePoints.call(this,a,b,c);a&&3<=a.length&&(this._priceOffset=a[2].price-a[0].price)};
|
|
TradingView.LineToolParallelChannel.prototype.setPoint=function(a,b,c){c&&c.shift&&2>a&&this._snapPoint45Degree(b,this.points().item(1-a));R47.prototype.setPoint.call(this,a,b,c);2===a&&this.calculatePriceDiff();a=this.points().item(0);this._points.item(2).index=a.index;this._points.item(2).price=a.price+this._priceOffset};TradingView.LineToolParallelChannel.prototype.pointsCount=function(){return 3};TradingView.LineToolParallelChannel.prototype.title=function(){return"Parallel Channel"};
|
|
TradingView.LineToolParallelChannel.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(0));return R47.prototype.addPoint.call(this,a,b)};TradingView.LineToolParallelChannel.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset};TradingView.LineToolParallelChannel.prototype.cloneData=function(a){this._priceOffset=a._priceOffset};
|
|
TradingView.LineToolParallelChannel.prototype.restoreData=function(a){a.priceOffset&&(this._priceOffset=a.priceOffset)};TradingView.LineToolParallelChannel.prototype.state=function(a){a=R47.prototype.state.call(this,a);a.priceOffset=this._priceOffset;return a};TradingView.LineToolParallelChannel.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolParallelChannel.prototype._getAlertPlots=function(){function a(a,b){return a.index<=b.index?[a,b]:[b,a]}var b=this._points.clone().toArray().splice(0,2),b=b.concat([{price:b[0].price+this._priceOffset,time:b[0].time,index:b[0].index},{price:b[1].price+this._priceOffset,time:b[1].time,index:b[1].index}]),c=a(b[0],b[1]),d=a(b[2],b[3]),e;0>this._priceOffset?e=d:(e=c,c=d);var d=this.properties().extendLeft.value(),f=this.properties().extendRight.value();b[0].index<=b[1].index?(b=d,
|
|
d=f):b=f;return[this._linePointsToAlertPlot(c,"Upper",b,d),this._linePointsToAlertPlot(e,"Lower",b,d)]};TradingView.TrendLineStatsCache=function(){this._registeredSources={};this._sourcesToRow={};this._rowsToSources={};this._currentSymbol="";this._actualWidth=this._actualCapacity=0;this._canvas=$("<canvas>");this._cache=this._canvas.get(0).getContext("2d");this._currentWidth=400;this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1E3).css("left",0);this._ctx=this._canvas.get(0).getContext("2d");this._ctx.font=TradingView.LineToolTrendLine.LABEL_FONTSIZE+
|
|
"px"+TradingView.LineToolTrendLine.LABEL_FONT;var a=TradingView.LineToolTrendLine.LABEL_LINESPACING,b=TradingView.LineToolTrendLine.LABEL_FONTSIZE+a;this._padding=8;this._rowHeight=3*b-a+2*this._padding+2};TradingView.TrendLineStatsCache.prototype.canvas=function(){return this._canvas};TradingView.TrendLineStatsCache.prototype.topByRow=function(a){return a*this._rowHeight};TradingView.TrendLineStatsCache.prototype.rowHeight=function(a){return this._rowHeight};
|
|
TradingView.TrendLineStatsCache.prototype.rowWidth=function(a){return this._sourcesToRow[this._rowsToSources[a]].width};TradingView.TrendLineStatsCache.prototype.currentWidth=function(){return this._currentWidth};
|
|
TradingView.TrendLineStatsCache.prototype._findEmptyRow=function(a){for(var b=0;this._rowsToSources[b];)b++;this._rowsToSources[b]=a;b>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),TradingView.logDebugChart("TrendLineCache. Expanging cache to "+this._actualCapacity+" items"));return b};
|
|
TradingView.TrendLineStatsCache.prototype._effectiveState=function(a){var b={};b.p1=$.extend({},a.points().item(0));b.p2=$.extend({},a.points().item(1));var c=a.properties();b.showBars=c.showBarsRange.value();b.showTimeRange=c.showDateTimeRange.value();b.showDistance=c.showDistance.value();b.showPriceRange=c.showPriceRange.value();b.showAngle=c.showAngle.value();b.color=c.textcolor.value();b.showAngle&&(b.priceRange=a.priceScale().priceRange().state(),b.barSpacing=a.D0.timeScale().barSpacing());
|
|
return b};
|
|
TradingView.TrendLineStatsCache.prototype._effectiveStatesEquals=function(a,b){var c=function(a,b){return a||b?a&&!b||!a&&b?!0:a.index!=b.index||a.price!=b.price:!1};return a&&!b||!a&&b||c(a.p1,b.p1)||c(a.p2,b.p2)||a.color!=b.color||a.showBars!=b.showBars||a.showTimeRange!=b.showTimeRange||a.showDistance!=b.showDistance||a.showPriceRange!=b.showPriceRange||a.showAngle!=b.showAngle||a.showAngle&&(a.priceRange.min!=b.priceRange.min||a.priceRange.max!=b.priceRange.max||a.barSpacing!=b.barSpacing)?!1:
|
|
!0};TradingView.TrendLineStatsCache.prototype.removeSource=function(a){if(this._sourcesToRow[a]){var b=this._sourcesToRow[a].row;this._ctx.save();this._ctx.clearRect(0,this.topByRow(b),this._currentWidth,this.rowHeight(b));this._ctx.restore();delete this._sourcesToRow[a];delete this._rowsToSources[b]}};
|
|
TradingView.TrendLineStatsCache.prototype._repaintSource=function(a,b,c){this._ctx.save();this._ctx.translate(0,this.topByRow(b)+.5);c.points.setItem(0,new MathEx.Point(0,0));c.offsetX=0;c.offsetY=0;delete c.horzAlign;delete c.vertAlign;this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(b));b=(new TradingView.TrendLineStatsRenderer(c,{})).draw(this._ctx);this._sourcesToRow[a].width=b.width;this._ctx.restore()};
|
|
TradingView.TrendLineStatsCache.symbolInfoDifferent=function(a,b){return a.listed_exchange.value()===b.listed_exchange&&a.short_name.value()===b.name};
|
|
TradingView.TrendLineStatsCache.prototype.updateSource=function(a,b){var c=a.properties().symbol.value();if(!this._currentSymbol||TradingView.TrendLineStatsCache.symbolInfoDifferent(a.properties().symbolInfo,this._currentSymbol))TradingView.logDebugChart("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+c),this._currentSymbol=a.properties().symbolInfo,this._sourcesToRow={},this._rowsToSources={};c=a.id();if(!this._sourcesToRow[c]){var d=this._findEmptyRow(c);
|
|
this._sourcesToRow[c]={effectiveState:null,row:d}}var d=this._sourcesToRow[a.id()].effectiveState,e=this._effectiveState(a);if(!this._effectiveStatesEquals(d,e)){var d=this._sourcesToRow[a.id()],f=b();this._repaintSource(c,d.row,f);this._sourcesToRow[c].effectiveState=e}return this._sourcesToRow[c]};
|
|
TradingView.TrendLineStatsRenderer=function(a,b,c){this._textSizeCache=b;this._data=a;this._fontSize=a.fontsize?a.fontsize:a.fontSize?a.fontSize:12;this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0;a.lines=this._lines=TextRenderer.prototype.wordWrap.call(this,a.text,a.wordWrapWidth);this._hittest=c?c:new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)};
|
|
(function(){var a,b={priceRange:{width:15,height:14,data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,
|
|
134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,
|
|
0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,
|
|
134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12,data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,
|
|
255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,
|
|
130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};TradingView.TrendLineStatsRenderer.prototype._preRender=function(){if(!this._preRendered){if(!a){var b=document.createElement("canvas");b.width=0;b.height=
|
|
0;a=b.getContext("2d")}this._data.points.item(0);var d=this._data.points.item(0).x+(this._data.offsetX||0),b=d,e=this._data.points.item(0).y+(this._data.offsetY||0),f=e,g=this._fontSize,h=this._lineSpacing,k=(g+h)*this._lines.length-h;a.textBaseline="top";a.font=this.fontStyle();var h=[],l;if(this._data.wordWrapWidth){l=this._data.wordWrapWidth;for(var m=0;m<this._lines.length;m++)h.push(this._data.wordWrapWidth)}else for(m=l=0;m<this._lines.length;m++){var n=a.measureText(this._lines[m]).width;h.push(n);
|
|
l=Math.max(l,n)}if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){var n={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},p=0,r=0;this._data.backgroundHorzInflate&&(p=this._data.backgroundHorzInflate/2,n.left+=p,n.right+=p,p=-p);this._data.backgroundVertInflate&&(r=this._data.backgroundVertInflate/2,n.top+=r,n.bottom+=r,r=-r);g="number"==typeof this._data.padding?
|
|
this._data.padding:~~(g/6);for(m in n)n[m]||(n[m]=g);k={x:Math.floor(d+p),y:Math.floor(e+r),w:Math.ceil(l+n.left+n.right),h:Math.ceil(k+n.top+n.bottom)};b+=n.left+p;f+=n.top+r;if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)e="middle"==this._data.vertAlign?e-k.h/2:e-k.h-(k.y-e),f+=e-k.y,k.y=e;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d="center"==this._data.horzAlign?d-k.w/2:d-k.w-(k.x-d),b+=d-k.x,k.x=d,!0!==this._data.doNotAlignText&&("right"==this._data.horzAlign?
|
|
(a.textAlign="end",b+=l):(a.textAlign="center",b+=l/2));0!==k.w%2&&k.w++;k.x+=.5;k.y+=.5;this._boundingRect=[new MathEx.Point(k.x,k.y),new MathEx.Point(k.x+k.w,k.y+k.h)];this._rect=k;this._padding=n;this._defaultPadding=g}else{if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)f-=Math.round(k*("middle"==this._data.vertAlign?.5:1));d=b;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d-=Math.round(l*("center"==this._data.horzAlign?.5:1));this._boundingRect=[new MathEx.Point(d,
|
|
f),new MathEx.Point(d+l,f+k)]}this._textPoint={x:b,y:f};this._textSizeCache&&(this._textSizeCache.widths=h);this._preRendered=!0;this._maxWidth=l}};TradingView.TrendLineStatsRenderer.prototype._drawIcon=function(a,d,e,f){if(b.hasOwnProperty(f)){f=b[f];if(!f.src){f.src=document.createElement("canvas");f.src.width=f.width;f.src.height=f.height;for(var g=f.src.getContext("2d"),h=g.createImageData(f.width,f.height),k=0;k<f.data.length;k++)h.data[k]=f.data[k];g.putImageData(h,0,0)}a.drawImage(f.src,d,
|
|
e)}}})();TradingView.TrendLineStatsRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font};
|
|
TradingView.TrendLineStatsRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){this._preRender();var b=this._fontSize,c=b+this._lineSpacing;a.textBaseline="top";a.font=this.fontStyle();var d=this._rect;if((this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect){"right"!=this._data.horzAlign&&"center"!=this._data.horzAlign||!0===this._data.doNotAlignText||(a.textAlign="right"==this._data.horzAlign?"end":"center");if(this._data.backgroundRoundRect){if(a.roundRect(d.x,
|
|
d.y,d.w,d.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fill(),a.globalAlpha=1),this._data.borderColor){var e="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(b/12,1);a.strokeStyle=this._data.borderColor;a.lineWidth=e;a.stroke()}}else if(this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fillRect(d.x,d.y,
|
|
d.w,d.h),a.globalAlpha=1),this._data.borderColor)e="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(b/12,1),a.strokeStyle=this._data.borderColor,a.lineWidth=e,a.strokeRect(d.x-e/2,d.y-e/2,d.w+e,d.h+e);else if(this._data.highlightBorder){a.strokeStyle=this._data.color;a.lineWidth=1;a.beginPath();var f=[3,1];a.dashedLineTo(d.x-.5,e=d.y-.5,b=d.x+d.w+.5,e,f);a.dashedLineTo(b,e,b,e=d.y+d.h+.5,f);a.dashedLineTo(b=d.x-.5,e,d.x+d.w+.5,e,f);a.dashedLineTo(b,d.y-.5,b,e,f);a.globalAlpha=
|
|
.5;a.stroke();a.globalAlpha=1}this._data.icons&&this._data.icons.forEach(function(b,e){this._drawIcon(a,d.x+this._defaultPadding,d.y+this._padding.top+c*e,b)},this)}else"right"==this._data.horzAlign?a.textAlign="end":"center"==this._data.horzAlign&&(a.textAlign="center");e=this._textPoint.x;b=this._textPoint.y;a.fillStyle=this._data.color;for(f=0;f<this._lines.length;f++)a.fillText(this._lines[f],e,b),b+=c;return{width:d.w+2}}};
|
|
TradingView.TrendLineStatsRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;this._preRender();return this._boundingRect?MathEx.pointInRect(a,this._boundingRect[0],this._boundingRect[1])?this._hittest:null:null};TradingView.TrendLineRenderer=function(a,b){this._data=a;this._hittest=b?b:new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)};
|
|
TradingView.TrendLineRenderer.prototype.drawArrow=function(a,b,c,d){if(!(1>b.substract(a).length())){var e=b.substract(a).normalized();a=e.scaled(5*d);a=b.substract(a);e=e.transponed().scaled(3*d);d=a.add(e);a=a.substract(e);CanvasEx.drawLine(c,Math.round(d.x),Math.round(d.y),b.x,b.y);CanvasEx.drawLine(c,Math.round(a.x),Math.round(a.y),b.x,b.y)}};
|
|
TradingView.TrendLineRenderer.prototype.lineClipping=function(a,b,c,d){return(a=TradingView.CohenSutherland(a.x,a.y,b.x,b.y,0,0,c,d))?[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]:!1};TradingView.TrendLineRenderer.prototype.expandPoints=function(a,b,c,d){var e=new MathEx.Point(0,0);c=new MathEx.Point(c,d);this._data.extendleft&&(d=a.substract(b),(d=MathEx.intersectRayWithRect(a,a.add(d),e,c))&&(a=d));this._data.extendright&&(d=b.substract(a),(d=MathEx.intersectRayWithRect(b,b.add(d),e,c))&&(b=d));return[a,b]};
|
|
TradingView.TrendLineRenderer.prototype.drawCircle=function(a,b,c,d){d=$.extend({fillStyle:"#000000"},d);b.save();b.fillStyle=d.fillStyle;b.beginPath();b.arc(a.x,a.y,c,0,2*Math.PI,!1);b.fill();d.strokeWidth&&(b.lineWidth=d.strokeWidth,b.stroke());b.restore()};
|
|
TradingView.TrendLineRenderer.prototype.draw=function(a){if(!(this._data.points&&2>this._data.points.size()||this._data.floatPoints&&2>this._data.floatPoints.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.floatPoints?this._data.floatPoints:this._data.points,c=b.item(0),b=b.item(1),d;this._data.overlayLineEndings?d=[$.extend(!0,{},c),$.extend(!0,{},b)]:this.drawEnds(a,[c,b]);c=this.expandPoints(c,b,this._data.width,
|
|
this._data.height);(c=this.lineClipping(c[0],c[1],this._data.width,this._data.height))&&0<this._data.linewidth&&CanvasEx.drawLine(a,Math.round(c[0].x),Math.round(c[0].y),Math.round(c[1].x),Math.round(c[1].y));this._data.overlayLineEndings&&this.drawEnds(a,d)}};
|
|
TradingView.TrendLineRenderer.prototype.drawEnds=function(a,b){var c=b[0],d=b[1];switch(this._data.leftend){case R47.LINEEND_ARROW:this.drawArrow(d,c,a,a.lineWidth);break;case R47.LINEEND_CIRCLE:this.drawCircle(c,a,a.lineWidth,this._data.endstyle)}switch(this._data.rightend){case R47.LINEEND_ARROW:this.drawArrow(c,d,a,a.lineWidth);break;case R47.LINEEND_CIRCLE:this.drawCircle(d,a,a.lineWidth,this._data.endstyle)}};
|
|
TradingView.TrendLineRenderer.prototype.hitTest=function(a){if(this._data.points&&2>this._data.points.size()||this._data.floatPoints&&2>this._data.floatPoints.size())return null;var b=TradingView.isMobile.any()?24:3,c=this._data.floatPoints?this._data.floatPoints:this._data.points,d=c.item(0),c=c.item(1),d=this.expandPoints(d,c,this._data.width,this._data.height);return MathEx.distanceToSegment(d[0],d[1],a).distance<=b?this._hittest:null};
|
|
TradingView.R43=function(a,b){J90.call(this,a,b);this._label=null;this._rendererCache={};this._labelDataInvalidated=this._invalidated=!0};inherit(TradingView.R43,J90);TradingView.R43.prototype.update=function(){this._labelDataInvalidated=this._invalidated=!0};
|
|
TradingView.R43.prototype.updateImpl=function(){var a=this.R99.points();if(!(2>a.size())){var b=a.item(0),c=a.item(1),d=this.D0.timeScale().visibleBars();if(void 0!==d&&!d.isEmpty()&&(d=d.clone(),a=this.R99.properties(),!(b.index<d.firstBar()&&c.index<d.firstBar())||a.extendLeft.value()||a.extendRight.value())){J90.prototype.update.call(this);var b=a.showBarsRange.value(),c=a.showDateTimeRange.value(),d=a.showDistance.value(),e=a.showPriceRange.value(),
|
|
a=a.showAngle.value();if(e||b||c||d||a){var f=this;this._statCache=this.D0._trendLineStatsCache.updateSource(this.R99,function(){return f._statLabelData()})}else this.D0._trendLineStatsCache.removeSource(this.R99.id()),this._label=null,this._labelData&&(this._labelData.text="",this._labelData.lines=[]);this._invalidated=!1}}};
|
|
TradingView.R43.prototype._statLabelData=function(){if(this._labelDataInvalidated){var a=this.R99.points(),b=a.item(0),c=a.item(1),d=this.R99.properties(),a=[],e,f,g,h,k;if(d.showPriceRange.value()&&this.R99.priceScale()){h=c.price-b.price;e=h/b.price;e=this.R99.priceScale().formatter().format(h)+" ("+(new TradingView.PercentageFormatter).format(100*e)+")";var l=this.D0.mainSeries().base();l&&(l=Math.round(h*l),e+=", "+l);a.push("priceRange")}var l=d.showBarsRange.value(),
|
|
m=d.showDateTimeRange.value(),n=d.showDistance.value();if(l||m||n){f="";l&&(k=c.index-b.index,f+=$.t("{0} bars").format(k));if(m){var m=this.D0.timeScale().indexToUserTime(b.index),p=this.D0.timeScale().indexToUserTime(c.index);m&&p&&(m=(p.valueOf()-m.valueOf())/1E3,(m=(new TradingView.TimeSpanFormatter).format(m))&&(f+=l?" ("+m+")":m))}n&&(f&&(f+=", "),"undefined"==typeof h&&(h=c.price-b.price),"undefined"==typeof k&&(k=c.index-b.index),h=Math.round(1E5*Math.sqrt(h*h+k*k))/1E5,f+=$.t("distance: {0}").format(h));
|
|
f&&a.push("barsRange")}if(d.showAngle.value()){var b=this.R99.pointToScreenPoint(b),c=this.R99.pointToScreenPoint(c),r,b=b instanceof Array?b[0]:b instanceof MathEx.Point?b:null,c=c instanceof Array?c[0]:c instanceof MathEx.Point?c:null;b instanceof MathEx.Point&&c instanceof MathEx.Point&&(b=c.substract(b),0<b.length()&&(b=b.normalized(),r=Math.acos(b.x),0<b.y&&(r=-r)));"number"!=typeof r||TradingView.isNaN(r)||(g=Math.round(180*r/Math.PI)+"\u00ba",a.push("angle"))}this._label=[e,f,g].filter(function(a){return a}).join("\n")||
|
|
null;this._icons=a;this._labelDataInvalidated=!1}f={points:(new List).append(this._points.item(1)),text:this._label,color:this.R99.properties().textcolor.value(),font:TradingView.LineToolTrendLine.LABEL_FONT,fontsize:TradingView.LineToolTrendLine.LABEL_FONTSIZE,lineSpacing:TradingView.LineToolTrendLine.LABEL_LINESPACING,backgroundColor:TradingView.LineToolTrendLine.LABEL_BGCOLOR,borderColor:TradingView.LineToolTrendLine.LABEL_BORDERCOLOR,borderWidth:1,padding:TradingView.LineToolTrendLine.LABEL_PADDING,
|
|
paddingLeft:30,doNotAlignText:!0,icons:this._icons};this._points.item(1).y<this._points.item(0).y&&(f.vertAlign="bottom");this._points.item(1).x<this._points.item(0).x&&(f.horzAlign="right");return this._labelData=f};
|
|
TradingView.R43.prototype.renderer=function(){this._invalidated&&this.updateImpl();var a=new TradingView.CompositeRenderer;if(this._invalidated||!this.R99.priceScale())return a;var b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D0.timeScale().width();b.height=this.R99.priceScale().height();b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=this.R99.properties().linestyle.value();
|
|
b.extendleft=this.R99.properties().extendLeft.value();b.extendright=this.R99.properties().extendRight.value();b.leftend=this.R99.properties().leftEnd.value();b.rightend=this.R99.properties().rightEnd.value();a.append(new TradingView.TrendLineRenderer(b));if((this.isAnchorsRequired()||this.R99.properties().alwaysShowStats.value())&&this._label&&2==this._points.size()){var c=this._points.item(1),d={left:0,top:this.D0._trendLineStatsCache.topByRow(this._statCache.row),width:this.D0._trendLineStatsCache.rowWidth(this._statCache.row),
|
|
height:this.D0._trendLineStatsCache.rowHeight(this._statCache.row)},c={left:c.x,top:c.y,width:d.width,height:d.height};c.left="right"==this._labelData.horzAlign?c.left-(TradingView.LineToolTrendLine.LABEL_PADDING+c.width):c.left+TradingView.LineToolTrendLine.LABEL_PADDING;c.top="bottom"==this._labelData.vertAlign?c.top-(TradingView.LineToolTrendLine.LABEL_PADDING+c.height):c.top+TradingView.LineToolTrendLine.LABEL_PADDING;var e=this.D0._trendLineStatsCache.canvas(),d=new TradingView.PaneRendererCachedImage(e.get(0),
|
|
d,c);a.append(d)}this.addAnchors(a);!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&2<=b.points.size()&&this.R99.getAlertIsActive(function(c){a.append(new TradingView.PaneRendererClockIcon({point1:b.points.item(0),point2:b.points.item(1),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
|
|
TradingView.LineToolTrendLine=function(a,b){this._constructor="LineToolTrendLine";var c=b?b:new J52("linetooltrendline");R47.call(this,a,new TradingView.R43(this,a),c);a._trendLineStatsCache||(a._trendLineStatsCache=new TradingView.TrendLineStatsCache)};inherit(TradingView.LineToolTrendLine,R47);TradingView.LineToolTrendLine.LABEL_OFFSET=8;TradingView.LineToolTrendLine.LABEL_FONT="Arial";
|
|
TradingView.LineToolTrendLine.LABEL_FONTSIZE=12;TradingView.LineToolTrendLine.LABEL_LINESPACING=10;TradingView.LineToolTrendLine.LABEL_BGCOLOR="rgba(255,255,255,.8)";TradingView.LineToolTrendLine.LABEL_BORDERCOLOR="#e3e3e3";TradingView.LineToolTrendLine.LABEL_PADDING=8;TradingView.LineToolTrendLine.prototype.stop=function(){R47.prototype.stop.call(this);this.D0._trendLineStatsCache.removeSource(this.id())};TradingView.LineToolTrendLine.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolTrendLine.prototype.title=function(){return"Trend Line"};TradingView.LineToolTrendLine.prototype.canHasAlert=function(){return!0};TradingView.LineToolTrendLine.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points.toArray(),null,this.properties().extendLeft.value(),this.properties().extendRight.value())]};
|
|
(function(){function a(a,c,d,e,f,g){var h=0;a<d?h|=1:a>f&&(h|=2);c<e?h|=4:c>g&&(h|=8);return h}TradingView.CohenSutherland=function(b,c,d,e,f,g,h,k){for(var l=a(b,c,f,g,h,k),m=a(d,e,f,g,h,k),n=!1,p,r,t,v=0;;){if(1E3<v)throw Error("Cohen - Sutherland algorithm: infinity loop");v++;if(l|m)if(l&m)break;else t=l?l:m,t&8?(p=b+(d-b)*(k-c)/(e-c),r=k):t&4?(p=b+(d-b)*(g-c)/(e-c),r=g):t&2?(r=c+(e-c)*(h-b)/(d-b),p=h):(r=c+(e-c)*(f-b)/(d-b),p=f),t==l?(b=p,c=r,l=a(b,c,f,g,h,k)):(d=p,e=r,m=a(d,e,f,g,h,k));else{n=
|
|
!0;break}}return n?[b,c,d,e]:!1}})();TradingView.RectangleRenderer=function(a,b,c){this._data=a;this._hittestResult=b||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittestResult=c||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND)};
|
|
TradingView.RectangleRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1).substract(b);a.beginPath();a.rect(b.x,b.y,c.x,c.y);0<this._data.linewidth&&a.stroke();this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
|
|
TradingView.RectangleRenderer.prototype.hitTest=function(a){if(2>this._data.points.size()||this._data.nohittest)return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=new MathEx.Point(c.x,b.y),e=new MathEx.Point(b.x,c.y),f=MathEx.distanceToSegment(b,d,a);if(3>=f.distance)return this._hittestResult;f=MathEx.distanceToSegment(d,c,a);if(3>=f.distance)return this._hittestResult;f=MathEx.distanceToSegment(c,e,a);if(3>=f.distance)return this._hittestResult;f=MathEx.distanceToSegment(e,
|
|
b,a);return 3>=f.distance?this._hittestResult:this._data.fillBackground&&(d=Math.min(b.x,c.x),e=Math.max(b.x,c.x),f=Math.min(b.y,c.y),c=Math.max(b.y,c.y),b=new MathEx.Point(d,f),c=new MathEx.Point(e,c),MathEx.pointInRect(a,b,c))?this._backHittestResult:null};R8=function(a,b){J90.call(this,a,b)};inherit(R8,J90);
|
|
R8.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().color.value();a.linewidth=this.R99.properties().linewidth.value();a.backcolor=this.R99.properties().backgroundColor.value();a.fillBackground=this.R99.properties().fillBackground.value();a.transparency=this.R99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new TradingView.CompositeRenderer;b.append(new TradingView.RectangleRenderer(a));
|
|
this.addAnchors(b);return b}return new TradingView.RectangleRenderer(a)};TradingView.LineToolRectangle=function(a,b){this._constructor="LineToolRectangle";var c=b?b:new J52("linetoolrectangle");R47.call(this,a,new R8(this,a),c)};inherit(TradingView.LineToolRectangle,R47);TradingView.LineToolRectangle.prototype.pointsCount=function(){return 2};TradingView.LineToolRectangle.prototype.title=function(){return"Rectangle"};TradingView.EllipseRenderer=function(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=2*Math.PI;this._data.clockwise=!1};
|
|
TradingView.EllipseRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0),c=this._data.points.item(1);if(3>this._data.points.size())a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance;if(1>d)a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),
|
|
a.stroke();else{var e=c.substract(b),b=b.add(c).scaled(.5),c=new MathEx.Point(-e.y,e.x),c=c.normalized();b.add(c.scaled(d));b.add(c.scaled(-d));a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;var c=e.length(),f=e.y/c,e=Math.acos(e.x/c);0>f&&(e=-e);var f=this._data.points.item(2),g=MathEx.Matrix.translate(-b.x,-b.y),f=g.mult(f),g=MathEx.Matrix.rotate(-e),f=g.mult(f),g=MathEx.Matrix.scale(1,c/(2*d)),f=g.mult(f);this._data.clockwise=0>f.y?!0:!1;a.save();a.beginPath();a.translate(b.x,
|
|
b.y);a.rotate(e);a.scale(1,2*d/c);a.arc(0,0,.5*c,this._data.angleFrom,this._data.angleTo,this._data.clockwise);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};TradingView.EllipseRenderer.prototype._additionalPointTest=function(a,b){return!0};
|
|
TradingView.EllipseRenderer.prototype.hitTest=function(a){if(3>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance,e=c.substract(b),c=b.add(c).scaled(.5),b=new MathEx.Point(-e.y,e.x),b=b.normalized();c.add(b.scaled(d));var f=c.add(b.scaled(-d)),b=e.length(),g=e.y/b,e=Math.acos(e.x/b);0>g&&(e=-e);c=MathEx.Matrix.translate(-c.x,-c.y);a=c.mult(a);f=c.mult(f);c=MathEx.Matrix.rotate(-e);a=c.mult(a);
|
|
f=c.mult(f);c=MathEx.Matrix.scale(1,b/(2*d));a=c.mult(a);f=c.mult(f);d=a.length();return this._additionalPointTest(a,f)?3>=Math.abs(d-.5*b)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):this._data.fillBackground&&!this._data.noHitTestOnBackground&&d<=.5*b?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND):null:null};J69=function(a,b){J90.call(this,a,b)};inherit(J69,J90);
|
|
J69.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.color=this.R99.properties().color.value();b.linewidth=this.R99.properties().linewidth.value();b.backcolor=this.R99.properties().backgroundColor.value();b.fillBackground=this.R99.properties().fillBackground.value();b.transparency=this.R99.properties().transparency.value();a.append(new TradingView.EllipseRenderer(b));
|
|
if(this.isAnchorsRequired()){var c=b.points.item(0),d=b.points.item(1);if(2==this._points.size())return this.addAnchors(a),a;var b=b.points.item(2),e=MathEx.distanceToLine(c,d,b).distance,b=d.substract(c),f=c.add(d).scaled(.5),g=new MathEx.Point(-b.y,b.x),g=g.normalized(),b=f.add(g.scaled(e)),e=f.add(g.scaled(-e)),c=new MathEx.Point(c.x,c.y);c.data=0;d=new MathEx.Point(d.x,d.y);d.data=1;b=new MathEx.Point(b.x,b.y);b.data=2;e=new MathEx.Point(e.x,e.y);e.data=3;a.append(this.createLineAnchor({points:[c,
|
|
d,b,e]}))}return a};TradingView.LineToolEllipse=function(a,b){this._constructor="LineToolEllipse";var c=b?b:new J52("linetoolellipse");R47.call(this,a,new J69(this,a),c);this.version=TradingView.LineToolEllipse.version};inherit(TradingView.LineToolEllipse,R47);
|
|
TradingView.LineToolEllipse.prototype.startChanging=function(a,b){R47.prototype.startChanging.call(this,a,b);if(0===a||1==a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0];this._dist=MathEx.distanceToLine(c,d,e).distance}};
|
|
TradingView.LineToolEllipse.prototype.setPoint=function(a,b){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],f=this.priceScale();if(f.isPercent()){var g=this.ownerSource().firstValue();b.price=f.priceRange().convertFromPercent(b.price,g)}switch(a){case 0:c=this.pointToScreenPoint(b)[0];f=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-f.y,f.x);d=d.normalized();e=c.add(d.scaled(this._dist));
|
|
e=this.screenPointToPoint(e);this._points.setItem(0,b);this._points.setItem(2,e);break;case 1:e=MathEx.distanceToLine(c,d,e).distance;d=this.pointToScreenPoint(b)[0];f=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-f.y,f.x);d=d.normalized();e=c.add(d.scaled(this._dist));e=this.screenPointToPoint(e);this._points.setItem(1,b);this._points.setItem(2,e);break;case 2:b=this.pointToScreenPoint(b)[0];e=MathEx.distanceToLine(c,d,b).distance;f=d.substract(c);c=c.add(d).scaled(.5);d=new MathEx.Point(-f.y,
|
|
f.x);d=d.normalized();e=c.add(d.scaled(e));e=this.screenPointToPoint(e);this._points.setItem(2,e);break;case 3:b=this.pointToScreenPoint(b)[0],e=MathEx.distanceToLine(c,d,b).distance,f=d.substract(c),c=c.add(d).scaled(.5),d=new MathEx.Point(-f.y,f.x),d=d.normalized(),e=c.add(d.scaled(e)),e=this.screenPointToPoint(e),this._points.setItem(2,e)}this.normalizePoints()};TradingView.LineToolEllipse.prototype.pointsCount=function(){return 3};TradingView.LineToolEllipse.prototype.title=function(){return"Ellipse"};
|
|
TradingView.LineToolEllipse.version=2;
|
|
TradingView.LineToolEllipse.prototype.migrateVersion=function(a,b,c){1==a&&2==this._points.size()&&(b=this._points.item(0).price,c=.5*(this._points.item(0).price+this._points.item(1).price),this._points.setItem(0,{price:c,index:this._points.item(0).index}),this._points.setItem(1,{price:c,index:this._points.item(1).index}),this._points.append({price:b,index:this._points.item(0).index}));1==a&&2==this._timePoint.size()&&(b=this._timePoint.item(0).price,c=.5*(this._timePoint.item(0).price+this._timePoint.item(1).price),
|
|
this._timePoint.item(0).price=c,this._timePoint.item(1).price=c,a={price:b,offset:this._timePoint.item(0).offset,time_t:this._timePoint.item(0).time_t},this._timePoint.append(a))};TradingView.HorzLineRenderer=function(a){this._data=a};TradingView.HorzLineRenderer.prototype.draw=function(a){if(0===this._data.points.size())return null;if(!1!==this._data.visible){var b=this._data.points.item(0).y,c=a.canvas.width;a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,0,b,c,b)}};
|
|
TradingView.HorzLineRenderer.prototype.hitTest=function(a){return!1===this._data.visible||0===this._data.points.size()?null:3>=Math.abs(a.y-this._data.points.item(0).y)?new TradingView.HitTestResult(this._data.hitTestResult):null};J85=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J85,J90);J85.prototype.update=function(){this._invalidated=!0};
|
|
J85.prototype.updateImpl=function(){J90.prototype.update.call(this)};
|
|
J85.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer,b={};b.points=this._points;b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=this.R99.properties().linestyle.value();b.hitTestResult=TradingView.HitTestResult.MOVEPOINT;var c=this.R99.properties();a.append(new TradingView.HorzLineRenderer(b));if(this.R99.properties().showLabel.value()&&
|
|
1==this._points.size()){var d=c.vertLabelsAlign.value(),e=c.horzLabelsAlign.value(),f=this._points.item(0),g=0,h=0;"left"==e?f.x=3:"right"==e?(f.x=this.D0.timeScale().width(),h=-5):f.x=this.D0.timeScale().width()/2;"middle"==d?g=-this.R99.properties().fontsize.value()/6:"bottom"==d&&(g=-4);c={points:(new List).append(f),text:c.text.value(),color:c.textcolor.value(),vertAlign:d,horzAlign:e,font:c.font.value(),offsetX:h,offsetY:g,bold:this.R99.properties().bold.value(),italic:this.R99.properties().italic.value(),
|
|
fontsize:this.R99.properties().fontsize.value()};a.append(new TextRenderer(c,this._rendererCache))}1==this._points.size()&&this.isAnchorsRequired()&&(c=new MathEx.Point(this.D0.timeScale().width()/2,this._points.item(0).y),c.data=0,a.append(this.createLineAnchor({points:[c]})));if(!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&1==this._points.size()){var k=new MathEx.Point(this.D0.timeScale().width()/2,this._points.item(0).y);this.R99.getAlertIsActive(function(c){a.append(new TradingView.PaneRendererClockIcon({point1:k,
|
|
color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return a};TradingView.LineToolHorzLinePriceAxisView=function(a,b){this.R99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invaildated=!0};inherit(TradingView.LineToolHorzLinePriceAxisView,PriceAxisView);TradingView.LineToolHorzLinePriceAxisView.prototype.update=function(){this._invaildated=!0};
|
|
TradingView.LineToolHorzLinePriceAxisView.prototype.updateImpl=function(){if(0!==this.R99.points().size()&&this.R99.priceScale()&&!this.R99.priceScale().isEmpty()){var a=this.R99.properties().linecolor.value();a!=this._background&&(this._background=a,this._color=this.color());a=this.R99.points().item(0).price;if(this.R99.priceScale().isPercent()){var b=this.R99.ownerSource().firstValue();if(null===b)return;a=this.R99.priceScale().priceRange().convertToPercent(a,b)}this._floatCoordinate=
|
|
this.R99.priceScale().priceToCoordinate(a,!0);this._coordinate=Math.round(this._floatCoordinate);this._textHeight=this.R99.priceScale().m_markBuilder.fontHeight();this.R99.priceScale().formatter()&&(this._text=this.R99.priceScale().formatter().format(a))}};
|
|
TradingView.LineToolHorzLinePriceAxisView.prototype.renderer=function(){this._invaildated&&(this.updateImpl(),this._invaildated=!1);return new TradingView.PriceAxisViewRenderer({text:this._text,coordinate:this._coordinate,color:this._color,background:this._background,textHeight:this._textHeight,visible:!0})};TradingView.LineToolHorzLinePriceAxisView.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
|
|
TradingView.LineToolHorzLine=function(a,b){this._constructor="LineToolHorzLine";var c=b?b:new J52("linetoolhorzline");R47.call(this,a,new J85(this,a),c);this._priceAxisView=new TradingView.LineToolHorzLinePriceAxisView(this,a)};inherit(TradingView.LineToolHorzLine,R47);TradingView.LineToolHorzLine.prototype.pointsCount=function(){return 1};TradingView.LineToolHorzLine.prototype.title=function(){return"Horizontal Line"};
|
|
TradingView.LineToolHorzLine.prototype.priceAxisViews=function(a,b){return this.isActualSymbol()&&b===this.priceScale()&&this.properties().showPrice.value()&&this.D0.paneForSource(this)===a?[this._priceAxisView]:null};TradingView.LineToolHorzLine.prototype.updateAllViews=function(){R47.prototype.updateAllViews.call(this);this._priceAxisView.update()};TradingView.LineToolHorzLine.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolHorzLine.prototype._getAlertPlots=function(){return[this.points().item(0).price]};TradingView.HorzRayRenderer=function(a){this._data=a};TradingView.HorzRayRenderer.prototype.draw=function(a){if(0===this._data.points.size())return null;var b=a.canvas.width,c=this._data.points.item(0).y,d=Math.max(0,this._data.points.item(0).x),b=Math.max(b,this._data.points.item(0).x);a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,d,c,b,c)};
|
|
TradingView.HorzRayRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.x<this._data.points.item(0).x?null:3>=Math.abs(a.y-this._data.points.item(0).y)?new TradingView.HitTestResult(this._data.hitTestResult):null};J86=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(J86,J90);
|
|
J86.prototype.update=function(){this._invalidated=!0};J86.prototype.updateImpl=function(){J90.prototype.update.call(this)};
|
|
J86.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer,b={};b.points=this._points;b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=this.R99.properties().linestyle.value();b.hitTestResult=TradingView.HitTestResult.MOVEPOINT;var c=this.R99.properties();a.append(new TradingView.HorzRayRenderer(b));if(this.R99.properties().showLabel.value()&&
|
|
1==this._points.size()){var d=c.vertLabelsAlign.value(),e=c.horzLabelsAlign.value(),f=this._points.item(0).clone(),g=0,h=0;"right"==e?(f.x=this.D0.timeScale().width(),h=-5):"center"==e&&(f.x=(f.x+this.D0.timeScale().width())/2);"middle"==d?g=-this.R99.properties().fontsize.value()/6:"bottom"==d&&(g=-4);c={points:(new List).append(f),text:c.text.value(),color:c.textcolor.value(),vertAlign:d,horzAlign:e,font:c.font.value(),offsetX:h,offsetY:g,bold:this.R99.properties().bold.value(),
|
|
italic:this.R99.properties().italic.value(),fontsize:this.R99.properties().fontsize.value()};a.append(new TextRenderer(c,this._rendererCache))}this.addAnchors(a);TradingView.printing||!this.R99.hasAlert.value()||this.D0.readOnly()||1!=this._points.size()||this.R99.getAlertIsActive(function(c){a.append(new TradingView.PaneRendererClockIcon({point1:b.points.clone().item(0),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
|
|
TradingView.LineToolHorzRayPriceAxisView=function(a,b){this.R99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14};inherit(TradingView.LineToolHorzRayPriceAxisView,PriceAxisView);TradingView.LineToolHorzRayPriceAxisView.prototype.update=function(){this._invaildated=!0};
|
|
TradingView.LineToolHorzRayPriceAxisView.prototype.updateImpl=function(){0!==this.R99.points().size()&&this.R99.priceScale()&&!this.R99.priceScale().isEmpty()&&(this._background=this.R99.properties().linecolor.value(),this._coordinate=this.R99.priceScale().priceToCoordinate(this.R99.points().item(0).price),this._textHeight=this.R99.priceScale().m_markBuilder.fontHeight(),this._text=this.R99.priceScale().formatter().format(this.R99.points().item(0).price))};
|
|
TradingView.LineToolHorzRayPriceAxisView.prototype.renderer=function(){this._invaildated&&(this.updateImpl(),this._invaildated=!1);var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new TradingView.PriceAxisViewRenderer(a)};
|
|
TradingView.LineToolHorzRay=function(a,b){this._constructor="LineToolHorzRay";var c=b?b:new J52("linetoolhorzray");R47.call(this,a,new J86(this,a),c);this._priceAxisView=new TradingView.LineToolHorzRayPriceAxisView(this,a)};inherit(TradingView.LineToolHorzRay,R47);TradingView.LineToolHorzRay.prototype.pointsCount=function(){return 1};TradingView.LineToolHorzRay.prototype.title=function(){return"Horizontal Ray"};
|
|
TradingView.LineToolHorzRay.prototype.priceAxisViews=function(a,b){return this.isActualSymbol()&&b===this.priceScale()&&this.properties().showPrice.value()&&this.D0.paneForSource(this)===a?[this._priceAxisView]:null};TradingView.LineToolHorzRay.prototype.updateAllViews=function(){R47.prototype.updateAllViews.call(this);this._priceAxisView.update()};TradingView.LineToolHorzRay.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolHorzRay.prototype._getAlertPlots=function(){var a=this._points.clone().item(0);return[this._linePointsToAlertPlot([a,{index:a.index+1,price:a.price}],null,!1,!0)]};TradingView.VertLineRenderer=function(a,b){this._data=a;this._hittest=b};TradingView.VertLineRenderer.prototype.draw=function(a){if(0!==this._data.points.size()&&!(0>=this._data.linewidth)){var b=this._data.points.item(0).x;a.translate(1,0);var c=a.canvas.height;a.lineCap="square";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;CanvasEx.drawLine(a,b,0,b,c)}};
|
|
TradingView.VertLineRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._hittest||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);return 3>=Math.abs(a.x-this._data.points.item(0).x)?b:null};function R45(a,b){J90.call(this,a,b)}inherit(R45,J90);
|
|
R45.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().linecolor.value();a.linewidth=this.R99.properties().linewidth.value();a.linestyle=this.R99.properties().linestyle.value();var b=new TradingView.CompositeRenderer;b.append(new TradingView.VertLineRenderer(a));this.addAnchors(b);if(!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&1==a.points.size()){var c=new MathEx.Point(this._points.item(0).x,this.R99.priceScale().height()/
|
|
2);this.R99.getAlertIsActive(function(d){b.append(new TradingView.PaneRendererClockIcon({point1:c,color:d?a.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))})}return b};TradingView.LineToolVertLineTimeAxisView=function(a,b){TradingView.TimeAxisView.call(this);this.R99=a;this.D0=b;this._invalidated=!0};inherit(TradingView.LineToolVertLineTimeAxisView,TradingView.TimeAxisView);TradingView.LineToolVertLineTimeAxisView.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.LineToolVertLineTimeAxisView.prototype.updateImpl=function(){if(!this.D0.timeScale().isEmpty()&&0!==this.R99.points().size()){this._text="";this._background=this.R99.properties().linecolor.value();var a=this.R99.points().item(0).index;this._coordinate=this.D0.timeScale().indexToCoordinate(a);if(a=this.D0.timeScale().indexToUserTime(a))this._text=(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(a);this._invalidated=!1}};
|
|
TradingView.LineToolVertLineTimeAxisView.prototype.renderer=function(){this._invalidated&&this.updateImpl();var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:18};return new TradingView.TimeAxisViewRenderer(a)};
|
|
TradingView.LineToolVertLine=function(a,b){this._constructor="LineToolVertLine";var c=b?b:new J52("linetoolvertline");R47.call(this,a,new R45(this,a),c);this._timeAxisView=new TradingView.LineToolVertLineTimeAxisView(this,a)};inherit(TradingView.LineToolVertLine,R47);TradingView.LineToolVertLine.prototype.pointsCount=function(){return 1};TradingView.LineToolVertLine.prototype.title=function(){return"Vertical Line"};
|
|
TradingView.LineToolVertLine.prototype.timeAxisViews=function(){return this.symbol()===this.D0.mainSeries().symbol()&&this.properties().showTime.value()?[this._timeAxisView]:null};TradingView.LineToolVertLine.prototype.updateAllViews=function(){R47.prototype.updateAllViews.call(this);this._timeAxisView.update()};TradingView.LineToolVertLine.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolVertLine.prototype._getAlertPlots=function(){var a=this._points.clone().item(0);return[this._linePointsToAlertPlot([a,{index:a.index,price:a.price+1}],null,!0,!0)]};TradingView.ChannelRenderer=function(a){this._data=a};TradingView.ChannelRenderer.prototype.extendPoints=function(a,b,c){var d=new MathEx.Point(0,-5E3);c=new MathEx.Point(c,5E3);var e=b.substract(a);(e=MathEx.intersectRayWithRect(b,b.add(e),d,c))&&(b=e);!MathEx.pointInRect(a,d,c)&&MathEx.pointInRect(b,d,c)&&(e=MathEx.intersectRayWithRect(b,a,d,c))&&(a=e);!MathEx.pointInRect(b,d,c)&&MathEx.pointInRect(a,d,c)&&(e=MathEx.intersectRayWithRect(a,b,d,c))&&(b=e);return[a,b]};
|
|
TradingView.ChannelRenderer.prototype.draw=function(a){var b=a.canvas.width,c=this.extendPoints(this._data.p1,this._data.p2,b),b=this.extendPoints(this._data.p3,this._data.p4,b);a.beginPath();a.moveTo(c[0].x,c[0].y);a.lineTo(c[1].x,c[1].y);c[1].x<b[1].x&&a.lineTo(b[1].x,c[1].y);a.lineTo(b[1].x,b[1].y);a.lineTo(b[0].x,b[0].y);a.lineTo(c[0].x,c[0].y);a.fillStyle=TradingView.generateColor(this._data.color,this._data.transparency);a.fill()};
|
|
TradingView.ChannelRenderer.prototype.hitTest=function(a){if(!this._data.hittestOnBackground)return null;var b=this._data.width,c=this.extendPoints(this._data.p1,this._data.p2,b),b=this.extendPoints(this._data.p3,this._data.p4,b),d=[new MathEx.Point(c[0].x,c[0].y),new MathEx.Point(c[1].x,c[1].y)];c[1].x<b[1].x&&d.push(new MathEx.Point(b[1].x,c[1].y));d.push(new MathEx.Point(b[1].x,b[1].y));d.push(new MathEx.Point(b[0].x,b[0].y));d.push(new MathEx.Point(c[0].x,c[0].y));return MathEx.isInPolygon(d,
|
|
a)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND):null};R1=function(a,b){J90.call(this,a,b)};inherit(R1,J90);
|
|
R1.prototype.update=function(){J90.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
|
|
R1.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size()||!this._medianPoint)return a;var b={points:(new List).append(this._points.item(0)).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,
|
|
extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),
|
|
extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));for(var b=this._points.item(2).substract(this._points.item(1)).scaled(.5),c=this._medianPoint.substract(this._points.item(0)),d=0,e=this.R99.properties().fillBackground.value(),f=this.R99.properties().transparency.value(),g=0;8>=g;g++){var h="level"+g,h=this.R99.properties()[h];if(h.visible.value()){var k=this._medianPoint.addScaled(b,
|
|
h.coeff.value()),l=k.add(c),m=this._medianPoint.addScaled(b,-h.coeff.value()),n=m.add(c);if(e){var p={};p.width=this.D0.timeScale().width();p.p1=k;p.p2=l;p.p3=this._medianPoint.addScaled(b,d);p.p4=p.p3.add(c);p.color=h.color.value();p.width=this.D0.timeScale().width();p.transparency=f;p.hittestOnBackground=!0;a.append(new TradingView.ChannelRenderer(p));p={};p.width=this.D0.timeScale().width();p.p1=m;p.p2=n;p.p3=this._medianPoint.addScaled(b,-d);p.p4=p.p3.add(c);p.color=h.color.value();
|
|
p.width=this.D0.timeScale().width();p.transparency=f;p.hittestOnBackground=!0;a.append(new TradingView.ChannelRenderer(p))}d=h.coeff.value();l={points:(new List).append(k).append(l),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};k=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,
|
|
null,g);a.append(new TradingView.TrendLineRenderer(l,k));h={points:(new List).append(m).append(n),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};k=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,g);a.append(new TradingView.TrendLineRenderer(h,
|
|
k))}}this.addAnchors(a);return a};R12=function(a,b){R1.call(this,a,b)};inherit(R12,R1);
|
|
R12.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,
|
|
leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(a),a;var c={points:(new List).append(this._modifiedBase).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),
|
|
extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(c));if(3>this._points.size())return this.addAnchors(a),a;c={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),
|
|
linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(c));for(var c=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this._medianPoint.substract(this._modifiedBase),e=0,f=this.R99.properties().fillBackground.value(),g=this.R99.properties().transparency.value(),h=0;8>=h;h++){var k="level"+h,k=this.R99.properties()[k];
|
|
if(k.visible.value()){var l=this._medianPoint.addScaled(c,k.coeff.value()),m=l.add(d),n=this._medianPoint.addScaled(c,-k.coeff.value()),p=n.add(d);f&&(b={},b.p1=l,b.p2=m,b.p3=this._medianPoint.addScaled(c,e),b.p4=b.p3.add(d),b.color=k.color.value(),b.width=this.D0.timeScale().width(),b.transparency=g,b.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(b)),b={},b.p1=n,b.p2=p,b.p3=this._medianPoint.addScaled(c,-e),b.p4=b.p3.add(d),b.color=k.color.value(),b.width=this.D0.timeScale().width(),
|
|
b.transparency=g,b.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(b)));e=k.coeff.value();l={points:(new List).append(l).append(m),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};b=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,
|
|
null,h);a.append(new TradingView.TrendLineRenderer(l,b));k={points:(new List).append(n).append(p),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};b=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,h);a.append(new TradingView.TrendLineRenderer(k,
|
|
b))}}this.addAnchors(a);return a};R12.prototype.update=function(){R1.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(.5))};R11=function(a,b){R12.call(this,a,b)};inherit(R11,R12);
|
|
R11.prototype.update=function(){R1.prototype.update.call(this);if(2<this._points.size()){var a=this._points.item(0).x,b=.5*(this._points.item(0).y+this._points.item(1).y);this._modifiedBase=new MathEx.Point(a,b)}};J88=function(a,b){R1.call(this,a,b)};inherit(J88,R1);
|
|
J88.prototype.update=function(){R1.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(.5))};
|
|
J88.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;if(!this._medianPoint||!this._modifiedBase)return this.addAnchors(a),a;if(3==this._points.size()){var b={points:(new List).append(this._modifiedBase).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),
|
|
linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b))}var c={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),
|
|
linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(c));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),
|
|
linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));var b=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this._points.item(2).substract(this._modifiedBase),e=0,f=this.R99.properties().fillBackground.value(),g=this.R99.properties().transparency.value(),
|
|
h={points:(new List).append(this._medianPoint).append(this._medianPoint.add(d)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(h));
|
|
for(h=0;8>=h;h++){var k="level"+h,k=this.R99.properties()[k];if(k.visible.value()){var l=this._medianPoint.addScaled(b,k.coeff.value()),m=l.add(d),n=this._medianPoint.addScaled(b,-k.coeff.value()),p=n.add(d);f&&(c={},c.p1=l,c.p2=m,c.p3=this._medianPoint.addScaled(b,e),c.p4=c.p3.add(d),c.color=k.color.value(),c.width=this.D0.timeScale().width(),c.transparency=g,c.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(c)),c={},c.p1=n,c.p2=p,c.p3=this._medianPoint.addScaled(b,-e),c.p4=
|
|
c.p3.add(d),c.color=k.color.value(),c.width=this.D0.timeScale().width(),c.transparency=g,c.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(c)));e=k.coeff.value();l={points:(new List).append(l).append(m),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};
|
|
c=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,h);a.append(new TradingView.TrendLineRenderer(l,c));k={points:(new List).append(n).append(p),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};c=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,
|
|
null,h);a.append(new TradingView.TrendLineRenderer(k,c))}}this.addAnchors(a);return a};TradingView.LineToolPitchfork=function(a,b){this._constructor="LineToolPitchfork";var c=b?b:new J52("linetoolpitchfork");R47.call(this,a,new R1(this,a),c);this.D2.style.listeners().subscribe(this,TradingView.LineToolPitchfork.prototype._recreatePaneView);this._recreatePaneView()};inherit(TradingView.LineToolPitchfork,R47);
|
|
TradingView.LineToolPitchfork.STYLE_ORIGINAL=0;TradingView.LineToolPitchfork.STYLE_SCHIFF=1;TradingView.LineToolPitchfork.STYLE_INSIDE=2;TradingView.LineToolPitchfork.STYLE_SCHIFF2=3;
|
|
TradingView.LineToolPitchfork.prototype.additionalActions=function(){for(var a=[],b=["Original","Modified Schiff","Inside","Schiff"],c=0;4>c;c++){var d=new TradingView.Action({checked:this.properties().style.value()==c,checkable:!0,text:$.t(b[c]),callbackContext:{target:this,value:c}});d.callbacks().subscribe(null,function(a){var b=a.callbackContext();a=b.target;b=b.value;a.properties().style.setValue(b);a.updateAllViews();a.D0.updateSource(a)});a.push(d)}return[a[0],a[3],a[1],a[2]]};
|
|
TradingView.LineToolPitchfork.prototype._recreatePaneView=function(){this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_ORIGINAL?this._paneViews=[new R1(this,this.D0)]:this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF?this._paneViews=[new R12(this,this.D0)]:this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF2?this._paneViews=[new R11(this,
|
|
this.D0)]:this.D2.style.value()==TradingView.LineToolPitchfork.STYLE_INSIDE&&(this._paneViews=[new J88(this,this.D0)])};TradingView.LineToolPitchfork.prototype.pointsCount=function(){return 3};TradingView.LineToolPitchfork.prototype.title=function(){return $.t("Pitchfork")};TradingView.LineToolPitchfork.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};R0=function(a,b){J90.call(this,a,b)};inherit(R0,J90);
|
|
R0.prototype.update=function(){J90.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
|
|
R0.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size()||!this._medianPoint)return a;var b={points:(new List).append(this._points.item(0)).append(this._medianPoint),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),extendleft:!1,
|
|
extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));if(3>this._points.size())return this.addAnchors(a),a;b={points:(new List).append(this._points.item(1)).append(this._points.item(2)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this.R99.properties().median.color.value(),linewidth:this.R99.properties().median.linewidth.value(),linestyle:this.R99.properties().median.linestyle.value(),
|
|
extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(b));for(var b=0,c=this._points.item(2).substract(this._points.item(1)).scaled(.5),d=this.R99.properties().fillBackground.value(),e=this.R99.properties().transparency.value(),f=0;8>=f;f++){var g="level"+f,g=this.R99.properties()[g];if(g.visible.value()){var h=this._medianPoint.addScaled(c,g.coeff.value()),k=this._medianPoint.addScaled(c,
|
|
-g.coeff.value());if(d){var l={};l.width=this.D0.timeScale().width();l.p1=this._points.item(0);l.p2=h;l.p3=this._points.item(0);l.p4=this._medianPoint.addScaled(c,b);l.color=g.color.value();l.transparency=e;l.hittestOnBackground=!0;a.append(new TradingView.ChannelRenderer(l));l={};l.width=this.D0.timeScale().width();l.p1=this._points.item(0);l.p2=k;l.p3=this._points.item(0);l.p4=this._medianPoint.addScaled(c,-b);l.color=g.color.value();l.transparency=e;l.hittestOnBackground=!0;a.append(new TradingView.ChannelRenderer(l))}b=
|
|
g.coeff.value();l={points:(new List).append(this._points.item(0)).append(h),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};h=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,f);a.append(new TradingView.TrendLineRenderer(l,h));g={points:(new List).append(this._points.item(0)).append(k),
|
|
width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};h=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,f);a.append(new TradingView.TrendLineRenderer(g,h))}}this.addAnchors(a);return a};
|
|
TradingView.LineToolPitchfan=function(a,b){this._constructor="LineToolPitchfan";var c=b?b:new J52("linetoolpitchfan");R47.call(this,a,new R0(this,a),c)};inherit(TradingView.LineToolPitchfan,R47);TradingView.LineToolPitchfan.prototype.pointsCount=function(){return 3};TradingView.LineToolPitchfan.prototype.title=function(){return"Pitchfan"};
|
|
TradingView.LineToolPitchfan.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.LineToolSchiffPitchfork=function(a,b){var c=b?b:new J52("linetoolschiffpitchfork");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolSchiffPitchfork"};inherit(TradingView.LineToolSchiffPitchfork,TradingView.LineToolPitchfork);TradingView.LineToolSchiffPitchfork.prototype.title=function(){return $.t("Modified Schiff Pitchfork")};TradingView.LineToolSchiffPitchfork2=function(a,b){var c=b?b:new J52("linetoolschiffpitchfork2");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolSchiffPitchfork2"};inherit(TradingView.LineToolSchiffPitchfork2,TradingView.LineToolPitchfork);TradingView.LineToolSchiffPitchfork2.prototype.title=function(){return $.t("Schiff Pitchfork")};TradingView.LineToolInsidePitchfork=function(a,b){var c=b?b:new J52("linetoolinsidepitchfork");TradingView.LineToolPitchfork.call(this,a,c);this._constructor="LineToolInsidePitchfork"};inherit(TradingView.LineToolInsidePitchfork,TradingView.LineToolPitchfork);TradingView.LineToolInsidePitchfork.prototype.title=function(){return $.t("Inside Pitchfork")};function TextRenderer(a,b,c){this._textSizeCache=b;this._data=a;this._fontSize=a.fontsize?a.fontsize:a.fontSize?a.fontSize:20;a.lines=this._lines=this.wordWrap(a.text,a.wordWrapWidth);this._hittest=c?c:new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)}
|
|
(function(){var a;TextRenderer.prototype.wordWrap=function(b,c,d){if(!a){var e=document.createElement("canvas");e.width=0;e.height=0;a=e.getContext("2d")}c=+c;b=(b+"").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);b[b.length-1]||b.pop();if(!isFinite(c)||0>=c)return b;a.font=d||this.fontStyle();d=[];for(e=0;e<b.length;e++){var f=b[e],g=a.measureText(f).width;if(g<=c)d.push(f);else for(f=f.split(/([-\)\]\},.!?:;])|(\s+)/);f.length;){g=~~(c/g*(f.length+2)/3);if(0>=g||a.measureText(f.slice(0,3*g-1).join("")).width<=
|
|
c)for(;a.measureText(f.slice(0,3*(g+1)-1).join("")).width<=c;)g++;else for(;0<g&&a.measureText(f.slice(0,3*--g-1).join("")).width>c;);if(0<g)d.push(f.slice(0,3*g-1).join("")),f.splice(0,3*g);else{var g=f[0]+(f[1]||""),h=1===h?1:~~(c/a.measureText(g)*g.length);if(a.measureText(g.substr(0,h)).width<=c)for(;a.measureText(g.substr(0,h+1)).width<=c;)h++;else for(;1<h&&a.measureText(g.substr(0,--h)).width>c;);1>h&&(h=1);d.push(g.substr(0,h));f[0]=g.substr(h);f[1]=""}g=a.measureText(f.join("")).width;if(g<=
|
|
c){d.push(f.join(""));break}}}return d}})();TextRenderer.prototype._x=function(){return this._data.points.item(0).x+this._data.offsetX};TextRenderer.prototype._y=function(){var a=this._fontSize*this._lines.length;this._data.scaleY&&(a*=this._data.scaleY);var b=this._data.points.item(0).y+this._data.offsetY+a;switch(this._data.vertAlign){case "bottom":b-=a;break;case "middle":b-=a/2}return b};
|
|
TextRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font};
|
|
TextRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){var b=this._x(),c=this._y(),d=this._fontSize;this._data.scaleY&&(d*=this._data.scaleY);c-=d*(this._lines.length-1);a.textBaseline="alphabetic";a.font=this.fontStyle();switch(this._data.horzAlign){case "left":a.textAlign="start";break;case "right":a.textAlign="end";break;case "center":a.textAlign="center"}a.translate(b+.5,c+.5);c=b=0;d=this._fontSize;if(this._data.scaleX&&this._data.scaleY){var e=Math.min(this._data.scaleX,this._data.scaleY);
|
|
a.scale(e,e)}var e=[],f;if(this._data.wordWrapWidth){f=this._data.wordWrapWidth;for(var g=0;g<this._lines.length;g++)e.push(this._data.wordWrapWidth)}else for(g=f=0;g<this._lines.length;g++){var h=a.measureText(this._lines[g]).width;e.push(h);f=Math.max(f,h)}h=0;if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){g=b;switch(this._data.horzAlign){case "right":g-=f;break;case "center":g-=f/2}var k=d*this._lines.length,l=~~(d/6);this._data.backgroundHorzInflate&&
|
|
(f+=2*this._data.backgroundHorzInflate,g-=this._data.backgroundHorzInflate);this._data.backgroundVertInflate&&(k+=2*this._data.backgroundVertInflate,c+=this._data.backgroundVertInflate);var g=Math.floor(g-l),m=Math.floor(c-d);f=Math.ceil(f+2*l);k=Math.ceil(k+2*l);0!==f%2&&f++;this._data.padding&&(k+=this._data.padding,h=this._data.padding);this._data.backgroundVertInflate&&(c+=this._data.backgroundVertInflate);if(this._data.backgroundRoundRect){if(a.roundRect(g,m,f,k,this._data.backgroundRoundRect),
|
|
this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fill(),a.globalAlpha=1),this._data.borderColor){var n=~~Math.max(d/12,1);a.strokeStyle=this._data.borderColor;a.lineWidth=n;a.stroke()}}else if(this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fillRect(g,m,f,k),a.globalAlpha=1),this._data.borderColor)n=~~Math.max(d/12,1),a.strokeStyle=this._data.borderColor,a.lineWidth=
|
|
n,a.strokeRect(g-n/2,m-n/2,f+n,k+n);else if(this._data.highlightBorder){a.strokeStyle=this._data.color;a.lineWidth=1;a.beginPath();var p=[3,1];a.dashedLineTo(g-.5,n=m-.5,l=g+f+.5,n,p);a.dashedLineTo(l,n,l,n=m+k+.5,p);a.dashedLineTo(l=g-.5,n,g+f+.5,n,p);a.dashedLineTo(l,m-.5,l,n,p);a.globalAlpha=.5;a.stroke();a.globalAlpha=1}}this._data.backgroundVertInflate&&!this._data.backgroundColor&&(c+=2*this._data.backgroundVertInflate);a.fillStyle=this._data.color;for(g=0;g<this._lines.length;g++)a.fillText(this._lines[g],
|
|
b,c),c+=d+h;this._textSizeCache&&(this._textSizeCache.widths=e)}};
|
|
TextRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._fontSize;this._data.scaleY&&(b*=this._data.scaleY);var c=this._textSizeCache.widths;if(!c)return null;for(var d=0,e=0;e<c.length;e++)d=Math.max(d,c[e]);this._data.scaleX&&(d*=this._data.scaleX);c=this._data.points.item(0).x+this._data.offsetX;e=this._data.points.item(0).y+this._data.offsetY;"bottom"==this._data.vertAlign&&(e-=this._lines.length*this._fontSize);"middle"==this._data.vertAlign&&(e-=this._lines.length*
|
|
this._fontSize/2);"right"==this._data.horzAlign?c-=d:"center"==this._data.horzAlign&&(c-=d/2);var f=this._data.backgroundColor||this._data.borderColor?~~(b/6):0,b=this._data.borderColor?~~Math.max(b/12,1):0;return a.x>=c-f-b&&a.x<=c+d+f+b&&a.y>=e-b&&a.y<=e+this._lines.length*this._fontSize+2*f+b?this._hittest:null};
|
|
R39=function(a,b,c,d,e,f){J90.call(this,a,b);this._offsetX=c;this._offsetY=d;this._vertAlign=e;this._horzAlign=f;this._rendererCache={};this._renderer=null};inherit(R39,J90);R39.prototype.update=function(){this._renderer=null;J90.prototype.update.call(this)};
|
|
R39.prototype.renderer=function(){if(this._renderer)return this._renderer;var a=this.R99.priceScale();if(!a||a.isEmpty())return this._renderer=new TradingView.CompositeRenderer;var b={},c=this.R99.properties(),d=c.locked&&c.locked.value();b.points=d?this.R99.fixedPoints():this._points;b.text=c.text.value();b.color=c.color.value();b.font=c.font.value();b.offsetX=this._offsetX?this._offsetX:0;b.offsetY=this._offsetY?this._offsetY:0;b.vertAlign=this._vertAlign?this._vertAlign:
|
|
"top";b.horzAlign=this._horzAlign?this._horzAlign:"left";b.fontsize=c.fontsize.value();c.fillBackground&&c.fillBackground.value()&&(b.backgroundColor=c.backgroundColor.value(),b.backgroundTransparency=1-c.backgroundTransparency.value()/100||0);c.drawBorder&&c.drawBorder.value()&&(b.borderColor=c.borderColor.value());c.wordWrap&&c.wordWrap.value()&&(b.wordWrapWidth=c.wordWrapWidth.value());b.bold=c.bold&&c.bold.value();b.italic=c.italic&&c.italic.value();b.highlightBorder=this.D0.selectedSource()===
|
|
this.R99;d||!c.fixedSize||c.fixedSize.value()||(b.scaleX=this.R99.D0.timeScale().barSpacing()/this.R99._barSpacing,c=a.height()/a.priceRange().length(),this.R99._isPriceDencityLog&&!a.isLog()&&(c=a.priceRange().minValue(),d=a.priceRange().maxValue(),c=a._toLog(c),d=a._toLog(d),c=d-c,c=a.height()/c),!this.R99._isPriceDencityLog&&a.isLog()&&(c=a.priceRange().minValue(),d=a.priceRange().maxValue(),c=a._fromLog(c),d=a._fromLog(d),c=d-c,c=a.height()/c),b.scaleY=c/this.R99._priceDencity,
|
|
(!isFinite(b.scaleY)||0>=b.scaleY)&&delete b.scaleY);c=new TextRenderer(b,this._rendererCache);this.isAnchorsRequired()&&1===b.points.size()&&!this._noSelection?(d=b.points.item(0),a=new TradingView.CompositeRenderer,a.append(c),b.wordWrapWidth&&(b=new MathEx.Point(d.x+b.wordWrapWidth+~~(b.fontsize/6),d.y+(b.lines?b.lines.length*b.fontsize/2+~~(b.fontsize/6):0)),b.data=0,a.append(this.createLineAnchor({points:[b]}))),this._renderer=a):this._renderer=c;return this._renderer};
|
|
TradingView.LineToolText=function(a,b){this._constructor="LineToolText";var c=b?b:new J52("linetooltext");R47.call(this,a,new R39(this,a),c);this._timeScale=a.timeScale();this._barSpacing=a.timeScale().barSpacing()};inherit(TradingView.LineToolText,R47);TradingView.LineToolText.MIN_WIDTH=100;
|
|
TradingView.LineToolText.prototype.setPoint=function(a,b){var c=this.properties(),d;0===a&&c.wordWrapWidth&&c.wordWrapWidth.value()&&(d=c.locked&&c.locked.value()?this.fixedPoints().item(0).x:this._timeScale.indexToCoordinate(this.points().item(0).index),d=this._timeScale.indexToCoordinate(b.index)-d-~~(c.fontsize.value()/6),isFinite(d)&&c.wordWrapWidth.setValue(Math.max(TradingView.LineToolText.MIN_WIDTH,d)))};TradingView.LineToolText.prototype.pointsCount=function(){return 1};
|
|
TradingView.LineToolText.prototype.title=function(){return $.t("Text")};TradingView.LineToolText.prototype.setPriceScale=function(a){DataSource.prototype.setPriceScale.call(this,a);a&&a.priceRange()&&(this._priceDencity=a.height()/a.priceRange().length(),this._isPriceDencityLog=a.isLog())};
|
|
TradingView.LineToolText.prototype.restoreSize=function(){this._barSpacing=this.D0.timeScale().barSpacing();this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length();this.updateAllViews();this.D0.updateSource(this)};TradingView.LineToolText.prototype.restoreTemplate=function(a){delete a.locked;delete a.text;R47.prototype.restoreTemplate.call(this,a)};
|
|
TradingView.LineToolTextAbsolute=function(a,b){var c=b?b:new J52("linetooltextabsolute");c.locked.value()||c.locked.setValue(!0);TradingView.LineToolText.call(this,a,c)};inherit(TradingView.LineToolTextAbsolute,TradingView.LineToolText);TradingView.LineToolTextAbsolute.prototype.title=function(){return $.t("Anchored Text")};TradingView.LineToolText.prototype.state=function(a){var b=R47.prototype.state.call(this,a);a&&(b.state.fixedSize=!1);return b};TradingView.LineToolThumbUp=function(a,b){this._constructor="LineToolThumbUp";var c=b?b:new Property(defaults("linetoolthumbup"));R47.call(this,a,new J97(this,a,this.image,20,20,-11,0),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbUp,R47);TradingView.LineToolThumbUp.prototype.image=new Image;TradingView.LineToolThumbUp.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAACG0lEQVR4AWMgBajE205TTrD7D8R7VRJtQxgoBSDD9r++8n/68bX/leNt91NkmEKCg4BOhvv/7S/O/d/y9DTIlT8pMlAx3q4kqDv7/9KHB/8vfXAAZOAfsg0DhpeoerLT/zmXtv6ffXfn/6ZD8/4rxdqcJT/s4m168pa0/V/1+Mj/6Xe2/XdvTfovF2SWS57rEmxCjfP9/q95cOT//Pt7/k+6sem/SpLDfwZBQX4yYtXBA+TVicdW/l/+6ND/aXe2gl0YPa0MFIYQnGi3TjHB3hVFI0wSxoZhy5Lg/70Hlv5f//TE/zn3dv2feGvj/5l3d4D5e19dAieh3v1LgGptN+AzEKQQjPcANW16dvr/wgf7/k+5vfl//80N/6fd3gqO6Y3PTv7f8vzM/x0vzoP14jVw24uzQINO/V/75DjYsKlAQybc3AgyEORKsKGzgC6dC3T1ikeHCRu45OEBcPKYcWf7/8m3N8MMQ8cgcZChhA2cfW8nRBNhDFI7yA3sPb/6v3Kc7VOqGZi2rPm/fITFLKoY2Hxq8X+dTPf/km66xkQlbM101/+WFaH/XVoT/6esbPrfcmbJ/+6ra/4X75r0P3p+5X8toLxckEknUBsbvhzHCcRSoGzMKSNsJmKmFClup1EhG2C6QzHG+h2wYP0pH2p+RcbPaImgtpQ1UB0XEDMSzMdQRcxAzA7EvEAsCsSyQCwPtVAAiFnRDQMAkGceWYhDo88AAAAASUVORK5CYII=";
|
|
TradingView.LineToolThumbUp.prototype.pointsCount=function(){return 1};TradingView.LineToolThumbUp.prototype.title=function(){return"Thumb Up"};TradingView.LineToolThumbDown=function(a,b){this._constructor="LineToolThumbDown";var c=b?b:new J52("linetoolthumbdown");R47.call(this,a,new J97(this,a,this.image,20,20,-6,-18),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbDown,R47);
|
|
TradingView.LineToolThumbDown.prototype.image=new Image;TradingView.LineToolThumbDown.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAB70lEQVR4AWNAB4dsVUT3WCrU7bOQP7zXQuH/Xgv523stFSbsNley2e+gzcNACgBqLNhvq/r/SkbQ/wcNWf9fT6n//7Sj6P+N/Ij/JwIs/4PkIJYgMFgfgo0Au8xlVA/Yq/9/3JL//3lrwf+nNan/H1ck/n9Slfz/WVPO/xddpf9fTaj+/2pSLRi/ntaI38Ad5goTrmUF/39am/7/IdBFD7KC/t9P9///IDPw/8Oc0P+PCqP+PyqJ/f+4NA6MnzVk4Tdwj4XCg0dVKf8f5oX/v5/mRwiDDMVtIFQQ5D2Qi6hn4OOyeJBiqhkIUjSSDNxsKrf3RoovKKlgMwAsfj3W9f8RJy3iEvZ8A5moVcayJ2CS5wIt/z/ICIAbdjPR8/8+K6X/TepiZUDlakAsBcSc+HIeGxCLArGCNh+r6V5Lxf8Pc0PBBt7LDPp/yEHj/1QdiWKgPBcQM5GUp7eYycWf9Lf4/6goGuzKixEO/xcbyC6AuoiRgVSw01z+2L3S+P+PCiL/30kP+L/fRuV/oZKgLumGIWL8z9PaNGA2DPt/OsDi/0I9mS6gMCvpJiHy9a9HZXHgQuKAnfr/UhUxZbDryAXbzOQv384KBpUusOTAwkAJWGokXbjRWO4WyLANJnILwa6jELADsTgQS4JjlgQAAD+B93SzAgQRAAAAAElFTkSuQmCC";
|
|
TradingView.LineToolThumbDown.prototype.pointsCount=function(){return 1};TradingView.LineToolThumbDown.prototype.title=function(){return"Thumb Down"};TradingView.LineToolThumbDown.prototype.version=TradingView.LineToolThumbUp.prototype.version=2;TradingView.LineToolThumbUp.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(12,0)))};
|
|
TradingView.LineToolThumbDown.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(7,18)))};TradingView.BalloonRenderer=function(a,b){this._measureCache=b;this._data=a};
|
|
TradingView.BalloonRenderer.prototype.draw=function(a){if(0!==this._data.points.length){a.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var b=a.measureText(this._data.label);b.height=this._data.fontSize;var c={left:15,top:(30-b.height)/2},b=b.width+2*c.left,d=this._data.points[0].x-(c.left+20),e=this._data.points[0].y-39;this._measureCache&&$.extend(this._measureCache,{innerWidth:b,innerHeight:30,padding:c});a.translate(.5+d,.5+e);a.beginPath();a.moveTo(24,
|
|
30);a.lineTo(15,30);a.arcTo(-1E3,0,1E3,0,15);a.lineTo(b-15,0);a.arcTo(1E3,30,-1E3,30,15);a.lineTo(33,30);a.quadraticCurveTo(33,34,35,39);a.quadraticCurveTo(27,36,24,30);a.fillStyle=TradingView.generateColor(this._data.backgroundColor,this._data.transparency);a.fill();a.strokeStyle=this._data.borderColor;a.lineWidth=2;a.stroke();a.closePath();a.textBaseline="top";a.fillStyle=this._data.color;a.fillText(this._data.label,c.left,c.top-1)}};
|
|
TradingView.BalloonRenderer.prototype.hitTest=function(a){if(0===this._data.points.length||!this._measureCache.padding)return null;var b=this._data.points[0].x-(this._measureCache.padding.left+20),c=this._data.points[0].y-(this._measureCache.innerHeight+9);return MathEx.pointInRect(a,new MathEx.Point(b,c),new MathEx.Point(b+this._measureCache.innerWidth,c+this._measureCache.innerHeight))?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
J56=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J56,J90);
|
|
J56.prototype.renderer=function(){var a={};a.points=this._points.toArray();a.color=this.R99.properties().color.value();a.borderColor=this.R99.properties().borderColor.value();a.backgroundColor=this.R99.properties().backgroundColor.value();a.transparency=this.R99.properties().transparency.value();a.fontWeight=this.R99.properties().fontWeight.value();a.fontSize=this.R99.properties().fontsize.value();a.fontFamily=this.R99.properties().font.value();
|
|
a.label=this.R99.properties().text.value();if(this.isAnchorsRequired()&&1==a.points.length){var b=new TradingView.CompositeRenderer;b.append(new TradingView.BalloonRenderer(a,this._rendererCache));b.append(new TradingView.SelectionRenderer({points:a.points}));return b}return new TradingView.BalloonRenderer(a,this._rendererCache)};
|
|
TradingView.LineToolBalloon=function(a,b){this._constructor="LineToolBalloon";var c=b?b:new J52("linetoolballoon");R47.call(this,a,new J56(this,a),c)};inherit(TradingView.LineToolBalloon,R47);TradingView.LineToolBalloon.prototype.pointsCount=function(){return 1};TradingView.LineToolBalloon.prototype.title=function(){return"Balloon"};TradingView.CalloutRenderer=function(a,b){this._data=a;a.lines=this.wordWrap(a.text,a.wordWrapWidth);this._textSizeCache=b};TradingView.CalloutRenderer.ROUND_RADIUS=8;TradingView.CalloutRenderer.TEXT_MARGINS=2;
|
|
(function(){var a;TradingView.CalloutRenderer.prototype.wordWrap=function(b,c){if(!a){var d=document.createElement("canvas");d.width=0;d.height=0;a=d.getContext("2d")}c=+c;d=(b+"").split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/);d[d.length-1]||d.pop();if(!isFinite(c)||0>=c)return d;a.font=this.fontStyle();for(var e=[],f=0;f<d.length;f++){var g=d[f],h=a.measureText(g).width;if(h<=c)e.push(g);else for(g=g.split(/([-\)\]\},.!?:;])|(\s+)/);g.length;){h=~~(c/h*(g.length+2)/3);if(0>=h||a.measureText(g.slice(0,3*h-
|
|
1).join("")).width<=c)for(;a.measureText(g.slice(0,3*(h+1)-1).join("")).width<=c;)h++;else for(;0<h&&a.measureText(g.slice(0,3*--h-1).join("")).width>c;);if(0<h)e.push(g.slice(0,3*h-1).join("")),g.splice(0,3*h);else{var h=g[0]+(g[1]||""),k=1===k?1:~~(c/a.measureText(h)*h.length);if(a.measureText(h.substr(0,k)).width<=c)for(;a.measureText(h.substr(0,k+1)).width<=c;)k++;else for(;1<k&&a.measureText(h.substr(0,--k)).width>c;);1>k&&(k=1);e.push(h.substr(0,k));g[0]=h.substr(k);g[1]=""}h=a.measureText(g.join("")).width;
|
|
if(h<=c){e.push(g.join(""));break}}}return e}})();
|
|
TradingView.CalloutRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1);if(3>b.substract(a).length())return new TradingView.HitTestResult(TradingView.HitTestResult.CHANGEPOINT,0);b=c.x-this._textSizeCache.totalWidth/2;c=c.y-this._textSizeCache.totalHeight/2;return a.x>=b&&a.x<=b+this._textSizeCache.totalWidth&&a.y>=c&&a.y<=c+this._textSizeCache.totalHeight?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
TradingView.CalloutRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
TradingView.CalloutRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0).clone(),c=this._data.points.item(1).clone();a.lineCap="butt";a.strokeStyle=this._data.bordercolor;a.lineWidth=this._data.linewidth;a.textBaseline="bottom";a.font=this.fontStyle();var d=this._data.fontSize*this._data.lines.length,e=this._data.wordWrapWidth||this._data.lines.reduce(function(b,c){return Math.max(b,a.measureText(c).width)},0);this._textSizeCache.textHeight=d;this._textSizeCache.textHeight=
|
|
e;var f=TradingView.CalloutRenderer.ROUND_RADIUS,g=TradingView.CalloutRenderer.TEXT_MARGINS,h=e+2*g+2*f,k=d+2*g+2*f;this._textSizeCache.totalWidth=h;this._textSizeCache.totalHeight=k;var l=c.x-h/2,m=c.y-k/2,n=0,e=e+2*g>2*f,d=d+2*g>2*f;b.x>l+h?n=20:b.x>l&&(n=10);b.y>m+k?n+=2:b.y>m&&(n+=1);a.save();a.translate(l,m);b.x-=l;b.y-=m;c.x-=l;c.y-=m;a.beginPath();a.moveTo(f,0);10==n&&(e?(a.lineTo(c.x-f,0),a.lineTo(b.x,b.y),a.lineTo(c.x+f,0)):a.lineTo(b.x,b.y));a.lineTo(h-f,0);20==n?(a.lineTo(b.x,b.y),a.lineTo(h,
|
|
f)):a.arcTo(h,0,h,f,f);21==n&&(d?(a.lineTo(h,c.y-f),a.lineTo(b.x,b.y),a.lineTo(h,c.y+f)):a.lineTo(b.x,b.y));a.lineTo(h,k-f);22==n?(a.lineTo(b.x,b.y),a.lineTo(h-f,k)):a.arcTo(h,k,h-f,k,f);12==n&&(e?(a.lineTo(c.x+f,k),a.lineTo(b.x,b.y),a.lineTo(c.x-f,k)):a.lineTo(b.x,b.y));a.lineTo(f,k);2==n?(a.lineTo(b.x,b.y),a.lineTo(0,k-f)):a.arcTo(0,k,0,k-f,f);1==n&&(d?(a.lineTo(0,c.y+f),a.lineTo(b.x,b.y),a.lineTo(0,c.y-f)):a.lineTo(b.x,b.y));a.lineTo(0,f);0===n?(a.lineTo(b.x,b.y),a.lineTo(f,0)):a.arcTo(0,0,f,0,
|
|
f);a.stroke();a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency);a.fill();a.fillStyle=this._data.color;m=f+g+this._data.fontSize;l=f+g;for(b=0;b<this._data.lines.length;b++)a.fillText(this._data.lines[b],l,m),m+=this._data.fontSize;a.restore()}};J62=function(a,b){J90.call(this,a,b);this._textSizeCache={}};inherit(J62,J90);
|
|
J62.prototype.update=function(){J90.prototype.update.call(this);this.R99._calculatePoint2()};
|
|
J62.prototype.renderer=function(){if(!this._points.item(0))return new TradingView.CompositeRenderer;if(!(2>this._points.size(0))){var a=this.R99.properties(),b={};b.points=new List;b.points.append(this._points.item(0));var c=this._points.item(1).clone();c.x=this._points.item(0).x+this.R99._barOffset*this.D0.timeScale().barSpacing();b.points.append(c);b.color=a.color.value();b.linewidth=a.linewidth.value();b.backcolor=a.backgroundColor.value();b.transparency=a.transparency.value();
|
|
b.text=a.text.value();b.font=a.font.value();b.fontSize=a.fontsize.value();b.bordercolor=a.bordercolor.value();a.wordWrap&&a.wordWrap.value()&&(b.wordWrapWidth=a.wordWrapWidth.value());b.bold=a.bold&&a.bold.value();b.italic=a.italic&&a.italic.value();c=new TradingView.CalloutRenderer(b,this._textSizeCache);if(this.isAnchorsRequired()){a=new TradingView.CompositeRenderer;a.append(c);var c=b.points.item(1),d=b.points.clone();d.removeAt(d.size()-1);a.append(this.createLineAnchor({points:d.toArray()}));
|
|
b.wordWrapWidth&&(b=new MathEx.Point(c.x+(b.wordWrapWidth>>1)+TradingView.CalloutRenderer.ROUND_RADIUS+TradingView.CalloutRenderer.TEXT_MARGINS,c.y),b.data=1,a.append(this.createLineAnchor({points:[b]})));return a}return c}};TradingView.LineToolCallout=function(a,b){this._constructor="LineToolCallout";var c=b?b:new J52("linetoolcallout");R47.call(this,a,new J62(this,a),c);this._barOffset=0;this._timeScale=a.timeScale()};
|
|
inherit(TradingView.LineToolCallout,R47);TradingView.LineToolCallout.MIN_WIDTH=100;TradingView.LineToolCallout.prototype.pointsCount=function(){return 2};TradingView.LineToolCallout.prototype.title=function(){return"Callout"};TradingView.LineToolCallout.prototype.correctPoints=function(a){var b=this._currentMovingPoint.index-this._startMovingPoint.index,c=this._currentMovingPoint.price-this._startMovingPoint.price,d=a.item(1);d.index+=b;d.price+=c;a.setItem(1,d)};
|
|
TradingView.LineToolCallout.prototype.addPoint=function(a){(a=R47.prototype.addPoint.call(this,a))&&this._calculateBarOffset();return a};TradingView.LineToolCallout.prototype._calculateBarOffset=function(){1<this.points().size()&&(this._barOffset=this.points().item(1).index-this.points().item(0).index)};TradingView.LineToolCallout.prototype.setLastPoint=function(a){R47.prototype.setLastPoint.call(this,a);2==this.points().size()&&this._calculateBarOffset()};
|
|
TradingView.LineToolCallout.prototype.setPoint=function(a,b){switch(a){case 0:R47.prototype.setPoint.call(this,a,b);this._calculateBarOffset();break;case 1:var c=this.properties();if(!c.wordWrapWidth)break;var d=this._points,e=this._dragStartLeftEdgeIndex,f=Math.round((b.index-e)/2);if(isFinite(e)&&isFinite(f)){d.setItem(1,{index:e+f,price:d.item(1).price});this._calculateBarOffset();this.normalizePoints();d=this._timeScale.indexToCoordinate(e+2*f)-this._timeScale.indexToCoordinate(e)-
|
|
TradingView.CalloutRenderer.ROUND_RADIUS-TradingView.CalloutRenderer.TEXT_MARGINS;if(!isFinite(d))break;c.wordWrapWidth.setValue(Math.max(TradingView.LineToolCallout.MIN_WIDTH,d))}else d.setItem(1,b),this._calculateBarOffset(),this.normalizePoints()}};TradingView.LineToolCallout.prototype.startDragPoint=function(a,b){var c=this.properties();1===a&&c.wordWrap&&c.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points().item(1).index-b.index)};
|
|
TradingView.LineToolCallout.prototype.move=function(a){R47.prototype.move.call(this,a);this._calculateBarOffset()};TradingView.LineToolCallout.prototype.state=function(a){a=R47.prototype.state.call(this,a);a.barOffset=this._barOffset;return a};TradingView.LineToolCallout.prototype.restoreData=function(a){a.barOffset?this._barOffset=a.barOffset:this._calculateBarOffset();this._calculatePoint2()};
|
|
TradingView.LineToolCallout.prototype.setPriceScale=function(a){DataSource.prototype.setPriceScale.call(this,a);a&&a.priceRange()&&this._calculatePoint2()};TradingView.LineToolCallout.prototype._calculatePoint2=function(){if(this.D0.lineBeingEdited()!=this&&this.D0.sourceBeingMoved()!=this&&!(2>this._points.size())){var a=this.points().item(0),b=this.points().item(1);this._points.setItem(1,{price:b.price,index:a.index+this._barOffset})}};TradingView.TriangleRenderer=function(a){this._data=a};
|
|
TradingView.TriangleRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),d;d=2==this._data.points.size()?c:this._data.points.item(2);a.beginPath();a.moveTo(b.x,b.y);a.lineTo(c.x,c.y);a.lineTo(d.x,d.y);a.lineTo(b.x,b.y);this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),
|
|
a.fill());a.stroke()}};
|
|
TradingView.TriangleRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2)||c,e=MathEx.distanceToSegment(b,c,a);if(3>=e.distance)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(c,d,a);if(3>=e.distance)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(d,b,a);return 3>=e.distance?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):
|
|
this._data.fillBackground&&MathEx.pointInTriangle(b,c,d,a)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND):null};R44=function(a,b){J90.call(this,a,b)};inherit(R44,J90);
|
|
R44.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().color.value();a.linewidth=this.R99.properties().linewidth.value();a.backcolor=this.R99.properties().backgroundColor.value();a.fillBackground=this.R99.properties().fillBackground.value();a.transparency=this.R99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new TradingView.CompositeRenderer;b.append(new TradingView.TriangleRenderer(a));this.addAnchors(b);
|
|
return b}return new TradingView.TriangleRenderer(a)};TradingView.LineToolTriangle=function(a,b){this._constructor="LineToolTriangle";var c=b?b:new J52("linetooltriangle");R47.call(this,a,new R44(this,a),c)};inherit(TradingView.LineToolTriangle,R47);TradingView.LineToolTriangle.prototype.pointsCount=function(){return 3};TradingView.LineToolTriangle.prototype.title=function(){return"Triangle"};TradingView.ArcRenderer=function(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=Math.PI;this._data.clockwise=!1};
|
|
TradingView.ArcRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){var b=this._data.points.item(0),c=this._data.points.item(1);if(3>this._data.points.size())a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var d=this._data.points.item(2),d=MathEx.distanceToLine(b,c,d).distance;if(1>d)a.strokeStyle=this._data.color,a.lineWidth=this._data.linewidth,a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();
|
|
else{var e=c.substract(b),f=b.add(c).scaled(.5),c=new MathEx.Point(-e.y,e.x),c=c.normalized();f.add(c.scaled(d));f.add(c.scaled(-d));a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;var c=e.length(),g=e.y/c,e=Math.acos(e.x/c);0>g&&(e=-e);g=this._data.points.item(2);f=MathEx.Matrix.translate(-f.x,-f.y);g=f.mult(g);f=MathEx.Matrix.rotate(-e);g=f.mult(g);f=MathEx.Matrix.scale(1,c/(2*d));g=f.mult(g);this._data.clockwise=0>g.y?!0:!1;a.save();a.beginPath();a.translate(b.x,b.y);a.rotate(e);
|
|
b=1-Math.sqrt(3)/2;a.scale(1,d/(c*b));this._data.clockwise?a.arc(.5*c,c*Math.sqrt(3)/2,c,-2*Math.PI/3,-Math.PI/3,!1):a.arc(.5*c,-c*Math.sqrt(3)/2,c,Math.PI/3,2*Math.PI/3,!1);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};
|
|
TradingView.ArcRenderer.prototype.hitTest=function(a){if(3>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),e=MathEx.distanceToLine(b,c,d).distance;if(1>e)return e=MathEx.distanceToLine(b,c,a).distance,5>e?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null;var f=c.substract(b),g=f.length(),c=b.add(c).scaled(.5),d=d.substract(c),d=d.normalized();c.add(d.scaled(e));c.add(d.scaled(-e));c=f.y/g;f=Math.acos(f.x/
|
|
g);0>c&&(f=-f);b=MathEx.Matrix.translate(-b.x,-b.y);a=b.mult(a);b=MathEx.Matrix.rotate(-f);a=b.mult(a);d=b.mult(d);b=1-Math.sqrt(3)/2;b=MathEx.Matrix.scale(1,g*b/e);a=b.mult(a);d=b.mult(d);if(0>a.y*d.y)return null;e=0>a.y?new MathEx.Point(.5*g,g*Math.sqrt(3)/2):new MathEx.Point(.5*g,-g*Math.sqrt(3)/2);a=a.substract(e).length();return 5>=Math.abs(a-g)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
J54=function(a,b){J90.call(this,a,b)};inherit(J54,J90);
|
|
J54.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().color.value();a.linewidth=this.R99.properties().linewidth.value();a.backcolor=this.R99.properties().backgroundColor.value();a.fillBackground=this.R99.properties().fillBackground.value();a.transparency=this.R99.properties().transparency.value();if(this.isAnchorsRequired()){var b=new TradingView.CompositeRenderer;b.append(new TradingView.ArcRenderer(a));var c=new List,
|
|
d=a.points.item(0),e=new MathEx.Point(d.x,d.y);e.data=0;c.append(e);if(1==a.points.size())return b;var f=a.points.item(1),e=new MathEx.Point(f.x,f.y);e.data=1;if(2==a.points.size())return this.addAnchors(b),b;c.append(e);var e=a.points.item(2),g=MathEx.distanceToLine(d,f,e).distance,h=f.substract(d),d=d.add(f).scaled(.5),f=new MathEx.Point(-h.y,h.x),f=f.normalized(),e=d.add(f.scaled(g)),f=d.add(f.scaled(-g)),k=h.length(),l=h.y/k,h=Math.acos(h.x/k);0>l&&(h=-h);a=a.points.item(2);d=MathEx.Matrix.translate(-d.x,
|
|
-d.y);a=d.mult(a);d=MathEx.Matrix.rotate(-h);a=d.mult(a);d=MathEx.Matrix.scale(1,k/(2*g));a=d.mult(a);a=0<=a.y?new MathEx.Point(e.x,e.y):new MathEx.Point(f.x,f.y);a.data=2;c.append(a);b.append(this.createLineAnchor({points:c.toArray()}));return b}return new TradingView.ArcRenderer(a)};
|
|
TradingView.LineToolArc=function(a,b){this._constructor="LineToolArc";var c=b?b:new J52("linetoolarc");R47.call(this,a,new J54(this,a),c);this.version=TradingView.LineToolArc.version};inherit(TradingView.LineToolArc,R47);
|
|
TradingView.LineToolArc.prototype.startChanging=function(a,b){R47.prototype.startChanging.call(this,a,b);if(0===a||1===a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0];this._dist=MathEx.distanceToLine(c,d,e).distance;var f=d.substract(c),f=new MathEx.Point(-f.y,f.x),c=c.add(d).scaled(.5);0>e.substract(c).dotProduct(f)&&(this._dist=-this._dist)}};
|
|
TradingView.LineToolArc.prototype.pointsCount=function(){return 3};TradingView.LineToolArc.prototype.title=function(){return"Arc"};
|
|
TradingView.LineToolArc.prototype.setPoint=function(a,b){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],f=this.priceScale();if(f.isPercent()){var g=this.ownerSource().firstValue();b.price=f.priceRange().convertFromPercent(b.price,g)}switch(a){case 0:var c=this.pointToScreenPoint(b)[0],g=d.substract(c),h=c.add(d).scaled(.5),c=new MathEx.Point(-g.y,g.x),c=c.normalized(),e=h.add(c.scaled(this._dist)),
|
|
e=this.screenPointToPoint(e);this._points.setItem(0,b);this._points.setItem(2,e);break;case 1:f=MathEx.distanceToLine(c,d,e).distance;d=this.pointToScreenPoint(b)[0];g=d.substract(c);h=c.add(d).scaled(.5);c=new MathEx.Point(-g.y,g.x);c=c.normalized();e=h.add(c.scaled(this._dist));e=this.screenPointToPoint(e);this._points.setItem(1,b);this._points.setItem(2,e);break;case 2:b=this.pointToScreenPoint(b)[0];var f=MathEx.distanceToLine(c,d,b).distance,g=d.substract(c),h=c.add(d).scaled(.5),c=new MathEx.Point(-g.y,
|
|
g.x),c=c.normalized(),e=h.add(c.scaled(f)),c=h.add(c.scaled(-f)),d=g.length(),k=g.y/d,g=Math.acos(g.x/d);0>k&&(g=-g);h=MathEx.Matrix.translate(-h.x,-h.y);b=h.mult(b);k=h.mult(e);h=MathEx.Matrix.rotate(-g);b=h.mult(b);k=h.mult(k);h=MathEx.Matrix.scale(1,d/(2*f));b=h.mult(b);k=h.mult(k);e=0<=b.y*k.y?new MathEx.Point(e.x,e.y):new MathEx.Point(c.x,c.y);e=this.screenPointToPoint(e);this._points.setItem(2,e)}this.normalizePoints()};TradingView.LineToolArc.version=2;
|
|
TradingView.LineToolArc.prototype.migrateVersion=function(a,b,c){1==a&&2==this._points.size()&&(b=(2*this._points.item(0).price+3*this._points.item(1).price)/5,this._points.append({price:b,index:this._points.item(1).index}));1==a&&2==this._timePoint.size()&&(b=(2*this._timePoint.item(0).price+3*this._timePoint.item(1).price)/5,a={price:b,offset:this._timePoint.item(1).offset,time_t:this._timePoint.item(1).time_t},this._timePoint.append(a))};TradingView.LineToolArrow=function(a,b){this._constructor="LineToolArrow";var c=b?b:new J52("linetoolarrow");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolArrow,TradingView.LineToolTrendLine);TradingView.LineToolArrow.prototype.title=function(){return"Arrow"};J61=function(a,b){J90.call(this,a,b);this._invalidated=!0;this.D0=b;this.R99=a};inherit(J61,J90);J61.prototype.update=function(){this._invalidated=!0};
|
|
J61.prototype._smoothArray=function(a,b){for(var c=Array(a.length),d=0;d<a.length;d++){for(var e=new MathEx.Point(0,0),f=0;f<b;f++)var g=Math.max(d-f,0),h=Math.min(d+f,a.length-1),e=e.add(a[g]),e=e.add(a[h]);c[d]=e.scaled(.5/b)}c.push(a[a.length-1]);return c};
|
|
J61.prototype._updateInternal=function(){J90.prototype.update.call(this);var a=Math.max(1,this.R99.properties().smooth.value()),b=this._points.toArray();if(0!==b.length){for(var c=[b[0]],d=1;d<b.length;d++){for(var e=b[d].substract(b[d-1]),f=e.length(),g=Math.floor(f/a),e=e.normalized().scaled(f/g),f=0;f<g-1;f++)c.push(b[d-1].add(e.scaled(f)));c.push(b[d])}a=this._smoothArray(c,a);this._points=new List(a)}};
|
|
J61.prototype.renderer=function(){this._invalidated&&(this._updateInternal(),this._invalidated=!1);var a={},b=this.R99.properties();a.points=this._points.toArray();a.color=b.linecolor.value();a.linewidth=b.linewidth.value();a.linestyle=b.linestyle.value();a.skipClosePath=!0;a.leftend=this.R99.properties().leftEnd.value();a.rightend=this.R99.properties().rightEnd.value();b.fillBackground.value()&&this.D0.lineBeingCreated()!==this.R99&&(a.filled=!0,a.fillBackground=
|
|
!0,a.backcolor=b.backgroundColor.value(),a.transparency=b.transparency.value());return this.isAnchorsRequired()&&this.R99.finished()?(b=new TradingView.CompositeRenderer,b.append(new TradingView.PoligonRenderer(a)),0<a.points.length&&b.append(new TradingView.SelectionRenderer({points:[a.points[0],a.points[a.points.length-1]]})),b):new TradingView.PoligonRenderer(a)};
|
|
TradingView.LineToolBrush=function(a,b){this._constructor="LineToolBrush";var c=b?b:new J52("linetoolbrush");R47.call(this,a,new J61(this,a),c);this._finished=!1};inherit(TradingView.LineToolBrush,R47);TradingView.LineToolBrush.prototype.pointsCount=function(){return-1};TradingView.LineToolBrush.prototype.finished=function(){return this._finished};
|
|
TradingView.LineToolBrush.prototype.finish=function(){this._finished=!0;this._lastPoint=null;this.normalizePoints();this.createServerPoints()};TradingView.LineToolBrush.prototype.title=function(){return"Brush"};TradingView.LineToolBrush.prototype.percentDistance=function(a,b){return Math.abs((b-a)/a)};
|
|
TradingView.LineToolBrush.prototype.addPoint=function(a){if(this._finished)return!0;this._lastPoint=null;if(0<this._points.size()){var b=this._points.item(this._points.size()-1),b=this.pointToScreenPoint(b)[1];if(2>this.pointToScreenPoint(a)[1].substract(b).length())return this._finished}R47.prototype.addPoint.call(this,a);return this._finished};
|
|
TradingView.LineToolBrush.prototype.restorePoints=function(a,b,c){R47.prototype.restorePoints.call(this,a,b,c);this._finished=!0};TradingView.LineToolRay=function(a,b){this._constructor="LineToolRay";var c=b?b:new J52("linetoolray");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolRay,TradingView.LineToolTrendLine);TradingView.LineToolRay.prototype.title=function(){return"Ray"};TradingView.LineToolExtended=function(a,b){this._constructor="LineToolExtended";var c=b?b:new J52("linetoolextended");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolExtended,TradingView.LineToolTrendLine);TradingView.LineToolExtended.prototype.title=function(){return"Extended Line"};TradingView.LineToolArrowMark=function(a,b){var c=b?b:new J52("linetoolarrowmark");R47.call(this,a,new J97(this,a,this.image,this.width,this.height,this.offsetX,this.offsetY),c)};inherit(TradingView.LineToolArrowMark,R47);TradingView.LineToolArrowMark.prototype.width=21;TradingView.LineToolArrowMark.prototype.height=21;TradingView.LineToolArrowMark.prototype.offsetX=0;
|
|
TradingView.LineToolArrowMark.prototype.offsetY=0;TradingView.LineToolArrowMark.prototype.paneViews=function(a){a=R47.prototype.paneViews.call(this,a);null!==a&&this._textPaneView&&a.push(this._textPaneView);return a};TradingView.LineToolArrowMark.prototype.pointsCount=function(){return 1};TradingView.LineToolArrowMark.prototype.title=function(){return"Arrow Mark"};
|
|
TradingView.LineToolArrowMarkLeft=function(a,b){this._constructor="LineToolArrowMarkLeft";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new R39(this,a,22,-3,"middle","left");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkLeft,TradingView.LineToolArrowMark);TradingView.LineToolArrowMarkLeft.prototype.image=new Image;TradingView.LineToolArrowMarkLeft.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==";
|
|
TradingView.LineToolArrowMarkLeft.prototype.offsetX=1;TradingView.LineToolArrowMarkLeft.prototype.offsetY=-10;TradingView.LineToolArrowMarkLeft.prototype.title=function(){return"Arrow Mark Left"};TradingView.LineToolArrowMarkUp=function(a,b){this._constructor="LineToolArrowMarkUp";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new R39(this,a,0,18,"top","center");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkUp,TradingView.LineToolArrowMark);
|
|
TradingView.LineToolArrowMarkUp.prototype.image=new Image;TradingView.LineToolArrowMarkUp.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=";
|
|
TradingView.LineToolArrowMarkUp.prototype.offsetX=-9;TradingView.LineToolArrowMarkUp.prototype.offsetY=0;TradingView.LineToolArrowMarkUp.prototype.title=function(){return"Arrow Mark Up"};TradingView.LineToolArrowMarkRight=function(a,b){this._constructor="LineToolArrowMarkRight";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new R39(this,a,-22,-3,"middle","right");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkRight,TradingView.LineToolArrowMark);
|
|
TradingView.LineToolArrowMarkRight.prototype.image=new Image;TradingView.LineToolArrowMarkRight.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=";
|
|
TradingView.LineToolArrowMarkRight.prototype.offsetX=-19;TradingView.LineToolArrowMarkRight.prototype.offsetY=-10;TradingView.LineToolArrowMarkRight.prototype.title=function(){return"Arrow Mark Right"};TradingView.LineToolArrowMarkDown=function(a,b){this._constructor="LineToolArrowMarkDown";TradingView.LineToolArrowMark.call(this,a,b);this._textPaneView=new R39(this,a,0,-23,"bottom","center");this._textPaneView._noSelection=!0};inherit(TradingView.LineToolArrowMarkDown,TradingView.LineToolArrowMark);
|
|
TradingView.LineToolArrowMarkDown.prototype.image=new Image;TradingView.LineToolArrowMarkDown.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=";
|
|
TradingView.LineToolArrowMarkDown.prototype.offsetX=-9;TradingView.LineToolArrowMarkDown.prototype.offsetY=-18;TradingView.LineToolArrowMarkDown.prototype.title=function(){return"Arrow Mark Down"};TradingView.LineToolArrowMarkRight.prototype.version=TradingView.LineToolArrowMarkLeft.prototype.version=TradingView.LineToolArrowMarkDown.prototype.version=TradingView.LineToolArrowMarkUp.prototype.version=2;
|
|
TradingView.LineToolArrowMarkDown.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,21)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=-4)};
|
|
TradingView.LineToolArrowMarkUp.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=-10,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=18)};
|
|
TradingView.LineToolArrowMarkRight.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=0,this._textPaneView._offsetY=10)};
|
|
TradingView.LineToolArrowMarkLeft.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(0,0)),this._textPaneView._offsetX=21,this._textPaneView._offsetY=10)};TradingView.LineToolFlagMark=function(a,b){this._constructor="LineToolFlagMark";var c=b?b:new J52("linetoolflagmark");R47.call(this,a,new J97(this,a,this.image,25,25,-8,-21),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolFlagMark,R47);TradingView.LineToolFlagMark.prototype.image=new Image;TradingView.LineToolFlagMark.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=";
|
|
TradingView.LineToolFlagMark.prototype.pointsCount=function(){return 1};TradingView.LineToolFlagMark.prototype.title=function(){return"Flag Mark"};TradingView.LineToolFlagMark.prototype.version=2;TradingView.LineToolFlagMark.prototype.migrateVersion=function(a){1==a&&(this.version=1,this._paneViews[0]._offsetX=0,this._paneViews[0]._offsetY=0,this._paneViews[0].setAnchors(new MathEx.Point(9,21)))};TradingView.NoteRendererSource=function(){};TradingView.NoteRendererSource.prototype.update=function(a){this._data&&(!this._data||a.markerColor==this._data.markerColor&&a.width==this._data.width&&a.height==this._data.height)||this._createSource(a.width,a.height,a.markerColor);this._data=a};
|
|
TradingView.NoteRendererSource.prototype._createSource=function(a,b,c){this._sourceCanvas=document.createElement("canvas");this._sourceCanvas.width=a;this._sourceCanvas.height=b;this._translate=new MathEx.Point(-a/2,-b+.5);0===this._translate.x%1&&(this._translate.x+=.5);var d=this._sourceCanvas.getContext("2d"),e=.6*a;d.fillStyle=c;d.beginPath();d.moveTo(a/2,b);d.quadraticCurveTo(a,a/1.15,a,a/2);d.arc(a/2,a/2,a/2,0,Math.PI,!0);d.quadraticCurveTo(0,a/1.15,a/2,b);d.fill();d.globalCompositeOperation=
|
|
"destination-out";d.beginPath();d.moveTo((a-e)/2,a/2);d.arc(a/2,a/2,e/2,0,2*Math.PI);d.fill()};TradingView.NoteRendererSource.prototype.drawOn=function(a){var b=(new MathEx.Point(Math.round(this._data.point.x),Math.round(this._data.point.y))).add(this._translate);a.drawImage(this._sourceCanvas,b.x,b.y)};
|
|
TradingView.NoteRendererSource.prototype.hasPoint=function(a){var b=this._data.point.add(this._translate),c=new MathEx.Point(this._data.point.x-this._translate.x,this._data.point.y);return MathEx.pointInRect(a,b,c)};TradingView.NoteRenderer=function(a,b){this.R99=a;this._data=b};TradingView.NoteRenderer.prototype.draw=function(a){this.R99.drawOn(a);this._data.tooltipVisible&&this.drawTooltipOn(a)};
|
|
TradingView.NoteRenderer.prototype.drawTooltipOn=function(a){a.save();var b=String(this._data.text).replace(/^\s+|\s+$/g,"").replace(/[\r\n]+/g,"\n");a.font=(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font;var b=TextRenderer.prototype.wordWrap(b,TradingView.LineToolNote.TOOLTIP_WIDTH-2*TradingView.LineToolNote.TOOLTIP_PADDING,a.font),c=this._data.point,d=TradingView.LineToolNote.TOOLTIP_LINESPACING,e=TradingView.LineToolNote.TOOLTIP_WIDTH,f=b.length*
|
|
this._data.fontSize+2*TradingView.LineToolNote.TOOLTIP_PADDING;1<b.length&&(f+=(b.length-1)*d);var g=Math.round(c.x-e/2),h=Math.round(c.y-this._data.height-f-8),k=20>c.x||c.x+20>this._data.vpWidth,l=k?null:"top",m=k?null:Math.round(c.x);10>h?h=c.y+13:l="bottom";10>g?g+=Math.abs(g-10):g+e+10>this._data.vpWidth&&(g-=g+e+10-this._data.vpWidth);a.fillStyle=TradingView.generateColor(this._data.backgroundColor,this._data.backgroundTransparency);a.strokeStyle=this._data.markerColor;a.lineWidth=1;a.beginPath();
|
|
a.moveTo(g,h);k||"top"!=l||(a.lineTo(m-7,h),a.lineTo(m,h-7),a.lineTo(m+7,h));a.lineTo(g+e,h);a.lineTo(g+e,h+f);k||"bottom"!=l||(a.lineTo(m+7,h+f),a.lineTo(m,h+f+7),a.lineTo(m-7,h+f));a.lineTo(g,h+f);a.closePath();a.fill();a.stroke();a.textBaseline="middle";a.fillStyle=this._data.textColor;c=g+TradingView.LineToolNote.TOOLTIP_PADDING;h=h+TradingView.LineToolNote.TOOLTIP_PADDING+this._data.fontSize/2;for(e=0;e<b.length;e++)a.fillText(b[e].replace(/^\s+/,""),c,h),h+=this._data.fontSize+d;a.restore()};
|
|
TradingView.NoteRenderer.prototype.hitTest=function(a){if(this.R99.hasPoint(a))return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)};TradingView.NotePaneView=function(a,b){J90.call(this,a,b);this._rendererSource=new TradingView.NoteRendererSource};inherit(TradingView.NotePaneView,J90);TradingView.NotePaneView.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()};
|
|
TradingView.NotePaneView.prototype.renderer=function(){var a=new TradingView.CompositeRenderer,b=this.R99.properties(),c=b.locked&&b.locked.value()?this.R99.fixedPoints().toArray():this._points.toArray();if(1>c.length)return a;var d=this.isLabelVisible(),b=$.extend(b.state(),{point:c[0],width:24,height:32,tooltipVisible:d,vpWidth:this.D0.m_timeScale.m_width,vpHeight:this.R99.m_priceScale.m_height});this._rendererSource.update(b);a.append(new TradingView.NoteRenderer(this._rendererSource,
|
|
b));d&&a.append(new TradingView.SelectionRenderer({points:c}));return a};TradingView.LineToolNote=function(a,b){this._constructor="LineToolNote";var c=b?b:new J52("linetoolnote");R47.call(this,a,new TradingView.NotePaneView(this,a),c);this.version=TradingView.LineToolNote.version};inherit(TradingView.LineToolNote,R47);TradingView.LineToolNote.TOOLTIP_WIDTH=300;TradingView.LineToolNote.TOOLTIP_PADDING=10;
|
|
TradingView.LineToolNote.TOOLTIP_LINESPACING=5;TradingView.LineToolNote.version=1;TradingView.LineToolNote.prototype.pointsCount=function(){return 1};TradingView.LineToolNote.prototype.title=function(){return $.t("Note")};TradingView.LineToolNote.prototype.restoreTemplate=function(a){delete a.locked;delete a.text;R47.prototype.restoreTemplate.call(this,a)};
|
|
TradingView.LineToolNoteAbsolute=function(a,b){var c=b?b:new J52("linetoolnoteabsolute");c.locked.value()||c.locked.setValue(!0);TradingView.LineToolNote.call(this,a,c)};inherit(TradingView.LineToolNoteAbsolute,TradingView.LineToolNote);TradingView.LineToolNoteAbsolute.prototype.title=function(){return $.t("Anchored Note")};TradingView.LineToolNote.prototype.state=function(a){var b=R47.prototype.state.call(this,a);a&&(b.state.fixedSize=!1);return b};TradingView.PriceLabelRenderer=function(a,b,c){this._data=a;this._measureCache=b;this._chartModel=c;this._points=a.points.toArray()};
|
|
TradingView.PriceLabelRenderer.prototype.draw=function(a){if(0!==this._points.length){a.font=[this._data.fontWeight,this._data.fontSize+"px",this._data.fontFamily].join(" ");var b=a.measureText(this._data.label);b.height=this._data.fontSize;var c=b.width+20,b=b.height+10,d=this._points[0].x- -9,e=this._points[0].y-(b+15);this._measureCache&&$.extend(this._measureCache,{innerWidth:c,innerHeight:b,tailLeft:-9,tailHeight:15});a.translate(.5+d,.5+e);a.beginPath();a.moveTo(12,b);a.lineTo(-9,b+15);a.lineTo(-10,
|
|
b+15-1);a.lineTo(5,b);a.lineTo(3,b);a.arcTo(0,b,0,0,3);a.lineTo(0,3);a.arcTo(0,0,c,0,3);a.lineTo(c-3,0);a.arcTo(c,0,c,b,3);a.lineTo(c,b-3);a.arcTo(c,b,0,b,3);a.lineTo(12,b);a.fillStyle=TradingView.generateColor(this._data.backgroundColor,this._data.transparency);a.fill();a.strokeStyle=this._data.borderColor;a.lineWidth=2;a.stroke();a.closePath();a.textBaseline="top";a.fillStyle=this._data.color;a.fillText(this._data.label,10,4);a.translate(-.5,-.5);a.beginPath();a.arc(-9,b+15,2.5,0,2*Math.PI,!1);
|
|
a.fillStyle=TradingView.generateColor(this._data.borderColor,this._data.transparency);a.fill();a.strokeStyle=this._chartModel.backgroundColor();a.lineWidth=1;a.stroke();a.closePath()}};
|
|
TradingView.PriceLabelRenderer.prototype.hitTest=function(a){if(0===this._points.length)return null;var b=this._points[0].x-this._measureCache.tailLeft,c=this._points[0].y-(this._measureCache.innerHeight+this._measureCache.tailHeight);return MathEx.pointInRect(a,new MathEx.Point(b,c),new MathEx.Point(b+this._measureCache.innerWidth,c+this._measureCache.innerHeight))?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
R5=function(a,b,c){J90.call(this,a,b);this._image=TradingView.getImage("price_label",TradingView.wrapUrl("/static/images/price_label.png"));this._rendererCache={}};inherit(R5,J90);
|
|
R5.prototype.update=function(){J90.prototype.update.call(this);if(0<this.R99.points().size()){var a=this.R99.points().item(0).price,b=this.R99.priceScale();if(b&&!b.isEmpty()){if(b.isPercent())var c=this.R99.ownerSource().firstValue(),a=b.priceRange().convertToPercent(a,c);this._priceLabel=b.formatter().format(a)}}};
|
|
R5.prototype.renderer=function(){var a={};a.points=this._points.toArray();a.borderColor=this.R99.properties().borderColor.value();a.backgroundColor=this.R99.properties().backgroundColor.value();a.color=this.R99.properties().color.value();a.fontWeight=this.R99.properties().fontWeight.value();a.fontSize=this.R99.properties().fontsize.value();a.fontFamily=this.R99.properties().font.value();a.transparency=this.R99.properties().transparency.value();
|
|
a.label=this._priceLabel;a.image=this._image;if(this.isAnchorsRequired()&&1==a.points.length){var b=new TradingView.CompositeRenderer;b.append(new TradingView.PriceLabelRenderer(a,this._rendererCache,this.D0));b.append(new TradingView.SelectionRenderer({points:a.points}));return b}return new TradingView.PriceLabelRenderer(a,this._rendererCache,this.D0)};
|
|
TradingView.LineToolPriceLabel=function(a,b){this._constructor="LineToolPriceLabel";var c=b||new J52("linetoolpricelabel");R47.call(this,a,new R5(this,a),c)};inherit(TradingView.LineToolPriceLabel,R47);TradingView.LineToolPriceLabel.prototype.pointsCount=function(){return 1};TradingView.LineToolPriceLabel.prototype.title=function(){return"Price Label"};TradingView.PredictionRenderer=function(a){this._data=a;this._targetFontSize2=this._targetFontSize1=11;this._targetFontSize3=14;this._font="Arial";this._sourceFontSize1=12;this._sourceFontSize2=10};
|
|
TradingView.PredictionRenderer.prototype.drawBalloon=function(a,b,c,d,e,f){f=f||20;a.beginPath();if("down"===e)return b=new MathEx.Point(b.x-f,b.y-6-5-d),a.moveTo(b.x+3,b.y),a.lineTo(b.x+c-3,b.y),a.arcTo(b.x+c,b.y,b.x+c,b.y+3,3),a.lineTo(b.x+c,b.y+d-3),a.arcTo(b.x+c,b.y+d,b.x+c-3,b.y+d,3),a.lineTo(b.x+f+5,b.y+d),a.lineTo(b.x+f,b.y+d+5),a.lineTo(b.x+f-5,b.y+d),a.lineTo(b.x+3,b.y+d),a.arcTo(b.x,b.y+d,b.x,b.y+d-3,3),a.lineTo(b.x,b.y+3),a.arcTo(b.x,b.y,b.x+3,b.y,3),b;b=new MathEx.Point(b.x-f,b.y+6+5+
|
|
d);a.moveTo(b.x+3,b.y);a.lineTo(b.x+c-3,b.y);a.arcTo(b.x+c,b.y,b.x+c,b.y-3,3);a.lineTo(b.x+c,b.y-d+3);a.arcTo(b.x+c,b.y-d,b.x+c-3,b.y-d,3);a.lineTo(b.x+f+5,b.y-d);a.lineTo(b.x+f,b.y-d-5);a.lineTo(b.x+f-5,b.y-d);a.lineTo(b.x+3,b.y-d);a.arcTo(b.x,b.y-d,b.x,b.y-d+3,3);a.lineTo(b.x,b.y-3);a.arcTo(b.x,b.y,b.x+3,b.y,3);return new MathEx.Point(b.x,b.y-d)};
|
|
TradingView.PredictionRenderer.prototype.drawTargetLabel=function(a){var b=this._data.points.item(1);a.save();a.translate(.5,.5);a.font="normal "+this._targetFontSize3+"px "+this._font;var c=1.5*this._targetFontSize1+1.5*this._targetFontSize2+3,d=a.measureText(this._data.targetLine1).width,e=a.measureText(this._data.targetLine2).width;a.font="normal "+this._targetFontSize2+"px "+this._font;var f=a.measureText(this._data.targetLine3).width,g=a.measureText(this._data.targetLine4).width,e=Math.max(d+
|
|
e,f+g+10)+20,g="up"===this._data.direction?"down":"up",h=b.x+e-a.canvas.width+5,h=Math.max(20,Math.min(e-15,h)),g=this.drawBalloon(a,b,e,c,g,h);a.save();a.fillStyle=TradingView.generateColor(this._data.targetBackColor,this._data.transparency);a.fill();a.restore();a.save();a.lineWidth=2;a.strokeStyle=TradingView.generateColor(this._data.targetStrokeColor,this._data.transparency);a.stroke();a.restore();a.beginPath();a.arc(b.x,b.y,3,0,2*Math.PI,!1);a.fillStyle=this._data.centersColor;a.fill();a.textAlign=
|
|
"left";a.fillStyle=this._data.targetTextColor;a.font="normal "+this._targetFontSize3+"px "+this._font;a.fillText(this._data.targetLine1,g.x+6,g.y+this._targetFontSize1+4);a.fillText(this._data.targetLine2,g.x+6+d+5,g.y+this._targetFontSize1+4);a.font="normal "+this._targetFontSize2+"px "+this._font;b=g.y+this._targetFontSize1+8+this._targetFontSize2;a.fillText(this._data.targetLine3,g.x+6,b);a.drawImage(this._data.clockWhite,g.x+6+f+6,b-this._targetFontSize2+3);a.fillText(this._data.targetLine4,g.x+
|
|
6+f+13+5,b);if(this._data.status){f=this._targetFontSize1+4;a.font="bold "+this._targetFontSize1+"px "+this._font;var k,l,m,n;switch(this._data.status){case TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS:k=$.t("SUCCESS");l=TradingView.generateColor(this._data.successBackground,this._data.transparency);m=this._data.successTextColor;n=this._data.successIcon;break;case TradingView.LineToolPrediction.ALERT_STATUS_FAILURE:k=$.t("FAILURE"),l=TradingView.generateColor(this._data.failureBackground,this._data.transparency),
|
|
m=this._data.failureTextColor,n=this._data.failureIcon}b=a.measureText(k).width;b=Math.round((e-b)/2);a.fillStyle=l;"up"===this._data.direction?(a.roundRect(g.x-1,g.y-f-2,e+2,f,5),a.fill(),a.fillStyle=m,a.fillText(k,g.x+b,g.y-5),a.drawImage(n,g.x+b-13,g.y-14)):(a.roundRect(g.x-1,g.y+c+3,e+2,f,5),a.fill(),a.fillStyle=m,a.fillText(k,g.x+b,g.y+c+f-1),a.drawImage(n,g.x+b-13,g.y+c+5))}a.restore()};
|
|
TradingView.PredictionRenderer.prototype.drawStartLabel=function(a){a.save();a.translate(.5,.5);a.font="normal "+this._sourceFontSize1+"px "+this._font;var b=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,c=a.measureText(this._data.sourceLine1).width;a.font="normal "+this._fontsize2+"px "+this._font;var d=a.measureText(this._data.sourceLine2).width,d=Math.max(c,d)-5,c=this._data.points.item(0),b=this.drawBalloon(a,c,d,b,this._data.direction);a.fillStyle=TradingView.generateColor(this._data.sourceBackColor,
|
|
this._data.transparency);a.fill();a.lineWidth=2;a.strokeStyle=TradingView.generateColor(this._data.sourceStrokeColor,this._data.transparency);a.stroke();a.beginPath();a.arc(c.x,c.y,3,0,2*Math.PI,!1);a.fillStyle=this._data.centersColor;a.fill();a.textAlign="left";a.fillStyle=this._data.sourceTextColor;a.font="normal "+this._sourceFontSize1+"px "+this._font;a.fillText(this._data.sourceLine1,b.x+3,b.y+this._sourceFontSize1+2);a.font="normal "+this._sourceFontSize2+"px "+this._font;a.fillText(this._data.sourceLine2,
|
|
b.x+3,b.y+this._sourceFontSize1+4+this._sourceFontSize2);a.restore()};
|
|
TradingView.PredictionRenderer.prototype.draw=function(a){if(!(2>this._data.points.size())){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1);new MathEx.Point(b.y,c.x);var d=c.substract(b);1>Math.abs(d.x)||1>Math.abs(d.y)?(a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y)):(a.save(),a.beginPath(),a.translate(b.x,b.y),a.scale(1,d.y/d.x),a.moveTo(0,0),a.arcTo(d.x,0,d.x,d.x,Math.abs(d.x)),
|
|
a.lineTo(d.x,d.x),a.restore());a.stroke();this.drawTargetLabel(a);this.drawStartLabel(a);b=Math.max(8,4*this._data.linewidth);a.fillStyle=this._data.color;var e=0>d.y?1:-1,f;if(1>Math.abs(d.x)||1>Math.abs(d.y))f=Math.atan(d.x/d.y);else{var g=Math.abs(d.x),h=Math.abs(d.y);Math.sqrt((3*g+h)*(3*h+g));var k=0,l=Math.PI/2,m=(k+l)/2,n;if(d.length()>b)for(;;){f=g*Math.sin(m);n=h*(1-Math.cos(m));var p=Math.sqrt((f-g)*(f-g)+(n-h)*(n-h));if(1>Math.abs(p-b))break;p>b?k=m:l=m;m=(k+l)/2}f=Math.atan((g-f)/(h-n));
|
|
0>d.x*d.y&&(f=-f)}a.save();a.beginPath();a.translate(c.x,c.y);a.rotate(-f);a.moveTo(0,0);a.lineTo(-b/2,e*b);a.lineTo(b/2,e*b);a.lineTo(0,0);a.restore();a.fill()}};
|
|
TradingView.PredictionRenderer.prototype.targetLabelHitTest=function(a){var b=this._data.points.item(1),c=1.5*this._targetFontSize1+1.5*this._targetFontSize2,d=this._targetFontSize1*this._data.targetLine1.length,e=this._targetFontSize1*this._data.targetLine2.length,f=this._targetFontSize2*this._data.targetLine3.length,g=this._targetFontSize2*this._data.targetLine4.length;this._data.status&&(c+=1.5*this._targetFontSize1);d=Math.max(d+e,f+g)-20;g="up"===this._data.direction?-1:1;e=b.x-20;f=b.y+5*g;
|
|
c=b.y+(5+c)*g;b=Math.min(f,c);c=Math.max(f,c);return a.x>=e&&a.x<=e+d&&a.y>=b&&a.y<=c?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
TradingView.PredictionRenderer.prototype.sourceLabelHitTest=function(a){var b=1.5*this._sourceFontSize1+1.5*this._sourceFontSize2,c=Math.max(this._sourceFontSize1*this._data.sourceLine1.length,this._sourceFontSize2*this._data.sourceLine2.length),d=this._data.points.item(0),e="up"===this._data.direction?1:-1,f=d.x-20,g=d.y+5*e,d=d.y+(5+b)*e,b=Math.min(g,d),g=Math.max(g,d);return a.x>=f&&a.x<=f+c&&a.y>=b&&a.y<=g?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
TradingView.PredictionRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=c.substract(b);new MathEx.Point(b.y,c.x);var d=c.substract(b),b=a.substract(b),c=Math.abs(d.x),e=Math.abs(d.y),d=MathEx.sign(d.y)*(e-e*Math.sqrt(1-b.x*b.x/(c*c)));return 3>Math.abs(d-b.y)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):(d=this.targetLabelHitTest(a))?d:this.sourceLabelHitTest(a)};
|
|
R4=function(a,b){J90.call(this,a,b);this._clockWhite=TradingView.getImage("prediction-clock-white",TradingView.wrapUrl("/static/images/prediction-clock-white.png"));this._clockBlack=TradingView.getImage("prediction-clock-black",TradingView.wrapUrl("/static/images/prediction-clock-black.png"));this._successIcon=TradingView.getImage("prediction-success-white",TradingView.wrapUrl("/static/images/prediction-success-white.png"));this._failureIcon=
|
|
TradingView.getImage("prediction-failure-white",TradingView.wrapUrl("/static/images/prediction-failure-white.png"))};inherit(R4,J90);
|
|
R4.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().linecolor.value();a.linewidth=this.R99.properties().linewidth.value();a.targetLine1=this._targetLine1;a.targetLine2=this._targetLine2;a.targetLine3=this._targetLine3;a.targetLine4=this._targetLine4;a.status=this.R99.properties().status.value();a.transparency=this.R99.properties().transparency.value();a.targetBackColor=this.R99.properties().targetBackColor.value();
|
|
a.targetStrokeColor=this.R99.properties().targetStrokeColor.value();a.targetTextColor=this.R99.properties().targetTextColor.value();a.sourceBackColor=this.R99.properties().sourceBackColor.value();a.sourceStrokeColor=this.R99.properties().sourceStrokeColor.value();a.sourceTextColor=this.R99.properties().sourceTextColor.value();a.successBackground=this.R99.properties().successBackground.value();a.successTextColor=this.R99.properties().successTextColor.value();a.failureBackground=
|
|
this.R99.properties().failureBackground.value();a.failureTextColor=this.R99.properties().failureTextColor.value();a.intermediateBackColor=this.R99.properties().intermediateBackColor.value();a.intermediateTextColor=this.R99.properties().intermediateTextColor.value();a.sourceLine1=this._sourceLine1;a.sourceLine2=this._sourceLine2;a.direction=this._direction;a.clockWhite=this._clockWhite;a.clockBlack=this._clockBlack;a.successIcon=this._successIcon;a.failureIcon=this._failureIcon;a.finished=
|
|
this._finished;a.centersColor=(new TradingView.RGBColor(this.D0.D2.paneProperties.background._value)).blackWhiteContrast();if(this.isAnchorsRequired()){var b=new TradingView.CompositeRenderer;b.append(new TradingView.PredictionRenderer(a));this.addAnchors(b);return b}return new TradingView.PredictionRenderer(a)};
|
|
R4.prototype.update=function(){J90.prototype.update.call(this);this._targetLine4=this._targetLine3=this._targetLine2=this._targetLine1="";if(!(2>this.R99.points().size())&&this.R99.priceScale()){var a=this.R99.points().item(1),b=this.R99.points().item(0);this._targetLine3=this.R99.priceScale().formatter().format(a.price);var c=a.price-b.price,d=0>c?"-":"+";this._targetLine1=this.R99.priceScale().formatter().format(Math.abs(c));
|
|
c=Math.abs((Math.round(c/b.price*1E4)/100).toPrecision(3));this._targetLine1=d+this._targetLine1+" ("+d+c+"%)";d=this.D0.timeScale().indexToUserTime(b.index);c=this.D0.timeScale().indexToUserTime(a.index);b.time&&a.time&&(d=TradingView.isString(b.time)?new Date(Date.parse(b.time)):b.time,c=TradingView.isString(a.time)?new Date(Date.parse(a.time)):a.time);c&&d&&(this._targetLine4=(new TradingView.DateFormatter).format(c),this.D0.mainSeries().isDWM()||(this._targetLine4=this._targetLine4+
|
|
" "+(new TradingView.TimeFormatter("%h:%m")).format(c)),a=(c.valueOf()-d.valueOf())/1E3,this._targetLine2=$.t("in",{context:"dates"})+" "+(new TradingView.TimeSpanFormatter).format(a));this._sourceLine1=this.R99.priceScale().formatter().format(b.price);this._sourceLine2="";if(b=this.D0.timeScale().indexToUserTime(b.index))this._sourceLine2=(new TradingView.DateFormatter).format(b),this.D0.mainSeries().isDWM()||(this._sourceLine2=this._sourceLine2+" "+(new TradingView.TimeFormatter("%h:%m")).format(b));
|
|
this._direction=this.R99.direction()===TradingView.LineToolPrediction.DIRECTION_UP?"up":"down";this._finished=this.D0.lineBeingCreated()!==this.R99&&this.D0.lineBeingEdited()!==this.R99&&this.D0.sourceBeingMoved()!==this.R99}};
|
|
TradingView.LineToolPrediction=function(a,b){this._constructor="LineToolPrediction";var c=b?b:new J52("linetoolprediction");c.merge({status:TradingView.LineToolPrediction.ALERT_STATUS_WAITING});R47.call(this,a,new R4(this,a),c)};TradingView.LineToolPrediction.ALERT_STATUS_WAITING=0;TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS=1;TradingView.LineToolPrediction.ALERT_STATUS_FAILURE=2;
|
|
TradingView.LineToolPrediction.DIRECTION_UP=1;TradingView.LineToolPrediction.DIRECTION_DOWN=2;inherit(TradingView.LineToolPrediction,R47);TradingView.LineToolPrediction.prototype.status=function(){return this.D2.status.value()};TradingView.LineToolPrediction.prototype.setStatus=function(a){return this.D2.status.setValue(a)};TradingView.LineToolPrediction.prototype.pointsCount=function(){return 2};TradingView.LineToolPrediction.prototype.title=function(){return"Forecast"};
|
|
TradingView.LineToolPrediction.prototype.restorePoints=function(a,b,c){R47.prototype.restorePoints.call(this,a,b,c);this.checkAlert()};
|
|
TradingView.LineToolPrediction.prototype.checkAlert=function(){if(!(2>this._points.size()||this.D0.mainSeries().bars().isEmpty())){var a=this._points.item(1);if(this.status())a.index>this.D0.timeScale().points().lastTimePointIndex()&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);else if(this.D0.mainSeries().bars().last(),this.D0.timeScale().indexToTimePoint(a.index)){var b=this.D0.mainSeries().bars().valueAt(a.index),c=this.direction();c===TradingView.LineToolPrediction.DIRECTION_UP&&
|
|
b[TradingView.HIGH_PLOT]>=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):c===TradingView.LineToolPrediction.DIRECTION_DOWN&&b[TradingView.LOW_PLOT]<=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):(a=this.D0.mainSeries().bars().last().value,b[TradingView.TIME_PLOT]!==a[TradingView.TIME_PLOT]&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_FAILURE))}}};
|
|
TradingView.LineToolPrediction.prototype.addPoint=function(a){(a=R47.prototype.addPoint.call(this,a))&&this.checkAlert();return a};TradingView.LineToolPrediction.prototype.endChanging=function(){R47.prototype.endChanging.call(this);this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);this.checkAlert()};TradingView.LineToolPrediction.prototype.onData=function(a){R47.prototype.onData.call(this,a);this.checkAlert()};
|
|
TradingView.LineToolPrediction.prototype.endMoving=function(){R47.prototype.endMoving.call(this);this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);this.checkAlert()};TradingView.LineToolPrediction.prototype.direction=function(){if(2>this.points().size())return TradingView.LineToolPrediction.DIRECTION_UP;var a=this.points().item(0);return this.points().item(1).price>a.price?TradingView.LineToolPrediction.DIRECTION_UP:TradingView.LineToolPrediction.DIRECTION_DOWN};R3=function(a,b){J90.call(this,a,b)};inherit(R3,J90);
|
|
R3.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.R99.properties().linecolor.value();a.linewidth=this.R99.properties().linewidth.value();a.linestyle=this.R99.properties().linestyle.value();a.filled=this.R99.properties().filled.value();a.backcolor=this.R99.properties().backgroundColor.value();a.fillBackground=this.R99.properties().fillBackground.value();a.transparency=this.R99.properties().transparency.value();if(this.isAnchorsRequired()){var b=
|
|
new TradingView.CompositeRenderer;b.append(new TradingView.PoligonRenderer(a));this.addAnchors(b);return b}return new TradingView.PoligonRenderer(a)};TradingView.LineToolPolyline=function(a,b){this._constructor="LineToolPolyline";var c;b?c=b:(c=new J52("linetoolpolyline"),c.filled.setValue(!1));R47.call(this,a,new R3(this,a),c);c.addExclusion("filled")};inherit(TradingView.LineToolPolyline,R47);
|
|
TradingView.LineToolPolyline.prototype.pointsCount=function(){return-1};TradingView.LineToolPolyline.prototype.title=function(){return"Polyline"};
|
|
TradingView.LineToolPolyline.prototype.addPoint=function(a){var b=this.D0.timeScale().indexToCoordinate(a.index),c=a.price,d=null;this.priceScale().isPercent()&&(d=this.ownerSource().firstValue());c=this.priceScale().priceToCoordinate(c);if(0<this._points.size()){var e=this._points.item(this._points.size()-1),f=this.D0.timeScale().indexToCoordinate(e.index),e=e.price;this.priceScale().isPercent()&&(e=this.priceScale().priceRange().convertToPercent(e,d));e=this.priceScale().priceToCoordinate(e);
|
|
if(5>(new MathEx.Point(b,c)).substract(new MathEx.Point(f,e)).length())return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;e=this._points.item(0);f=this.D0.timeScale().indexToCoordinate(e.index);e=e.price;this.priceScale().isPercent()&&(e=this.priceScale().priceRange().convertToPercent(e,d));d=this.priceScale().priceToCoordinate(e);if(5>(new MathEx.Point(b,c)).substract(new MathEx.Point(f,d)).length())return this.D2.filled.setValue(!0),this._lastPoint=null,
|
|
this.normalizePoints(),this.createServerPoints(),!0}return R47.prototype.addPoint.call(this,a)};
|
|
TradingView.LineToolPolyline.prototype.setPoint=function(a,b){R47.prototype.setPoint.call(this,a,b);if(!(this.D0.timeScale().isEmpty()||this.priceScale().isEmpty()||a!==this._points.size()-1&&0!==a)){var c=this.D0.timeScale().indexToCoordinate(b.index),d=this.priceScale().priceToCoordinate(b.price),e=a===this._points.size()-1?this._points.item(0):this._points.item(this._points.size()-1),f=this.D0.timeScale().indexToCoordinate(e.index),e=this.priceScale().priceToCoordinate(e.price);
|
|
5>(new MathEx.Point(c,d)).substract(new MathEx.Point(f,e)).length()&&this.D2.filled.setValue(!0)}};J82=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J82,J90);
|
|
J82.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return console.log("J82:1 point"),this.addAnchors(a),a;for(var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x),e=Math.min(b.y,c.y),f=Math.max(b.x,c.x),g=Math.max(b.y,c.y),h=this.R99.properties(),k=this.R99.properties().fillHorzBackground.value(),l=this.R99.properties().horzTransparency.value(),m=this.R99.properties().fillVertBackground.value(),
|
|
n=this.R99.properties().vertTransparency.value(),p=0;p<this._hlevels.length;p++){if(0<p&&k){var r=this._hlevels[p-1],b=new MathEx.Point(d,this._hlevels[p].y),c=new MathEx.Point(f,r.y),r={};r.points=(new List).append(b).append(c);r.color=this._hlevels[p].color;r.linewidth=0;r.backcolor=this._hlevels[p].color;r.fillBackground=!0;r.transparency=l;a.append(new TradingView.RectangleRenderer(r))}b=new MathEx.Point(d,this._hlevels[p].y);c=new MathEx.Point(f,this._hlevels[p].y);r={points:(new List).append(b).append(c),
|
|
width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this._hlevels[p].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(r));h.showLeftLabels.value()&&(b={points:(new List).append(b),text:""+this._hlevels[p].coeff,color:this._hlevels[p].color,vertAlign:"middle",horzAlign:"right",
|
|
font:h.font.value(),offsetX:-5,offsetY:0,fontsize:12},a.append(new TextRenderer(b,this._rendererCache)));h.showRightLabels.value()&&(c={points:(new List).append(c),text:""+this._hlevels[p].coeff,color:this._hlevels[p].color,vertAlign:"middle",horzAlign:"left",font:h.font.value(),offsetX:5,offsetY:0,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)))}for(p=0;p<this._vlevels.length;p++)b=new MathEx.Point(this._vlevels[p].x,e),c=new MathEx.Point(this._vlevels[p].x,g),0<p&&m&&(r=this._vlevels[p-
|
|
1],d=new MathEx.Point(r.x,e),r={},r.points=(new List).append(d).append(c),r.color=this._vlevels[p].color,r.linewidth=0,r.backcolor=this._vlevels[p].color,r.fillBackground=!0,r.transparency=n,a.append(new TradingView.RectangleRenderer(r))),r={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this._vlevels[p].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,
|
|
rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(r)),h.showTopLabels.value()&&(d={points:(new List).append(b),text:""+this._vlevels[p].coeff,color:this._vlevels[p].color,vertAlign:"bottom",horzAlign:"center",font:h.font.value(),offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(d,this._rendererCache))),h.showBottomLabels.value()&&(c={points:(new List).append(c),text:""+this._vlevels[p].coeff,color:this._vlevels[p].color,vertAlign:"top",horzAlign:"center",
|
|
font:h.font.value(),offsetX:0,offsetY:5,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)));this.addAnchors(a);return a};
|
|
J82.prototype.update=function(){J90.prototype.update.call(this);if(!(2>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b=this.R99.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.R99.priceScale().isPercent()&&(d=this.R99.ownerSource().firstValue());for(var e=1;7>=e;e++){var f="hlevel"+e,g=this.R99.properties()[f];
|
|
if(g.visible.value()){var f=g.coeff.value(),g=g.color.value(),h=a.price+f*c;this.R99.priceScale().isPercent()&&(h=this.R99.priceScale().priceRange().convertToPercent(h,d));h=this.R99.priceScale().priceToCoordinate(h);this._hlevels.push({coeff:f,color:g,y:h})}}this._vlevels=[];b=b.index-a.index;for(e=1;7>=e;e++)f="vlevel"+e,g=this.R99.properties()[f],g.visible.value()&&(f=g.coeff.value(),g=g.color.value(),c=Math.round(a.index+f*b),c=this.D0.timeScale().indexToCoordinate(c),this._vlevels.push({coeff:f,
|
|
color:g,x:c}))}};TradingView.LineToolGannSquare=function(a,b){this._constructor="LineToolGannSquare";var c=b?b:new J52("linetoolgannsquare");R47.call(this,a,new J82(this,a),c)};inherit(TradingView.LineToolGannSquare,R47);TradingView.LineToolGannSquare.prototype.pointsCount=function(){return 2};TradingView.LineToolGannSquare.prototype.title=function(){return"Gann Box"};J81=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J81,J90);
|
|
J81.prototype.update=function(){J90.prototype.update.call(this);if(!(2>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1);this._fans=[];for(var c=b.x-a.x,d=b.y-a.y,e,f,g=1;9>=g;g++){var h="level"+g,h=this.R99.properties()[h];if(h.visible.value()){e=h.coeff1.value();var k=h.coeff2.value();f=e/k;var l=h.color.value(),
|
|
m=""+e+"/"+k;e>k?(e=b.x,f=a.y+d/f):(e=a.x+c*f,f=b.y);this._fans.push({label:m,color:l,x:e,y:f,index:g,linewidth:h.linewidth.value(),linestyle:h.linestyle.value()})}}}};
|
|
J81.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.R99.properties(),d=this.R99.properties().fillBackground.value(),e=this.R99.properties().transparency.value(),f=0;f<this._fans.length;f++){var g=new MathEx.Point(this._fans[f].x,this._fans[f].y);if(d)if(4>this._fans[f].index){var h=new MathEx.Point(this._fans[f+1].x,this._fans[f+1].y),k={};k.width=
|
|
this.D0.timeScale().width();k.p1=b;k.p2=g;k.p3=b;k.p4=h;k.color=this._fans[f].color;k.transparency=e;k.hittestOnBackground=!0;a.append(new TradingView.ChannelRenderer(k))}else 4<this._fans[f].index&&0<f&&(h=new MathEx.Point(this._fans[f-1].x,this._fans[f-1].y),k={},k.width=this.D0.timeScale().width(),k.p1=b,k.p2=g,k.p3=b,k.p4=h,k.color=this._fans[f].color,k.transparency=e,k.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(k)));h={points:(new List).append(b).append(g),width:this.D0.timeScale().width(),
|
|
height:this.R99.priceScale().height(),color:this._fans[f].color,linewidth:this._fans[f].linewidth,linestyle:this._fans[f].linestyle,extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};k=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,this._fans[f].index);a.append(new TradingView.TrendLineRenderer(h,k));c.showLabels.value()&&(g={points:(new List).append(g),text:this._fans[f].label,color:this._fans[f].color,
|
|
vertAlign:"middle",horzAlign:"left",font:c.font.value(),offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(g,this._rendererCache)))}this.addAnchors(a);return a};TradingView.LineToolGannFan=function(a,b){this._constructor="LineToolGannFan";var c=b?b:new J52("linetoolgannfan");R47.call(this,a,new J81(this,a),c)};inherit(TradingView.LineToolGannFan,R47);
|
|
TradingView.LineToolGannFan.prototype.pointsCount=function(){return 2};TradingView.LineToolGannFan.prototype.title=function(){return"Gann Fan"};TradingView.LineToolGannFan.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.FibRetracementLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.FibRetracementLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.FibRetracementLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolFibRetracement.LevelsCount};J72=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(J72,J90);
|
|
J72.prototype.update=function(){this._invalidated=!0};
|
|
J72.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.D0._fibRetracementLabelsCache.updateSource(this.R99);if(!(2>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b=this.R99.points().item(1),c=!1,d=this.R99.properties();d.reverse&&d.reverse.value()&&(c=d.reverse.value());
|
|
this._levels=[];var e=c?b.price-a.price:a.price-b.price,a=c?a.price:b.price,f;if(this.R99.priceScale().isPercent()&&(f=this.R99.ownerSource().firstValue(),null===f))return;for(b=1;b<=TradingView.LineToolFibRetracement.LevelsCount;b++)if(c=d["level"+b],c.visible.value()){var g=c.coeff.value(),c=c.color.value(),g=a+g*e;this.R99.priceScale().isPercent()&&(g=this.R99.priceScale().priceRange().convertToPercent(g,f));g=this.R99.priceScale().priceToCoordinate(g);this._levels.push({color:c,
|
|
y:g,linewidth:d.levelsStyle.linewidth.value(),linestyle:d.levelsStyle.linestyle.value(),index:b})}}};
|
|
J72.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x);Math.min(b.y,c.y);var e=Math.max(b.x,c.x);Math.max(b.y,c.y);for(var f=this.R99.properties(),g=f.fillBackground.value(),h=f.transparency.value(),k=f.extendLines.value()?this.D0.timeScale().width():e,l=this.D0._fibRetracementLabelsCache,
|
|
m=l.canvas().get(0),n=0;n<this._levels.length;n++){if(0<n&&g){var c=this._levels[n-1],b=new MathEx.Point(d,this._levels[n].y),c=new MathEx.Point(k,c.y),p={};p.points=(new List).append(b).append(c);p.color=this._levels[n].color;p.linewidth=0;p.backcolor=this._levels[n].color;p.fillBackground=!0;p.transparency=h;a.append(new TradingView.RectangleRenderer(p))}var b=new MathEx.Point(d,this._levels[n].y),c=new MathEx.Point(e,this._levels[n].y),p={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),
|
|
height:this.R99.priceScale().height(),color:this._levels[n].color,linewidth:this._levels[n].linewidth,linestyle:this._levels[n].linestyle,extendleft:!1,extendright:f.extendLines.value(),leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},r=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,this._levels[n].index);a.append(new TradingView.TrendLineRenderer(p,r));if(f.showCoeffs.value()||f.showPrices.value())if(p=this._cacheState.preparedCells.cells[this._levels[n].index-
|
|
1]){var t;switch(f.horzLabelsAlign.value()){case "left":t=b;break;case "center":t=b.add(c).scaled(.5);t.x+=p.width/2;t.x=Math.round(t.x);break;case "right":f.extendLines.value()?t=new MathEx.Point(k-4,this._levels[n].y):(t=new MathEx.Point(k+4,this._levels[n].y),t.x+=p.width,t.x=Math.round(t.x))}b={left:p.left,top:l.topByRow(this._cacheState.row),width:p.width,height:l.rowHeight(this._cacheState.row)};c={left:t.x-b.width,top:t.y,width:p.width,height:b.height};p=f.vertLabelsAlign.value();"middle"==
|
|
p&&(c.top-=c.height/2);"bottom"==p&&(c.top-=c.height);b=new TradingView.PaneRendererCachedImage(m,b,c);a.append(b)}}f.trendline.visible.value()&&(p={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:f.trendline.color.value(),linewidth:f.trendline.linewidth.value(),linestyle:f.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},
|
|
a.append(new TradingView.TrendLineRenderer(p)));this.addAnchors(a);return a};TradingView.LineToolFibRetracement=function(a,b){this._constructor="LineToolFibRetracement";var c=b?b:new J52("linetoolfibretracement");R47.call(this,a,new J72(this,a),c);this.version=TradingView.LineToolFibRetracement.version;this.D2._stateVersion=1;a._fibRetracementLabelsCache||(a._fibRetracementLabelsCache=new TradingView.FibRetracementLabelsCache)};
|
|
inherit(TradingView.LineToolFibRetracement,R47);TradingView.LineToolFibRetracement.version=2;TradingView.LineToolFibRetracement.LevelsCount=24;TradingView.LineToolFibRetracement.prototype.stop=function(){R47.prototype.stop.call(this);this.D0._fibRetracementLabelsCache.removeSource(this.id())};TradingView.LineToolFibRetracement.prototype.pointsCount=function(){return 2};TradingView.LineToolFibRetracement.prototype.title=function(){return"Fib Retracement"};
|
|
TradingView.LineToolFibRetracement.prototype.migrateVersion=function(a,b,c){1==a&&this.properties().extendLines.setValue(!0)};TradingView.LineToolFibRetracement.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.TrendBasedFibExtensionLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.TrendBasedFibExtensionLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.TrendBasedFibExtensionLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolTrendBasedFibExtension.LevelsCount};TradingView.TrendBasedFibExtensionLabelsCache.prototype.points=function(a){return[a.points().item(0),a.points().item(1)]};
|
|
TradingView.TrendBasedFibExtensionLabelsCache.prototype.startPoint=function(a,b){return a.points().item(2)};TradingView.TrendBasedFibExtensionLabelsCache.prototype.priceRange=function(a,b){var c=this.points(a),d=c[0],c=c[1];return b?d.price-c.price:c.price-d.price};TradingView.TrendBasedFibExtensionLabelsCache.prototype.sourceIsReady=function(a){return 3<=a.points().size()};R41=function(a,b){J90.call(this,a,b);this._rendererCache={}};
|
|
inherit(R41,J90);R41.prototype.update=function(){this._invalidated=!0};
|
|
R41.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.D0._trendBasedFibExtensionLabelsCache.updateSource(this.R99);if(!(3>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b=this.R99.points().item(1),c=this.R99.points().item(2),d=!1,e=this.R99.properties();e.reverse&&
|
|
e.reverse.value()&&(d=e.reverse.value());this._levels=[];var a=d?a.price-b.price:b.price-a.price,f;this.R99.priceScale().isPercent()&&(f=this.R99.ownerSource().firstValue());for(b=1;b<=TradingView.LineToolTrendBasedFibExtension.LevelsCount;b++)if(d=e["level"+b],d.visible.value()){var g=d.coeff.value(),d=d.color.value(),g=c.price+g*a;this.R99.priceScale().isPercent()&&(g=this.R99.priceScale().priceRange().convertToPercent(g,f));g=this.R99.priceScale().priceToCoordinate(g);this._levels.push({color:d,
|
|
y:g,linewidth:e.levelsStyle.linewidth.value(),linestyle:e.levelsStyle.linestyle.value(),index:b})}}};
|
|
R41.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.R99.properties();if(d.trendline.visible.value()){var e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),
|
|
linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(e))}if(3>this._points.size())return this.addAnchors(a),a;var f=this._points.item(2);d.trendline.visible.value()&&(e={points:(new List).append(c).append(f),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),
|
|
linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(e)));var g=Math.min(f.x,c.x);Math.min(b.y,c.y);f=Math.max(f.x,c.x);Math.max(b.y,c.y);for(var h=d.fillBackground.value(),k=d.transparency.value(),l=d.extendLines.value()?this.D0.timeScale().width():f,m=this.D0._trendBasedFibExtensionLabelsCache,n=m.canvas().get(0),p=0;p<this._levels.length;p++){0<
|
|
p&&h&&(c=this._levels[p-1],b=new MathEx.Point(g,this._levels[p].y),c=new MathEx.Point(l,c.y),e={},e.points=(new List).append(b).append(c),e.color=this._levels[p].color,e.linewidth=0,e.backcolor=this._levels[p].color,e.fillBackground=!0,e.transparency=k,a.append(new TradingView.RectangleRenderer(e)));var b=new MathEx.Point(g,this._levels[p].y),c=new MathEx.Point(f,this._levels[p].y),e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),
|
|
color:this._levels[p].color,linewidth:this._levels[p].linewidth,linestyle:this._levels[p].linestyle,extendleft:!1,extendright:d.extendLines.value(),leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},r=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,this._levels[p].index);a.append(new TradingView.TrendLineRenderer(e,r));if(d.showCoeffs.value()||d.showPrices.value())if(e=this._cacheState.preparedCells.cells[this._levels[p].index-
|
|
1]){var t;switch(d.horzLabelsAlign.value()){case "left":t=b;break;case "center":t=b.add(c).scaled(.5);t.x+=e.width/2;t.x=Math.round(t.x);break;case "right":d.extendLines.value()?t=new MathEx.Point(l-4,this._levels[p].y):(t=new MathEx.Point(l+4,this._levels[p].y),t.x+=e.width,t.x=Math.round(t.x))}b={left:e.left,top:m.topByRow(this._cacheState.row),width:e.width,height:m.rowHeight(this._cacheState.row)};c={left:t.x-b.width,top:t.y,width:e.width,height:b.height};e=d.vertLabelsAlign.value();"middle"==
|
|
e&&(c.top-=c.height/2);"bottom"==e&&(c.top-=c.height);b=new TradingView.PaneRendererCachedImage(n,b,c);a.append(b)}}this.addAnchors(a);return a};
|
|
TradingView.LineToolTrendBasedFibExtension=function(a,b){this._constructor="LineToolTrendBasedFibExtension";var c=b?b:new J52("linetooltrendbasedfibextension");R47.call(this,a,new R41(this,a),c);this.version=TradingView.LineToolTrendBasedFibExtension.version;a._trendBasedFibExtensionLabelsCache||(a._trendBasedFibExtensionLabelsCache=new TradingView.TrendBasedFibExtensionLabelsCache)};
|
|
inherit(TradingView.LineToolTrendBasedFibExtension,R47);TradingView.LineToolTrendBasedFibExtension.version=2;TradingView.LineToolTrendBasedFibExtension.LevelsCount=24;TradingView.LineToolTrendBasedFibExtension.prototype.stop=function(){R47.prototype.stop.call(this);this.D0._trendBasedFibExtensionLabelsCache.removeSource(this.id())};TradingView.LineToolTrendBasedFibExtension.prototype.pointsCount=function(){return 3};
|
|
TradingView.LineToolTrendBasedFibExtension.prototype.title=function(){return"Trend-Based Fib Extension"};TradingView.LineToolTrendBasedFibExtension.prototype.migrateVersion=function(a,b,c){1==a&&this.properties().extendLines.setValue(!0)};TradingView.LineToolTrendBasedFibExtension.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};J74=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J74,J90);
|
|
J74.prototype.update=function(){J90.prototype.update.call(this);if(!(2>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b=this.R99.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.R99.priceScale().isPercent()&&(d=this.R99.ownerSource().firstValue());for(var e=1;7>=e;e++){var f="hlevel"+e,g=this.R99.properties()[f];
|
|
if(g.visible.value()){var f=g.coeff.value(),g=g.color.value(),h=a.price+f*c;this.R99.priceScale().isPercent()&&(h=this.R99.priceScale().priceRange().convertToPercent(h,d));h=this.R99.priceScale().priceToCoordinate(h);this._hlevels.push({coeff:f,color:g,y:h,index:e})}}this._vlevels=[];b=b.index-a.index;for(e=1;7>=e;e++)f="vlevel"+e,g=this.R99.properties()[f],g.visible.value()&&(f=g.coeff.value(),g=g.color.value(),c=Math.round(a.index+f*b),c=this.D0.timeScale().indexToCoordinate(c),
|
|
this._vlevels.push({coeff:f,color:g,x:c,index:e}))}};
|
|
J74.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;for(var b=this._points.item(0),c=this._points.item(1),d=Math.min(b.x,c.x),e=Math.min(b.y,c.y),f=Math.max(b.x,c.x),g=Math.max(b.y,c.y),h=this.R99.properties(),k=h.grid.color.value(),l=h.grid.linewidth.value(),m=h.grid.linestyle.value(),n=0;n<this._hlevels.length;n++){b=new MathEx.Point(d,this._hlevels[n].y);c=new MathEx.Point(f,this._hlevels[n].y);if(h.grid.visible.value()){var p=
|
|
{points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k,linewidth:l,linestyle:m,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(p))}h.showLeftLabels.value()&&(b={points:(new List).append(b),text:""+this._hlevels[n].coeff,color:this._hlevels[n].color,vertAlign:"middle",horzAlign:"right",font:h.font.value(),
|
|
offsetX:-5,offsetY:0,fontsize:12},a.append(new TextRenderer(b,this._rendererCache)));h.showRightLabels.value()&&(c={points:(new List).append(c),text:""+this._hlevels[n].coeff,color:this._hlevels[n].color,vertAlign:"middle",horzAlign:"left",font:h.font.value(),offsetX:5,offsetY:0,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)))}for(n=0;n<this._vlevels.length;n++)b=new MathEx.Point(this._vlevels[n].x,e),c=new MathEx.Point(this._vlevels[n].x,g),h.grid.visible.value()&&(p={points:(new List).append(b).append(c),
|
|
width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k,linewidth:l,linestyle:m,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(p))),h.showTopLabels.value()&&(b={points:(new List).append(b),text:""+this._vlevels[n].coeff,color:this._vlevels[n].color,vertAlign:"bottom",horzAlign:"center",font:h.font.value(),offsetX:0,offsetY:-5,fontsize:12},a.append(new TextRenderer(b,
|
|
this._rendererCache))),h.showBottomLabels.value()&&(c={points:(new List).append(c),text:""+this._vlevels[n].coeff,color:this._vlevels[n].color,vertAlign:"top",horzAlign:"center",font:h.font.value(),offsetX:0,offsetY:5,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)));e=h.fillBackground.value();g=h.transparency.value();b=this._points.item(0);c=this._points.item(1);for(n=0;n<this._hlevels.length;n++)m=new MathEx.Point(c.x,this._hlevels[n].y),0<n&&e&&(k=new MathEx.Point(c.x,this._hlevels[n-
|
|
1].y),l={},l.width=this.D0.timeScale().width(),l.p1=b,l.p2=m,l.p3=b,l.p4=k,l.color=this._hlevels[n].color,l.transparency=g,l.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(l))),p={points:(new List).append(b).append(m),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this._hlevels[n].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},
|
|
k=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,{type:"h",index:this._hlevels[n].index}),a.append(new TradingView.TrendLineRenderer(p,k));for(n=0;n<this._vlevels.length;n++)m=new MathEx.Point(this._vlevels[n].x,c.y),0<n&&e&&(k=new MathEx.Point(this._vlevels[n-1].x,c.y),l={},l.width=this.D0.timeScale().width(),l.p1=b,l.p2=m,l.p3=b,l.p4=k,l.color=this._vlevels[n].color,l.transparency=g,l.hittestOnBackground=!0,a.append(new TradingView.ChannelRenderer(l))),p={points:(new List).append(b).append(m),
|
|
width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:this._vlevels[n].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},k=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,{type:"v",index:this._vlevels[n].index}),a.append(new TradingView.TrendLineRenderer(p,k));this.addAnchors(a);return a};
|
|
TradingView.LineToolFibSpeedResistanceFan=function(a,b){this._constructor="LineToolFibSpeedResistanceFan";var c=b?b:new J52("linetoolfibspeedresistancefan");R47.call(this,a,new J74(this,a),c)};inherit(TradingView.LineToolFibSpeedResistanceFan,R47);TradingView.LineToolFibSpeedResistanceFan.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpeedResistanceFan.prototype.title=function(){return"Fib Speed Resistance Fan"};
|
|
TradingView.LineToolFibSpeedResistanceFan.prototype.processErase=function(a,b){var c;c="h"==b.type?"hlevel"+b.index:"vlevel"+b.index;c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.FibSpeedResistanceArcsLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.FibSpeedResistanceArcsLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.FibSpeedResistanceArcsLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolFibSpeedResistanceArcs.LevelsCount};
|
|
TradingView.FibArcRenderer=function(a,b,c){this._data=a;this._hittest=b||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittest=c||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND)};
|
|
TradingView.FibArcRenderer.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.translate(this._data.center.x,this._data.center.y);a.beginPath();this._data.fullCircles?a.arc(0,0,this._data.radius,2*Math.PI,0,!1):0<this._data.dir?a.arc(0,0,this._data.radius,0,Math.PI,!1):a.arc(0,0,this._data.radius,Math.PI,0,!1);a.stroke();this._data.fillBackground&&(this._data.radius2&&(this._data.fullCircles?a.arc(0,0,this._data.radius2,2*Math.PI,0,!0):0<this._data.dir?
|
|
a.arc(0,0,this._data.radius2,Math.PI,0,!0):a.arc(0,0,this._data.radius2,0,Math.PI,!0)),a.fillStyle=TradingView.generateColor(this._data.color,this._data.transparency),a.fill())};
|
|
TradingView.FibArcRenderer.prototype.hitTest=function(a){if(MathEx.sign(a.y-this._data.center.y)!==this._data.dir&&!this._data.fullCircles)return null;a=a.substract(this._data.center).length();return 3>Math.abs(a-this._data.radius)?this._hittest:this._data.hittestOnBackground&&Math.abs(a)<=this._data.radius+3?this._backHittest:null};J73=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};
|
|
inherit(J73,J90);J73.prototype.update=function(){this._invalidated=!0};
|
|
J73.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.D0._fibSpeedResistanceArcsLabelsCache.updateSource(this.R99);if(!(2>this._points.size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1),c=a.substract(b).length();this._levels=[];for(var d=this.R99.properties(),e=1;e<=TradingView.LineToolFibSpeedResistanceArcs.LevelsCount;e++){var f=
|
|
d["level"+e];if(f.visible.value()){var g=f.coeff.value(),h=f.color.value(),k=b.substract(a).length()*g,l=MathEx.sign(b.y-a.y),g=new MathEx.Point(a.x,a.y+l*c*g);this._levels.push({color:h,radius:k,dir:l,labelPoint:g,linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),index:e})}}}};
|
|
J73.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.R99.properties(),d=c.fillBackground.value(),e=c.transparency.value(),f=this.D0._fibSpeedResistanceArcsLabelsCache,g=f.canvas().get(0),h=0;h<this._levels.length;h++){var k=this._levels[h],l={};l.center=b;l.color=k.color;l.linewidth=
|
|
k.linewidth;l.radius=k.radius;l.dir=k.dir;l.transparency=e;l.fillBackground=d;l.hittestOnBackground=!0;l.fullCircles=c.fullCircles.value();0<h&&(l.radius2=this._levels[h-1].radius);var m=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,k.index);a.append(new TradingView.FibArcRenderer(l,m));c.showCoeffs.value()&&(m=this._cacheState.preparedCells.cells[this._levels[h].index-1])&&(l={left:m.left,top:f.topByRow(this._cacheState.row),width:m.width,height:f.rowHeight(this._cacheState.row)},
|
|
k={left:Math.round(k.labelPoint.x-l.width),top:Math.round(k.labelPoint.y-l.height/2),width:m.width,height:l.height},k=new TradingView.PaneRendererCachedImage(g,l,k),a.append(k))}c.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:c.trendline.color.value(),linewidth:c.trendline.linewidth.value(),linestyle:c.trendline.linestyle.value(),extendleft:!1,extendright:!1,
|
|
leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(b)));this.addAnchors(a);return a};
|
|
TradingView.LineToolFibSpeedResistanceArcs=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new J52("linetoolfibspeedresistancearcs");R47.call(this,a,new J73(this,a),c);a._fibSpeedResistanceArcsLabelsCache||(a._fibSpeedResistanceArcsLabelsCache=new TradingView.FibSpeedResistanceArcsLabelsCache)};inherit(TradingView.LineToolFibSpeedResistanceArcs,R47);
|
|
TradingView.LineToolFibSpeedResistanceArcs.LevelsCount=11;TradingView.LineToolFibSpeedResistanceArcs.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpeedResistanceArcs.prototype.title=function(){return"Fib Speed Resistance Arcs"};TradingView.LineToolFibSpeedResistanceArcs.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};J76=function(a,b){J90.call(this,a,b);this._levels=[];this._rendererCache={}};inherit(J76,J90);
|
|
J76.prototype.update=function(){J90.prototype.update.call(this);if(!(1>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b;2===this.R99.points().size()&&(b=this.R99.points().item(1));var c=this.R99.properties(),d=this.R99.points().item(0).index;if(!this.D0.timeScale().visibleBars().isEmpty())for(this._levels=
|
|
[],a=b?b.index-a.index:1,b=1;11>=b;b++){var e=c["level"+b];if(e.visible.value()){var f=Math.round(d+e.coeff.value()*a),f=this.D0.timeScale().indexToCoordinate(f),f={index:b,x:f,color:e.color.value(),width:e.linewidth.value(),style:e.linestyle.value()};c.showLabels.value()&&(f.text=e.coeff.value(),f.y=this.R99.priceScale().height());this._levels.push(f)}}}};
|
|
J76.prototype.renderer=function(){for(var a=new TradingView.CompositeRenderer,b=this.R99.properties(),c=0;c<this._levels.length;c++){var d={};d.points=(new List).append(new MathEx.Point(this._levels[c].x,0));d.color=this._levels[c].color;d.linewidth=this._levels[c].width;d.linestyle=this._levels[c].style;var e=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,this._levels[c].index);a.append(new TradingView.VertLineRenderer(d,e));if(0<c&&b.fillBackground.value()){var f=
|
|
this._levels[c-1],e=new MathEx.Point(this._levels[c].x,0),f=new MathEx.Point(f.x,this.R99.priceScale().height()),g={};g.points=(new List).append(e).append(f);g.color=this._levels[c].color;g.linewidth=0;g.backcolor=this._levels[c].color;g.fillBackground=!0;g.transparency=b.transparency.value();a.append(new TradingView.RectangleRenderer(g))}if(void 0!==this._levels[c].text){var h,k,l,e=b.horzLabelsAlign.value(),e="left"==e?"right":"right"==e?"left":"center";switch(e){case "left":k=3;break;case "center":k=
|
|
0;break;case "right":k=-3}switch(b.vertLabelsAlign.value()){case "top":h=new MathEx.Point(this._levels[c].x,0);l=5;break;case "middle":h=new MathEx.Point(this._levels[c].x,.5*this._levels[c].y);l=0;break;case "bottom":h=new MathEx.Point(this._levels[c].x,this._levels[c].y),l=-10}d={points:(new List).append(h),text:""+this._levels[c].text,color:d.color,vertAlign:"middle",horzAlign:e,font:b.font.value(),offsetX:k,offsetY:l,fontsize:12};a.append(new TextRenderer(d,this._rendererCache))}}2===this._points.size()&&
|
|
(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(b)));this.isAnchorsRequired()&&(2===this.R99.points().size()?
|
|
a.append(this.createLineAnchor({points:this._points.toArray()})):0<this._points.size()&&a.append(this.createLineAnchor({points:[new MathEx.Point(this._points.item(0).x,this.R99.priceScale().height()/2)],hittestResult:TradingView.HitTestResult.MOVEPOINT})));return a};
|
|
TradingView.LineToolFibTimeZone=function(a,b){this._constructor="LineToolFibTimeZone";var c=b?b:new J52("linetoolfibtimezone");R47.call(this,a,new J76(this,a),c);this.version=TradingView.LineToolFibTimeZone.version};inherit(TradingView.LineToolFibTimeZone,R47);TradingView.LineToolFibTimeZone.version=2;
|
|
TradingView.LineToolFibTimeZone.prototype.migrateVersion=function(a,b,c){if(1===a){c.properties.level1.color.setValue(c.properties.baselinecolor.value());for(a=2;11>=a;a++)c.properties["level"+a].color.setValue(c.properties.linecolor.value());for(a=1;11>=a;a++)c.properties["level"+a].linewidth.setValue(c.properties.linewidth.value()),c.properties["level"+a].linestyle.setValue(c.properties.linestyle.value())}};TradingView.LineToolFibTimeZone.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolFibTimeZone.prototype.title=function(){return"Fib Time Zone"};TradingView.LineToolFibTimeZone.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.FibCirclesLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.FibCirclesLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.FibCirclesLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolFibCircles.LevelsCount};TradingView.EllipseRendererSimple=function(a,b,c){this._data=a;this._hittest=b||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittest=c||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND)};
|
|
TradingView.EllipseRendererSimple.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.lineStyle=this._data.linestyle;var b=this._data.points.item(0),c=this._data.points.item(1),d=Math.abs(b.x-c.x),e=Math.abs(b.y-c.y),b=b.add(c).scaled(.5);if(!(1>d||1>e)){var f;if(this._data.wholePoints){var c=this._data.wholePoints.item(0),g=this._data.wholePoints.item(1);f=Math.abs(c.x-g.x);Math.abs(c.y-g.y)}a.save();a.translate(b.x,b.y);a.scale(1,e/d);a.beginPath();
|
|
a.arc(0,0,d/2,0,2*Math.PI,!1);a.restore();a.stroke();this._data.fillBackground&&(this._data.wholePoints&&(a.translate(b.x,b.y),a.scale(1,e/d),a.arc(0,0,f/2,0,2*Math.PI,!0)),a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
|
|
TradingView.EllipseRendererSimple.prototype.hitTest=function(a){if(2>this._data.points.size())return null;var b=this._data.points.item(0),c=this._data.points.item(1),d=.5*Math.abs(b.x-c.x);Math.abs(b.y-c.y);var e=Math.abs(b.x-c.x),f=Math.abs(b.y-c.y),g=b.add(c).scaled(.5);a=a.substract(g);if(1>e||1>f)return null;a.y/=(c.y-b.y)/(c.x-b.x);b=a.x*a.x+a.y*a.y-d*d;b=MathEx.sign(b)*Math.sqrt(Math.abs(b/d));return 3>Math.abs(b)?this._hittest:this._data.fillBackground&&!this._data.noHitTestOnBackground&&3>
|
|
b?this._backHittest:null};J71=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(J71,J90);J71.prototype.update=function(){this._invalidated=!0};
|
|
J71.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.D0._fibCirclesLabelsCache.updateSource(this.R99);if(!(2>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1);this._center=a.add(b).scaled(.5);var c=Math.abs(b.x-a.x),a=Math.abs(b.y-a.y);this._levels=[];for(var b=this.R99.properties(),
|
|
d=1;d<=TradingView.LineToolFibCircles.LevelsCount;d++){var e=b["level"+d];if(e.visible.value()){var f=e.coeff.value(),g=e.color.value(),h=new List;h.append(new MathEx.Point(this._center.x-.5*c*f,this._center.y-.5*a*f));h.append(new MathEx.Point(this._center.x+.5*c*f,this._center.y+.5*a*f));f=new MathEx.Point(this._center.x,this._center.y+.5*a*f);this._levels.push({color:g,points:h,labelPoint:f,linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:d})}}}};
|
|
J71.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;this._points.item(0);this._points.item(1);for(var b=this.R99.properties(),c=b.fillBackground.value(),d=b.transparency.value(),e=this.D0._fibCirclesLabelsCache,f=e.canvas().get(0),g=0;g<this._levels.length;g++){var h=this._levels[g],k={};k.points=h.points;k.color=h.color;k.linewidth=h.linewidth;k.backcolor=
|
|
h.color;0<g&&(k.wholePoints=this._levels[g-1].points);k.fillBackground=c;k.transparency=d;var l=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,h.index);a.append(new TradingView.EllipseRendererSimple(k,l));b.showCoeffs.value()&&(l=this._cacheState.preparedCells.cells[this._levels[g].index-1])&&(k={left:l.left,top:e.topByRow(this._cacheState.row),width:l.width,height:e.rowHeight(this._cacheState.row)},h={left:Math.round(h.labelPoint.x-k.width),top:Math.round(h.labelPoint.y-k.height/
|
|
2),width:l.width,height:k.height},h=new TradingView.PaneRendererCachedImage(f,k,h),a.append(h))}b.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},
|
|
a.append(new TradingView.TrendLineRenderer(b)));this.addAnchors(a);return a};TradingView.LineToolFibCircles=function(a,b){this._constructor="LineToolFibCircles";var c=b?b:new J52("linetoolfibcircles");R47.call(this,a,new J71(this,a),c);a._fibCirclesLabelsCache||(a._fibCirclesLabelsCache=new TradingView.FibCirclesLabelsCache)};inherit(TradingView.LineToolFibCircles,R47);
|
|
TradingView.LineToolFibCircles.LevelsCount=11;TradingView.LineToolFibCircles.prototype.pointsCount=function(){return 2};TradingView.LineToolFibCircles.prototype.title=function(){return"Fib Circles"};TradingView.LineToolFibCircles.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.FibWedgeLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.FibWedgeLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.FibWedgeLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolFibWedge.LevelsCount};
|
|
TradingView.ArcWedgeRenderer=function(a,b,c){this._data=a;this._hittest=b||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);this._backHittest=c||new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND);this._rendererCache={}};
|
|
TradingView.ArcWedgeRenderer.prototype.draw=function(a){a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.beginPath();a.arc(this._data.center.x,this._data.center.y,this._data.radius,this._data.edge1,this._data.edge2,!0);a.stroke();if(this._data.fillBackground){a.arc(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.edge2,this._data.edge1,!1);if(this._data.gradient){var b=a.createRadialGradient(this._data.center.x,this._data.center.y,this._data.prevRadius,this._data.center.x,
|
|
this._data.center.y,this._data.radius);b.addColorStop(0,TradingView.generateColor(this._data.color1,this._data.transparency));b.addColorStop(1,TradingView.generateColor(this._data.color2,this._data.transparency));a.fillStyle=b}else a.fillStyle=TradingView.generateColor(this._data.color,this._data.transparency);a.fill()}};
|
|
TradingView.ArcWedgeRenderer.prototype.hitTest=function(a){var b=a.substract(this._data.center).length();if(4>=Math.abs(b-this._data.radius)){var c=a.substract(this._data.p1).length(),d=a.substract(this._data.p2).length(),c=Math.max(c,d),d=this._data.p1.substract(this._data.p2).length();if(c<=d)return this._hittest}return this._data.fillBackground&&b<=this._data.radius&&(d=this._data.p1.substract(this._data.center).normalized(),c=this._data.p2.substract(this._data.center).normalized(),b=a.substract(this._data.center).normalized(),
|
|
a=d.dotProduct(c),d=b.dotProduct(d),b=b.dotProduct(c),d>=a&&b>=a)?this._backHittest:null};J77=function(a,b){J90.call(this,a,b);this._rendererCache={};this._levels=[];this._invalidated=!0};inherit(J77,J90);J77.prototype.update=function(){this._invalidated=!0};
|
|
J77.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.R99.getCache().updateSource(this.R99);this._levels=[];if(!(3>this._points.size())){var a=this._points,b=a.item(0),c=a.item(1),d=a.item(2),a=c.substract(b).normalized(),d=d.substract(b).normalized(),e=new MathEx.Point(1,0),f=new MathEx.Point(0,1),g=Math.acos(a.dotProduct(e));0>a.dotProduct(f)&&(g=2*Math.PI-g);this._edge1=g;e=Math.acos(d.dotProduct(e));
|
|
0>d.dotProduct(f)&&(e=2*Math.PI-e);this._edge2=e;g<e&&(this._edge1=Math.max(g,e),this._edge2=Math.min(g,e)+2*Math.PI);Math.abs(g-e)>Math.PI&&(this._edge1=Math.min(g,e),this._edge2=Math.max(g,e)-2*Math.PI);f=this.R99.properties();for(g=1;g<=this.R99.getCache().levelsCount();g++)if(e=f["level"+g],e.visible.value()){var h=e.coeff.value(),k=e.color.value(),l=c.substract(b).length()*h,m=a.add(d).scaled(.5).normalized().scaled(l),m=b.add(m);this._levels.push({coeff:h,color:k,radius:l,labelPoint:m,
|
|
p1:b.add(a.scaled(l)),p2:b.add(d.scaled(l)),linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:g})}}};
|
|
J77.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this.R99.properties(),c=this._points,d=c.item(0),e=c.item(1),f={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,
|
|
extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(f));if(3>this._points.size())return this.addAnchors(a),a;var g=c.item(2),c=g.data,f=e.substract(d).length();e.substract(d).normalized();g=g.substract(d).normalized();g=d.add(g.scaled(f));g.data=c;f={points:(new List).append(d).append(g),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),
|
|
linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(f));for(var c=this.D0._fibWedgeLabelsCache,f=c.canvas().get(0),h=this._levels.length-1;0<=h;h--){var k=this._levels[h],l={};l.center=this._points.item(0);l.radius=k.radius;l.prevRadius=0<h?this._levels[h-1].radius:0;l.edge=this._edge;l.color=k.color;
|
|
l.linewidth=1;l.edge1=this._edge1;l.edge2=this._edge2;l.p1=k.p1;l.p2=k.p2;l.fillBackground=b.fillBackground.value();l.transparency=b.transparency.value();var m=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,k.index);a.append(new TradingView.ArcWedgeRenderer(l,m));b.showCoeffs.value()&&(m=this._cacheState.preparedCells.cells[this._levels[h].index-1])&&(l={left:m.left,top:c.topByRow(this._cacheState.row),width:m.width,height:c.rowHeight(this._cacheState.row)},k={left:Math.round(k.labelPoint.x-
|
|
l.width),top:Math.round(k.labelPoint.y-l.height/2),width:m.width,height:l.height},k=new TradingView.PaneRendererCachedImage(f,l,k),a.append(k))}this.isAnchorsRequired()&&(c=[d,e],this.D0.lineBeingCreated()!=this.R99&&c.push(g),a.append(this.createLineAnchor({points:c})));return a};
|
|
TradingView.LineToolFibWedge=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new J52("linetoolfibwedge");R47.call(this,a,new J77(this,a),c);a._fibWedgeLabelsCache||(a._fibWedgeLabelsCache=new TradingView.FibWedgeLabelsCache)};inherit(TradingView.LineToolFibWedge,R47);TradingView.LineToolFibWedge.LevelsCount=11;
|
|
TradingView.LineToolFibWedge.prototype.getCache=function(){this.D0._fibWedgeLabelsCache||(this.D0._fibWedgeLabelsCache=new TradingView.FibWedgeLabelsCache);return this.D0._fibWedgeLabelsCache};TradingView.LineToolFibWedge.prototype.pointsCount=function(){return 3};TradingView.LineToolFibWedge.prototype.title=function(){return"Fib Wedge"};
|
|
TradingView.LineToolFibWedge.prototype.setPoint=function(a,b){R47.prototype.setPoint.call(this,a,b);if(!this._recursiveGuard){this._recursiveGuard=!0;if(2==a){var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],e=e.substract(c).length(),d=d.substract(c).normalized(),d=c.add(d.scaled(e)),c=this.priceScale().coordinateToPrice(d.y);a=Math.round(this.D0.timeScale().coordinateToIndex(d.x));
|
|
this.D2.points[1].price.setValue(c);this.D2.points[1].bar.setValue(a)}else{var c=this.pointToScreenPoint(this._points.item(0))[0],d=this.pointToScreenPoint(this._points.item(1))[0],e=this.pointToScreenPoint(this._points.item(2))[0],f=d.substract(c).length(),d=e.substract(c).normalized(),e=c.add(d.scaled(f)),c=this.priceScale().coordinateToPrice(e.y);a=Math.round(this.D0.timeScale().coordinateToIndex(e.x));this.D2.points[2].price.setValue(c);this.D2.points[2].bar.setValue(a)}this._recursiveGuard=
|
|
!1}};
|
|
TradingView.LineToolFibWedge.prototype.addPoint=function(a){if(2==this._points.size()){var b=this.pointToScreenPoint(this._points.item(0))[0],c=this.pointToScreenPoint(this._points.item(1))[0];if(this.priceScale().isPercent()){var d=this.ownerSource().firstValue();a.price=this.priceScale().priceRange().convertFromPercent(a.price,d)}a=this.pointToScreenPoint(a)[0];c=c.substract(b).length();a=a.substract(b).normalized();a=b.add(a.scaled(c));b=this.priceScale().coordinateToPrice(a.y);a={index:Math.round(this.D0.timeScale().coordinateToIndex(a.x)),price:b}}return R47.prototype.addPoint.call(this,
|
|
a)};TradingView.LineToolFibWedge.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.ProjectionLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.ProjectionLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.ProjectionLabelsCache.prototype.levelsCount=function(){return 1};R7=function(a,b){J77.call(this,a,b)};inherit(R7,J77);R7.prototype.update=function(){J77.prototype.update.call(this)};
|
|
R7.prototype._levelsCount=function(){return 1};
|
|
R7.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this.R99.properties(),c=this._points,d=c.item(0),e=c.item(1),f={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,
|
|
extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(f));if(3>this._points.size())return this.addAnchors(a),a;var g=c.item(2),c=g.data,f=e.substract(d).length();e.substract(d).normalized();e=g.substract(d).normalized();g=d.add(e.scaled(f));g.data=c;f={points:(new List).append(d).append(g),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:b.trendline.color.value(),
|
|
linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(f));d=this._levels[0];e={};e.center=this._points.item(0);e.radius=d.radius;e.prevRadius=0;e.edge=this._edge;e.color=b.trendline.color.value();e.color1=b.color1.value();e.color2=b.color2.value();e.linewidth=b.linewidth.value();e.edge1=this._edge1;e.edge2=this._edge2;
|
|
e.p1=d.p1;e.p2=d.p2;e.fillBackground=b.fillBackground.value();e.transparency=b.transparency.value();e.gradient=!0;a.append(new TradingView.ArcWedgeRenderer(e));this.addAnchors(a);return a};TradingView.LineToolProjection=function(a,b){this._constructor="LineToolProjection";var c=b?b:new J52("linetoolprojection");R47.call(this,a,new R7(this,a),c)};inherit(TradingView.LineToolProjection,TradingView.LineToolFibWedge);
|
|
TradingView.LineToolProjection.prototype.title=function(){return"Projection"};TradingView.LineToolProjection.prototype.getCache=function(){this.D0._projectionLabelsCache||(this.D0._projectionLabelsCache=new TradingView.ProjectionLabelsCache);return this.D0._projectionLabelsCache};J68=function(a,b){J90.call(this,a,b);this._rendererCache=[{},{},{},{},{},{}]};inherit(J68,J90);
|
|
J68.prototype.renderer=function(){if(!this._wave)return null;for(var a=this.isAnchorsRequired()?0:1,b=new TradingView.CompositeRenderer,c=this.R99.properties(),d=0;d<this._wave.length;d++)b.append(new TradingView.TrendLineRenderer(this._wave[d]));var e=1;if(2<this._points.size())var f=this._points.item(2),g=this._points.item(1),e=MathEx.sign(f.y-g.y);var h=[],k=0;this.D0.lineBeingCreated()==this.R99&&(k=1);for(var l=(new TradingView.RGBColor(this.D0.backgroundColor())).blackWhiteContrast(),
|
|
c=c.color.value(),d=0;d<this._points.size()-k;d++,e=-e)if(!(d<a)){var m=this.R99.label(d),n=m.label;if("circle"==m.decoration){g=this._points.item(d).clone();g.y=1==e?g.y+(13+m.fontIncrease/2):g.y-(14+m.fontIncrease/2);var p=(12+m.fontIncrease)/2+2,f=g.substract(new MathEx.Point(p,p)),g=g.add(new MathEx.Point(p,p)),f={points:(new List).append(f).append(g),color:(new TradingView.RGBColor(c)).darken("black"==l?15:-15).toHex(),linewidth:1,fillBackground:!1},f=new TradingView.EllipseRendererSimple(f);
|
|
b.append(f)}"brackets"==m.decoration&&(n="("+n+")");n={points:(new List).append(this._points.item(d)),text:n,color:(new TradingView.RGBColor(c)).darken("black"==l?15:-15).toHex(),vertAlign:1==e?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1==e?5:-10,fontsize:12+m.fontIncrease,bold:m.bold};h.push(n);""!==m&&b.append(new TextRenderer(n,this._rendererCache[d],new TradingView.HitTestResult(TradingView.HitTestResult.CHANGEPOINT,d)))}if(this.isAnchorsRequired()){a=[];for(d=0;d<h.length;d++)e=
|
|
this._points.item(d).clone(),e.y=h[d].points.item(0).y,e.data=d,a.push(e);this.D0.lineBeingCreated()==this.R99&&a.pop();b.append(this.createLineAnchor({points:a}))}return b};
|
|
J68.prototype.update=function(){J90.prototype.update.call(this);this._wave=[];var a=this.R99.properties(),b=this.R99.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&!c.isEmpty()){var d;this.R99.priceScale().isPercent()&&(d=this.R99.ownerSource().firstValue());var e=a.color.value();if(a.showWave.value())for(var f=this.R99.points(),g=1;g<f.size();g++){var h=f.item(g-1),k=f.item(g);this.D0.mainSeries().bars().valueAt(h.index);
|
|
this.D0.mainSeries().bars().valueAt(k.index);var l=c.indexToCoordinate(h.index),m=c.indexToCoordinate(k.index),h=h.price,k=k.price;this.R99.priceScale().isPercent()&&(h=this.R99.priceScale().priceRange().convertToPercent(h,d),k=this.R99.priceScale().priceRange().convertToPercent(k,d));h=b.priceToCoordinate(h);k=b.priceToCoordinate(k);l={points:(new List).append(new MathEx.Point(l,h)).append(new MathEx.Point(m,k)),width:c.width(),height:b.height(),color:TradingView.generateColor(e,
|
|
0),linewidth:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_CIRCLE,rightend:R47.LINEEND_CIRCLE,endstyle:{strokeWidth:1,fillStyle:this.D0.backgroundColor()},overlayLineEndings:!0};this._wave.push(l)}}};TradingView.LineToolElliott=function(a,b){var c=b?b:new J52("linetoolelliott");R47.call(this,a,new J68(this,a),c)};
|
|
inherit(TradingView.LineToolElliott,R47);
|
|
TradingView.LineToolElliott.migrateState=function(a){var b={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},c={0:11,1:8};"LineToolElliottSubminuette"===a.type&&(a.type="LineToolElliottImpulse",a.state.degree=b[a.state.wavesize]);"LineToolElliottMinor"===a.type&&(a.type="LineToolElliottImpulse",a.state.degree=b[a.state.wavesize]);"LineToolElliottCircle"===a.type&&(a.type="LineToolElliottImpulse",a.state.degree=b[a.state.wavesize]);"LineToolElliottMinorRetr"===a.type&&(a.type="LineToolElliottCorrection",a.state.degree=
|
|
c[a.state.wavesize]);"LineToolElliottMajorRetr"===a.type&&(a.type="LineToolElliottCorrection",a.state.degree=c[a.state.wavesize])};TradingView.LineToolElliott.prototype.title=function(){return"Elliott Labels"};TradingView.LineToolElliott.degrees="Supermillennium;Millennium;Submillennium;Grand Supercycle;Supercycle;Cycle;Primary;Intermediate;Minor;Minute;Minuette;Subminuette;Micro;Submicro;Miniscule".split(";");
|
|
TradingView.LineToolElliott.prototype.additionalActions=function(a){var b=new TradingView.Action({text:$.t("Degree")}),c=this;b.subActions=TradingView.LineToolElliott.degrees.map(function(b,e){var f=new TradingView.Action({text:b,checkable:!0,checked:c.properties().degree.value()==e});f.callbacks().subscribe(null,function(){a.setProperty(c.properties().degree,e,"Change Elliott Degree")});return f});return[b]};
|
|
TradingView.LineToolElliott.prototype.label=function(a){var b=TradingView.LineToolElliott.degrees.length-this.properties().degree.value()-1,c=Math.floor(b/3),d=4*Math.floor(c),e=!!(c%2),b=["","brackets","circle"][b%3];a=this.labelsGroup()[c][a];return{fontIncrease:d,bold:e,decoration:b,label:a}};
|
|
TradingView.LineToolElliott5Points=function(a,b){var c=b?b:new J52("linetoolelliott");R47.call(this,a,new J68(this,a),c);this.version=TradingView.LineToolElliott5Points.version};inherit(TradingView.LineToolElliott5Points,TradingView.LineToolElliott);TradingView.LineToolElliott5Points.version=3;TradingView.LineToolElliott5Points.prototype.pointsCount=function(){return 6};
|
|
TradingView.LineToolElliott5Points.prototype.migrateVersion=function(a,b,c){1==a&&(a=$.extend({},this._timePoint.item(0)),this._timePoint.insert(a,0),0<this._points.size()&&(a=$.extend({},this._points.item(0)),this._points.insert(a,0)))};TradingView.LineToolElliottImpulse=function(a,b){this._constructor="LineToolElliottImpulse";var c=b?b:new J52("linetoolelliottimpulse");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottImpulse,TradingView.LineToolElliott5Points);
|
|
TradingView.LineToolElliottImpulse._labelsGroups=["012345".split(""),"0 i ii iii iv v".split(" "),"012345".split(""),"0 I II III IV V".split(" "),"012345".split("")];TradingView.LineToolElliottImpulse.prototype.labelsGroup=function(){return TradingView.LineToolElliottImpulse._labelsGroups};
|
|
TradingView.LineToolElliottTriangle=function(a,b){this._constructor="LineToolElliottTriangle";var c=b?b:new J52("linetoolelliotttriangle");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottTriangle,TradingView.LineToolElliott5Points);TradingView.LineToolElliottTriangle._labelsGroups=["0ABCDE".split(""),"0abcde".split(""),"0ABCDE".split(""),"0abcde".split(""),"0ABCDE".split("")];TradingView.LineToolElliottTriangle.prototype.labelsGroup=function(){return TradingView.LineToolElliottTriangle._labelsGroups};
|
|
TradingView.LineToolElliottTripleCombo=function(a,b){this._constructor="LineToolElliottTripleCombo";var c=b?b:new J52("linetoolelliotttriplecombo");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottTripleCombo,TradingView.LineToolElliott5Points);TradingView.LineToolElliottTripleCombo._labelsGroups=["0WXYXZ".split(""),"0wxyxz".split(""),"0WXYXZ".split(""),"0wxyxz".split(""),"0WXYXZ".split("")];
|
|
TradingView.LineToolElliottTripleCombo.prototype.labelsGroup=function(){return TradingView.LineToolElliottTripleCombo._labelsGroups};TradingView.LineToolElliott3Points=function(a,b){var c=b?b:new J52("linetoolelliott");R47.call(this,a,new J68(this,a),c);this.version=TradingView.LineToolElliott3Points.version};inherit(TradingView.LineToolElliott3Points,TradingView.LineToolElliott);
|
|
TradingView.LineToolElliott3Points.version=3;TradingView.LineToolElliott3Points.prototype.pointsCount=function(){return 4};TradingView.LineToolElliott3Points.prototype.migrateVersion=function(a,b,c){1==a&&(a=$.extend({},this._timePoint.item(0)),this._timePoint.insert(a,0),0<this._points.size()&&(a=$.extend({},this._points.item(0)),this._points.insert(a,0)))};
|
|
TradingView.LineToolElliottCorrection=function(a,b){this._constructor="LineToolElliottCorrection";var c=b?b:new J52("linetoolelliottcorrection");TradingView.LineToolElliott3Points.call(this,a,c)};inherit(TradingView.LineToolElliottCorrection,TradingView.LineToolElliott3Points);TradingView.LineToolElliottCorrection._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]];
|
|
TradingView.LineToolElliottCorrection.prototype.labelsGroup=function(){return TradingView.LineToolElliottCorrection._labelsGroups};TradingView.LineToolElliottDoubleCombo=function(a,b){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var c=b?b:new J52("linetoolelliottdoublecombo");TradingView.LineToolElliott3Points.call(this,a,c)};inherit(TradingView.LineToolElliottDoubleCombo,TradingView.LineToolElliott3Points);
|
|
TradingView.LineToolElliottDoubleCombo._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]];TradingView.LineToolElliottDoubleCombo.prototype.labelsGroup=function(){return TradingView.LineToolElliottDoubleCombo._labelsGroups};J93=function(a,b){J90.call(this,a,b);this._lines=[]};inherit(J93,J90);
|
|
J93.prototype.update=function(){J90.prototype.update.call(this);if(!(2>this.R99.points().size())){var a=this.D0.timeScale();if(this.R99.priceScale()&&!this.R99.priceScale().isEmpty()&&!a.isEmpty()){var b=this.R99.points().item(0),c=this.R99.points().item(1),c=c?c.index-b.index:1;this._lines=[];if(0!==c){var d=a.visibleBars();if(0<c)for(b=b.index;b<=d.lastBar();b+=c)this._lines.push({x:a.indexToCoordinate(b)});else for(b=
|
|
b.index;b>=d.firstBar();b+=c)this._lines.push({x:a.indexToCoordinate(b)})}}}};
|
|
J93.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.R99.properties(),d={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,
|
|
rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(d));d=this.R99.properties();for(b=0;b<this._lines.length;b++)c={points:(new List).append(new MathEx.Point(this._lines[b].x,0)),color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:d.linestyle.value()},a.append(new TradingView.VertLineRenderer(c));this.isAnchorsRequired()&&(2===this.R99.points().size()?(d=this._points.clone(),a.append(this.createLineAnchor({points:d.toArray()}))):a.append(this.createLineAnchor({points:[new MathEx.Point(this._points.item(0).x,
|
|
this.R99.priceScale().height()/2)],hittestResult:TradingView.HitTestResult.MOVEPOINT})));return a};TradingView.LineToolCircleLines=function(a,b){this._constructor="LineToolCircleLines";var c=b?b:new J52("linetoolcirclelines");R47.call(this,a,new J93(this,a),c)};inherit(TradingView.LineToolCircleLines,R47);TradingView.LineToolCircleLines.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolCircleLines.prototype.title=function(){return"Cyclic Lines"};TradingView.LineToolVbPFixed=function(a,b,c,d){var e=TradingView.Study.lineToolNameForPointsBasedStudy("VbPFixed@tv-volumebyprice");c=c?c:TradingView.StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),"VbPFixed@tv-volumebyprice");d=a.studyVersioning();b=b?b:TradingView.prepareStudyProperties(c,null,null,d);this._metaInfo=c;this.m_data=new TradingView.PlotList;this._plotOffsets={};this._plotOffsetsMetaInfoOverride={};d=new R31(this,a);var f=new TradingView.Study.StudyPaneView_hhists(this,
|
|
a),g=new TradingView.Study.StudyPaneView_horizlines(this,a),h=new TradingView.Study.StudyPaneView_polygons(this,a),f=[d,f,g,h];d=a.mainSeries();0<c.plots.length&&(g=new R33(this,d,a,c.plots[0].id),f.push(g));1<c.plots.length&&(g=new R33(this,d,a,c.plots[1].id),f.push(g));2<c.plots.length&&(d=new R33(this,d,a,c.plots[2].id),f.push(d));A63.call(this,a,f,b,e);this._turnaroundCounter=1;this._turnaround="vbpfixed_"+
|
|
this._turnaroundCounter;this._metaInfo=c;this._graphics=new A62(c);this._plotFields=[];if(a=this.metaInfo().plots)for(c=0,e=a.length;c<e;c++)this._plotFields.push(a[c].id);this.clearData();this._formatter=new TradingView.VolumeFormatter};inherit(TradingView.LineToolVbPFixed,A63);TradingView.LineToolVbPFixed.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolVbPFixed.prototype._requestStudy=function(){var a=this.points().item(0),b=this.points().item(1),c=Math.min(a.index,b.index),a=Math.max(a.index,b.index);if(c===a)this.clearData();else if(c=this.D0.mainSeries().bars().valueAt(c),a=this.D0.mainSeries().bars().valueAt(a),c&&a){c=1E3*c[TradingView.TIME_PLOT];a=1E3*a[TradingView.TIME_PLOT];b=[];void 0!==this.properties().inputs.rowsLayout&&b.push(this.properties().inputs.rowsLayout.value());b.push(this.properties().inputs.rows.value());
|
|
b.push(this.properties().inputs.volume.value());b.push(c);b.push(a);b.push(this.properties().inputs.vaVolume.value());var d=this;this._studyId?(this._turnaround="vbpfixed_"+ ++this._turnaroundCounter,this.D0.chartApi().modifyStudy(this._studyId,this._turnaround,b,function(a){d.onData(a)})):(this._studyId=TradingView.Study.makeNextStudyId(),this.D0.chartApi().createStudy(this._studyId,this._turnaround,this.D0.mainSeries()._seriesId,this._metaInfo.id+"-1!",b,function(a){d.onData(a)}))}};
|
|
TradingView.LineToolVbPFixed.prototype.onData=function(a){"data_update"===a.method&&a.params.customId==="pointset_"+this._currentPointsetId?(R47.prototype.onData.call(this,a),2==this._points.size()&&this._requestStudy()):"data_update"===a.method&&a.params.customId===this._studyId&&this._checkTurnaround(a.params.turnaround)&&(a.params.nonseries.d=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"",this._processPlotOffsets(a.params),this._mergeData(a.params.plots),""!==
|
|
a.params.nonseries.d&&(this._graphics.process(a.params.nonseries),this._correctPoints(this._graphics.graphics())),0<a.params.nonseries.indexes.length&&(this._indexes=a.params.nonseries.indexes),this.updateAllViews(),this.D0.updateSource(this))};
|
|
TradingView.LineToolVbPFixed.prototype._correctPoints=function(a){if(a&&(void 0===a.indexes||0!==a.indexes.length)){a=a.hhists["0"].data;for(var b=null,c=null,d=0;d<a.length;++d){var e=a[d].priceLow,f=a[d].priceHigh;if(!b||e<b)b=e;if(!c||f>c)c=f}this._points.item(0).price=c;this._points.item(1).price=b}};TradingView.LineToolVbPFixed.prototype.calcIsActualSymbol=function(){this._isActualSymbol=!0};TradingView.LineToolVbPFixed.prototype.formatter=function(){return this._formatter};
|
|
TradingView.LineToolVbPFixed.prototype.isSelfColorerPlot=function(a){return TradingView.Study.isSelfColorerPlot(this,a)};TradingView.LineToolVbPFixed.prototype.offset=function(a){return TradingView.Study.offset(this,a)};TradingView.LineToolVbPFixed.prototype.data=function(){return this.m_data};TradingView.LineToolVbPFixed.prototype._processPlotOffsets=function(a){TradingView.Study.processPlotOffsets(this,a)};TradingView.LineToolVbPFixed.prototype._mergeData=function(a){this.m_data.merge(a)};R9=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(R9,J90);R9.prototype._formatInTicks=function(a){var b=this.D0.mainSeries().base();return Math.round(a*b)};R9.INDEX_ENTRY=0;R9.INDEX_CLOSE=1;R9.INDEX_ACTUALENTRY=2;
|
|
R9.INDEX_ACTUALCLOSE=3;R9.prototype.isLabelVisible=function(){return this.isHoveredSource()||this.isSelectedSource()};
|
|
R9.prototype.update=function(){J90.prototype.update.call(this);this._profitLevel=this._stopLevel=null;var a=this.D0.timeScale(),b=this.R99.priceScale();if(b&&!b.isEmpty()&&!a.isEmpty()&&0!==this.R99.points().size()&&0!==this._points.size()&&this.D0.mainSeries().bars().last()&&!(2>this.R99.points().size())&&0!==this.D0.mainSeries().bars().size()){this._isClosed=4==this.R99.points().size();var c;if(this._isClosed){a=
|
|
this.R99.points().item(R9.INDEX_ACTUALCLOSE).price;if(this.R99.points().item(R9.INDEX_ACTUALCLOSE).index<parseInt(this.R99.D0.mainSeries().bars().first()))return;c=Math.min(parseInt(this.R99.D0.mainSeries().bars().last()),this.R99.points().item(R9.INDEX_ACTUALCLOSE).index)}else{if(this.R99.points().item(R9.INDEX_CLOSE).index<parseInt(this.R99.D0.mainSeries().bars().first()))return;
|
|
c=Math.min(parseInt(this.R99.D0.mainSeries().bars().last()),this.R99.points().item(R9.INDEX_CLOSE).index);a=this.D0.mainSeries().bars().valueAt(c)[TradingView.CLOSE_PLOT]}this._closeBar=this.R99.D0.timeScale().indexToCoordinate(c);var d=this.R99.priceScale(),e=this.R99.stopPrice(),f=this.R99.profitPrice();this._pl=1<this.R99.points().size()?this.R99.calculatePL(a):0;if(d.isPercent())var g=this.R99.ownerSource().firstValue(),
|
|
e=d.priceRange().convertToPercent(e,g),f=d.priceRange().convertToPercent(f,g),a=d.priceRange().convertToPercent(a,g);this._entryLevel=this._points.item(R9.INDEX_ENTRY).y;this._stopLevel=b.priceToCoordinate(e);this._profitLevel=b.priceToCoordinate(f);this._closeLevel=b.priceToCoordinate(a);this._closeBar=this.R99.D0.timeScale().indexToCoordinate(c)}};
|
|
R9.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size()||2>this.R99.points().size())return a;var b=this,c=this.R99.properties();this.D0.timeScale();var d=this._points.item(R9.INDEX_ENTRY).x,e=this._points.item(R9.INDEX_ACTUALENTRY)?this._points.item(R9.INDEX_ACTUALENTRY).x:this._points.item(R9.INDEX_CLOSE).x,
|
|
f=this._points.item(R9.INDEX_ACTUALCLOSE)?this._points.item(R9.INDEX_ACTUALCLOSE).x:this._points.item(R9.INDEX_CLOSE).x,g=this._points.item(R9.INDEX_CLOSE).x,h,k=new MathEx.Point(d,this._entryLevel);h=new MathEx.Point(g,this._stopLevel);var l={};l.points=(new List).append(k).append(h);l.color="white";l.linewidth=0;l.backcolor=c.stopBackground.value();l.fillBackground=!0;l.transparency=c.stopBackgroundTransparency.value();
|
|
a.append(new TradingView.RectangleRenderer(l,new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT),new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)));if(0>this._pl){k=new MathEx.Point(e,this._entryLevel);h=new MathEx.Point(f,this._closeLevel);l={};l.points=(new List).append(k).append(h);l.color="white";l.linewidth=0;l.backcolor=c.stopBackground.value();l.fillBackground=!0;var m=.01*c.stopBackgroundTransparency.value();l.transparency=100-100*(1-m*m*m);a.append(new TradingView.RectangleRenderer(l,
|
|
new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT),new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)))}k=new MathEx.Point(d,this._entryLevel);h=new MathEx.Point(g,this._profitLevel);l={};l.points=(new List).append(k).append(h);l.color="white";l.linewidth=0;l.backcolor=c.profitBackground.value();l.fillBackground=!0;l.transparency=c.profitBackgroundTransparency.value();a.append(new TradingView.RectangleRenderer(l,new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT),
|
|
new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)));0<this._pl&&(k=new MathEx.Point(e,this._entryLevel),h=new MathEx.Point(f,this._closeLevel),l={},l.points=(new List).append(k).append(h),l.color="white",l.linewidth=0,l.backcolor=c.profitBackground.value(),l.fillBackground=!0,m=.01*c.profitBackgroundTransparency.value(),l.transparency=100-100*(1-m*m*m),a.append(new TradingView.RectangleRenderer(l,new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT),new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT))));
|
|
e=function(c,d,e){var f={};f.points=(new List).append(c).append(d);f.width=b.D0.timeScale().width();f.height=b.R99.priceScale().height();f.color=e?e:b.R99.properties().linecolor.value();f.linewidth=b.R99.properties().linewidth.value();f.linestyle=CanvasEx.LINESTYLE_SOLID;f.extendleft=!1;f.extendright=!1;f.leftend=R47.LINEEND_NORMAL;f.rightend=R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(f))};this._points.item(R9.INDEX_ACTUALENTRY)&&
|
|
(k=this._points.item(R9.INDEX_ACTUALENTRY),h=this._isClosed?this._points.item(R9.INDEX_ACTUALCLOSE):new MathEx.Point(this._closeBar,this._closeLevel),l={},l.points=(new List).append(k).append(h),l.width=b.D0.timeScale().width(),l.height=b.R99.priceScale().height(),l.color=b.R99.properties().linecolor.value(),l.linewidth=1,l.linestyle=CanvasEx.LINESTYLE_DASHED,l.extendleft=!1,l.extendright=!1,l.leftend=R47.LINEEND_NORMAL,
|
|
l.rightend=R47.LINEEND_ARROW,a.append(new TradingView.TrendLineRenderer(l)));b=this;l=function(d,e,f,g,h,k){if(b.isLabelVisible()||TradingView.printing){var l={};l.points=(new List).append(d);l.text=e;l.color=c.textcolor.value();l.font=c.font.value();l.offsetX=3;l.offsetY=h;l.vertAlign=g;l.horzAlign="center";l.backgroundRoundRect=4;l.backgroundColor=f;l.fontsize=c.fontsize.value();l.backgroundHorzInflate=4;l.backgroundVertInflate=2;k&&(l.borderColor=k);a.append(new TextRenderer(l,
|
|
b._rendererCache))}};f=this.R99.entryPrice();m=this.R99.stopPrice();h=this.R99.profitPrice();var n=Math.abs(m-f),p=Math.round(1E4*n/f)/100,r=Math.abs(h-f),t=Math.round(1E4*r/f)/100,v=Math.abs(f-h)/Math.abs(f-m),k=new MathEx.Point(d,this._points.item(R9.INDEX_ENTRY).y);h=new MathEx.Point(g,this._points.item(R9.INDEX_ENTRY).y);e(k,h);h=new MathEx.Point((d+g)/2,Math.round(this._points.item(0).y)+.5);k="";this._points.item(1)&&void 0!==
|
|
this._pl&&(k=this._isClosed?" "+$.t("Closed",{context:"line_tool_position"}):$.t("Open",{context:"line_tool_position"}),k=$.t("{0} P&L: {1}").format(k,this.R99.priceScale().formatter().format(this._pl))+"\n");k+=$.t("Risk/Reward Ratio: {0}").format(Math.round(100*v)/100)+" ";v=c.linecolor.value();0>this._pl?v=c.stopBackground.value():0<this._pl&&(v=c.profitBackground.value());l(h,k,v,"middle",0,"white");k=new MathEx.Point(d,this._stopLevel);h=new MathEx.Point(g,this._stopLevel);e(k,h,c.stopBackground.value());
|
|
h=new MathEx.Point((d+g)/2,this._stopLevel);k=$.t("Stop: {0} ({1}%)").format(this.R99.priceScale().formatter().format(n),p);l(h,k,c.stopBackground.value(),f<m?"bottom":"top",f<m?-12:-1);k=new MathEx.Point(d,this._profitLevel);h=new MathEx.Point(g,this._profitLevel);e(k,h,c.profitBackground.value());h=new MathEx.Point((d+g)/2,this._profitLevel);k=$.t("Target: {0} ({1}%)").format(this.R99.priceScale().formatter().format(r),t);l(h,k,c.profitBackground.value(),f<m?"top":"bottom",f<m?-1:-12);this.isAnchorsRequired()&&
|
|
(e=this._points.item(0).clone(),e.data=0,l=new MathEx.Point(d,this._stopLevel),l.data=1,d=new MathEx.Point(d,this._profitLevel),d.data=2,g=new MathEx.Point(g,e.y),g.data=3,a.append(this.createLineAnchor({points:[e,l,d,g]})));return a};TradingView.LineToolRiskRewardPriceAxisView=function(a,b,c,d){this.R99=a;this.D0=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14;this._pricePropName=c;this._colorPropName=d};
|
|
inherit(TradingView.LineToolRiskRewardPriceAxisView,PriceAxisView);
|
|
TradingView.LineToolRiskRewardPriceAxisView.prototype.update=function(){if(0!==this.R99.points().size()&&this.R99.priceScale()&&!this.R99.priceScale().isEmpty()){var a=this.R99.properties()[this._pricePropName].value();this._background=this.R99.properties()[this._colorPropName].value();this._coordinate=this.R99.priceScale().priceToCoordinate(a);this._textHeight=this.R99.priceScale().m_markBuilder.fontHeight();this._text=this.R99.priceScale()?this.R99.priceScale().formatter().format(a):
|
|
""}};TradingView.LineToolRiskRewardPriceAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new TradingView.PriceAxisViewRenderer(a)};
|
|
TradingView.LineToolRiskReward=function(a,b){var c=b?b:new J52("linetoolriskreward");R47.call(this,a,new R9(this,a),c);this.D2.addExclusion&&(this.D2.addExclusion("stopLevel"),this.D2.addExclusion("profitLevel"));if(!b.stopLevel&&!b.profitLevel){var d=a.timeScale().visibleBars(),e=d.firstBar(),d=d.lastBar(),f=a.mainSeries().priceRange(e,d),e=a.mainSeries().priceScale();e.isLog()&&(d=e.logicalToPrice(f.minValue()),
|
|
f=e.logicalToPrice(f.maxValue()),f=new PriceRange(d,f));if(e.isPercent())var g=a.mainSeries().firstValue(),d=e.priceRange().convertFromPercent(f.minValue(),g),f=e.priceRange().convertFromPercent(f.maxValue(),g),f=new PriceRange(d,f);f&&!f.isEmpty()&&(e=Math.round(.2*f.length()*a.mainSeries().base()),c.merge({stopLevel:e,profitLevel:e}))}var h=this;c.stopLevel.listeners().subscribe(this,TradingView.LineToolRiskReward.prototype.recalculate);c.stopLevel.listeners().subscribe(null,function(){h.properties().stopPrice._listeners.fire(h.properties().stopPrice)});
|
|
c.profitLevel.listeners().subscribe(this,TradingView.LineToolRiskReward.prototype.recalculate);c.profitLevel.listeners().subscribe(null,function(){h.properties().targetPrice._listeners.fire(h.properties().targetPrice)});c.addProperty("entryPrice");c.entryPrice=new TradingView.LineToolRiskReward.PriceProperty(this,0);c.addProperty("stopPrice");c.stopPrice=new TradingView.LineToolRiskReward.StopPriceProperty(this);c.addProperty("targetPrice");c.targetPrice=new TradingView.LineToolRiskReward.TargetPriceProperty(this);
|
|
this._entryPriceAxisView=new TradingView.LineToolRiskRewardPriceAxisView(this,a,"entryPrice","linecolor");this._stopPriceAxisView=new TradingView.LineToolRiskRewardPriceAxisView(this,a,"stopPrice","stopBackground");this._profitPriceAxisView=new TradingView.LineToolRiskRewardPriceAxisView(this,a,"targetPrice","profitBackground");this.version=TradingView.LineToolRiskReward.version};inherit(TradingView.LineToolRiskReward,R47);TradingView.LineToolRiskReward.version=2;
|
|
TradingView.LineToolRiskReward.prototype.migrateVersion=function(a,b,c){1==a&&1<=this._points.size()&&(a=new List,a.append(this._points.item(0)),b=this._points.item(0),b={price:b.price,index:b.index+50},a.append(b),this._points.item(1)&&a.append(this._points.item(1)),this._points.item(2)&&a.append(this._points.item(2)),this._points=a,1<=this._timePoint.size()&&(c=new List,b=this._timePoint.item(0),c.append(b),c.append({price:b.price,time_t:b.time_t,offset:b.offset+50}),this._timePoint.item(1)&&a.append(this._points.item(1)),
|
|
this._timePoint.item(2)&&a.append(this._points.item(2)),this._timePoint=c))};TradingView.LineToolRiskReward.prototype.checkAlert=function(){this.recalculate()};TradingView.LineToolRiskReward.prototype.priceAxisViews=function(a,b){return this._isActualSymbol&&b===this.priceScale()&&this.D0.paneForSource(this)===a?[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]:null};
|
|
TradingView.LineToolRiskReward.prototype.updateAllViews=function(){!this._isActualSymbol||!this.D2.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled()||(R47.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update())};
|
|
TradingView.LineToolRiskReward.prototype.setPoint=function(a,b){var c=this.priceScale(),d;c.isPercent()&&(d=this.ownerSource().firstValue(),b.price=c.priceRange().convertFromPercent(b.price,d));switch(a){case 0:b.price=this._roundPrice(b.price);c.isPercent()&&(b.price=c.priceRange().convertToPercent(b.price,d));R47.prototype.setPoint.call(this,a,b);this.recalculate();break;case 1:this.properties().stopPrice.setValue(this.preparseStopPrice(b.price));break;case 2:this.properties().targetPrice.setValue(this.preparseProfitPrice(b.price));
|
|
break;case 3:b.price=this._roundPrice(b.price),c.isPercent()&&(b.price=c.priceRange().convertToPercent(b.price,d)),R47.prototype.setPoint.call(this,1,b),this.recalculate()}};TradingView.LineToolRiskReward.PriceProperty=function(a,b){R47.PointPriceProperty.call(this,a,b)};inherit(TradingView.LineToolRiskReward.PriceProperty,R47.PointPriceProperty);
|
|
TradingView.LineToolRiskReward.PriceProperty.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.price=parseFloat(a);this._lineSource.setPoint(this._pointIndex,b);this._lineSource.recalculate();this._lineSource.D0.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging()};TradingView.LineToolRiskReward.StopPriceProperty=function(a){TradingView.LineToolRiskReward.PriceProperty.call(this,a,1)};
|
|
inherit(TradingView.LineToolRiskReward.StopPriceProperty,TradingView.LineToolRiskReward.PriceProperty);TradingView.LineToolRiskReward.StopPriceProperty.prototype.value=function(){var a=this._lineSource.stopPrice();return parseFloat(this._lineSource.priceScale().formatter().format(a))};
|
|
TradingView.LineToolRiskReward.StopPriceProperty.prototype.setValue=function(a){a=Math.round(Math.abs(a-this._lineSource.entryPrice())*this._lineSource.D0.mainSeries().base());this._lineSource.properties().stopLevel.setValue(a);this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)};TradingView.LineToolRiskReward.TargetPriceProperty=function(a){TradingView.LineToolRiskReward.PriceProperty.call(this,a,2)};
|
|
inherit(TradingView.LineToolRiskReward.TargetPriceProperty,TradingView.LineToolRiskReward.PriceProperty);TradingView.LineToolRiskReward.TargetPriceProperty.prototype.value=function(){var a=this._lineSource.profitPrice();return parseFloat(this._lineSource.priceScale().formatter().format(a))};
|
|
TradingView.LineToolRiskReward.TargetPriceProperty.prototype.setValue=function(a){a=Math.round(Math.abs(a-this._lineSource.entryPrice())*this._lineSource.D0.mainSeries().base());this._lineSource.properties().profitLevel.setValue(a);this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)};TradingView.LineToolRiskReward.prototype.pointsCount=function(){return 1};TradingView.LineToolRiskReward.prototype.title=function(){return"Risk/Reward"};
|
|
TradingView.LineToolRiskReward.prototype.addPoint=function(a){var b=this.priceScale();if(b.isPercent()){var c=this.ownerSource().firstValue();a.price=b.priceRange().convertFromPercent(a.price,c)}a.price=this._roundPrice(a.price);this._points.append(a);b={price:a.price,index:a.index+50};this._points.append(b);if(a=this.calculateActualEntry(a,b))this._points.append(a),(b=this.findClosePoint(a,b))&&this._points.append(b);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};
|
|
TradingView.LineToolRiskReward.prototype._roundPrice=function(a){var b=this.D0.mainSeries().base();return Math.round(a*b)/b};
|
|
TradingView.LineToolRiskReward.prototype.recalculate=function(){if(this.properties().interval.value()==this.D0.mainSeries().interval()&&0!==this.points().size()){var a=this.properties().targetPrice.value(),b=this.properties().stopPrice.value(),c=new List;c.append(this._points.item(0));c.append(this._points.item(1));var d=this.calculateActualEntry(this.points().item(0),this.points().item(1));d&&(c.append(d),(d=this.findClosePoint(d,this.points().item(1)))&&c.append(d));this._points=c;a!==this.properties().targetPrice.value()&&
|
|
this.properties().targetPrice._listeners.fire(this.properties().targetPrice);b!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice)}};TradingView.LineToolRiskReward.prototype.startMoving=function(a){a.price=this._roundPrice(a.price);R47.prototype.startMoving.call(this,a)};
|
|
TradingView.LineToolRiskReward.prototype.move=function(a){a.price=this._roundPrice(a.price);R47.prototype.move.call(this,a);this.recalculate();this._entryPriceAxisView.update()};TradingView.LineToolRiskReward.prototype.correctPoints=function(a){R47.prototype.correctPoints.call(this,(new List).append(a.item(0)).append(a.item(1)))};TradingView.LineToolRiskReward.prototype.entryPrice=function(){return this.points().item(0).price};
|
|
TradingView.LineToolRiskReward.prototype.findClosePoint=function(a,b){for(var c=this.D0.mainSeries().bars(),d=parseInt(c.first(),10),e=Math.max(a.index,d),d=parseInt(c.last(),10);e<=Math.min(d,b.index);e++){var f=c.valueAt(e),f=this.checkStopPrice(f);if(null!=f)return{index:e,price:f}}return null};
|
|
TradingView.LineToolRiskReward.prototype.calculateActualEntry=function(a,b){for(var c=this.D0.mainSeries().bars(),d=parseInt(c.first(),10),e=Math.max(a.index,d),d=a.price,f=parseInt(c.last(),10);e<=Math.min(f,b.index);e++){var g=c.valueAt(e);if(g[TradingView.HIGH_PLOT]>=d&&g[TradingView.LOW_PLOT]<=d)return{index:e,price:d}}return null};
|
|
TradingView.LineToolRiskRewardShort=function(a,b){this._constructor="LineToolRiskRewardShort";var c=b?b:new J52("linetoolriskrewardshort");TradingView.LineToolRiskReward.call(this,a,c)};inherit(TradingView.LineToolRiskRewardShort,TradingView.LineToolRiskReward);TradingView.LineToolRiskRewardShort.prototype.title=function(){return"Risk/Reward short"};
|
|
TradingView.LineToolRiskRewardShort.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardShort.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardShort.prototype.calculatePL=function(a){return this.entryPrice()-a};
|
|
TradingView.LineToolRiskRewardShort.prototype.preparseStopPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()+1/this.D0.mainSeries().base();return Math.max(a,b)};TradingView.LineToolRiskRewardShort.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()-1/this.D0.mainSeries().base();return Math.min(a,b)};
|
|
TradingView.LineToolRiskRewardShort.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[TradingView.HIGH_PLOT]>=b?this.stopPrice():a[TradingView.LOW_PLOT]<=c?this.profitPrice():null};TradingView.LineToolRiskRewardLong=function(a,b){this._constructor="LineToolRiskRewardLong";var c=b?b:new J52("linetoolriskrewardlong");TradingView.LineToolRiskReward.call(this,a,c)};inherit(TradingView.LineToolRiskRewardLong,TradingView.LineToolRiskReward);
|
|
TradingView.LineToolRiskRewardLong.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardLong.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this.D0.mainSeries().base()};TradingView.LineToolRiskRewardLong.prototype.calculatePL=function(a){return a-this.entryPrice()};
|
|
TradingView.LineToolRiskRewardLong.prototype.preparseStopPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()-1/this.D0.mainSeries().base();return Math.min(a,b)};TradingView.LineToolRiskRewardLong.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()+1/this.D0.mainSeries().base();return Math.max(a,b)};
|
|
TradingView.LineToolRiskRewardLong.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[TradingView.LOW_PLOT]<=b?this.stopPrice():a[TradingView.HIGH_PLOT]>=c?this.profitPrice():null};TradingView.LineToolRiskRewardLong.prototype.title=function(){return"Risk/Reward long"};J99=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J99,J90);
|
|
J99.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.R99.properties(),b=new TradingView.CompositeRenderer,c=new List;c.append(this._points.item(0));c.append(this._points.item(1));c.append(3>this._points.size()?this._points.item(1):this._points.item(2));var d=this,e=function(b,c){return{points:(new List).append(b),text:c,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),
|
|
italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:d.R99.properties().color.value(),backgroundRoundRect:4}},f=function(a,b){return{points:(new List).append(a).append(b),width:d.D0.timeScale().width(),height:d.R99.priceScale().height(),color:d.R99.properties().color.value(),linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL}},g={};
|
|
g.points=c;g.color=a.color.value();g.linewidth=a.linewidth.value();g.backcolor=a.backgroundColor.value();g.fillBackground=a.fillBackground.value();g.transparency=a.transparency.value();b.append(new TradingView.TriangleRenderer(g));3<this._points.size()&&(c=new List,c.append(this._points.item(2)),c.append(this._points.item(3)),c.append(5==this._points.size()?this._points.item(4):this._points.item(3)),g={},g.points=c,g.color=a.color.value(),g.linewidth=a.linewidth.value(),g.backcolor=a.backgroundColor.value(),
|
|
g.fillBackground=a.fillBackground.value(),g.transparency=a.transparency.value(),b.append(new TradingView.TriangleRenderer(g)));3<=this._points.size()&&(c=this._points.item(0).add(this._points.item(2)).scaled(.5),c=e(c,this._ABRetracement),b.append(new TextRenderer(c,this._rendererCache)));4<=this._points.size()&&(c=this._points.item(1).add(this._points.item(3)).scaled(.5),g=f(this._points.item(1),this._points.item(3)),b.append(new TradingView.TrendLineRenderer(g)),c=e(c,this._BCRetracement),b.append(new TextRenderer(c,
|
|
this._rendererCache)));5<=this._points.size()&&(c=this._points.item(2).add(this._points.item(4)).scaled(.5),c=e(c,this._CDRetracement),b.append(new TextRenderer(c,this._rendererCache)),g=f(this._points.item(0),this._points.item(4)),b.append(new TradingView.TrendLineRenderer(g)),c=this._points.item(0).add(this._points.item(4)).scaled(.5),c=e(c,this._XDRetracement),b.append(new TextRenderer(c,this._rendererCache)));c=e(this._points.item(0),"X");this._points.item(1).y>this._points.item(0).y?(c.vertAlign=
|
|
"bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5);b.append(new TextRenderer(c,this._rendererCache));c=e(this._points.item(1),"A");this._points.item(1).y<this._points.item(0).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5);b.append(new TextRenderer(c,this._rendererCache));2<this._points.size()&&(c=e(this._points.item(2),"B"),this._points.item(2).y<this._points.item(1).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));
|
|
3<this._points.size()&&(c=e(this._points.item(3),"C"),this._points.item(3).y<this._points.item(2).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));4<this._points.size()&&(c=e(this._points.item(4),"D"),this._points.item(4).y<this._points.item(3).y?(c.vertAlign="bottom",c.offsetY=-10):(c.vertAlign="top",c.offsetY=5),b.append(new TextRenderer(c,this._rendererCache)));this.addAnchors(b);return b};
|
|
J99.prototype.update=function(){J90.prototype.update.call(this);var a,b,c,d,e;3<=this.R99.points().size()&&(a=this.R99.points().item(0),b=this.R99.points().item(1),c=this.R99.points().item(2),this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3);4<=this.R99.points().size()&&(d=this.R99.points().item(3),this._BCRetracement=Math.round(1E3*Math.abs((d.price-c.price)/(c.price-b.price)))/1E3);5<=
|
|
this.R99.points().size()&&(e=this.R99.points().item(4),this._CDRetracement=Math.round(1E3*Math.abs((e.price-d.price)/(d.price-c.price)))/1E3,this._XDRetracement=Math.round(1E3*Math.abs((e.price-b.price)/(b.price-a.price)))/1E3)};TradingView.LineTool5PointsPattern=function(a,b){this._constructor="LineTool5PointsPattern";var c=b?b:new J52("linetool5pointspattern");R47.call(this,a,new J99(this,a),c)};
|
|
inherit(TradingView.LineTool5PointsPattern,R47);TradingView.LineTool5PointsPattern.prototype.pointsCount=function(){return 5};TradingView.LineTool5PointsPattern.prototype.title=function(){return"XABCD Pattern"};
|
|
TradingView.LineTool5PointsPattern.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}};
|
|
TradingView.LineTool5PointsPattern.prototype._updateTooltip=function(){var a=this._tooltipFieldsHash,b=this.points().m_values,c,d;b[0]&&(c=this.D0.timeScale().indexToUserTime(b[0].index),a.time0.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price0.value=this.D0.mainSeries()._formatter.format(b[0].price));b[1]&&(d=this.D0.timeScale().indexToUserTime(b[1].index),a.time1.value=d?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(d):
|
|
0,a.price1.value=this.D0.mainSeries()._formatter.format(b[1].price));b[2]&&(c=this.D0.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price2.value=this.D0.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D0.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price3.value=this.D0.mainSeries()._formatter.format(b[3].price));
|
|
b[4]&&(c=this.D0.timeScale().indexToUserTime(b[4].index),a.time4.value=d?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price4.value=this.D0.mainSeries()._formatter.format(b[4].price))};TradingView.LineTool5PointsPattern.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};J91=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J91,J90);
|
|
J91.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.R99.properties(),b=new TradingView.CompositeRenderer,c=this._points,d=this,e=function(b,c){return{points:(new List).append(b),text:c,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:d.R99.properties().color.value(),backgroundRoundRect:4}},
|
|
f=function(b,c,e,f){return{points:(new List).append(b).append(c),width:d.D0.timeScale().width(),height:d.R99.priceScale().height(),color:TradingView.generateColor(d.R99.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL}},g=f(c.item(0),c.item(1),0);b.append(new TradingView.TrendLineRenderer(g));3<=c.size()&&(g=
|
|
f(c.item(1),c.item(2),0),b.append(new TradingView.TrendLineRenderer(g)));4==c.size()&&(g=f(c.item(2),c.item(3),0),b.append(new TradingView.TrendLineRenderer(g)));g=e(this._points.item(0),"A");this._points.item(1).y>this._points.item(0).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5);b.append(new TextRenderer(g,this._rendererCache));g=e(this._points.item(1),"B");this._points.item(1).y<this._points.item(0).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5);
|
|
b.append(new TextRenderer(g,this._rendererCache));2<this._points.size()&&(g=e(this._points.item(2),"C"),this._points.item(2).y<this._points.item(1).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5),b.append(new TextRenderer(g,this._rendererCache)));3<this._points.size()&&(g=e(this._points.item(3),"D"),this._points.item(3).y<this._points.item(2).y?(g.vertAlign="bottom",g.offsetY=-10):(g.vertAlign="top",g.offsetY=5),b.append(new TextRenderer(g,this._rendererCache)));3<=this._points.size()&&
|
|
(c=this._points.item(0).add(this._points.item(2)).scaled(.5),g=f(this._points.item(0),this._points.item(2),70,1),b.append(new TradingView.TrendLineRenderer(g)),g=e(c,this._ABRetracement),b.append(new TextRenderer(g,this._rendererCache)));4<=this._points.size()&&(c=this._points.item(1).add(this._points.item(3)).scaled(.5),g=f(this._points.item(1),this._points.item(3),70,1),b.append(new TradingView.TrendLineRenderer(g)),g=e(c,this._CDRetracement),b.append(new TextRenderer(g,this._rendererCache)));this.addAnchors(b);
|
|
return b};
|
|
J91.prototype.update=function(){J90.prototype.update.call(this);var a,b,c;3<=this.R99.points().size()&&(a=this.R99.points().item(0),b=this.R99.points().item(1),c=this.R99.points().item(2),this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3);4==this.R99.points().size()&&(a=this.R99.points().item(3),this._CDRetracement=Math.round(1E3*Math.abs((a.price-c.price)/(c.price-b.price)))/1E3)};
|
|
TradingView.LineToolABCD=function(a,b){this._constructor="LineToolABCD";var c=b?b:new J52("linetoolabcd");R47.call(this,a,new J91(this,a),c)};inherit(TradingView.LineToolABCD,R47);TradingView.LineToolABCD.prototype.pointsCount=function(){return 4};TradingView.LineToolABCD.prototype.title=function(){return"ABCD Pattern"};
|
|
TradingView.LineToolABCD.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}};
|
|
TradingView.LineToolABCD.prototype._updateTooltip=function(){var a=this._tooltipFieldsHash,b=this.points().m_values;if(b[0]){var c=this.D0.timeScale().indexToUserTime(b[0].index);a.time0.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0;a.price0.value=this.D0.mainSeries()._formatter.format(b[0].price)}b[1]&&(c=this.D0.timeScale().indexToUserTime(b[1].index),a.time1.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):
|
|
0,a.price1.value=this.D0.mainSeries()._formatter.format(b[1].price));b[2]&&(c=this.D0.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price2.value=this.D0.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D0.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new TradingView.DateTimeFormatter(this.D0.mainSeries().isDWM())).format(c):0,a.price3.value=this.D0.mainSeries()._formatter.format(b[3].price))};
|
|
TradingView.LineToolABCD.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};J96=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(J96,J90);
|
|
J96.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);if(2>this._points.size())return null;var a=this.R99.properties(),b=new TradingView.CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:d,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.R99.properties().color.value(),
|
|
backgroundRoundRect:4}},e=function(b,d){return{points:(new List).append(b).append(d),width:c.D0.timeScale().width(),height:c.R99.priceScale().height(),color:c.R99.properties().color.value(),linewidth:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL}},f=e(this._points.item(0),this._points.item(1));b.append(new TradingView.TrendLineRenderer(f));3<=this._points.size()&&
|
|
(f=e(this._points.item(1),this._points.item(2)),b.append(new TradingView.TrendLineRenderer(f)));4==this._points.size()&&(f=e(this._points.item(2),this._points.item(3)),b.append(new TradingView.TrendLineRenderer(f)),this._intersectPoint?(e=new List,e.append(this._startPoint1),e.append(this._startPoint2),e.append(this._intersectPoint),f={},f.points=e,f.color=a.color.value(),f.linewidth=a.linewidth.value(),f.backcolor=a.backgroundColor.value(),f.fillBackground=a.fillBackground.value(),f.transparency=
|
|
a.transparency.value(),b.append(new TradingView.TriangleRenderer(f))):this._intersectPoint1&&this._intersectPoint2&&(e=new List,e.append(this._startPoint1),e.append(this._startPoint2),e.append(this._intersectPoint2),e.append(this._intersectPoint1),f={filled:!0,fillBackground:!0},f.points=e,f.color=a.color.value(),f.linewidth=a.linewidth.value(),f.backcolor=a.backgroundColor.value(),f.transparency=a.transparency.value(),b.append(new TradingView.PoligonRenderer(f))));e=d(this._points.item(0),"A");this._points.item(1).y>
|
|
this._points.item(0).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5);b.append(new TextRenderer(e,this._rendererCache));e=d(this._points.item(1),"B");this._points.item(1).y<this._points.item(0).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5);b.append(new TextRenderer(e,this._rendererCache));2<this._points.size()&&(e=d(this._points.item(2),"C"),this._points.item(2).y<this._points.item(1).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=
|
|
5),b.append(new TextRenderer(e,this._rendererCache)));3<this._points.size()&&(e=d(this._points.item(3),"D"),this._points.item(3).y<this._points.item(2).y?(e.vertAlign="bottom",e.offsetY=-10):(e.vertAlign="top",e.offsetY=5),b.append(new TextRenderer(e,this._rendererCache)));this.addAnchors(b);return b};J96.prototype.update=function(){this._invalidated=!0};
|
|
J96.prototype.updateImpl=function(){J90.prototype.update.call(this);this._valid=!1;delete this._intersectPoint;delete this._intersectPoint1;delete this._intersectPoint2;if(4==this._points.size()){var a=this._points.item(0),b=this._points.item(1),c=this._points.item(2),d=this._points.item(3);if(!(1>Math.abs(c.x-a.x)||1>Math.abs(d.x-b.x))){var e=Math.min(a.x,b.x),e=Math.min(e,c.x),e=Math.min(e,d.x),f=(c.y-a.y)/(c.x-a.x),g=a.y+(e-a.x)*
|
|
f,h=(d.y-b.y)/(d.x-b.x),k=b.y+(e-b.x)*h;if(!(1E-6>Math.abs(f-h))){this._startPoint1=new MathEx.Point(e,g);this._startPoint2=new MathEx.Point(e,k);var l=(b.y-a.y+(a.x*f-b.x*h))/(f-h);this._valid=!0;l<e&&(e=Math.max(a.x,b.x),e=Math.max(e,c.x),e=Math.max(e,d.x),g=a.y+(e-a.x)*f,k=b.y+(e-b.x)*h,this._startPoint1=new MathEx.Point(e,g),this._startPoint2=new MathEx.Point(e,k));this._intersectPoint=new MathEx.Point(l,a.y+(l-a.x)*f)}}}};
|
|
TradingView.LineToolTrianglePattern=function(a,b){this._constructor="LineToolTrianglePattern";var c=b?b:new J52("linetooltrianglepattern");R47.call(this,a,new J96(this,a),c)};inherit(TradingView.LineToolTrianglePattern,R47);TradingView.LineToolTrianglePattern.prototype.pointsCount=function(){return 4};TradingView.LineToolTrianglePattern.prototype.title=function(){return"Triangle Pattern"};J95=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J95,J90);
|
|
J95.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.R99.properties(),b=new TradingView.CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:d,color:a.textcolor.value(),vertAlign:"middle",horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.R99.properties().color.value(),backgroundRoundRect:4}},
|
|
e=function(b,d,e,f){return{points:(new List).append(b).append(d),width:c.D0.timeScale().width(),height:c.R99.priceScale().height(),color:TradingView.generateColor(c.R99.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL}},f=1;f<this._points.size();f++){var g=e(this._points.item(f-1),this._points.item(f),0);b.append(new TradingView.TrendLineRenderer(g))}this._retrace1&&
|
|
(g=e(this._points.item(1),this._points.item(3),70,1),b.append(new TradingView.TrendLineRenderer(g)),f=this._points.item(1).add(this._points.item(3)).scaled(.5),f=d(f,this._retrace1),b.append(new TextRenderer(f,this._rendererCache)));this._retrace2&&(g=e(this._points.item(3),this._points.item(5),70,1),b.append(new TradingView.TrendLineRenderer(g)),f=this._points.item(5).add(this._points.item(3)).scaled(.5),f=d(f,this._retrace2),b.append(new TextRenderer(f,this._rendererCache)));this.addAnchors(b);
|
|
return b};
|
|
J95.prototype.update=function(){J90.prototype.update.call(this);delete this._retrace1;delete this._retrace2;if(4<=this.R99.points().size()){var a=this.R99.points().item(1),b=this.R99.points().item(2),c=this.R99.points().item(3);this._retrace1=Math.round(100*Math.abs((c.price-b.price)/(b.price-a.price)))/100}6<=this.R99.points().size()&&(c=this.R99.points().item(3),a=this.R99.points().item(4),b=this.R99.points().item(5),this._retrace2=
|
|
Math.round(100*Math.abs((b.price-a.price)/(a.price-c.price)))/100)};TradingView.LineToolThreeDrivers=function(a,b){this._constructor="LineToolThreeDrivers";var c=b?b:new J52("linetoolthreedrivers");R47.call(this,a,new J95(this,a),c)};inherit(TradingView.LineToolThreeDrivers,R47);TradingView.LineToolThreeDrivers.prototype.pointsCount=function(){return 7};
|
|
TradingView.LineToolThreeDrivers.prototype.title=function(){return"Three Drivers Pattern"};J94=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J94,J90);
|
|
J94.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.R99.properties(),b=new TradingView.CompositeRenderer,c=this,d=function(b,d){return{points:(new List).append(b),text:$.t(d),color:a.textcolor.value(),horzAlign:"center",font:a.font.value(),offsetX:0,offsetY:0,bold:a.bold&&a.bold.value(),italic:a.italic&&a.italic.value(),fontsize:a.fontsize.value(),backgroundColor:c.R99.properties().color.value(),backgroundRoundRect:4}},
|
|
e=function(b,d,e,f){return{points:(new List).append(b).append(d),width:c.D0.timeScale().width(),height:c.R99.priceScale().height(),color:TradingView.generateColor(c.R99.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL}},f=function(b,c,d){var e=new List;e.append(b);e.append(c);e.append(d);b={};b.points=e;b.color=
|
|
a.color.value();b.linewidth=0;b.backcolor=a.backgroundColor.value();b.fillBackground=a.fillBackground.value();b.transparency=a.transparency.value();return b},g=1;g<this._points.size();g++){var h=e(this._points.item(g-1),this._points.item(g),0);b.append(new TradingView.TrendLineRenderer(h))}if(5<=this._points.size()){var k,l=g=!1;this._intersect1?h=this._intersect1:(h=this._points.item(2),g=!0);this._intersect2?k=this._intersect2:(k=this._points.item(4),l=!0);h=e(h,k,0);h.extendleft=g;h.extendright=
|
|
l;b.append(new TradingView.TrendLineRenderer(h));e=f(this._points.item(2),this._points.item(3),this._points.item(4));b.append(new TradingView.TriangleRenderer(e))}this._intersect1&&(e=f(this._intersect1,this._points.item(1),this._points.item(2)),b.append(new TradingView.TriangleRenderer(e)));this._intersect2&&(e=f(this._points.item(4),this._points.item(5),this._intersect2),b.append(new TradingView.TriangleRenderer(e)));2<=this._points.size()&&(f=this._points.item(1),f=d(f,"Left Shoulder"),this._points.item(1).y<
|
|
this._points.item(0).y?(f.vertAlign="bottom",f.offsetY=-10):(f.vertAlign="top",f.offsetY=5),b.append(new TextRenderer(f,this._rendererCache)));4<=this._points.size()&&(f=this._points.item(3),f=d(f,"Head"),this._points.item(3).y<this._points.item(2).y?(f.vertAlign="bottom",f.offsetY=-10):(f.vertAlign="top",f.offsetY=5),b.append(new TextRenderer(f,this._rendererCache)));6<=this._points.size()&&(f=this._points.item(5),f=d(f,"Right Shoulder"),this._points.item(5).y<this._points.item(4).y?(f.vertAlign=
|
|
"bottom",f.offsetY=-10):(f.vertAlign="top",f.offsetY=5),b.append(new TextRenderer(f,this._rendererCache)));this.addAnchors(b);return b};
|
|
J94.prototype.update=function(){J90.prototype.update.call(this);delete this._intersect1;delete this._intersect2;var a,b;if(5<=this._points.size()){var c=this._points.item(0),d=this._points.item(1);a=this._points.item(2);this._points.item(3);b=this._points.item(4);c=MathEx.intersectSegment(a,b,c,d);null!==c&&(d=b.substract(a),this._intersect1=a.add(d.scaled(c)))}7==this._points.size()&&(c=this._points.item(5),d=this._points.item(6),
|
|
c=MathEx.intersectSegment(a,b,c,d),null!==c&&(d=b.substract(a),this._intersect2=a.add(d.scaled(c))))};TradingView.LineToolHeadAndShoulders=function(a,b){this._constructor="LineToolHeadAndShoulders";var c=b?b:new J52("linetoolheadandshoulders");R47.call(this,a,new J94(this,a),c)};inherit(TradingView.LineToolHeadAndShoulders,R47);TradingView.LineToolHeadAndShoulders.prototype.pointsCount=function(){return 7};
|
|
TradingView.LineToolHeadAndShoulders.prototype.title=function(){return"Head & Shoulders"};R42=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(R42,J90);
|
|
R42.prototype.update=function(){J90.prototype.update.call(this);if(!(3>this.R99.points().size()||!this.R99.priceScale()||this.R99.priceScale().isEmpty()||this.D0.timeScale().isEmpty())){var a=this.R99.points().item(0),b=this.R99.points().item(1),c=this.R99.points().item(2);this._levels=[];if(b.index!=a.index&&(a=b.index-a.index,b=this.R99.properties(),c=c.index,!this.D0.timeScale().visibleBars().isEmpty()))for(var d=
|
|
1;11>=d;d++){var e=b["level"+d];if(e.visible.value()){var f=e.coeff.value(),g=e.color.value(),h=Math.round(c+f*a),e={x:this.D0.timeScale().indexToCoordinate(h),coeff:f,color:g,linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:d};b.showCoeffs.value()&&(e.text=f,e.y=this.R99.priceScale().height());this._levels.push(e)}}}};
|
|
R42.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.R99.properties();if(d.trendline.visible.value()){var e={points:(new List).append(b).append(c),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,
|
|
extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};a.append(new TradingView.TrendLineRenderer(e))}if(3>this._points.size())return this.addAnchors(a),a;e=this._points.item(2);d.trendline.visible.value()&&(e={points:(new List).append(c).append(e),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),
|
|
extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},a.append(new TradingView.TrendLineRenderer(e)));for(var e=d.fillBackground.value(),f=d.transparency.value(),g=0;g<this._levels.length;g++){if(0<g&&e){var b=new MathEx.Point(this._levels[g-1].x,0),c=new MathEx.Point(this._levels[g].x,this.R99.priceScale().height()),h={};h.points=(new List).append(b).append(c);h.color=this._levels[g].color;h.linewidth=0;h.backcolor=
|
|
this._levels[g].color;h.fillBackground=!0;h.transparency=f;a.append(new TradingView.RectangleRenderer(h))}if(void 0!==this._levels[g].text){var k,l,m,c=d.horzLabelsAlign.value(),c="left"==c?"right":"right"==c?"left":"center";switch(c){case "left":l=3;break;case "center":l=0;break;case "right":l=-3}switch(d.vertLabelsAlign.value()){case "top":k=new MathEx.Point(this._levels[g].x,0);m=5;break;case "middle":k=new MathEx.Point(this._levels[g].x,.5*this._levels[g].y);m=0;break;case "bottom":k=new MathEx.Point(this._levels[g].x,
|
|
this._levels[g].y),m=-10}c={points:(new List).append(k),text:""+this._levels[g].text,color:this._levels[g].color,vertAlign:"middle",horzAlign:c,font:d.font.value(),offsetX:l,offsetY:m,fontsize:12};a.append(new TextRenderer(c,this._rendererCache))}c={};c.points=(new List).append(new MathEx.Point(this._levels[g].x,0));c.color=this._levels[g].color;c.linewidth=this._levels[g].linewidth;c.linestyle=this._levels[g].linestyle;b=new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,null,this._levels[g].index);
|
|
a.append(new TradingView.VertLineRenderer(c,b))}this.addAnchors(a);return a};TradingView.LineToolTrendBasedFibTime=function(a,b){this._constructor="LineToolTrendBasedFibTime";var c=b?b:new J52("linetooltrendbasedfibtime");R47.call(this,a,new R42(this,a),c);this.version=TradingView.LineToolTrendBasedFibTime.version};inherit(TradingView.LineToolTrendBasedFibTime,R47);
|
|
TradingView.LineToolTrendBasedFibTime.version=1;TradingView.LineToolTrendBasedFibTime.prototype.pointsCount=function(){return 3};TradingView.LineToolTrendBasedFibTime.prototype.title=function(){return"Trend-Based Fib Time"};TradingView.LineToolTrendBasedFibTime.prototype.migrateVersion=function(a,b,c){};TradingView.LineToolTrendBasedFibTime.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.GannArcRenderer=function(a){this._data=a};
|
|
TradingView.GannArcRenderer.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;a.translate(this._data.center.x,this._data.center.y);var b=this._data.edge.substract(this._data.center),b=b.y/b.x,c=this._data.point.substract(this._data.center);c.y/=b;var c=c.length(),d=this._data.prevPoint.substract(this._data.center);d.y/=b;d=d.length();a.scale(1,b);this._data.fillBack&&(this._data.point.x<this._data.center.x&&(c=-c,d=-d),a.beginPath(),a.moveTo(d,
|
|
0),a.lineTo(c,0),a.arcTo(c,c,0,c,Math.abs(c)),a.lineTo(0,d),a.arcTo(d,d,d,0,Math.abs(d)),a.fillStyle=TradingView.generateColor(this._data.color,this._data.transparency),a.fill());a.beginPath();this._data.point.x>this._data.center.x?a.arc(0,0,Math.abs(c),0,Math.PI/2,!1):a.arc(0,0,Math.abs(c),-Math.PI/2,-Math.PI,!0);a.scale(1,1/b);a.stroke()};
|
|
TradingView.GannArcRenderer.prototype.hitTest=function(a){a=a.substract(this._data.center);var b=this._data.edge.substract(this._data.center),c=b.y/b.x;a.y/=c;var d=this._data.point.substract(this._data.center);d.y/=c;var d=d.length(),e=a.length(),f=this._data.prevPoint.substract(this._data.center);f.y/=c;c=f.length();return 5>Math.abs(e-d)&&0<=b.x*a.x&&0<=b.y*a.y?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):this._data.fillBack&&e>=c&&e<=d&&0<=b.x*a.x&&0<=b.y*a.y?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT_BACKGROUND):
|
|
null};J80=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(J80,J90);J80.prototype.update=function(){J90.prototype.update.call(this);this.R99._cornerPoint&&this._points.append(this.R99.pointToScreenPoint(this.R99._cornerPoint)[0])};
|
|
J80.prototype.renderer=function(){var a=this.R99.properties(),b=new TradingView.CompositeRenderer;if(2>this._points.size())return this.addAnchors(b),b;for(var c=this._points.item(0),d=3==this._points.size()?this._points.item(2):this._points.item(1),e=this._points.item(1),f,g,h=0;6>h;h++){var k=a.levels[h];if(k.visible.value()){var l=h/5;f=c.x+l*(d.x-c.x);g=c.y;var m=d.y;f={points:(new List).append(new MathEx.Point(f,g)).append(new MathEx.Point(f,m)),width:this.D0.timeScale().width(),
|
|
height:this.R99.priceScale().height(),color:k.color.value(),linewidth:k.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};b.append(new TradingView.TrendLineRenderer(f));g=c.y+l*(d.y-c.y);f=c.x;l=d.x;f={points:(new List).append(new MathEx.Point(f,g)).append(new MathEx.Point(l,g)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:k.color.value(),
|
|
linewidth:k.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};b.append(new TradingView.TrendLineRenderer(f))}}for(h in a.fanlines._childs)m=a.fanlines[h],m.visible.value()&&(k=m.x.value(),l=m.y.value(),k>l?(f=d.x,l/=k,g=c.y+l*(d.y-c.y)):(g=d.y,l=k/l,f=c.x+l*(d.x-c.x)),f={points:(new List).append(c).append(new MathEx.Point(f,g)),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),
|
|
color:m.color.value(),linewidth:m.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},b.append(new TradingView.TrendLineRenderer(f)));m=c;for(h in a.arcs._childs){var n=a.arcs[h];n.visible.value()&&(k=n.x.value()/5,l=n.y.value()/5,f=c.x+k*(d.x-c.x),g=c.y+l*(d.y-c.y),(new MathEx.Point(f,g)).substract(c).length(),f={center:c,point:new MathEx.Point(f,g),edge:d,color:n.color.value(),
|
|
linewidth:n.width.value(),fillBack:a.arcsBackground.fillBackground.value(),transparency:a.arcsBackground.transparency.value(),prevPoint:m},b.append(new TradingView.GannArcRenderer(f)),m=f.point)}this.isAnchorsRequired()&&(a=[c,e],this.D0.lineBeingCreated()==this.R99&&a.pop(),b.append(this.createLineAnchor({points:a})));return b};
|
|
TradingView.LineToolGannComplex=function(a,b){this._constructor="LineToolGannComplex";var c=b?b:new J52("linetoolganncomplex");R47.call(this,a,new J80(this,a),c)};inherit(TradingView.LineToolGannComplex,R47);
|
|
TradingView.LineToolGannComplex.prototype._recalcSecondPoint=function(){var a=this.D0.mainSeries().properties().style.value(),b=this.D0.mainSeries().interval();if(a!==this._currentStyle||b!==this._currentInterval)a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(2))[0].substract(a),a=a.add(b.scaled(.2/Math.sqrt(2))),a=this.screenPointToPoint(a),this._points.setItem(1,a)};TradingView.LineToolGannComplex.prototype.pointsCount=function(){return 2};
|
|
TradingView.LineToolGannComplex.prototype.title=function(){return"Gann Square"};TradingView.LineToolGannComplex.prototype._fixThirdPoint=function(a){if(!(2>this.points().size())){var b=this.pointToScreenPoint(this.points().item(0))[0],c=this.pointToScreenPoint(this.points().item(1))[0],d=c.substract(b);a?b=b.add(d.scaled(5*Math.sqrt(2))):(a=0>d.x?-1:1,d=0>d.y?-1:1,c=c.substract(b).length(),b=b.add(new MathEx.Point(5*c*a,5*c*d)));this._cornerPoint=this.screenPointToPoint(b)}};
|
|
TradingView.LineToolGannComplex.prototype.setPoint=function(a,b,c){a=R47.prototype.setPoint.call(this,a,b,c);this._fixThirdPoint(c&&c.shift);this._points.setItem(2,this._cornerPoint);delete this._cornerPoint;c=this.D0.mainSeries().properties().style.value();b=this.D0.mainSeries().interval();this._currentStyle=c;this._currentInterval=b;return a};
|
|
TradingView.LineToolGannComplex.prototype.setLastPoint=function(a,b){var c=R47.prototype.setLastPoint.call(this,a,b);this._fixThirdPoint(b&&b.shift);return c};
|
|
TradingView.LineToolGannComplex.prototype.addPoint=function(a,b){var c=this.D0.mainSeries().properties().style.value(),d=this.D0.mainSeries().interval();this._currentStyle=c;this._currentInterval=d;c=this.priceScale();c.isPercent()&&(d=this.ownerSource().firstValue(),a.price=c.priceRange().convertFromPercent(a.price,d));c=b&&b.shift;this._points.append(a);this._lastPoint=null;(d=this._points.size()==this.pointsCount())?(this._fixThirdPoint(c),this._points.append(this._cornerPoint),delete this._cornerPoint,
|
|
this.normalizePoints(),this.createServerPoints()):this._lastPoint=a;return d};TradingView.LineToolGannComplex.prototype.onData=function(a){R47.prototype.onData.call(this,a);this._recalcSecondPoint()};TradingView.FibChannelLabelsCache=function(){TradingView.LevelledLineToolLabelsCache.call(this)};inherit(TradingView.FibChannelLabelsCache,TradingView.LevelledLineToolLabelsCache);TradingView.FibChannelLabelsCache.prototype.levelsCount=function(){return TradingView.LineToolFibChannel.LevelsCount};J70=function(a,b){J90.call(this,a,b);this._rendererCache={};this._invalidated=!0};inherit(J70,J90);
|
|
J70.prototype.update=function(){this._invalidated=!0};J70.prototype._updateImpl=function(){J90.prototype.update.call(this);this._cacheState=this.D0._fibChannelLabelsCache.updateSource(this.R99);3>this._points.size()||3>this.R99.points().size()||(this._points.item(0),this._points.item(1),this._points.item(2),this.norm=this._points.item(2).substract(this._points.item(0)))};
|
|
J70.prototype.renderer=function(){function a(a,d,e){var k;switch(c.horzLabelsAlign.value()){case "left":k=a;break;case "center":k=a.add(d).scaled(.5);k.x+=e.width/2;k.x=Math.round(k.x);break;case "right":k=d.clone(),k.x+=e.width,k.x=Math.round(k.x)}a={left:e.left,top:f.topByRow(h._cacheState.row),width:e.width,height:f.rowHeight(h._cacheState.row)};e={left:Math.round(k.x-a.width),top:Math.round(k.y),width:e.width,height:a.height};k=c.vertLabelsAlign.value();"middle"==k&&
|
|
(e.top-=e.height/2);"bottom"==k&&(e.top-=e.height);e=new TradingView.PaneRendererCachedImage(g,a,e);b.append(e)}this._invalidated&&(this._updateImpl(),this._invalidated=!1);var b=new TradingView.CompositeRenderer;if(2>this._points.size())return this.addAnchors(b),b;var c=this.R99.properties(),d=this._points.item(0),e=this._points.item(1);if(3>this._points.size())return d={points:(new List).append(d).append(e),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:c.level1.color.value(),
|
|
linewidth:c.levelsStyle.linewidth.value(),linestyle:c.levelsStyle.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},b.append(new TradingView.TrendLineRenderer(d)),this.addAnchors(b),b;for(var f=this.D0._fibChannelLabelsCache,g=f.canvas().get(0),h=this,k=1;k<TradingView.LineToolFibRetracement.LevelsCount;k++){var l=c["level"+k];if(l.visible.value()){for(var m=
|
|
null,n=k+1;n<=TradingView.LineToolFibRetracement.LevelsCount;n++){var p=c["level"+n];if(p.visible.value()){m=p;break}}if(!m)break;var p=this.norm.scaled(l.coeff.value()),n=d.add(p),p=e.add(p),r=this.norm.scaled(m.coeff.value()),m=d.add(r),r=e.add(r),t={};t.points=new List;t.points.append(n);t.points.append(p);t.points.append(m);t.points.append(r);t.color=l.color.value();t.width=this.D0.timeScale().width();t.height=this.R99.priceScale().height();t.linewidth=c.levelsStyle.linewidth.value();
|
|
t.linestyle=c.levelsStyle.linestyle.value();t.extendleft=c.extendLeft.value();t.extendright=c.extendRight.value();t.backcolor=l.color.value();t.transparency=c.transparency.value();t.skipTopLine=!0;t.fillBackground=c.fillBackground.value();t.hittestOnBackground=!0;b.append(new TradingView.ParallelChannelRenderer(t));(c.showCoeffs.value()||c.showPrices.value())&&a(n,p,this._cacheState.preparedCells.cells[k-1])}}m=null;for(k=TradingView.LineToolFibRetracement.LevelsCount;1<=k;k--)if(l=c["level"+k],l.visible.value()){m=
|
|
k;break}null!=m&&(l=c["level"+m],l.visible.value()&&(p=this.norm.scaled(l.coeff.value()),n=d.add(p),p=e.add(p),d={points:(new List).append(n).append(p),width:this.D0.timeScale().width(),height:this.R99.priceScale().height(),color:l.color.value(),linewidth:c.levelsStyle.linewidth.value(),linestyle:c.levelsStyle.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL},
|
|
b.append(new TradingView.TrendLineRenderer(d)),(c.showCoeffs.value()||c.showPrices.value())&&a(n,p,this._cacheState.preparedCells.cells[m-1])));this.addAnchors(b);return b};
|
|
TradingView.LineToolFibChannel=function(a,b){this._constructor="LineToolFibChannel";var c=b?b:new J52("linetoolfibchannel");R47.call(this,a,new J70(this,a),c);this.version=TradingView.LineToolFibChannel.version;a._fibChannelLabelsCache||(a._fibChannelLabelsCache=new TradingView.FibChannelLabelsCache)};inherit(TradingView.LineToolFibChannel,R47);TradingView.LineToolFibChannel.LevelsCount=24;
|
|
TradingView.LineToolFibChannel.version=2;TradingView.LineToolFibChannel.prototype.migrateVersion=function(a,b,c){c.properties.removeProperty("reverse")};TradingView.LineToolFibChannel.prototype.pointsCount=function(){return 3};TradingView.LineToolFibChannel.prototype.title=function(){return"Fib Channel"};TradingView.LineToolFibChannel.prototype.processErase=function(a,b){var c="level"+b,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};TradingView.FibSpiralRenderer=function(a){this._data=a};TradingView.FibSpiralRenderer.prototype._fibNumbers=function(){return[0,1,2,3,5,8,13,21,34,55,89]};TradingView.FibSpiralRenderer.prototype._continiusFib=function(a){var b=this._fibNumbers(),c=Math.floor(a),d=Math.ceil(a);if(d>=b.length)return null;a=Math.pow(a-c,1.15);return b[c]+(b[d]-b[c])*a};
|
|
TradingView.FibSpiralRenderer.prototype.hitTest=function(a){var b=this._data.points.item(0),c=this._data.points.item(1).substract(b),b=a.substract(b);a=c.normalized();var d=a.transponed(),e=b.normalized();a=Math.acos(a.dotProduct(e));0>Math.asin(d.dotProduct(e))&&(a=2*Math.PI-a);b=b.length();for(d=0;4>d;d++)if(e=this._continiusFib(a/(.5*Math.PI)+4*d),e=e*c.length()/5,null!==e&&5>Math.abs(e-b))return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);return null};
|
|
TradingView.FibSpiralRenderer.prototype.draw=function(a){a.lineCap="round";a.strokeStyle=this._data.color;var b=this._data.points.item(0),c=this._data.points.item(1);a.translate(b.x,b.y);var d=c.substract(b),b=d.length(),d=d.normalized(),c=Math.acos(d.x);0>Math.asin(d.y)&&(c=2*Math.PI-c);a.rotate(c);a.scale(b/5,b/5);a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);d=Math.PI/100;a.moveTo(0,0);for(var e=0;e<50*(this._fibNumbers().length-1);e++){var f=e*d,g=this._continiusFib(e/
|
|
50),h=Math.cos(f)*g,f=Math.sin(f)*g;a.lineTo(h,f)}a.scale(5/b,5/b);a.rotate(-c);a.stroke()};J75=function(a,b){J90.call(this,a,b)};inherit(J75,J90);
|
|
J75.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.width=this.D0.timeScale().width();b.height=this.R99.priceScale().height();b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=this.R99.properties().linestyle.value();b.extendleft=!1;b.extendright=!0;b.leftend=R47.LINEEND_NORMAL;b.rightend=
|
|
R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(b));b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D0.timeScale().width();b.height=this.R99.priceScale().height();b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=this.R99.properties().linestyle.value();a.append(new TradingView.FibSpiralRenderer(b));this.isAnchorsRequired()&&(a.append(new TradingView.TrendLineRenderer(b)),
|
|
this.addAnchors(a));return a};TradingView.LineToolFibSpiral=function(a,b){this._constructor="LineToolFibSpiral";var c=b?b:new J52("linetoolfibspiral");R47.call(this,a,new J75(this,a),c)};inherit(TradingView.LineToolFibSpiral,R47);TradingView.LineToolFibSpiral.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpiral.prototype.title=function(){return"Fib Spiral"};J67=function(a,b){J90.call(this,a,b);this._label=null;this._rendererCache={}};inherit(J67,J90);
|
|
J67.prototype.update=function(){J90.prototype.update.call(this);this._label=null;if(!(2>this.R99.points().size())&&this.R99.priceScale()){var a=this.R99.points().item(0),b=this.R99.points().item(1);this._price1=this.R99.priceScale().formatter().format(a.price);this._price2=this.R99.priceScale().formatter().format(b.price);if(3==this.R99.points().size()){var c=this.R99.points().item(2);this._price3=this.R99.priceScale().formatter().format(c.price);
|
|
a=b.price-a.price;this._price4=this.R99.priceScale().formatter().format(c.price+a)}}};
|
|
J67.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.R99.properties(),e=this.D0,f=this.R99,d=f.properties(),g,h;if(3<=this._points.size()){g=this._points.item(2);g.x=c.x;var k=c.y-b.y;h=b.clone();h.y=g.y+k;h.data=3;if(d.fillBackground.value()){var l={},k=e.timeScale().width();f.priceScale().height();var m=d.extendLeft.value(),n=d.extendRight.value();
|
|
m||n?!m&&n?(l={},l.width=k,l.p1=b,l.p2=c,l.p3=h,l.p4=g,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(l))):m&&!n?(l={},l.width=k,l.p1=c,l.p2=b,l.p3=g,l.p4=h,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(l))):(l=b.add(c).scaled(.5),m=h.add(g).scaled(.5),n={},n.width=k,n.p1=
|
|
l,n.p2=c,n.p3=m,n.p4=g,n.color=d.backgroundColor.value(),n.transparency=d.transparency.value(),n.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(n)),n={},n.width=k,n.p1=l,n.p2=b,n.p3=m,n.p4=h,n.color=d.backgroundColor.value(),n.transparency=d.transparency.value(),n.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(n))):(l.points=new List([b,c,g,h]),l.color="rgba(0,0,0,0)",l.linewidth=0,l.linestyle=CanvasEx.LINESTYLE_SOLID,
|
|
l.filled=!0,l.backcolor=d.backgroundColor.value(),l.fillBackground=!0,l.transparency=d.transparency.value(),a.append(new TradingView.PoligonRenderer(l)))}}k=function(a,b){return{points:(new List).append(a).append(b),width:e.timeScale().width(),height:f.priceScale().height(),color:d.linecolor.value(),linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),extendleft:d.extendLeft.value(),extendright:d.extendRight.value(),leftend:d.leftEnd.value(),rightend:d.rightEnd.value()}};a.append(new TradingView.TrendLineRenderer(k(b,
|
|
c)));var p=this,l=function(b,c,d,e){p.R99.properties().showPrices.value()&&(d={points:(new List).append(b),text:d,color:p.R99.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:p.R99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:p.R99.properties().bold.value(),italic:p.R99.properties().italic.value(),fontsize:p.R99.properties().fontsize.value()},a.append(new TextRenderer(d,p._rendererCache)),d={points:(new List).append(c),
|
|
text:e,color:p.R99.properties().textcolor.value(),horzAlign:b.x<c.x?"left":"right",vertAlign:"middle",font:p.R99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:p.R99.properties().bold.value(),italic:p.R99.properties().italic.value(),fontsize:p.R99.properties().fontsize.value()},a.append(new TextRenderer(d,p._rendererCache)))};a.append(new TradingView.TrendLineRenderer(k(b,c)));l(b,c,this._price1,this._price2);if(2==this._points.size())return this.addAnchors(a),
|
|
a;a.append(new TradingView.TrendLineRenderer(k(h,g)));l(g,h,this._price3,this._price4);this.isAnchorsRequired()&&(g=[b,c,g,h],this.D0.lineBeingCreated()==this.R99&&g.pop(),a.append(this.createLineAnchor({points:g})));!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&b&&c&&this.R99.getAlertIsActive(function(e){a.append(new TradingView.PaneRendererClockIcon({point1:b,point2:c,color:e?d.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))});
|
|
return a};TradingView.LineToolDisjointAngle=function(a,b){this._constructor="LineToolDisjointAngle";var c=b?b:new J52("linetooldisjointangle");R47.call(this,a,new J67(this,a),c);this.version=TradingView.LineToolDisjointAngle.version};inherit(TradingView.LineToolDisjointAngle,R47);TradingView.LineToolDisjointAngle.version=1;TradingView.LineToolDisjointAngle.prototype.pointsCount=function(){return 3};
|
|
TradingView.LineToolDisjointAngle.prototype.title=function(){return"Disjoint Angle"};TradingView.LineToolDisjointAngle.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return R47.prototype.addPoint.call(this,a)};
|
|
TradingView.LineToolDisjointAngle.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return R47.prototype.setLastPoint.call(this,a)};
|
|
TradingView.LineToolDisjointAngle.prototype.setPoint=function(a,b,c){var d=.5*(this._points.item(1).price+this._points.item(2).price);c&&c.shift&&1==a&&this._snapPoint45Degree(b,this.points().item(0));3>a&&R47.prototype.setPoint.call(this,a,b);0!==a&&2!=a&&(1==a?(a=this._points.item(1).price-d,this._points.item(2).price=this._points.item(1).price-2*a):3==a&&(a=this.priceScale(),c=b.price,a.isPercent()&&(d=this.ownerSource().firstValue(),c=a.priceRange().convertFromPercent(c,
|
|
d)),a=c-this._points.item(2).price,this._points.item(0).price=this._points.item(1).price-a,this._points.item(0).index=b.index))};TradingView.LineToolDisjointAngle.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolDisjointAngle.prototype._getAlertPlots=function(){var a=this._points.item(0),b=this._points.item(1),c=[];a.index<=b.index?(c.push(a),c.push(b)):(c.push(b),c.push(a));var d=this._points.item(2);d.time=b.time;d.index=b.index;var e={price:d.price+(b.price-a.price),time:a.time,index:a.index},f=[];d.index<=e.index?(f.push(d),f.push(e)):(f.push(e),f.push(d));c[0].price>f[0].price?(d=c,c=f):f[0].price>c[0].price?d=f:f[1].price>c[1].price?d=f:(d=c,c=f);f=this.properties().extendLeft.value();
|
|
e=this.properties().extendRight.value();a.index<=b.index?(a=f,b=e):(a=e,b=f);return[this._linePointsToAlertPlot(d,"Upper",a,b),this._linePointsToAlertPlot(c,"Lower",a,b)]};J78=function(a,b){J90.call(this,a,b);this._label2=this._label1=null;this._rendererCache={}};inherit(J78,J90);
|
|
J78.prototype.update=function(){J90.prototype.update.call(this);this._label2=this._label1=null;if(!(2>this.R99.points().size())&&this.R99.priceScale()){var a=this.R99.points().item(0),b=this.R99.points().item(1);this._price1=this.R99.priceScale().formatter().format(a.price);this._price2=this.R99.priceScale().formatter().format(b.price);3==this.R99.points().size()&&(a=this.R99.points().item(2),this._price3=this.R99.priceScale().formatter().format(a.price))}};
|
|
J78.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d,e,f=this.R99.properties(),g=this.D0,h=this.R99;if(3==this._points.size()&&(d=this._points.item(2),d.x=c.x,e=b.clone(),e.y=d.y,e.data=3,f.fillBackground.value())){var k={},l=g.timeScale().width();h.priceScale().height();var m=f.extendLeft.value(),n=f.extendRight.value();m||n?!m&&n?(k={},k.width=l,k.p1=
|
|
b,k.p2=c,k.p3=e,k.p4=d,k.color=f.backgroundColor.value(),k.transparency=f.transparency.value(),k.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(k))):m&&!n?(k={},k.width=l,k.p1=c,k.p2=b,k.p3=d,k.p4=e,k.color=f.backgroundColor.value(),k.transparency=f.transparency.value(),k.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(k))):(k=b.add(c).scaled(.5),m=e.add(d).scaled(.5),n={},n.width=l,n.p1=k,n.p2=c,n.p3=m,n.p4=d,n.color=
|
|
f.backgroundColor.value(),n.transparency=f.transparency.value(),n.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(n)),n={},n.width=l,n.p1=k,n.p2=b,n.p3=m,n.p4=e,n.color=f.backgroundColor.value(),n.transparency=f.transparency.value(),n.hittestOnBackground=TradingView.isMobile.any(),a.append(new TradingView.ChannelRenderer(n))):(k.points=new List([b,c,d,e]),k.color="rgba(0,0,0,0)",k.linewidth=0,k.linestyle=CanvasEx.LINESTYLE_SOLID,k.filled=!0,k.backcolor=f.backgroundColor.value(),
|
|
k.fillBackground=!0,k.transparency=f.transparency.value(),a.append(new TradingView.PoligonRenderer(k)))}l=function(a,b){return{points:(new List).append(a).append(b),width:g.timeScale().width(),height:h.priceScale().height(),color:f.linecolor.value(),linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),extendleft:f.extendLeft.value(),extendright:f.extendRight.value(),leftend:f.leftEnd.value(),rightend:f.rightEnd.value()}};a.append(new TradingView.TrendLineRenderer(l(b,c)));if(2==this._points.size())return this.addAnchors(a),
|
|
a;var p=this,k=function(b,c,d,e){p.R99.properties().showPrices.value()&&(d={points:(new List).append(b),text:d,color:p.R99.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:p.R99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:p.R99.properties().bold.value(),italic:p.R99.properties().italic.value(),fontsize:p.R99.properties().fontsize.value()},a.append(new TextRenderer(d,p._rendererCache)),d={points:(new List).append(c),
|
|
text:e,color:p.R99.properties().textcolor.value(),horzAlign:b.x<c.x?"left":"right",vertAlign:"middle",font:p.R99.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:p.R99.properties().bold.value(),italic:p.R99.properties().italic.value(),fontsize:p.R99.properties().fontsize.value()},a.append(new TextRenderer(d,p._rendererCache)))};a.append(new TradingView.TrendLineRenderer(l(b,c)));k(b,c,this._price1,this._price2);if(2==this._points.size())return a;a.append(new TradingView.TrendLineRenderer(l(e,
|
|
d)));k(d,e,this._price3,this._price3);this.isAnchorsRequired()&&(d=[b,c,d,e],this.D0.lineBeingCreated()==this.R99&&d.pop(),a.append(this.createLineAnchor({points:d})));!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&b&&c&&this.R99.getAlertIsActive(function(d){a.append(new TradingView.PaneRendererClockIcon({point1:b,point2:c,color:d?f.linecolor.value():defaults("chartproperties.alertsProperties.drawingIcon.color")}))});return a};
|
|
TradingView.LineToolFlatBottom=function(a,b){this._constructor="LineToolFlatBottom";var c=b?b:new J52("linetoolflatbottom");R47.call(this,a,new J78(this,a),c);this.version=TradingView.LineToolFlatBottom.version};inherit(TradingView.LineToolFlatBottom,R47);TradingView.LineToolFlatBottom.version=1;TradingView.LineToolFlatBottom.prototype.pointsCount=function(){return 3};
|
|
TradingView.LineToolFlatBottom.prototype.title=function(){return"Flat Bottom"};TradingView.LineToolFlatBottom.prototype.addPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return R47.prototype.addPoint.call(this,a)};
|
|
TradingView.LineToolFlatBottom.prototype.setLastPoint=function(a,b){b&&b.shift&&2==this.points().size()&&this._snapPoint45Degree(a,this.points().item(this.points().size()-2));return R47.prototype.setLastPoint.call(this,a)};
|
|
TradingView.LineToolFlatBottom.prototype.setPoint=function(a,b,c){this._points.item(1);this._points.item(2);c&&c.shift&&1==a&&this._snapPoint45Degree(b,this.points().item(0));3>a?R47.prototype.setPoint.call(this,a,b):this._points.item(0).index=b.index};TradingView.LineToolFlatBottom.prototype.canHasAlert=function(){return!0};
|
|
TradingView.LineToolFlatBottom.prototype._getAlertPlots=function(){var a=this._points.item(0),b=this._points.item(1),c=[];a.index<=b.index?(c.push(a),c.push(b)):(c.push(b),c.push(a));var d=this._points.item(2);d.time=b.time;d.index=b.index;var e={price:d.price,time:a.time,index:a.index},f=[];d.index<=e.index?(f.push(d),f.push(e)):(f.push(e),f.push(d));c[0].price>f[0].price?(d=c,c=f):f[0].price>c[0].price?d=f:f[1].price>c[1].price?d=f:(d=c,c=f);f=this.properties().extendLeft.value();e=this.properties().extendRight.value();
|
|
a.index<=b.index?(a=f,b=e):(a=e,b=f);return[this._linePointsToAlertPlot(d,"Upper",a,b),this._linePointsToAlertPlot(c,"Lower",f,b)]};TradingView.IconRenderer=function(a,b){this._data=a;this._cache=b};
|
|
TradingView.IconRenderer.prototype.draw=function(a){var b=String.fromCharCode(this._data.icon);a.font=this._data.size+"px FontAwesome";var c=a.measureText(b).width;a.textBaseline="middle";var d=this._data.point;a.translate(d.x,d.y);a.rotate(this._data.angle-Math.PI/2);a.scale(this._data.scale,1);d=65536*this._data.icon+this._data.size;this._cache[d]=c;this._data.selected&&(a.fillStyle="rgba(80, 80, 80, 0.2)",a.fillRect(-this._cache[d]/2,-this._data.size/2,this._cache[d],this._data.size));a.fillStyle=
|
|
this._data.color;a.fillText(b,-this._cache[d]/2,0)};TradingView.IconRenderer.prototype.hitTest=function(a){var b=this._cache[65536*this._data.icon+this._data.size]*this._data.scale,c=MathEx.Matrix.rotate(-this._data.angle);a=a.substract(this._data.point);a=c.mult(a);return Math.abs(a.y)<=b/2&&Math.abs(a.x)<=this._data.size/2?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};J87=function(a,b){J90.call(this,a,b);this._cache={}};
|
|
inherit(J87,J90);J87.anchorLimit=80;
|
|
J87.prototype.renderer=function(){var a=new TradingView.CompositeRenderer;if(1>this._points.size())return a;var b=this.R99.properties(),c={point:this._points.item(0),color:b.color.value(),size:b.size.value(),icon:b.icon.value(),angle:b.angle.value(),scale:b.scale.value(),selected:this.isAnchorsRequired()},d=this.D0,e=this.R99;a.append(new TradingView.IconRenderer(c,this._cache));if(this.isAnchorsRequired()){var f=this._cache[65536*c.icon+c.size],g=c.size,c=this._points.item(0),
|
|
h=b.scale.value(),g=new MathEx.Point(Math.max(J87.anchorLimit,g)/2,0),f=new MathEx.Point(0,Math.max(J87.anchorLimit,h*f)/2),b=MathEx.Matrix.rotate(b.angle.value()),g=b.mult(g),f=b.mult(f),b=c.add(g);b.data=0;g=c.substract(g);g.data=1;h=c.add(f);h.data=2;h.square=!0;f=c.substract(f);f.data=3;f.square=!0;c={points:(new List).append(b).append(g),width:d.timeScale().width(),height:e.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,
|
|
extendleft:!1,extendright:!1,leftend:R47.LINEEND_NORMAL,rightend:R47.LINEEND_NORMAL};d=new TradingView.TrendLineRenderer(c);d._hittest=null;a.append(d);a.append(this.createLineAnchor({points:[b,g,h,f]}))}return a};
|
|
TradingView.LineToolIcon=function(a,b){this._constructor="LineToolIcon";var c=b?b:new J52("linetoolicon");c.addExclusion("angle");c.addExclusion("scale");R47.call(this,a,new J87(this,a),c);this.version=TradingView.LineToolIcon.version};
|
|
TradingView.LineToolIcon._getAvailIcons=function(){for(var a=[],a=a.concat([61536,61537,61538,61539]),a=a.concat([61725,61726]),a=a.concat([61575,61576,61796,61797]),a=a.concat([61779,61780,61781,61782,61783,61784,61785,61786]),b=a.slice(0),c=61440;61846>=c;c++)-1!=$.inArray(c,a)||15==c%16&&61487!==c||61620<=c&&61630>=c||61718!=c&&61719!=c&&61472!=c&&61619!=c&&b.push(c);return b};TradingView.LineToolIcon.availIcons=TradingView.LineToolIcon._getAvailIcons();inherit(TradingView.LineToolIcon,R47);
|
|
TradingView.LineToolIcon.version=1;TradingView.LineToolIcon.prototype.pointsCount=function(){return 1};TradingView.LineToolIcon.prototype.title=function(){return"Icon"};
|
|
TradingView.LineToolIcon.prototype.startChanging=function(a,b){R47.prototype.startChanging.call(this,a,b);var c=this.properties(),d=65536*c.icon.value()+c.size.value();this._startChangeWidth=this._paneViews[0]._cache[d];c.size.value()<J87.anchorLimit?this._sizeScale=c.size.value()/J87.anchorLimit:this._sizeScale=1;this._origScale=c.scale.value();this._resizeRatio=this._startChangeWidth*this._origScale<J87.anchorLimit?
|
|
this._startChangeWidth/J87.anchorLimit:1};TradingView.LineToolIcon.prototype.endChanging=function(){R47.prototype.endChanging.call(this);delete this._startChangeWidth;delete this._sizeScale;delete this._resizeRatio};
|
|
TradingView.LineToolIcon.prototype.setPoint=function(a,b,c){var d=this.priceScale();if(d.isPercent()){var e=this.ownerSource().firstValue();b.price=d.priceRange().convertFromPercent(b.price,e)}c&&c.shift&&this.D2.snapTo45Degrees&&this._snapPoint45Degree(b,this.points().item(0));c=this.pointToScreenPoint(this.points().item(0))[1];d=this.pointToScreenPoint(b)[1];0===a||1==a?(b=d.substract(c).normalized(),c=2*d.substract(c).length(),c*=this._sizeScale,this.D2.size.setValue(c),c=Math.acos(-b.x),
|
|
0<Math.asin(b.y)&&(c=2*Math.PI-c),0===a&&(c+=Math.PI),this.D2.angle.setValue(c)):(a=this._startChangeWidth,b=d.substract(c).length(),this._origScale*a<J87.anchorLimit?(a=J87.anchorLimit/2,this.D2.scale.setValue(this._origScale*b/a)):this.D2.scale.setValue(b/(a/2)))};R10=function(a,b){J90.call(this,a,b)};inherit(R10,J90);R10.prototype.update=function(){J90.prototype.update.call(this);this._distance=0;3==this._points.size()&&(this._distance=MathEx.distanceToLine(this._points.item(0),this._points.item(1),this._points.item(2)).distance)};
|
|
R10.prototype.renderer=function(){var a=new TradingView.CompositeRenderer,b=this.R99.properties(),c=this._points.item(0),d;2<=this._points.size()&&(d=this._points.item(1));var e,f,g,h;if(2==this._points.size()){var k={};k.points=this._points;k.floatPoints=this._floatPoints;k.width=this.D0.timeScale().width();k.height=this.R99.priceScale().height();k.color=b.color.value();k.linewidth=1;k.linestyle=CanvasEx.LINESTYLE_SOLID;k.extendleft=!1;k.extendright=!1;
|
|
k.leftend=R47.LINEEND_NORMAL;k.rightend=R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(k))}else 3==this._points.size()&&(this._points.item(2),e=d.substract(c),f=(new MathEx.Point(e.y,-e.x)).normalized().scaled(this._distance),h=f.scaled(-1),e=c.add(f),g=d.add(f),f=c.add(h),h=d.add(h),k={},k.points=(new List).append(e).append(g).append(h).append(f),k.color=b.color.value(),k.linewidth=this.R99.properties().linewidth.value(),k.linestyle=
|
|
CanvasEx.LINESTYLE_SOLID,k.filled=!0,k.backcolor=b.backgroundColor.value(),k.fillBackground=b.fillBackground.value(),k.transparency=b.transparency.value(),a.append(new TradingView.PoligonRenderer(k)));this.isAnchorsRequired()&&(b=[],b.push(c),2<=this._points.size()&&b.push(d),3==this._points.size()&&(e.data=2,f.data=2,g.data=2,h.data=2,b.push(e),b.push(f),b.push(g),b.push(h)),a.append(this.createLineAnchor({points:b})));return a};
|
|
TradingView.LineToolRotatedRectangle=function(a,b){this._constructor="LineToolRotatedRectangle";var c=b?b:new J52("linetoolrotatedrectangle");R47.call(this,a,new R10(this,a),c)};inherit(TradingView.LineToolRotatedRectangle,R47);
|
|
TradingView.LineToolRotatedRectangle.prototype.startChanging=function(a,b){R47.prototype.startChanging.call(this,a,b);if(0===a||1==a){var c=this._paneViews[0],d=c._points.item(0),e=c._points.item(1),c=c._points.item(2);this._distance=MathEx.distanceToLine(d,e,c).distance}};
|
|
TradingView.LineToolRotatedRectangle.prototype.setPoint=function(a,b,c){R47.prototype.setPoint.call(this,a,b,c);if(0===a||1==a)b=this._paneViews[0],b.update(),a=b._points.item(0),b=b._points.item(1).substract(a),b=(new MathEx.Point(b.y,-b.x)).normalized().scaled(this._distance),a=a.add(b),a=this.screenPointToPoint(a),this._points.setItem(2,a)};TradingView.LineToolRotatedRectangle.prototype.endChanging=function(){delete this._distance};
|
|
TradingView.LineToolRotatedRectangle.prototype.pointsCount=function(){return 3};TradingView.LineToolRotatedRectangle.prototype.title=function(){return"Rotated Rectangle"};TradingView.AngleRenderer=function(a){this._data=a};TradingView.AngleRenderer.prototype.hitTest=function(){return null};
|
|
TradingView.AngleRenderer.prototype.draw=function(a){a.save();a.translate(this._data.point.x,this._data.point.y);a.strokeStyle=this._data.color;var b=[1,2];"function"==typeof a.setLineDash?a.setLineDash(b):void 0!==a.mozDash?a.mozDash=b:void 0!==a.webkitLineDash&&(a.webkitLineDash=b);b=this._data.size;a.beginPath();a.moveTo(0,0);a.lineTo(b,0);a.arc(0,0,b,0,-this._data.angle,0<this._data.angle);a.stroke();a.restore()};
|
|
R40=function(a,b){J90.call(this,a,b);this._label=null;this._rendererCache={}};inherit(R40,J90);
|
|
R40.prototype.update=function(){J90.prototype.update.call(this);if(0<this._points.size()&&void 0!==this.R99._angle){var a=this._points.item(0),b=Math.cos(this.R99._angle),c=-Math.sin(this.R99._angle),b=new MathEx.Point(b,c);this._secondPoint=a.addScaled(b,this.R99._distance);this._secondPoint.data=1}this._label=null;if(!(2>this.R99.points().size())){var a=this.R99.points().item(0),c=this.R99.points().item(1),b=[],d,
|
|
e;if(this.R99.properties().showPriceRange.value()&&this.R99.priceScale()){var f=c.price-a.price;d=f/a.price;d=this.R99.priceScale().formatter().format(f)+" ("+(new TradingView.PercentageFormatter).format(100*d)+")";var g=this.D0.mainSeries().base();g&&(f=Math.round(f*g),d+=", "+f);b.push("priceRange")}this.R99.properties().showBarsRange.value()&&(a=c.index-a.index,e=""+$.t("{0} bars").format(a),b.push("barsRange"));this._label=[d,e].filter(function(a){return a}).join("\n")||null;
|
|
this._icons=b}};
|
|
R40.prototype.renderer=function(){var a=new TradingView.CompositeRenderer,b={},c=this.isAnchorsRequired(),d=c||this.R99.properties().alwaysShowStats.value();if(this._secondPoint&&0<this._points.size()){b.points=(new List).append(this._points.item(0)).append(this._secondPoint);b.width=this.D0.timeScale().width();b.height=this.R99.priceScale().height();b.color=this.R99.properties().linecolor.value();b.linewidth=this.R99.properties().linewidth.value();b.linestyle=
|
|
this.R99.properties().linestyle.value();b.extendleft=this.R99.properties().extendLeft.value();b.extendright=this.R99.properties().extendRight.value();b.leftend=R47.LINEEND_NORMAL;b.rightend=R47.LINEEND_NORMAL;a.append(new TradingView.TrendLineRenderer(b));if(d&&this._label&&2==this._points.size()){var d={points:(new List).append(this._secondPoint),text:this._label,color:this.R99.properties().textcolor.value(),font:TradingView.LineToolTrendLine.LABEL_FONT,
|
|
fontsize:TradingView.LineToolTrendLine.LABEL_FONTSIZE,lineSpacing:TradingView.LineToolTrendLine.LABEL_LINESPACING,backgroundColor:TradingView.LineToolTrendLine.LABEL_BGCOLOR,borderColor:TradingView.LineToolTrendLine.LABEL_BORDERCOLOR,borderWidth:1,padding:TradingView.LineToolTrendLine.LABEL_PADDING,paddingLeft:30,doNotAlignText:!0,icons:this._icons},e=TradingView.LineToolTrendLine.LABEL_OFFSET;this._points.item(1).y<this._points.item(0).y?(d.vertAlign="bottom",d.offsetY=-e):d.offsetY=e;this._points.item(1).x<
|
|
this._points.item(0).x?(d.horzAlign="right",d.offsetX=-e):d.offsetX=e;a.append(new TradingView.TrendLineStatsRenderer(d,this._rendererCache))}d={};d.point=this._points.item(0);d.angle=this.R99._angle;d.color=this.R99.properties().linecolor.value();d.size=50;a.append(new TradingView.AngleRenderer(d));d=Math.round(180*d.angle/Math.PI)+"\u00ba";e=this._points.item(0).clone();e.x+=50;d={points:(new List).append(e),text:d,color:this.R99.properties().textcolor.value(),horzAlign:"left",font:this.R99.properties().font.value(),
|
|
offsetX:5,offsetY:0,bold:this.R99.properties().bold.value(),italic:this.R99.properties().italic.value(),fontsize:this.R99.properties().fontsize.value(),vertAlign:"middle"};a.append(new TextRenderer(d,this._rendererCache))}!TradingView.printing&&this.R99.hasAlert.value()&&!this.D0.readOnly()&&b&&2<=b.points.size()&&this.R99.getAlertIsActive(function(c){a.append(new TradingView.PaneRendererClockIcon({point1:b.points.item(0),point2:b.points.item(1),color:c?b.color:defaults("chartproperties.alertsProperties.drawingIcon.color")}))});
|
|
this._secondPoint&&0<this._points.size()&&c&&a.append(this.createLineAnchor({points:[this._points.item(0),this._secondPoint]}));return a};TradingView.LineToolTrendAngle=function(a,b){this._constructor="LineToolTrendAngleLine";var c=b?b:new J52("linetooltrendangle");R47.call(this,a,new R40(this,a),c);this.D2.addProperty("angle");this.D2.angle=new TradingView.LineToolTrendAngle.AngleProperty(this)};
|
|
inherit(TradingView.LineToolTrendAngle,R47);TradingView.LineToolTrendAngle.AngleProperty=function(a){Property.call(this);this._lineSource=a};inherit(TradingView.LineToolTrendAngle.AngleProperty,Property);TradingView.LineToolTrendAngle.AngleProperty.prototype.value=function(){return Math.round(180*this._lineSource._angle/Math.PI)};
|
|
TradingView.LineToolTrendAngle.AngleProperty.prototype.setValue=function(a){this._lineSource._angle=a*Math.PI/180;a=this._lineSource.pointToScreenPoint(this._lineSource.points().item(0))[0];var b=Math.cos(this._lineSource._angle),c=-Math.sin(this._lineSource._angle),b=new MathEx.Point(b,c);a=a.addScaled(b,this._lineSource._distance);a=this._lineSource.screenPointToPoint(a);this._lineSource._points.setItem(1,a);this._lineSource.D0.updateSource(this._lineSource);this._lineSource.updateAllViews();
|
|
this._lineSource.D0.updateSource(this._lineSource)};TradingView.LineToolTrendAngle.prototype.pointsCount=function(){return 2};TradingView.LineToolTrendAngle.prototype.title=function(){return"Trend Angle"};
|
|
TradingView.LineToolTrendAngle.prototype._calculateAngle=function(){var a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(1))[0],c=b.substract(a);0<c.length()?(c=c.normalized(),this._angle=Math.acos(c.x),0<c.y&&(this._angle=-this._angle),this._distance=b.substract(a).length()):delete this._angle;this.properties().hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)};
|
|
TradingView.LineToolTrendAngle.prototype.addPoint=function(a,b){var c=R47.prototype.addPoint.call(this,a,b);c&&this._calculateAngle();return c};TradingView.LineToolTrendAngle.prototype.setLastPoint=function(a,b){R47.prototype.setLastPoint.call(this,a,b);1<this.points().size()&&this._calculateAngle()};
|
|
TradingView.LineToolTrendAngle.prototype.axisPoints=function(){if(2>this.points().size())return new List;var a=(new List).append(this.points().item(0)),b=this.pointToScreenPoint(this.points().item(0))[1],c=Math.cos(this._angle)*this._distance,d=-Math.sin(this._angle)*this._distance,b=b.add(new MathEx.Point(c,d)),b=this.screenPointToPoint(b);a.append(b);return a};
|
|
TradingView.LineToolTrendAngle.prototype.setPoint=function(a,b,c){R47.prototype.setPoint.call(this,a,b,c);1<this.points().size()&&1==a&&this._calculateAngle()};TradingView.LineToolTrendAngle.prototype.restoreData=function(a){this._angle=a.angle;this._distance=a.distance};TradingView.LineToolTrendAngle.prototype.state=function(a){a=R47.prototype.state.call(this,a);a.angle=this._angle;a.distance=this._distance;return a};
|
|
TradingView.LineToolTrendAngle.prototype.cloneData=function(a){this._angle=a._angle;this._distance=a._distance};TradingView.LineToolTrendAngle.prototype.canHasAlert=function(){return!0};TradingView.LineToolTrendAngle.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points.toArray(),null,this.properties().extendLeft.value(),this.properties().extendRight.value())]};TradingView.ChartTradingUtils={_fontHeightCache:{}};TradingView.ChartTradingUtils._parseColor=function(a){var b=document.createElement("div");b.style.color=a;a=b.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||b.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i);$(b).remove();return{r:a[1],g:a[2],b:a[3],a:a[4]||"1"}};
|
|
TradingView.ChartTradingUtils.getColorFromProperties=function(a,b){var c=1-b.value()/100,d=this._parseColor(a.value());return"rgba("+d.r+","+d.g+","+d.b+","+c+")"};TradingView.ChartTradingUtils.setColorToProperties=function(a,b,c){a=this._parseColor(a);b.setValue("rgb("+a.r+","+a.g+","+a.b+")");c.setValue(Math.max(0,Math.min(100*(1-a.a),100)))};
|
|
TradingView.ChartTradingUtils._parseFont=function(a){var b=document.createElement("div");b.style.font=a;a=b.style.fontSize.match(/(\d+)pt/);a={family:b.style.fontFamily,size:a&&a[0]==b.style.fontSize?a[1]:"",bold:"bold"==b.style.fontWeight,italic:"italic"==b.style.fontStyle};$(b).remove();return a};TradingView.ChartTradingUtils.getFontFromProperties=function(a,b,c,d){c=c.value()?"bold":"";d=d.value()?"italic":"";b=b.value()+"pt";a=a.value();return[c,d,b,a].join(" ")};
|
|
TradingView.ChartTradingUtils.setFontToProperties=function(a,b,c,d,e){a=this._parseFont(a);0<a.family.length&&b.setValue(a.family);0<a.size.length&&c.setValue(a.size);d.setValue(a.bold);e.setValue(a.italic)};
|
|
TradingView.ChartTradingUtils.fontHeight=function(a){if(!this._fontHeightCache[a]){var b=document.createElement("span");b.appendChild(document.createTextNode("height"));document.body.appendChild(b);b.style.cssText="font: "+a+"; white-space: nowrap; display: inline;";var c=b.offsetHeight;document.body.removeChild(b);this._fontHeightCache[a]=Math.ceil(c)}return this._fontHeightCache[a]};
|
|
TradingView.ChartTradingUtils.drawPolyHoverOrPress=function(a,b,c,d){d?(a.save(),a.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(a,b,!0),a.restore()):c&&(a.save(),a.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(a,b,!0),a.restore())};TradingView.ChartTradingUtils.repaint=function(a){var b=new A22(A22.LIGHT_UPDATE);b.force=!0;a.D20(b)};
|
|
TradingView.ChartTradingUtils.roundToMinTick=function(a,b){var c=1/a.mainSource().base();return c*Math.round(b/c)};TradingView.LineToolTrading=function(a,b,c){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0};R47.call(this,a,b,c)};inherit(TradingView.LineToolTrading,R47);TradingView.LineToolTrading.POINTS_COUNT=1;TradingView.LineToolTrading.prototype.pointsCount=function(){return TradingView.LineToolTrading.POINTS_COUNT};TradingView.LineToolTrading.prototype.hasContextMenu=function(){return!1};
|
|
TradingView.LineToolTrading.prototype.state=function(){return null};TradingView.LineToolTrading.prototype.startMoving=function(){R47.prototype.startMoving.apply(this,arguments);this._cursorMoved=!1};TradingView.LineToolTrading.prototype.endMoving=function(){R47.prototype.endMoving.apply(this,arguments);this._cursorMoved=!1};
|
|
TradingView.LineToolTrading.prototype.correctPoints=function(a){this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1;for(var b=1/this.priceScale().mainSource().base(),c=0;c<a.size();c++){var d=a.item(c);this._cursorMoved&&(d.price=this._currentMovingPoint.price);d.price=b*Math.round(d.price/b);a.setItem(c,d)}};TradingView.LineToolTrading.prototype.userEditEnabled=function(){return!0};
|
|
TradingView.LineToolTrading.prototype.isUserDeletable=function(){return!1};TradingView.LineToolTrading.prototype.showInObjectTree=function(){return!1};TradingView.OrderLineAdapter=function(a){this._line=a;this._data={bodyText:"order",quantityText:"0"}};TradingView.OrderLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};TradingView.OrderLineAdapter.prototype.setPrice=function(a){var b=this._line.points().item(0);b.price=a;this._line._points.setItem(0,b);this._line.normalizePoints();return this};TradingView.OrderLineAdapter.prototype.getText=function(){return this._data.bodyText};
|
|
TradingView.OrderLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";this._line.updateAllViewsAndRedraw();return this};TradingView.OrderLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};TradingView.OrderLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};TradingView.OrderLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};
|
|
TradingView.OrderLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";this._line.updateAllViewsAndRedraw();return this};TradingView.OrderLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D0.properties().tradingProperties.extendLeft.value():a};TradingView.OrderLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};
|
|
TradingView.OrderLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineLength.value():a};TradingView.OrderLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};
|
|
TradingView.OrderLineAdapter.prototype.getLineColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};TradingView.OrderLineAdapter.prototype.setLineColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};
|
|
TradingView.OrderLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineStyle.value():a};TradingView.OrderLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};
|
|
TradingView.OrderLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineWidth.value():a};TradingView.OrderLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};TradingView.OrderLineAdapter.prototype.getBodyBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setBodyBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};TradingView.OrderLineAdapter.prototype.getBodyBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setBodyBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};TradingView.OrderLineAdapter.prototype.getBodyTextColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setBodyTextColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};TradingView.OrderLineAdapter.prototype.getBodyFont=function(){return TradingView.ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};
|
|
TradingView.OrderLineAdapter.prototype.setBodyFont=function(a){TradingView.ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};TradingView.OrderLineAdapter.prototype.getQuantityBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setQuantityBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};TradingView.OrderLineAdapter.prototype.getQuantityBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setQuantityBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};TradingView.OrderLineAdapter.prototype.getQuantityTextColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setQuantityTextColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};TradingView.OrderLineAdapter.prototype.getQuantityFont=function(){return TradingView.ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
|
|
TradingView.OrderLineAdapter.prototype.setQuantityFont=function(a){TradingView.ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};TradingView.OrderLineAdapter.prototype.getCancelButtonBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setCancelButtonBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency);return this};TradingView.OrderLineAdapter.prototype.getCancelButtonBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setCancelButtonBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency);return this};TradingView.OrderLineAdapter.prototype.getCancelButtonIconColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)};
|
|
TradingView.OrderLineAdapter.prototype.setCancelButtonIconColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency);return this};TradingView.OrderLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};
|
|
TradingView.OrderLineAdapter.prototype.onCancel=function(a,b){b?this.isFunction(b)&&(this._onCancelData=a,this._onCancelCallback=b):this.isFunction(a)&&(this._onCancelCallback=a);return this};TradingView.OrderLineAdapter.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)};TradingView.OrderLineAdapter.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)};
|
|
TradingView.OrderLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};TradingView.OrderLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};
|
|
TradingView.OrderLineAdapter.prototype.onMove=function(a,b){b?this.isFunction(b)&&(this._onMoveData=a,this._onMoveCallback=b):this.isFunction(a)&&(this._onMoveCallback=a);return this};TradingView.OrderLineAdapter.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)};
|
|
TradingView.OrderLineAdapter.prototype.onContextMenu=function(a,b){b?this.isFunction(b)&&(this._onContextMenuData=a,this._onContextMenuCallback=b):this.isFunction(a)&&(this._onContextMenuCallback=a);return this};TradingView.OrderLineAdapter.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)};TradingView.OrderLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};
|
|
TradingView.OrderRenderer=function(a,b,c){this._data=a;this._cache=b;this._adapter=c};TradingView.OrderRenderer.prototype._height=function(){return Math.max(20,1+Math.max(TradingView.ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),TradingView.ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};
|
|
TradingView.OrderRenderer.prototype._bodyWidth=function(a){if(0===this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getBodyFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return Math.round(20+b)};
|
|
TradingView.OrderRenderer.prototype._quantityWidth=function(a){if(0===this._adapter.getQuantity().length)return 0;a.save();a.font=this._adapter.getQuantityFont();var b=a.measureText(this._adapter.getQuantity()).width;a.restore();return Math.round(Math.max(this._height(),10+b))};TradingView.OrderRenderer.prototype._cancelButtonWidth=function(){return this._adapter.isOnCancelCallbackPresent()?this._height():0};
|
|
TradingView.OrderRenderer.prototype._drawLines=function(a,b,c,d,e){a.save();a.strokeStyle=this._adapter.getLineColor();a.lineStyle=this._adapter.getLineStyle();a.lineWidth=this._adapter.getLineWidth();CanvasEx.drawLine(a,c,d,e,d);this._adapter.getExtendLeft()&&CanvasEx.drawLine(a,0,d,b,d);a.restore()};
|
|
TradingView.OrderRenderer.prototype._drawMovePoints=function(a,b,c){a.save();a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBorderColor();b+=4;for(var d=b+2,e=Math.floor((this._height()-10)/2)+1,f=0;f<e;++f){var g=c+5+2*f;CanvasEx.drawLine(a,b,g,d,g)}a.restore()};
|
|
TradingView.OrderRenderer.prototype._drawBody=function(a,b,c){a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=this._bodyWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
|
|
TradingView.OrderRenderer.prototype._drawBodyText=function(a,b,c){a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getBodyFont();a.fillStyle=this._adapter.getBodyTextColor();b+=this._bodyWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getText(),5+b-2,c)};
|
|
TradingView.OrderRenderer.prototype._drawQuantity=function(a,b,c,d){a.save();a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var e=this._quantityWidth(a),f=this._height();a.fillRect(b+.5,c+.5,e-1,f-1);d&&a.clip&&(a.beginPath(),a.rect(b+.5,c-.5,e+1,f+1),a.clip());a.strokeRect(b,c,e,f);a.restore()};
|
|
TradingView.OrderRenderer.prototype._drawQuantityText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getQuantityFont();a.fillStyle=this._adapter.getQuantityTextColor();b+=this._quantityWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getQuantity(),b,c);a.restore()};
|
|
TradingView.OrderRenderer.prototype._drawCancelButton=function(a,b,c,d){a.strokeStyle=this._adapter.getCancelButtonBorderColor();a.fillStyle=this._adapter.getCancelButtonBackgroundColor();var e=this._cancelButtonWidth(),f=this._height();a.fillRect(b+.5,c+.5,e-1,f-1);a.save();d&&a.clip&&(a.beginPath(),a.rect(b+.5,c-.5,e+1,f+1),a.clip());a.strokeRect(b,c,e,f);a.restore();d=b+e;f=c+f;a.strokeStyle=this._adapter.getCancelButtonIconColor();var e=(this._cancelButtonWidth()-8)/2,g=(this._height()-8)/2;CanvasEx.drawPoly(a,
|
|
[{x:b+e,y:c+g},{x:d-e,y:f-g}],!0);CanvasEx.drawPoly(a,[{x:d-e,y:c+g},{x:b+e,y:f-g}],!0)};
|
|
TradingView.OrderRenderer.prototype.draw=function(a){if(this._data.points&&!(1>this._data.points.size())){var b=a.canvas.width,c=this._bodyWidth(a),d=this._quantityWidth(a),e=c+d+this._cancelButtonWidth(),f=b-e,g=Math.max(this._adapter.getLineLength()/100*b,1),f=Math.round(b-Math.min(f,g)),e=f-e,h=Math.round(this._data.points.item(0).y),g=Math.round(h-(this._height()+1)/2);this._cache.bodyRight=e+c;this._cache.quantityRight=e+c+d;this._cache.top=g;this._cache.bottom=g+this._height();this._cache.left=
|
|
e;this._cache.right=f;this._drawLines(a,e,f,h,b);b=!1;0!==c&&(this._drawBody(a,e,g),this._drawMovePoints(a,e,g),this._drawBodyText(a,e,g),b=!0);0!==d&&(this._drawQuantity(a,e+c,g,b),this._drawQuantityText(a,e+c,g),b=!0);0!==this._cancelButtonWidth()&&this._drawCancelButton(a,e+c+d,g,b)}};
|
|
TradingView.OrderRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.y<this._cache.top||a.y>this._cache.bottom?null:a.x>=this._cache.left&&a.x<this._cache.bodyRight?0===this._adapter.getTooltip().length?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT,{tooltip:{text:this._adapter.getTooltip(),rect:new TradingView.Rect(this._cache.left,this._cache.top,this._cache.bodyRight-this._cache.left,
|
|
this._cache.bottom-this._cache.top)}}):a.x>=this._cache.bodyRight&&a.x<this._cache.quantityRight?new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:"Edit Order",rect:new TradingView.Rect(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.quantityRight&&a.x<this._cache.right?new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,
|
|
{mouseDownHandler:this._adapter.callOnCancel.bind(this._adapter),tooltip:{text:"Cancel Order",rect:new TradingView.Rect(this._cache.quantityRight,this._cache.top,this._cache.right-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):null};TradingView.OrderPriceAxisView=function(a,b){R48.call(this,a,b)};inherit(TradingView.OrderPriceAxisView,R48);
|
|
TradingView.OrderPriceAxisView.prototype._updateImpl=function(){R48.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};TradingView.OrderPaneView=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(TradingView.OrderPaneView,J90);
|
|
TradingView.OrderPaneView.prototype.renderer=function(){return new TradingView.OrderRenderer({points:this._points},this._rendererCache,this.R99._adapter)};TradingView.LineToolOrder=function(a,b){this._adapter=new TradingView.OrderLineAdapter(this);this._constructor="LineToolOrder";var c=b||new J52("linetoolorder");TradingView.LineToolTrading.call(this,a,new TradingView.OrderPaneView(this,a),c)};inherit(TradingView.LineToolOrder,TradingView.LineToolTrading);
|
|
TradingView.LineToolOrder.skipMagnetting=!0;TradingView.LineToolOrder.prototype.setPoint=function(a,b,c){this._points.setItem(a,b);this.normalizePoints()};TradingView.LineToolOrder.prototype.addPoint=function(a,b){this._points.append(a);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};TradingView.LineToolOrder.prototype.title=function(){return"Order"};
|
|
TradingView.LineToolOrder.prototype.endMoving=function(a){var b=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!=this._currentMovingPoint.price;TradingView.LineToolTrading.prototype.endMoving.call(this);!a&&b&&this._adapter.callOnMove()};TradingView.LineToolOrder.prototype.createPriceAxisView=function(a){return this._priceAxisView=new TradingView.OrderPriceAxisView(this,a)};
|
|
TradingView.LineToolOrder.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showOrders.value()?null:R47.prototype.paneViews.call(this,a)};TradingView.LineToolOrder.prototype.priceAxisViews=function(a,b){return TradingView.printing||!this.D0.properties().tradingProperties.showOrders.value()?null:R47.prototype.priceAxisViews.call(this,a,b)};TradingView.LineToolOrder.prototype.hasContextMenu=function(){return!0};
|
|
TradingView.LineToolOrder.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()};TradingView.PositionLineAdapter=function(a){this._line=a;this._data={bodyText:"position",quantityText:"0"}};TradingView.PositionLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};TradingView.PositionLineAdapter.prototype.setPrice=function(a){var b=this._line.points().item(0);b.price=a;this._line._points.setItem(0,b);this._line.normalizePoints();return this};TradingView.PositionLineAdapter.prototype.getText=function(){return this._data.bodyText};
|
|
TradingView.PositionLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";this._line.updateAllViewsAndRedraw();return this};TradingView.PositionLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};TradingView.PositionLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};TradingView.PositionLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};
|
|
TradingView.PositionLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";this._line.updateAllViewsAndRedraw();return this};TradingView.PositionLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D0.properties().tradingProperties.extendLeft.value():a};TradingView.PositionLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};
|
|
TradingView.PositionLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineLength.value():a};TradingView.PositionLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};
|
|
TradingView.PositionLineAdapter.prototype.getLineColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};TradingView.PositionLineAdapter.prototype.setLineColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};
|
|
TradingView.PositionLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineStyle.value():a};TradingView.PositionLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};
|
|
TradingView.PositionLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D0.properties().tradingProperties.lineWidth.value():a};TradingView.PositionLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};
|
|
TradingView.PositionLineAdapter.prototype.getBodyBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};TradingView.PositionLineAdapter.prototype.setBodyBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};
|
|
TradingView.PositionLineAdapter.prototype.getBodyBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};TradingView.PositionLineAdapter.prototype.setBodyBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};
|
|
TradingView.PositionLineAdapter.prototype.getBodyTextColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};TradingView.PositionLineAdapter.prototype.setBodyTextColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};
|
|
TradingView.PositionLineAdapter.prototype.getBodyFont=function(){return TradingView.ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};
|
|
TradingView.PositionLineAdapter.prototype.setBodyFont=function(a){TradingView.ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};TradingView.PositionLineAdapter.prototype.getQuantityBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setQuantityBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};TradingView.PositionLineAdapter.prototype.getQuantityBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setQuantityBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};TradingView.PositionLineAdapter.prototype.getQuantityTextColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setQuantityTextColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};TradingView.PositionLineAdapter.prototype.getQuantityFont=function(){return TradingView.ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
|
|
TradingView.PositionLineAdapter.prototype.setQuantityFont=function(a){TradingView.ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};TradingView.PositionLineAdapter.prototype.getReverseButtonBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setReverseButtonBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency);return this};TradingView.PositionLineAdapter.prototype.getReverseButtonBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setReverseButtonBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency);return this};TradingView.PositionLineAdapter.prototype.getReverseButtonIconColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setReverseButtonIconColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency);return this};TradingView.PositionLineAdapter.prototype.getCloseButtonBorderColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setCloseButtonBorderColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency);return this};TradingView.PositionLineAdapter.prototype.getCloseButtonBackgroundColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setCloseButtonBackgroundColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency);return this};TradingView.PositionLineAdapter.prototype.getCloseButtonIconColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)};
|
|
TradingView.PositionLineAdapter.prototype.setCloseButtonIconColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency);return this};TradingView.PositionLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};
|
|
TradingView.PositionLineAdapter.prototype.onReverse=function(a,b){b?this.isFunction(b)&&(this._onReverseData=a,this._onReverseCallback=b):this.isFunction(a)&&(this._onReverseCallback=a);return this};TradingView.PositionLineAdapter.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)};TradingView.PositionLineAdapter.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)};
|
|
TradingView.PositionLineAdapter.prototype.onClose=function(a,b){b?this.isFunction(b)&&(this._onCloseData=a,this._onCloseCallback=b):this.isFunction(a)&&(this._onCloseCallback=a);return this};TradingView.PositionLineAdapter.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._onCloseCallback.call(this,this._onCloseData)};TradingView.PositionLineAdapter.prototype.isOnCloseCallbackPresent=function(){return this.isFunction(this._onCloseCallback)};
|
|
TradingView.PositionLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};TradingView.PositionLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};
|
|
TradingView.PositionLineAdapter.prototype.onContextMenu=function(a,b){b?this.isFunction(b)&&(this._onContextMenuData=a,this._onContextMenuCallback=b):this.isFunction(a)&&(this._onContextMenuCallback=a);return this};TradingView.PositionLineAdapter.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)};
|
|
TradingView.PositionLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};TradingView.PositionRenderer=function(a,b,c){this._data=a;this._cache=b;this._adapter=c};TradingView.PositionRenderer.prototype._height=function(){return Math.max(20,1+Math.max(TradingView.ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),TradingView.ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};
|
|
TradingView.PositionRenderer.prototype._bodyWidth=function(a){if(0===this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getBodyFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return Math.round(10+b)};
|
|
TradingView.PositionRenderer.prototype._quantityWidth=function(a){if(0===this._adapter.getQuantity().length)return 0;a.save();a.font=this._adapter.getQuantityFont();var b=a.measureText(this._adapter.getQuantity()).width;a.restore();return Math.round(Math.max(this._height(),10+b))};TradingView.PositionRenderer.prototype._reverseButtonWidth=function(){return this._adapter.isOnReverseCallbackPresent()?this._height():0};
|
|
TradingView.PositionRenderer.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0};TradingView.PositionRenderer.prototype._drawLines=function(a,b,c,d,e){a.save();a.strokeStyle=this._adapter.getLineColor();a.lineStyle=this._adapter.getLineStyle();a.lineWidth=this._adapter.getLineWidth();CanvasEx.drawLine(a,c,d,e,d);this._adapter.getExtendLeft()&&CanvasEx.drawLine(a,0,d,b,d);a.restore()};
|
|
TradingView.PositionRenderer.prototype._drawBody=function(a,b,c){a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=this._bodyWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
|
|
TradingView.PositionRenderer.prototype._drawBodyText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getBodyFont();a.fillStyle=this._adapter.getBodyTextColor();b+=this._bodyWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getText(),b,c);a.restore()};
|
|
TradingView.PositionRenderer.prototype._drawQuantity=function(a,b,c){a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var d=this._quantityWidth(a),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e)};
|
|
TradingView.PositionRenderer.prototype._drawQuantityText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getQuantityFont();a.fillStyle=this._adapter.getQuantityTextColor();b+=this._quantityWidth(a)/2;c+=this._height()/2;a.fillText(this._adapter.getQuantity(),b,c);a.restore()};
|
|
TradingView.PositionRenderer.prototype._drawReverseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getReverseButtonBorderColor();a.fillStyle=this._adapter.getReverseButtonBackgroundColor();var d=this._reverseButtonWidth(),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e);a.strokeStyle=this._adapter.getReverseButtonIconColor();d=function(a,b){CanvasEx.drawLine(a,0,0,0,b);CanvasEx.drawLine(a,-1,1,1,1);CanvasEx.drawLine(a,-2,2,2,2)};b+=Math.round((this._reverseButtonWidth()-
|
|
6)/2);c+=5;a.save();a.transform(1,0,0,1,b,c);d(a,10);a.transform(1,0,0,1,6,10);a.rotate(Math.PI);d(a,10);a.restore();a.restore()};
|
|
TradingView.PositionRenderer.prototype._drawCloseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getCloseButtonBorderColor();a.fillStyle=this._adapter.getCloseButtonBackgroundColor();var d=this._closeButtonWidth(),e=this._height();a.fillRect(b+.5,c+.5,d-1,e-1);a.strokeRect(b,c,d,e);d=b+d;e=c+e;a.strokeStyle=this._adapter.getCloseButtonIconColor();var f=(this._closeButtonWidth()-8)/2,g=(this._height()-8)/2;CanvasEx.drawPoly(a,[{x:b+f,y:c+g},{x:d-f,y:e-g}],!0);CanvasEx.drawPoly(a,[{x:d-
|
|
f,y:c+g},{x:b+f,y:e-g}],!0);a.restore()};
|
|
TradingView.PositionRenderer.prototype.draw=function(a){if(this._data.points&&!(1>this._data.points.size())){var b=a.canvas.width,c=this._bodyWidth(a),d=this._quantityWidth(a),e=this._reverseButtonWidth(a),f=c+d+e+this._closeButtonWidth(),g=b-f,h=Math.max(this._adapter.getLineLength()/100*b,1),g=Math.round(b-Math.min(g,h)),f=g-f,h=Math.round(this._data.points.item(0).y),k=Math.round(h-(this._height()+1)/2);this._cache.bodyRight=f+c;this._cache.quantityRight=this._cache.bodyRight+d;this._cache.reverseButtonRight=
|
|
this._cache.quantityRight+e;this._cache.top=k;this._cache.bottom=k+this._height();this._cache.left=f;this._cache.right=g;this._drawLines(a,f,g,h,b);0!==c&&(this._drawBody(a,f,k),this._drawBodyText(a,f,k));0!==d&&(this._drawQuantity(a,this._cache.bodyRight,k),this._drawQuantityText(a,this._cache.bodyRight,k));0!==e&&this._drawReverseButton(a,this._cache.quantityRight,k);0!==this._closeButtonWidth()&&this._drawCloseButton(a,this._cache.reverseButtonRight,k)}};
|
|
TradingView.PositionRenderer.prototype.hitTest=function(a){return 0===this._data.points.size()||a.y<this._cache.top||a.y>this._cache.bottom?null:a.x>=this._cache.left&&a.x<this._cache.bodyRight&&0!=this._adapter.getTooltip().length?new HitTestResult(HitTestResult.CUSTOM,{tooltip:{text:this._adapter.getTooltip(),rect:new TradingView.Rect(this._cache.left,this._cache.top,this._cache.bodyRight-this._cache.left,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.bodyRight&&a.x<this._cache.quantityRight&&
|
|
this._adapter._onModifyCallback?new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnModify.bind(this._adapter),tooltip:{text:$.t("Edit Position"),rect:new TradingView.Rect(this._cache.bodyRight,this._cache.top,this._cache.quantityRight-this._cache.bodyRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.quantityRight&&a.x<this._cache.reverseButtonRight?new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnReverse.bind(this._adapter),
|
|
tooltip:{text:$.t("Reverse Position"),rect:new TradingView.Rect(this._cache.quantityRight,this._cache.top,this._cache.reverseButtonRight-this._cache.quantityRight,this._cache.bottom-this._cache.top)}}):a.x>=this._cache.reverseButtonRight&&a.x<this._cache.right?new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,{mouseDownHandler:this._adapter.callOnClose.bind(this._adapter),tooltip:{text:$.t("Close Position"),rect:new TradingView.Rect(this._cache.reverseButtonRight,this._cache.top,this._cache.right-
|
|
this._cache.reverseButtonRight,this._cache.bottom-this._cache.top)}}):null};TradingView.PositionPriceAxisView=function(a,b){R48.call(this,a,b)};inherit(TradingView.PositionPriceAxisView,R48);TradingView.PositionPriceAxisView.prototype._updateImpl=function(){R48.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};
|
|
TradingView.PositionPaneView=function(a,b){J90.call(this,a,b);this._rendererCache={}};inherit(TradingView.PositionPaneView,J90);TradingView.PositionPaneView.prototype.renderer=function(){return new TradingView.PositionRenderer({points:this._points},this._rendererCache,this.R99._adapter)};
|
|
TradingView.LineToolPosition=function(a,b){this._adapter=new TradingView.PositionLineAdapter(this);this._constructor="LineToolPosition";var c=b||new J52("linetoolposition");TradingView.LineToolTrading.call(this,a,new TradingView.PositionPaneView(this,a),c)};inherit(TradingView.LineToolPosition,TradingView.LineToolTrading);TradingView.LineToolPosition.prototype.setPoint=function(a,b,c){this._points.setItem(a,b);this.normalizePoints()};
|
|
TradingView.LineToolPosition.prototype.addPoint=function(a,b){this._points.append(a);this._lastPoint=null;this.normalizePoints();this.createServerPoints();return!0};TradingView.LineToolPosition.skipMagnetting=!0;TradingView.LineToolPosition.prototype.title=function(){return"Position"};TradingView.LineToolPosition.prototype.createPriceAxisView=function(a){return this._priceAxisView=new TradingView.PositionPriceAxisView(this,a)};
|
|
TradingView.LineToolPosition.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showPositions.value()?null:R47.prototype.paneViews.call(this,a)};TradingView.LineToolPosition.prototype.priceAxisViews=function(a,b){return TradingView.printing||!this.D0.properties().tradingProperties.showPositions.value()?null:R47.prototype.priceAxisViews.call(this,a,b)};
|
|
TradingView.LineToolPosition.prototype.hasContextMenu=function(){return!0};TradingView.LineToolPosition.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()};TradingView.ExecutionsPositionController=function(a,b){this._pane=a;this._timeScale=b};
|
|
TradingView.ExecutionsPositionController.prototype.getYCoordinate=function(a){var b=0,c=a.getDirection(),d=a._index,e=this._pane.mainDataSource();if(e.bars){var f="buy"==c?10:-10,g=e.bars().search(d,TradingView.SEARCH_NEAREST_LEFT);g&&(d=g.index,b="buy"==c?g.value[TradingView.LOW_PLOT]:g.value[TradingView.HIGH_PLOT],g=e.priceScale(),g.isPercent()&&(e=e.firstValue(),b=g.priceRange().convertToPercent(b,e)),b=g.priceToCoordinate(b)+f)}f=this._pane.orderedSources();for(e=f.length-1;0<=e;--e)if(g=f[e],
|
|
g instanceof TradingView.LineToolExecution&&g._adapter.getDirection()==c&&g._adapter._index==d){if(g==a._line)break;b="buy"==c?b+g._adapter._height():b-g._adapter._height()}return b};TradingView.ExecutionLineAdapter=function(a){this._line=a};TradingView.ExecutionLineAdapter.prototype._height=function(){var a=this.getArrowHeight(),b=this.getArrowSpacing();this.getText()&&TradingView.ChartTradingUtils.fontHeight(this.getFont());return a+b+0+10};
|
|
TradingView.ExecutionLineAdapter.prototype.getIndex=function(){var a=this._line.D0.timeScale().m_points.lastTimePointIndex(),b=this._line.points().item(0).index;return a-b};TradingView.ExecutionLineAdapter.prototype.setIndex=function(a){a=this._line.D0.timeScale().m_points.lastTimePointIndex()-Math.abs(a);this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.index=a;this._line.move(b);this._line.endMoving();return this};
|
|
TradingView.ExecutionLineAdapter.prototype.getTime=function(){return this._unixtime};TradingView.ExecutionLineAdapter.prototype.setTime=function(a){this._unixtime=a;this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:a}],[]);this._line.createServerPoints();return this};TradingView.ExecutionLineAdapter.prototype.getPrice=function(){if(0<this._line.points().size())return this._line.points().item(0).price;if(0<this._line._timePoint.size())return this._line._timePoint.item(0).price};
|
|
TradingView.ExecutionLineAdapter.prototype.setPrice=function(a){0<this._line.points().size()&&(this._line.points().item(0).price=a);0<this._line._timePoint.size()&&(this._line._timePoint.item(0).price=a);return this};TradingView.ExecutionLineAdapter.prototype.getText=function(){return this._line.properties().text.value()};TradingView.ExecutionLineAdapter.prototype.setText=function(a){this._line.properties().text.setValue(a||"");this._line.updateAllViewsAndRedraw();return this};
|
|
TradingView.ExecutionLineAdapter.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()};TradingView.ExecutionLineAdapter.prototype.setArrowHeight=function(a){this._line.properties().arrowHeight.setValue(a||5);return this};TradingView.ExecutionLineAdapter.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()};
|
|
TradingView.ExecutionLineAdapter.prototype.setArrowSpacing=function(a){this._line.properties().arrowSpacing.setValue(a||1);return this};TradingView.ExecutionLineAdapter.prototype.getDirection=function(){return this._line.properties().direction.value()};TradingView.ExecutionLineAdapter.prototype.setDirection=function(a){this._line.properties().direction.setValue(a||"buy");return this};
|
|
TradingView.ExecutionLineAdapter.prototype.getArrowColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)};TradingView.ExecutionLineAdapter.prototype.setArrowColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().arrowColor,this._line.properties().arrowTransparency);return this};
|
|
TradingView.ExecutionLineAdapter.prototype.getTextColor=function(){return TradingView.ChartTradingUtils.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)};TradingView.ExecutionLineAdapter.prototype.setTextColor=function(a){TradingView.ChartTradingUtils.setColorToProperties(a,this._line.properties().textColor,this._line.properties().textTransparency);return this};
|
|
TradingView.ExecutionLineAdapter.prototype.getFont=function(){return TradingView.ChartTradingUtils.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)};
|
|
TradingView.ExecutionLineAdapter.prototype.setFont=function(a){TradingView.ChartTradingUtils.setFontToProperties(a,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic);return this};TradingView.ExecutionLineAdapter.prototype.setTooltip=function(a){a=null==a?"":a+"";this._line.properties().tooltip.setValue(a);return this};TradingView.ExecutionLineAdapter.prototype.getTooltip=function(){return this._line.properties().tooltip.value()};
|
|
TradingView.ExecutionLineAdapter.prototype.remove=function(){this._line.D0.removeSource(this._line);delete this._line};TradingView.ExecutionRenderer=function(a,b){this._data=a;this._adapter=b};TradingView.ExecutionRenderer.prototype._textWidth=function(a){if(0===this._adapter.getText().length)return 0;a.save();a.font=this._adapter.getFont();var b=a.measureText(this._adapter.getText()).width;a.restore();return 5+b};
|
|
TradingView.ExecutionRenderer.prototype._drawArrow=function(a,b,c){a.save();a.strokeStyle=this._adapter.getArrowColor();a.fillStyle=this._adapter.getArrowColor();var d=this._adapter.getArrowHeight(),e=this._adapter.getDirection();a.transform(1,0,0,1,b,c);"buy"!=e&&a.rotate(Math.PI);CanvasEx.drawLine(a,0,0,0,d);CanvasEx.drawLine(a,-1,1,1,1);CanvasEx.drawLine(a,-2,2,2,2);a.restore()};
|
|
TradingView.ExecutionRenderer.prototype._drawText=function(a,b,c){var d=this._adapter.getText();d&&(a.save(),a.textAlign="center",a.textBaseline="middle",a.font=this._adapter.getFont(),a.fillStyle=this._adapter.getTextColor(),b+=this._textWidth(a)/2,c+=TradingView.ChartTradingUtils.fontHeight(this._adapter.getFont())/2,a.fillText(d,b,c-1),a.restore())};
|
|
TradingView.ExecutionRenderer.prototype.draw=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolExecution.POINTS_COUNT)){var b=Math.round(this._data.points.item(0).x+.5),c=Math.round(this._data.points.item(0).y);this._drawArrow(a,b,c);var d=this._textWidth(a);if(0!==d){var e=this._adapter.getArrowHeight(),f=this._adapter.getArrowSpacing(),g=TradingView.ChartTradingUtils.fontHeight(this._adapter.getFont()),c="buy"==this._adapter.getDirection()?c+e+f:c-e-f-g;this._drawText(a,
|
|
Math.round(b-d/2),c)}}};
|
|
TradingView.ExecutionRenderer.prototype.hitTest=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolExecution.POINTS_COUNT)){var b=Math.round(this._data.points.item(0).x),c=Math.round(this._data.points.item(0).y),d=this._adapter.getArrowHeight(),e;"buy"==this._adapter.getDirection()?(e=c,c+=d):e=c-d;if(a.x>=b-2&&a.x<=b+2&&a.y>=e&&a.y<=c)return a=this._adapter.getTooltip(),new TradingView.HitTestResult(TradingView.HitTestResult.CUSTOM,{mouseDownHandler:function(){TradingView.TradingWidget&&TradingView.TradingWidget.journalDialog()},
|
|
tooltip:""!=a?{text:a,rect:new TradingView.Rect(b,e,2,c-e)}:null})}};TradingView.ExecutionPaneView=function(a,b){J90.call(this,a,b)};inherit(TradingView.ExecutionPaneView,J90);TradingView.ExecutionPaneView.prototype._renderer=null;TradingView.ExecutionPaneView.prototype._rendererCached=!1;
|
|
TradingView.ExecutionPaneView.prototype.update=function(){J90.prototype.update.call(this);this._renderer=null;this._rendererCached=!1};
|
|
TradingView.ExecutionPaneView.prototype.renderer=function(){if(this._rendererCached)return this._renderer;this._rendererCached=!0;var a=this.R99,b=a._adapter,c=a.D0.timeScale();if(0===a.points().size())return null;var d=a.points().item(0).index;if(a=a.D0.mainSeries().bars().search(d,TradingView.SEARCH_NEAREST_LEFT))d=a.index;b._index=d;if(!isFinite(d))return this._renderer=null;a=c.visibleBars();if(!a||d>a.lastBar()||d<a.firstBar())return this._renderer=null;a=this.R99.D0.paneForSource(this.R99).executionsPositionController();
|
|
c=c.indexToCoordinate(d);d=a.getYCoordinate(b);if(!isFinite(d))return this._renderer=null;a=new List;a.append({x:c,y:d});return this._renderer=new TradingView.ExecutionRenderer({points:a},b)};
|
|
TradingView.LineToolExecution=function(a,b){this._adapter=new TradingView.ExecutionLineAdapter(this);this._constructor="LineToolExecution";var c=b||new J52("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0};R47.call(this,a,new TradingView.ExecutionPaneView(this,a),c)};inherit(TradingView.LineToolExecution,R47);TradingView.LineToolExecution.POINTS_COUNT=1;
|
|
TradingView.LineToolExecution.skipMagnetting=!0;TradingView.LineToolExecution.prototype.pointsCount=function(){return TradingView.LineToolExecution.POINTS_COUNT};TradingView.LineToolExecution.prototype.title=function(){return"Execution"};TradingView.LineToolExecution.prototype.hasContextMenu=function(){return!1};TradingView.LineToolExecution.prototype.state=function(){return null};
|
|
TradingView.LineToolExecution.prototype.paneViews=function(a){return TradingView.printing||!this.D0.properties().tradingProperties.showExecutions.value()?null:R47.prototype.paneViews.call(this,a)};TradingView.LineToolExecution.prototype.userEditEnabled=function(){return!1};TradingView.LineToolExecution.prototype.showInObjectTree=function(){return!1};TradingView.CycleArcRenderer=function(a){this._data=a};
|
|
TradingView.CycleArcRenderer.prototype.draw=function(a){a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);a.save();a.translate(this._data.point.x+1,this._data.point.y);a.scale(this._data.width,this._data.height);a.beginPath();a.arc(.5,0,.5,Math.PI,0,!1);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.fill())};
|
|
TradingView.CycleArcRenderer.prototype.hitTest=function(a){if(a.y>this._data.point.y||a.x<this._data.point.x||a.x>this._data.point.x+this._data.width)return null;var b=new MathEx.Point(this._data.point.x+this._data.width/2,this._data.point.y);a=a.substract(b);a.y/=this._data.height/this._data.width;a=a.length();return 3>Math.abs(a-this._data.width/2)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
TradingView.TimeCyclesPaneView=function(a,b){J90.call(this,a,b)};inherit(TradingView.TimeCyclesPaneView,J90);
|
|
TradingView.TimeCyclesPaneView.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.R99.points(),b=a.item(0),a=a.item(1),c=Math.min(b.index,a.index),d=Math.max(b.index,a.index),e=d-c,b=this._points.item(0),f=this._points.item(1),a=Math.abs(b.x-f.x),g=new TradingView.CompositeRenderer,h=this.R99.properties(),k=this.D0.timeScale();if(0===e)return null;for(var l=Math.min(b.x,f.x),m=[];l>-a;c-=e)l=k.indexToCoordinate(c),m.push(l);l=Math.max(b.x,f.x);for(c=d;l<k.width();c+=
|
|
e)l=k.indexToCoordinate(c),m.push(l);for(c=0;c<m.length;c++)d={point:new MathEx.Point(m[c],b.y),width:a,height:a,color:h.linecolor.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),fillBackground:h.fillBackground.value(),backcolor:h.backgroundColor.value(),transparency:h.transparency.value()},d=new TradingView.CycleArcRenderer(d),g.append(d);this.addAnchors(g);return g};
|
|
TradingView.LineToolTimeCycles=function(a,b){this._constructor="LineToolTimeCycles";var c;c=b?b:new J52("linetooltimecycles");R47.call(this,a,new TradingView.TimeCyclesPaneView(this,a),c)};inherit(TradingView.LineToolTimeCycles,R47);TradingView.LineToolTimeCycles.prototype.pointsCount=function(){return 2};TradingView.LineToolTimeCycles.prototype.title=function(){return"Time Cycles"};
|
|
TradingView.LineToolTimeCycles.prototype.setPoint=function(a,b,c){c=this._points.item(0);var d=this._points.item(1),e=this.priceScale();if(e.isPercent()){var f=this.ownerSource().firstValue();b.price=e.priceRange().convertFromPercent(b.price,f)}c.price=b.price;d.price=b.price;this._points.setItem(a,b);this.normalizePoints()};
|
|
TradingView.LineToolTimeCycles.prototype.addPoint=function(a,b,c){if(a=R47.prototype.addPoint.call(this,a,b,!0))b=this._points.item(0),this._points.item(1).price=b.price,c||(this.normalizePoints(),this.createServerPoints());return a};TradingView.SineRenderer=function(a){this._data=a};TradingView.SineRenderer.prototype.draw=function(a){a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);a.beginPath();a.moveTo(this._data.point.x,this._data.point.y);for(var b=1;b<=2*this._data.width;b++){var c=Math.sin(b*Math.PI/this._data.width-Math.PI/2)*this._data.height/2;a.lineTo(this._data.point.x+b,this._data.point.y+c+this._data.height/2)}a.stroke()};
|
|
TradingView.SineRenderer.prototype.hitTest=function(a){if(a.x<this._data.point.x||a.x>this._data.point.x+2*this._data.width)return null;var b=Math.sin((a.x-this._data.point.x)*Math.PI/this._data.width-Math.PI/2)*this._data.height/2,b=this._data.point.y+b+this._data.height/2;return 3>=Math.abs(b-a.y)?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};TradingView.SineLinePaneView=function(a,b){J90.call(this,a,b)};
|
|
inherit(TradingView.SineLinePaneView,J90);
|
|
TradingView.SineLinePaneView.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.R99.points(),b=a.item(0),a=a.item(1),c=Math.min(b.index,a.index),d=2*(Math.max(b.index,a.index)-c),b=this._points.item(0),a=this._points.item(1),e=Math.abs(b.x-a.x),f=a.y-b.y,g=new TradingView.CompositeRenderer,h=this.R99.properties(),k=this.D0.timeScale();if(0===d)return null;for(var l=k.indexToCoordinate(c),m=[],n=c;l>-e;n-=d)l=k.indexToCoordinate(n),m.push(l);l=l=k.indexToCoordinate(c+
|
|
d);for(n=c+d;l<k.width();n+=d)l=k.indexToCoordinate(n),m.push(l);for(c=0;c<m.length;c++)d=new MathEx.Point(m[c],b.y),new MathEx.Point(m[c]+e,a.y),d={point:d,width:e,height:f,color:h.linecolor.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value()},d=new TradingView.SineRenderer(d),g.append(d);this.addAnchors(g);return g};
|
|
TradingView.LineToolSineLine=function(a,b){this._constructor="LineToolSineLine";var c;c=b?b:new J52("linetoolsineline");R47.call(this,a,new TradingView.SineLinePaneView(this,a),c)};inherit(TradingView.LineToolSineLine,R47);TradingView.LineToolSineLine.prototype.pointsCount=function(){return 2};TradingView.LineToolSineLine.prototype.title=function(){return"Sine Line"};TradingView.quadroBezierHitTest=function(a,b,c,d){for(var e=3/(c.substract(a).length()+c.substract(b).length()),f=0;1>=f;f+=e){var g=a.scaled((1-f)*(1-f)),h=c.scaled(2*f*(1-f)),k=b.scaled(f*f);if(5>g.add(h).add(k).substract(d).length())return!0}return null};
|
|
TradingView.cubicBezierHitTest=function(a,b,c,d,e){for(var f=3/(c.substract(a).length()+d.substract(c).length()+b.substract(d).length()),g=0;1>=g;g+=f){var h=a.scaled((1-g)*(1-g)*(1-g)),k=c.scaled(3*(1-g)*(1-g)*g),l=d.scaled(3*(1-g)*g*g),m=b.scaled(g*g*g);if(5>h.add(k).add(l).add(m).substract(e).length())return!0}};
|
|
TradingView.extendQuandroBezier=function(a,b,c,d,e){d=c.substract(a).length()+c.substract(b).length();if(!d)return[];d=3/d;e=[];for(var f=1;f<=500*d;f+=d){var g=a.scaled((1-f)*(1-f)),h=c.scaled(2*f*(1-f)),k=b.scaled(f*f),g=g.add(h).add(k);0<e.length&&2>e[e.length-1].substract(g).length()&&(d*=2);e.push(g)}return e};TradingView.BezierQuadroRenderer=function(a){this._data=a};
|
|
TradingView.BezierQuadroRenderer.prototype.draw=function(a){var b=this._data.points.item(0),c=this._data.points.item(1);a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);if(2==this._data.points.size())a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke();else{var d=this._data.points.item(2),e=c.substract(b),f=d.substract(e.scaled(.25)),e=d.add(e.scaled(.25));this._data.fillBack&&2<this._data.points.size()&&(a.fillStyle=
|
|
TradingView.generateColor(this._data.backcolor,this._data.transparency),a.beginPath(),a.moveTo(b.x,b.y),a.quadraticCurveTo(f.x,f.y,d.x,d.y),a.quadraticCurveTo(e.x,e.y,c.x,c.y),a.fill());a.beginPath();a.moveTo(b.x,b.y);if(0<this._data.extendLeftPoints.length){var g=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1];a.moveTo(g.x,g.y);for(g=this._data.extendLeftPoints.length-2;0<=g;g--){var h=this._data.extendLeftPoints[g];a.lineTo(h.x,h.y)}}a.quadraticCurveTo(f.x,f.y,d.x,d.y);a.quadraticCurveTo(e.x,
|
|
e.y,c.x,c.y);for(g=0;g<this._data.extendRightPoints.length;g++)h=this._data.extendRightPoints[g],a.lineTo(h.x,h.y);a.stroke();this._data.leftend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(f,b,a,a.lineWidth);this._data.rightend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(e,c,a,a.lineWidth)}};
|
|
TradingView.BezierQuadroRenderer.prototype.hitTest=function(a){if(3==this._data.points.size()){var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),e=c.substract(b),f=d.substract(e.scaled(.25)),e=d.add(e.scaled(.25));if(TradingView.quadroBezierHitTest(d,b,f,a)||TradingView.quadroBezierHitTest(d,c,e,a))return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);for(d=1;d<this._data.extendLeftPoints.length;d++)if(b=this._data.extendLeftPoints[d-1],c=
|
|
this._data.extendLeftPoints[d],b=MathEx.distanceToSegment(b,c,a).distance,3>b)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);for(d=1;d<this._data.extendRightPoints.length;d++)if(b=this._data.extendRightPoints[d-1],c=this._data.extendRightPoints[d],b=MathEx.distanceToSegment(b,c,a).distance,3>b)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)}return null};
|
|
TradingView.BezierQuadroPaneView=function(a,b){J90.call(this,a,b);this._invalidated=!0};inherit(TradingView.BezierQuadroPaneView,J90);TradingView.BezierQuadroPaneView.prototype.update=function(){J90.prototype.update.call(this);this._invalidated=!0};
|
|
TradingView.BezierQuadroPaneView.prototype.updateImpl=function(){this._extendLeftPoints=[];this._extendRightPoints=[];if(!(3>this.R99.points().size())){var a=this.R99.pointToScreenPoint(this.R99.points().item(0))[1],b=this.R99.pointToScreenPoint(this.R99.points().item(1))[1],c=this.R99.pointToScreenPoint(this.R99.points().item(2))[1],d=b.substract(a),e=c.substract(d.scaled(.25)),d=c.add(d.scaled(.25)),f=this.D0.timeScale().width(),g=this.R99.priceScale().height();
|
|
this.R99.properties().extendLeft.value()&&(this._extendLeftPoints=TradingView.extendQuandroBezier(c,a,e,f,g));this.R99.properties().extendRight.value()&&(this._extendRightPoints=TradingView.extendQuandroBezier(c,b,d,f,g))}};
|
|
TradingView.BezierQuadroPaneView.prototype.renderer=function(){if(2>this._points.size())return new TradingView.CompositeRenderer;this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a=(new List).appendAll(this._points);this.R99._controlPoint&&a.append(this.R99.pointToScreenPoint(this.R99._controlPoint)[0]);var b={},c=this.R99.properties();b.points=a;b.color=c.linecolor.value();b.linewidth=c.linewidth.value();b.linestyle=c.linestyle.value();b.leftend=c.leftEnd.value();b.rightend=
|
|
c.rightEnd.value();b.fillBack=c.fillBackground.value();b.backcolor=c.backgroundColor.value();b.transparency=c.transparency.value();b.extendLeftPoints=this._extendLeftPoints;b.extendRightPoints=this._extendRightPoints;a=new TradingView.CompositeRenderer;a.append(new TradingView.BezierQuadroRenderer(b));this.addAnchors(a);return a};
|
|
TradingView.LineToolBezierQuadro=function(a,b){this._constructor="LineToolBezierQuadro";var c;c=b?b:new J52("linetoolbezierquadro");R47.call(this,a,new TradingView.BezierQuadroPaneView(this,a),c)};inherit(TradingView.LineToolBezierQuadro,R47);TradingView.LineToolBezierQuadro.prototype.pointsCount=function(){return 2};TradingView.LineToolBezierQuadro.prototype.title=function(){return"Curve"};
|
|
TradingView.LineToolBezierQuadro.prototype.controlPoint=function(){var a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(1))[0],c=b.substract(a).scaled(.5).transponed().scaled(.3),a=a.add(b).scaled(.5).add(c);return this.screenPointToPoint(a)};TradingView.LineToolBezierQuadro.prototype.setLastPoint=function(a,b){R47.prototype.setLastPoint.call(this,a,b);this._controlPoint=this.controlPoint()};
|
|
TradingView.LineToolBezierQuadro.prototype.addPoint=function(a,b,c){if(a=R47.prototype.addPoint.call(this,a,b,!0))b=this.controlPoint(),this._points.append(b),delete this._controlPoint,c||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2);return a};TradingView.LineToolBezierQuadro.prototype.restorePoints=function(a,b,c){R47.prototype.restorePoints.call(this,a,b,c);this._createPointProperty(2)};
|
|
TradingView.BezierCubicRenderer=function(a){this._data=a};
|
|
TradingView.BezierCubicRenderer.prototype.draw=function(a){a.lineCap="butt";a.strokeStyle=this._data.color;a.lineWidth=this._data.linewidth;CanvasEx.setLineStyle(a,this._data.linestyle);var b=this._data.points.item(0),c=this._data.points.item(1);if(2==this._data.points.size())a.beginPath(),a.moveTo(b.x,b.y),a.lineTo(c.x,c.y),a.stroke(),this._data.leftend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(c,b,a,a.lineWidth),this._data.rightend==R47.LINEEND_ARROW&&
|
|
TradingView.TrendLineRenderer.prototype.drawArrow(b,c,a,a.lineWidth);else{var d=this._data.points.item(2),e=this._data.points.item(3),f=e.substract(b),g=d.substract(f.scaled(.25)),f=d.add(f.scaled(.25)),h=c.substract(d),k=e.substract(h.scaled(.25)),h=e.add(h.scaled(.25));this._data.fillBack&&2<this._data.points.size()&&(a.fillStyle=TradingView.generateColor(this._data.backcolor,this._data.transparency),a.beginPath(),a.moveTo(b.x,b.y),a.quadraticCurveTo(g.x,g.y,d.x,d.y),a.bezierCurveTo(f.x,f.y,k.x,
|
|
k.y,e.x,e.y),a.quadraticCurveTo(h.x,h.y,c.x,c.y),a.fill());a.beginPath();if(0<this._data.extendLeftPoints.length){var l=this._data.extendLeftPoints[this._data.extendLeftPoints.length-1];a.moveTo(l.x,l.y);for(l=this._data.extendLeftPoints.length-2;0<=l;l--){var m=this._data.extendLeftPoints[l];a.lineTo(m.x,m.y)}}a.moveTo(b.x,b.y);a.quadraticCurveTo(g.x,g.y,d.x,d.y);a.bezierCurveTo(f.x,f.y,k.x,k.y,e.x,e.y);a.quadraticCurveTo(h.x,h.y,c.x,c.y);for(l=0;l<this._data.extendRightPoints.length;l++)m=this._data.extendRightPoints[l],
|
|
a.lineTo(m.x,m.y);a.stroke();this._data.leftend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(g,b,a,a.lineWidth);this._data.rightend==R47.LINEEND_ARROW&&TradingView.TrendLineRenderer.prototype.drawArrow(h,c,a,a.lineWidth)}};
|
|
TradingView.BezierCubicRenderer.prototype.hitTest=function(a){if(4==this._data.points.size()){var b=this._data.points.item(0),c=this._data.points.item(1),d=this._data.points.item(2),e=this._data.points.item(3),f=e.substract(b),g=d.substract(f.scaled(.25)),f=d.add(f.scaled(.25)),h=c.substract(d),k=e.substract(h.scaled(.25)),h=e.add(h.scaled(.25));if(TradingView.quadroBezierHitTest(d,b,g,a)||TradingView.cubicBezierHitTest(d,e,f,k,a)||TradingView.quadroBezierHitTest(e,c,h,a))return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);
|
|
for(d=1;d<this._data.extendLeftPoints.length;d++)if(b=this._data.extendLeftPoints[d-1],c=this._data.extendLeftPoints[d],b=MathEx.distanceToSegment(b,c,a).distance,3>b)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT);for(d=1;d<this._data.extendRightPoints.length;d++)if(b=this._data.extendRightPoints[d-1],c=this._data.extendRightPoints[d],b=MathEx.distanceToSegment(b,c,a).distance,3>b)return new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT)}return null};
|
|
TradingView.BezierCubicPaneView=function(a,b){J90.call(this,a,b);this._invalidated=!0};inherit(TradingView.BezierCubicPaneView,J90);TradingView.BezierCubicPaneView.prototype.update=function(){J90.prototype.update.call(this);this._invalidated=!0};
|
|
TradingView.BezierCubicPaneView.prototype.updateImpl=function(){this._extendLeftPoints=[];this._extendRightPoints=[];if(!(4>this.R99.points().size())){var a=this.R99.pointToScreenPoint(this.R99.points().item(0))[1],b=this.R99.pointToScreenPoint(this.R99.points().item(1))[1],c=this.R99.pointToScreenPoint(this.R99.points().item(2))[1],d=this.R99.pointToScreenPoint(this.R99.points().item(3))[1],e=d.substract(a),f=c.substract(e.scaled(.25));c.add(e.scaled(.25));e=b.substract(c);
|
|
d.substract(e.scaled(.25));var e=d.add(e.scaled(.25)),g=this.D0.timeScale().width(),h=this.R99.priceScale().height();this.R99.properties().extendLeft.value()&&(this._extendLeftPoints=TradingView.extendQuandroBezier(c,a,f,g,h));this.R99.properties().extendRight.value()&&(this._extendRightPoints=TradingView.extendQuandroBezier(d,b,e,g,h))}};
|
|
TradingView.BezierCubicPaneView.prototype.renderer=function(){if(2>this._points.size())return new TradingView.CompositeRenderer;this._invalidated&&(this.updateImpl(),this._invalidated=!1);var a=(new List).appendAll(this._points);this.R99._controlPoints&&(a.append(this.R99.pointToScreenPoint(this.R99._controlPoints[0])[0]),a.append(this.R99.pointToScreenPoint(this.R99._controlPoints[1])[0]));var b={},c=this.R99.properties();b.points=a;b.color=c.linecolor.value();b.linewidth=
|
|
c.linewidth.value();b.linestyle=c.linestyle.value();b.leftend=c.leftEnd.value();b.rightend=c.rightEnd.value();b.fillBack=c.fillBackground.value();b.backcolor=c.backgroundColor.value();b.transparency=c.transparency.value();b.extendLeftPoints=this._extendLeftPoints;b.extendRightPoints=this._extendRightPoints;a=new TradingView.CompositeRenderer;a.append(new TradingView.BezierCubicRenderer(b));this.addAnchors(a);return a};
|
|
TradingView.LineToolBezierCubic=function(a,b){this._constructor="LineToolBezierCubic";var c;c=b?b:new J52("linetoolbeziercubic");R47.call(this,a,new TradingView.BezierCubicPaneView(this,a),c)};inherit(TradingView.LineToolBezierCubic,R47);TradingView.LineToolBezierCubic.prototype.pointsCount=function(){return 2};TradingView.LineToolBezierCubic.prototype.title=function(){return"Double Curve"};
|
|
TradingView.LineToolBezierCubic.prototype.controlPoints=function(){var a=this.pointToScreenPoint(this.points().item(0))[0],b=this.pointToScreenPoint(this.points().item(1))[0],c=b.substract(a).scaled(.5).transponed().scaled(.3),d=a.add(b).scaled(.33),a=a.add(b).scaled(.67),d=d.add(c),c=a.substract(c);return[this.screenPointToPoint(d),this.screenPointToPoint(c)]};
|
|
TradingView.LineToolBezierCubic.prototype.setLastPoint=function(a,b){R47.prototype.setLastPoint.call(this,a,b);this._controlPoints=this.controlPoints()};
|
|
TradingView.LineToolBezierCubic.prototype.addPoint=function(a,b,c){if(a=R47.prototype.addPoint.call(this,a,b,!0))b=this.controlPoints(),delete this._controlPoints,this._points.append(b[0]).append(b[1]),c||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3);return a};
|
|
TradingView.LineToolBezierCubic.prototype.restorePoints=function(a,b,c){R47.prototype.restorePoints.call(this,a,b,c);this._createPointProperty(2);this._createPointProperty(3)};A24=function(a,b,c){var d=this._mtpStudyId()+"@mtp-mtpredictor";c=c||TradingView.StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),d);b=b||TradingView.prepareStudyProperties(c,null,null,a.studyVersioning());d=TradingView.Study.lineToolNameForPointsBasedStudy(d);A63.call(this,a,this.createPaneViews(a),b,d);this._doNotNeedLine=!0;this._turnaroundCounter=0;this._nextTurnaround();this._metaInfo=c;this._graphics=new A62(c);this._formatter=
|
|
new TradingView.VolumeFormatter};inherit(A24,A63);A24.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()};A24.prototype.calcIsActualSymbol=function(){return R47.prototype.calcIsActualSymbol.call(this)};
|
|
A24.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter};A24.prototype.createPaneViews=function(a){return[new R31(this,a),new TradingView.Study.StudyPaneView_textmarks(this,a),new TradingView.Study.StudyPaneView_polygons(this,a),new TradingView.Study.StudyPaneView_lines(this,a)]};
|
|
A24.prototype.onData=function(a){"data_update"===a.method&&a.params.customId==="pointset_"+this._currentPointsetId?(R47.prototype.onData.call(this,a),this._points.size()==this.pointsCount()&&this._requestStudy()):"data_update"===a.method&&a.params.customId===this._studyId&&this._checkTurnaround(a.params.turnaround)&&(a.params.nonseries.d=""!==a.params.nonseries.d?JSON.parse(a.params.nonseries.d):"",""!==a.params.nonseries.d&&this._graphics.process(a.params.nonseries),
|
|
0<a.params.nonseries.indexes.length&&(this._indexes=a.params.nonseries.indexes),this.updateAllViews(),this.D0.updateSource(this))};
|
|
A24.prototype._requestStudy=function(){var a=this,b=function(b){a.onData(b)},c=this._studyInputs();c&&(this._studyId?(this._nextTurnaround(),this.D0.chartApi().modifyStudy(this._studyId,this._turnaround,c,b)):(this._studyId=TradingView.Study.makeNextStudyId(),this.D0.chartApi().createStudy(this._studyId,this._turnaround,this.D0.mainSeries()._seriesId,this._metaInfo.id+"-1!",c,b)))};A37=function(a,b,c){A24.call(this,a,b,c)};inherit(A37,A24);A37.prototype._mtpStudyId=function(){return"mtp_riskreward"};A37.prototype.pointsCount=function(){return 3};
|
|
A37.getTooltipText=function(a){return a&&0!==a._points.size()?1==a._points.size()?"Select Stop Bar":2==a._points.size()?"Select Target Point":null:"Select Entry Setup Bar"};
|
|
A37.prototype._studyInputs=function(){var a=this.points().item(0).index,b=this.points().item(1).index,c=this.points().item(2).index,a=this.D0.mainSeries().bars().valueAt(a),b=this.D0.mainSeries().bars().valueAt(b),c=this.D0.mainSeries().bars().valueAt(c);return a&&b&&c?[1E3*a[TradingView.TIME_PLOT],1E3*b[TradingView.TIME_PLOT],1E3*c[TradingView.TIME_PLOT],this.points().item(2).price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),
|
|
this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()]:null};A26=function(a,b,c){A24.call(this,a,b,c);this._symbolIntervalChanged=!1;this.D0.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)};inherit(A26,A24);A26.prototype._mtpStudyId=function(){return"mtp_decisionpoint"};
|
|
A26.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0};A26.prototype.pointsCount=function(){return 1};A26.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1E3*a[TradingView.TIME_PLOT]]:null};
|
|
A26.prototype.onData=function(a){A24.prototype.onData.call(this,a);this._symbolIntervalChanged=!1};A33=function(a,b,c){A24.call(this,a,b,c)};inherit(A33,A24);A33.prototype.pointsCount=function(){return 1};A33.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[TradingView.TIME_PLOT]]:null};
|
|
A34=function(a,b,c){A33.call(this,a,b,c)};inherit(A34,A33);A34.prototype._mtpStudyId=function(){return"mtp_ew_main"};A35=function(a,b,c){A33.call(this,a,b,c)};inherit(A35,A33);
|
|
A35.prototype._mtpStudyId=function(){return"mtp_ew_major"};A36=function(a,b,c){A33.call(this,a,b,c)};inherit(A36,A33);A36.prototype._mtpStudyId=function(){return"mtp_ew_minor"};A25=function(a,b,c){A24.call(this,a,b,c)};inherit(A25,A24);A25.prototype._mtpStudyId=function(){return"mtp_tsanalysis"};A25.prototype.pointsCount=function(){return 1};
|
|
A25.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D0.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),
|
|
this.properties().inputs.shouldFilterSTFTrends.value()]:null};A44=function(a,b,c,d,e){this._wptStudyId=d;this._pointsCount=e;A24.call(this,a,b,c)};inherit(A44,A24);
|
|
A44.prototype._studyInputs=function(){for(var a=[this.properties().inputs.displayZoneLabels.value()],b=0;b<this.pointsCount();++b){var c=this.points().item(b).index,c=this.D0.mainSeries().bars().valueAt(c);if(!c)return null;a.push(1E3*c[TradingView.TIME_PLOT])}return a};A44.prototype._mtpStudyId=function(){return this._wptStudyId};A44.prototype.pointsCount=function(){return this._pointsCount};
|
|
A27=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down1ora",2)};inherit(A27,A44);A27.getTooltipText=function(a){return"Down Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};A28=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down2orb",2)};
|
|
inherit(A28,A44);A28.getTooltipText=function(a){return"Down Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};A29=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down3",3)};inherit(A29,A44);
|
|
A29.getTooltipText=function(a){return"Down Wave 3: Select Point "+((a?a._points.size():0)+1)};A30=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down4",2)};inherit(A30,A44);A30.getTooltipText=function(a){return"Down Wave 4: Select Point "+((a?a._points.size():0)+1)};
|
|
A31=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_down5",5)};inherit(A31,A44);A31.getTooltipText=function(a){return"Down Wave 5: Select Point "+((a?a._points.size():0)+1)};A32=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_downc",3)};
|
|
inherit(A32,A44);A32.getTooltipText=function(a){return"Down Wave C: Select Point "+((a?a._points.size():0)+1)};A38=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up1ora",2)};inherit(A38,A44);
|
|
A38.getTooltipText=function(a){return"Up Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};A39=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up2orb",2)};inherit(A39,A44);A39.getTooltipText=function(a){return"Up Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};
|
|
A40=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up3",3)};inherit(A40,A44);A40.getTooltipText=function(a){return"Up Wave 3: Select Point "+((a?a._points.size():0)+1)};A41=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up4",2)};
|
|
inherit(A41,A44);A41.getTooltipText=function(a){return"Up Wave 4: Select Point "+((a?a._points.size():0)+1)};A42=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_up5",5)};inherit(A42,A44);
|
|
A42.getTooltipText=function(a){return"Up Wave 5: Select Point "+((a?a._points.size():0)+1)};A43=function(a,b,c){A44.call(this,a,b,c,"mtp_wpt_upc",3)};inherit(A43,A44);A43.getTooltipText=function(a){return"Up Wave C: Select Point "+((a?a._points.size():0)+1)};TradingView.MarkRenderer=function(a){this._data=a};TradingView.MarkRenderer.prototype.draw=function(a){if(0!==this._data.points.length){var b=this._data.points[0].x+this._data.offsetX,c=this._data.points[0].y+this._data.offsetY;a.translate(-.5,-.5);a.drawImage(this._data.image,b,c,this._data.width,this._data.height)}};
|
|
TradingView.MarkRenderer.prototype.hitTest=function(a){if(0===this._data.points.length)return null;var b=this._data.points[0].clone();this._data.offsetX&&(b.x+=this._data.offsetX);this._data.offsetY&&(b.y+=this._data.offsetY);return MathEx.pointInRect(a,b,b.add(new MathEx.Point(this._data.width,this._data.height)))?new TradingView.HitTestResult(TradingView.HitTestResult.MOVEPOINT):null};
|
|
J97=function(a,b,c,d,e,f,g){J90.call(this,a,b);this._image=c;this._offsetX=f||0;this._offsetY=g||0;this._width=d;this._height=e};inherit(J97,J90);J97.prototype.setAnchors=function(a){this._anchorsOffset=a};
|
|
J97.prototype.renderer=function(){var a={};a.points=this._points.toArray();a.color=this.R99.properties().color.value();a.image=this._image;a.offsetX=this._offsetX;a.offsetY=this._offsetY;a.width=this._width;a.height=this._height;if(this.isAnchorsRequired()&&1==a.points.length){var b=new TradingView.CompositeRenderer;b.append(new TradingView.MarkRenderer(a));if(this._anchorsOffset){for(var c=[],d=0;d<a.points.length;d++)c.push(a.points[d].clone().add(this._anchorsOffset));
|
|
b.append(new TradingView.SelectionRenderer({points:c}))}else b.append(new TradingView.SelectionRenderer({points:a.points}));return b}return new TradingView.MarkRenderer(a)};J97.prototype.update=function(){J90.prototype.update.call(this)};TradingView.ChartModel.version=2;
|
|
TradingView.ChartModel.prototype.state=function(a){for(var b={panes:[]},c=0;c<this.panes().length;c++)b.panes.push(this.panes()[c].state(!0,a));b.timeScale=this.m_timeScale.state(a);c=this.publishedChartsTimelineSource();b.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),publishedChartsTimelineProperties:c?c.state(a):void 0};b.version=TradingView.ChartModel.version;b.timezone=this.timezone();return b};
|
|
TradingView.ChartModel.prototype.asyncState=function(a){return this.publishedChartsTimelineSource().asyncState(a).pipe(function(a){var c={};c.chartProperties={publishedChartsTimelineProperties:a};return c})};
|
|
TradingView.ChartModel.prototype.restoreState=function(a,b){var c={};if(a.panes)if(Array.isArray(a.panes))if(1>a.panes.length)TradingView.logDebugChart("TradingView.ChartModel.restoreState: invalid state");else{a.chartProperties&&!a.chartProperties.timezone&&(a.chartProperties.timezone=a.timezone);if(a.chartProperties){var d=TradingView.factoryDefaults("chartproperties").scalesProperties;TradingView.merge(d,a.chartProperties.scalesProperties);!("showLastValue"in d)||"showSeriesLastValue"in d||"showStudyLastValue"in
|
|
d||(d.showSeriesLastValueProperty=d.showLastValue,d.showStudyLastValueProperty=d.showLastValue);"showSeriesLastValue"in d&&(c.showSeriesLastValueProperty=!0);"showStudyLastValue"in d&&(c.showStudyLastValueProperty=!0);a.chartProperties.paneProperties.vertGridProperties=a.chartProperties.paneProperties.vertGridProperties||TradingView.clone(a.chartProperties.paneProperties.gridProperties);a.chartProperties.paneProperties.horzGridProperties=a.chartProperties.paneProperties.horzGridProperties||TradingView.clone(a.chartProperties.paneProperties.gridProperties);
|
|
this.D2.paneProperties.merge(a.chartProperties.paneProperties);this.D2.scalesProperties.merge(d);a.chartProperties.timezone&&this.D2.timezone.setValue(a.chartProperties.timezone);this.m_timeScale.restoreState(a.timeScale,b)}a.timeScale&&this.m_timeScale.restoreState(a.timeScale,b);d=a.panes;this.panes()[0].restoreState(d[0],b,a.version,c);for(d=1;d<a.panes.length;d++)(this.panes()[d]||this.createPane()).restoreState(a.panes[d],b,a.version,c);a.chartProperties&&a.chartProperties.publishedChartsTimelineProperties&&
|
|
this.publishedChartsTimelineSource().restoreData(a.chartProperties.publishedChartsTimelineProperties,b);this._invalidateBarColorerCaches();c=this.D19();for(d=0;d<c.length;d++){var e=c[d];TradingView.isInherited(e.constructor,R47)&&e.calcIsActualSymbol()}this._version=a.version;this.timeScale().recalcLockedScale();this.recalculateAllPanes();this.D20(new A22(A22.FULL_UPDATE))}else TradingView.logDebugChart("TradingView.ChartModel.restoreState: invalid state");
|
|
else TradingView.logDebugChart("TradingView.ChartModel.restoreState: invalid state")};
|
|
TradingView.ChartModel.prototype.restoreAxisState=function(a){if(a.panes)if(Array.isArray(a.panes))if(1>a.panes.length)TradingView.logDebugChart("TradingView.ChartModel.restoreAxisState: invalid state");else{this.m_timeScale.restoreState(a.timeScale,!1,!0);for(var b=0;b<a.panes.length;b++){var c=this.panes()[b];c.m_leftPriceScale.restoreState(a.panes[b].leftAxisState);c.m_rightPriceScale.restoreState(a.panes[b].rightAxisState)}this.recalculateAllPanes();this.D20(new A22(A22.FULL_UPDATE))}else TradingView.logDebugChart("TradingView.ChartModel.restoreAxisState: invalid state");
|
|
else TradingView.logDebugChart("TradingView.ChartModel.restoreAxisState: invalid state")};
|
|
R75.prototype.state=function(a,b,c){function d(a){return c&&!a.isSavedInStudyTemplates()||a instanceof TradingView.AlertLabel||!a.state||!a.state()||!a.isSavedInChart(b)}var e={};if(a)for(e.sources=[],a=0;a<this.m_dataSources.length;a++)d(this.m_dataSources[a])||e.sources.push(this.m_dataSources[a].state(b));e.leftAxisState=this.m_leftPriceScale.state();e.leftAxisSources=[];for(a=0;a<this.m_leftPriceScale.D19().length;a++)d(this.m_leftPriceScale.D19()[a])||e.leftAxisSources.push(this.m_leftPriceScale.D19()[a].id());
|
|
e.rightAxisState=this.m_rightPriceScale.state();e.rightAxisSources=[];for(a=0;a<this.m_rightPriceScale.D19().length;a++)d(this.m_rightPriceScale.D19()[a])||e.rightAxisSources.push(this.m_rightPriceScale.D19()[a].id());e.overlayPriceScales={};for(a=0;a<this.m_dataSources.length;a++){var f=this.m_dataSources[a];this.isOverlay(f)&&f.isSavedInChart(b)&&(e.overlayPriceScales[f.id()]=f.priceScale().state())}e.stretchFactor=this._stretchFactor;this.m_mainDataSource&&(e.mainSourceId=
|
|
this.m_mainDataSource.id());return e};R75.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.length;b++)if(this.m_dataSources[b].id()===a)return this.m_dataSources[b];return null};R75.prototype.isESDStudy=function(a){return"Script$TV_EARNINGS@tv-scripting"==a.id||"Script$TV_DIVIDENDS@tv-scripting"==a.id||"Script$TV_SPLITS@tv-scripting"==a.id};
|
|
R75.prototype.restoreState=function(a,b,c,d){d=d||{};if(!a.leftAxisState||!a.rightAxisState)throw Error("invalid state");if(!a.leftAxisSources||!a.rightAxisSources)throw Error("invalid state");a.stretchFactor&&(this._stretchFactor=a.stretchFactor);var e={};if(a.sources){var f=-1!==this.m_dataSources.indexOf(this.D0.mainSeries());this.clearSeries();f&&this.m_dataSources.push(this.D0.mainSeries());for(var g=0;g<a.sources.length;g++){var h=a.sources[g];1E200<Math.abs(h.zorder)&&(console.warn("Datasource zorder has bad value: "+
|
|
h.zorder+" Resetting it to -1"),h.zorder=-1);var k=h.id;e[k]=h.ownerSource;var l=h.type;"MainSeries"===l?this._restoreMainSeries(h,b,f,d):l.toLowerCase().startsWith("study")?this._restoreStudy(h,b,d):this._restoreLineTool(h,b)}}this.m_leftPriceScale.D19().splice(0,Infinity);this.m_leftPriceScale._hasSeries=!1;f=defaults("chartproperties").paneProperties.leftAxisProperties;TradingView.merge(f,a.leftAxisState);this.m_leftPriceScale.restoreState(f);for(g=0;g<a.leftAxisSources.length;g++)if(d=
|
|
this.dataSourceForId(a.leftAxisSources[g]))void 0!==f.m_showSymbolLabels&&d instanceof TradingView.Series&&this.model().properties().scalesProperties.showSymbolLabels.setValue(f.m_showSymbolLabels),this.m_leftPriceScale.addDataSource(d),d.setPriceScale(this.m_leftPriceScale);this.m_rightPriceScale.D19().splice(0,Infinity);this.m_rightPriceScale._hasSeries=!1;f=defaults("chartproperties").paneProperties.rightAxisProperties;TradingView.merge(f,a.rightAxisState);this.m_rightPriceScale.restoreState(f);
|
|
for(g=0;g<a.rightAxisSources.length;g++)if(d=this.dataSourceForId(a.rightAxisSources[g]))void 0!==f.m_showSymbolLabels&&d instanceof TradingView.Series&&this.model().properties().scalesProperties.showSymbolLabels.setValue(f.m_showSymbolLabels),this.m_rightPriceScale.addDataSource(d),d.setPriceScale(this.m_rightPriceScale);b&&this.D2.legendProperties.merge(defaults("chartproperties.paneProperties.legendProperties"));for(g=0;g<this.m_dataSources.length;g++)d=this.m_dataSources[g],-1===this.m_rightPriceScale.D19().indexOf(d)&&
|
|
-1===this.m_leftPriceScale.D19().indexOf(d)?(d._isOverlay=!0,b=new R76(this.D2.overlayPropreties),b.setHeight(this.m_height),b.setTopMargin(this.m_rightPriceScale.topMargin()),b.setBottomMargin(this.m_rightPriceScale.bottomMargin()),b.addDataSource(d),a.overlayPriceScales&&a.overlayPriceScales[d.id()]&&(f=a.overlayPriceScales[d.id()],f.m_isAutoScale=!0,f.m_isLog=!1,f.m_isPercentage=!1,b.restoreState(f)),d.setPriceScale(b)):d._isOverlay=!1;for(k in e)(g=e[k])&&(d=this.sourceById(k))&&
|
|
this.sourceById(k).setOwnerSource(this.sourceById(g));a.mainSourceId&&(this.m_mainDataSource=this.dataSourceForId(a.mainSourceId));if(!this.m_mainDataSource)for(g=0;g<this.m_dataSources.length;g++)if(d=this.m_dataSources[g],TradingView.isInherited(d.constructor,TradingView.PriceDataSource)){this.m_mainDataSource=d;break}for(g=0;g<this.m_dataSources.length;g++)d=this.m_dataSources[g],TradingView.isInherited(d.constructor,R47)?(d.ownerSource()||d.setOwnerSource(this.mainDataSource()),
|
|
d.isFixed()&&d.restoreFixedPoints(),1==c&&d.priceScale().isPercent()&&!d.isFixed()&&d.correctPricesToPercents(),d.fixAfterRestorePriceAxis&&d.fixAfterRestorePriceAxis()):TradingView.isInherited(d.constructor,TradingView.Study)&&(a=d.properties(),a.linkedToSeries&&a.linkedToSeries.value()&&(d.ownerSource()||d.setOwnerSource(this.model().mainSeries())));this._updateMargins();this._cachedHitTestSources=this._cachedOrderedSoruces=null};
|
|
R75.prototype._restoreMainSeries=function(a,b,c,d){var e=a.id,f=a.state,g=a.zorder;f&&["candleStyle","hollowCandleStyle","haStyle"].forEach(function(a){f[a].wickUpColor=f[a].wickUpColor||f[a].wickColor;f[a].wickDownColor=f[a].wickDownColor||f[a].wickColor});c||(this.D0.paneForSource(this.D0.mainSeries()).removeDataSource(this.D0.mainSeries()),this.m_dataSources.push(this.D0.mainSeries()));c=f&&f.style?f.style:void 0;var h=c==TradingView.Series.STYLE_PNF&&f.pnfStyle.lockScale;f&&!f.lockScale&&
|
|
(f.lockScale=h);c==TradingView.Series.STYLE_PNF&&"ATR"==this.D0.mainSeries().properties().pnfStyle.inputs.style.value()?this.D0.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":c==TradingView.Series.STYLE_RENKO&&"ATR"==this.D0.mainSeries().properties().renkoStyle.inputs.style.value()&&(this.D0.mainSeries().properties().renkoStyle.inputs.style._value="Traditional");f&&!f.hasOwnProperty("showSessions")&&(f.showSessions=!1);f&&!f.extendedHours&&(f.extendedHours=!1);
|
|
f&&b&&(f.showCountdown=!1);f&&(b&&!("showSeriesLastValueProperty"in d)&&"showLastValue"in f&&this.D0.properties().scalesProperties.showSeriesLastValue.setValue(f.showLastValue),delete f.showLastValue);this.D0.mainSeries().properties().merge(f);this.D0.mainSeries()._prevChartStyle=this.D0.mainSeries().properties().style.value();this.D0.mainSeries().J63();this.D0.mainSeries().setId(e);b&&this.D0.mainSeries().restoreData(a.bars,a.nsBars,a.symbolInfo,a.rtPrice,a.boxSize);
|
|
void 0!==g&&this.D0.mainSeries().setZorder(g);this.D0.mainSeries().properties().extendedHours.listeners().fire(this.D0.mainSeries().properties().extendedHours);this.D0.mainSeries().symbolInfo()&&this.D0.mainSeries().onSymbolResolved().fire(this.D0.mainSeries().symbolInfo())};
|
|
R75.prototype._restoreStudy=function(a,b,c){var d=a.id,e=a.state,f=a.zorder,g=TradingView.clone(a.metaInfo);$.extend(g,TradingView.StudyMetaInfo.parseIdString(g.id));if(!this.isESDStudy(g)||b){var h=e,k=this.D0.studyVersioning();c=k.patchPropsStateAndMetaInfo(h,g,{oldShowStudyLastValueProperty:b&&!c.showStudyLastValueProperty});var h=c.propsState,g=c.metaInfo,l=new TradingView.StudyStub(this.D0,a,g.shortDescription);l.setId(d);k.updateMetaInfoAsync(g,b).done(function(c){l.setStatus("");var e=
|
|
c||g;if(e.isTVScript&&!b){var f=TradingView.StudyMetaInfo.parseIdString(e.fullId||e.id).productId;pro.hasPackage(f)||(e=A57.createScriptStubNoSrc("Error: '"+e.shortDescription+"' is not authorized",e.scriptIdPart),$.extend(e,TradingView.StudyMetaInfo.parseIdString(e.id)),c=g=e,h={})}c=TradingView.prepareStudyPropertiesForLoadChart(g,c,h,null,k);e=TradingView.createStudy(this.D0,c,this.D0.mainSeries(),e);e.setId(d);b&&(c=k.patchStudyData(g,a.data,a.nonSeriesData,a.indexes),
|
|
e.restoreData(c.data,c.nsData,c.indexes));this.D0.replaceStudyStub(l,e)||(l=e)}.bind(this)).fail(function(a){console.error(a);l.setStatus("error: "+a)});this.m_dataSources.push(l);delete this._cachedOrderedSoruces;delete this._cachedHitTestSources;void 0!==f&&l.setZorder(f);return l}};
|
|
R75.prototype._restoreLineTool=function(a,b){TradingView.LineToolElliott.migrateState(a);var c=a.type,d=a.id,e=a.state,f=a.zorder,g=TradingView[c];assert(TradingView.isInherited(g,R47),"invalid data source type:"+c+" (expected to be a Line Tool)");for(var h=a.points,k=!1,l=0;l<h.length;l++)if(1E4<Math.abs(h[l].offset)){k=!0;break}if(!k){h=null;k=TradingView.factoryDefaults("linetool");if(TradingView.isInherited(g,A63)){h=this.D0.studyVersioning();
|
|
a=h.patchPointsBasedStudyState(a);e=a.state;TradingView.merge(k,e);e=a.metaInfo;$.extend(e,TradingView.StudyMetaInfo.parseIdString(e.fullId));if(!b&&!pro.hasPackage(e.productId)){h=new TradingView.StudyStub(this.D0,a,e.shortDescription);h.setId(d);this.m_dataSources.push(h);void 0!==f&&h.setZorder(f);h.setStatus($.t("not authorized"));h.setFailed(!0);return}g=h.updateMetaInfo(e)||e;k=TradingView.prepareStudyPropsStateForLoadChart(g,e,k,null,h);b?TradingView.merge(k,{fixedSize:!1}):TradingView.merge(k,
|
|
{fixedSize:!0});e=new J52("study_"+g.id,k,!0);c=TradingView.LineDataSourceFactory.create(c,this.D0,e,g,this.mainDataSource())}else g=c.toLowerCase(),TradingView.merge(k,TradingView.factoryDefaults(g)),TradingView.merge(k,e),b?TradingView.merge(k,{fixedSize:!1}):TradingView.merge(k,{fixedSize:!0}),e=new J52(c.toLowerCase(),k),c=new TradingView[c](this.D0,e);c.setId(d);c.linkKey=a.linkKey;d=this.D0.isJustClonedChart();g=a.alertId;k=R77.enabled("alerts")&&
|
|
TradingView.D18("drawing_alerts");!d&&k&&g&&c.setAlert&&c.setAlert(g,null,null,!0);d=a.indexes?a.indexes:[];d=d.slice(0,a.points.length);c.isFixed()?c.restorePositionPercents(a.positionPercents):c.restorePoints(a.points,d,b);c instanceof TradingView.LineToolBarsPattern||c instanceof TradingView.LineToolCallout||c instanceof TradingView.LineToolTrendAngle||c instanceof TradingView.LineToolParallelChannel?c.restoreData(a):b&&c.restoreData&&(d=a,h&&(d.graphics=h.patchPointsBasedStudyData(d.metaInfo,
|
|
d.graphics)),c.restoreData(d));h=null==a.version?1:a.version;d=null==c.version?1:c.version;h!=d&&"function"===typeof c.migrateVersion&&c.migrateVersion(h,d,{pane:this,model:this.D0,properties:e});this.m_dataSources.push(c);delete this._cachedOrderedSoruces;delete this._cachedHitTestSources;void 0!==f&&c.setZorder(f);return c}};
|
|
TradingView.ChartModel.prototype.studyTemplate=function(a){for(var b={panes:[]},c=0;c<this.panes().length;c++)b.panes.push(this.panes()[c].state(!0,!1,!0));a&&(b.interval=this.mainSeries().interval());b.version=TradingView.ChartModel.version;return b};TradingView.ChartModel.prototype.restoreStudyTemplate=function(a,b){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),a,b)};
|
|
TradingView.ChartModel.prototype.theme=function(){var a={};a.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()};a.mainSourceProperties=this.mainSeries().state().state;delete a.mainSourceProperties.symbol;delete a.mainSourceProperties.interval;delete a.chartProperties.paneProperties.topMargin;delete a.chartProperties.paneProperties.bottomMargin;
|
|
a.version=TradingView.ChartModel.version;return a};TradingView.ChartModel.prototype.restoreTheme=function(a){var b={hollowCandle:{related:"candle"}},c;for(c in b)a.mainSourceProperties[c+"Style"]||(a.mainSourceProperties[c+"Style"]=TradingView.clone(a.mainSourceProperties[b[c].related+"Style"]));this._undoModel.chartLoadTheme(this,a)};function fixLineToolsPositions(a,b,c){var d=a.allLineTools(),e=d.length;a=a.timeScale();a.points();for(var f=0;f<e;++f){for(var g=d[f],h=0,k=g.points(),l=k.size(),m=0;m<l;++m){var n=k.item(m);n.time>b&&n.time<=c&&(n.index=a.m_points.indexOf(n.time),++h)}0<h&&g.updateAllViews()}}
|
|
TradingView.requestChartSnapshotBars=function(a,b){function c(c){a._currentRequest.requestFirstBarTime(c,f,function(e){e.p[1]>g?(a._currentRequest.disconnect(),delete a._currentRequest,a._haveNoMoreData=!0,b()):d(c)})}function d(c){var d=1;a._haveNoMoreData=!0;var k=!1;a._currentRequest.createSeries("series_id","turnaround",c,f,["bar_count",g-1,-l],function(c){switch(c.method){case "data_update":if(!c.params.plots.length)break;var f=c.params.plots[0].value[TradingView.TIME_PLOT],n=c.params.plots;
|
|
a._haveNoMoreData=n.length<l;k=0===n.length;m=f==g;e.mainSeries().fixLastBar(a._chartDirection);e.mainSeries().bars().addTail(n,m);c=e.mainSeries().parseJapProjBars(c.params.nonseries);e.mainSeries().m_data.m_nsBars=c.nsBars;e.mainSeries().m_data.lastProjectionPrice=c.lastPrice;e.model().recalculateAllPanes();e.model().updateSource(e.mainSeries());e.model().updateLineTools();e.timeScale().scrollToOffsetAnimated(h);break;case "series_completed":d--,0===d&&(a._currentRequest.disconnect(),delete a._currentRequest,
|
|
b())}});c=e.D19();for(var n={},w=function(c){var f=c.method;"study_completed"===f||"study_error"===f?(d--,0===d&&(a._currentRequest.disconnect(),delete a._currentRequest,b())):"data_update"!==f||k||(n[c.params.customId].m_data.addTail(c.params.plots,m),e.model().recalculateAllPanes(),e.model().updateSource(e.mainSeries()))},u=0;u<c.length;u++){var x=c[u];if(TradingView.isInherited(x.constructor,TradingView.Study)&&-1!==["Volume","Compare","Overlay","Sessions"].indexOf(x.metaInfo().shortId)){var C=
|
|
"study_"+u,A=x.metaInfo().id+"-1!";n[C]=x;d++;a._currentRequest.createStudy(C,"turnaround","series_id",A,x.inputs(),w)}}}var e=a.model(),f=e.mainSeries().interval(),g=e.mainSeries().bars().last().value[TradingView.TIME_PLOT];"function"!==typeof b&&(b=function(){});if(null!=a._currentRequest)TradingView.logDebugChart("requestSnapshotBars: unexpected requestSnapshotBars");else{var h=e.timeScale().rightOffset();if(!(0>h||a._haveNoMoreData)){var k=e.mainSeries().getSymbolString(),l=Math.max(Math.ceil(h),
|
|
100),m=!1,n=new TradingView.TVChartApi;!window.user||"pro_realtime"!==user.pro_plan&&"pro_realtime_trial"!==user.pro_plan||n.authTokenRequired(!0);a._currentRequest=new TradingView.ChartSession(n);a._currentRequest.connect(function(b){if("connected"===b.method){b=e.model().timezone();b||(b=defaults("chartproperties").mainSeriesProperties.timezone);a._currentRequest.switchTimezone(b);var d="symbol_id",f=function(b){switch(b.method){case "symbol_error":if(b.params[1]==TradingView.Series.PERMISSION_DENIED){switch(b.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:e.mainSeries().properties().extendedHours.setValue(!1);
|
|
b=e.mainSeries().getSymbolString();break;case TradingView.Series.PD_REASON_SYMBOL:b=b.params[3];break;default:b=b.params[2]}b&&(d+="_re",a._currentRequest.resolveSymbol(d,b,f))}break;default:c(d)}};a._currentRequest.resolveSymbol(d,k,f)}else if("timescale_update"===b.method){var g=e.mainSeries().bars().last(),h=e.timeScale().indexToUserTime(g).valueOf()/1E3,g=e.timeScale().points(),l=g.lastTimePointIndex(),l=g.valueAt(l);if(0<b.params.changes.length){var m=b.params.changes[0]==l;m||(h+=1);e.timeScale().addTail(b,
|
|
h,m);b=g.lastTimePointIndex();b=g.valueAt(b);fixLineToolsPositions(e.model(),l,b)}}})}}};TradingView.FutureBarsRenderer=function(a,b){this._data=a;this._colors=this.getBackgroundColor(b)};TradingView.FutureBarsRenderer.prototype.hitTest=function(){return null};
|
|
TradingView.FutureBarsRenderer.prototype.getBackgroundColor=function(a){return[{background:"rgba(255, 158, 171, 0.3)",line:"#7E202F"},{background:"rgba(244, 255, 158, 0.3)",line:"#EBFF3F"},{background:"rgba(195, 255, 160, 0.3)",line:"#308020"}][a+1]};
|
|
TradingView.FutureBarsRenderer.prototype.draw=function(a){a.fillStyle=this._colors.background;a.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height);a.strokeStyle=this._colors.line;a.beginPath();a.lineWidth=1;var b=Math.round(this._data.x);a.moveTo(b,0);a.lineTo(b,this._data.height);a.stroke()};TradingView.J79=function(a,b,c){this._series=a;this._lastBar=b;this._direction=c};
|
|
TradingView.J79.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)-.5*this._series.m_model.timeScale().barSpacing()+1};
|
|
TradingView.J79.prototype.renderer=function(){var a={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()},b=this._series.data().bars(),b=b.last().value[TradingView.CLOSE_PLOT]>b.valueAt(this._lastBar)[TradingView.CLOSE_PLOT]?1:-1,c=0;1==this._direction?c=b:2==this._direction&&(c=-1*b);return new TradingView.FutureBarsRenderer(a,c)};TradingView.TextWidthCache=function(a){this._maxSize=a||50;this._actualSize=0;this._cache={};this._oldestTick=this._usageTick=1;this._tick2Labels={}};
|
|
TradingView.TextWidthCache.prototype.measureText=function(a,b){if(this._cache[b])return this._cache[b].width;if(this._actualSize==this._maxSize){var c=this._tick2Labels[this._oldestTick];delete this._tick2Labels[this._oldestTick];delete this._cache[c];this._oldestTick++;this._actualSize--}c=a.measureText(b).width;this._cache[b]={width:c,tick:this._usageTick};this._tick2Labels[this._usageTick]=b;this._actualSize++;this._usageTick++;return c};R96=function(a,b){var c=a._undoModel.D4,d=c.onWidget(),e=!1,e=d?c._options&&!c._options.hideIdeas:TVSettings.getBool("BarsMarksContainer.visibile",!1);b?b.merge({visible:e,frozen:!1}):b=new Property({visible:e,frozen:!1});var f=this;b.visible.listeners().subscribe(null,function(a){d||c._containsData||TVSettings.setValue("BarsMarksContainer.visibile",!!a.value());f._tooltip&&f._tooltip.removeAll()});R47.call(this,a,null,b);this.onNeedRepaint=
|
|
new Delegate;this._requests=[];this._marks={};this._collectedRange=this._getDataTimeout=this._loadedRange=null;this.D0.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks);this.D0.mainSeries().onSymbolResolved().subscribe(this,this.clearMarks);this.D0.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData);this._initialize();this.pinnedTooltips={};this._tooltip=new TradingView.TooltipRenderer(this._createTooltip.bind(this),this)};
|
|
inherit(R96,R47);R96.prototype._constructor="Child class must override this member";R96.prototype._initialize=function(a){throw"Child class must override this member";};R96.prototype.onClicked=function(){throw"Child class must override this member";};R96.prototype._getData=function(a){throw"Child class must override this member";};
|
|
R96.prototype._createTooltip=function(){throw"Child class must override this member";};R96.prototype.updateDotData=function(a,b){return b};R96.prototype.updatePlateData=function(a,b){};R96.prototype._plateViewData=function(a){return{}};R96.prototype.pinTooltip=function(a,b){this.pinnedTooltips[a]=b};R96.prototype.timeScale=function(){return this.D0.timeScale()};
|
|
R96.prototype.getIntervalInTicks=function(){function a(a){a=parseInt(a);if(a!=a)throw new TypeError("Unexpected interval");return 60*a}var b=a(1440),c=7*b,d=31*b,e=this.D0.mainSeries().properties().interval.value();switch(e){case "M":return d;case "W":return c;case "D":return b;default:return a(e)}};R96.prototype._maxDate=new Date(2037,0,1);
|
|
R96.prototype.getVisibleTickmarksRange=function(){if(this.timeScale().isEmpty())return{start:0,end:0};var a=this.timeScale().visibleBars();if(!(a.lastBar()>this.timeScale().points().firstTimePointIndex()&&a.firstBar()<this.timeScale().points().lastTimePointIndex()))return{start:0,end:0};var b;b=a.lastBar()<this.timeScale().points().lastTimePointIndex()?this.timeScale().indexToTimePoint(a.lastBar()):this._maxDate;a={start:this.timeScale().indexToTimePoint(Math.max(a.firstBar(),
|
|
this.timeScale().points().firstTimePointIndex())),end:b};return{start:a.start?a.start.getTime()/1E3:void 0,end:a.end?a.end.getTime()/1E3:void 0}};R96.prototype.getVisibleRangePlates=function(){var a=[],b=this.getVisibleTickmarksRange(),c=this.getIntervalInTicks();$.each(this._marks,function(d,e){var f=e.tickmark;f>=b.start&&f<=b.end+c&&a.push(e)});return a};
|
|
R96.prototype.getPublishedPlates=function(){var a={},b=this;if(!is_authenticated)return a;$.each(this.getVisibleRangePlates(),function(c,d){d.is_public&&(b.pinnedTooltips[d.id]||d.user__id==user.id)&&(a[d.id]=d)});return a};R96.prototype._maxPlatesPerBar=10;
|
|
R96.prototype.filterDisplayedPlates=function(a){a=a.reduce(function(a,c){var d=this._getIndex(c.tickmark);a[d]=a[d]||[];a[d].push(c);return a}.bind(this),{});return a=Object.keys(a).reduce(function(b,c){var d=a[c],d=d.sort(function(a,b){return b.views_count-a.views_count}),d=d.slice(0,this._maxPlatesPerBar);return b.concat(d)}.bind(this),[])};
|
|
R96.prototype._layout=function(a){switch(a){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}};R96.prototype._theme=function(a){switch(a){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}};
|
|
R96.prototype._offset=function(a,b){var c;switch(a){default:case "up":c=b[TradingView.HIGH_PLOT];break;case "down":c=b[TradingView.LOW_PLOT]}this.priceScale().isPercent()&&(c=this.priceScale().priceRange().convertToPercent(c,this.ownerSource().firstValue()));return this.priceScale().priceToCoordinate(c)};R96.prototype._getIndex=function(a){return this.timeScale().timePointToIndex(a)};
|
|
R96.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}};R96.prototype.barWidth=function(){return this.timeScale().barSpacing()};
|
|
R96.prototype.getPlatesViewData=function(){if(this.D0.mainSeries().data().isEmpty())return[];var a=this.filterDisplayedPlates(this.getVisibleRangePlates()),b=this,c={},d=this.D0.lastHittestData(),a=a.map(function(a){var e=this._getIndex(a.tickmark),f=this._getBar(e);if(!f)return!1;var l=this._layout(a.direction),m=this._theme(a.direction),n=d&&d.id==a.id,p=this.timeScale().indexToCoordinate(e),f=this._offset(l,f),r=0;e in c||(c[e]={up:0,down:0});r=c[e][l]++;return TradingView.merge({id:a.id,
|
|
x:p,y:f,order:r,direction:l,theme:m,hovered:n,pinned:!0===b.pinnedTooltips[a.id],user__id:a.user__id,label:a.label,labelFontColor:a.labelFontColor||"#444",minSize:a.minSize||0},this._plateViewData(a))}.bind(this)),a=a.filter(function(a){return!!a}),e=a.filter(function(a){return!0===a.hovered}),f=0;for(;f<a.length;f++)null!=e[0]&&a[f].user__id==e[0].user__id&&(a[f].highlightByAuthor=!0);a.sort(function(a,b){return a.hovered&&!b.hovered?1:0});return a};
|
|
R96.prototype._getBar=function(a){return this.D0.mainSeries().data().valueAt(a)};R96.prototype.paneViews=function(a){var b=this;return this.D2.visible.value()?[new J59(this,a,function(a){return new TradingView.BarsMarksContainerRenderer(a.getViewData(),b)})]:[]};R96.prototype.dataWindowView=function(){return null};
|
|
R96.prototype.priceAxisViews=function(){return null};R96.prototype.statusView=function(){return null};R96.prototype.updateAllViews=function(){};R96.prototype.pointsCount=function(){return 0};R96.prototype.properties=function(){return this.D2};
|
|
R96.prototype._rangeDifference=function(a){a=$.extend({},a);this._loadedRange&&(a.start<this._loadedRange.start?a.end=this._loadedRange.start:a.end>this._loadedRange.end&&(a.start=this._loadedRange.end));return a};R96.prototype._rangeUnion=function(a,b){a=$.extend({},a);b&&(a.start=Math.min(b.start,a.start),a.end=Math.max(b.end,a.end));return a};
|
|
R96.prototype._pushGetDataStack=function(a){if(!a.end||!a.start)throw new TypeError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout);this._collectedRange=this._rangeUnion(a,this._collectedRange);this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange);this._getDataTimeout=this._collectedRange=null}.bind(this),300)};R96.prototype.roundRange=function(a){return{start:Math.round(a.start),end:Math.round(a.end)}};
|
|
R96.prototype.refreshData=function(){this.getData(this._lastRange)};R96.prototype.getData=function(a){if(!a.start||!a.end)throw new TypeError("Wrong range");this._lastRange=a;a=$.extend({},a);a.end=this._maxDate/1E3;this._pushGetDataStack(a)};
|
|
R96.prototype._abortAllRequests=function(){this._requests.forEach(function(a){a.abort()});this._requests=[];this._getDataTimeout&&clearTimeout(this._getDataTimeout);this._getDataTimeout=this._collectedRange=null};R96.prototype.clearMarks=function(){this._abortAllRequests();this._marks={};this._loadedRange=null};J59=function(a,b,c){this.source=a;this.pane=b;this._rendererFactory=c};
|
|
J59.prototype.update=function(){};J59.prototype.renderer=function(){return this._rendererFactory(this.source)};TradingView.BarsMarksContainerRenderer=function(a,b){this._barWidth=a.barWidth;this._plates=a.plates;this._tooltip=a.tooltip;this.D0=b};
|
|
TradingView.BarsMarksContainerRenderer.prototype.draw=function(a){a.save();for(var b=0;b<this._plates.length;b++)if(this._plates[b].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,a));this._tooltip.draw(this._plates.map(function(a){return this._plateTransform(a)}.bind(this)),a);this._tooltip.endDraw();a.restore()};
|
|
TradingView.BarsMarksContainerRenderer.prototype._drawItem=function(a,b){a.save();this._highlightByAuthor&&!b.highlightByAuthor&&(a.globalAlpha=.4);var c=this._dotTransform(b);c.mine?this._drawTriangle(a,c):this._drawDot(a,c);a.restore()};
|
|
TradingView.BarsMarksContainerRenderer.prototype._commonTransform=function(a){var b=Math.max(1.4*a.minSize,this._barWidth+4),b=a.y+{up:-1,down:1}[a.direction]*(b*(a.order+.6)+.25*b);return{id:a.id,theme:this.themes[a.theme+(a.hovered||a.highlightByAuthor?"_hovered":"")],themeName:a.theme,x:Math.round(a.x+1),y:Math.round(b),pinned:a.pinned,hovered:a.hovered}};
|
|
TradingView.BarsMarksContainerRenderer.prototype._dotTransform=function(a){var b=this._commonTransform(a);b.radius=Math.max(a.minSize/2,.4*this._barWidth);b.label=a.label;b.labelFontColor=a.labelFontColor;b.labelFontSize=Math.ceil(Math.max(10,Math.min(b.radius,20)));return this.D0.updateDotData(a,b)};TradingView.BarsMarksContainerRenderer.prototype._plateTransform=function(a){var b=this._commonTransform(a);return this.D0.updatePlateData(a,b)};
|
|
TradingView.BarsMarksContainerRenderer.THEMES=["green","red","neutral","yellow","blue"];TradingView.BarsMarksContainerRenderer.prototype.themes={green:{border:"#78C143",background:"#8DDD54",dotBorderWidth:2},red:{border:"#CC4545",background:"#ED5A5A ",dotBorderWidth:2},neutral:{border:"#EAC300",background:"#FFD400",dotBorderWidth:2},yellow:{border:"#EAC300",background:"#FFD400",dotBorderWidth:2},blue:{border:"#047ACE",background:"#0496FF",dotBorderWidth:2}};
|
|
TradingView.BarsMarksContainerRenderer.THEMES.forEach(function(a){var b=TradingView.BarsMarksContainerRenderer.prototype.themes;b[a+"_hovered"]=$.extend({},b[a],{dotBorderWidth:4})});
|
|
TradingView.BarsMarksContainerRenderer.prototype._drawTriangle=function(a,b){a.strokeStyle=b.theme.border;a.fillStyle=b.theme.background;a.lineWidth=b.theme.dotBorderWidth;var c=b.radius,d=Math.cos(Math.PI/6)*c,e=Math.sin(Math.PI/6)*c;a.translate(b.x,b.y);"up"==b.direction&&a.rotate(Math.PI);b["public"]||(a.lineWidth/=2);a.beginPath();a.moveTo(0,-c);a.lineTo(d,e);a.lineTo(-d,e);a.lineTo(0,-c);a.closePath();a.stroke();b["public"]&&a.fill()};
|
|
TradingView.BarsMarksContainerRenderer.prototype._drawDot=function(a,b){a.strokeStyle=b.theme.border;a.fillStyle=b.theme.background;a.lineWidth=b.theme.dotBorderWidth;a.beginPath();a.arc(b.x,b.y,b.radius,0,2*Math.PI,!0);a.closePath();a.stroke();a.fill();b.label&&6<b.radius&&(a.textAlign="center",a.textBaseline="middle",a.font="bold "+b.labelFontSize+"px Arial",a.fillStyle=b.labelFontColor,a.fillText(b.label,b.x,b.y))};
|
|
TradingView.BarsMarksContainerRenderer.prototype.hitTest=function(a){for(var b,c=this._plates.length-1;0<=c;--c)if(b=this._hitTestDot(this._plates[c],a))return b;return null};TradingView.BarsMarksContainerRenderer.prototype._hitTestDot=function(a,b){var c=this._dotTransform(a),d=new MathEx.Point(c.x,c.y);return MathEx.isInCircle(d,Math.max(c.radius,8),b)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR,a):null};
|
|
R97=function(){this._layout=[];this._currentId=void 0;this.tooltipHovered=!1};R97.prototype._createLayout=function(){throw"Child class must override this member";};R97.prototype._updatePlate=function(a){throw"Child class must override this member";};R97.prototype._getContainer=function(a){this._container&&this._context===a||(this._context=a,this._container=$(a.canvas).parent());return this._container};
|
|
R97.prototype._plateArrowSize=14;
|
|
R97.prototype.showPlate=function(a,b){if(this._currentId!=a.id||!this._layout||0===this._layout.length||null==this._layout[0].parentNode){this._currentId=a.id;this._createLayout();this._getContainer(b).append(this._layout);var c=this;this._layout.hover(function(){c.tooltipHovered=!0;$(this).stop(!0).fadeTo(0,1)},function(){c.tooltipHovered=!1})}var d=Math.round(a.barWidth/2);15<d&&(d=15);10>d&&(d=10);this._updatePlate(a);var e=a.x-this._layout.outerWidth()<this._plateArrowSize,
|
|
f=b.canvas.width-a.x+Math.round(a.barWidth/2+d);e&&(f-=this._layout.outerWidth()+2*this._plateArrowSize);var g=b.canvas.height;this._layout.toggleClass("right",e);this._layout.css({top:Math.min(Math.max(a.y,20),g-this._layout.outerHeight()-10),right:f,fontSize:d+"px",display:"block"})};R97.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())};R97.prototype._toggleLayout=function(a){this._layout.toggle(a)};
|
|
R97.prototype.hide=function(a){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove();a()})};R97.prototype.setSource=function(a){this.source=a};TradingView.TooltipRenderer=function(a,b){this.tooltips={};this.tooltipFactory=a;this.source=b};
|
|
TradingView.TooltipRenderer.prototype.findOrCreateTooltip=function(a){var b=this.tooltips[a.id];null==b&&(a.hovered||a.pinned)&&(b=this._createTooltip(),this.tooltips[a.id]=b);return b};TradingView.TooltipRenderer.prototype.showPlate=function(a,b){var c=this.findOrCreateTooltip(a);null!=c&&(c._drawPlate(a,b),c.plateData=a)};
|
|
TradingView.TooltipRenderer.prototype.draw=function(a,b){this.hoveredId=null;for(var c=0;c<a.length;c++)a[c].hovered&&(this.hoveredId=a[c].id);a.forEach(function(a){this.showPlate(a,b)}.bind(this))};TradingView.TooltipRenderer.prototype.endDraw=function(){for(var a in this.tooltips)if(this.tooltips.hasOwnProperty(a)){var b=this.tooltips[a];b.toggleVisibility();this.hoveredId&&b.plateData.id!=this.hoveredId&&!b.plateData.pinned&&(b.remove(),delete this.tooltips[a])}};
|
|
TradingView.TooltipRenderer.prototype.removeAll=function(){for(var a in this.tooltips)this.tooltips.hasOwnProperty(a)&&this.tooltips[a].remove();this.tooltips={}};TradingView.TooltipRenderer.prototype.removeTooltip=function(a){delete this.tooltips[a]};TradingView.TooltipRenderer.prototype._createTooltip=function(){return new TradingView.TooltipWrap(this,this.tooltipFactory())};TradingView.TooltipWrap=function(a,b){this.renderer=a;this._tooltip=b;this.visible=!1};
|
|
TradingView.TooltipWrap.prototype._drawPlate=function(a,b){var c=this;this.visible=!0;this._tooltip.setSource(this.renderer.source);this._tooltip.showPlate(a,b);a.hovered||a.pinned||this._tooltip.hide(function(){c.renderer.removeTooltip(a.id)})};TradingView.TooltipWrap.prototype.remove=function(){this._tooltip._removeLayout()};TradingView.TooltipWrap.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible);this.visible=!1};TradingView.UserDefinedBarsMarks=function(a){R96.call(this,a);var b=this;TradingView.drawingState.hideMarksOnBars().subscribe(this,function(){b.D2.visible.setValue(!TradingView.drawingState.hideMarksOnBars().value())})};inherit(TradingView.UserDefinedBarsMarks,R96);TradingView.UserDefinedBarsMarks.prototype._initialize=function(a){this.D2.visible.setValue(!0)};TradingView.UserDefinedBarsMarks.prototype._constructor="TradingView.UserDefinedBarsMarks";
|
|
TradingView.UserDefinedBarsMarks.prototype._plateViewData=function(a){return{text:a.text}};TradingView.UserDefinedBarsMarks.prototype.onClicked=function(){var a=this.D0.lastHittestData().id;this._marks[a].onClicked()};TradingView.UserDefinedBarsMarks.prototype.clearMarks=function(){R96.prototype.clearMarks.call(this);this.onNeedRepaint.fire()};
|
|
TradingView.UserDefinedBarsMarks.prototype._getData=function(a){var b=this.D0.mainSeries().symbolInfo();if(b){var c=this.roundRange(this._rangeDifference(a)),d=this,e=this.D0.mainSeries().properties().interval.value();D16.getMarks(b,c.start,c.end,function(b){b.forEach(function(a){d._marks[a.id]=a},d);d._loadedRange=d._rangeUnion(a,d._loadedRange);d.onNeedRepaint.fire()},e)}};TradingView.UserDefinedBarsMarks.prototype._createTooltip=function(){return new TradingView.UserDefinedBarsMarksTooltip};
|
|
TradingView.UserDefinedBarsMarks.prototype.updatePlateData=function(a,b){b.barWidth=this.barWidth();b.text=a.text;b.tooltipMargin=-1*Math.max(a.minSize/2,.4*this.barWidth());return b};TradingView.UserDefinedBarsMarks.prototype.hasContextMenu=function(){return!1};TradingView.UserDefinedBarsMarksTooltip=function(a){R97.call(this)};inherit(TradingView.UserDefinedBarsMarksTooltip,R97);
|
|
TradingView.UserDefinedBarsMarksTooltip.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>');this._layout_text=$('<div class="text"></div>').appendTo(this._layout)};TradingView.UserDefinedBarsMarksTooltip.prototype._updatePlate=function(a){this._currentId=a.id;this._layout.css("border-color",a.theme.border);this._layout.css("margin-top",a.tooltipMargin+"px");this._layout_text.html(a.text);this._layout.append(this._layout_text)};TradingView.UserDefinedTimescaleMarks=function(a){R96.call(this,a);var b=this;TradingView.drawingState.hideMarksOnBars().subscribe(this,function(){b.D2.visible.setValue(!TradingView.drawingState.hideMarksOnBars().value())});this._paneView=new TradingView.TimescaleMarksContainerPaneView(this)};inherit(TradingView.UserDefinedTimescaleMarks,R96);TradingView.UserDefinedTimescaleMarks.prototype._initialize=function(a){this.D2.visible.setValue(!0)};
|
|
TradingView.UserDefinedTimescaleMarks.prototype._constructor="TradingView.UserDefinedTimescaleMarks";TradingView.UserDefinedTimescaleMarks.prototype._plateViewData=function(a){return{text:a.text}};TradingView.UserDefinedTimescaleMarks.prototype.onClicked=function(){var a=this.D0.lastHittestData().id;D17.emit("onTimescaleMarkClick",a)};
|
|
TradingView.UserDefinedTimescaleMarks.prototype.clearMarks=function(){R96.prototype.clearMarks.call(this);this.onNeedRepaint.fire()};
|
|
TradingView.UserDefinedTimescaleMarks.prototype._getData=function(a){var b=this.D0.mainSeries().symbolInfo();if(b){var c=this.D0.timeScale(),d=this.roundRange(this._rangeDifference(a)),e=this,f=this.D0.mainSeries().properties().interval.value();D16.getTimescaleMarks(b,d.start,d.end,function(b){b.forEach(function(a){a.index=c.timePointToIndex(a.tickmark);e._marks[a.id]=a},e);e._loadedRange=e._rangeUnion(a,e._loadedRange);e.onNeedRepaint.fire()},f)}};
|
|
TradingView.UserDefinedTimescaleMarks.prototype.updatePlateData=function(a,b){b.barWidth=this.barWidth();b.text=a.text;b.tooltipMargin=-1*Math.max(a.minSize/2,.4*this.barWidth());return b};TradingView.UserDefinedTimescaleMarks.prototype.hasContextMenu=function(){return!1};TradingView.UserDefinedTimescaleMarks.prototype.paneViews=function(a){return this.D2.visible.value()?[this._paneView]:[]};
|
|
TradingView.TimescaleMarksContainerPaneView=function(a,b){this.source=a;this._rendererFactory=b;this.stylesCache={};this.templatesCache={};this._createLollipops()};inherit(TradingView.TimescaleMarksContainerPaneView,TradingView.ESDPaneView);
|
|
TradingView.TimescaleMarksContainerPaneView.prototype._createLollipops=function(){this.lollipops=[];var a=this.source.D0.timeScale(),b=TradingView.ESDPaneView.prototype._getY.call(this.source),c=this.source.D0.lastHittestData(),d=this;$.each(this.source._marks,function(e,f){var g={id:f.id,basePoint:new MathEx.Point(a.indexToCoordinate(f.index)+1,b),hovered:c&&c.id==f.id,barY:null,label:f.label,color:f.color,tooltip:f.tooltip};d.lollipops.push(g)})};
|
|
TradingView.TimescaleMarksContainerPaneView.prototype.update=function(){this._createLollipops()};TradingView.TimescaleMarksContainerPaneView.prototype.renderer=function(){this.update();return TradingView.ESDPaneView.prototype.renderer.call(this)};
|
|
TradingView.TimescaleMarksContainerPaneView.prototype._generateTemplateStyle=function(a,b,c){var d=a+b+c;d in this.stylesCache||(c={strokeStyle:b,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:64,circleHeight:35,radius:11,lineWidth:2,fillStyle:"white",strokeStyle:"#E2745B",text:{label:c,strokeStyle:b,font:"normal 12px Verdana, Arial, sans-serif"}}},b={lollipop:{fillStyle:b,text:{strokeStyle:"white"}}},this.stylesCache[d]="default"===a?c:$.extend(!0,
|
|
{},c,b));return this.stylesCache[d]};TradingView.TimescaleMarksContainerPaneView.prototype.getTemplate=function(a,b){var c=a+b.color+b.label;c in this.templatesCache||(this.templatesCache[c]=this.createTemplate(this._generateTemplateStyle(a,b.color,b.label)));return this.templatesCache[c]};TradingView.TimescaleMarksContainerPaneView.prototype.getStyle=function(a,b){return this._generateTemplateStyle(a,b.color,b.label)};TradingView.TimescaleMarksContainerPaneView.prototype.createText=function(a,b){a.tooltip.forEach(function(a){b.addTextLine(a)})};
|
|
TradingView.TimescaleMarksContainerPaneView.prototype.hasTooltip=function(a){return!!a.tooltip&&a.tooltip.length};R32=function(a,b){this.R99=a;this.D0=b;this._points=(new List).append(new MathEx.Point(0,0))};R32.prototype.update=function(){this._visible=!1;if(this.R99.properties().showPriceLine.value()){var a=this.R99.lastValueData("close",!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
|
|
R32.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=1;a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=TradingView.HitTestResult.REGULAR;a.visible=this._visible;return new TradingView.HorzLineRenderer(a)};A50=function(a,b){this.R99=a;this.D0=b;this._invalidated=!0;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14};
|
|
inherit(A50,PriceAxisView);A50.prototype.update=function(){this._invalidated=!0};A50.prototype.coordinate=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.coordinate.call(this)};
|
|
A50.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.R99.lastValueData("close",!1);a&&(this._text=a.text,this._floatCoordinate=a.floatCoordinate,this._coordinate=a.coordinate,this._textHeight=this.R99.priceScale().m_markBuilder.fontHeight(),this._background=a.color,this._visible=!0)};
|
|
A50.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:this._visible};return new TradingView.PriceAxisViewRenderer(a)};
|
|
A49=function(a,b){TradingView.DataWindowView.call(this);this.D1=a;this.D0=b;this._items.append(new TradingView.DataWindowItem("Open",""));this._items.append(new TradingView.DataWindowItem("High",""));this._items.append(new TradingView.DataWindowItem("Low",""));this._items.append(new TradingView.DataWindowItem("Close",""));this._invalidated=!0;this.update()};inherit(A49,TradingView.DataWindowView);
|
|
A49.prototype._updateImpl=function(){this._header=this.D1.title();if(!this.D0.timeScale().isEmpty()&&0!==this.D1.data().size()){var a,b,c=!1;this.D1.properties().style.value()===TradingView.Series.STYLE_BARS?(a=this.D1.properties().barStyle.upColor.value(),b=this.D1.properties().barStyle.downColor.value(),c=this.D1.properties().barStyle.barColorsOnPrevClose.value()):this.D1.properties().style.value()===TradingView.Series.STYLE_CANDLES?
|
|
(a=this.D1.properties().candleStyle.upColor.value(),b=this.D1.properties().candleStyle.downColor.value(),c=this.D1.properties().candleStyle.barColorsOnPrevClose.value()):this.D1.properties().style.value()===TradingView.Series.STYLE_HOLLOW_CANDLES?(a=this.D1.properties().hollowCandleStyle.upColor.value(),b=this.D1.properties().hollowCandleStyle.downColor.value(),c=!0):this.D1.properties().style.value()===TradingView.Series.STYLE_LINE?a=b=this.D1.properties().lineStyle.color.value():
|
|
this.D1.properties().style.value()===TradingView.Series.STYLE_AREA&&(a=b=this.D1.properties().areaStyle.linecolor.value());var d=this.D1.series(),e=this.D0.crossHairSource().appliedIndex(),d=d.nearestIndex(e,TradingView.SEARCH_NEAREST_LEFT);if(void 0!==d){e=this.D1.data().valueAt(d);if(!(e&&e[TradingView.OPEN_PLOT]&&e[TradingView.HIGH_PLOT]&&e[TradingView.LOW_PLOT]&&e[TradingView.CLOSE_PLOT]))return;var f=this.D1.formatter();this._items.item(0).setValue(f.format(e[TradingView.OPEN_PLOT]));
|
|
this._items.item(1).setValue(f.format(e[TradingView.HIGH_PLOT]));this._items.item(2).setValue(f.format(e[TradingView.LOW_PLOT]));this._items.item(3).setValue(f.format(e[TradingView.CLOSE_PLOT]));a=c&&1<=d?this.D1.data().valueAt(d-1)[TradingView.CLOSE_PLOT]<=e[TradingView.CLOSE_PLOT]?a:b:e[TradingView.OPEN_PLOT]<=e[TradingView.CLOSE_PLOT]?a:b;for(b=0;4>b;b++)this._items.item(b).setColor(a)}this._additional=(a=TradingView.getDataVendorString(this.D1.symbolInfo()))?"(Data Provided by "+a+")":
|
|
void 0}};A49.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};A49.prototype.update=function(){this._invalidated=!0};A49.prototype.additional=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._additional};
|
|
TradingView.study_Overlay=function(a,b,c,d){this._symbolLabelView=new TradingView.R38(a,this,"close","symbol","showSymbolLabels");TradingView.Study.call(this,a,b,c,d);this._paneView=this._formatter=null;var e=this;this.properties().minTick.listeners().subscribe(null,function(){e._createFormatter();e.updateAllViews();e.D0.D20(new A22(A22.FULL_UPDATE))})};inherit(TradingView.study_Overlay,TradingView.Study);
|
|
TradingView.study_Overlay.prototype.createPlotLabels=function(a){};TradingView.study_Overlay.prototype.symbol=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols?this._resolvedSymbols[a]:null;return(b?b.name:a).toUpperCase()};
|
|
TradingView.study_Overlay.prototype.lastValueData=function(a,b){var c=TradingView.Study.prototype.lastValueData.call(this,"close",b);if(!c)return c;var d=this.properties(),e=c.item;switch(d.style.value()){case TradingView.Series.STYLE_BARS:c.color=e[TradingView.OPEN_PLOT]<=e[TradingView.CLOSE_PLOT]?d.barStyle.upColor.value():d.barStyle.downColor.value();break;case TradingView.Series.STYLE_CANDLES:c.color=e[TradingView.OPEN_PLOT]<=e[TradingView.CLOSE_PLOT]?d.candleStyle.upColor.value():d.candleStyle.downColor.value();
|
|
break;case TradingView.Series.STYLE_HOLLOW_CANDLES:c.color=e[TradingView.OPEN_PLOT]<=e[TradingView.CLOSE_PLOT]?d.candleStyle.upColor.value():d.candleStyle.downColor.value();break;case TradingView.Series.STYLE_LINE:c.color=d.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:c.color=d.areaStyle.color1.value()}return c};
|
|
TradingView.study_Overlay.prototype.createViews=function(){this._priceAxisViews=[];this._priceAxisViewsBase=[new A50(this,this.D0)];this._paneViews=[];var a=null;switch(this.D2.style.value()){case TradingView.Series.STYLE_BARS:a=new R15(this,this.D0);break;case TradingView.Series.STYLE_CANDLES:a=new R16(this,this.D0);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:a=new R18(this,
|
|
this.D0);break;case TradingView.Series.STYLE_LINE:a=new R20(this,this.D2.lineStyle.priceSource.value(),this.D0);break;case TradingView.Series.STYLE_AREA:a=new R13(this,this.D2.areaStyle.priceSource.value(),this.D0)}a&&this._paneViews.push(a);this._paneViews.push(new R32(this,this.D0));this._paneViews.push(this._symbolLabelView);this._dataWindowView||(this._dataWindowView=
|
|
new A49(this,this.D0));this._statusView||(this._statusView=new TradingView.StudyStatusView(this));this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)};TradingView.study_Overlay.prototype.barColorer=function(){return new TradingView.SeriesBarColorer(this)};TradingView.study_Overlay.prototype.start=function(){this._formatter=null;TradingView.Study.prototype.start.call(this);this.priceScale()&&this.priceScale().updateFormatter()};
|
|
TradingView.study_Overlay.prototype._createFormatter=function(){if("default"==this.properties().minTick.value()){var a=this.properties().inputs.symbol.value(),a=this._resolvedSymbols[a];this._formatter=new TradingView.PriceFormatter(a?a.pricescale:100,a?a.minmov:1,a?a.fractional:!1)}else{var a=this.properties().minTick.value(),a=isNumber(a)?["100","1","false"]:a.split(","),b=parseInt(a[0]),c=parseInt(a[1]);this._formatter=new TradingView.PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&this.priceScale().updateFormatter()};
|
|
TradingView.study_Overlay.prototype.formatter=function(){this._formatter||this._createFormatter();return this._formatter};TradingView.study_Overlay.prototype._changeInputs=function(){TradingView.Study.prototype._changeInputs.call(this,this.inputs());this.m_formatter=null;this.priceScale().updateFormatter()};TradingView.study_Overlay.prototype.title=function(){var a=this.properties().inputs.symbol.value(),b=this._resolvedSymbols[a];return(b?b.name+", "+b.exchange:a).toUpperCase()};
|
|
TradingView.study_Overlay.prototype.bars=function(){return this.m_data};TradingView.study_Overlay.prototype.open=function(a){return this.bars().valueAt(a)[TradingView.OPEN_PLOT]};TradingView.study_Overlay.prototype.high=function(a){return this.bars().valueAt(a)[TradingView.HIGH_PLOT]};TradingView.study_Overlay.prototype.low=function(a){return this.bars().valueAt(a)[TradingView.LOW_PLOT]};TradingView.study_Overlay.prototype.close=function(a){return this.bars().valueAt(a)[TradingView.CLOSE_PLOT]};
|
|
TradingView.study_Overlay.prototype.hl2=function(a){return(this.high(a)+this.low(a))/2};TradingView.study_Overlay.prototype.hlc3=function(a){return(this.high(a)+this.low(a)+this.close(a))/3};TradingView.study_Overlay.prototype.ohlc4=function(a){return(this.open(a)+this.high(a)+this.low(a)+this.close(a))/4};TradingView.study_Overlay.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var a=this.D2.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};
|
|
TradingView.study_Overlay.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate};TradingView.Study.graphicsZOrderPriority=function(a){switch(a){case "polygons":return-100;case "trendchannels":return-90;default:return 0}};TradingView.Study.StudyPaneView_horizlines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_horizlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.TrendLineRenderer(this._data[b],new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_horizlines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().horizlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.horizlines[h.styleId];if(k.visible.value())for(var l=0;l<h.data.length;l++){var m=
|
|
h.data[l],n=d[m.startIndex],p=d[m.endIndex];if(!(!m.extendRight&&Math.max(n,p)<f||!m.extendLeft&&Math.min(n,p)>e)){var r={},n=c.indexToCoordinate(n),p=c.indexToCoordinate(p),t=m.level;if(b.isPercent())var v=this.D1.firstValue(),t=b.priceRange().convertToPercent(t,v);t=b.priceToCoordinate(t);n=new MathEx.Point(n,t);p=new MathEx.Point(p,t);r.points=(new List).append(n).append(p);r.extendleft=m.extendLeft;r.extendright=m.extendRight;r.width=c.width();r.height=b.height();r.color=k.color.value();r.linewidth=
|
|
k.width.value();r.linestyle=k.style.value();this._data.push(r)}}}}}};TradingView.Study.StudyPaneView_vertlines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_vertlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.TrendLineRenderer(this._data[b],new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_vertlines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().vertlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.vertlines[h.styleId];if(k.visible.value())for(var l=0;l<h.data.length;l++){var m=
|
|
h.data[l],n={};if(!(d[m.index]<f||d[m.index]>e)){var p=c.indexToCoordinate(d[m.index])+1,r=null,t;m.extendBottom?t=b.height():(t=m.startPrice,b.isPercent()&&(r=r||this.D1.firstValue(),t=b.priceRange().convertToPercent(t,r)),t=b.priceToCoordinate(t));if(m.extendTop)r=0;else{var v=m.endPrice;b.isPercent()&&(r=r||this.D1.firstValue(),v=b.priceRange().convertToPercent(v,r));r=b.priceToCoordinate(v)}t=new MathEx.Point(p,t);p=new MathEx.Point(p,r);n.points=(new List).append(t).append(p);n.extendleft=
|
|
m.extendBottom;n.extendright=m.extendTop;n.width=c.width();n.height=b.height();n.color=k.color.value();n.linewidth=k.width.value();n.linestyle=k.style.value();this._data.push(n)}}}}}};TradingView.Study.StudyPaneView_lines=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_lines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.TrendLineRenderer(this._data[b],new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_lines.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().lines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.lines[h.styleId];if(k.visible.value())for(var l=0;l<h.data.length;l++){var m=
|
|
h.data[l],n=d[m.startIndex]+(m.startOffset||0),p=d[m.endIndex]+(m.endOffset||0);if(!(!m.extendRight&&Math.max(n,p)<f||!m.extendLeft&&Math.min(n,p)>e)){var r={},n=c.indexToCoordinate(n),p=c.indexToCoordinate(p),t=m.startPrice,m=m.endPrice;if(b.isPercent())var v=this.D1.firstValue(),t=b.priceRange().convertToPercent(t,v),m=b.priceRange().convertToPercent(m,v);t=b.priceToCoordinate(t);m=b.priceToCoordinate(m);n=new MathEx.Point(n,t);p=new MathEx.Point(p,m);r.points=(new List).append(n).append(p);
|
|
r.color=k.color.value();r.linewidth=k.width.value();r.linestyle=k.style.value();this._data.push(r)}}}}}};TradingView.Study.StudyPaneView_hlines=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textData=[];this._textRendererCache={}};TradingView.Study.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_hlines.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.HorzLineRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData();this._calcTextData()};
|
|
TradingView.Study.StudyPaneView_hlines.prototype._calcTextData=function(){this._textData=[];var a=this.D1.graphics().hlines;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=0;d<a.length;d++){var e=a[d];if(e.data){var f=this.D1.properties().graphics.hlines[e.styleId];if(f.enableText.value()&&f.showText.value())for(var g=0;g<e.data.length;g++){var h=e.data[g],k={};k.text=void 0===h.text?"":h.text;k.color=f.color.value();k.font=
|
|
"arial";k.fontsize=f.fontSize.value();h=h.level;if(b.isPercent())var l=this.D1.firstValue(),h=b.priceRange().convertToPercent(h,l);var h=b.priceToCoordinate(h),l=f.textPos.value(),m;if(l==CanvasEx.TEXTPOS_TOPLEFT||l==CanvasEx.TEXTPOS_MIDDLELEFT||l==CanvasEx.TEXTPOS_BOTTOMLEFT)m=4,k.horzAlign="left";else if(l==CanvasEx.TEXTPOS_TOPCENTER||l==CanvasEx.TEXTPOS_MIDDLECENTER||l==CanvasEx.TEXTPOS_BOTTOMCENTER)m=c.width()/2,k.horzAlign="center";else if(l==CanvasEx.TEXTPOS_TOPRIGHT||l==CanvasEx.TEXTPOS_MIDDLERIGHT||
|
|
l==CanvasEx.TEXTPOS_BOTTOMRIGHT)m=c.width(),k.horzAlign="right";if(l==CanvasEx.TEXTPOS_TOPLEFT||l==CanvasEx.TEXTPOS_TOPCENTER||l==CanvasEx.TEXTPOS_TOPRIGHT)k.vertAlign="bottom",h-=4;else if(l==CanvasEx.TEXTPOS_MIDDLELEFT||l==CanvasEx.TEXTPOS_MIDDLECENTER||l==CanvasEx.TEXTPOS_MIDDLERIGHT)k.vertAlign="middle",h-=2;else if(l==CanvasEx.TEXTPOS_BOTTOMLEFT||l==CanvasEx.TEXTPOS_BOTTOMCENTER||l==CanvasEx.TEXTPOS_BOTTOMRIGHT)k.vertAlign="top";h=new MathEx.Point(m,h);k.points=(new List).append(h);k.offsetX=
|
|
0;k.offsetY=0;this._textData.push(k)}}}}};
|
|
TradingView.Study.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){this._data=[];var a=this.D1.graphics().hlines;if(a){var b=this.D1.priceScale();if(b&&!b.isEmpty())for(var c=0;c<a.length;c++){var d=a[c];if(d.data){var e=this.D1.properties().graphics.hlines[d.styleId];if(e.visible.value())for(var f=0;f<d.data.length;f++){var g={},h=d.data[f].level;if(b.isPercent())var k=this.D1.firstValue(),h=b.priceRange().convertToPercent(h,k);h=b.priceToCoordinate(h);g.points=(new List).append(new MathEx.Point(0,
|
|
h));g.color=e.color.value();g.linewidth=e.width.value();g.linestyle=e.style.value();g.hitTestResult=TradingView.HitTestResult.REGULAR;this._data.push(g)}}}}};TradingView.Study.StudyPriceAxisView_hlines=function(a,b,c,d,e){this.D1=a;this.D0=b;this._line=c;this._styleId=d;this._data={};this._lineType=e;this._invalidated=!0};inherit(TradingView.Study.StudyPriceAxisView_hlines,PriceAxisView);TradingView.Study.StudyPriceAxisView_hlines.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPriceAxisView_hlines.prototype.updateImpl=function(){this._data={};this._data.visible=!1;var a=this.D1.priceScale();if(a&&!a.isEmpty()&&this.D1.properties().visible.value()){var b=this.D1.properties().graphics[this._lineType][this._styleId];if(b.visible&&b.visible.value()&&b.showPrice&&b.showPrice.value()){this._data.visible=!0;this._data.color="white";this._data.background=b.color.value();b=this._line.level;if(a.isPercent()){var c=this.D1.firstValue();if(!isNumber(c))return;
|
|
b=a.priceRange().convertToPercent(b,c)}this._data.coordinate=a.priceToCoordinate(b);this._data.textHeight=a.m_markBuilder.fontHeight();this._data.text=a.formatter().format(b)}}};TradingView.Study.StudyPriceAxisView_hlines.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);return new TradingView.PriceAxisViewRenderer(this._data)};TradingView.TriangleTextMarkRenderer=function(a,b){this._data=a;this._textCache=b};
|
|
TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
TradingView.TriangleTextMarkRenderer.prototype.draw=function(a){if(this._data){var b="up"==this._data.direction?1:-1,c=this._data.point.x;"left"==this._data.halign?c-=this._data.size:"right"==this._data.halign&&(c+=this._data.size);var d=this._data.point.y;a.font=this.fontStyle();var e=a.measureText(this._data.text).width;this._textCache.textWidth=e;var f=this._data.fontSize,g=.65*f,h=1*f;a.save();a.translate(c+.5,d+.5);a.beginPath();a.moveTo(0,0);switch(this._data.direction){case "up":case "down":a.lineTo(g,
|
|
h*b);a.lineTo(.5*e+g,h*b);a.lineTo(.5*e+g,(h+1.75*f)*b);a.lineTo(.5*-e-g,(h+1.75*f)*b);a.lineTo(.5*-e-g,h*b);a.lineTo(-g,h*b);a.lineTo(0,0);a.strokeStyle=this._data.borderColor;a.stroke();a.fillStyle=this._data.color;a.fill();a.fillStyle=this._data.fontColor;a.fillText(this._data.text,.5*-e,0>b?b*h-.5*f:h+1.25*f);break;default:throw this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer";}a.restore()}};
|
|
TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(a){var b=this._textCache.textWidth,c=this._data.fontSize;switch(this._data.direction){case "up":case "down":var d="up"==this._data.direction?1:-1,e=.65*c,f=1*c,g=this._data.point.x;"left"==this._data.halign?g-=this._data.size:"right"==this._data.halign&&(g+=this._data.size);var h=this._data.point.y,k=g+.5*b+e,l=h+f*d,f=h+(f+1.75*c)*d;f<l&&(h=l,l=f,f=h);if(MathEx.pointInRect(a,new MathEx.Point(g-.5*b-e,l),new MathEx.Point(k,f)))return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);
|
|
b=[{}];b[0].x=this._data.point.x;b[0].y=this._data.point.y;b[1]={};b[1].x=this._data.point.x+.65*c;b[1].y=this._data.point.y+c*d;b[2]={};b[2].x=this._data.point.x-.65*c;b[2].y=this._data.point.y+c*d;c=(a.x-b[0].x)*(b[1].y-b[0].y)-(a.y-b[0].y)*(b[1].x-b[0].x);if(0<((a.x-b[1].x)*(b[2].y-b[1].y)-(a.y-b[1].y)*(b[2].x-b[1].x))*c&&0<((a.x-b[2].x)*(b[0].y-b[2].y)-(a.y-b[2].y)*(b[0].x-b[2].x))*c)return new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR);break;default:throw this._data.direction+
|
|
" doesn't supported by TradingView.TriangleTextMarkRenderer";}return null};TradingView.RectangleTextMarkRenderer=function(a,b){this._data=a;this._textCache=b};TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
TradingView.RectangleTextMarkRenderer.prototype.draw=function(a){if(this._data){var b=this._data.point.x,c=this._data.point.y;a.font=this.fontStyle();var d=a.measureText(this._data.text).width;this._textCache.textWidth=d;a.save();a.translate(b+.5,c+.5);a.beginPath();a.moveTo(0,0);b=this._data.valign;a.textAlign=this._data.halign;switch(b){case "middle":a.textBaseline="middle";break;case "top":a.textBaseline="bottom";break;case "bottom":a.textBaseline="hanging"}a.fillStyle=this._data.fontColor;a.fillText(this._data.text,
|
|
0,0);a.restore()}};TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(a){var b=this._data.point.x+.5,c=this._data.point.y+.5,d=this._textCache.textWidth,e=this._data.fontSize,f=this._data.halign;switch(this._data.valign){case "middle":c-=e/2;break;case "bottom":c-=e}switch(f){case "right":b-=d;break;case "center":b-=d/2}f=new MathEx.Point(b,c);b=new MathEx.Point(b+d,c+e);return MathEx.pointInRect(a,f,b)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
TradingView.CircleShapeMarkRenderer=function(a,b){this._data=a;this._textCache=b};TradingView.CircleShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=this._data.point.x,d=this._data.point.y;a.save();a.fillStyle=this._data.color;a.beginPath();a.arc(c+1,d+2*this._data.size*b+.5,this._data.size,0,2*Math.PI);a.closePath();a.fill();a.stroke()}};
|
|
TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(a){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-a.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*b-a.y,2)<=Math.pow(this._data.size,2)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};TradingView.SquareShapeMarkRenderer=function(a,b){this._data=a;this._textCache=b};
|
|
TradingView.SquareShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=parseInt(this._data.size),d=new MathEx.Point(this._data.point.x-c/2,this._data.point.y-c/2+b*c),b=(new MathEx.Point(this._data.point.x+c/2,this._data.point.y+c/2+b*c)).substract(d);a.beginPath();a.fillStyle=this._data.color;a.rect(d.x,d.y,b.x,b.y);a.stroke();a.fill()}};
|
|
TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(a){var b="down"==this._data.direction?1:"up"==this._data.direction?-1:0,c=parseInt(this._data.size),d=new MathEx.Point(this._data.point.x-c/2,this._data.point.y-c/2+b*c),c=new MathEx.Point(this._data.point.x+c/2,this._data.point.y+c/2+b*c),b=new MathEx.Point(Math.min(d.x,c.x),Math.min(d.y,c.y)),d=new MathEx.Point(Math.max(d.x,c.x),Math.max(d.y,c.y));return MathEx.pointInRect(a,b,d)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):
|
|
null};TradingView.ArrowShapeMarkRenderer=function(a,b,c){this._data=a;this._textCache=b;this._arrowDirection=c};
|
|
TradingView.ArrowShapeMarkRenderer.prototype.draw=function(a){if(this._data){var b=this._arrowDirection,c=1*this._data.size,d=this._data.color,e=this._data.point.x+1,f=this._data.point.y,g=1.1*c;switch(b){case "up":f-=g;break;case "down":f+=g}var g=c/6,h=c/4,k=c/3,l=c/2,m=.6666666*c;a.save();a.fillStyle=d;a.beginPath();switch(b){case "up":a.moveTo(e,f);a.lineTo(e-l,f+m);a.lineTo(e-h,f+m);a.lineTo(e,f+k);a.lineTo(e+h,f+m);a.lineTo(e+l,f+m);a.lineTo(e,f);break;case "down":a.moveTo(e,f+c);a.lineTo(e-
|
|
l,f+k);a.lineTo(e-h,f+k);a.lineTo(e,f+m);a.lineTo(e+h,f+k);a.lineTo(e+l,f+k);a.lineTo(e,f+c);break;case "right":a.moveTo(e+g,f);a.lineTo(e-g,f-h);a.lineTo(e-g,f+h);a.lineTo(e+g,f);break;case "left":a.moveTo(e-g,f),a.lineTo(e+g,f-h),a.lineTo(e+g,f+h),a.lineTo(e-g,f)}a.closePath();a.fill();a.stroke()}};
|
|
TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(a){var b=this._data.point.x,c=this._data.point.y,d=this._arrowDirection,e=1*this._data.size,f=e/2,f=1.1*e;switch(d){case "up":c-=f;break;case "down":c+=f}var g=e/6,h=e/4,k=e/3,f=e/2,l=.6666666*e;switch(d){case "up":var m=new MathEx.Point(b,c),n=new MathEx.Point(b+f,c+l),p=new MathEx.Point(b-f,c+l);break;case "down":m=new MathEx.Point(b,c+e);n=new MathEx.Point(b+f,c+k);p=new MathEx.Point(b-f,c+k);break;case "right":m=new MathEx.Point(b+
|
|
g,c);n=new MathEx.Point(b-g,c-h);p=new MathEx.Point(b-g,c+h);break;case "left":m=new MathEx.Point(b-g,c),n=new MathEx.Point(b+g,c-h),p=new MathEx.Point(b+g,c+h)}return MathEx.pointInTriangle(m,n,p,a)?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};TradingView.Study.StudyPaneView_textmarks=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_textmarks,TradingView.LocationToYMixin);
|
|
TradingView.Study.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "triangle":a.append(new TradingView.TriangleTextMarkRenderer(this._data[b],this._textCache[b]));break;case "rectangle":a.append(new TradingView.RectangleTextMarkRenderer(this._data[b],this._textCache[b]))}return a};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().textmarks;if(a){var b=this.D1.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.textmarks[h.styleId];if(k.visible.value())for(var h=h.data,l=0;l<h.length;l++){var m=
|
|
h[l],n={},p=k.location.value(),r=k.shape.value(),t=d[m.time];if(!(t<f||t>e)&&this.D1.series().bars().valueAt(t)){t=d[m.time]+(m.offset||0);n.font=k.fontFamily.value();n.color=TradingView.generateColor(k.color.value(),k.transparency.value());n.bold=k.fontBold.value();n.fontColor=TradingView.generateColor(k.fontColor.value(),k.transparency.value());n.italic=k.fontItalic.value();n.fontSize=k.fontSize.value();n.text=m.text?m.text:"";n.halign=k.halign.value();n.valign=void 0!==k.valign?k.valign.value():
|
|
"middle";n.shape=k.shape.value();n.size=.5*c.barSpacing();n.borderColor="rgb(0, 0, 0)";var v,w;switch(r){case "triangle":w=this._calcCoordsForTriangleShape(p,t,50,m.price,b);n.direction=w.direction;v=Math.round(c.indexToCoordinate(t));w=w.y;break;case "rectangle":w=this._calcCoordsForRectangleShape(p,t,m.price,b,c),v=w.x,w=w.y}n.point=new MathEx.Point(v,w);this._data.push(n);this._textCache.push({})}}}}}};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(a,b,c,d,e){switch(a){case CanvasEx.MARKLOC_TOP:d=e.height()-c;e="down";break;case CanvasEx.MARKLOC_BOTTOM:d=c;e="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:e.isPercent()&&(a=this.D1.firstValue(),d=e.priceRange().convertToPercent(d,a));d=e.priceToCoordinate(d);e="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:e.isPercent()&&(a=this.D1.firstValue(),d=e.priceRange().convertToPercent(d,a));d=e.priceToCoordinate(d);
|
|
e="up";break;case CanvasEx.MARKLOC_ABOVEBAR:d=this._locationToY(a,b);e="down";break;case CanvasEx.MARKLOC_BELOWBAR:d=this._locationToY(a,b);e="up";break;default:d=this._locationToY(a,b),e="up"}return{y:d,direction:e}};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(a,b,c,d,e){var f=Math.round(e.indexToCoordinate(b));switch(a){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:d.isPercent()&&(a=this.D1.firstValue(),c=d.priceRange().convertToPercent(c,a));c=d.priceToCoordinate(c);break;case CanvasEx.MARKLOC_ABOVEBAR:c=this._locationToY(a,b);break;case CanvasEx.MARKLOC_BELOWBAR:c=this._locationToY(a,b);break;case CanvasEx.MARKLOC_RIGHT:f=
|
|
e.width();d.isPercent()&&(a=this.D1.firstValue(),c=d.priceRange().convertToPercent(c,a));c=d.priceToCoordinate(c);break;case CanvasEx.MARKLOC_LEFT:f=e.width();d.isPercent()&&(a=this.D1.firstValue(),c=d.priceRange().convertToPercent(c,a));c=d.priceToCoordinate(c);break;default:c=this._locationToY(a,b)}return{x:f,y:c}};TradingView.Study.StudyPaneView_shapemarks=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_shapemarks,TradingView.LocationToYMixin);
|
|
TradingView.Study.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_shapemarks.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "circle":a.append(new TradingView.CircleShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "square":a.append(new TradingView.SquareShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "arrowUp":a.append(new TradingView.ArrowShapeMarkRenderer(this._data[b],
|
|
this._textCache[b],"up"));break;case "arrowDown":a.append(new TradingView.ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"down"));break;case "arrowRight":a.append(new TradingView.ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"right"));break;case "arrowLeft":a.append(new TradingView.ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"left"))}return a};
|
|
TradingView.Study.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().shapemarks;if(a){var b=this.D1.priceScale(),c=this.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.shapemarks[h.styleId];if(k.visible.value())for(var h=h.data,l=0;l<h.length;l++){var m=
|
|
h[l],n=d[m.time];if(!(n<f||n>e)){var p={};if(null!=m.time&&this.D1.series().bars().valueAt(n)){p.color=TradingView.generateColor(k.color.value(),k.transparency.value());var r=0;"left"==k.halign.value()?r-=c.barSpacing()/2+1:"right"==k.halign.value()&&(r+=c.barSpacing()/2+1);p.size=k.size.value();p.shape=k.shape.value();r=Math.round(c.indexToCoordinate(n))+r;m=m.price;if(b.isPercent())var t=this.D1.firstValue(),m=b.priceRange().convertToPercent(m,t);m=b.priceToCoordinate(m);t=k.location.value();
|
|
switch(t){case CanvasEx.MARKLOC_ABSOLUTE:p.direction="";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:p.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:p.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:m=this._locationToY(t,n,Math.floor(2*p.size/c.barSpacing())+1);p.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:m=this._locationToY(t,n,Math.floor(2*p.size/c.barSpacing())+1);p.direction="down";break;default:console.warn("Bad location value: "+t),m=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,
|
|
n),p.direction="up"}p.point=new MathEx.Point(r,m);this._data.push(p);this._textCache.push({})}}}}}}};TradingView.BackgroundRenderer=function(a){this._data=a};TradingView.BackgroundRenderer.prototype.draw=function(a){};TradingView.BackgroundRenderer.prototype.drawBackground=function(a){var b=this._data;TradingView.clearRect(a,b.x1,b.y1,b.x2-b.x1,b.y2-b.y1,TradingView.generateColor(this._data.color,this._data.transparency))};TradingView.BackgroundRenderer.prototype.hitTest=function(a){return null};
|
|
TradingView.Study.StudyPaneView_backgrounds=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0};TradingView.Study.StudyPaneView_backgrounds.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.BackgroundRenderer(this._data[b]));return a};
|
|
TradingView.Study.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(a){return"inSession"===a||"outOfSession"===a?!this.D1._series.properties().extendedHours.value():!1};
|
|
TradingView.Study.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().backgrounds;if(a){var b=this.D0.timeScale(),c=this.D1.priceScale();if(c&&!c.isEmpty()&&b&&!b.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g],k=h.styleId,h=h.data,l=this.D1.properties().graphics.backgrounds[k];if(!this._hideExtendedHours(k)&&l.visible.value())for(var m,
|
|
n,k=0;k<h.length;k++){var p=h[k],r={},t=d[p.start],v=d[p.stop];if(!(v<f||t>e)&&null!=p.start&&null!=p.stop){var p=Math.ceil(b.indexToCoordinate(t,!0)-.5*b.barSpacing()),w=Math.ceil(b.indexToCoordinate(v,!0)+.5*b.barSpacing());n==t-1&&(p=m);m=w;n=v;0>p&&0>w||p>b.width()&&w>b.width()||(r.x1=p,r.x2=w,r.y1=0,r.y2=c.height(),r.color=l.color.value(),r.transparency=l.transparency.value(),this._data.push(r))}}}}};
|
|
TradingView.Study.StudyPaneView_polygons=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_polygons.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.PoligonRenderer(this._data[b],new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_polygons.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().polygons;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.D1.properties().graphics.polygons[h.styleId];if(100!=k.transparency.value())for(var l=0;l<h.data.length;l++){for(var m=
|
|
h.data[l],n=Infinity,p=-Infinity,r=0;m.points&&r<m.points.length;r++)var t=d[m.points[r].index]+(m.points[r].offset||0),n=Math.min(n,t),p=Math.max(p,t);if(!(p<f||n>e)){n={};n.points=new List;for(r=0;m.points&&r<m.points.length;r++){t=m.points[r];p=c.indexToCoordinate(d[t.index]+(t.offset||0));t=t.level;if(b.isPercent())var v=this.D1.firstValue(),t=b.priceRange().convertToPercent(t,v);t=b.priceToCoordinate(t);p=new MathEx.Point(p,t);p.data=r;n.points.append(p)}n.color=k.color.value();n.backcolor=
|
|
k.color.value();n.linewidth=void 0!==k.showBorder&&k.showBorder.value()?1:0;n.linestyle=CanvasEx.LINESTYLE_SOLID;n.filled=!0;n.fillBackground=!0;n.transparency=k.transparency.value();n.mouseTouchable=k.mouseTouchable.value();this._data.push(n)}}}}}};TradingView.Study.StudyPaneView_trendchannels=function(a,b){this.D1=a;this.D0=b;this._data=[]};TradingView.Study.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_trendchannels.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);for(var a=new TradingView.CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TradingView.PoligonRenderer(this._data[b],new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_trendchannels.prototype._convertToYCoord=function(a){var b=this.D1.priceScale(),c=this.D1.firstValue();b.isPercent()&&(a=b.priceRange().convertToPercent(a,c));return b.priceToCoordinate(a)};
|
|
TradingView.Study.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){this._data=[];var a=this.D1.graphics().trendchannels;if(a){var b=this.D1.priceScale(),c=this.D1.D0.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=function(a,b,c,d,e,f){var g=new MathEx.Point(0,0);d=new MathEx.Point(c,d);e&&(e=a.substract(b),(e=MathEx.intersectRayWithRect(a,a.add(e),g,d))?a=e:b.x=c);f&&(e=b.substract(a),(e=MathEx.intersectRayWithRect(b,b.add(e),g,d))?b=e:b.x=c);return[a,
|
|
b]},e=this.D1.graphics().indexes,f=this.D0.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data)for(var l=this.D1.properties().graphics.trendchannels[k.styleId],m=0;m<k.data.length;m++){var n=k.data[m],p=e[n.startIndex],r=e[n.endIndex];if(!(Math.max(p,r)<g&&!n.extendRight||Math.min(p,r)>f&&!n.extendLeft)){var t=this._convertToYCoord(n.startHighPrice),v=this._convertToYCoord(n.startLowPrice),w=this._convertToYCoord(n.endHighPrice),u=w-(t-v),p=
|
|
c.indexToCoordinate(p),r=c.indexToCoordinate(r),t=new MathEx.Point(p,t),v=new MathEx.Point(p,v),w=new MathEx.Point(r,w),u=new MathEx.Point(r,u),w=d(t,w,c.width(),b.height(),n.extendLeft,n.extendRight),u=d(v,u,c.width(),b.height(),n.extendLeft,n.extendRight),t=w[0],w=w[1],v=u[0],u=u[1],r={};r.points=new List;r.points.append(t);r.points.append(v);r.points.append(u);r.points.append(w);r.color=l.color.value();r.backcolor=l.color.value();r.linewidth=void 0!==l.borderWidth?l.borderWidth.value():0;r.linestyle=
|
|
CanvasEx.LINESTYLE_SOLID;r.filled=!0;r.fillBackground=!0;n.transparency?(n=n.transparency+l.transparency.value(),r.transparency=Math.min(n,100)):r.transparency=l.transparency.value();r.mouseTouchable=!0;this._data.push(r)}}}}};TradingView.Study.StudyPaneView_hhists=function(a,b){this.D1=a;this.D0=b;this._data=[];this._textData=[];this._textRendererCache={}};TradingView.Study.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.Study.StudyPaneView_hhists.prototype.renderer=function(){this._invalidated&&(this._updateViewInternal(),this._invalidated=!1);var a=new TradingView.CompositeRenderer,b;for(b in this._data)a.append(new TradingView.HorizHistogramRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_hhists.prototype._updateViewInternal=function(){this._data=[];this._textData=[];var a=this.D1.priceScale(),b=this.D0.timeScale();if(a&&!a.isEmpty()&&b&&!b.isEmpty()){var c=this.D1.graphics().hhists;if(c)for(var d=this.D1.graphics().indexes,e=this.D0.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<c.length;g++){var h=c[g],k=this.D1.properties().graphics.hhists[h.styleId];if(k.visible.value()){var h=h.dataObj,l;for(l in h){for(var m=
|
|
h[l],n=Infinity,p=-Infinity,r=m.length;r--;)n=Math.min(n,d[m[r].firstBarTime]),p=Math.max(p,d[m[r].lastBarTime]);p<f||n>e||this._updateDataForRenderers(m,k,a,b,d)}}}}};
|
|
TradingView.Study.StudyPaneView_hhists.prototype._updateDataForRenderers=function(a,b,c,d,e){for(var f=[],g=this._findMaxRate(a),h=null,k=null,l=null,m,n,p,r,t,v={},w=function(a,b,c){if(c==CanvasEx.HHISTDIR_LEFTTORIGHT)return a+b;if(c==CanvasEx.HHISTDIR_RIGHTTOLEFT)return b+a;throw Error("Unknown direction value: "+c);},u=0;u<a.length;u++){var x=a[u];null===k&&(k=this._findActualRateLength(x.rate));null===h&&(h=Math.abs(d.indexToCoordinate(e[x.firstBarTime])-d.indexToCoordinate(e[x.lastBarTime])),
|
|
h=b.percentWidth.value()*h/100,h-=k,h=Math.max(h,0));for(var C=!1,A,y,D=0;D<k;D++)if(0!==x.rate[D]){v[D]=void 0===v[D]?x.rate[D]:v[D]+x.rate[D];c.isPercent()?(n=this.D1.firstValue(),m=c.priceRange().convertToPercent(x.priceHigh,n),n=c.priceRange().convertToPercent(x.priceLow,n)):(m=x.priceHigh,n=x.priceLow);var E={};E.y1=c.priceToCoordinate(m)+1;E.y2=c.priceToCoordinate(n)-1;0===u&&(A=E.y2,y=E.y2-E.y1);n=b.location.value();m=b.direction.value();if(n==CanvasEx.HHISTLOC_ABSOLUTE&&m==CanvasEx.HHISTDIR_LEFTTORIGHT)r=
|
|
d.indexToCoordinate(e[x.firstBarTime]),p=1,t="left";else if(n==CanvasEx.HHISTLOC_ABSOLUTE&&m==CanvasEx.HHISTDIR_RIGHTTOLEFT)r=d.indexToCoordinate(e[x.lastBarTime]),p=-1,t="right";else if(n==CanvasEx.HHISTLOC_RELATIVE&&m==CanvasEx.HHISTDIR_LEFTTORIGHT)r=0,p=1,t="left";else if(n==CanvasEx.HHISTLOC_RELATIVE&&m==CanvasEx.HHISTDIR_RIGHTTOLEFT)r=d.width(),p=-1,t="right";else throw Error("Unknown location/direction values: "+n+"/"+m);E.x1=0===D?r:r+p*(h*x.rate[D-1]/g+k);E.x2=E.x1+h*x.rate[D]/g*p;E.colorBg=
|
|
b.colors[D].value();E.transparency=b.transparencies[D].value();E.blendedColor=TradingView.generateColor(E.colorBg,E.transparency);E.x0=r;f.push(E);l||(l=.6*(E.y2-E.y1));if(!C&&b.showValues.value()&&7.5<=l){var C=!0,z={};n=this.D1.formatter();z.text="";for(var F=0;F<k;F++)z.text=w(z.text,n.format(x.rate[F]),m),F!=k-1&&(z.text=w(z.text,"x",m));z.color=b.valuesColor.value();z.font="arial";z.fontsize=l;z.horzAlign=t;z.vertAlign="middle";E=new MathEx.Point(r+3*p,E.y2-.61*(E.y2-E.y1));z.points=(new List).append(E);
|
|
z.offsetX=0;z.offsetY=0;this._textData.push(z);if(u===a.length-1){E=r+3*p;p=A+.39*y;t={text:"",color:TradingView.shiftColor(b.valuesColor.value(),1.5),font:"arial",fontsize:l,horzAlign:t,vertAlign:"middle",points:(new List).append(new MathEx.Point(E,p)),offsetX:0,offsetY:0};for(F=0;F<k;F++)t.text=w(t.text,n.format(v[F]),m),F!=k-1&&(t.text=w(t.text,"x",m));this._textData.push(t)}}}}0<f.length&&this._data.push(f)};
|
|
TradingView.Study.StudyPaneView_hhists.prototype._findMaxRate=function(a){for(var b=0,c=0,d=0;d<a.length;d++){for(var e=c=0;e<a[d].rate.length;e++)c+=a[d].rate[e];b=Math.max(b,c)}return b};TradingView.Study.StudyPaneView_hhists.prototype._findActualRateLength=function(a){for(var b=0,c=0;c<a.length;++c){var d=a[c];if(null!==d&&void 0!==d)b++;else break}return b};TradingView.HorizHistogramRenderer=function(a){this._data=a};
|
|
function searchCoord(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>>1,f=a[e].y1,g=a[e].y2;if(f>b)c=e+1;else if(g<b)d=e-1;else return a[e+1]&&f==a[e+1].y1?e+1:e}return-1}TradingView.HorizHistogramRenderer.prototype.hitTest=function(a){var b=searchCoord(this._data,a.y);if(0>b)return null;var c=Math.min(this._data[b].x0,this._data[b].x2),b=Math.max(this._data[b].x0,this._data[b].x2);return c<=a.x&&a.x<=b?new TradingView.HitTestResult(TradingView.HitTestResult.REGULAR):null};
|
|
TradingView.HorizHistogramRenderer.prototype.draw=function(a){a.save();for(var b={},c=[],d,e=0;e<this._data.length;e++){var f=this._data[e];b[f.blendedColor]?b[f.blendedColor].push(f):(c.push(f.blendedColor),b[f.blendedColor]=[f])}for(var g=0;g<c.length;g++){d=c[g];a.fillStyle=d;a.strokeStyle=d;a.beginPath();d=b[d];for(e=0;e<d.length;e++)f=d[e],a.rect(f.x1,f.y1,f.x2-f.x1,f.y2-f.y1);a.stroke();a.fill()}a.restore()};TradingView.study_ScriptWithDataOffset=function(a,b,c,d){TradingView.Study.call(this,a,b,c,d)};inherit(TradingView.study_ScriptWithDataOffset,TradingView.Study);TradingView.study_ScriptWithDataOffset.prototype.clearData=function(){TradingView.Study.prototype.clearData.call(this);this._underlyingData=new TradingView.PlotList(this._plotFields)};
|
|
TradingView.study_ScriptWithDataOffset.prototype._mergeData=function(a){var b=0===this._underlyingData._length()?null:this._underlyingData._indexAt(0);this._underlyingData.merge(a);b!==this._underlyingData._indexAt(0)&&(this.m_data=new TradingView.PlotList(this._underlyingData.columns()));this.m_data._start=this._underlyingData._start;this.m_data._end=this._underlyingData._end;var c=this.m_data._length();for(a=c;a<this._underlyingData._length();++a)b=TradingView.merge({},this._underlyingData._valueAt(a)),
|
|
this.m_data.add(this._underlyingData._indexAt(a),b);this._plotsForStrategyProcessing().forEach(function(a){this._createStrategy(a.strategy,a.strategyIndex,a.targetIndex,c).rebuildData(this.m_data)},this);return this.m_data};
|
|
TradingView.study_ScriptWithDataOffset.prototype._plotsForStrategyProcessing=function(){var a=["dataoffset"],b=[];this._metaInfo.plots.forEach(function(c,d){if(-1<a.indexOf(c.type)){var e=null;this._metaInfo.plots.forEach(function(a,b){a.id==c.target&&(e=b)});assert(0<=e,"target plot not found for strategy plot "+c.id);b.push({strategy:c.type,strategyIndex:d,targetIndex:e})}},this);return b};
|
|
TradingView.study_ScriptWithDataOffset.prototype._createStrategy=function(a,b,c,d){return new TradingView.study_ScriptWithDataOffset["Strategy_"+a](b,c,d)};TradingView.study_ScriptWithDataOffset.Strategy_dataoffset=function(a,b,c){this._strategyPlotIndex=a;this._targetPlotIndex=b;this._startIndex=c};
|
|
TradingView.study_ScriptWithDataOffset.Strategy_dataoffset.prototype.rebuildData=function(a){for(var b=this._targetPlotIndex+1,c=this._strategyPlotIndex+1,d=null,e=null,f=this._startIndex;f<a._length();++f){var g=a._valueAt(f),h=g[b],k=g[c]?Math.round(g[c]):null;g[b]=null;g[c]=null;!k||0<k||((k=f+k,g={pointIndex:k,value:h},e)?e.pointIndex!=g.pointIndex&&(0<=k&&(a._items[k].value[b]=h),k=!1,d&&(k=d.value<=e.value&&e.value<=h||d.value>=e.value&&e.value>=h),k?0<=e.pointIndex&&(a._items[e.pointIndex].value[b]=
|
|
null):d=e,e=g):e=g)}};TradingView.getDataVendorString=function(a){if(a&&"QUANDL"==a.exchange)return"Quandl.com"};TradingView.AppClipboard=function(){function a(a){a=$.Event("appclip:"+a);$(window).trigger(a,{AppClipboard:g});return a}function b(b){if(document.activeElement===document.body||document.activeElement===document.documentElement){var c;c=[];b.shiftKey&&c.push("s");b.ctrlKey&&c.push("c");b.metaKey&&c.push("m");b.altKey&&c.push("a");c.push(b.keyCode);c=c.join("");var d;a:{switch(c){case "c67":case "m67":case "c45":d="copy";break a;case "c86":case "m86":case "s45":d="paste";break a;case "c88":case "m88":case "s46":d=
|
|
"cut";break a}d=void 0}if(d){if("keydown"===b.type)e[c]=!0;else if(e[c])return;if(document.getSelection){if(!document.getSelection().isCollapsed)return}else if(document.selection&&"None"!==document.selection.type)return;b.isDefaultPrevented()||a(d).isDefaultPrevented()&&b.preventDefault()}}}function c(b){b=b.originalEvent||b;"application-clipboard"===b.key&&a("change")}function d(){localStorage.getItem("application-clipboard")&&(localStorage.removeItem("application-clipboard"),a("change"))}var e=
|
|
{},f=!1,g={init:function(){f||($(document).on("keypress keydown",b),$(window).on("storage",c),f=!0)},set:function(b){if(null==b)return d();b=JSON.stringify(b);b!==localStorage.getItem("application-clipboard")&&(localStorage.setItem("application-clipboard",b),a("change"))},get:function(){try{return JSON.parse(localStorage.getItem("application-clipboard"))}catch(a){return null}},clear:d,destroy:function(){$(document).off("keypress keydown",b);$(window).off("storage",c);$(window).off("appclip:copy");
|
|
$(window).off("appclip:paste");$(window).off("appclip:cut");$(window).off("appclip:change");f=!1}};return g}();A20=function(a,b,c){this._options=c||{};this._w=a;this._opener=b;this._addMetric=1;this._addOpened=!1};A20.prototype._interval=function(a){a=$(a.target);a.hasClass("disabled")||(this._w.setInterval(a.data("interval")),this.close())};A20.prototype._quickTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
|
|
A20.prototype._onQuick=function(a){var b=$(a.target).closest(".item"),c=this._w.toggleQuick(b.data("interval"));b.toggleClass("quicked",c);$(a.target).closest(".to-quick").attr("title",this._quickTitle(c));return!1};A20.prototype._onDelete=function(a){a=$(a.target.parentNode);this._w.removeInterval(a.data("interval"));this._reopen();return!1};A20.prototype._showControlButtons=function(){return!0};
|
|
A20.prototype._append=function(a,b){var c=$("<span>").addClass("item").toggleClass("active",b==this._w.getInterval()).toggleClass("quicked",this._w.inQuick(b)).toggleClass("disabled",!TradingView.IntervalHelper.isAvailable(b)).text(this._w.fullLabel(b)).data("interval",b);this._showControlButtons()&&(this._w.isDefaultInterval(b)||c.prepend($("<span>").addClass("delete").attr("title",$.t("Remove custom interval")).click(this._onDelete.bind(this))),this._w._options.notShowQuicks||
|
|
c.prepend($("<span>").addClass("to-quick").append(svgAsset("star","16x16")).attr("title",this._quickTitle(this._w.inQuick(b))).click(this._onQuick.bind(this))));c.click(this._interval.bind(this));a.append(c)};
|
|
A20.prototype._appendAdd=function(a){function b(){var a=parseInt(e.val());1>a&&e.val(1);var b={1:1440,60:24,D:364,W:52,M:12}[this._addMetric];a>b&&e.val(b)}var c=$("<span>").addClass("item-add"),d=$('<span class="item-add-wrap">').appendTo(c),e=$('<input type="text">').addClass("tv-text-input inset minutes").val(1).appendTo(d).TVTicker(),f=$("<span>").addClass("tv-button mins").append($("<span>")).append($("<i>")).appendTo(d),d=$("<span>").addClass("tv-button add").text($.t("Add")).appendTo(d),
|
|
g={1:$.t("minute_plural"),60:$.t("hour_plural"),D:$.t("day_plural"),W:$.t("week_plural"),M:$.t("month_plural")};f.find("span").text(g[this._addMetric||1]);e.change(b.bind(this));var h=this;TradingView.bindPopupMenu(f,null,{direction:"up",event:"button-popup",addClass:"thin small-font metrics",popupSpacing:~~this._w._options.popupSpacing,onRemove:function(){h._addOpened=!1}});f.click(function(){h._addOpened=!0;f.trigger("button-popup",[$.map(g,function(a,c){return{title:a.toUpperCase(),active:c==h._addMetric,
|
|
action:function(){h._addMetric=c;f.find("span").text(a);b.call(h);return!1}}})])});d.click(function(){TradingView.runOrGoPro(function(){var a=parseInt(e.val());if(a==a){var b=parseInt(h._addMetric);b==b?h._addInterval(""+a*h._addMetric):h._addInterval(""+a+h._addMetric)}},{feature:"customIntervals"})});a.append($("<div>").addClass("separator"));a.append(c)};A20.prototype._addInterval=function(a){};
|
|
A20.prototype._open=function(a,b){a.find(".item, .item-add, .separator").remove();var c=[],d=[],e=[],f=$("<span>").addClass("separator");$.each(b,function(a,b){/^\d*[DWM]$/.test(b)?e.push(b):TradingView.IntervalHelper.isHour(b)?d.push(b):c.push(b)}.bind(this));c.length&&c.forEach(function(b){this._append(a,b)}.bind(this));d.length&&(a.append(f.clone()),d.forEach(function(b){this._append(a,b)}.bind(this)));e.length&&(a.append(f.clone()),e.forEach(function(b){this._append(a,b)}.bind(this)));
|
|
this._options.onWidget||R77.enabled("charting_library_base")||this._appendAdd(a)};A20.prototype._reopen=function(){this._open(this._menu,this._w._sorted(this._w._intervals))};
|
|
A20.prototype.open=function(a){var b=$("<div>").addClass("charts-popup-list intervals-list favored-list").toggleClass("touch",Modernizr.touch),c=this._w.mainButton().offset(),d=this._w.mainButton().outerHeight(),e=c.top+d+parseInt(this._options.popupSpacing||0);b.appendTo(document.body);b.css({top:e,left:c.left}).show();this._menu=b;this._opener.addClass("active");this._open(b,a);a=Math.min($("body").height(),$(window).height())-d-e-10;this._setMaxHeight(b,a);setTimeout(function(){b.on("mousedownoutside",
|
|
function(a){this.close(a)&&b.unbind("mousedownoutside")}.bind(this))}.bind(this),0)};A20.prototype._setMaxHeight=function(a,b){a.height()>=b&&(a.css("max-height",b+"px"),a.width(a.width()+18))};
|
|
A20.prototype.close=function(a){if(a&&$(a.target).parents("span.item-add, .charts-popup-list.metrics").length||a&&$(a.target).hasClass("submenu")&&$(a.target).parents(".intervals-container").length)return!1;this._menu.remove();$(document.body).off(".interval-menu");delete this._menu;this._opener.removeClass("active");return!0};A21=function(a){this._options=$.extend({interval:1},a||{});this._e=$("<div>").addClass("intervals-container favored-list-container");this._quick=$("<div>").addClass("quick").appendTo(this._e);this._quicked={};this._main=$("<span>").text(this.shortLabel(this._options.interval)).appendTo(this._quick);this._main.data("interval",this._options.interval);R77.enabled("header_interval_dialog_button")&&this._setIntervalDialogButton();this._mainSub=$("<span>").addClass("submenu").attr("title",
|
|
$.t("Time Interval")).append($("<i>")).appendTo(this._e);a&&"string"==typeof a.submenuBtnAddClass&&this._mainSub.addClass(a.submenuBtnAddClass);this._quick.on("click",this._selectInterval.bind(this));this._mainSub.on("click",this._selectMenu.bind(this));this._menu=new A20(this,this._mainSub,this._options);this.onResize=new Delegate;A45.intraday.subscribe(this._fullUpdate.bind(this));A45.supportedResolutions.subscribe(this._fullUpdate.bind(this));
|
|
a.interval&&A45.interval.setValue(a.interval);A45.interval.subscribe(this.activateInterval.bind(this),{callWithLast:!0});TVXWindowEvents.on("intervalwidget-change",this._onChangeInAnotherTab.bind(this));this._fullUpdate()};A21.prototype.forceUpdate=function(){this._fullUpdate(!0)};A21.prototype._fullUpdate=function(a){this._setupIntervals(a);this._setupQuicks(a);this.reactivateInterval();this._resize()};
|
|
A21.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)};A21.prototype.isDefaultInterval=function(a){return a in D16.defaultResolutions()};A21.prototype._setupIntervals=function(){this._intervals=$.extend({},D16.defaultResolutions())};
|
|
A21.prototype._sorted=function(a){Array.isArray(a)||(a=Object.keys(a));return a.sort(function(a,c){function d(a){var b=TradingView.IntervalHelper.isDWM(a);return b?{D:1440,W:10080,M:43200}[b.unit]*b.qty:parseInt(a)}return d(a)-d(c)})};A21.prototype.setUpStarredItemsList=function(a){for(var b={},c=0;c<a.length;++c)b[a[c]]=!0;this._setupQuicks(!1,b)};
|
|
A21.prototype._setupQuicks=function(a,b){if(!this._options.notShowQuicks||b)b=b||{},R77.enabled("star_some_intervals_by_default")&&(b={1:!0,30:!0,60:!0}),this._quicked=TVSettings.getJSON("IntervalWidget.quicks",b,a),this._quicked=this._removeCustomIntervalQuicks(this._quicked);this._addQuicked(this._quicked)};
|
|
A21.prototype._removeCustomIntervalQuicks=function(a){var b={};Object.keys(a).forEach(function(c){this.isDefaultInterval(c)&&(b[c]=a[c])},this);return b};A21.prototype.element=function(){return this._e};A21.prototype.mainButton=function(){return this._main};A21.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)};
|
|
A21.prototype.postfix=function(a,b){if(b){var c=" ";switch(a){case "D":c+=$.t("day",{count:b});break;case "W":c+=$.t("week",{count:b});break;case "M":c+=$.t("month",{count:b});break;case "m":c+=$.t("minute",{count:b});break;case "h":c+=$.t("hour",{count:b})}return c}switch(a){case "m":return"";case "h":return $.t("h",{context:"dates"});default:return $.t(a.toUpperCase(),{count:0})}};
|
|
A21.prototype.readable=function(a,b,c){var d="m",e=TradingView.IntervalHelper.isDWM(a);e&&(a=e.qty,d=e.unit);a=parseInt(a);if(!a)throw new TypeError("Wrong interval value: "+a);"m"===d&&TradingView.IntervalHelper.isHour(a)&&(a=~~(a/60),d="h");b=b?a:null;return""+(c&&1===a&&"m"!=d?"":a)+this.postfix(d,b)};A21.prototype.shortLabel=function(a){return TradingView.translatedIntervalString(this.readable(a,!1))};
|
|
A21.prototype.fullLabel=function(a){return this.readable(a,!0)};A21.prototype._addQuicked=function(a){this._quicks().remove();a=this._sorted(a);a.forEach(function(a){a=$("<span>").data("interval",a).text(this.shortLabel(a)).toggleClass("selected",a==this.getInterval()).toggleClass("disabled",!TradingView.IntervalHelper.isAvailable(a));this._main.before(a)},this);this._resize()};A21.prototype._resize=function(){this.onResize.fire()};
|
|
A21.prototype.addQuick=function(a){this._quicked[a]=!0;this._addQuicked(this._quicked);this.saveSettings();this.reactivateInterval()};A21.prototype._quickWithInterval=function(a){var b=null;this._quicks().each(function(c,d){d=$(d);if(a==d.data("interval"))return b=d,!1});return b};A21.prototype.inQuick=function(a){return null!=this._quickWithInterval(a)};
|
|
A21.prototype.removeQuick=function(a){this._quickWithInterval(a)&&(this._quickWithInterval(a).remove(),this._resize(),delete this._quicked[a],this.saveSettings(),this.reactivateInterval())};A21.prototype.toggleQuick=function(a){var b=this.inQuick(a);b?this.removeQuick(a):this.addQuick(a);return!b};A21.prototype.hasQuicks=function(){return!!this._quicks().length};A21.prototype.deactivate=function(a){this._quick.find("span").removeClass("selected")};
|
|
A21.prototype.activateInterval=function(a){this.deactivate();this.inQuick(a)?this._quickWithInterval(a).addClass("selected"):(this.hasQuicks()&&this._main.addClass("selected"),this._main.text(this.shortLabel(a)),this._main.data("interval",a),this._resize())};A21.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())};A21.prototype.getInterval=function(){return A45.interval.value()};
|
|
A21.prototype.setInterval=function(a){A45.interval.setValue(""+a)};A21.prototype._selectInterval=function(a){a=$(a.target);var b=a.data("interval");this.hasQuicks()||this.getInterval()!=b?a.hasClass("disabled")||this.setInterval(b):this._selectMenu()};A21.prototype._selectMenu=function(a){this._mainSub.hasClass("active")?this._menu.close():this._menu.open(this._sorted(this._intervals))};
|
|
A21.prototype._setIntervalDialogButton=function(){this._intervalDialogButton=$("<span>").addClass("submenu interval-dialog-button apply-common-tooltip").attr("title",$.t("Open Interval Dialog")).append($("<i>")).appendTo(this._e).click(function(){var a=(new TradingView.ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show(),b=$(this);b.addClass("active");a.on("destroy",function(){b.removeClass("active")})})};
|
|
A21.prototype.addInterval=function(a){};A21.prototype.removeInterval=function(a){};A21.prototype.saveIntervals=function(){};A21.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)};A21.prototype.saveSettings=function(){this.saveQuicked();this.saveIntervals();TVXWindowEvents.emit("intervalwidget-change")};A22=function(a){this._invalidationLevel=a?a:A22.UPDATE_CURSOR_ONLY;this._invalidatedPanes={};TradingView.perfomanceTestEnabled()&&(this._timeCreated=window.performance.now(),this._mergeCount=0,this._documentHidden=document.hidden)};A22.UPDATE_CURSOR_ONLY=1;A22.LIGHT_UPDATE=2;A22.FULL_UPDATE=3;
|
|
A22.prototype.invalidatePane=function(a,b){this._invalidatedPanes[a]=this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],b):b};A22.prototype.invalidateAll=function(a){this._invalidationLevel=Math.max(this._invalidationLevel,a)};A22.prototype.fullInvalidation=function(){return this._invalidationLevel};
|
|
A22.prototype.invalidateForPane=function(a){return this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],this._invalidationLevel):this._invalidationLevel};
|
|
A22.prototype.merge=function(a){this.force=this.force||a.force;this._invalidationLevel=Math.max(this._invalidationLevel,a._invalidationLevel);for(var b in a._invalidatedPanes)this._invalidatedPanes[b]=this._invalidatedPanes[b]?Math.max(this._invalidatedPanes[b],a._invalidatedPanes[b]):a._invalidatedPanes[b];TradingView.perfomanceTestEnabled()&&this._mergeCount++};
|
|
A22.prototype.exclude=function(a){this._invalidationLevel<=a&&(this._invalidationLevel=0);for(var b in this._invalidatedPanes)this._invalidatedPanes[b]<=a&&(this._invalidatedPanes[b]=0)};A22.prototype.start=function(){this._timeStart=window.performance.now()};A22.prototype.end=function(){this._timeEnd=window.performance.now()};TradingView.PropertyPagesFactory=function(){function a(a){return a instanceof R47?a instanceof TradingView.LineToolRiskReward?J25:a instanceof TradingView.LineToolRegressionTrend?J24:a instanceof TradingView.LineToolEllipse||a instanceof TradingView.LineToolRotatedRectangle||a instanceof TradingView.LineToolArc?null:a instanceof TradingView.LineToolTrendAngle?J28:
|
|
a instanceof TradingView.LineToolParallelChannel||a instanceof TradingView.LineToolPolyline||a instanceof TradingView.LineToolText||a instanceof TradingView.LineToolFibWedge||a instanceof TradingView.LineToolBrush?null:a instanceof TradingView.LineToolHorzLine?J11:a instanceof TradingView.LineToolBarsPattern||a instanceof TradingView.LineToolDisjointAngle||a instanceof TradingView.LineToolFlatBottom?null:a instanceof TradingView.LineToolVertLine?J35:
|
|
a instanceof A63?J43:a instanceof TradingView.LineToolIcon||a instanceof TradingView.LineToolTrading||a instanceof TradingView.LineToolExecution?null:J14:a instanceof TradingView.Study?a instanceof TradingView.study_ElliottWave?J40:a instanceof TradingView.study_Compare?J38:J41:null}function b(a,
|
|
b){if(a instanceof TradingView.Series||a instanceof A7||a instanceof TradingView.ESDStudyBase)return A85;if(a instanceof TradingView.Study)return a instanceof TradingView.study_PivotPointsHighLow?J45:a instanceof TradingView.study_PivotPointsStandard?J46:a instanceof TradingView.study_ZigZag?J48:a instanceof
|
|
TradingView.study_Overlay?J44:a instanceof TradingView.study_LinearRegression?J42:"Volume@tv-basicstudies"==a.metaInfo().id?J50:a instanceof TradingView.study_VbPVisible||a instanceof TradingView.study_VbPSessions?TradingView.StudyVolumeProfilePropertyPage:J47;if(a instanceof R47){if(a instanceof TradingView.LineToolVbPFixed)return J51;
|
|
if(a instanceof TradingView.LineToolRegressionTrend)return J42;if(a instanceof TradingView.LineToolTrendLine)return J32;if(a instanceof TradingView.LineToolTrendAngle)return J29;if(a instanceof TradingView.LineToolDateRange||a instanceof TradingView.LineToolPriceRange)return A95;if(a instanceof TradingView.LineToolHorzLine||
|
|
a instanceof TradingView.LineToolHorzRay)return J12;if(a instanceof TradingView.LineToolVertLine)return J36;if(a instanceof TradingView.LineToolPitchfork)return J18;if(a instanceof TradingView.LineToolPitchfan)return J17;if(a instanceof TradingView.LineToolText)return J27;if(a instanceof TradingView.LineToolNote)return TradingView.LineToolNotePropertyPage;
|
|
if(a instanceof TradingView.LineToolCallout)return A93;if(a instanceof TradingView.LineToolRectangle||a instanceof TradingView.LineToolRotatedRectangle)return J23;if(a instanceof TradingView.LineToolEllipse)return A98;if(a instanceof TradingView.LineToolArc)return A87;if(a instanceof TradingView.LineToolTriangle)return J34;
|
|
if(a instanceof TradingView.LineToolParallelChannel)return J16;if(a instanceof TradingView.LineToolDisjointAngle)return A96;if(a instanceof TradingView.LineToolFlatBottom)return J7;if(a instanceof TradingView.LineToolArrowMark)return A88;if(a instanceof TradingView.LineToolPriceLabel)return J21;
|
|
if(a instanceof TradingView.LineToolIcon)return J13;if(a instanceof TradingView.LineToolBalloon)return A89;if(a instanceof TradingView.LineToolBrush)return A92;if(a instanceof TradingView.LineToolPrediction)return J20;if(a instanceof TradingView.LineToolPolyline)return J19;if(a instanceof TradingView.LineToolGannSquare)return J10;
|
|
if(a instanceof TradingView.LineToolGannComplex)return J8;if(a instanceof TradingView.LineToolGannFan)return J9;if(a instanceof TradingView.LineToolFibRetracement)return J1;if(a instanceof TradingView.LineToolFibChannel)return A99;if(a instanceof TradingView.LineToolFibCircles)return A84;
|
|
if(a instanceof TradingView.LineToolFibSpiral)return J4;if(a instanceof TradingView.LineToolFibSpeedResistanceArcs)return J2;if(a instanceof TradingView.LineToolTrendBasedFibExtension)return J30;if(a instanceof TradingView.LineToolTrendBasedFibTime)return J31;if(a instanceof TradingView.LineToolFibSpeedResistanceFan)return J3;
|
|
if(a instanceof TradingView.LineToolFibTimeZone)return J5;if(a instanceof TradingView.LineToolProjection)return J22;if(a instanceof TradingView.LineToolFibWedge)return J6;if(a instanceof TradingView.LineToolCircleLines)return A94;if(a instanceof TradingView.LineToolTimeCycles||a instanceof TradingView.LineToolSineLine)return TradingView.LineToolTimeCyclesPropertyPage;
|
|
if(a instanceof TradingView.LineToolElliott)return A97;if(a instanceof TradingView.LineToolBarsPattern)return A91;if(a instanceof TradingView.LineToolRiskReward)return J26;if(a instanceof TradingView.LineTool5PointsPattern)return J15;if(a instanceof TradingView.LineToolABCD)return A86;
|
|
if(a instanceof TradingView.LineToolTrianglePattern)return J33;if(a instanceof TradingView.LineToolThreeDrivers)return A86;if(a instanceof TradingView.LineToolHeadAndShoulders)return J15;if(a instanceof A63)return J47;if(a instanceof TradingView.LineToolBezierCubic||a instanceof TradingView.LineToolBezierQuadro)return TradingView.LineToolBezierStylesPropertyPage}return null}
|
|
function c(a){return a instanceof TradingView.ESDStudyBase?null:a instanceof TradingView.Study?J39:null}return{createInputsPropertyPage:function(b,c){var f=a(b);return f?new f(b.properties(),c,b):null},createStudyStrategyPropertyPage:function(a,b){return a instanceof TradingView.StudyStrategy?new TradingView.StudyStrategyPropertyPage(a.properties(),b,a):null},createStylesPropertyPage:function(a,c){var f=b(a);return f?new f(a.properties(),c,a):null},createDisplayPropertyPage:function(a,
|
|
b){var f=c(a);return f?new f(a.properties(),b,a):null},hasInputsPropertyPage:function(b){return!!a(b)},hasStylesPropertyPage:function(a){return!!b(a)},hasDisplayPropertyPage:function(a){return!!c(a)}}}();function D7(a,b){this.D0=b;this._bindings=[];this._property=a}D7.prototype.model=function(){return this.D0};D7.prototype.bindControl=function(a){this._bindings.push(a);return a};D7.prototype.unbindControl=function(a){a=this._bindings.indexOf(a);-1!==a&&this._bindings.splice(a,1)};D7.prototype.loadData=function(){for(var a=0;a<this._bindings.length;a++){var b=this._bindings[a];b.property&&b.setValue(b.property().value())}};
|
|
D7.prototype.saveData=function(){this.D0.beginUndoMacro();for(var a=0;a<this._bindings.length;a++){var b=this._bindings[a];b.changed()&&this.D0.setProperty(b.property(),b.value())}this.D0.endUndoMacro()};
|
|
D7.prototype.createColorPicker=function(){return $(document.createElement("input")).addClass("colorpicker-widget").bind("customcolorchange",function(a,b){TVSettings.setJSON("pickerCustomColors",b)}).tvcolorpicker({customColors:TVSettings.getJSON("pickerCustomColors",[])})};D7.prototype.createTextEditor=function(a,b){var c={};a&&(c.width=a);b&&(c.height=b);return $(document.createElement("textarea")).css(c)};
|
|
D7.prototype.createCombo=function(a){var b=$(document.createElement("select"));a=a.reduce(function(a,b){return a.add($(document.createElement("option")).prop({value:b,text:b}))},$());return b.append(a)};D7.prototype.createKeyCombo=function(a){var b=$(document.createElement("select"));$.each(a||[],function(a,d){$(document.createElement("option")).prop({value:a,text:d}).appendTo(b)});return b};
|
|
D7.prototype.createFontEditor=function(a){a=a||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(a)};D7.prototype.createFontSizeEditor=function(a){return this.createCombo(a||[10,11,12,14,16,20,24,28,32,40]).addClass("tv-select-container-fontsize")};
|
|
D7.prototype.createSeriesMinTickEditor=function(){var a="<select><option value='default'>"+$.t("Default")+"</option>",b=[{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: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}],c;for(c in b)var d=b[c],a=a+("<option value='"+(d.priceScale+","+d.minMove+","+d.frac)+"'>"+(d.minMove+"/"+d.priceScale)+"</option>");return $(a+"</select>")};D7.prototype.createPrecisionEditor=function(){for(var a="<select><option value='default'>"+$.t("Default")+"</option>",b=0;6>=b;b++)a+="<option value='"+b+"'>"+b+"</option>";return $(a+"</select>")};
|
|
D7.prototype.createLabeledCell=function(a,b,c){var d=null;"number"===typeof a.valueOf()&&(d=a,a=b,b=c);a+="";c=this._labelToId(a);var e=$("<td>");$("<label>").html(0<a.length?$.t(a):"").attr("for",c).appendTo(e);d&&e.attr("colspan",d);b&&b.attr("id",c);return e};D7.prototype.createTableInTable=function(a){a=$("<tr>").appendTo(a);a=$("<td>").appendTo(a);return $('<table cellpadding="0" cellspacing="0">').appendTo(a)};
|
|
D7.prototype._labelToId=function(a){return"control"+a.replace(/(^| )\w/g,function(a){return"-"+a.trim().toLowerCase()})+Math.floor(1E3*Math.random())};D7.prototype.addRow=function(a){return $(document.createElement("tr")).appendTo(a)};
|
|
D7.prototype.addLabeledRow=function(a,b,c,d){var e=b&&0<b.length?$.t(b):"",f=$(document.createElement("tr")),g=$(document.createElement("td")).html(e);d&&g.attr("colspan",2);c&&(b=this._labelToId(b),c.attr("id",b),g.html('<label for="'+b+'">'+e+"</label>"));return f.append(g).appendTo(a)};D7.prototype.addEditorRow=function(a,b,c,d){var e=$(document.createElement("td"));c.row=this.addLabeledRow(a,b,c,d);c.appendTo(e.appendTo(c.row));return c};
|
|
D7.prototype.addColorPickerRow=function(a,b){return this.addEditorRow(a,b,this.createColorPicker())};D7.prototype.addOffsetEditorRow=function(a,b){var c=$("<input/>");c.attr("type","text");c.css("width","100px");c.addClass("ticker");return this.addEditorRow(a,b,c)};D7.prototype.addFontEditorRow=function(a,b){return this.addEditorRow(a,b,this.createFontEditor())};
|
|
D7.prototype.refreshStateControls=function(a,b,c){for(var d=0;d<b.length;d++){var e=b[d],f=a[e.id];f.toggle(this.parseRule(e.visible,b,c));f.attr("disabled",!this.parseRule(e.visible,b,c))}};D7.prototype.parseRule=function(a,b,c){if(!a)return!0;a=a.split("==");return 2>a.length?!1:c[a[0]].value()==a[1]};D7.prototype.destroy=function(){for(var a=this._bindings.length;a--;)this._bindings[a].destroy();this._bindings.length=0};
|
|
function Binding(a,b,c,d,e){a?(this._control=a,this._property=b,this._applyOnFly=c,this._undoModel=d,this._undoText=e,b&&(this._formatters=[],this._changed=!1,this.setValue(b.value()),b.listeners().subscribe(this,Binding.prototype.propertyChanged))):TradingView.logDebugChart("Binding: missing control")}Binding.prototype.addFormatter=function(a){this._formatters.push(a)};Binding.prototype._formatValue=function(a){return this._formatters.reduce(function(a,c){return c(a)},a)};
|
|
Binding.prototype._attachToControl=function(a,b){var c=this;if(b)a.on("keyup change input",function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)});else a.keypress(function(a){this._changed=!0;13==a.which&&(a=c.value(),c.setValueToProperty(a),c.setValue(a))}),a.focusout(function(a){a=c.value();c.changed()&&(c.setValueToProperty(a),c.setValue(a))}),a.change(function(a){var b=c.value();$(a.target).is(".ticker")?(void 0!==c._changeTimerId&&clearTimeout(c._changeTimerId),c._changeTimerId=setTimeout(function(){c.setValueToProperty(b)},
|
|
250)):c.setValueToProperty(b);c.setValue(b)})};Binding.prototype.control=function(){return this._control};Binding.prototype.changed=function(){return this._changed};Binding.prototype.setValueToProperty=function(a){this._undoModel.setProperty(this._property,a,this._undoText);this._changed=!1};Binding.prototype.property=function(){return this._property};Binding.prototype.propertyChanged=function(a){this.setValue(a.value())};
|
|
Binding.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,Binding.prototype.propertyChanged)};TradingView.UppercaseTransformer=function(a){return a.toUpperCase()};TradingView.GreateTransformer=function(a){return function(b){return b<a?a:b}};TradingView.LessTransformer=function(a){return function(b){return b>a?a:b}};TradingView.ToIntTransformer=function(a){return function(b){b=parseInt(b,10);return TradingView.isNaN(b)?a:b}};
|
|
TradingView.ToFloatTransformer=function(a){return function(b){b=parseFloat(b);return TradingView.isNaN(b)?a:b}};TradingView.ToAsciiTransformer=function(){return function(a){var b=a;for(a=a.replace(/[^\u0000-\u007F]/,"");a.length!==b.length;)b=a,a=b.replace(/[^\u0000-\u007F]/,"");return a}};TradingView.ReplaceEmptyTransformer=function(a){return function(b){return 0===b.length?a:b}};
|
|
TradingView.SimpleStringBinder=function(a,b,c,d,e,f){Binding.call(this,a,b,d,e,f);this._transformFunction=c;this._attachToControl(a,d)};inherit(TradingView.SimpleStringBinder,Binding);TradingView.SimpleStringBinder.prototype.value=function(){var a=this._control.val();if(this._transformFunction)if(Array.isArray(this._transformFunction))for(var b=0;b<this._transformFunction.length;b++)a=this._transformFunction[b](a);else a=this._transformFunction(a);return a};
|
|
TradingView.SimpleStringBinder.prototype.setValue=function(a){var b=this._control.val();a=this._formatValue(a);b!==a&&this._control.val(a)};D8=function(a,b,c,d,e,f){this._subControlIds=b;Binding.call(this,a,c,d,e,f);this._forEachSubControl(function(a){this._attachToControl(a,d)})};inherit(D8,Binding);
|
|
D8.prototype._forEachSubControl=function(a){this._subControlIds.forEach(function(b){b="#"+b;b=this.control().find(b);a.call(this,b)},this)};D8.prototype._parseSessions=function(a){var b=a.split("-",2);2!=b.length&&(b=["0","0"]);a=parseInt(b[0]);b=parseInt(b[1]);return[Math.floor(a/100),a%100,Math.floor(b/100),b%100]};
|
|
D8.prototype.value=function(){var a=[];this._forEachSubControl(function(b){a.push(b.val())});var b=function(a,b){b.forEach(function(b){a=b(a)});return("0"+a).slice(-2)},c=[TradingView.ToIntTransformer(0),TradingView.GreateTransformer(0),TradingView.LessTransformer(23)],d=[TradingView.ToIntTransformer(0),TradingView.GreateTransformer(0),TradingView.LessTransformer(59)];return b(a[0],c)+b(a[1],d)+"-"+b(a[2],c)+b(a[3],d)};
|
|
D8.prototype.setValue=function(a){var b=this._parseSessions(a);this._forEachSubControl(function(a){var d=a.val(),e=("0"+b[0]).slice(-2);b.shift();d!==e&&a.val(e)})};D9=function(a,b,c,d,e,f,g){this.D0=d;this._mainSeries=f;this._toIntTransformer=TradingView.ToIntTransformer(g);this._disabled=!1;Binding.call(this,a,b,c,d,e);var h=this;c&&a.change(function(){h.setValueToProperty(h.value())});this._mainSeries.onBarReceived().subscribe(this,function(a){h.setValue(this.property().value())})};
|
|
inherit(D9,Binding);D9.prototype.value=function(){if(this._disabled)return this._control.attr("disabled",!0),null;var a=this._control.val(),a=this._toIntTransformer(a);0>a&&(a=0);var b=this._mainSeries.bars().size();b<=a&&(a=b-1);return 1E3*this._mainSeries.bars()._valueAt(this._mainSeries.bars().lastIndex()-a)[TradingView.TIME_PLOT]};
|
|
D9.prototype.setValue=function(a){this._disabled||null==a?this._control.attr("disabled",!0):0>a?(this._control.val(-a),this._property.setValue(this.value())):(a=this._mainSeries.data().timeToBarIndex(a/1E3,TradingView.SEARCH_FROM_RIGHT),null===a?this._disabled=!0:(a=this._mainSeries.bars().lastIndex()-a,this._control.val()!==a.toString()&&this._control.val(a)))};D10=function(a,b,c,d,e){Binding.call(this,a,b,c,d,e);if(c)a.on("accept-symbol",function(a,b){this.setValueToProperty(b)}.bind(this))};
|
|
inherit(D10,Binding);D10.prototype.value=function(){return this._control.val()};D10.prototype.setValue=function(a){var b=this.value();a&&b!==a&&this._control.val(a)};D11=function(a,b,c,d,e,f,g){Binding.call(this,a,b,d,e,f);this._transformFunction=c;this._setter=g;var h=this;d&&a.change(function(){h._setter?h._setter.call(h,h.value()):h.setValueToProperty(h.value())})};inherit(D11,Binding);
|
|
D11.prototype.value=function(){var a=this._control.val();this._transformFunction&&(a=this._transformFunction(a));return a};D11.prototype.setValue=function(a){this._control.val(a);if(this._control.selectbox)try{var b=this._control.find("[value='"+a+"']");if(0<b.length){var c=b[0];this._control.selectbox("change",c.value,c.text)}}catch(d){}};TradingView.StaticContentBinder=function(a,b){Binding.call(this,a,b)};
|
|
inherit(TradingView.StaticContentBinder,Binding);TradingView.StaticContentBinder.prototype.value=function(){return this._property.value()};TradingView.StaticContentBinder.prototype.setValue=function(a){return this._control.html(a)};D12=function(a,b,c,d,e,f){if(!a.is(":checkbox, :radio"))return new D12.PushButtonBinder(a,b,c,d,e);Binding.call(this,a,b,c,d,e);this._setter=f;var g=this;c&&a.change(function(){g._setter?g._setter.call(g,g.value()):g.setValueToProperty(g.value())})};
|
|
inherit(D12,Binding);D12.prototype.value=function(){return this.control().is(":checked")};
|
|
D12.prototype.setValue=function(a){if(this.control().is(".visibility-switch")){var b={opacity:a?1:.5},c=a?"enable":"disable",d=this.control().data("hides");if(d)d.closest("td").css(b);else{var e=this.control();e.parent().parent().data("visible",a).find("td").filter(function(){var a=$(this);return!a.find("label").length&&a.find(":checkbox").attr("id")!==e.attr("id")}).each(function(){var d=$(this);d.children().each(function(){var e=$(this);e.is(".ui-slider")?e.slider(c):(e.is("select")?
|
|
e.selectbox(c):e.is(".custom-select")?e.data(c)():e.prop("disabled",!a),d.css(b))})})}}return this.control().attr("checked",!!a)};TradingView.DisabledBinder=function(a,b,c,d,e){Binding.call(this,a,b,c,d,e)};inherit(TradingView.DisabledBinder,Binding);TradingView.DisabledBinder.prototype.value=function(){return this.control().is(":disabled")};TradingView.DisabledBinder.prototype.setValue=function(a){return this.control().attr("disabled",!!a)};
|
|
D12.PushButtonBinder=function(a,b,c,d,e){Binding.call(this,a,b,c,d,e);var f=this;c&&a.click(function(){var a=$(this).toggleClass("active").hasClass("active");f.setValueToProperty(a)})};inherit(D12.PushButtonBinder,Binding);D12.PushButtonBinder.prototype.value=function(){return this.control().hasClass("active")};D12.PushButtonBinder.prototype.setValue=function(a){return this.control().toggleClass("active",!!a)};
|
|
D14=function(a,b,c,d,e){c?(Binding.call(this,a,b,!0,c,d),e?a.callbacks().subscribe(this,e):a.callbacks().subscribe(this,D14.prototype.onActionCallback)):TradingView.logDebugChart("ActionBinder: Missed undo model")};inherit(D14,Binding);D14.prototype.onActionCallback=function(a){this._undoModel.setProperty(this._property,this.value(),this._undoText)};D14.prototype.value=function(){return this.control().checked};
|
|
D14.prototype.setValue=function(a){return this.control().checked=!!a};TradingView.ColorBinding=function(a,b,c,d){Binding.call(this,a,b,c,d);var e=this;c&&a.change(function(){e.setValueToProperty(e.value())})};inherit(TradingView.ColorBinding,Binding);TradingView.ColorBinding.prototype.value=function(){return this._control.val()};TradingView.ColorBinding.prototype.setValue=function(a){this._control.val(a);this._control.change();this._control.color&&this._control.color.fromString(a)};
|
|
TradingView.ToggleButtonBinding=function(a,b){b.toggle(a.checked);b.content().click(function(){a.setChecked(b.toggled());a.callbacks().fire(a)})};
|
|
TradingView.SliderBinder=function(a,b,c,d,e){isNumber(b.value())||(console.warn("Property cannot be binded to control, bad value (expect number): "+b.value()),b=new Property);Binding.call(this,a,b,c,d,e);var f=this;c&&(a.bind("slidechange",function(a,b){f.setValueToProperty(b.value)}),a.bind("slide",function(a,b){f.setValueToProperty(b.value)}));a.bind("slidestart",function(a,b){d.beginUndoMacro(e)});a.bind("slidestop",function(a,b){d.endUndoMacro()})};inherit(TradingView.SliderBinder,Binding);
|
|
TradingView.SliderBinder.prototype.value=function(){return this._control.slider("option","value")};TradingView.SliderBinder.prototype.setValue=function(a){this._control.slider("option","value",a)};D15=function(a,b,c,d,e,f){D12.call(this,a,b,d,e,f);this._intervalProperty=c;this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged);this.onIntervalChanged()};inherit(D15,D12);
|
|
D15.prototype.onIntervalChanged=function(){1440>+this._intervalProperty.value()?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})};D15.prototype.value=function(){return this._control.is(":disabled")?this._property.value():D12.prototype.value.call(this)};
|
|
D15.prototype.setValue=function(a){if(!this._control.is(":disabled"))return D12.prototype.setValue.call(this,a)};D15.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged);delete this._intervalProperty;D12.prototype.destroy.call(this,arguments)};
|
|
TradingView.WVBinding=function(a,b,c,d){this._control=a;this._wv=b.spawn();this._transformFunction=c;this._undoText=d;this._attachToControl(this._control)};TradingView.WVBinding.prototype._attachToControl=function(a){var b=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0});$(this._control).on("change",function(){b.setValueToProperty(b.value())})};TradingView.WVBinding.prototype.control=function(){return this._control};
|
|
TradingView.WVBinding.prototype.value=function(){var a=$(this._control).val();this._transformFunction&&(a=this._transformFunction(a));return a};TradingView.WVBinding.prototype.setValue=function(a){$(this._control).val(a)};TradingView.WVBinding.prototype.setValueToProperty=function(a){A77.setWatchedValue(this._wv,a,this._undoText)};TradingView.WVBinding.prototype.watchedValue=function(){return this._wv};TradingView.WVBinding.prototype.destroy=function(){this._wv.destroy()};
|
|
TradingView.CheckboxWVBinding=function(a,b,c,d,e){this._not=!!e;TradingView.WVBinding.apply(this,arguments)};inherit(TradingView.CheckboxWVBinding,TradingView.WVBinding);TradingView.CheckboxWVBinding.prototype._attachToControl=function(a){var b=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0});$(this._control).on("click",function(){b.setValueToProperty(b.value())})};
|
|
TradingView.CheckboxWVBinding.prototype.value=function(){var a=$(this._control).attr("checked");this._not&&(a=!a);this._transformFunction&&(a=this._transformFunction(a));return a};TradingView.CheckboxWVBinding.prototype.setValue=function(a){this._not&&(a=!a);$(this._control).attr("checked",!!a)};TradingView.SeriesStylePropertyPageMixin=function(){};inherit(TradingView.SeriesStylePropertyPageMixin,D7);TradingView.SeriesStylePropertyPageMixin.prototype.getInputTitle=function(a,b){return b.inputInfo?b.inputInfo[a].name.value():a.toLowerCase().replace(/\b\w/g,function(a){return a.toUpperCase()})};
|
|
TradingView.SeriesStylePropertyPageMixin.prototype.prepareLayoutImpl=function(a,b,c,d){function e(b){g.refreshStateControls(f,a.inputs,c.inputs)}d=d||{};for(var f={},g=this,h=0;h<a.inputs.length;h++){var k=a.inputs[h],l=k.id,m=this.getInputTitle(l,c),n=$("<tr/>");n.appendTo(b);var p=$("<td/>");p.appendTo(n);p.addClass("propertypage-name-label");p.text(m);var r=$("<td"+(d.valueColspan?' colspan = "'+d.valueColspan+'"':"")+"/>");r.appendTo(n);p=null;if(k.options)for(var p=$("<select/>"),t=0;t<k.options.length;t++){var v=
|
|
k.options[t];$("<option value='"+v+"'>"+v+"</option>").appendTo(p)}else p=$("<input/>"),"bool"===k.type?p.attr("type","checkbox"):p.attr("type","text");p.appendTo(r);p.css("width","100px");m="Change "+m;if(k.options)this.bindControl(new D11(p,c.inputs[l],null,!0,this.model(),m));else if("integer"===k.type)r=[TradingView.ToIntTransformer(k.defval)],k.min&&r.push(TradingView.GreateTransformer(k.min)),k.max&&r.push(TradingView.LessTransformer(k.max)),this.bindControl(new TradingView.SimpleStringBinder(p,
|
|
c.inputs[l],r,!1,this.model(),m)),p.addClass("ticker");else if("float"===k.type){r=[TradingView.ToFloatTransformer(k.defval)];if(k.min){var w;if(("BarSetRenko@tv-prostudies"==a.id||"BarSetPnF@tv-prostudies"==a.id)&&"boxSize"==k.id||"BarSetKagi@tv-prostudies"==a.id&&"reversalAmount"==k.id)w=this.D0.model().mainSeries().symbolInfo(),w=w.minmov/w.pricescale;r.push(TradingView.GreateTransformer(w?w:k.min))}k.max&&r.push(TradingView.LessTransformer(k.max));this.bindControl(new TradingView.SimpleStringBinder(p,
|
|
c.inputs[l],r,!1,this.model(),m));p.addClass("ticker")}else"text"===k.type&&this.bindControl(new TradingView.SimpleStringBinder(p,this._property.inputs[l],null,!1,this.model(),m));p.change(e);f[k.id]=n}this.refreshStateControls(f,a.inputs,c.inputs)};TradingView.SeriesStylePropertyPageMixin.prototype.getMetaInfo=function(a){for(var b=this.D0.m_model._studiesMetaData,c=0;c<b.size();c++)if(b.item(c).id===a)return b.item(c);return null};
|
|
TradingView.SeriesStylePropertyPageMixin.prototype._prepareSeriesStyleLayout=function(a,b,c,d){var e=$("<tbody>").appendTo(a),f=this._candlesColorerTbody=$("<tbody>").appendTo(b),g=this._barsColorerTbody=$("<tbody>").appendTo(b),h=this._haColorerTbody=$("<tbody>").appendTo(b),k=this._candlesTbody=$("<tbody>").appendTo(c),l=this._hollowCandlesTbody=$("<tbody>").appendTo(c),m=this._haTbody=$("<tbody>").appendTo(c),n=this._barsTbody=$("<tbody>").appendTo(c),p=this._lineTbody=$("<tbody>").appendTo(c);
|
|
b=this._areaTbody=$("<tbody>").appendTo(c);var r=this._renkoTbody=$("<tbody>").appendTo(c),t=this._pbTbody=$("<tbody>").appendTo(c);a=this._kagiTbody=$("<tbody>").appendTo(c);c=this._pnfTbody=$("<tbody>").appendTo(c);var e=this.addLabeledRow(e,"Style"),v=$(document.createElement("td")).appendTo(e);v.addClass("property-wide-select");e=$(document.createElement("select"));$("<option value="+TradingView.Series.STYLE_BARS+">"+$.t("Bars")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_CANDLES+
|
|
">"+$.t("Candles")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_HOLLOW_CANDLES+">"+$.t("Hollow Candles")+"</option>").appendTo(e);this instanceof J44||$("<option value="+TradingView.Series.STYLE_HEIKEN_ASHI+">"+$.t("Heiken Ashi")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_LINE+">"+$.t("Line")+"</option>").appendTo(e);$("<option value="+TradingView.Series.STYLE_AREA+">"+$.t("Area")+"</option>").appendTo(e);e.css("width",
|
|
"100px").appendTo(v);this.switchStyle();this.bindControl(new D11(e,d.style,parseInt,!0,this.model(),"Change Series Style",function(a){this._undoModel.setChartStyleProperty(this._property,a,this._undoText)}));d.style.listeners().subscribe(this,this.switchStyle);var v=this.createColorPicker(),w=this.createColorPicker(),u=this.createColorPicker(),x=this.createColorPicker(),C=this.createColorPicker(),A=this.createColorPicker(),y=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
|
|
$(C).add(A)),D=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(u)),E=$("<input type='checkbox'/>"),f=this.addLabeledRow(f,"Color bars based on previous close",E);$("<td>").append(E).prependTo(f);f=this.addLabeledRow(k,"Candles");$("<td>").prependTo(f);$("<td>").append(v).appendTo(f);$("<td>").append(w).appendTo(f);f=this.addLabeledRow(k,"Borders",y);$("<td>").append(y).prependTo(f);$("<td>").append(C).appendTo(f);$("<td>").append(A).appendTo(f);f=this.addLabeledRow(k,"Wick",
|
|
D);$("<td>").append(D).prependTo(f);$("<td>").append(u).appendTo(f);$("<td>").append(x).appendTo(f);this.bindControl(new TradingView.ColorBinding(v,d.candleStyle.upColor,!0,this.model(),"Change Candle Up Color"));this.bindControl(new TradingView.ColorBinding(w,d.candleStyle.downColor,!0,this.model(),"Change Candle Down Color"));this.bindControl(new D12(D,d.candleStyle.drawWick,!0,this.model(),"Change Candle Wick Visibility"));this.bindControl(new TradingView.ColorBinding(u,d.candleStyle.wickUpColor,
|
|
!0,this.model(),"Change Candle Wick Up Color"));this.bindControl(new TradingView.ColorBinding(x,d.candleStyle.wickDownColor,!0,this.model(),"Change Candle Wick Down Color"));this.bindControl(new D12(y,d.candleStyle.drawBorder,!0,this.model(),"Change Candle Border Visibility"));this.bindControl(new TradingView.ColorBinding(C,d.candleStyle.borderUpColor,!0,this.model(),"Change Candle Up Border Color"));this.bindControl(new TradingView.ColorBinding(A,d.candleStyle.borderDownColor,
|
|
!0,this.model(),"Change Candle Down Border Color"));this.bindControl(new D12(E,d.candleStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"));k=this.createColorPicker();v=this.createColorPicker();w=this.createColorPicker();u=this.createColorPicker();x=this.createColorPicker();C=this.createColorPicker();A=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(x).add(C));y=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
|
|
$(w));f=this.addLabeledRow(l,"Candles");$("<td>").prependTo(f);$("<td>").append(k).appendTo(f);$("<td>").append(v).appendTo(f);f=this.addLabeledRow(l,"Borders",A);$("<td>").append(A).prependTo(f);$("<td>").append(x).appendTo(f);$("<td>").append(C).appendTo(f);f=this.addLabeledRow(l,"Wick",y);$("<td>").append(y).prependTo(f);$("<td>").append(w).appendTo(f);$("<td>").append(u).appendTo(f);this.bindControl(new TradingView.ColorBinding(k,d.hollowCandleStyle.upColor,!0,this.model(),"Change Hollow Candle Up Color"));
|
|
this.bindControl(new TradingView.ColorBinding(v,d.hollowCandleStyle.downColor,!0,this.model(),"Change Hollow Candle Down Color"));this.bindControl(new D12(y,d.hollowCandleStyle.drawWick,!0,this.model(),"Change Hollow Candle Wick Visibility"));this.bindControl(new TradingView.ColorBinding(w,d.hollowCandleStyle.wickUpColor,!0,this.model(),"Change Hollow Candle Wick Up Color"));this.bindControl(new TradingView.ColorBinding(u,d.hollowCandleStyle.wickDownColor,!0,this.model(),"Change Hollow Candle Down Wick Color"));
|
|
this.bindControl(new D12(A,d.hollowCandleStyle.drawBorder,!0,this.model(),"Change Hollow Candle Border Visibility"));this.bindControl(new TradingView.ColorBinding(x,d.hollowCandleStyle.borderUpColor,!0,this.model(),"Change Hollow Candle Up Border Color"));this.bindControl(new TradingView.ColorBinding(C,d.hollowCandleStyle.borderDownColor,!0,this.model(),"Change Hollow Candle Down Border Color"));l=$("<input type='checkbox'/>");f=this.addLabeledRow(g,"Color bars based on previous close",
|
|
l);$("<td>").append(l).prependTo(f);k=$("<input type='checkbox'/>");f=this.addLabeledRow(g,"HLC Bars",k);$("<td>").append(k).prependTo(f);f=this.addColorPickerRow(n,"Up Color");g=this.addColorPickerRow(n,"Down Color");this.bindControl(new TradingView.ColorBinding(f,d.barStyle.upColor,!0,this.model(),"Change Bar Up Color"));this.bindControl(new TradingView.ColorBinding(g,d.barStyle.downColor,!0,this.model(),"Change Bar Down Color"));this.bindControl(new D12(l,d.barStyle.barColorsOnPrevClose,
|
|
!0,this.model(),"Change Color Bars Based On Previous Close"));this.bindControl(new D12(k,d.barStyle.dontDrawOpen,!0,this.model(),"Change HLC Bars"));g=TradingView.createPriceSourceEditor();f=this.addLabeledRow(p,"Price Source");$('<td colspan="3">').append(g).appendTo(f);f=this.addLabeledRow(p,"Type");f=$('<td colspan="3">').appendTo(f);f.addClass("property-wide-select");n=$(document.createElement("select"));$("<option value="+TradingView.Series.STYLE_LINE_TYPE_SIMPLE+">"+$.t("Simple")+
|
|
"</option>").appendTo(n);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_MARKERS+">"+$.t("With Markers")+"</option>").appendTo(n);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_STEP+">"+$.t("Step")+"</option>").appendTo(n);n.appendTo(f);f=this.addLabeledRow(p,"Line");p=this.createColorPicker();l=TradingView.createLineWidthEditor();$("<td>").append(p).appendTo(f);$("<td>").append(l).appendTo(f);this.bindControl(new D11(g,d.lineStyle.priceSource,null,!0,this.model(),
|
|
"Change Price Source"));this.bindControl(new D11(n,d.lineStyle.styleType,parseInt,!0,this.model(),"Change Line Type"));this.bindControl(new TradingView.ColorBinding(p,d.lineStyle.color,!0,this.model(),"Change Line Color"));this.bindControl(new TradingView.SliderBinder(l,d.lineStyle.linewidth,!0,this.model(),"Change Line Width"));d.haStyle&&(p=this.createColorPicker(),g=this.createColorPicker(),n=this.createColorPicker(),l=this.createColorPicker(),k=this.createColorPicker(),
|
|
v=this.createColorPicker(),w=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(k).add(v)),u=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(n)),x=$("<input type='checkbox'/>"),f=this.addLabeledRow(h,"Color bars based on previous close",x),$("<td>").append(x).prependTo(f),f=this.addLabeledRow(m,"Candles"),$("<td>").prependTo(f),$("<td>").append(p).appendTo(f),$("<td>").append(g).appendTo(f),f=this.addLabeledRow(m,"Borders",w),$("<td>").append(w).prependTo(f),
|
|
$("<td>").append(k).appendTo(f),$("<td>").append(v).appendTo(f),f=this.addLabeledRow(m,"Wick",u),$("<td>").append(u).prependTo(f),$("<td>").append(n).appendTo(f),$("<td>").append(l).appendTo(f),this.bindControl(new TradingView.ColorBinding(p,d.haStyle.upColor,!0,this.model(),"Change Heiken Ashi Up Color")),this.bindControl(new TradingView.ColorBinding(g,d.haStyle.downColor,!0,this.model(),"Change Heiken Ashi Down Color")),this.bindControl(new D12(u,d.haStyle.drawWick,!0,this.model(),
|
|
"Change Heiken Ashi Wick Visibility")),this.bindControl(new TradingView.ColorBinding(n,d.haStyle.wickUpColor,!0,this.model(),"Change Heiken Ashi Wick Up Color")),this.bindControl(new TradingView.ColorBinding(l,d.haStyle.wickDownColor,!0,this.model(),"Change Heiken Ashi Wick Down Color")),this.bindControl(new D12(w,d.haStyle.drawBorder,!0,this.model(),"Change Heiken Ashi Border Visibility")),this.bindControl(new TradingView.ColorBinding(k,d.haStyle.borderUpColor,!0,this.model(),
|
|
"Change Heiken Ashi Up Border Color")),this.bindControl(new TradingView.ColorBinding(v,d.haStyle.borderDownColor,!0,this.model(),"Change Heiken Ashi Down Border Color")),this.bindControl(new D12(x,d.haStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close")));this instanceof J44||R77.enabled("charting_library_base")||($("<option value="+TradingView.Series.STYLE_RENKO+">"+$.t("Renko")+"</option>").appendTo(e),
|
|
$("<option value="+TradingView.Series.STYLE_PB+">"+$.t("Line break")+"</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_KAGI+">"+$.t("Kagi")+"</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_PNF+">"+$.t("Point & Figure")+"</option>").appendTo(e),h=this.createColorPicker(),m=this.createColorPicker(),f=this.addLabeledRow(r,"Up bars"),$('<td class="some-colorpicker">').append(h).append(m).appendTo(f),e=this.createColorPicker(),p=this.createColorPicker(),f=this.addLabeledRow(r,
|
|
"Down bars"),$('<td class="some-colorpicker">').append(e).append(p).appendTo(f),g=this.createColorPicker(),n=this.createColorPicker(),f=this.addLabeledRow(r,"Projection up bars"),$('<td class="some-colorpicker">').append(g).append(n).appendTo(f),l=this.createColorPicker(),k=this.createColorPicker(),f=this.addLabeledRow(r,"Projection down bars"),$('<td class="some-colorpicker">').append(l).append(k).appendTo(f),this.prepareLayoutImpl(this.getMetaInfo("BarSetRenko@tv-prostudies"),r,d.renkoStyle),this.bindControl(new TradingView.ColorBinding(h,
|
|
d.renkoStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new TradingView.ColorBinding(e,d.renkoStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new TradingView.ColorBinding(g,d.renkoStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new TradingView.ColorBinding(l,d.renkoStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new TradingView.ColorBinding(m,d.renkoStyle.borderUpColor,
|
|
!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new TradingView.ColorBinding(p,d.renkoStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new TradingView.ColorBinding(n,d.renkoStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new TradingView.ColorBinding(k,d.renkoStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),r=this.createColorPicker(),h=this.createColorPicker(),
|
|
f=this.addLabeledRow(t,"Up bars"),$('<td class="some-colorpicker">').append(r).append(h).appendTo(f),m=this.createColorPicker(),e=this.createColorPicker(),f=this.addLabeledRow(t,"Down bars"),$('<td class="some-colorpicker">').append(m).append(e).appendTo(f),p=this.createColorPicker(),g=this.createColorPicker(),f=this.addLabeledRow(t,"Projection up bars"),$('<td class="some-colorpicker">').append(p).append(g).appendTo(f),n=this.createColorPicker(),l=this.createColorPicker(),f=this.addLabeledRow(t,
|
|
"Projection down bars"),$('<td class="some-colorpicker">').append(n).append(l).appendTo(f),this.prepareLayoutImpl(this.getMetaInfo("BarSetPriceBreak@tv-prostudies"),t,d.pbStyle,{valueColspan:2}),this.bindControl(new TradingView.ColorBinding(r,d.pbStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new TradingView.ColorBinding(m,d.pbStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new TradingView.ColorBinding(p,d.pbStyle.upColorProjection,!0,this.model(),
|
|
"Change Projection Bar Up Color")),this.bindControl(new TradingView.ColorBinding(n,d.pbStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new TradingView.ColorBinding(h,d.pbStyle.borderUpColor,!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new TradingView.ColorBinding(e,d.pbStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new TradingView.ColorBinding(g,d.pbStyle.borderUpColorProjection,!0,this.model(),
|
|
"Change Projection Border Bar Up Color")),this.bindControl(new TradingView.ColorBinding(l,d.pbStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),t=this.addColorPickerRow(a,"Up bars"),f=this.addColorPickerRow(a,"Down bars"),r=this.addColorPickerRow(a,"Projection up bars"),h=this.addColorPickerRow(a,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetKagi@tv-prostudies"),a,d.kagiStyle),this.bindControl(new TradingView.ColorBinding(t,d.kagiStyle.upColor,
|
|
!0,this.model(),"Change Bar Up Color")),this.bindControl(new TradingView.ColorBinding(f,d.kagiStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new TradingView.ColorBinding(r,d.kagiStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new TradingView.ColorBinding(h,d.kagiStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),a=this.addColorPickerRow(c,"Up bars"),t=this.addColorPickerRow(c,"Down bars"),f=this.addColorPickerRow(c,
|
|
"Projection up bars"),r=this.addColorPickerRow(c,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetPnF@tv-prostudies"),c,d.pnfStyle),this.bindControl(new TradingView.ColorBinding(a,d.pnfStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new TradingView.ColorBinding(t,d.pnfStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new TradingView.ColorBinding(f,d.pnfStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new TradingView.ColorBinding(r,
|
|
d.pnfStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")));c=TradingView.createPriceSourceEditor();f=this.addLabeledRow(b,"Price Source");$('<td colspan="3">').appendTo(f).append(c);a=this.createColorPicker();t=TradingView.createLineWidthEditor();f=this.addLabeledRow(b,"Line");$("<td>").appendTo(f).append(a);$('<td colspan="2">').appendTo(f).append(t);r=this.createColorPicker();h=this.createColorPicker();m=TradingView.createTransparencyEditor(h);f=this.addLabeledRow(b,"Fill");
|
|
$("<td>").appendTo(f).append(r);$("<td>").appendTo(f).append(h);$("<td>").appendTo(f).append(m);this.bindControl(new D11(c,d.areaStyle.priceSource,null,!0,this.model(),"Change Price Source"));this.bindControl(new TradingView.ColorBinding(a,d.areaStyle.linecolor,!0,this.model(),"Change Line Color"));this.bindControl(new TradingView.SliderBinder(t,d.areaStyle.linewidth,!0,this.model(),"Change Line Width"));this.bindControl(new TradingView.ColorBinding(r,d.areaStyle.color1,
|
|
!0,this.model(),"Change Line Color"));this.bindControl(new TradingView.ColorBinding(h,d.areaStyle.color2,!0,this.model(),"Change Line Color"));this.bindControl(new TradingView.SliderBinder(m,d.areaStyle.transparency,!0,this.model(),"Change Area Transparency"))};TradingView.LinetoolTemplatesList=function(a,b,c){var d={saveAsText:$.t("Save As..."),applyDefaultText:$.t("Apply Defaults")};this._toolName=a;this._applyTemplate=b;this._options=$.extend(d,c||{});this._list=[];R77.enabled("charting_library_base")||(this.templatesDeferred=this.loadData())};TradingView.LinetoolTemplatesList._cache={};TradingView.LinetoolTemplatesList.prototype.getData=function(){return this._list};
|
|
TradingView.LinetoolTemplatesList.prototype.loadData=function(){var a=this;return this._toolName in TradingView.LinetoolTemplatesList._cache?(this._list=TradingView.LinetoolTemplatesList._cache[this._toolName],$.Deferred().resolve()):$.get("/drawing-templates/"+this._toolName+"/",function(b){a._list=b;TradingView.LinetoolTemplatesList._cache[a._toolName]=b}).error(function(a){console.warn("Failed to load drawing template: "+a.responseText)})};
|
|
TradingView.LinetoolTemplatesList.prototype.templatesLoaded=function(){return this.templatesDeferred};TradingView.LinetoolTemplatesList.prototype.invalidateToolCache=function(){delete TradingView.LinetoolTemplatesList._cache[this._toolName]};
|
|
TradingView.LinetoolTemplatesList.prototype.createButton=function(a){var b=this;a=$.extend({},a,b._options);var c=$("<a></span></a>").addClass(a.buttonClass?a.buttonClass:"tv-button").html(a.buttonInner?a.buttonInner:$.t("Template")+'<span class="icon-dropdown">');TradingView.bindPopupMenu(c,null,{event:"button-popup"});c.bind("click",function(c){c.stopPropagation();if(!$(this).is("active")){c=[];"function"===typeof a.getDataForSaveAs&&c.push({title:a.saveAsText,action:function(){runOrSignIn(function(){var c=
|
|
function(c){var d=JSON.stringify(a.getDataForSaveAs());b.saveTemplate(c,d)}.bind(b);TradingView.showChartNameDialog(c,"Save template as...","Template name",64)})},addClass:"special"});"function"===typeof a.defaultsCallback&&c.push({title:a.applyDefaultText,action:a.defaultsCallback,addClass:"special"});var e=[];$.each(b._list,function(a,c){e.push({title:c,action:function(){b.loadTemplate.call(b,c)},deleteAction:function(){runOrSignIn(function(){A83.showConfirm("Template","Do you realy want to delete "+
|
|
(c?'"'+c+'"':"")+" template?",function(){b.removeTemplate.call(b,c)})})}})});e.length&&(e.sort(function(a,b){a=a.title.toUpperCase();b=b.title.toUpperCase();return a==b?0:a>b?1:-1}),c.push({separator:!0}),c=c.concat(e));$(this).trigger("button-popup",[c])}});return c};TradingView.LinetoolTemplatesList.prototype.loadTemplate=function(a){var b=this;return $.get("/drawing-template/"+this._toolName+"/?templateName="+encodeURIComponent(a),function(a){b._applyTemplate(JSON.parse(a.content))}).error(function(a){console.warn(a.responseText)})};
|
|
TradingView.LinetoolTemplatesList.prototype.removeTemplate=function(a){a&&($.post("/remove-drawing-template/",{name:a,tool:this._toolName}).error(function(a){console.warn(a.responseText)}),this.invalidateToolCache(),this._list=$.grep(this._list,function(b){return b!=a}))};
|
|
TradingView.LinetoolTemplatesList.prototype.saveTemplate=function(a,b){var c=this;if(a&&b){a=TradingView.clean(a);var d=-1!=$.inArray(a,c._list),e=function(){$.post("/save-drawing-template/",{name:a,tool:c._toolName,content:b},function(){d||c._list.push(a)}).error(function(a){console.warn(a.responseText)});c.invalidateToolCache()};d?A83.showConfirm("Confirm replacing",'Do you realy want to replace "'+a+'"?',e):e()}};
|
|
TradingView.LinetoolTemplatesList.prototype.deleteAction=function(a){var b=this;runOrSignIn(function(){A83.showConfirm("Template","Do you realy want to delete "+(a?'"'+a+'"':"")+" template?",function(){b.removeTemplate.call(b,a)})})};TradingView.LinetoolTemplatesList.prototype.showSaveDialog=function(a){var b=this;runOrSignIn(function(){TradingView.showChartNameDialog(function(c){var d=JSON.stringify(a.template());b.saveTemplate(c,d)},"Save template as...","Template name",64)})};J49=function(a,b,c){D7.call(this,a,b);this._linetool=c;this._templateList=new TradingView.LinetoolTemplatesList(this._linetool._constructor,this.applyTemplate.bind(this))};inherit(J49,D7);J49.prototype.applyTemplate=function(a){this._linetool.restoreTemplate(a);this.D0.model().updateSource(this._linetool);this.loadData()};
|
|
J49.prototype.createTemplateButton=function(a){var b=this;a=$.extend({},a,{getDataForSaveAs:function(){return b._linetool.template()}.bind(b)});return this._templateList.createButton(a)};
|
|
J49.prototype.appendTemplateRow=function(a){if(is_authenticated){var b=$(document.createElement("tr"));b.appendTo(a);var c=$(document.createElement("td"));c.attr("colspan",2);c.appendTo(b);b=$('<div class="dialog-theme-buttons"></div>').appendTo(c);this.templateButton=$(this.createTemplateButton());this.templateButton.appendTo(b);$('<tr><td class="property-page-separator-cell" colspan="6"><div class="property-page-separator"></div></td></tr>').appendTo(a)}};"undefined"!=typeof FlashCanvas&&FlashCanvas.setOptions({disableContextMenu:!0});TradingView.setCanvasSize=function(a,b){a.width=b.w;a.height=b.h;"undefined"==typeof FlashCanvas&&a.getContext("2d").translate(.5,.5)};TradingView.clearRect=function(a,b,c,d,e,f){a.save();"undefined"==typeof FlashCanvas&&a.translate(-.5,-.5);a.fillStyle=f;a.fillRect(b,c,d,e);a.restore()};
|
|
TradingView.addCanvasTo=function(a,b){var c=document.createElement("canvas");a.append(c);"undefined"!=typeof FlashCanvas&&FlashCanvas.initElement(c);TradingView.setCanvasSize(c,b);return c};TradingView.Rect=function(a,b,c,d){this.x=a;this.y=b;this.w=c;this.h=d};A61=function(a,b){this.w=a;this.h=b};A61.prototype.equals=function(a){return this.w===a.w&&this.h===a.h};TradingView.Point=function(a,b){this.x=a;this.y=b};
|
|
TradingView.setAbsoluteRect=function(a,b){a.css("position","absolute");a.css("left",b.x+"px");a.css("top",b.y+"px");a.width(b.w);a.height(b.h)};TradingView.setAbsolutePos=function(a,b){a.css("position","absolute");a.css("left",b.x+"px");a.css("top",b.y+"px")};TradingView.addLocalCoordsToMouseEvent=function(a,b){var c=a.offset();b.localX=b.pageX-c.left;b.localY=b.pageY-c.top};TradingView.processEvent=function(a,b,c,d,e){d&&(e||TradingView.addLocalCoordsToMouseEvent(b,a),d.call(c,a,b))};
|
|
TradingView.MOUSE_RIGHT_BUTTON=2;
|
|
TradingView.setMouseEventHandler=function(a,b,c){var d=function(d){a.off("mousemove.chartgui");var e=function(d){if(!TradingView.mousePressed||Modernizr.touch)TradingView.processEvent(d,a,b,b.mouseMoveEvent),c&&d.preventDefault()};a.on("mousemove.chartgui",e);Modernizr.touch&&e(d);TradingView.processEvent(d,a,b,b.mouseEnterEvent);c&&d.preventDefault()};a.mouseenter(d);var e=0,f=null,g=function(){window.clearTimeout(f);e=0;f=null},h=0,k=0,l=null,m=function(m){void 0===m.button&&(m.button=0);if(Modernizr.touch||
|
|
m.originalEvent.touches)m.pageX=m.originalEvent.touches[0].pageX,m.pageY=m.originalEvent.touches[0].pageY,m.localX=m.originalEvent.touches[0].pageX,m.localY=m.originalEvent.touches[0].pageY,d(m);var n=function(d){void 0===d.button&&(d.button=0);if(Modernizr.touch||d.originalEvent.touches)d.pageX=d.originalEvent.touches[0].pageX,d.pageY=d.originalEvent.touches[0].pageY,d.localX=d.originalEvent.touches[0].pageX,d.localY=d.originalEvent.touches[0].pageY,d.clientX=d.originalEvent.touches[0].pageX,d.clientY=
|
|
d.originalEvent.touches[0].pageY,h=d.pageX,k=d.pageY,clearTimeout(l);d.button!==TradingView.MOUSE_RIGHT_BUTTON&&TradingView.processEvent(d,a,b,b.pressedMouseMoveEvent);c&&d.preventDefault()},p=function(d){void 0===d.button&&(d.button=0);if(Modernizr.touch||d.originalEvent.touches)d.pageX=h,d.pageY=k,d.localX=h,d.localY=k,clearTimeout(l);TradingView.mousePressed=!1;$(document.body).off("mousemove.chartgui");$(document.body).off("mouseup.chartgui");Modernizr.touch||d.originalEvent.touches?($(document.body).off("touchmove.chartgui"),
|
|
$(document.body).off("touchend.chartgui"),t(d)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"));d.button!==TradingView.MOUSE_RIGHT_BUTTON&&(TradingView.processEvent(d,a,b,b.mouseUpEvent),++e,f&&1<e?(TradingView.processEvent(d,a,b,b.mouseDoubleClickEvent),g()):TradingView.processEvent(d,a,b,b.mouseClickEvent));c&&d.preventDefault();Modernizr.touch&&t(d)};Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),
|
|
$(document.body).on("touchmove.chartgui",n),$(document.body).on("touchend.chartgui",p),l=setTimeout(function(){v(m)},500)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",n),$(document.body).on("mouseup.chartgui touchend.chartgui",p));TradingView.mousePressed=!0;m.button!==TradingView.MOUSE_RIGHT_BUTTON&&(TradingView.processEvent(m,a,b,b.mouseDownEvent),f||(e=0,f=window.setTimeout(g,
|
|
500)));if(c){m.preventDefault();try{window.focus()}catch(r){}}};a.on("touchcancel",function(){clearTimeout(l)});if(Modernizr.touch)a.on("touchstart.chartgui",m),a.on("touchstartoutside mousedownoutside",function(c){TradingView.processEvent(c,a,b,b.mouseDownOutsideEvent,!0)}),a.on("gesturestart",function(c){TradingView.processEvent(c,a,b,b.gestureStartEvent);clearTimeout(l)}),a.on("gesturechange",function(c){c.scale=c.originalEvent.scale;TradingView.processEvent(c,a,b,b.gestureChangeEvent)}),a.on("gestureend",
|
|
function(c){TradingView.processEvent(c,a,b,b.gestureEndEvent)});else if(a.on("mousedown.chartgui touchstart.chartgui",m),a.on("touchstartoutside mousedownoutside",function(c){TradingView.processEvent(c,a,b,b.mouseDownOutsideEvent,!0)}),navigator.msPointerEnabled&&window.MSGesture){var m=new MSGesture,n=!1,p=1,r=a.get(0);m.target=r;r.gesture=m;r.gesture.pointerType=null;r.pointers=[];m.pointerType=null;a.on("pointerdown",function(a){if(a.target===this)if(null===this.gesture.pointerType)this.gesture.target=
|
|
r,this.gesture.addPointer(a.originalEvent.pointerId),this.gesture.pointerType=a.originalEvent.pointerType;else if(a.originalEvent.pointerType===this.gesture.pointerType)this.gesture.addPointer(a.originalEvent.pointerId);else{var b=new MSGesture;b.target=a.originalEvent.target;a.originalEvent.target.gesture=b;a.originalEvent.target.gesture.pointerType=a.originalEvent.pointerType;a.originalEvent.target.gesture.addPointer(a.originalEvent.pointerId)}});a.on("MSGestureChange",function(c){c.scale=p*=1*
|
|
(c.originalEvent.scale-1)+1;n||1===c.originalEvent.scale||(n=!0,TradingView.processEvent(c,a,b,b.gestureStartEvent));n&&TradingView.processEvent(c,a,b,b.gestureChangeEvent)});a.on("MSGestureEnd",function(c){n=!1;p=1;TradingView.processEvent(c,a,b,b.gestureEndEvent)})}var t=function(d){a.off("mousemove.chartgui touchmove.chartgui");TradingView.processEvent(d,a,b,b.mouseLeaveEvent);c&&d.preventDefault()};a.mouseleave(t);var v=function(d){TradingView.processEvent(d,a,b,b.contextMenuEvent);c&&d.preventDefault()};
|
|
a.contextMenu&&a.contextMenu(v)};TradingView.clientRect=function(a){var b=a.offset(),c=a.width();a=a.height();return new TradingView.Rect(b.left,b.top,c,a)};TradingView.offsetPosition=function(a){var b=0,c=0;do b+=a.offsetLeft,c+=a.offsetTop,a=a.offsetParent;while(a);return{left:b,top:c}};
|
|
TradingView.addColorPicker=function(a){var b=$("<input>");b.appendTo(a);b.tvcolorpicker();TVSettings&&(b.tvcolorpicker.setCustomColors=TVSettings.setJSON("pickerCustomColors",[]),b.bind("customcolorchange",function(a,b){TVSettings.setJSON("pickerCustomColors",b)}));return b};
|
|
TradingView.createLineStyleEditor=function(){return new TradingView.HTMLHelper.Combobox([{value:CanvasEx.LINESTYLE_SOLID,html:'<div class="linestyle solidline"/>'},{value:CanvasEx.LINESTYLE_DOTTED,html:'<div class="linestyle dottedline"/>'},{value:CanvasEx.LINESTYLE_DASHED,html:'<div class="linestyle dashedline"/>'}])};
|
|
TradingView.createShapeLocationEditor=function(){return $('<select><option value="'+CanvasEx.MARKLOC_ABOVEBAR+'">Above Bar</option><option value="'+CanvasEx.MARKLOC_BELOWBAR+'">Below Bar</option><option value="'+CanvasEx.MARKLOC_TOP+'">Top</option><option value="'+CanvasEx.MARKLOC_BOTTOM+'">Bottom</option><option value="'+CanvasEx.MARKLOC_ABSOLUTE+'">Absolute</option></select>')};
|
|
TradingView.createShapeStyleEditor=function(){for(var a="<select>",b=Object.keys(TradingView.StudyPlotShapes.Data),c=0;c<b.length;++c)var d=TradingView.StudyPlotShapes.Data[b[c]],a=a+('<option value="'+d.id+'">'+d.guiName+"</option>");return $(a+"</select>")};TradingView.createLineWidthEditor=function(){return $('<div class="linewidth-slider">').slider({min:1,max:4,step:1})};TradingView.createVisibilityEditor=function(){return $("<input type='checkbox' class='visibility-switch'/>")};
|
|
TradingView.createTextEditor=function(){var a=$("<input/>");a.attr("type","text");return a};
|
|
TradingView.createTextPosEditor=function(){return new TradingView.HTMLHelper.Combobox([{value:CanvasEx.TEXTPOS_TOPLEFT,html:"Top Left"},{value:CanvasEx.TEXTPOS_TOPCENTER,html:"Top Center"},{value:CanvasEx.TEXTPOS_TOPRIGHT,html:"Top Right"},{value:CanvasEx.TEXTPOS_MIDDLELEFT,html:"Middle Left"},{value:CanvasEx.TEXTPOS_MIDDLECENTER,html:"Middle Center"},{value:CanvasEx.TEXTPOS_MIDDLERIGHT,html:"Middle Right"},{value:CanvasEx.TEXTPOS_BOTTOMLEFT,html:"Bottom Left"},{value:CanvasEx.TEXTPOS_BOTTOMCENTER,
|
|
html:"Bottom Center"},{value:CanvasEx.TEXTPOS_BOTTOMRIGHT,html:"Bottom Right"}])};TradingView.createHHistDirectionEditor=function(){var a=$("<select />");$("<option value='"+CanvasEx.HHISTDIR_LEFTTORIGHT+"'>Left</option>").appendTo(a);$("<option value='"+CanvasEx.HHISTDIR_RIGHTTOLEFT+"'>Right</option>").appendTo(a);return a};
|
|
TradingView.createTransparencyEditor=function(a){var b=$('<div class="transparency-slider"><div class="gradient"></div></div>').slider({min:0,max:100,step:1}),c=["-moz-linear-gradient(left, %COLOR 0%, transparent 100%)","-webkit-gradient(linear, left top, right top, color-stop(0%,%COLOR), color-stop(100%,transparent))","-webkit-linear-gradient(left, %COLOR 0%,transparent 100%)","-o-linear-gradient(left, %COLOR 0%,transparent 100%)","linear-gradient(to right, %COLOR 0%,transparent 100%)"];b.setColor=
|
|
function(a){var e=b.find(".gradient");$.browser.msie?e.css("filter","progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', EndColor=0, GradientType=1)"):c.forEach(function(b){e.css("background-image",b.replace(/%COLOR/,a))})};a?(b.setColor(a.val()||"black"),a.on("change",function(a){b.setColor(a.target.value)})):b.setColor("black");return b};
|
|
TradingView.createPlotEditor=function(){var a=$("<select />");$("<option value='"+TradingView.StudyConsts.PLOT_LINE+"'>"+$.t("Line")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_LINE_WITH_BREAKS+"'>"+$.t("Line With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_HISTOGRAM+"'>"+$.t("Histogram")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_CROSS+"'>"+$.t("Cross",{context:"chart_type"})+"</option>").appendTo(a);
|
|
$("<option value='"+TradingView.StudyConsts.PLOT_AREA+"'>"+$.t("Area")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS+"'>"+$.t("Area With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_COLUMNS+"'>"+$.t("Columns")+"</option>").appendTo(a);$("<option value='"+TradingView.StudyConsts.PLOT_CIRCLES+"'>"+$.t("Circles")+"</option>").appendTo(a);return a};
|
|
TradingView.createPriceSourceEditor=function(){var a=$("<select>");$("<option value='open'>"+$.t("Open")+"</option>").appendTo(a);$("<option value='high'>"+$.t("High")+"</option>").appendTo(a);$("<option value='low'>"+$.t("Low")+"</option>").appendTo(a);$("<option value='close'>"+$.t("Close")+"</option>").appendTo(a);$("<option value='hl2'>"+$.t("(H + L)/2")+"</option>").appendTo(a);$("<option value='hlc3'>"+$.t("(H + L + C)/3")+"</option>").appendTo(a);$("<option value='ohlc4'>"+$.t("(O + H + L + C)/4")+
|
|
"</option>").appendTo(a);return a};TradingView.cacheUrl=function(a){$("<img>").attr("src",a)};TradingView.themeImageHTML=function(a){return"<img src='"+TradingView.themeResourceFullPath(a)+"' style='display:block'/>"};TradingView.animate=function(a,b,c,d,e){var f=d||250,g=$.easing[e]||$.easing.easeOutCubic,h=0,k=Date.now(),l=function(d){d=(d?1E12>d?Date.now():d:Date.now())-k;var e=Math.min(a,g(null,d,0,a,f)),p=e-h;h=e;b(p);d>=f?"function"==typeof c&&c():requestAnimationFrame(l)};requestAnimationFrame(l)};
|
|
A14=function(a,b,c){this._options=c=c||{};this._name=a;this._container=$('<div class="favored-list-container" />');c.addClass&&this._container.addClass(c.addClass);this._quick_container=$('<div class="quick" />').appendTo(this._container);this._submenu=$('<span class="submenu">'+(this._options.submenuHtml||"")+"<i></i></span>").appendTo(this._container);c.tooltip&&(this._submenu.attr("title",c.tooltip),c.addTooltipClass&&this._submenu.addClass(c.addTooltipClass));this._activeButton=
|
|
null;this._onChange=new Delegate;this._onSelect=new Delegate;this._onResize=new Delegate;this._onOpen=new Delegate;this._load(b);TradingView.bindPopupMenu(this._container,null,{direction:"down",svg:null==c.svg?!0:c.svg,reverse:!0,addClass:"narrow favored-list"+(c.popupAddClass?" "+c.popupAddClass:""),event:"popup-menu",popupSpacing:c.popupSpacing});this._submenu.on("click",this._openMenu.bind(this));if(!$.browser.msie)TVXWindowEvents.on(a+"-change",$.proxy(this,"_onChangeInAnotherTab"));return this};
|
|
A14.prototype._openMenu=function(){this._onOpen.fire();this._submenu.trigger("popup-menu",[this._data])};A14.prototype._onChangeInAnotherTab=function(){this.reload(this._data)};A14.prototype.reload=function(a){this._quick_container.empty();this._load(a)};
|
|
A14.prototype._convertQuicksToData=function(a){this._quicks.forEach(function(b){var c=!1;a.forEach(function(a){if(a.id==b)return c=!0,!1});c||a.push({id:b,title:b,favoriteButton:{icon:{},title:b,addClass:"apply-common-tooltip"}})});return a};
|
|
A14.prototype._load=function(a){var b=this;this._quicks=this._options.showJustDefaultQuicks?this._options.defaultFavorites||[]:this._options.notShowQuicks?[]:TVSettings.getJSON(this._name+".quicks",this._options.defaultFavorites||[],!0);this._list=[];a=this._convertQuicksToData(a);$.grep(a,function(a,b){return!a.separator}).forEach(function(a,d){var e={index:d,data:a,svg:a.svg&&$(a.svg).clone(),toQuickButton:$('<span class="to-quick" title=""></span>').append(svgAsset("star","16x16")),
|
|
toggleFavorite:function(a,c){var d=void 0!==a?a:!this.isFavorite();d?this.markFavorite():this.unmarkFavorite();b._toggleFavorite(e,d,c)},markFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Remove from favorites")).addClass("quicked")},unmarkFavorite:function(){this.toQuickButton&&this.toQuickButton.attr("title",$.t("Add to favorites")).removeClass("quicked")},isFavorite:function(){return-1<b._quicks.indexOf(a.id)},active:function(){return this.data.active()},drop:function(){return this.data.drop()}};
|
|
b._options.notShowQuicks&&$.extend(e,{toQuickButton:null});e.data.toQuickButtonStyle&&e.toQuickButton&&e.toQuickButton.css(e.data.toQuickButtonStyle);b._list.push(e);var f={action:function(){b._change(e)},buttons:[],active:b._options.notShowActive?function(){return!1}:function(){return b._active&&e===b._active}};b._options.notShowQuicks||f.buttons.push({el:e.toQuickButton,handler:function(a){e.toggleFavorite();a.preventDefault();a.stopPropagation()}});if("function"===typeof e.data.drop){var g=b._options.notShowQuicks?
|
|
' style="right: 7px;"':"";f.buttons.push({el:$('<span class="delete" title="'+$.t("Delete")+'"'+g+"></span>"),handler:function(a){e.drop();a.stopPropagation()}})}$.extend(a,f);e.toggleFavorite(e.isFavorite(),!0)});this._data=a;this._options.notShowActive||this._addActive(this._list[0]);this._onResize.fire()};
|
|
A14.prototype._toggleFavorite=function(a,b,c){if(!this._options.notShowQuicks||this._options.showJustDefaultQuicks){if(b){a.favorite_button=this._createButton(a,this._quick_container);var d=this._lastFavoriteButton(a);d?a.favorite_button.insertAfter(d.favorite_button):a.favorite_button.prependTo(this._quick_container)}else c||this._removeButton(a);c||(b?-1==this._quicks.indexOf(a.data.id)&&this._quicks.push(a.data.id):-1<this._quicks.indexOf(a.data.id)&&this._quicks.splice(this._quicks.indexOf(a.data.id),
|
|
1),this._saveFavorite(),this._markActive(),this._onResize.fire())}};A14.prototype._lastFavoriteButton=function(a){for(a=a.index-1;0<=a;a--)if(this._list[a]&&this._list[a].favorite_button)return this._list[a]};A14.prototype._saveFavorite=function(){this._options.notShowQuicks||(TVSettings.setJSON(this._name+".quicks",this._quicks),TVXWindowEvents.emit(this._name+"-change"))};
|
|
A14.prototype._createButton=function(a){var b=this,c=a.data.favoriteButton,d=$("<span></span>").data("item",a);c.addClass&&d.addClass(c.addClass);c.text&&d.text(a.text);c.title&&d.prop("title",c.title);a.svg&&$(a.svg).clone().appendTo(d);d.on("click",function(c){b._change(a);0===b._quicks.length&&b._openMenu();c.preventDefault()});return d};A14.prototype._removeButton=function(a){a.favorite_button&&(a.favorite_button.remove(),a.favorite_button=null)};
|
|
A14.prototype._markActive=function(a){if(!this._options.notShowActive){var b=this,c;if(this._active)if(a=this._active,a.isFavorite()){var d=b._quick_container.find(".just_active");this._btnToggleActiveView(d,!1)}else c=this._addActive(a),0!==this._quicks.length&&this._btnToggleActiveView(c,!0);$.map(this._list,function(c){a!==c||0===b._quicks.length?b._btnToggleActiveView(c.favorite_button,!1):c.favorite_button&&b._btnToggleActiveView(a.favorite_button,!0)});c&&c.hasClass("selected")?
|
|
this._container.addClass("not-favored-active"):this._container.removeClass("not-favored-active")}};A14.prototype._btnToggleActiveView=function(a,b){a&&(a.data("item"),b?a.addClass("selected"):a.removeClass("selected"))};A14.prototype._addActive=function(a){this._quick_container.find(".just_active").remove();return this._createButton(a).appendTo(this._quick_container).addClass("just_active")};A14.prototype._clearActive=function(){this._quick_container.find(".just_active").remove()};
|
|
A14.prototype._clearActive=function(){};A14.prototype._setActive=function(a){if(this._active===a)return!1;this._active=a;this._markActive();return!0};A14.prototype._change=function(a){this._onSelect.fire(a.data.id);if(this._setActive(a))this._onChange.fire(a.data.id);else return!1};A14.prototype.element=function(){return this._container};
|
|
A14.prototype._getItemByValue=function(a){for(var b in this._list)if(this._list[b].data.id==a)return this._list[b];throw Error("undefined value "+a+" in FavoredList");};A14.prototype.onChange=function(){return this._onChange};A14.prototype.onSelect=function(){return this._onSelect};A14.prototype.onResize=function(){return this._onResize};A14.prototype.onOpen=function(){return this._onOpen};
|
|
A14.prototype.setValue=function(a){a=this._getItemByValue(a);this._setActive(a)};A14.prototype.value=function(a){return this._active?this._active.data.value:void 0};A14.prototype.removeById=function(a,b){var c=$.grep(this._data,function(b){return b.id!=a});this._list.forEach(function(b){b.data.id==a&&this._toggleFavorite(b,!1)},this);this.reload(c);"function"===typeof b&&b()};
|
|
TradingView.bindPopupMenu=function(a,b,c){var d,e;a=$(a);c=c||{};d=(c.event||"click")+".popup-menu";c.hideEvent&&(e=c.hideEvent+".popup-menu");var f=function(){},g=f,h={},k=function(d,e,k){function p(b){b=$(b.target).parents().andSelf();b.is(v)||b.is(a)||b.is(".charts-popup-tab-headers, .charts-popup-itemheader")||g()}function r(a){a=$(a.target).parents().andSelf();a.is(".charts-popup-tab-headers, .charts-popup-itemheader")||c.notCloseOnButtons&&a.is(".icon-save, .icon-delete")||g()}function t(b,
|
|
d,e){if(b instanceof TradingView.bindPopupMenu.TabGroup){if(b.tabs&&b.tabs.length)if(1!==b.tabs.length||b.tabs[0].title){var f=$('<div class="charts-popup-tab-group"></div>').appendTo(e),g=$('<div class="charts-popup-tab-headers"></div>').appendTo(f),h=null;$.each(b.tabs||[],function(a,c){if(c.items&&c.items.length){var d=$('<div class="charts-popup-tab"></div>').hide().appendTo(f);$.each(c.items,function(){t(this,void 0,d)});var e=$('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(c.name)).appendTo(g);
|
|
e.on("click",function(a){e.is(".active")||(g.find(".charts-popup-tab-header.active").removeClass("active"),e.addClass("active"),f.find(".charts-popup-tab").hide(),d.show(),a&&a.preventDefault(),"function"===typeof b.onChange&&b.onChange.call(b,c.name))});if(!h||c.active)h=e,g.find(".charts-popup-tab-header.active").removeClass("active"),e.addClass("active"),f.find(".charts-popup-tab").hide(),d.show()}})}else $.each(b.tabs[0].items,function(){t(this,void 0,e)})}else if(b instanceof TradingView.bindPopupMenu.Group){var k=
|
|
$('<div class="charts-popup-group"></div>').appendTo(e);b.title&&(d=$('<div class="charts-popup-itemheader"></div>').text(b.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),b.collapsible&&(k.addClass("charts-popup-group-collapsible"),k.toggleClass("collapsed",b.collapsed),d.on("click",function(){k.toggleClass("collapsed");if("function"==typeof b.onChange)b.onChange(k.hasClass("collapsed"))})),k.append(d));$.each(b.items,function(a){t(this,1,k)})}else if(b instanceof TradingView.bindPopupMenu.Header)e.append($('<div class="charts-popup-itemheader"></div>').text(b.title));
|
|
else if(b.separator){var l=$('<span class="separator"></span>');e.append(l)}else{l=$('<a class="item" href="#">');"function"==typeof b.deleteAction&&"function"==typeof b.saveAction&&l.addClass("item-twobuttons");b.url&&l.attr("href",b.url);b.target&&l.attr("target",b.target);d||l.addClass("first");"function"===typeof b.active?b.active(b)&&l.addClass("active"):b.active&&l.addClass("active");b.addClass&&l.addClass(b.addClass);b.addData&&l.data(b.addData);b.disabled&&l.addClass("disabled");if("function"==
|
|
typeof b.action){var m=b.action;d=function(a){var c=$(a.target).parents().andSelf();c.is(p)||c.is(r)||(m.apply(l,arguments),!b.url&&a&&"function"==typeof a.preventDefault&&a.preventDefault())};c.upAction?l.bind("mouseup",d):l.bind("click",d)}b.date?(d=$('<span class="title"></span>').appendTo(l),$('<span class="date"></span>').text(b.date||"").appendTo(l)):b.icon&&!c.svg?(d=$('<span class="icon"></span>').appendTo(l),d.css("background-image",b.icon.image||""),b.icon.offset&&d.css("background-position",
|
|
"string"===typeof b.icon.offset?b.icon.offset:b.icon.offset.x+"px "+b.icon.offset.y+"px"),d=$('<span class="title"></span>').appendTo(l)):!0===c.svg&&b.svg?(l.append(b.svg),d=$('<span class="title"></span>').appendTo(l)):d=$('<span class="title-expanded"></span>').appendTo(l);b.html?d.html(b.html):d.text(b.title||"");if("function"==typeof b.deleteAction){var n=b.deleteAction;d=b.deleteAction.title||$.t("Delete");var p=$('<span class="icon-delete">');p.attr("title",d);p.on("click",function(a){n.apply(l,
|
|
arguments);a.preventDefault()});l.append(p)}if("function"==typeof b.saveAction){var x=b.saveAction;d=b.saveAction.title||"Save";var r=$('<span class="icon-save">');r.attr("title",d);r.on("click",function(a){x.apply(l,arguments);a.preventDefault()});l.append(r)}b.buttons instanceof Array&&b.buttons.length&&b.buttons.forEach(function(a){a.el instanceof $||(a.el=$(a.el));a.el.appendTo(l);if(a.handler)a.el.on("click",function(b){a.handler.apply(l,arguments)})});"undefined"!==typeof b.counter&&(d=b.counterBlue?
|
|
"blue":"",$('<span class="counter"></span>').text(b.counter+"").addClass(d).appendTo(l));e.append(l);a.data("popup-menu",e)}}e=e||b;"function"===typeof e&&(e=e());if($(this).hasClass("open"))if(k)g(),k=h.scrollTop;else return;g=function(){h.scrollTop=v.scrollTop();v.remove();a.removeClass("active open");a.data("popup-menu",null);$(document).off("click",r);$(document).off("mousedown",p);Modernizr.touch&&$(document).off("touchstart.chartgui",p);$(document).off("selectstart.popup-menu");g=f;if(c.onRemove)c.onRemove()};
|
|
a.addClass("active open");var v=$('<div class="charts-popup-list">');c.addClass&&v.addClass(c.addClass);$.each(e,function(a){t(this,a,v)});setTimeout(function(){$(document).on("click",r);$(document).on("mousedown",p);if(Modernizr.touch)$(document).on("touchstart.chartgui",p)},0);if(c.upAction)$(document).on("selectstart.popup-menu",function(){return!1});v.appendTo(document.body);var w=$(window).width();e=Math.min($(window).height(),$("body").height());var u=a.outerWidth(),x=a.outerHeight(),C=a.offset();
|
|
k=$(window).scrollTop()||0;C.top-=k;C.top=Math.round(C.top);C.left=Math.round(C.left);var A=v.outerWidth(),y=v.outerHeight(),D=void 0!==c.viewportSpacing?c.viewportSpacing:10,E=c.popupSpacing?~~c.popupSpacing:1,z=c.popupDrift?~~c.popupDrift:0,F=y-v.height(),K=c.direction?c.direction:"down",Q=!!c.reverse;if("down"==K){var B=e-C.top-x-E-D-F,J=C.top-E-D-F;B<Math.max(y||0,100)&&J>B&&(K="up")}switch(K){case "down":case "up":"down"==K?v.css("top",C.top+x+E+"px"):v.css("bottom",e-C.top+E+"px").css("top",
|
|
"auto");Q?(Math.max(C.left+z+u-A,D),v.css("left",Math.max(C.left+z+u-A,D)+"px").css("right","auto")):v.css("left",C.left+z+"px").css("right","auto");break;case "right":case "left":E=Math.max(E,4),"right"==K?v.css("left",Math.floor(C.left+u+E)+"px").css("right","auto"):v.css("left",Math.floor(Math.max(C.left-A-E,D))+"px").css("right","auto"),Q?v.css("top",Math.floor(Math.max(C.top+z+x-y,D))+"px"):v.css("top",Math.floor(C.top+z)+"px")}v.show();"up"==K||{left:1,right:1}[K]&&Q?"up"==K?v.css("max-height",
|
|
C.top-E-D-F+"px"):v.css("max-height",C.top+x-E-D-F+"px"):v.css("max-height",e-C.top-x-E-D-F+"px");c.careRightBorder&&(w+=$(window).scrollLeft(),parseInt(v.css("left"))+v.width()+D>w&&v.css("left",w-v.width()-D+"px").css("right","auto"));c.careBottomBorder&&parseInt(v.css("top"))+v.height()+D>e+k&&v.css("top",e-v.height()-D+k+"px");var O;k=a.parents().andSelf();for(e=k.size();e--;)if("fixed"===k.eq(e).css("position")){O=k.eq(e);break}O&&(O=v.offset(),v.css({position:"fixed",left:O.left-$(document).scrollLeft(),
|
|
right:"auto"}));v[0].scrollHeight>v.height()&&v.addClass("popup-with-scroll");d&&d.preventDefault()};d&&a.bind(d,k);e&&a.bind(e,function(){g()});c.runOpened&&k()};TradingView.bindPopupMenu.TabGroup=function TabGroup(b){if(!(this instanceof TabGroup))return new TabGroup(b);b=b||{};this.tabs=[];"function"===typeof b.onChange&&(this.onChange=b.onChange)};
|
|
TradingView.bindPopupMenu.TabGroup.prototype.appendTab=function(a,b,c){a=null==a?"":a+"";b||(b=[]);c||(c={});if(!Array.isArray(b))throw new TypeError("items must be an array");this.tabs.push({name:a,items:b,active:!!c.active});return b};TradingView.bindPopupMenu.Header=function Header(b){if(!(this instanceof Header))return new Header(b);this.title=b};
|
|
TradingView.bindPopupMenu.Group=function Group(b){if(!(this instanceof Group))return new Group(b);b=b||{};this.items=[];this.title=null==b.title?"":b.title+"";this.collapsible=!!b.collapsible;this.collapsed=!!b.collapsed;"function"===typeof b.onChange&&(this.onChange=b.onChange)};TradingView.bindPopupMenu.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)};TradingView.unbindPopupMenu=function(a){a=$(a);a.unbind(".popup-menu");a.removeData("popup-menu")};
|
|
TradingView.showChartNameDialog=function(a,b,c,d,e,f,g){var h=b?b:$.t("Save New Chart Layout"),k=A83.createDialog(h);b=function(){var b=k.find('input[name="name"]'),c=b.val(),d=[];if(e)for(var f=0;f<e.length;f++)if("bool"===e[f].type){var g=k.find('input[name="'+e[f].name+'"]');d.push(g[0].checked)}c?(a(c,d),A83.destroy(h)):(A83.showError($.t("Please enter chart name"),A83.get(h)),b.focus());return!1};d=d||"";g=g||{};g.inputValue=g.inputValue?g.inputValue:"";k.css("width",
|
|
"400px");k.find(".tv-dialog-content").html('<div class="main"><form><p>'+$.t(c?c:"Chart name")+':</p><p class="tv-dialogs-name"><input type="text" name="name" maxlength="'+d+'"/></p><p class="tv-dialog-right"></p></form></div>').find("input").val(g.inputValue);g.inputSelectEnable&&"boolean"==typeof g.inputSelectEnable&&k.find('input[name="name"]').select();if(e)for(c=k.find(".tv-dialog-right"),d=0;d<e.length;d++)if("bool"===e[d].type){g=$('<p class="tv-dialogs-name"></p>');var l=e[d].hint?$('<div class="tv-dialogs-label-hint"></div>').blueTooltip($.t(e[d].hint),
|
|
"bottom"):null,m=$('<label><input type="checkbox" style="vertical-align:top;margin-top:2px" name="'+e[d].name+'"/> '+$.t(e[d].title)+"</label>");g.append(m,l).insertBefore(c)}k.find("form").submit(b);$('<a class="tv-button wide ok">'+$.t("OK")+"</a>").click(b).css({"margin-right":"5px"}).appendTo(k.find(".tv-dialog-right"));$('<a class="tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){A83.destroy(h)}).appendTo(k.find(".tv-dialog-right"));"function"===typeof f&&f(k);A83.positionDialog(k,
|
|
{left:$(window).width()/2-k.width()/2,top:$(window).height()/2-k.height()/2});A83.applyHandlers(k);k.find('input[name="name"]').focus()};A1=function(a,b,c){var d=this;this.HIGHLIGHT_STUDY_NUM_FLICKS=2;this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies";this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER";this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB";this._SCRIPTING_PACKAGE_NAME="tv-scripting";this._BASIC_STUDIES_PAGE_NAME=R77.enabled("plain_studymarket")?"Technical Analysis":"Built-ins";this.D5=a;this._chart=a.activeChartWidget.value();this._options=$.extend({},this.DEFAULT_OPTIONS,c||
|
|
{});this.concretizeOptions();this._studies=this._market=null;this._packagesWithTabNames={};this._user=b;this._favs=[];this._pages={};this._tabs={};this._headers={};this.favsChanged=new Delegate;this.layoutChanged=new Delegate;this.visibilityChanged=new Delegate;this.studiesReady=new $.Deferred;this.marketPagesReady=new $.Deferred;this._pubSearchPage=-1;this._pubSearchEntries=[];this._pubSearchDfd=null;TVXWindowEvents.on("StudyFavoritesChanged",function(a){d._onExternalFavoritesChanged(JSON.parse(a))});
|
|
this._strategiesFilterType=new WatchedValue(TVSettings.getValue("studyMarket.strategiesFilter","none"))};A1.prototype.init=function(){this._initialized||(this.setupMarketInfo(),this.getStudyInfo(),this.setUser(this._user),this.prepareLayout(),this.attachHandlers(),this._initialized=!0)};
|
|
A1.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:/EPS/,earnings:/EPS/,"trailing twelve months":/TTM/},popularFundamentals:[{name:$.t("Income Statement"),studies:"Script$EDGR_TOTAL_REVENUE@tv-scripting Script$EDGR_DILUTED_EPS_NET_INCOME@tv-scripting Script$EDGR_NET_INCOME@tv-scripting Script$EDGR_EBITDA@tv-scripting Script$EDGR_EBIT@tv-scripting Script$EDGR_EQUITY_EARNINGS@tv-scripting".split(" ")},{name:$.t("Profitability"),
|
|
studies:["Script$EDGR_GROSS_MARGIN@tv-scripting","Script$EDGR_AFTER_TAX_MARGIN@tv-scripting","Script$EDGR_GROSS_PROFIT@tv-scripting"]},{name:$.t("Dividend"),studies:["Script$EDGR_DIVIDEND_YIELD@tv-scripting","Script$EDGR_DIVIDENDS_PAID@tv-scripting"]},{name:$.t("Current Valuation"),studies:["Script$EDGR_MARKET_CAP@tv-scripting","Script$EDGR_PRICE_EARNINGS_TTM@tv-scripting","Script$EDGR_PRICE_EARNINGS_TO_GROWTH_TTM@tv-scripting","Script$EDGR_PRICE_BOOK_VALUE_PER_SHARE@tv-scripting"]},{name:$.t("Other"),
|
|
studies:["Script$EDGR_DEBT_TO_EQUITY@tv-scripting","Script$EDGR_FREE_CASH_FLOW@tv-scripting","Script$EDGR_RETURN_ON_EQUITY@tv-scripting","Script$EDGR_ACCOUNTING_CHANGE@tv-scripting","Script$EDGR_ACCOUNTS_PAYABLE@tv-scripting"]}]};A1.prototype._FAV_KEY="studyMarket.favorites";A1.prototype._PAGE_KEY="studyMarket.page";A1.prototype._MARKET_TAB_IS_OPEN_KEY="studyMarket.marketTabIsOpen";
|
|
A1.prototype._TECHNICAL_TAB_IS_OPEN_KEY="studyMarket.technicalTabIsOpen";A1.prototype._ECONOMY_TAB="Economy & Symbols";A1.prototype._FILTER_KEY="studyMarket.filter";A1.prototype.onCustomScriptModified=function(){this._initialized&&(this.getStudyInfo(),this.resetCustomScriptPage(),this.loadFavorites(),this.updateSearchPage())};
|
|
A1.prototype.onPublishedScriptModified=function(){this._initialized&&(this.getStudyInfo(),this.resetPublishedScriptPage(),this.loadFavorites(),this.updateSearchPage())};A1.prototype.concretizeOptions=function(){if(this._options.onWidget||R77.enabled("study_market_minimized"))this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0};
|
|
A1.prototype.setupMarketInfo=function(){this._market={products:pro.getStudies(),order:pro.getStudiesOrder()};this._market.order=$.grep(this._market.order,function(a){return"Script$EOTPRO"!=a});this.setupSubproductsInfo()};
|
|
A1.prototype.setupSubproductsInfo=function(){this._subProductIds={};for(var a=Object.keys(this._market.products),b=0;b<a.length;++b){var c=this._market.products[a[b]];if(void 0!==c.subproduct_ids)for(var d=0;d<c.subproduct_ids.length;++d)this._subProductIds[c.subproduct_ids[d]]=c.id}};A1.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){this.setupStudyInfo()})};
|
|
A1.prototype.setupStudyInfo=function(){var a=this._chart.model().studiesMetaData().toArray();this._studies={};a=a.filter(function(a){return!this.isHidedStudy(a)},this);a.forEach(function(a){var c=this.getStudyPackageName(a);if("Script$EOTPRO"!=c&&(!this._options.minimized||c==this._BASIC_STUDIES_PACKAGE_NAME)){var d=this.resolvePackageName(c);assert(void 0!==d,"Cannot resolve packageName "+c);this._studies[d]=this._studies[d]||[];this._studies[d].push(a)}}.bind(this),this);this.studiesReady.resolve()};
|
|
A1.prototype.resolvePackageName=function(a){return a in this._subProductIds?this._subProductIds[a]:a};A1.prototype.setUser=function(a){is_authenticated?this.setupUserData(a):this.setAnonymous()};A1.prototype.setupUserData=function(a){this._user=a;this.loadFavorites();this.updateMarketPages()};A1.prototype.setAnonymous=function(){this.setupUserData(null,[]);this.favsChanged.fire()};
|
|
A1.prototype.isHidedStudy=function(a){return!!a.is_hidden_study};A1.prototype.loadFavorites=function(){for(var a=TVSettings.getJSON(this._FAV_KEY,[]),b=[],c=0;c<a.length;c++){var d=TradingView.StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.favsChanged.fire()};A1.prototype.saveFavorites=function(){TVSettings.setJSON(this._FAV_KEY,this._favs)};
|
|
A1.prototype.prepareLayout=function(){var a=this;this._widget=$('<div class="insert-study-dialog"><div class="insert-study-row insert-study-title tv-dialog-title"><a class="tv-dialog-title-close"></a>'+$.t("Indicators")+'</div><div class="insert-study-row insert-study-body"><div class="insert-study-tabs"><div class="insert-study-tabs-list-container"><ul class="insert-study-tabs-list"></ul></div></div><div class="insert-study-main"><div class="insert-study-headers"></div><div class="insert-study-pages insert-study-row"></div></div></div></div>');
|
|
this._w_title=this._widget.find(".insert-study-title");this._w_tabs_container=this._widget.find(".insert-study-tabs-list-container");this._w_tabs=this._widget.find(".insert-study-tabs-list");this._w_pages=this._widget.find(".insert-study-pages");this._w_pages.onScrollToEnd=new Delegate;this._w_headers=this._widget.find(".insert-study-headers");this._widget.draggable(A83._constrainDraggableOptionsIfNeeded({handle:".insert-study-title"})).css({position:"absolute",zIndex:17});this.preparePages();
|
|
this._options.minimized&&this._widget.addClass("minimized");this._w_pages.scroll(function(){var b=$.map(a._w_pages.children(":visible"),function(a){return $(a).outerHeight(!0)}).reduce(function(a,b){return a+b},0),c=a._w_headers.outerHeight(!0),d=a._widget.find(".insert-study-main").height();b>d-c&&b-a._w_pages.scrollTop()===d-c&&a._w_pages.onScrollToEnd.fire()});this._widget.appendTo("body");this.hide()};A1.prototype.currentPage=function(){return this._pages[this._currentPageTitle]};
|
|
A1.prototype.preparePages=function(){this.addSearchPage();R77.enabled("items_favoriting")&&this.addFavoritesPage();this.prepareBasicPage();this._options.minimized||R77.enabled("charting_library_base")||(this.preparePublishedScriptPage(),this.prepareCustomScriptPage());this.prepareMarketPages();this._options.minimized||R77.enabled("charting_library_base")||(this.prepareFundamentalsPage(),this.studiesReady.done(function(){}.bind(this)));this.addEconomyPage();
|
|
this._scroll=new A59(this._w_tabs_container,this._w_tabs,{showBottomShadow:!1})};A1.prototype.addEconomyPage=function(){var a=this.addPage(this._ECONOMY_TAB,{showTitle:!0}),a=$('<div class="economy-page">').appendTo(a);this.addSymbolWidget=new TradingView.AddSymbolWidget(this.D5);this.addSymbolWidget.show();a.append(this.addSymbolWidget._widget)};
|
|
A1.prototype.addFavoritesPage=function(){this.addPage("Favorites",{showTitle:!0}).addClass("page-padded")};
|
|
A1.prototype._getStrategiesFilterControl=function(){var a=this,b=$('<span class="filter-control">').on("click",function(){var b=a._strategiesFilterType.value(),b=[{title:$.t("Indicators and Strategies"),action:a._strategiesFilterType.setValue.bind(a._strategiesFilterType,"none"),active:"only_strategies"!=b&&"not_strategies"!=b},{title:$.t("Indicators"),action:a._strategiesFilterType.setValue.bind(a._strategiesFilterType,"not_strategies"),active:"not_strategies"==b},{title:$.t("Strategies"),
|
|
action:a._strategiesFilterType.setValue.bind(a._strategiesFilterType,"only_strategies"),active:"only_strategies"==b}];$(this).trigger("popup-menu",[b])});TradingView.bindPopupMenu(b,null,{direction:"down",event:"popup-menu",addClass:"studymarket-strategies-filter"});this._strategiesFilterType.subscribe(function(a){b.text({not_strategies:$.t("Indicators"),only_strategies:$.t("Strategies")}[a]||$.t("Indicators and Strategies"))},{callWithLast:!0});return b};
|
|
A1.prototype.prepareBasicPage=function(){var a=this,b=a.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!R77.enabled("plain_studymarket"),showTitle:!0,filterControl:null});this._basicPage=b;b.addClass("page-padded");a.studiesReady.done(function(){a.resetBasicPage()});a._options.selectBasicPage&&a.selectPage(this._BASIC_STUDIES_PAGE_NAME)};
|
|
A1.prototype.prepareCustomScriptPage=function(){var a=this;a.addPage("My Scripts",{packageName:this._CUSTOM_STUDIES_PACKAGE_NAME,technical:!0,showTitle:!0}).addClass("page-padded");a.studiesReady.done(function(){a.resetCustomScriptPage()})};
|
|
A1.prototype.preparePublishedScriptPage=function(){var a=this,b=a.addPage("Public Library",{packageName:this._CUSTOM_STUDIES_PACKAGE_NAME,technical:!0,showTitle:!0,titleHref:"/script/",wikiHref:"https://www.tradingview.com/stock-charts-support/index.php/Public_Library"});b.addClass("page-padded");a.studiesReady.done(function(){a.resetPublishedScriptPage()});b.on("show-page",function(){a._onPublishedScriptPageShown(b)})};
|
|
A1.prototype._onPublishedScriptPageShown=function(){0>this._pubSearchPage&&this._pubslishedScriptsLoadMore()};A1.prototype._pubslishedScriptsLoadMore=function(){var a=this;if(!this._pubslishedScriptsLoading){var b=this.getPage("Public Library");$('<div class="loading-indicator-small"></div>').appendTo(b);this._pubslishedScriptsLoading=!0;this._loadNextPubSearchPage().done(function(){a.resetPublishedScriptPage();a._pubslishedScriptsLoading=!1})}};
|
|
A1.prototype.resetBasicPage=function(){var a=this.getPage(this._BASIC_STUDIES_PAGE_NAME);if(this._studies){var b=this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[],c=this._strategiesFilterType.value();if("not_strategies"==c||"only_strategies"==c)b=b.filter(function(a){a=TradingView.StudyMetaInfo.isScriptStrategy(a);return"not_strategies"==c?!a:a});window.studyMarket.preparePageStudies(a,b)}};
|
|
A1.prototype.resetCustomScriptPage=function(){if(!this._options.minimized&&window.scriptLib&&this._studies){var a=this.getPage("My Scripts"),b=this._studies.Script$USER||[],c=$.Deferred();window.scriptLib&&b.length?window.scriptLib.requestUserScripts(function(a){for(var e=b.length;e--;){var f=b[e].scriptIdPart;if(f){delete b[e].scriptName;for(var g=null,h=a.length;h--;)if(a[h].scriptIdPart===f){g=a[h];break}g?b[e].scriptName=a[h].scriptName:b.splice(e,1)}else b.splice(e,1)}c.resolve(b)}):
|
|
c.resolve(b);c.done(function(b){b.length?window.studyMarket.preparePageStudies(a,b):window.studyMarket.appendTVScriptBtn(a)})}};A1.prototype._createPublishedScriptMetaInfo=function(a){var b=this.D5.activeChartWidget.value(),b=TradingView.StudyMetaInfo.createMetaInfoStub(a,b.studyScriptingPkgVers),b=new TradingView.StudyMetaInfo(b);b.author=a.author;b.scriptName=a.scriptName;b.scriptDescription=a.description;b.agreeCount=a.agreeCount;b.imageUrl=a.imageUrl;return b};
|
|
A1.prototype.resetPublishedScriptPage=function(){if(!this._options.minimized){var a=this,b=this.getPage("Public Library"),c=this._pubSearchEntries.map(function(b){return a._createPublishedScriptMetaInfo(b)});a.preparePageStudies(b,c,null,!0);b=a._pubslishedScriptsLoadMore.bind(a);a._w_pages.onScrollToEnd.unsubscribe(a,b);(void 0===a._pubSearchPageMax||null===a._pubSearchPageMax||0<=a._pubSearchPage&&a._pubSearchPage!==a._pubSearchPageMax)&&a._w_pages.onScrollToEnd.subscribe(a,
|
|
b)}};
|
|
A1.prototype.prepareFundamentalsPage=function(a,b){var c=this;a=this.addPage("Fundamentals",{packageName:"Script$EDGR",showTitle:!0});this.studiesReady.done(function(){function b(){function a(b){return-1!=g.indexOf(b)}function d(a){return e.filter(function(b){return a===b.id})[0]}for(var f=[],g=$.map(e,function(a){return a.id}),h=0;h<c._options.popularFundamentals.length;h++){var k=c._options.popularFundamentals[h];k.studies=k.studies.filter(a).map(d);k.studies.length&&f.push(k)}return f}var e=
|
|
this._studies.Script$EDGR;if("undefined"!==e){var f=a,g=b();a.addClass("page-with-popular");if(g.length){var f=$("<div></div>"),h=$("<div></div>"),k=$('<div><div class="column column-left"></div><div class="column column-right"></div></div>'),l=k.find(".column-left").css("width","50%"),m=k.find(".column-right").css("width","50%"),n=function(){for(var a=0,b=0;b<g.length;b++)a+=g[b].studies.length;return a}(),p=function(a){var b=$('<div class="insert-study-items"></div>');c.fillStudies(b,a.studies,
|
|
null);b.prepend('<div class="subgroup-header">'+a.name+"</div>");return b};a.append(h);h.append('<div class="header-container with-divider"><div class="group-header">'+$.t("All Metrics")+"</div></div>");h.append(f);a.prepend(k);a.append(h);for(k=h=0;h<g.length;h++){var r=g[h],t=p(r);k<n/2?l.append(t):m.append(t);k+=r.studies.length}}this.preparePageStudies(f,e)}}.bind(this))};
|
|
A1.prototype.appendTVScriptBtn=function(a){var b=this;if(a){var c=$('<br><a class="add-custom-script-btn"> '+$.t("Create your first script now!")+"</a>").on("click",function(a){b.hide();TradingView.ScriptEditorWidget.open();a.stopPropagation()});a.empty();a.append("<p>"+$.t("Welcome to the TradingView custom scripting engine. It allows you to create your own custom studies or modify existing. You do not have any scripts created.")+"</p>");a.find("p").append(c)}};
|
|
A1.prototype.appendPubScriptBtn=function(a){a&&a.html("<p>"+$.t("No public library scripts were found.")+"</p>")};
|
|
A1.prototype.prepareMarketPages=function(){this._options.hideMarketPages||this.studiesReady.done(function(){var a=this,b=this._market.order.map(function(b){return a._market.products[b]});b.sort(function(a,b){return a.name<b.name?-1:a.name>b.name?1:0});b.forEach(function(a){a.$page=this.addPage(a.name,{market:"tv-volumebyprice"!=a.id,packageName:a.id,subProductIds:a.subproduct_ids||[]});a.$page.addClass("offer-page")},this);this.selectPage(TVSettings.getValue(this._PAGE_KEY,this._basicPage));
|
|
this.marketPagesReady.resolve()}.bind(this))};
|
|
A1.prototype.addSearchPage=function(){var a=this;a._tabs.search=$('<div class="search"><div class="left-border"></div><div class="right-border"></div><input type="text" name="q" value="" autocomplete="off" placeholder="'+$.t("Search")+'"><div></div><a class="input-reset"></a></div>').data("title","search");a._pages.search=$('<div class="page-search"></div>').data("title","search");var b=a._tabs.search.find("input"),c=a._tabs.search.find(".input-reset");a._search_value=null;a._search_input=
|
|
b;this._widget.find(".insert-study-tabs").prepend(a._tabs.search);a._w_pages.prepend(a._pages.search);c.on("click",function(){b.val("").trigger("input").focus()});b.focus(function(){a.search(b.val())});var d;b.on("input",function(){c.toggle(""!==this.value);var b=$(this);d&&clearTimeout(d);d=setTimeout(function(){d=void 0;a.search(b.val())},200)})};
|
|
A1.prototype.search=function(a,b,c){var d=this;if(this._search_value!==a||b){var e=this._pages.search,f=[];""!==a&&(f.push({re:new RegExp("("+a.split("").map(function(a){return TradingView.RegExpEscape(a)}).join(")(.*?)(")+")","i"),fuzzyHighlight:!0}),a.toLowerCase()in this.DEFAULT_OPTIONS.searchKeywords&&f.push({re:this.DEFAULT_OPTIONS.searchKeywords[a.toLowerCase()],fuzzyHighlight:!1}));this._search_value=a;e.html("");var g=$.Deferred();d._currentAsyncSearchDfd=g;R77.enabled("plain_studymarket")?
|
|
g.resolve([]):A56.suggest(a).done(function(a){var b=[];a=a&&a.results||[];if(!$.isEmptyObject(TVScript))for(var c=0;c<a.length;c++)b.push(d._createPublishedScriptMetaInfo(a[c]));g.resolve(b)}).fail(function(){g.resolve([])});g.done(function(a){if(d._currentAsyncSearchDfd===g){for(var b=Object.keys(d._studies).concat(d._PUBLISHED_STUDIES_PACKAGE_NAME).sort(),c=[d._BASIC_STUDIES_PACKAGE_NAME,d._PUBLISHED_STUDIES_PACKAGE_NAME,d._CUSTOM_STUDIES_PACKAGE_NAME],m=c.length;m--;){var n=
|
|
c[m],p=b.indexOf(n);-1!==p&&(b.splice(p,1),b.unshift(n))}for(c=0;c<b.length;c++){n=b[c];p=[];if(n===d._PUBLISHED_STUDIES_PACKAGE_NAME)p=a;else for(var r=d._studies[n],m=0;m<r.length;m++){var t=r[m];if(f.length)for(var v=0;v<f.length;v++){var w=f[v].re;w.lastIndex=0;w.test(t.description_localized||t.description||t.scriptName)&&p.push(t)}else p.push(t)}if(p.length){m=$('<div class="insert-study-items"><div>');r=n;switch(n){case d._BASIC_STUDIES_PACKAGE_NAME:r=d._BASIC_STUDIES_PAGE_NAME;break;case "Script$USER":r=
|
|
$.t("My Scripts");break;case "Script$PUB":r=$.t("Public Library");break;default:n in d._packagesWithTabNames&&(r=d._packagesWithTabNames[r])}e.append('<div class="search-header">'+$.t(r)+"</div>");e.append(m);d.fillStudies(m,p,f)}}e.is(":has(li)")||e.is(":has(.not-found)")||e.append('<p class="not-found">'+$.t("No indicators matched your criteria.")+"</p>");d.layoutChanged.fire()}})}c||this.selectPage("search")};
|
|
A1.prototype.updateSearchPage=function(){var a=this._tabs.search.find("input").val();this.search(a,!0,!0)};A1.prototype.updateMarketPages=function(){$.when(this.marketPagesReady).done(function(){var a;this._market.order.forEach(function(b){a=this._market.products[b];pro.hasPackage(a.id)?(b=this._studies[a.id])?this.preparePageStudies(a.$page,b,a):console.warn("Subscripted study package "+a.id+" absent in metaInfo."):this.preparePageOffer(a.$page,a)},this)}.bind(this))};
|
|
A1.prototype.preparePageStudies=function(a,b,c,d){var e=$('<div class="insert-study-items"/>');a.empty();a.append(e);c&&a.find(".insert-study-items").css({width:199,"float":"left"}).end().append('<div class="insert-study-offer-container">'+pro.prepareProductPage(c)+"</div>");d||(b=this.sortStudies(b));this.fillStudies(e,b,null)};A1.prototype.preparePageOffer=function(a,b){a.data("html",pro.prepareProductOfferPage(b));a.data("offer",b)};
|
|
A1.prototype.addPage=function(a,b){b=$.extend({},b);var c=$.t(a),d=a.toLowerCase(),e=$("<div></div>").data("title",d),f=$('<li title="'+c+'"></li>').text(c).data("title",d),g=b.filterControl instanceof jQuery,c=$(Mustache.render('<div class="insert-study-header">{{#showTitle}}<div class="header-text">{{#technical}}'+$.t("Technical Analysis")+': {{/technical}}{{#titleHref}}<a href="{{titleHref}}" target="_blank"><u>{{title}}</u></a>{{/titleHref}}{{^titleHref}}{{title}}{{/titleHref}}{{#filterControl}}: <span class="filter-control-placeholder"></span>{{/filterControl}}{{#wikiHref}}<a href="{{wikiHref}}" target="_blank" class="tv-dialogs-label-hint apply-common-tooltip" title="Wiki"></a>{{/wikiHref}}</div>{{/showTitle}}</div>',
|
|
{showTitle:b.showTitle,title:c,technical:b.technical,titleHref:b.titleHref,wikiHref:b.wikiHref,filterControl:g})).data("title",d).appendTo(this._w_headers).hide();g&&c.find(".filter-control-placeholder").replaceWith(b.filterControl);b.beta&&f.append('<span class="beta-sign">Beta</span>');b.packageName&&(this._packagesWithTabNames[b.packageName]=a);this._pages[d]=e;this._tabs[d]=f;this._headers[d]=c;b.technical?(g=this._getOrCreateTechincalTab().find("ul"),g.append(f)):b.market?(g=this._getOrCreateMarketTab().find("ul"),
|
|
g.append(f)):this._w_market_tabs?f.insertBefore(this._w_market_tabs):this._w_tabs.append(f);this._w_pages.append(e);e.toggle(d===this._currentPageTitle);return e};
|
|
A1.prototype._getOrCreateMarketTab=function(){if(this._w_market_tabs)return this._w_market_tabs;var a=TVSettings.getBool(this._MARKET_TAB_IS_OPEN_KEY,!0);this._w_market_tabs=$('<li class="tabs market-tabs"><div class="text open">'+$.t("Marketplace Add-ons")+"</div><ul></ul></li>");this._w_tabs.append(this._w_market_tabs);this.toggleMarketTabs(a);return this._w_market_tabs};
|
|
A1.prototype._getOrCreateTechincalTab=function(){if(this._w_technical_tabs)return this._w_technical_tabs;var a=TVSettings.getBool(this._TECHNICAL_TAB_IS_OPEN_KEY,!0);this._w_technical_tabs=$('<li class="tabs technical-tabs"><div class="text open">'+$.t("Technical Analysis")+"</div><ul></ul></li>");this._w_tabs.append(this._w_technical_tabs);this.toggleTechnicalTabs(a);return this._w_technical_tabs};
|
|
A1.prototype.hide=function(){this._widget.hide();this.visibilityChanged.fire(!1);TradingView.keyboardBinder.removeListener("StudyMarket");var a=A83.dialogs.indexOf(this._widget);-1!==a&&A83.dialogs.splice(a,1)};
|
|
A1.prototype.show=function(){this.init();this._widget.show();this._widget.css("z-index",A83.dialogs.length+110);this._widget.on("mousedownoutside",function(a){$(a.target).parents().andSelf().is(".colorpicker, .charts-popup-list, .tvcolorpicker-popup, .symbol-edit-popup, .tv-dialog-shadowbox, .fancybox-overlay")||(this._widget.unbind("mousedownoutside"),this.hide())}.bind(this));this._widget.on("keyup.hideDialogStudy",function(a){"27"==a.which&&(this._widget.unbind("keyup.hideDialogStudy"),
|
|
this.hide())}.bind(this));this._clearInput();this.loadFavorites();this._scroll.scrollTo(0);this.updateLayout(!0);this.visibilityChanged.fire(!0);this.focusAddSymbolInput(this._currentPageTitle);TradingView.keyboardBinder.registerListener("StudyMarket",function(a){if(a.ctrlKey||"47"==a.which)return!1;if(a.which&&13===a.which)return a.target===this._search_input.get(0)&&this._insertStudyByShortDescription(),!0;if(!a.charCode||!a.which||32>=a.which||/^(input|textarea)$/i.test(a.target.tagName))return!1;
|
|
a.preventDefault();if(TradingView.onWidget())return!0;this._search_input.focus();this._search_input[0].value=String.fromCharCode(a.charCode);return!0}.bind(this));A83.dialogs.push(this._widget)};A1.prototype.isVisible=function(){return!!this._initialized&&this._widget.is(":visible")};
|
|
A1.prototype.updateLayout=function(a){var b=this._widget.find(".insert-study-body");b.css("height","");this._widget.css("width","");var c=A83.calcHeight(this._widget.height(),b.height());b.height(c);A83.resizeContentWidth(this._widget.width(),this._widget);b=this._w_headers.outerHeight(!0);c=this._widget.find(".insert-study-main").height();this._w_pages.height(c-b);var b=Math.min($(window).height(),$("body").height()),c=$(window).width(),d=this._widget.outerWidth(),
|
|
e=$("body").hasClass("on-cme-widget")?10:20,f=this._widget.height();a&&this._widget.css({left:Math.max(0,c-d)/2,top:Math.max(e,b-f)/2})};A1.prototype.getPage=function(a){a=a.toLowerCase();return this._pages[a]};A1.prototype.focusAddSymbolInput=function(a){a==this._ECONOMY_TAB.toLowerCase()&&this.addSymbolWidget.focus()};
|
|
A1.prototype.selectPage=function(a){this.focusAddSymbolInput(a);var b="";"string"===typeof a?b=a.toLowerCase():a instanceof $&&(b=a.data("title"));if(this._currentPageTitle!==b)if(b in this._pages&&b in this._tabs&&("favorites"!=b||this.hasVisibleFavorites())){for(var c in this._pages){a=b===c;var d=this._pages[c];this._headers[c]&&this._headers[c].toggle(a);d.toggle(a);this._tabs[c].toggleClass("active",a);a&&(d.data("html")&&(d.html(d.data("html")),d.data("html",null)),d.trigger("show-page"),
|
|
a=this._tabs[c].parents(".tabs"),a.is(".technical-tabs")?this.toggleTechnicalTabs(!0):a.is(".market-tabs")&&this.toggleMarketTabs(!0))}this._currentPageTitle=b;this._w_pages.scrollTop(0);this.layoutChanged.fire();TVSettings.setValue(this._PAGE_KEY,b)}else this.selectPage(this._basicPage)};
|
|
A1.prototype.attachHandlers=function(){var a=Modernizr.touch?"touchend":"click";this._w_tabs.on(a,"li",this.selectThisPage.bind(this));this._w_tabs.on(a,"li.market-tabs",this.marketTabsClickHandler.bind(this));this._w_tabs.on(a,"li.technical-tabs",this.technicalTabsClickHandler.bind(this));R77.enabled("items_favoriting")&&(this._w_pages.on(a,".insert-study-items .fav",this.toggleItem.bind(this)),this.favsChanged.subscribe(this,this.updateFavorites));this._w_pages.on(a,
|
|
".insert-study-items .source",this.viewSourceCode.bind(this));this._w_pages.on(a,".insert-study-items .open-chart-popup",this.openChartPopup.bind(this));this._w_pages.on(a,".insert-study-items .delete",this.deleteScript.bind(this));this._w_pages.on(a,".insert-study-items li a",function(a){a.stopPropagation()});this._w_pages.on(a,".insert-study-items li",this.insertThisStudy.bind(this));this._widget.on(a,function(a){a.stopPropagation()});this._widget.on(a,".insert-study-subscribe-button",this.subscribePackage.bind(this));
|
|
this.layoutChanged.subscribe(this,this.updateLayout);loginStateChange.subscribe(this,this.onLoginStateChange);this._w_title.on(a,"a",this.hide.bind(this));this._widget.on("click",".insert-study-offer-info-screenshots",function(a){a.currentTarget.getAttribute("data-fancybox-inited")||(a.currentTarget.setAttribute("data-fancybox-inited",!0),$(this).find("a").fancybox({type:"image",live:!1,afterShow:function(){$(".fancybox-overlay").on("click",function(a){a.stopPropagation()})}}),setTimeout(function(){$(a.target).click()},
|
|
0));a.preventDefault()})};A1.prototype.selectThisPage=function(a){var b=$(a.currentTarget).data("title");b&&"search"!=b&&this.selectPage(b);a.stopPropagation()};A1.prototype.marketTabsClickHandler=function(a){a.stopPropagation();this.toggleMarketTabs()};
|
|
A1.prototype.toggleMarketTabs=function(a){var b=this,c=this._w_market_tabs.find("ul"),d=this._w_market_tabs.find(".text"),e=function(){TVSettings.setValue(b._MARKET_TAB_IS_OPEN_KEY,d.hasClass("open"));b.layoutChanged.fire()};"boolean"===typeof a?a?(c.is(":visible")?c.slideDown(50,e):(c.css("display","block"),e()),d.addClass("open")):(c.is(":visible")?c.slideUp(50,e):(c.css("display","none"),e()),d.removeClass("open")):(d.toggleClass("open"),c.slideToggle(50,e))};
|
|
A1.prototype.technicalTabsClickHandler=function(a){a.stopPropagation();this.toggleTechnicalTabs()};
|
|
A1.prototype.toggleTechnicalTabs=function(a){var b=this,c=this._w_technical_tabs.find("ul"),d=this._w_technical_tabs.find(".text"),e=function(){TVSettings.setValue(b._TECHNICAL_TAB_IS_OPEN_KEY,d.hasClass("open"));b.layoutChanged.fire()};"boolean"===typeof a?a?(c.is(":visible")?c.slideDown(50,e):(c.css("display","block"),e()),d.addClass("open")):(c.is(":visible")?c.slideUp(50,e):(c.css("display","none"),e()),d.removeClass("open")):(d.toggleClass("open"),c.slideToggle(50,e))};
|
|
A1.prototype.toggleItem=function(a){a=$(a.target).parent().data("study");this.toggleFavorite(a.id);this.toggleEverywhere(a.id);return!1};A1.prototype.toggleEverywhere=function(a){var b=this.isFavorite(a);this._widget.find(".insert-study-items li").filter(function(b,d){var e=$(d).data("study");return e?TradingView.StudyMetaInfo.cutFullId(e.id)==a:!1}).find(".fav").toggleClass("in-fav",b).attr("title",this.favTitle(b))};
|
|
A1.prototype.toggleFavorite=function(a){this.isFavorite(a)?this.removeFavorite(a):this.addFavorite(a)};A1.prototype.isFavorite=function(a){a=TradingView.StudyMetaInfo.cutFullId(a);return-1!=this._favs.indexOf(a)};
|
|
A1.prototype.addFavorite=function(a){a=TradingView.StudyMetaInfo.cutFullId(a);if(this.isFavorite(a))return!1;this._favs.push(a);this.saveFavorites();TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify(this._favs));this.favsChanged.fire();window.is_authenticated&&(a=(/^Script\$(PUB;\d+)@tv-scripting/.exec(a)||0)[1])&&A56.info([a]).done(function(a){a&&a[0]&&a[0].imageUrl&&$.ajax({url:"/vote-for-chart/",type:"POST",dataType:"json",data:{image_url:a[0].imageUrl,
|
|
vote:1}})});return!0};A1.prototype.removeFavorite=function(a){a=TradingView.StudyMetaInfo.cutFullId(a);return this.isFavorite(a)?(this._favs.splice(this._favs.indexOf(a),1),this.saveFavorites(),TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify(this._favs)),this.favsChanged.fire(),!0):!1};
|
|
A1.prototype.updateFavorites=function(){var a=this.getVisibleFavorites();if(0===a.length)"favorites"===this._currentPageTitle&&this.selectPage(this._basicPage),this._widget.find(".insert-study-items li .fav").removeClass("in-fav"),this._tabs.favorites.hide();else{for(var b=this,c=$.Deferred(),d=[],e=[],f=0;f<a.length;f++){var g=a[f],h=b.getStudyPackageName({id:g});if(h===b._PUBLISHED_STUDIES_PACKAGE_NAME)(g=(/^Script\$([^@]+)/.exec(g)||0)[1])&&e.push(g);else for(var h=b._studies[h]||
|
|
[],k=0;k<h.length;k++)if(TradingView.StudyMetaInfo.cutFullId(h[k].id)==g){d.push(h[k]);break}}!e.length||this._options.minimized?c.resolve(d):A56.info(e).done(function(a){for(var c=0;c<a.length;c++)d.push(b._createPublishedScriptMetaInfo(a[c]))}).always(function(){c.resolve(d)});c.done(function(c){b.preparePageStudies(b._pages.favorites,c);b._widget.find(".insert-study-items li").find(".fav").removeClass("in-fav");a.forEach(b.toggleEverywhere,b)});this._tabs.favorites.show()}};
|
|
A1.prototype.hasFavorites=function(){return!!this._favs.length};A1.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length};A1.prototype.getVisibleFavorites=function(){return this.checkExcludePackageStudies(this._favs)};
|
|
A1.prototype.viewSourceCode=function(a){a.stopPropagation();this.hide();var b=$(a.target).parent().data("study");this.studyIsPublishedScript(b)?TradingView.ScriptEditorWidget.open({scriptIdPart:b.scriptIdPart,scriptSource:b.TVScriptSourceCode}):window.scriptLib.requestBuiltinAndUserScripts(function(a){for(var d=a.length;d--;)if(a[d].scriptIdPart===b.scriptIdPart){TradingView.ScriptEditorWidget.open(a[d]);break}})};
|
|
A1.prototype.openChartPopup=function(a){a.stopPropagation();a.preventDefault();a=$(a.target).parent().data("study");TradingView.historyManager.push(new TradingView.HistoryManager.ChartPage(a.imageUrl,a.scriptName||a.description))};
|
|
A1.prototype.deleteScript=function(a){a.stopPropagation();a.preventDefault();var b=$(a.target).closest("li"),c=b.data("study");A83.showConfirm("Confirmation","Do you really want to delete script '"+(c.scriptName||c.description)+"'?",function(){window.scriptLib.requestDeleteScript(c.scriptIdPart,function(){console.log("deleted");b.remove()})})};
|
|
A1.prototype.checkExcludePackageStudies=function(a){var b=this;return a.filter(function(a){var d=this.getStudyPackageName({id:a});return d===this._PUBLISHED_STUDIES_PACKAGE_NAME?!0:b._studies[d]&&0<$.grep(b._studies[d],function(b){return a===b.id}).length?d===this._BASIC_STUDIES_PACKAGE_NAME||d===this._CUSTOM_STUDIES_PACKAGE_NAME||d===this._SCRIPTING_PACKAGE_NAME||"Script$EDGR"===d||pro.hasPackage(d)&&d in this._studies:!1},this)};
|
|
A1.prototype.sortStudies=function(a){return a.sort(function(a,c){a=a.scriptName||a.description_localized||a.description;c=c.scriptName||c.description_localized||c.description;return a>c?1:a<c?-1:0})};A1.prototype.fillStudies=function(a,b,c){var d;a.empty();b.forEach(function(b){b?d=this.createStudyListItem(b,c):(d=document.createElement("li"),d.className="placeholder");a.append(d)},this)};
|
|
A1.prototype.createStudyListItem=function(a,b){var c=document.createElement("li");$.data(c,"study",a);var d=a.description_localized||$.t(a.scriptName||a.description||" ",{context:"study"}),e=this.isFavorite(a.id),f=[];if(b&&d){var g=[];b instanceof RegExp?g.push({re:b,fuzzyHighlight:!1}):$.isArray(b)&&(g=b);for(var h=0;h<g.length;h++){var k=g[h].re;k.lastIndex=0;if(k=k.exec(d))if(g[h].fuzzyHighlight)for(var l=k.index,m=1;m<k.length;m++){var n=k[m].length;m%2&&(f[l]=!0);l+=n}else for(l=
|
|
0;l<k[0].length;l++)f[k.index+l]=!0}}d=d.replace(/./g,function(a,b){"<"===a?a="<":"&"===a?a="&":'"'===a&&(a=""");f[b]&&(a='<span class="match">'+a+"</span>");return a});d='<span class="text" title="'+TradingView.strip_tags(d)+'"">'+d+"</span>";TradingView.StudyMetaInfo.isScriptStrategy(a)&&(d+='<svg class="strategy"><use xlink:href="#svg-strategy"></use></svg>');R77.enabled("items_favoriting")&&(d='<span class="fav'+(e?" in-fav":"")+' apply-common-tooltip" title="'+this.favTitle(e)+
|
|
'"></span>'+d);a.author&&a.author.username&&(d+='<span class="author"><a href="/u/'+a.author.username+'" target="_blank">'+a.author.username+"</a></span>");a.agreeCount&&(d+='<span class="agrees apply-common-tooltip" title="'+$.t("Total agrees")+'">'+a.agreeCount+" "+(1<a.agreeCount?$.t("likes"):$.t("like"))+"</span>");e=a.TVScriptSourceCode&&(0===a.id.indexOf(this._PUBLISHED_STUDIES_PACKAGE_NAME)||0===a.id.indexOf(this._CUSTOM_STUDIES_PACKAGE_NAME));!TradingView.isMobileView&&e&&(c.className="custom-script",
|
|
d+='<span class="source apply-common-tooltip" title="'+$.t("Source code")+'">{}</span>');R77.enabled("graying_disabled_tools_enabled")&&D16.studiesAccessController.isToolGrayed(a.description)&&(c.className+=" grayed");"undefined"!=typeof a.isCustomIndicator&&(c.className+=" custom-indicator");a.imageUrl?d+='<div class="open-chart-popup apply-common-tooltip" title="'+$.t("Read more...")+'">...</div>':e&&window.scriptLib&&(d+='<div class="delete apply-common-tooltip" title="'+$.t("Delete script")+
|
|
'"><i></i></div>');c.innerHTML=d;return c};A1.prototype.favTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
|
|
A1.prototype.insertThisStudy=function(a){a=$(a.target).closest("li");if(!a.hasClass("placeholder")){var b=a.data("study");if(R77.enabled("graying_disabled_tools_enabled")&&D16.studiesAccessController.isToolGrayed(b.description))D17.emit("onGrayedObjectClicked",{type:"study",name:b.description});else return a.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(b),!1}};
|
|
A1.prototype.insertStudy=function(a){var b=this.D5.activeChartWidget.value();if(b){var c=b.insertStudyStub(a.description);a=TradingView.StudyMetaInfo.replaceWithFullStudyMetaInfoAsync(b.model().studiesMetaData(),a);a.done(function(a){b.removeStudyStub(c.id())&&(b.insertStudyOrShowDialog(a),this._is_on_chart=!0)}.bind(this));a.fail(function(a){console.error("Error: "+a);c.setStatus(a)})}};
|
|
A1.prototype.subscribePackage=function(a){(a=$(a.target).closest(".insert-study-pages > div").data("offer"))&&TradingView.visitPaymentPage(a.id)};A1.prototype.onLoginStateChange=function(a){a||this.setUser(window.user)};
|
|
A1.prototype.getStudyList=function(a){function b(a){c.push(a)}if(!this.studiesReady.isResolved())return[];var c=[],d;for(d in this._studies)if(d==this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(d))this._studies[d].forEach(b),a&&c.push({separator:!0});a&&c.splice(c.length-1,1);return c};
|
|
A1.prototype.getStudyPackageName=function(a){if(a&&a.id){var b=TradingView.StudyMetaInfo.getPackageName(a.id);if(b!==this._SCRIPTING_PACKAGE_NAME)return b;a=a.id.split("@")[0];if(0!==a.indexOf("Script$"))return b;b=a.indexOf("_");return-1!==b?a.substring(0,b):/^Script\$USER;/.test(a)?"Script$USER":/^Script\$PUB;/.test(a)?"Script$PUB":/^Script\$STD;/.test(a)?this._BASIC_STUDIES_PACKAGE_NAME:a}};
|
|
A1.prototype.studyIsUserTVScript=function(a){if(a&&a.id)return"Script$USER"===this.getStudyPackageName(a)};A1.prototype.studyIsPublishedScript=function(a){if(a&&a.id)return"Script$PUB"===this.getStudyPackageName(a)};A1.prototype.selectSearchPage=function(){this.selectPage("search");this._clearInput()};
|
|
A1.prototype._insertStudyByShortDescription=function(){for(var a=this._search_value,a=a.trim(),b=this._studies[this._BASIC_STUDIES_PACKAGE_NAME],c=0;c<b.length;c++){var d=b[c];if(d.shortDescription&&d.shortDescription.toUpperCase()===a.toUpperCase()){this.insertStudy(d);break}}};A1.prototype._clearInput=function(){this._search_input.val("");"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()};
|
|
A1.prototype._loadNextPubSearchPage=function(){var a=this;if(a._pubSearchDfd)return a._pubSearchDfd;var b=a._pubSearchPage+1;a._pubSearchDfd=A56.suggest(void 0,b);a._pubSearchDfd.done(function(c){a._pubSearchPageMax=c.max_offset;a._pubSearchPage=b;a._pubSearchEntries=a._pubSearchEntries.concat(c.results||[])});a._pubSearchDfd.always(function(){delete a._pubSearchDfd});return a._pubSearchDfd};
|
|
A1.prototype._onExternalFavoritesChanged=function(a){for(var b=[],c=0;c<a.length;c++){var d=TradingView.StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.saveFavorites();this.favsChanged.fire()};TradingView.deleteStudyTemplate=function(a,b){TradingView.getStudyTemplatesList.D20();R77.enabled("charting_library_base")?TradingView.ChartingLibraryBackend.removeStudyTemplate(a,b):$.post("/remove-study-template/",{name:a},b)};
|
|
A65=function(a){this._options=a||{};this.D5=this._options.D6;this._SAVE_AS_TITLE=$.t("Save Study Template As...");this._list=[];this._favoredList=this._$wrapper=null;this._loaded=!1;this._onFirstLoad=new Delegate;this.onFavoriteListResize=new Delegate};A65.prototype.appendMenuButtonTo=function(a){a&&(this._$wrapper=a,this._generateFavoriteList())};
|
|
A65.prototype.refreshStudyTemplateList=function(a){var b=this;TradingView.getStudyTemplatesList(function(c){b._list=c||[];"function"===typeof a&&a()})};
|
|
A65.prototype._generateFavoriteList=function(){var a=this;this._favoredList=new A14("StudyTemplates",a._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,svg:!1,popupSpacing:this._options.popupSpacing,notShowQuicks:this._options.notShowQuicks,tooltip:$.t("Study Templates"),addTooltipClass:"apply-common-tooltip"});a.refreshFavoriteDropdownMenu();this._favoredList.element().appendTo(this._$wrapper);
|
|
this._favoredList.onSelect().subscribe(a,function(a){a!=this._SAVE_AS_TITLE&&this.applyStudyTemplate(a)});this._favoredList.onSelect().subscribe(a,function(a){a===this._SAVE_AS_TITLE&&this.showSaveAsDiaolg()});this._favoredList.onResize().subscribe(a.D5,a.D5.updateLayout);this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire);this._favoredList.onOpen().subscribe(a,function(){a.refreshFavoriteDropdownMenu()})};
|
|
A65.prototype._listPreparedForFavorite=function(a){var b=this;a=this.plainList("default");var c=this.plainList("custom"),d=[{id:b._SAVE_AS_TITLE,title:b._SAVE_AS_TITLE,addClass:"special",toQuickButtonStyle:{display:"none"}},{separator:!0}],e=function(a,c){return $.map(a,function(a){var d={id:a,title:$.t(a),svg:svgAsset("star","13x13"),favoriteButton:{icon:{},title:a,addClass:"apply-common-tooltip"}};c&&(d.drop=function(){this.deleteStudyTemplate(a)}.bind(b));return d})};c.length&&
|
|
(d=d.concat(e(c,!0)));0<a.length&&(d=d.concat([{separator:!0}]).concat(e(a)));return d};
|
|
A65.prototype.applyStudyTemplate=function(a){function b(b){TradingView.trackEvent("GUI","Load Study Template");c.model().model().restoreStudyTemplate(JSON.parse(b.content),a)}var c=this.D5.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",a);R77.enabled("charting_library_base")?TradingView.ChartingLibraryBackend.getStudyTemplateContent(a,b):$.get("/study-template/?templateName="+encodeURIComponent(a),b)};
|
|
A65.prototype.showSaveAsDiaolg=function(){var a=this,b=this.D5.activeChartWidget.value(),c=function(c,d){c=TradingView.clean(c);var g=d[0],g=JSON.stringify(b.model().model().studyTemplate(g)),h={name:c,content:g},g=function(){var b=function(b){b.error||(TVSettings.setValue("defaultStudyTemplate",c),TradingView.getStudyTemplatesList.D20(),a.refreshFavoriteDropdownMenu())};R77.enabled("charting_library_base")?TradingView.ChartingLibraryBackend.saveStudyTemplate(h,
|
|
b):$.post("/save-study-template/",h,b).error(function(a){console.error(a.responseText)})};if(-1!=$.inArray(c,a.plainList())){var k=$.t("Confirm replace"),l=$.t("Do you realy want to replace")+' "'+c+'"?<br><small>'+$.t("Note: default study templates won't be removed permanently")+"</small>";A83.showConfirm(k,l,g)}else g()},d=function(b){a.refreshStudyTemplateList(function(){b.find('[name="name"]').inputselectable({list:a.plainList().sort(),closeHandle:b})})};runOrSignIn(function(){TradingView.showChartNameDialog(c,
|
|
"Save new study template","Template name",255,[{title:$.t("Save Interval"),name:"save_interval",type:"bool",hint:'When selecting this checkbox the study template will set "'+b.model().model().mainSeries().interval()+'" interval on a chart'}],d)},!0)};
|
|
A65.prototype.refreshFavoriteDropdownMenu=function(){var a=this,b=this._favoredList;b&&a.refreshStudyTemplateList(function(){b.reload(a._listPreparedForFavorite());b._container.hasClass("active")&&(b._container.trigger("click"),b._openMenu.call(b))})};
|
|
A65.prototype.deleteStudyTemplate=function(a){var b=this,c="Do you realy want to delete "+(a?'"'+a+'"':"")+" study template?";runOrSignIn(function(){A83.showConfirm("Study Template",c,function(){b._favoredList.removeById(a);TradingView.deleteStudyTemplate(a,function(){setTimeout(function(){b.refreshFavoriteDropdownMenu()},0)})})})};A65.prototype.container=function(){return this._favoredList?this._favoredList._container:null};
|
|
A65.prototype.list=function(){return this._list};A65.prototype.plainList=function(a){return"default"===a?$.map(jQuery.grep(this._list,function(a){return!!a.is_default}),function(a){return a.name}):"custom"===a?$.map(jQuery.grep(this._list,function(a){return!a.is_default}),function(a){return a.name}):$.map(this._list,function(a){return a.name})};TradingView.Action=function(a){a||(a={});this.checkable=a.checkable||!1;this.checked=a.checked||null;this.enabled=void 0===a.enabled?!0:a.enabled;this.visible=a.visible||!0;this.font=a.font||"Arial";this.icon=a.icon||null;this.iconText=a.iconText||null;this.iconVisibleInMenu=a.iconVisibleMenu||!0;this.deleteButton=a.deleteButton||null;this.shortcut=null;this.setShortCut(a.shortcut,a.doNotBindShortcut);this.statusTip=a.statusTip||null;this.text=a.text||null;this.toolTip=a.toolTip||null;this.htmlclass=
|
|
a.htmlclass||null;this._callbackContext=a.callbackContext||this;this._callbacks=new Delegate;this.subActions=a.subActions||[]};TradingView.Action.prototype.callbacks=function(){return this._callbacks};TradingView.Action.prototype.callbackContext=function(){return this._callbackContext};TradingView.Action.prototype.setCallbackContext=function(a){this._callbackContext=a};TradingView.Action.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length};
|
|
TradingView.Action.prototype.setChecked=function(a){this.checked=a};TradingView.Action.prototype._toggleChecked=function(){this.checked=!this.checked};TradingView.Action.prototype.setVisible=function(a){this.visible=a};TradingView.Action.prototype.setEnabled=function(a){this.enabled=a};TradingView.Action.prototype.disable=function(){this.setEnabled(!1)};TradingView.Action.prototype.enable=function(){this.setEnabled(!0)};
|
|
TradingView.Action.prototype.setShortCut=function(a,b){a&&(this.shortcut=a,!0!==b&&this._bindShortCut())};TradingView.Action.prototype._bindShortCut=function(){var a=this,b="."+this.shortcut;$(document).unbind(b);$(document).bind("keydown"+b,this.shortcut,function(b){b.preventDefault();if(a.enabled)return a.executeCallback(),!1})};TradingView.Action.prototype.setIconVisible=function(a){this.iconVisibleInMenu=a};
|
|
TradingView.Action.prototype.executeCallback=function(a){this._lastEvent=a;this._toggleChecked();this._callbacks.fire(this)};TradingView.ActionSeparator=function(){TradingView.Action.call(this);this.subActions=this.font=null;this.htmlclass="action-separator"};inherit(TradingView.ActionSeparator,TradingView.Action);TradingView.ActionPlaceholder=function(a){TradingView.Action.call(this);this.deferred=a};inherit(TradingView.ActionPlaceholder,TradingView.Action);TradingView.ContextMenu={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{"class":"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td",instances:[],createMenu:function(a,b,c){a=new TradingView.ContextMenu.Menu(a,b,c);this.instances.push(a);return a},createMenuFromActions:function(a,b){var c=new TradingView.ContextMenu.Items(a,b);this.instances.push(c);return c},hideAll:function(){for(var a in this.instances)this.instances[a].hide()}};(function(a){function b(a){if(null==a._parentMenu)return null;a=a._parentMenu;a=null==a._parentMenuItem?a:b(a._parentMenuItem);return a}TradingView.ContextMenu.Item=function(a,b){this.action=a;this._parentMenu=b};TradingView.ContextMenu.Item.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};TradingView.ContextMenu.Item.prototype._createDeleteButton=
|
|
function(){if(!this.action.deleteButton)return null;var a=this,b=this.action.deleteButton.action,e=TradingView.HTMLHelper.Element.create("span",{"class":"context-menu-delete-button"});b&&e.click(function(){b.call(a);return!1});this.jqSubmenu.addClass("delete-spacer");this.jqSubmenu.append(e)};TradingView.ContextMenu.Item.prototype._createTextTag=function(){var a=this._textTagAttributes();this.jqText=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.TEXT_CELL_TAG,a);this.jqIcon.addClass("context-menu");
|
|
return this.jqText};TradingView.ContextMenu.Item.prototype._createRightTag=function(){var a=this._rightTagAttributes();this.jqRight=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.RIGHT_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqRight};TradingView.ContextMenu.Item.prototype._createSubmenuTag=function(){var a=this._submenuTagAttributes();this.jqSubmenu=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.SUBMENU_CELL_TAG,a);this.jqIcon.addClass("context-menu");
|
|
return this.jqSubmenu};TradingView.ContextMenu.Item.prototype._iconTagAttributes=function(){var a={},b=[];this.action&&(this.action.icon?(b.push("icon"),b.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(b.push("icon"),this.action.checked?b.push("checked-icon"):b.push("unchecked-icon")):b.push("spacer"));a["class"]=b.join(" ");return a};TradingView.ContextMenu.Item.prototype._textTagAttributes=function(){return{"class":"text",html:this.action?this.action.text:""}};TradingView.ContextMenu.Item.prototype.highlight=
|
|
function(a){a?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover"));this.action&&this.action.hasSubActions()&&(a?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))};TradingView.ContextMenu.Item.prototype._rightTagAttributes=function(){var a={},b=["right"];this.action&&this.action.shortcut&&(b.push("shortcut"),a["class"]=b.join(" "),a.html=this.action.shortcut);
|
|
return a};TradingView.ContextMenu.Item.prototype._submenuTagAttributes=function(){var a={};this.action&&this.action.hasSubActions()?a["class"]="submenu-arrow":a["class"]="context-menu spacer";return a};TradingView.ContextMenu.Item.prototype.render=function(){this._createRow();this.jqRow.append(this._createIconTag());this.jqRow.append(this._createTextTag());this.jqRow.append(this._createRightTag());this.jqRow.append(this._createSubmenuTag());this._createDeleteButton();this.appendCallback();var a=this;
|
|
this.jqRow.mouseenter(function(b){a.showSubmenu(b);a.highlight(!0);a._parentMenu&&a._parentMenu._parentMenuItem&&a._parentMenu._parentMenuItem.highlight(!0)});this.jqRow.mouseleave(function(){a.highlight(!1)});return this.jqRow};TradingView.ContextMenu.Item.prototype._createRow=function(){var a=this._rowTagAttributes();this.jqRow=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.ITEM_ROW_TAG,a);this.jqRow.addClass("context-menu");var b=this;if(this.action&&!this.action.hasSubActions()){var e=
|
|
function(a){a.destroy();a._parentMenuItem&&e(a._parentMenuItem._parentMenu)};this.jqRow.click(function(a){e(b._parentMenu)})}};TradingView.ContextMenu.Item.prototype.showSubmenu=function(a){this._parentMenu.closeOtherSubmenus(this);if(!this.action||this.action.hasSubActions())this._menu||(this._menu=TradingView.ContextMenu.createMenu(this.action.subActions,null,this)),this.jqRow.position(),this.jqRow.height(),this.jqRow.width(),this.jqRow.offset(),a.pageX=this._parentMenu.jqMenu.width()-2,a.pageY=
|
|
this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(a,this._parentMenu.jqMenu)};TradingView.ContextMenu.Item.prototype._rowTagAttributes=function(){var a=[];this.action&&(!1===this.action.enabled&&a.push("disabled"),!1===this.action.visible&&a.push("hidden"),this.action.font&&a.push("font_"+this.action.font),this.action.hasSubActions()&&a.push("has_submenu"),this.action.htmlclass&&a.push(this.action.htmlclass));return{"class":a.join(" ")}};TradingView.ContextMenu.Item.prototype.appendCallback=
|
|
function(){var a=this;this.jqRow.click(function(b){a.action.enabled&&a.action.executeCallback(b)})};TradingView.ContextMenu.Item.prototype.getTopLevelMenu=function(){return b(this)};TradingView.ContextMenu.ItemPlaceholder=function(a,b){this.action=a;this._parentMenu=b};TradingView.ContextMenu.ItemPlaceholder.prototype.render=function(a){this._createRow();var b=this;this.action.deferred.then(function(e){for(var f in e){var g=b._parentMenu.addItem(e[f]);TradingView.ContextMenu.Menu.renderItem(a,g)}}).always(function(){b.jqRow.hide()});
|
|
return this.jqRow};TradingView.ContextMenu.ItemPlaceholder.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};TradingView.ContextMenu.ItemPlaceholder.prototype._createRow=function(){var a=this._rowTagAttributes();this.jqRow=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.ITEM_ROW_TAG,a);this.jqRow.append(this._createIconTag());
|
|
this.jqRow.addClass("context-menu")};TradingView.ContextMenu.ItemPlaceholder.prototype._rowTagAttributes=function(){var a=[];this.action&&a.push("spinner");return{"class":a.join(" ")}};TradingView.ContextMenu.ItemPlaceholder.prototype.highlight=function(a){};TradingView.ContextMenu.ItemPlaceholder.prototype._iconTagAttributes=function(){var a={},b=[];b.push("spacer");a["class"]=b.join(" ");a.colspan="10";return a}})(jQuery);(function(a){function b(a){var d=[];a=a.m_items;for(var e=0;e<a.length;e++)a[e]._menu&&(d.push(a[e]._menu),d=d.concat(b(a[e]._menu)));return d}TradingView.ContextMenu.Menu=function(b,d,e){this.options={};this._parentMenuItem=e;a.extend(this.options,d);this.options["class"]&&(this.options.attributes["class"]=this.options["class"]);this.m_wrapper=this.jqMenu=null;this.m_items=[];for(var f in b)this.addItem(b[f])};TradingView.ContextMenu.Menu.prototype.addItem=function(a){a=a instanceof TradingView.ActionPlaceholder?
|
|
new TradingView.ContextMenu.ItemPlaceholder(a,this):new TradingView.ContextMenu.Item(a,this);this.m_items.push(a);return a};TradingView.ContextMenu.Menu.renderItem=function(a,b){a.append(b.render(a))};TradingView.ContextMenu.Menu.prototype.closeOtherSubmenus=function(a){for(a=0;a<this.m_items.length;++a)this.m_items[a].highlight(!1),this.m_items[a]._menu&&(this.m_items[a]._menu.destroy(),this.m_items[a]._menu=null)};TradingView.ContextMenu.Menu.prototype.isShown=function(){return null!==this.jqMenu};
|
|
TradingView.ContextMenu.Menu.prototype.render=function(){var b=this.getAttributes();if(this._parentMenuItem){this.jqMenu=b=a("<table>");b.attr("cellspacing","0");b.attr("cellpadding","0");b.addClass("context-menu");b.addClass("submenu");for(var d in this.m_items){var e=this.m_items[d];TradingView.ContextMenu.Menu.renderItem(b,e)}}else for(d in this.jqMenu=b=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.MENU_TAG,b),this.m_items)e=this.m_items[d],TradingView.ContextMenu.Menu.renderItem(b,
|
|
e);return this.jqMenu};TradingView.ContextMenu.Menu.prototype.getAttributes=function(){var a={},b=["context-menu"];this.options.attributes&&this.options.attributes["class"]&&b.push(this.options.attributes["class"]);a.cellspacing=0;a.cellpadding=0;a["class"]=b.join();return a};TradingView.ContextMenu.Menu.prototype.deploy=function(b,d){this.jqMenu=this.wrapper().append(this.render());d?(a(d).data("submenu",this.jqMenu),a(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",d),this.jqMenu.data("parent-item",
|
|
b.currentTarget)):a(document.body).append(this.jqMenu);TradingView.HTMLHelper.unbindContextMenu(this.jqMenu);this._setCoords(b);return this.jqMenu};TradingView.ContextMenu.Menu.prototype.show=function(a,b){this.deploy(a,b).show()};TradingView.ContextMenu.Menu.prototype.hide=function(){this.isShown()&&this.destroy()};TradingView.ContextMenu.Menu.prototype.destroy=function(){a.each(this.m_items,function(a,b){b._menu&&b._menu.destroy()});this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null);this.m_wrapper.empty()};
|
|
TradingView.ContextMenu.Menu.prototype._setCoords=function(b){var d=this.jqMenu;a(this.jqMenu.data("parent-menu"));var e=a(this.jqMenu.data("parent-item")),f=a(window).width(),g=Math.min(a(window).height(),a("body").height()),h=a(document).scrollTop(),k=a(document).scrollLeft();this.jqMenu.css({maxWidth:f-10,maxHeight:g-10});var l=d.outerWidth(),d=d.outerHeight(),m;e.size()?(m=e.offset(),m={top:m.top-1,left:m.left+e.outerWidth()}):m={top:b.pageY,left:b.pageX};this.jqMenu.offset(m);e={};e.top=Math.min(m.top,
|
|
g+h-d-5);e.left=Math.min(m.left,f+k-l-5);for(b=b.target;b&&b!==document;b=b.parentNode)if("fixed"===a(b).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(e)};TradingView.ContextMenu.Menu.prototype._wrapper=function(){var c=this,d=TradingView.ContextMenu.WRAPPER_ATTRIBUTES;this._parentMenuItem?this.m_wrapper=TradingView.HTMLHelper.Element.create(TradingView.ContextMenu.WRAPPER_TAG,d):(this.m_wrapper=TradingView.HTMLHelper.createPopup(d,void 0,{mouseDownOutsideEvent:function(d){var f=
|
|
a();a.each(b(c),function(){f=f.add(this.m_wrapper)});a(d.target).parents().andSelf().is(f)||c.hide()}}),this.m_wrapper.addClass("topmenu"));return this.m_wrapper};TradingView.ContextMenu.Menu.prototype.wrapper=function(a){return this.m_wrapper||this._wrapper()}})(jQuery);TradingView._defaultChartSymbol="FX:SPX500";
|
|
A7=function(a){var b=this;this._startSpinner(a.jqParent);TradingView.drawingState.init();var c=this;TradingView.drawingState.tool.subscribe(function(a){if(c.D0){c.D0.model().setCurrentTool(a);if(TradingView.isMobile.any()){var b=c._paneWidgets[0];if(R47.isLineTool(a)&&"LineToolBrush"!==a){a=.5*c.D0.model().timeScale().width();var d=.5*b._state.defaultPriceScale().height();c.D0.model().setCurrentPosition(a,d,b._state);b._updateTooltip(a,d)}else b._hideTooltip()}c.D0&&
|
|
TradingView.isMobile.any()&&c.D0.model().crossHairSource().updateAllViews()}});var d=function(a){return b.D0.model().timeScale().points().roughIndex(a)};TradingView.drawingState.createdLineTool.subscribe(null,function(a){var c=b.D0.model();if(a.model!=c&&b.D0.model().mainSeries().symbol()==a.symbol){var c=c.paneForSource(b.D0.model().mainSeries()),e={index:d(a.point.timeStamp),price:a.point.price};b.D0.createLineTool(c,e,a.linetool,a.props,a.linkKey)}});TradingView.drawingState.continuedLineTool.subscribe(null,
|
|
function(a){var c=b.D0.model();if(a.model!=c){var c={index:d(a.point.timeStamp),price:a.point.price},e=b.D0.lineBeingCreated();e&&b.D0.coninueCreatingLine(c,a.envState,!!a.finalState)&&a.finalState&&e.restoreExternalPoints(a.finalState)}});TradingView.drawingState.cancelledLineTool.subscribe(null,function(a){var c=b.D0.model();a.model!=c&&b.D0.cancelCreatingLine()});TradingView.drawingState.startedMovingLineTool.subscribe(null,function(a){var c=b.D0.model();if(a.model!=c&&
|
|
b.D0.model().mainSeries().symbol()==a.symbol&&(c=c.D19().filter(function(b){return b.linkKey==a.linkKey})[0])&&c.isActualSymbol()){var e={index:d(a.point.timeStamp),price:a.point.price};b.D0.startMovingSource(c,e)}});TradingView.drawingState.movedLineTool.subscribe(null,function(a){var c=b.D0.model();a.model!=c&&c.sourceBeingMoved()&&c.sourceBeingMoved().linkKey==a.linkKey&&(a={index:d(a.point.timeStamp),price:a.point.price},b.D0.moveSource(a))});TradingView.drawingState.finishedMovingLineTool.subscribe(null,
|
|
function(a){var c=b.D0.model();a.model!=c&&c.sourceBeingMoved()&&b.D0.endMovingSource(!!a.finalState)});TradingView.drawingState.startedChangingLineTool.subscribe(null,function(a){var c=b.D0.model();if(a.model!=c&&b.D0.model().mainSeries().symbol()==a.symbol&&(c=c.D19().filter(function(b){return b.linkKey==a.linkKey})[0])&&c.isActualSymbol()){var e={index:d(a.point.timeStamp),price:a.point.price};b.D0.startChangingLinetool(c,e,a.pointIndex,{})}});TradingView.drawingState.changedLineTool.subscribe(null,
|
|
function(a){var c=b.D0.model();a.model!=c&&c.lineBeingEdited()&&c.lineBeingEdited().linkKey==a.linkKey&&(a={index:d(a.point.timeStamp),price:a.point.price},b.D0.changeLinePoint(a))});TradingView.drawingState.finishedChangingLineTool.subscribe(null,function(a){var c=b.D0.model();if(a.model!=c){var d=c.D19().filter(function(b){return b.linkKey==a.linkKey})[0];c.lineBeingEdited()&&b.D0.endChangingLinetool(!!a.finalState);d&&d.isActualSymbol()&&a.finalState&&d.restoreExternalPoints(a.finalState)}});
|
|
TradingView.drawingState.removedLineTool.subscribe(null,function(a){var c=b.D0.model();a.model!=c&&(c=c.D19().filter(function(b){return b.linkKey==a.linkKey})[0])&&b.D0.removeSource(c)});TradingView.drawingState.finishedLineTool.subscribe(null,function(a){var c=b.D0.model();a.model!=c&&c.D19().filter(function(b){return b.linkKey==a.linkKey})[0]&&b.D0.finishLineTool()});TradingView.drawingState.changedLineStyle.subscribe(null,function(a){var c=b.D0.model();a.model!=
|
|
c&&(c=c.D19().filter(function(b){return b.linkKey==a.linkKey})[0])&&(c.properties().merge(a.state),c.propertiesChanged())});TradingView.drawingState.copiedLineTool.subscribe(null,function(a){var c=b.D0.model();if(a.model!=c&&b.D0.model().mainSeries().symbol()==a.symbol){var e=c.paneForSource(b.D0.model().mainSeries()),f=a.points[0],f={index:d(f.time_t),price:f.price},e=c.createLineTool(e,f,a.linetool,null,a.linkKey);if(c.lineBeingCreated())for(var g=1;g<a.points.length;g++)f={index:d(a.points[g].absolute_time),
|
|
price:a.points[g].price},g==a.points.length-1&&"LineToolBrush"==a.linetool&&c.finishLineTool(!0),c.coninueCreatingLine(f,{},g<a.points.length-1,!0),delete a.points[g].absolute_time;e.restoreExternalPoints({points:a.points,interval:a.props.interval});e.properties().merge(a.state);e.propertiesChanged()}});this._options=a=a||{};var e=a.jqParent,f=a.sizeFunc,g=a.content,h=a.readOnly,k=a.containsData,l=a.onWidget,m=a.onCmeWidget;m&&console.warn("[ChartWidget] 'onCmeWidget' option is depricated");var n=
|
|
a.widgetCustomer,p=a.timezone,r=a.withDateRanges,t=a.hideSymbolSearch,v=a.defSymbol,w=a.defInterval,u=a.defExtendedHours,x=-1!==$.inArray(a.defStyle,$.map($.grep(Object.keys(TradingView.Series),function(a){return/^STYLE_\w+/.test(a)}),function(a){return TradingView.Series[a]}))?a.defStyle:void 0;this.D5=a.D6||null;this._withDateRanges=("undefined"===typeof r?!h:!!r)&&R77.enabled("timeframes_toolbar");this._jqParent=void 0!==e?e:$(document.body);this._setContent(g);
|
|
this._readOnly=h;this._containsData=k;this._defSymbol=v;this._defInterval=w;this._defStyle=x;if(this._onWidget=!!l)m?this._widgetCustomer="cme":n&&(this._widgetCustomer=n);this._sizeFunc=f||function(){var a=b._jqParent.width(),c=b._jqParent.height(),d=b._jqParent[0];window.self!==window.top&&d.offsetWidth<d.clientWidth&&100>d.getBoundingClientRect().width&&(a=Math.round(100*d.getBoundingClientRect().width),c=Math.round(100*d.getBoundingClientRect().height));return new TradingView.Rect(0,0,a,c-(b._withDateRanges?
|
|
22:0))};this._hideSymbolSearch=t;this._jqMainDiv=null;this._rect=this._sizeFunc();this._jqMainTable=null;this._paneWidgets=[];this._paneSeparators=[];this._timeAxisWidget=null;this._frameTime=30;this.D0=null;this._metaInfo={};if(a=this._contentSeriesProperties())v=a.symbol,w=a.interval;"undefined"==typeof TradingView.IntervalHelper||TradingView.IntervalHelper.isMinute(w)||TradingView.IntervalHelper.isDWM(w)||(w=void 0);this.D2=new J52("chartproperties");this.D2.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties"));
|
|
this.D2.mainSeriesProperties.merge({visible:!0,symbol:v?v:TradingView._defaultChartSymbol,shortName:"",timeframe:"",onWidget:this._onWidget,interval:w||"D",style:x,extendedHours:u,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}});this._containsData&&this.D2.mainSeriesProperties.merge({showCountdown:!1});p&&TradingView.timezoneIsAvailable(p)&&this.D2.timezone.setValue(p);this._tagsChanged=new Delegate;this._modelCreated=
|
|
new Delegate;this._disconnected=new Delegate;this._reconnectBailout=new Delegate;this._connected=new Delegate;this._redrawPanes=new Delegate;this.chartWidgetInitialized=new Delegate;this._studiesMetaData=new List;this._studiesMigrations=new List;this._chartSession=new TradingView.ChartSession(D16);this.lhsPriceAxisWidthChanged=new Delegate;this.rhsPriceAxisWidthChanged=new Delegate;this.createLogo=null;!this._readOnly&&TradingView.perfomanceTestEnabled()&&(this.performance=new A7.Performance(this))};
|
|
A7.prototype.refreshMarks=function(){this.model().barsMarksSources().map(function(a){a.refreshData()})};A7.prototype.clearMarks=function(){this.model().barsMarksSources().map(function(a){a.clearMarks()})};A7._nextMetadataId=1;A7.FREE_STUDY_LIMIT=10;
|
|
A7.prototype._onStudiesMetadata=function(a){var b=this;if("studies_metadata"===a.method){this._studiesMigrations=new List;for(var c=a.params[1].migrations,d=0;c&&d<c.length;d++)this._studiesMigrations.append(c[d]);for(var e=a.params[1].metainfo,d=0;d<e.length;d++)A0._verifyInputsMaxValue(e[d]);for(d=0;d<e.length;d++)_applyLocalizationToMetadata(e[d]);e=e.concat(this.privateMetaInfo(TradingView.FundamentalsGenerator));e=e.concat(this.privateMetaInfo(TradingView.EotProGenerator));
|
|
R77.enabled("alerts")&&this._setAlertsStudiesList(e);void 0!==PineAddons?(a=A7._filterAuthorizedMetaInfo(PineAddons.TimWestStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SpyderCrusherStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.AlphaLabStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SRLevelsStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.MTFPanesStudiesMetaInfo),
|
|
e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SmarterStopsStudiesMetaInfo),e=e.concat(a),a=A7._filterAuthorizedMetaInfo(PineAddons.SynergyTradingStudiesMetaInfo),e=e.concat(a),a=PineAddons.ESDMetaInfo,e=e.concat(a)):console.error("PineAddons is undefined. All Pine Script products will be unavailable");(a=this._tvScriptsRequestDfd)||(a=$.Deferred().resolve([]));a.done(function(a){b._onScriptSources(a,e)})}};
|
|
A7.prototype._setAlertsStudiesList=function(a){this._alertsStudiesList=$.map($.grep(a,function(a){a=a.plots||[];for(var c=0;c<a.length;c++)if("line"===a[c].type)return!0;return!1}),function(a){return a.id})};
|
|
A7.prototype.canCreateAlertForDataSource=function(a){function b(a){a instanceof A58&&(a=a.bars());a instanceof TradingView.PlotList&&(a=a.state().data);if(!$.isArray(a))return!0;for(var b=a.length-1;0<=b;b--){var c=a[b];if(!$.isArray(c.value))return!0;for(var d=c.value.length-1;0<d;d--){var e=c.value[d];if(null!==e&&void 0!==e&&!TradingView.isNaN(e))return!0}}return!1}if(!R77.enabled("alerts"))return!1;var c=a.uniqueId&&a.uniqueId(),d=a===this.D0.mainSeries(),
|
|
e=a instanceof TradingView.Study,f=!(a instanceof TradingView.study_Script$TV_DIVIDENDS)&&!(a instanceof TradingView.study_Script$TV_SPLITS)&&!(a instanceof TradingView.study_Script$TV_EARNINGS),g=a.metaInfo?a.metaInfo():null,h=g?g.isTVScript:!1,g=g?-1!=$.inArray(g.fullId,this._alertsStudiesList):!1;return c&&(d||e&&f&&a.data()&&!a.data().isEmpty()&&b(a.data())&&(h||g))};
|
|
A7._filterAuthorizedMetaInfo=function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c],e=TradingView.StudyMetaInfo.parseIdString(d.id).productId;pro.hasPackage(e)&&b.push(d)}return b};A7.prototype.privateMetaInfo=function(a){return a?(new a(TradingView.StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION)).generateMetaInfo():[]};
|
|
A7.prototype._onScriptSources=function(a,b){if(!this.onWidget()){for(var c=null,d=0;d<b.length;++d){var e=b[d];if(e.id.startsWith("Script@tv-scripting-")){c=TradingView.StudyMetaInfo.parseIdString(e.id).version;break}}if(null!=c)for(this.studyScriptingPkgVers=c,d=0;d<a.length;++d)try{var f=a[d].scriptName;TradingView.logDebugChart("Loading script: '"+f+"'.");var g=TradingView.StudyMetaInfo.createMetaInfoStub(a[d],c);b.push(g)}catch(h){console.error("Could not process script (skipped): "+
|
|
f+" ("+h.message+")")}else console.error("Could not find tv-scripting package in metadata response")}for(d=0;d<b.length;d++)TradingView.StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,b[d]);TradingView.StudyMetaInfo.sortStudiesMetainfo(this._studiesMetaData);this._init();this.chartWidgetInitialized.fire()};
|
|
A7.prototype._init=function(){var a=this;!this._containsData&&this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this.D2.timeScale.rightOffset.value());this.initColors();this._makeDefaultGui();this._makeDefaultModel();this._chartSession&&this._chartSession.connected()&&this.D0.restart();this._content&&(this.initColors(),this._updateGui(),this.update());a.D0.mainSeries().marketStatus.subscribe(function(b){a.indicatorImage&&
|
|
a._updateDataAndMarketStatus(b,a.D0.mainSeries().status())},{callWithLast:!0});this._resizeHandler=function(){this._rect=this._sizeFunc();TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._adjustSize();this.D0&&this.D0.mainSeries().requestMoreData();this.paint()}.bind(this);this._resizeHandler();this._jqMainDiv.appendTo(this._jqParent);this._spinner&&(this._spinner.stop(),delete this._spinner);$(window).keydown(function(a){27==a.which&&a.preventDefault()});this._containsData||
|
|
this._jqMainDiv.mousewheel(function(a,c,d,e){if(!(!TradingView.onWidget()&&parent&&parent!==window&&parent.IS_DEMO_PAGE||!this.model()||this.noScroll||this.model().timeScale().isEmpty())){a=a.pageX-5;c=this._paneWidgets[0].lhsPriceAxisWidget.size.w;var f=this._timeAxisWidget.size.w;c&&(a=Math.max(0,a-c));a=Math.min(a,f);a=R77.enabled("right_bar_stays_on_scroll")?1:2*(a/f-.5);c=Math.min(1,Math.abs(e));0<e?this.model().zoomIn(a,c):0>e&&this.model().zoomOut(a,c);d&&this.model().scrollChart(-80*
|
|
d);return!1}}.bind(this));this._initBarsMarksSources();TradingView.D18("esdindicatorfeature")&&this.initESDTimelineWidget();this.setAutoScaleOnSymbolChange();this.readOnly()||this._hideSymbolSearch||A69.registerDialogKeypressHandler(this);this.adaptOnChartLogo()};A7.prototype._initBarsMarksSources=function(){var a=this;this.withModel(this,function(){this.model().barsMarksSources().map(function(b){b.onNeedRepaint.subscribe(a,a.paint)})})};
|
|
A7.prototype.initESDTimelineWidget=function(){new TradingView.ESDTimelineWidget(this)};A7.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().onStartLoading().subscribe(this,function(){(!this.model().mainSeries()instanceof TradingView.Series||!this.model().mainSeries().properties().lockScale.value())&&0===this.model().mainSeries().data().size()&&this.model().mainSeries().priceScale().setAutoScale(!0)})})};
|
|
A7.prototype.initColors=function(){this.D2.paneProperties.background.listeners().subscribe(this,A7.prototype.setBackgroundColor);this.D2.paneProperties.vertGridProperties.color.listeners().subscribe(this,A7.prototype.redrawPanes);this.D2.paneProperties.horzGridProperties.color.listeners().subscribe(this,A7.prototype.redrawPanes);this.D2.scalesProperties.lineColor.listeners().subscribe(this,
|
|
A7.prototype.setScaleLineColor);this.D2.scalesProperties.textColor.listeners().subscribe(this,A7.prototype.setScaleTextColor)};A7.prototype.paneWidgets=function(){return this._paneWidgets};A7.prototype.paneByCanvas=function(a){for(var b=0;b<this._paneWidgets.length;b++)if(this._paneWidgets[b].canvas===a||this._paneWidgets[b].top_canvas===a)return this._paneWidgets[b];return null};
|
|
A7.prototype.paneByState=function(a){for(var b=0;b<this._paneWidgets.length;b++)if(this._paneWidgets[b]._state===a)return this._paneWidgets[b];return null};A7.prototype.priceAxisByCanvas=function(a){for(var b=0;b<this._paneWidgets.length;b++){var c=this._paneWidgets[b].priceAxisByCanvas(a);if(c)return c}return null};
|
|
A7.prototype.timeAxisByCanvas=function(a){return a===this._timeAxisWidget.canvas||a===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null};A7.prototype.properties=function(){return this.D2};A7.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)};A7.prototype.readOnly=function(){return this._readOnly};A7.prototype.onDisconnected=function(){return this._disconnected};
|
|
A7.prototype.onReconnectBailout=function(){return this._reconnectBailout};A7.prototype.onConnected=function(){return this._connected};A7.prototype.onRedrawPanes=function(){return this._redrawPanes};A7.prototype.modelCreated=function(){return this._modelCreated};
|
|
A7.prototype.setResolution=function(a){if(this.D0){var b=this.D0.mainSeries().properties().interval;this.D0.setScreenChartProperty(b,a,this,$.t("Change Resolution"))}else this.D2.mainSeriesProperties.merge({interval:a})};A7.prototype.getResolution=function(){return this.D0?this.D0.mainSeries().properties().interval.value():this.D2.mainSeriesProperties.interval.value()};
|
|
A7.prototype.addSymbol=function(a,b){var c=this.model(),d=c.studiesMetaData(),e=c.mainSeries().properties().style.value()==TradingView.Series.STYLE_CANDLES?TradingView.Series.STYLE_BARS:TradingView.Series.STYLE_CANDLES,e={inputs:{symbol:a},style:e},d=d.find(function(a){return"Overlay@tv-basicstudies"==a.id});c.insertStudy(d,e,b)};A7.prototype.addSymbolDialog=function(){A83.showAddSymbolDialog(this,{overlayOption:!0,callback:this.addSymbol.bind(this)})};
|
|
A7.prototype.updateActions=function(){function a(a){function b(){TradingView.showThemeSaveDialog(c.D0)}d.applyColorTheme.subActions||(d.applyColorTheme.subActions=[]);var e=d.applyColorTheme.subActions;e.splice(0,e.length);if(is_authenticated){var f=new TradingView.Action({text:$.t("Save As...")});f.callbacks().subscribe(null,b);e.push(f);e.push(new TradingView.ActionSeparator)}a&&a.length?$.each(a,function(a,b){function d(a){return function(){var b=$.t("Do you realy want to delete ")+
|
|
(a?'"'+a+'"':"")+" theme?";A83.showConfirm("Theme",b,function(){$.post("/remove-theme/",{name:a}).error(function(a){console.error(a.responseText)});TradingView.getThemesList.D20()});this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}var f=new TradingView.Action({text:$.t(b)});f.callbacks().subscribe(null,function(){$.getJSON("/theme/?themeName="+encodeURIComponent(b),function(a){c.model().model().restoreTheme(JSON.parse(a.content))})});is_authenticated&&(f.deleteButton=
|
|
{action:d(f.text)});e.push(f)}):e.push(new TradingView.Action({text:"No color themes saved",enabled:!1}))}function b(){var a=studyTemplates.plainList("custom"),b=studyTemplates.plainList("default");d.applyStudyTemplate.subActions||(d.applyStudyTemplate.subActions=[]);var c=d.applyStudyTemplate.subActions;c.splice(0,c.length);var e=new TradingView.Action({text:studyTemplates._SAVE_AS_TITLE});e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDiaolg);c.push(e);c.push(new TradingView.ActionSeparator);
|
|
a.length||b.length?(a.length&&($.each(a,function(a,b){var d=new TradingView.Action({text:b});d.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});d.deleteButton={action:function(a){return function(){studyTemplates.deleteStudyTemplate(a);this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}(d.text)};c.push(d)}),c.push(new TradingView.ActionSeparator)),$.each(b,function(a,b){var d=new TradingView.Action({text:b});d.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});
|
|
c.push(d)})):c.push(new TradingView.Action({text:$.t("No study templates saved"),enabled:!1}))}for(var c=this,d=this.actions(),e=this.D0.D19(),f=!1,g=!1,h=0,k=e.length;h<k;h++){var l=e[h];TradingView.isInherited(l.constructor,R47)&&l.isUserDeletable()&&(f=!0);TradingView.isInherited(l.constructor,TradingView.Study)&&l.removeByRemoveAllStudies()&&(g=!0)}this._readOnly||(d.paneRemoveAllStudies&&d.paneRemoveAllStudies.setEnabled(g),d.paneRemoveAllDrawingTools&&d.paneRemoveAllDrawingTools.setEnabled(f));
|
|
a(TradingView.getThemesList(a));window.studyTemplates&&(b(),studyTemplates.refreshStudyTemplateList(b));var m=[];TradingView.availableTimezones.forEach(function(a){var b=this,c=function(){return a.id===b.model().model().properties().timezone.value()};if(!a.separator){var d=new TradingView.Action({text:a.title,checkable:!0,checked:c()});d.callbacks().subscribe(this,function(){var c;c||(c=setTimeout(function(){b.model().setProperty(b.model().model().properties().timezone,a.id,"Changed Time Zone");c=
|
|
!1},300))});b.model().model().properties().timezone.subscribe(null,function(){d.setChecked(c())});m.push(d)}},this);d.applyTimeZone.subActions=m;d.addToWatchlist.text=$.t("Add {0} To Watchlist").format(this.getSymbol(!0));this.updateActionForIntradayOnly(d.sessionBreaks)};A7.prototype.actions=function(){this._actions||this._setActions();return this._actions};
|
|
A7.prototype._setActions=function(){var a=this,b=[];if(!this._readOnly)for(var b=[new TradingView.Action({text:$.t("Eraser"),callbackContext:"eraser"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Trend Line"),callbackContext:"LineToolTrendLine"}),new TradingView.Action({text:$.t("Horizontal Line"),callbackContext:"LineToolHorzLine"}),new TradingView.Action({text:$.t("Vertical Line"),callbackContext:"LineToolVertLine"}),new TradingView.Action({text:$.t("Arrow"),
|
|
callbackContext:"LineToolArrow"}),new TradingView.Action({text:$.t("Ray"),callbackContext:"LineToolRay"}),new TradingView.Action({text:$.t("Extended"),callbackContext:"LineToolExtended"}),new TradingView.Action({text:$.t("Parallel Channel"),callbackContext:"LineToolParallelChannel"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Pitchfork"),callbackContext:"LineToolPitchfork"}),new TradingView.Action({text:$.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork"}),new TradingView.Action({text:$.t("Pitchfan"),
|
|
callbackContext:"LineToolPitchfan"}),new TradingView.Action({text:$.t("Gann Square"),callbackContext:"LineToolGannSquare"}),new TradingView.Action({text:$.t("Gann Fan"),callbackContext:"LineToolGannFan"}),new TradingView.Action({text:$.t("Fib Retracement"),callbackContext:"LineToolFibRetracement"}),new TradingView.Action({text:$.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension"}),new TradingView.Action({text:$.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan"}),
|
|
new TradingView.Action({text:$.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone"}),new TradingView.Action({text:$.t("Circle Lines"),callbackContext:"LineToolCircleLines"}),new TradingView.Action({text:$.t("Fib Circles"),callbackContext:"LineToolFibCircles"}),new TradingView.Action({text:$.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Rectangle"),callbackContext:"LineToolRectangle"}),new TradingView.Action({text:$.t("Ellipse"),
|
|
callbackContext:"LineToolEllipse"}),new TradingView.Action({text:$.t("Triangle"),callbackContext:"LineToolTriangle"}),new TradingView.Action({text:$.t("Polyline"),callbackContext:"LineToolPolyline"}),new TradingView.Action({text:$.t("Arc"),callbackContext:"LineToolArc"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Text"),callbackContext:"LineToolText"}),new TradingView.Action({text:$.t("Anchored Text"),callbackContext:"LineToolTextAbsolute"}),new TradingView.Action({text:$.t("Balloon"),
|
|
callbackContext:"LineToolBalloon"}),new TradingView.Action({text:$.t("Price Label"),callbackContext:"LineToolPriceLabel"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette"}),new TradingView.Action({text:$.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor"}),new TradingView.Action({text:$.t("Elliott Wave Circle"),callbackContext:"LineToolElliottCircle"}),new TradingView.Action({text:$.t("Elliott Minor Retracement"),
|
|
callbackContext:"LineToolElliottMinorRetr"}),new TradingView.Action({text:$.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Brush"),callbackContext:"LineToolBrush"}),new TradingView.ActionSeparator,new TradingView.Action({text:$.t("Forecast"),callbackContext:"LineToolPrediction"})],a=this,c=function(a){TradingView.drawingState.tool.setValue(a.callbackContext())},d=0;d<b.length;d++)b[d].callbacks().subscribe(null,
|
|
c);var e=new TradingView.Action({text:$.t("Reset Chart")});e.callbacks().subscribe(this,this.GUIResetScales);var f=new TradingView.Action({text:$.t("Undo"),shortcut:"ctrl+z"});f.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Undo");A77.undo()});f.disable();var g=new TradingView.Action({text:$.t("Redo"),shortcut:"ctrl+y"});g.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Redo");A77.redo()});g.disable();A77.undoStack().onChange().subscribe(this,
|
|
this.updateUndoRedo);A77.redoStack().onChange().subscribe(this,this.updateUndoRedo);var h=new TradingView.Action({text:$.t("Color Theme")}),k=new TradingView.Action({text:$.t("TimeZone")}),l=new TradingView.Action({text:$.t("Change Symbol...")});TVSettings.setValue("symboledit.dialog_last_entry","");l.callbacks().subscribe(this,function(){A69.showDialog({callback:this.setSymbol.bind(this)})});var m=new TradingView.Action({text:$.t("Change Interval...")});m.callbacks().subscribe(this,
|
|
function(){(new TradingView.ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show()});var n=new TradingView.Action({text:$.t("Add To Watchlist")});n.callbacks().subscribe(this,function(){for(var a=widgetbar.setPage("Watchlist, details and news"),b,c=0;c<a.widgets.length;c++)if("watchlist"==a.widgets[c].type){b=a.widgets[c].widgetObject;break}b&&b.addHighlight(this.getSymbol())});var p=new TradingView.Action({text:$.t("Study Template")}),r=new TradingView.Action({shortcut:"ctrl+alt+q",
|
|
text:$.t("Reset Scale")});r.callbacks().subscribe(null,function(b){a.model().resetTimeScale()});var b=new TradingView.Action({text:$.t("Insert Drawing Tool"),subActions:b}),c=new TradingView.Action({text:$.t("Remove All Indicators")}),d=new TradingView.Action({text:$.t("Remove All Drawing Tools")}),t=new TradingView.Action({text:$.t("Insert Indicator...")}),v=new TradingView.Action({text:$.t("Script Editor...")}),w=new TradingView.Action({text:$.t("Compare or Add Symbol...")}),u=new TradingView.Action({text:$.t("Compare...")}),
|
|
x=new TradingView.Action({text:$.t("Objects Tree...")}),C=new TradingView.Action({text:$.t("Properties..."),callback:function(b,c){a.showChartProperties()}}),A=new TradingView.Action({text:$.t("Scales Properties...")}),y=new TradingView.Action({text:$.t("Timezone/Sessions Properties...")}),D=new TradingView.Action({text:$.t("Lock/Unlock")});D.callbacks().subscribe(this,A7.prototype.toggleLockSelectedObject);var E=new TradingView.Action({text:$.t("Hide")});E.callbacks().subscribe(this,
|
|
A7.prototype.hideSelectedObject);var z=new TradingView.Action({text:$.t("Format...")});z.callbacks().subscribe(this,A7.prototype.editSelectedObject);var F=new TradingView.Action({text:$.t("Source Code...")});F.callbacks().subscribe(this,this.openSelectedObjectSource);var K=new TradingView.Action({text:$.t("Left Axis"),checkable:!0});K.binder=new D14(K,this.D2.scalesProperties.showLeftScale,this.model(),"Show Left Scale");var Q=
|
|
new TradingView.Action({text:$.t("Right Axis"),checkable:!0});Q.binder=new D14(Q,this.D2.scalesProperties.showRightScale,this.model(),"Show Right Scale");this.D2.scalesProperties.showLeftScale.listeners().subscribe(this,A7.prototype._updateScalesActions);this.D2.scalesProperties.showRightScale.listeners().subscribe(this,A7.prototype._updateScalesActions);var B=new TradingView.Action({text:$.t("Scale Price Chart Only"),
|
|
checkable:!0});B.binder=new D14(B,this.D2.scalesProperties.scaleSeriesOnly,this.model(),$.t("Scale Price Chart Only"));var J=this.model().model();this.D2.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){J.recalculateAllPanes();J.D20(new A22(A22.FULL_UPDATE))});var O=new TradingView.Action({text:$.t("Drawings Toolbar"),checkable:!0});window.sideToolbar&&(O.binder=new D14(O,
|
|
window.sideToolbar.visible,this.model(),"Drawings Toolbar"));var q=new TradingView.Action({text:$.t("Favorite Drawings Toolbar"),checkable:!0});window.sideToolbar&&window.sideToolbar.favoriteDrawingToolbar&&(q.binder=new D14(q,window.sideToolbar.favoriteDrawingToolbar.visibleProperty,this.model(),"Drawings Toolbar"));var T=new TradingView.Action({text:$.t("Magnet Mode"),checkable:!0});T.binder=new D14(T,TradingView.drawingState.properties().magnet,this.model(),
|
|
"Magnet");var I=new TradingView.Action({text:$.t("Stay In Drawing Mode"),checkable:!0});I.binder=new D14(I,TradingView.drawingState.properties().stayInDrawingMode,this.model(),"Stay In Drawing Mode");var M=new TradingView.Action({text:$.t("Sync drawings to all charts"),checkable:!0});M.binder=new D14(M,TradingView.drawingState.properties().drawOnAllCharts,this.model(),"SyncDrawings");var S=new TradingView.Action({text:$.t("Lock All Drawing Tools"),checkable:!0});
|
|
S.binder=new D14(S,TradingView.drawingState.lockDrawings(),this.model(),"Lock drawings",function(a){a||this.binder.setValue(!this.binder.value());TradingView.drawingState.lockDrawings().setValue(this.binder.value())}.bind(S));var N=new TradingView.Action({text:$.t("Hide All Drawing Tools"),checkable:!0});N.binder=new D14(N,TradingView.drawingState.hideAllDrawings(),this.model(),"Hide All Drawing Tools",function(a){a||this.binder.setValue(!this.binder.value());
|
|
TradingView.drawingState.hideAllDrawings().setValue(this.binder.value())}.bind(N));var W=new TradingView.Action({text:$.t("Hide Marks On Bars"),checkable:!0});W.binder=new D14(W,TradingView.drawingState.hideMarksOnBars(),this.model(),"Hide Marks On Bars",function(a){a||this.binder.setValue(!this.binder.value());TradingView.drawingState.hideMarksOnBars().setValue(this.binder.value())}.bind(W));var V=new TradingView.Action({text:$.t("Extended Hours"),checkable:!0});V.binder=new D14(V,
|
|
this.model().mainSeries().properties().extendedHours,this.model(),"Change Extended Hours");var R=new TradingView.Action({text:$.t("Symbol Last Value"),checkable:!0,checked:!1});R.binder=new D14(R,this.properties().scalesProperties.showSeriesLastValue,this.model(),"Show Symbol Last Value");var aa=new TradingView.Action({text:$.t("Symbol Labels"),checkable:!0,checked:!1});aa.binding=new D14(aa,this.properties().scalesProperties.showSymbolLabels,this.model(),
|
|
"Undo Show Symbol Labels");var U=new TradingView.Action({text:$.t("Indicator Last Value"),checkable:!0,checked:!1});U.binder=new D14(U,this.properties().scalesProperties.showStudyLastValue,this.model(),"Show Indicator Last Value");var L=new TradingView.Action({text:$.t("Indicator Labels",{context:"scale_menu"}),checkable:!0,checked:!1});L.binding=new D14(L,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels");var X=
|
|
new TradingView.Action({text:$.t("Countdown"),checkable:!0,checked:!1});X.binder=new D14(X,this.model().mainSeries().properties().showCountdown,this.model(),"Show Countdown");var G=new TradingView.Action({text:$.t("Symbol Info..."),checkable:!1});G.callbacks().subscribe(null,function(){var b=a.model().mainSeries().symbol();TradingView.SymbolInfoDialog(b,{})});var P=new TradingView.Action({text:$.t("Take Screenshot"),checkable:!1});P.callbacks().subscribe(null,function(){a.D5.takeScreenshot()});
|
|
this._actions={chartProperties:C,timeScaleReset:r,chartReset:e,compareOrAdd:w,compare:u,scalesProperties:A,tmzProperties:y,paneObjectTree:x,insertIndicator:t,insertDrawingTool:b,applyColorTheme:h,applyStudyTemplate:p,symbolSearch:l,showSymbolInfoDialog:G,changeInterval:m,addToWatchlist:n,seriesHide:E,studyHide:E,lineToggleLock:D,lineHide:E,showLeftAxis:K,showRightAxis:Q,scaleSeriesOnly:B,drawingToolbarAction:O,favoriteDrawingToolbar:q,magnetAction:T,stayInDrawingModeAction:I,syncModeAction:M,lockDrawingsAction:S,
|
|
hideAllDrawingsAction:N,hideAllMarks:W,applyTimeZone:k,extendedHours:V,showCountdown:X,showSeriesLastValue:R,showSymbolLabelsAction:aa,showStudyLastValue:U,showStudyPlotNamesAction:L,undo:f,redo:g,viewSourceCode:F,takeScreenshot:P};R77.enabled("charting_library_base")||(this._actions.scriptEditor=v);this.createSessionBreaksActions();this.readOnly()||(e=new TradingView.Action({text:$.t("Remove"),shortcut:"Del"}),e.callbacks().subscribe(this,function(){var a;this.D5&&(a=
|
|
this.D5.activeChartWidget.value());a||(a=this);a.removeSelectedSource()}),f=new TradingView.Action({text:$.t("Stop syncing drawing")}),f.callbacks().subscribe(this,function(){var a;this.D5&&(a=this.D5.activeChartWidget.value());a||(a=this);a.unlinkSelectedLine()}),g=new TradingView.Action({text:$.t("Sync drawing to all charts")}),g.callbacks().subscribe(this,function(){var a;this.D5&&(a=this.D5.activeChartWidget.value());
|
|
a||(a=this);a.copyLineToOtherCharts()}),this._actions.insertDrawingTool=b,this._actions.paneRemoveAllStudies=c,this._actions.paneRemoveAllDrawingTools=d,this._actions.seriesRemove=e,this._actions.studyRemove=e,this._actions.lineRemove=e,this._actions.lineUnlink=f,this._actions.lineCopyToCharts=g,this._actions.format=z,this._actions.lockDrawingsAction=S,this._actions.hideAllDrawingsAction=N,this._actions.hideAllMarks=W,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,A7.prototype.removeAllStudies),
|
|
this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,A7.prototype.removeAllDrawingTools));this._actions.paneObjectTree.callbacks().subscribe(this,A7.prototype.showSourceProperties);this._actions.chartProperties.callbacks().subscribe(this,A7.prototype.showChartProperties);this._actions.insertIndicator.callbacks().subscribe(this,A7.prototype.showIndicators);this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,
|
|
A7.prototype.showScriptEditor);this._actions.compareOrAdd.callbacks().subscribe(this,A7.prototype.showCompareOrAdd);this._actions.compare.callbacks().subscribe(this,A7.prototype.showCompareOrAdd);this._actions.scalesProperties.callbacks().subscribe(this,A7.prototype.showScalesProperties);this._actions.tmzProperties.callbacks().subscribe(this,A7.prototype.showTimezoneProperties);this._updateScalesActions()};
|
|
A7.prototype.executeActionByName=function(a){var b;a:{for(b in this._actions){var c=this._actions[b];if(c.text.toLowerCase()===a.toLowerCase()){b=c;break a}}b=null}b?b.callbacks().fire():console.warn("Unknown action: "+a)};A7.prototype.executeActionById=function(a){if(a in this._actions){var b=this._actions[a];b.checkable&&b.setChecked(!b.checked);this._actions[a].callbacks().fire(b)}else console.warn("Unknown action id: "+a)};
|
|
A7.prototype._updateScalesActions=function(){if(this._actions){for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility();this._update(new A22(A22.FULL_UPDATE))}};A7.prototype.removeAllStudies=function(){this.D0.removeAllStudies()};A7.prototype.removeAllDrawingTools=function(){this.D0.removeAllDrawingTools()};
|
|
A7.prototype.model=function(){return this.D0};A7.prototype.connect=function(){this._handler=function(a){this._onData(a)}.bind(this);this._chartSession.connect(this._handler)};A7.prototype.finishInitWithoutConnect=function(){this._chartSession.disable();this._init();this.chartWidgetInitialized.fire()};
|
|
A7.prototype.update=function(){if(this.D0){for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].update();this._timeAxisWidget.update()}};A7.prototype.paint=function(a){a||(a=new A22(A22.FULL_UPDATE));for(var b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].paint(a.invalidateForPane(b),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(a.fullInvalidation());this._redrawPanes.fire()};
|
|
A7.prototype._makeDefaultGui=function(){this._makeChartWidget();this._makeLoadingScreen();this._makeMasterTable();this._makeTimeAxisWidget();this._adjustSize();this._updateScalesActions();$("*",this._jqMainTable).selectable(!1);this.update();this.paint()};A7.prototype.widget=function(){return this._jqMainDiv};A7.prototype.restoreState=function(a,b){this._adjustSize();this.D0.restoreState(this._content,b);this._setActions()};
|
|
A7.prototype.redrawPanes=function(a){for(a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].paint();this._redrawPanes.fire()};
|
|
A7.prototype.adaptOnChartLogo=function(a){R77.enabled("adapt_onchart_logo_background")&&(a=a||this.D2.paneProperties.background.value(),$(".onchart-custom-logo .wrapper .inner").css("background-color",TradingView.generateColor(a,50)),$(".onchart-tv-logo .wrapper .inner").css("background-color",TradingView.generateColor(a,20)))};
|
|
A7.prototype.setBackgroundColor=function(a){this.adaptOnChartLogo(a.value());this.scaleBackgroundColor=a.value();for(a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].paint(),this._paneWidgets[a].setCursorForTool();this.update();this.paint()};A7.prototype.setScaleLineColor=function(a){this.scaleLineColor=a.value();$.each(this._paneSeparators,function(){this.update()});this.update();this.paint()};
|
|
A7.prototype.setScaleTextColor=function(a){this.scaleTextColor=a.value();this.update();this.paint()};
|
|
A7.prototype._update=function(a){this.performance&&a.start();if(!a||a.fullInvalidation()===A22.FULL_UPDATE){this.D0?this._updateGui():this._adjustSize();this._timeAxisWidget.update();for(var b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b]._state=this.D0.panes()[b],this._paneWidgets[b].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.fullUpdate()}else if(a.fullInvalidation()===A22.LIGHT_UPDATE){this._timeAxisWidget.update();
|
|
for(b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(a.fullInvalidation()===A22.UPDATE_CURSOR_ONLY){for(b=0;b<this._paneWidgets.length;b++)this._paneWidgets[b].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}this.paint(a);this.performance&&(a.end(),this.performance.newChartDraw(a))};
|
|
A7.prototype._createVolumeIfNeeded=function(){R77.enabled("create_volume_indicator_by_default")&&this._options.addVolume&&!this._content&&(R77.enabled("charting_library_base")?this.D0.mainSeries().onCompleted():this.D0.mainSeries().onSymbolResolved()).subscribe(this,function(){var a=this.D0.model().mainSeries().symbolInfo();a&&(a=!a.has_no_volume,!this.containsVolume()&&a?(a=TradingView.factoryDefaults("chartproperties.volumePaneSize"),this.insertStudy("Volume@tv-basicstudies",
|
|
!1,R77.enabled("volume_force_overlay"),void 0,{paneSize:a})):!a&&this.containsVolume()&&(a=this.model().D19().filter(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId})[0],this.D0.model().removeSource(a)))},!R77.enabled("charting_library_base"))};
|
|
A7.prototype._makeDefaultModel=function(){function a(){return TradingView.makeDefaultChartModel(c._chartSession,function(a){if(!(a instanceof A22))throw Error("Invalid mask");c._invalidateMask?c._invalidateMask.merge(a):c._invalidateMask=a;c._draw_planned||(c._draw_planned=!0,requestAnimationFrame(b))},c.D2,c.readOnly(),d,c._studiesMetaData,c._studiesMigrations,c)}function b(){c._draw_planned=!1;!c._inLoadingState&&c._invalidateMask&&(c._invalidateMask=
|
|
c._update(c._invalidateMask))}var c=this;if(this._content&&this._content.timeScale.points)var d={startDate:this._content.timeScale.points.items[0]};if(!this._studiesMetaData)throw Error("Cannot create chart model: studies metainfo is absent");R77.enabled("lean_chart_load")?this.D0=this.D0||a():this.D0=a();this._createVolumeIfNeeded();this._content?(this.restoreState(this._content,this._containsData),R77.enabled("chart_content_overrides_by_deafults")&&(this._defSymbol&&
|
|
this.setSymbol(this._defSymbol),this._defInterval&&this.setResolution(this._defInterval),"undefined"!==typeof this._defStyle&&this.setSeriesStyle(this.D0.mainSeries(),this._defStyle))):this._setActions();this.D0.onTagsChanged().subscribe(this,A7.prototype.onModelTagsChanged);this._updateGui();this._modelCreated.fire(this.D0);this._tagsChanged.fire();var c=this,e=this.D0.mainSeries();this.D0.lineCancelled().subscribe(this,this.onLineCancelled);e.onSymbolNotPermitted().subscribe(null,
|
|
function(a){e.properties().symbol.setValue(a)});this._options.handleSessionErrors&&(e.chartTypeNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showGoProDialog({feature:"kagiRenko"})}),e.intradaySpreadNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showGoProDialog({feature:"intradaySpread"})}),e.customIntervalNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");
|
|
c._options.muteSessionErrors||A83.showGoProDialog({feature:"customIntervals"})}),e.intradayExchangeNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");if(!c._options.muteSessionErrors){var a=e.symbolInfo().listed_exchange;TradingView.TVChartApi.prototype.supportedExchangesList().forEach(function(b){b.value==a&&(a=b.name)});A83.showGoProDialog({feature:"intradayExchange",exchangesButton:window.user.is_pro&&"pro_realtime_trial"!=window.user.pro_plan,exchange:a})}}),
|
|
e.requestingIntradayWhenNotSupported.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||A83.showIntervalMismatchDialog()}),e.requestingResolutionWhenNotSupported.subscribe(null,function(a){e.properties().interval.setValue(a)}),c._options.muteSessionErrors||e.onExtendedHoursNotPermitted().subscribe(null,function(){A83.showGoProDialog({feature:"extendedHours"})}));this._readOnly||!TradingView.D18("paper_trading")&&!R77.enabled("cqg_terminal")||
|
|
this._onWidget||TradingView.Trading.registerChartWidget(this)};A7.prototype._updateGui=function(){this.D0&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())};A7.prototype.setVisibleTimeRange=function(a,b,c){this._chartSession.setVisibleTimeRange(a,b,c)};
|
|
A7.prototype._dateRangeResolutions=function(){return D16.availableTimeFrames(this.D0.mainSeries().symbolInfo(),this.D0.mainSeries().status())||[]};
|
|
A7.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div"));this._jqMainDiv.addClass("chart-widget");TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._withDateRanges&&(R77.enabled("lean_chart_load")?!this._chartControlsBar:1)&&(this._chartControlsBar=$(document.createElement("div")).attr("class","chart-controls-bar").appendTo(this._jqParent),this._seriesControlWidget=new TradingView.SeriesControlWidget({parent:this._chartControlsBar,
|
|
D3:this}));if(this._options.controlBar||R77.enabled("control_bar"))this._controlBarNavigation=new A9(this,this._jqMainDiv,!0);this._containsData||this.createIndicatorImage()};A7.prototype._makeLoadingScreen=function(){R77.enabled("lean_chart_load")?this.screen||(this.screen=new A7.LoadingScreen(this,this._jqParent)):this.screen=new A7.LoadingScreen(this,this._jqMainDiv)};
|
|
A7.prototype.setSymbol=function(a,b){if(this.D0){var c=this.D0.mainSeries();if(b||!c.symbolSameAsCurrent(a)||R77.enabled("same_data_requery"))this.D0.setSelectedSource(null),this.D0.setScreenChartProperty(c.properties().symbol,a,this,"Change Symbol",R77.enabled("same_data_requery"))}else this.D2.mainSeriesProperties.merge({symbol:a})};
|
|
A7.prototype.getSymbol=function(a){var b;return(b=this.D0?this.D0.mainSeries().properties():this.D2.mainSeriesProperties)?a&&b.shortName&&b.shortName.value()?b.shortName.value():b.symbol.value():""};
|
|
A7.LoadingScreen=function(a,b){this._cw=a;this.$element=$('<div class="chart-loading-screen">');this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element);this.$element.appendTo(b);this._showed=!1;this._cw.withModel(this,this._connectToModel)};
|
|
A7.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().onDataLoaded().subscribe(this,function(a){switch(a.method){case "symbol_error":"permission denied"!==a.params[1]&&this.hide();break;case "series_completed":this.hide()}})};A7.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0;this._showed||this._cw.isDetached||(this._showed=!0,this._show());return $.Deferred().resolve()};
|
|
A7.LoadingScreen.prototype._show=function(){var a=this._cw.properties().paneProperties.background.value();this.$shield.css("background",a);this.$element.addClass("fade")};A7.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState;this._showed&&this._hide()};A7.LoadingScreen.prototype._hide=function(){this._showed=!1;this.$element.removeClass("fade")};A7.LoadingScreen.prototype.$canvas=null;
|
|
A7.LoadingScreen.prototype.context=null;A7.prototype._makeMasterTable=function(){this._jqMainTable=$(document.createElement("table"));this._jqMainTable.appendTo(this._jqMainDiv);this._jqMainTable.addClass("chart-markup-table");this._jqMainTable.attr("cellpading","0");this._jqMainTable.attr("cellspacing","0")};
|
|
A7.prototype._makePaneWidgetsAndSeparators=function(){for(var a=this.D0.panes(),b=a.length,c=this._paneWidgets.length,d=b;d<c;d++){var e=this._paneWidgets.pop();e.jqRow.remove();e.jqRow.find("*").remove();e.destroy();var f=this._paneSeparators.pop();f&&f.jqRow.remove()}for(d=c;d<b;d++)e=new A53(this,a[d],this._onWidget),this._paneWidgets.push(e),0<d&&(f=new A52(this,d-1,d),this._paneSeparators.push(f),this._timeAxisWidget?f.jqRow.insertBefore(this._timeAxisWidget.jqRow):
|
|
f.jqRow.appendTo(this._jqMainTable)),this._timeAxisWidget?e.jqRow.insertBefore(this._timeAxisWidget.jqRow):e.jqRow.appendTo(this._jqMainTable);for(d=0;d<b;d++)c=a[d],e=this._paneWidgets[d],e.state()!==c&&e.setState(c);for(d=b;d--;)this._paneWidgets[d].updateControls()};A7.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new A73(this,this._onWidget),this._timeAxisWidget.jqRow.appendTo(this._jqMainTable))};
|
|
A7.prototype.insertStudyOrShowDialog=function(a){if(this.isSymbolicStudy(a)){var b=defaults("study_"+a.id).description;A83.showAddSymbolDialog(this,{title:b,okButtonTitle:$.t("Apply"),callback:function(b,d){var e={inputs:{symbol:b}};TradingView.trackEvent("GUI","Add Study");this.model().insertStudy(a,e,d)}.bind(this)})}else this.hasConfirmInputs(a)?(b=defaults("study_"+a.id).description,A83.showConfirmInputsDialog(this,a,{title:b,okButtonTitle:$.t("Apply"),callback:function(b){TradingView.trackEvent("GUI",
|
|
"Add Study");this.model().insertStudy(a,b,!1)}.bind(this)})):TradingView.Study.isPointsBasedStudy(a.id)?(b=TradingView.Study.lineToolNameForPointsBasedStudy(a.id),TradingView.drawingState.tool.setValue(b)):(TradingView.trackEvent("GUI","Add Study"),this.insertStudy(a.id,!0,"Volume@tv-basicstudies"==a.id))};A7.prototype.hasConfirmInputs=function(a){a=a.inputs;if(void 0===a)return!1;for(var b=0;b<a.length;++b){var c=a[b];if(void 0!==c.confirm&&c.confirm)return!0}return!1};
|
|
A7.prototype.isSymbolicStudy=function(a){switch(a.id){case "Overlay@tv-basicstudies":case "CorrelationCoefficient@tv-basicstudies":return!0;default:return!1}};A7.prototype.isPointsBasedStudy=function(a){return TradingView.Study.isPointsBasedStudy(a.id)};
|
|
A7.prototype.insertStudy=function(a,b,c,d,e){a=TradingView.StudyMetaInfo.findStudyMetaInfo(this._studiesMetaData,a);assert(!a.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!");d=d?{inputs:d}:{};e&&(d=$.extend(d,e));b?this.D0.insertStudy(a,d,c):this.D0.model().insertStudy(a,d,c)};A7.prototype.insertStudyStub=function(a){return this.model().insertStudyStub(a)};A7.prototype.removeStudyStub=function(a){return this.model().removeStudyStub(a)};
|
|
A7.prototype._adjustSize=function(){var a=0,b=0,c=0;$.each(this._paneWidgets,function(){a=Math.max(this.lhsPriceAxisWidget.optimalWidth(),a);b=Math.max(this.rhsPriceAxisWidget.optimalWidth(),b);c+=this.stretchFactor()});var d=this._rect,e=d.w-a-b,f=this._paneSeparators.length,g=A52.HEIGHT,h=this._timeAxisWidget.optimalHeight(),k=(d.h-g*f-h)/c;this._jqMainTable.width(d.w);this._jqMainTable.height(d.h);var l=this;$.each(this._paneWidgets,function(c){l.D0&&
|
|
(this._state=l.D0.panes()[c]);c=Math.max(Math.round(this.stretchFactor()*k),2);this.setPriceAxisSize(A54.LHS,new A61(a,c));this.setPriceAxisSize(A54.RHS,new A61(b,c));this.setSize(new A61(e,c));l.D0&&this.state()&&l.D0.setPaneHeight(this.state(),c)});this._timeAxisWidget.setSize(new A61(e,h),new A61(a,h),new A61(b,h));this.D0&&this.D0.setWidth(e);this.maxLhsPriceAxisWidth!==
|
|
a&&(this.maxLhsPriceAxisWidth=a,this.lhsPriceAxisWidthChanged.fire(a));this.maxRhsPriceAxisWidth!==b&&(this.maxRhsPriceAxisWidth=b,this.rhsPriceAxisWidthChanged.fire(b))};
|
|
A7.prototype._onData=function(a){switch(a.method){case "connected":this._onConnection();break;case "disconnected":this._onDisconnect();break;case "reconnect_bailout":this._reconnectBailout.fire();break;case "connection_error":this._onConnectionError(a.params[0]);break;case "critical_error":this._disconnected.fire(!0);break;default:this.D0.onData(a)}};A7.prototype._nextMetadataId=1;
|
|
function _applyLocalizationToMetadata(a){a.description_localized=$.t(a.description,{context:"study"});return a}
|
|
A7.prototype._onConnection=function(){this._online=!0;this.D0?(this.D0.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):(R77.enabled("charting_library_base")?this._chartSession.requestMetadata("metadata_"+A7._nextMetadataId,function(a){a=a.params[1];for(var b=0;b<a.length;++b)TradingView.StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,_applyLocalizationToMetadata(a[b]));this._init();this.chartWidgetInitialized.fire()}.bind(this)):
|
|
(this._chartSession.requestMetadata("metadata_"+A7._nextMetadataId,function(a){this._onStudiesMetadata(a)}.bind(this)),"undefined"!==typeof window.scriptLib&&(this._tvScriptsRequestDfd=window.scriptLib.requestBuiltinAndUserScripts())),A7._nextMetadataId++)};A7.prototype._onDisconnect=function(){this.D0&&this.D0.disconnect();this._online=!1;this.update();this.paint();this._disconnected.fire()};
|
|
A7.prototype.studiesMetaData=function(){return this.D0.studiesMetaData()};A7.prototype._onConnectionError=function(a){this._disconnected.fire()};A7.prototype.getTimeScale=function(){return this._timeAxisWidget};A7.prototype.setSeriesStyle=function(a,b){this.D0.setProperty(a.properties().style,b)};
|
|
A7.prototype.showSourceProperties=function(a){(new TradingView.ObjectTreeDialog({D3:this},this.D0)).show()};A7.prototype.showChartProperties=function(a){return(new TradingView.EditObjectDialog(this.D0.mainSeries(),this.D0)).show()};A7.prototype.showScriptEditor=function(){TradingView.ScriptEditorWidget.open()};A7.prototype.showCompareOrAdd=function(){(new TradingView.CompareDialog(this.D5)).show()};
|
|
A7.prototype.showIndicators=function(){window.studyMarket.isVisible()?window.studyMarket.hide():window.studyMarket.show()};A7.prototype.showScalesProperties=function(a){return(new TradingView.EditObjectDialog(this.D0.mainSeries(),this.D0)).show({selectScales:!0})};A7.prototype.showTimezoneProperties=function(){return(new TradingView.EditObjectDialog(this.D0.mainSeries(),this.D0)).show({selectTmz:!0})};
|
|
A7.prototype.removeSelectedSource=function(){var a=this.D0.selectedSource();!a||a===this.D0.mainSeries()||a===this.D0.lineBeingCreated()||a instanceof R96||a instanceof TradingView.ESDStudyBase||this.D0.removeSelectedSource()};A7.prototype.unlinkSelectedLine=function(){var a=this.D0.selectedSource();a instanceof R47&&this.D0.unlinkLine(a)};
|
|
A7.prototype.copyLineToOtherCharts=function(){var a=this.D0.selectedSource();a instanceof R47&&this.D0.copyToOtherCharts(a)};A7.prototype.hideSelectedObject=function(){var a=this.D0.selectedSource();a&&this.D0.setProperty(a.properties().visible,!1,"Hide "+a.title())};
|
|
A7.prototype.toggleLockSelectedObject=function(){var a=this.D0.selectedSource();if(a){var b=a.properties().frozen.value();this.D0.setProperty(a.properties().frozen,!b,(b?"Unlock":"Lock")+" "+a.title())}};A7.prototype.editSelectedObject=function(a){if(a=this.D0.selectedSource())return(new TradingView.EditObjectDialog(a,this.D0)).show()};
|
|
A7.prototype.openSelectedObjectSource=function(a){(a=this.D0.selectedSource())&&a.metaInfo&&(a=a.metaInfo())&&a.TVScriptSourceCode&&a.scriptIdPart&&TradingView.ScriptEditorWidget&&TradingView.ScriptEditorWidget.open({scriptSource:a.TVScriptSourceCode,scriptIdPart:a.scriptIdPart})};A7.prototype.resetPriceAxisOptimalWidth=function(a){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(a)});this._redrawPanes.fire()};
|
|
A7.prototype.adjustPriceAxisWidth=function(a){this.resetPriceAxisOptimalWidth(a);this._adjustSize()};A7.prototype.setPriceAxisVisible=function(a,b){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(a,b)});this._timeAxisWidget.setStubVisible(a,b);this._adjustSize();this._redrawPanes.fire()};A7.prototype.setTimeAxisVisible=function(a){this._timeAxisWidget.setVisible(a);this._adjustSize()};
|
|
A7.prototype.isTextTool=function(a){switch(a){case "LineToolBalloon":case "LineToolText":case "LineToolTextAbsolute":case "LineToolCallout":case "LineToolNote":case "LineToolNoteAbsolute":return!0}return!1};A7.prototype.tags=function(){return this.D0?this.D0.calculateDefaultTags():[]};A7.prototype.state=function(a){return this.D0.state(a)};A7.prototype.asyncState=function(a){return this.D0.asyncState(a)};
|
|
A7.prototype.metaInfo=function(){var a=this._metaInfo;this.D0&&(a.systemTags=this.D0.calculateDefaultTags());return a};
|
|
A7.prototype.image=function(){for(var a=document.createElement("canvas"),b=a.getContext("2d"),c=0,d=this._timeAxisWidget.size.h,e,f=this.properties().scalesProperties.lineColor.value(),g=0;g<this._paneWidgets.length;g++)(e=this._paneWidgets[g])&&e.state()&&(e.state().recalculate(!0),0===g&&(c=e.lhsPriceAxisWidget.size.w+e.size.w+e.rhsPriceAxisWidget.size.w),d+=e.size.h);d+=this._paneWidgets.length-1;this._update();a.width=c+10;a.height=d+25+10;b.fillStyle="#F2F5F8";b.fillRect(0,
|
|
0,a.width,a.height);var h=30,g=this.mainSeriesQuotesAndMetainfo();g.ohlc&&(g="{0} O:{1} H:{2} L:{3} C:{4}".format(g.meta.symbol,g.ohlc[0],g.ohlc[1],g.ohlc[2],g.ohlc[3]),b.fillStyle="#000",b.font="12px Verdana, Arial",b.fillText(g,5,20));for(g=0;g<this._paneWidgets.length;g++)e=this._paneWidgets[g],b.drawImage(e.lhsPriceAxisWidget.canvas,5,h),b.drawImage(e.canvas,5+e.lhsPriceAxisWidget.size.w,h),e.statusWidget().renderTo(b,10,h+5),b.drawImage(e.rhsPriceAxisWidget.canvas,5+e.lhsPriceAxisWidget.size.w+
|
|
e.size.w,h),h+=e.size.h,g<this._paneWidgets.length-1&&(b.fillStyle=f,b.fillRect(5,h,c,1),h++);b.drawImage(this._timeAxisWidget.lhsCanvas,5,h);b.drawImage(this._timeAxisWidget.canvas,5+e.lhsPriceAxisWidget.size.w,h);b.drawImage(this._timeAxisWidget.rhsCanvas,5+e.lhsPriceAxisWidget.size.w+e.size.w,h);b.lineWidth=1;b.strokeStyle="#000";b.strokeRect(5.5,30.5,c-1,d-1);return a};
|
|
A7.prototype.images=function(){TradingView.printing=!0;var a=this.D0.selectedSource();this.D0.setSelectedSource(null);for(var b=[],c=0;c<this._paneWidgets.length;c++){var d=this._paneWidgets[c];d.paint(A22.LIGHT_UPDATE,this._onWidget);var e=d.image(this._onWidget);e.containsMainSeries=this._paneWidgets[c].containsMainSeries();e.studies=[];for(var d=d.state().D19(),f=0;f<d.length;f++){var g=d[f];g instanceof TradingView.Study?g.properties().visible.value()&&
|
|
g.statusView()&&this.properties().paneProperties.legendProperties.showStudyTitles.value()&&e.studies.push(g.statusView().text()):g instanceof TradingView.Series&&this.properties().paneProperties.legendProperties.showSeriesTitle.value()&&(e.mainSeriesText=g.statusView().text())}b.push(e);c<this._paneWidgets.length-1&&b.push(this._paneSeparators[c].image())}this._timeAxisWidget.paint(A22.LIGHT_UPDATE);c=this._timeAxisWidget.image();TradingView.printing=!1;this.D0.setSelectedSource(a);
|
|
this.D0.D20(new A22(A22.LIGHT_UPDATE));a=this.mainSeriesQuotesAndMetainfo();return{panes:b,timeAxis:c,colors:{text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}};
|
|
A7.prototype.mainSeriesQuotesAndMetainfo=function(){var a,b,c,d=this.D0.mainSeries();if(d){var e=function(a){return null==a?"":d.formatter().format(a)+""},f=function(a){return null==a?"":a+""};a={resoluton:d.interval(),symbol:d.symbol()};var g=d.symbolInfo();g&&(a.symbol=g.full_name,a.description=g.description,a.exchange=g.exchange);(g=d.bars().last())&&(b=g.value.slice(1,5).map(e));d.quoteData&&(c={change:e(d.quoteData.change),changePercent:f(d.quoteData.change_percent),
|
|
last:e(d.quoteData.last_price)})}return{meta:a,ohlc:b,quotes:c}};A7.prototype.onTagsChanged=function(){return this._tagsChanged};A7.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()};A7.prototype.destroy=function(){$(window).unbind("resize",this._resizeHandler);this.D0.model().destroy();this.performance&&this.performance.destroy();this._chartSession.stopSession()};A7.prototype.title=function(){return $.t("Chart Properties")};
|
|
A7.prototype.symbolProperty=function(){return this.D0.mainSeries().properties().shortName?this.D0.mainSeries().properties().shortName:this.D0.mainSeries().properties().symbol};
|
|
A7.prototype.loadContent=function(a,b){this.screen.show();for(var c=this.D0.model().D19(),d=0;d<c.length;d++){var e=c[d];e!=this.D0.mainSeries()&&this.D0.model().removeSource(e,!0)}this._jqMainDiv&&(this._jqMainDiv.remove(),this._jqMainDiv=null);this._timeAxisWidget=null;this._paneWidgets=[];D16.purgeCache();this.D0.mainSeries().purgeSymbolInfo();this._setContent(a);b&&(window.D6.metaInfo.id.setValue(b.uid),window.D6.metaInfo.uid.setValue(b.uid),
|
|
window.D6.metaInfo.name.setValue(b.name));for(var f,d=0;d<a.panes.length;++d)for(c=0;c<a.panes[d].sources.length;++c)if(a.panes[d].sources[c].state.symbol){f=a.panes[d].sources[c].state;break}if(!f)throw"An error occured while determining main series ion the chart";this.D2.mainSeriesProperties.merge({visible:!0,symbol:f.symbol,timeframe:"",onWidget:this._onWidget,interval:f.interval||"D",style:f.style});this._init();A45.interval.setValue(f.interval);A77.clearStack();
|
|
this._seriesControlWidget&&this._seriesControlWidget.updateUI();this.createLogo&&!R77.enabled("move_logo_to_main_pane")&&this.createLogo(void 0,this._jqMainDiv)};
|
|
A7.prototype._setContent=function(a){a&&a.panes.forEach(function(a){a.sources=a.sources.filter(function(a){return a?"MainSeries"==a.type?!0:a.points&&a.points.some(function(a){return null===a.time_t||!isFinite(a.time_t)})?(TradingView.logNormalChart("Dropped invalid "+a.type+". Reason: non-numeric point time"),!1):!0:!1});var c=function(c){return a.sources&&a.sources.some(function(a){return a.id==c})};a.leftAxisSources&&(a.leftAxisSources=a.leftAxisSources.filter(c));a.rightAxisSources&&
|
|
(a.rightAxisSources=a.rightAxisSources.filter(c))});this._content=a};A7.prototype._contentSeriesProperties=function(){if(this._content)for(var a=this._content.panes.length;0<a--;)for(var b=this._content.panes[a].sources,c=b.length;0<c--;)if("MainSeries"===b[c].type)return b[c].state};
|
|
A7.prototype.updateUndoRedo=function(){A77.undoStack().isEmpty()?this.actions().undo.setEnabled(!1):this.actions().undo.setEnabled(!0);A77.redoStack().isEmpty()?this.actions().redo.setEnabled(!1):this.actions().redo.setEnabled(!0)};
|
|
A7.prototype.createSessionBreaksActions=function(a){var b,c=this,d=function(){b=new TradingView.Action({text:$.t("Session Breaks"),checkable:!0});b.binder=new D14(b,c.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,c.model(),"Session Breaks");c._actions.sessionBreaks=b};c.model().mainSeries().sessionsStudy()?d():c.model().mainSeries().onSessionsStudyCreated().subscribe(c,function(){d()})};
|
|
A7.prototype.updateActionForIntradayOnly=function(a){!a||!a instanceof TradingView.Action||a.setEnabled(!!this.model().mainSeries().isIntradayInterval())};A7.prototype.withModel=function(a,b){this.model()?b.call(a):this.modelCreated().subscribe(a,b,!0)};A7.prototype.containsVolume=function(){return this.model().D19().some(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId})};
|
|
A7.prototype.containsStudy=function(a){return this.D0?this.D0.D19().some(function(b){if(!(b instanceof TradingView.Study))return!1;b=b.metaInfo();return b.id===a||b.fullId===a}):!1};A7.prototype.containsSessions=function(){return this.model().D19().some(function(a){return a instanceof TradingView.Study&&"Sessions"==a.metaInfo().shortId})};A7.prototype.isSmall=function(a){return this.constructor.isSmall(this._jqParent)};
|
|
A7.isSmall=function(a){return 550>a.width()||300>a.height()};A7.prototype.onWidget=function(){return this._onWidget};A7.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()};A7.prototype.widgetCustomer=function(){return this._widgetCustomer};A7.prototype.resize=function(){this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()};
|
|
A7.prototype.chartSession=function(){return this._chartSession};A7.prototype.maxLhsPriceAxisWidth=0;A7.prototype.maxRhsPriceAxisWidth=0;A7.prototype.GUIResetScales=function(){TradingView.trackEvent("GUI","Reset Scales");this.model()&&(this._containsData&&this.model().chartModel().restoreAxisState(this._content),this.model().resetScales())};A7.prototype.onLineCancelled=function(){TradingView.drawingState.resetToCursor()};
|
|
A7.prototype.createIndicatorImage=function(){var a=this;this.indicatorImage=$('<span class="chart-status-picture"></span>').appendTo(this._jqMainDiv);a.onWidget()||$('<span class="bats-warning"></span>').appendTo(this.indicatorImage).on("click",function(){TradingView.isProRealtime()||(location.href="/gopro/")}).blueTooltip($.t("<p><b>Warning:</b> This symbol is provided by BATS electronic exchange.</p><p>BATS real-time data is different from the “official” data and offers approximate volumes with fewer price updates.</p><p>If those differences are important to your analysis then you'll want to use our PRO service which allows you to subscribe to real-time data from the exchanges.</p>"),
|
|
"bottom","double-width");R77.enabled("display_market_status")&&(this.indicatorText=$('<span class="series-status-text"><span class="dot"></span> <span class="text"></span> <span class="market-status"></span></span>').appendTo(this.indicatorImage));a.withModel(null,function(){var b=a.D0.mainSeries();b.onStatusChanged().subscribe(null,a.updateIndicatorImage.bind(a));b.marketStatus.subscribe(a.updateIndicatorImage.bind(a));a.updateIndicatorImage()});a.rhsPriceAxisWidthChanged.subscribe(a,
|
|
a.updateIndicatorImagePosition);a.updateIndicatorImagePosition()};
|
|
A7.prototype.updateIndicatorImage=function(){function a(a,b){return f.hasOwnProperty(a)?f[a]:b}var b=this.indicatorImage;if(this.indicatorImage){var c=this.D0;if(c){var c=c.mainSeries(),d=c.status(),e=this._statusDetails(),f=null,f=e.hasOwnProperty(d)?e[d]:e.defaults,d=a("showBatsWarn",!0),e=(e=c.symbolInfo())&&e.full_name,d=!!(d&&e&&A68.hasBatsSymbols(e));b.find(".bats-warning").toggleClass("warn-bats",d);b.attr("title",a("title",""));this._updateDataAndMarketStatus(c.marketStatus.value(),
|
|
c.status())}}};
|
|
A7.prototype._statusDetails=function(){this.__statusDetails||(this.__statusDetails={},this.__statusDetails[TradingView.Series.STATUS_SNAPSHOT]={className:"snapshot",text:$.t(""),showBatsWarn:!1,priority:1},this.__statusDetails[TradingView.Series.STATUS_LOADING]=this.__statusDetails[TradingView.Series.STATUS_RESOLVING]={className:"loading",text:$.t("loading data"),priority:1},this.__statusDetails[TradingView.Series.STATUS_INVALID_SYMBOL]={className:"invalid",text:$.t("invalid symbol"),showBatsWarn:!1,
|
|
priority:1},this.__statusDetails[TradingView.Series.STATUS_OFFLINE]={className:"connecting",text:$.t("retrying"),priority:1},this.__statusDetails[TradingView.Series.STATUS_EOD]=this.__statusDetails[TradingView.Series.STATUS_PULSE]={className:"eod",text:$.t("eod data"),priority:1},this.__statusDetails[TradingView.Series.STATUS_DELAYED]={className:"delayed",title:$.t("Quotes are delayed by 10 min and updated every 30 seconds"),text:$.t("eod delayed"),priority:1},this.__statusDetails[TradingView.Series.STATUS_DELAYED_STREAMING]=
|
|
{className:"delayed-streaming",text:$.t("delayed"),priority:1},this.__statusDetails[TradingView.Series.STATUS_READY]=this.__statusDetails.defaults={className:"realtime",text:$.t("realtime"),priority:-1},this.__statusDetails.pre_market={text:$.t("pre-market"),className:"pre-market",priority:0},this.__statusDetails.post_market={text:$.t("post-market"),className:"post-market",priority:0},this.__statusDetails.out_of_session={text:$.t("closed"),className:"out-of-session",priority:0},this.__statusDetails.market=
|
|
this.__statusDetails.defaults);return this.__statusDetails};A7.prototype._updateDataAndMarketStatus=function(a,b){if(void 0!==this.indicatorText){var c=this._resultingStatusRecord(a,b);this.indicatorText.removeClass().addClass("series-status-text "+c.className);this.indicatorText.find(".text").html(c.text)}};
|
|
A7.prototype._resultingStatusRecord=function(a,b){if(a){var c=this._statusDetails()[a],d=this._statusDetails()[b];d||(d=this._statusDetails().defaults);return d.priority>c.priority?d:c}return this._statusDetails()[b]};A7.prototype.updateIndicatorImagePosition=function(){var a=this.indicatorImage;this.indicatorImage&&a.css("marginRight",this.maxRhsPriceAxisWidth)};
|
|
A7.prototype._startSpinner=function(a){"function"===typeof Spinner&&!this._spinner&&(a=$(a).get(0))&&(this._spinner=(new Spinner({lines:15,length:0,width:6,radius:20,corners:1,rotate:0,direction:1,color:"#333",speed:.75,trail:74,shadow:!1,hwaccel:!1,className:"spinner",top:"50%",left:"50%",zIndex:0})).spin(a))};A7.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned};
|
|
A7.prototype.getLastPaneLeftBottom=function(){var a=this._paneWidgets[this._paneWidgets.length-1].jqPane,b=a.offset();return{left:b.left,bottom:$(document.body).height()-b.top-a.height()}};
|
|
R77.enabled("datasource_copypaste")&&(A7.prototype.onAppClipboardPaste=function(a,b){TradingView.logDebugChart("[[paste]]");this.D0&&this.D0.pasteSourceFromClip(a,b)},A7.prototype.onAppClipboardCopy=function(a){TradingView.logDebugChart("[[copy]]");this.D0&&this.D0.copySourceToClip(a||this.D0.selectedSource())},A7.prototype.onAppClipboardCut=function(a){TradingView.logDebugChart("[[cut]]");this.D0&&this.D0.cutSourceToClip(a||
|
|
this.D0.selectedSource())});
|
|
A7.Performance=function(a){this.chartDrawTypes=["cursor","light","full","light_partial"];this.chartDraw={};this.lastValues={};this.cma={};this.slowReports=[];this.D3=a;this.chartDrawTypes.forEach(function(a){this.chartDraw[a]=this.emptyStatObj();this.lastValues[a]=[]}.bind(this));this.initialTimeout=setTimeout(function(){this.checkpointInterval=setInterval(this.performanceCheckPoint.bind(this),1E3)}.bind(this),3E3);this.cmaFilterHigh=60;this.cmaFilterLow=15;this.thresholdEmissionsRatio=
|
|
3;this.maxDroppedEmissions=1};A7.Performance.prototype.emptyStatObj=function(){return{totalDuration:0,totalWait:0,count:0,invalidations:0}};
|
|
A7.Performance.prototype.performanceCheckPoint=function(){for(var a=0;a<this.chartDrawTypes.length;a++){var b=this.chartDrawTypes[a],c=$.extend({avgDuration:this.chartDraw[b].count?this.chartDraw[b].totalDuration/this.chartDraw[b].count:0,avgWait:this.chartDraw[b].count?this.chartDraw[b].totalWait/this.chartDraw[b].count:0},this.chartDraw[b]);this.lastValues[b].unshift(c);this.lastValues[b]=this.lastValues[b].slice(0,10);0<c.count&&(this.cma[b]?c.avgDuration>this.cma[b].durationHigh*
|
|
this.thresholdEmissionsRatio&&this.cma[b].droppedEmissions<this.maxDroppedEmissions?this.cma[b].droppedEmissions++:(this.cma[b].droppedEmissions=0,this.cma[b].durationHigh+=(c.avgDuration-this.cma[b].durationHigh)/this.cmaFilterHigh,this.cma[b].durationLow+=(c.avgDuration-this.cma[b].durationLow)/this.cmaFilterLow,this.cma[b].waitHigh+=(c.avgWait-this.cma[b].waitHigh)/this.cmaFilterHigh,this.cma[b].waitLow+=(c.avgWait-this.cma[b].waitLow)/this.cmaFilterLow,this.checkPerformance(b,this.cma[b],this.lastValues[b])):
|
|
this.cma[b]={durationHigh:c.avgDuration,durationLow:c.avgDuration,waitHigh:c.avgWait,waitLow:c.avgWait});this.chartDraw[b]=this.emptyStatObj()}this.flushReport();this.draw()};A7.Performance.prototype.checkPerformance=function(a,b,c){b.durationLow-b.durationHigh>Math.max(20,b.durationHigh)&&!b.slowdownDurationDetected&&(this.slowReports.push({type:a,param:"duration",cma:b,cmaDifference:b.durationLow-b.durationHigh,values:c}),b.slowdownDurationDetected=!0)};
|
|
A7.Performance.prototype.flushReport=function(){if(this.slowReports.length){var a=this.D3.model().undoStack().m_commands.toArray(),a=a.slice(a.length-20,a.length).reduce(function(a,c){return a+c.text()+"\n"},"");console.warn({slowReports:this.slowReports,history:a});A72.sendReport("slow_page",{slowReports:this.slowReports,history:a},!0,!0);this.slowReports=[]}};
|
|
A7.Performance.prototype.newChartDraw=function(a){var b=a._invalidationLevel,c=this.textLvl(b),d;for(d in a._invalidatedPanes)a._invalidatedPanes[d]>b&&(b=a._invalidatedPanes[d],c=this.textLvl(b)+"_partial");this.addStats(c,a._timeCreated,a._timeStart,a._timeEnd,a._documentHidden,a._mergeCount)};A7.Performance.prototype.addStats=function(a,b,c,d,e,f){e||(a=this.chartDraw[a],a.totalDuration+=d-c,a.totalWait+=c-b,a.invalidations+=1+f,a.count++)};
|
|
A7.Performance.prototype.draw=function(){if(TradingView.getDisplayFpsLevel()==TradingView.FPS_SHOw_FULL){if(this.fpsCanvas)this.fpsCanvas.width=360;else{if(!this.D3._jqMainTable)return!1;this.fpsCanvas=TradingView.addCanvasTo(this.D3._jqMainTable.parent(),new A61(360,80));this.ctx=this.fpsCanvas.getContext("2d");$(this.fpsCanvas).css({position:"absolute",bottom:"23px",right:"65px"})}var a=this.ctx;a.font='10px "Lucida Console", monospace';for(var b=
|
|
["cursor","light","light_partial","full"],c=0,d=0;d<b.length;d++){var e=b[d],f=this.lastValues[e][0];a.fillText(e,90*c,15);a.fillText("fps "+f.count,90*c,30);a.fillText("inv "+f.invalidations,90*c,40);a.fillText("afd "+f.avgDuration.toFixed(2),90*c,50);a.fillText("afw "+f.avgWait.toFixed(2),90*c,60);this.cma[e]&&(a.fillText("dda "+(this.cma[e].durationLow-this.cma[e].durationHigh).toFixed(0)+" "+this.cma[e].durationLow.toFixed(0)+"/"+this.cma[e].durationHigh.toFixed(0),90*c,70),a.fillText("wda "+
|
|
(this.cma[e].waitLow-this.cma[e].waitHigh).toFixed(0)+" "+this.cma[e].waitLow.toFixed(0)+"/"+this.cma[e].waitHigh.toFixed(0),90*c,80));c++}}else this.fpsCanvas&&($(this.fpsCanvas).remove(),delete this.fpsCanvas,delete this.ctx)};A7.Performance.prototype.textLvl=function(a){switch(a){case 1:return"cursor";case 2:return"light";case 3:return"full"}};A7.Performance.prototype.destroy=function(){clearTimeout(this.initialTimeout);clearInterval(this.checkpointInterval)};A8=function(a){function b(){M&&M(I);var a=C||{};C={width:I.width(),height:I.height()};var b=I[0];if(window.self!==window.top&&b.offsetWidth<b.clientWidth&&100>b.getBoundingClientRect().width){var d=Math.round(100*b.getBoundingClientRect().width),b=Math.round(100*b.getBoundingClientRect().height);C={width:d,height:b}}d=!1;a.height===C.height&&a.width===C.width&&A||(d=!0);if(d)if(B)c(x);else for(a=0;a<A.count;a++)c(a)}function c(a){var b=u[a];if(b){var c;c=B?A8.LayoutTemplates.s.sizer(0,
|
|
C,r,t):A.sizer(a,C,r,t);u[a].wrap.css({width:Math.max(c.width||0,0),height:Math.max(c.height||0,0),top:Math.max(c.top||0,0),left:Math.max(c.left||0,0)});b.metrics&&b.metrics.width===c.width&&b.metrics.height===c.height||(b.metrics=c,b.D3&&b.D3.resize())}}function d(a){a=$.extend({D6:p},a||{});var b,d=$(document.createElement("div")).addClass("chart-container").appendTo(I).css({position:"absolute",overflow:"hidden"});d.on("mousedown touchstart",function(){v.setValue(b)});
|
|
var e=u.length,h={wrap:d};u.push(h);c(e);a.jqParent=d;h.D3=b=new A7(a);p.firstWidgetInitialized||b.chartWidgetInitialized.subscribe(null,function(){try{window.JsBridge.sendEvent("chart_widget_initialized")}catch(a){}p.firstWidgetInitialized=!0},!0);a.containsData?b.finishInitWithoutConnect():b.connect();f();g();return b}function e(a,b){y=a;B=b;J.setValue(B);A=A8.LayoutTemplates[a];var e=A.count;C={width:I.width(),height:I.height()};for(var g=
|
|
0;g<e||g<u.length;g++)(b?x===g:g<e)?(u[g]?(I.append(u[g].wrap),u[g].D3.isDetached=!1):d($.extend({},O,D.shift()||(v.value()?{content:v.value().state()}:null)||{})),u[g].wrap.toggleClass("multiple",1<e),c(g)):u[g]&&(u[g].D3.isDetached=!0,u[g].wrap.detach());f()}function f(){var a=Math.min(A.count,u.length)-1;if(0>a)v.deleteValue();else{var b=x;0>b&&(b=0);b>a&&(b=a);v.setValue(u[b].D3)}}function g(){for(var a=u.length;a--;){var b=a===x;u[a].wrap.toggleClass("active",b).toggleClass("inactive",
|
|
!b)}}function h(a){var b=a.mainSeries().properties();b.style.subscribe(null,k);k(b.style);a.model().onSelectedSourceChanged().subscribe(null,l);l(a.selectedSource())}function k(a){N.setValue(a.value())}function l(a){W.setValue(a)}function m(a){for(var b=!1,c=0;c<u.length;c++){var d=u[c].D3;if(d.model().mainSeries().properties().symbol.value()!==a||R77.enabled("same_data_requery"))b||(A77.beginUndoMacro("Change Symbol"),b=!0),d.setSymbol(a)}b&&A77.endUndoMacro()}
|
|
function n(a){if("s"===a||window.user&&user.is_pro||O.containsData||w)return a;A83.showGoProDialog({feature:"multipleCharts"});return"s"}var p=this,r=2,t=0,v=new WatchedValue,w=!1,u=[],x=0,C=null,A=null,y="s",D=[],E=new WatchedValue(!1),z=new WatchedValue(!1),F=new WatchedValue(TVSettings.getBool("chart.syncCrosshair",!0)),K=F.value();F.subscribe(function(a){K=a=!!a;TVSettings.setValue("chart.syncCrosshair",a)});var Q=new WatchedValue(y),B=!1,J=new WatchedValue(B);a=a||{};"padding"in a&&(r=
|
|
a.padding);"edge"in a&&(t=a.edge);var O=a.widgetOptions||{};O.readOnly&&(w=!0);var q=a.metaInfo||{},T={id:new WatchedValue(q.id),name:new WatchedValue(q.name),description:new WatchedValue(q.description),username:new WatchedValue(q.username),uid:new WatchedValue(q.uid)},I=$(a.jqParent).eq(0),M=a.onResize,S=new Delegate;this.updateLayout=b;var N=new WatchedValue,W=new WatchedValue;N.subscribe(function(a){var b=v.value();if(b&&(b=b.model())){var c=b.mainSeries().properties().style;c.value()!==a&&b.setChartStyleProperty(c,
|
|
a,"Change Series Style")}});var V=null;v.subscribe(function(a){if(a){for(var b,c=u.length;c--;)if(u[c].D3===a){b=c;break}if(!isFinite(b))throw Error("Cannot make detached ChartWidget active");x!==b&&(x=b,g());V!==a&&(V&&(V.modelCreated().unsubscribe(null,h),b=V.model())&&(b.mainSeries().properties().style.unsubscribe(null,k),b.model().onSelectedSourceChanged().unsubscribe(null,l),V=null),a&&((b=a.model())?h(b):a.modelCreated().subscribe(null,h),V=a))}},{callWithLast:!0});$.extend(this,{createChartWidget:d,
|
|
getAll:function(){return u.map(function(a){return a.D3})},destroy:function(){return u.forEach(function(a){a.D3.destroy()})},layout:Q,maximizeCurrentChart:J,activeChartWidget:v,activeChartStyle:N,selectedSource:W.readonly(),metaInfo:T,state:function(a){for(var b=[],c=A8.LayoutTemplates[y].count,d=0;d<c;d++)b.push(u[d].D3.state(a));a={layout:y,charts:b};E.value()&&(a.symbolLock=1);z.value()&&(a.intervalLock=1);return a},asyncState:function(a){for(var b=
|
|
$.Deferred(),c=[],d=A8.LayoutTemplates[y].count,e=0;e<d;e++)c.push(u[e].D3.asyncState(a));$.when.apply($,c).then(function(){for(var a={charts:[]},c=0;c<arguments.length;c++)a.charts.push(arguments[c]);b.resolve(a)});return b},readOnly:function(){return w},lock:{symbol:E,setSymbolLockWithUndo:function(a){if(a!==E.value()){A77.beginUndoMacro("Symbol Lock");if(a)for(var b=v.value(),c=b.getSymbol(),d=0;d<u.length;d++){var e=u[d].D3;
|
|
e!==b&&e.getSymbol()!==c&&e.setSymbol(c)}A77.setWatchedValue(E,a,"Symbol Lock");A77.endUndoMacro()}},interval:z,setIntervalLockWithUndo:function(a){if(a!==z.value()){A77.beginUndoMacro("Interval Lock");if(a)for(var b=v.value(),c=b.getResolution(),d=0;d<u.length;d++){var e=u[d].D3;e!==b&&e.getResolution()!==c&&e.setResolution(c)}A77.setWatchedValue(z,a,"Resolution Lock");A77.endUndoMacro()}},
|
|
crosshair:F},setSymbol:function(a){E.value()?m(a):v.value().setSymbol(a)},setResolution:function(a){if(z.value()){for(var b=!1,c=0;c<u.length;c++){var d=u[c].D3;d.model().mainSeries().properties().interval.value()!==a&&(b||(A77.beginUndoMacro("Change Resolution"),b=!0),d.setResolution(a))}b&&A77.endUndoMacro()}else v.value().setResolution(a)},updateLayout:b,images:function(a){if(a&&a.onlyActiveChart||B)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||
|
|
1,charts:[v.value().images()]};a=[];for(var b=A.count,c=0;c<u.length&&c<b;c++)a.push(u[c].D3.images());return{layout:y,hidpiRatio:window.hidpiCanvasRatio||1,charts:a}},syncCrosshair:function(a,b,c){if(c||K&&!B){c=A.count;for(var d=0;d<u.length&&d<c;d++){var e=u[d].D3;e!==b&&(e=e.model())&&e.model().setExternalPosition(a)}}},setSymbolAll:m,clearChartMetaInfo:function(){T.id.setValue(void 0);T.uid.setValue(void 0);T.name.setValue(void 0)},takeScreenshot:function(){var b={snapshotUrl:a.snapshotUrl};
|
|
(R77.enabled("show_dialog_on_snapshot_ready")?TradingView.getImageOfChart:TradingView.getImageOfChartSilently)(this,b,function(a){S.fire(a)})},onScreenshotReady:function(){return S}});if(F=a.content){F.charts||(F={layout:"s",charts:[F]});y=n(F.layout||"s");for(q=0;q<F.charts.length;q++)D.push({content:F.charts[q]});F.symbolLock&&E.setValue(!0);F.intervalLock&&z.setValue(!0);F=null}Q.setValue(y);e(y,B);D.splice(0,D.length);Q.subscribe(function(a){e(a,!1)});Q.hook=function(a){return a===this.value()?
|
|
a:n(a)};w&&(Q.writeLock=!0);J.subscribe(function(a){a!==B&&e(y,a)});$(window).on("resize",b);R77.enabled("datasource_copypaste")&&(TradingView.AppClipboard.init(),a.globalEvents&&($(window).on("appclip:paste",function(a){v.value().onAppClipboardPaste();a.preventDefault()}),$(window).on("appclip:copy",function(a){v.value().onAppClipboardCopy();a.preventDefault()}),$(window).on("appclip:cut",function(a){v.value().onAppClipboardCut();a.preventDefault()})))};
|
|
A8.LayoutTemplates={s:{title:"1 chart",count:1,sizer:function(a,b,c,d){return{width:b.width-d-d,height:b.height-d-d,top:d,left:d}}},"2h":{title:"2-up Horizontal",count:2,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=e-c>>1;switch(a){case 0:return{width:f,height:b,top:d,left:d};case 1:return a=c+f,{width:e-a,height:b,top:d,left:d+a}}}},"2v":{title:"2-up Vertical",count:2,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=b-c>>1;switch(a){case 0:return{width:e,
|
|
height:f,top:d,left:d};case 1:return a=c+f,{width:e,height:b-a,top:a+d,left:d}}}},"3h":{title:"3-up Horizontal",count:3,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=(e-c-c)/3|0;switch(a){case 0:return{width:f,height:b,top:d,left:d};case 1:return{width:f,height:b,top:d,left:c+f+d};case 2:return a=2*(c+f),{width:e-a,height:b,top:d,left:a+d}}}},"3v":{title:"3-up Vertical",count:3,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=(b-c-c)/3|0;switch(a){case 0:return{width:e,
|
|
height:f,top:d,left:d};case 1:return{width:e,height:f,top:c+f+d,left:d};case 2:return a=2*(c+f),{width:e,height:b-a,top:a+d,left:d}}}},"3s":{title:"3-up Stacked",count:3,sizer:function(a,b,c,d){var e=b.height-d-d,f=e-c>>1;b=b.width-d-d-c>>1;switch(a){case 0:return{width:b,height:e,left:d,top:d};case 1:return{width:b,height:f,left:b+c+d,top:d};case 2:return a=c+f,{width:b,height:e-a,left:b+c+d,top:a+d}}}},4:{title:"4-up",count:4,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=b-c>>1,
|
|
g=e-c>>1;switch(a){case 0:return{width:g,height:f,left:d,top:d};case 1:return a=f+c,{width:g,height:b-a,left:d,top:a+d};case 2:return c=g+c,{width:e-c,height:f,left:c+d,top:d};case 3:return a=f+c,c=g+c,{width:e-c,height:b-a,left:c+d,top:a+d}}}},6:{title:"6-up",count:6,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=b-c>>1,g=(e-c-c)/3|0;switch(a){case 0:return{width:g,height:f,left:d,top:d};case 1:return a=f+c,{width:g,height:b-a,left:d,top:a+d};case 2:return{width:g,height:f,left:g+
|
|
c+d,top:d};case 3:return a=f+c,{width:g,height:b-a,left:g+c+d,top:a+d};case 4:return g=g+c+g+c,{width:e-g,height:f,left:g+d,top:d};case 5:return g=g+c+g+c,a=f+c,{width:e-g,height:b-a,left:g+d,top:a+d}}}},8:{title:"8-up",count:8,sizer:function(a,b,c,d){var e=b.width-d-d;b=b.height-d-d;var f=b-c>>1,g=e-3*c>>2;switch(a){case 0:return{width:g,height:f,left:d,top:d};case 1:return a=f+c,{width:g,height:b-a,left:d,top:a+d};case 2:return{width:g,height:f,left:g+c+d,top:d};case 3:return a=f+c,{width:g,height:b-
|
|
a,left:g+c+d,top:a+d};case 4:return{width:g,height:f,left:g+c+g+c+d,top:d};case 5:return a=f+c,{width:g,height:b-a,left:g+c+g+c+d,top:a+d};case 6:return g=3*(g+c),{width:e-g,height:f,left:g+d,top:d};case 7:return g=3*(g+c),a=f+c,{width:e-g,height:b-a,left:g+d,top:a+d}}}}};TradingView.CompareWidget=function(a){this.D5=a;this.predefines={"":{"S&P 500 Trust":"AMEX:SPY","Nasdaq Composite":"INDEX:NASX","Diamonds Trust":"AMEX:DIA","Gold Trust":"AMEX:GLD","Euro Currency Trust":"AMEX:FXE","Nasdaq 100":"INDEX:IUXX","Nasdaq Financial 100":"INDEX:IXF"}};this.symbolAlias={"BATS:SPY":"AMEX:SPY","BATS:DIA":"AMEX:DIA","BATS:GLD":"AMEX:GLD","BATS:FXE":"AMEX:FXE"}};
|
|
TradingView.CompareWidget.prototype.addCompareSymbol=function(a,b,c){if(b=this.D5.activeChartWidget.value())if(b=b.model()){for(var d=b.mainSeries().interval(),e=b.studiesMetaData(),f,g=0;g<e.size();g++)"Compare@tv-basicstudies"===e.item(g).id&&(f=e.item(g));a={exchange:c,inputs:{symbol:a,resolution:d}};TradingView.trackEvent("GUI","Add Compare");return b.insertStudy(f,a)}};
|
|
TradingView.CompareWidget.prototype.removeCompareSymbol=function(a){var b=this.D5.activeChartWidget.value();if(b&&(b=b.model()))for(var c=b.D19(),d=0;d<c.length;d++){var e=c[d];if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var f=e.properties().inputs.symbol.value();(f===a||this.symbolAlias[f]&&this.symbolAlias[f]===a)&&b.removeSource(e)}}};
|
|
TradingView.CompareWidget.prototype._createPredefinesList_normal=function(){function a(a){$(this).is(":checked")?(c=b.addCompareSymbol(a.data.symbol))||$(this).attr("checked",!1):b.removeCompareSymbol(a.data.symbol)}var b=this,c,d,e,f;for(f in this.predefines){var g=$('<div class="predefine-section">').appendTo(this._widget),h;for(h in this.predefines[f])d=$('<div class="predefine-line"></div>').appendTo(g),e=$('<input type="checkbox" id="predefine-checkbox-'+this.symbolToId(this.predefines[f][h])+
|
|
'"/>').appendTo(d),e.change({symbol:this.predefines[f][h]},a),$('<label for="predefine-checkbox-'+this.symbolToId(this.predefines[f][h])+'">'+h+"</label>").appendTo(d)}$('<div class="clear"></div>').appendTo(this._widget)};
|
|
TradingView.CompareWidget.prototype.init=function(){var a=this;this._widget=$('<div class="compare-widget"></div>');var b=$('<div class="symbol-edit-widget">');this.input=$('<input type="text" class="symbol-edit with-plus single" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">').appendTo(b);var c=$('<a class="symbol-edit-plus" title="'+$.t("Company Comparison")+'"><span></span></a>').appendTo(b),d=A69.bindToInput(this.input,{callback:function(b){a.addCompareSymbol(b)},
|
|
keepFocus:!0,clearAfterAccept:!0});c.click(function(){d.acceptTypeIn()});b.appendTo(this._widget);R77.enabled("charting_library_base")||this._createPredefinesList_normal()};
|
|
TradingView.CompareWidget.prototype.show=function(){var a=this.D5.activeChartWidget.value();if(a&&(a=a.model())){a=a.D19();this.init();this._widget.find('input[id^="predefine-checkbox"]').attr("checked",!1);for(var b in this.predefines)for(var c in this.predefines[b])for(var d=this._widget.find("#predefine-checkbox-"+this.symbolToId(this.predefines[b][c])),e=0;e<a.length;e++){var f=a[e];if(f._metaInfo&&"Compare@tv-basicstudies"===f._metaInfo.id){var g=this.predefines[b][c],
|
|
f=f.properties().inputs.symbol.value();(f===g||this.symbolAlias[f]&&this.symbolAlias[f]===g)&&d.attr("checked",!0)}}}};TradingView.CompareWidget.prototype.symbolToId=function(a){return a.replace(/[^a-z0-9]/gi,"_")};TradingView.CompareWidget.prototype.focus=function(){Modernizr.touch||this.input.focus()};TradingView.CompareDialog=function(a){this.D6=a};TradingView.CompareDialog.prototype.tabChanged=function(a){0===a?this.compareTab.focus():this.addSymbolTab.focus()};
|
|
TradingView.CompareDialog.prototype.show=function(){TradingView.trackEvent("GUI","Compare Add");var a=A83.createDialog($.t("Compare Add"),{hideTitle:!0,dragHandle:".properties-tabs"}),b=a.find(".tv-dialog-content");a.css("min-width",0);b.css("min-width",0);var c=$('<div class="properties-tabs"></div>').appendTo(b);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Compare")).appendTo(c);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Add Symbol")).appendTo(c);var b=
|
|
$("<div>").appendTo(b),d=$('<div class="main-tree-page compare active">').appendTo(b),e=$('<div class="main-tree-page compare">').appendTo(b);this.compareTab=new TradingView.CompareWidget(this.D6);this.addSymbolTab=new TradingView.AddSymbolWidget(this.D6);this.compareTab.show();d.append(this.compareTab._widget);this.addSymbolTab.show();e.append(this.addSymbolTab._widget);this.tabs=new A71(c,b,{saveTab:"CompareAddDialog.tab"});this.tabs.tabChanged.subscribe(this,
|
|
this.tabChanged);A83.applyHandlers(a);A83.positionDialog(a,this.position);return a};TradingView.AddSymbolWidget=function(a){this.D5=a;this.init()};
|
|
TradingView.AddSymbolWidget.prototype.init=function(){var a=this;this._widget=$('<div class="addsymbol-widget"></div>');var b=$('<div class="symbol-edit-widget">'),c=$('<input type="text" class="symbol-edit with-plus single" placeholder="'+$.t("Symbol")+'" autocomplete="off">').appendTo(b);this._input=c;var d=$('<a class="symbol-edit-plus"><span></span></a>').appendTo(b),e=A69.bindToInput(c,{callback:function(b){var c=a.D5.activeChartWidget.value();c&&c.addSymbol(b,
|
|
a._checkbox.is(":checked"))},keepFocus:!0,clearAfterAccept:!0});d.on("click",function(){e.acceptTypeIn()});b.appendTo(this._widget);b=$('<div class="opts-line">').appendTo(this._widget);c="addsymbol-widget-overlay-"+TradingView.guid();this._checkbox=$('<input type="checkbox" id="'+c+'">').appendTo(b);this._checkbox.on("click",function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",$(this).is(":checked"))});$('<label for="'+c+'">'+$.t("Overlay the main chart")+"</label>").appendTo(b)};
|
|
TradingView.AddSymbolWidget.prototype.show=function(){this.focus();this._checkbox.attr("checked",TVSettings.getBool("showAddSymbolDialog.checkboxState",!0))};TradingView.AddSymbolWidget.prototype.focus=function(){Modernizr.touch||this._input.focus()};TradingView.SYMBOL_SEARCH_MAX_LENGTH=100;A4=function(){};A4.prototype._createBackButton=function(a){var b=a.createGroup().appendTo(a._$left);a._backButton=$('<div class="mobile-back-button"><i></i></div>').click(function(){1<window.history.length&&window.history.back();window.location.pathname="/"}).appendTo(b)};
|
|
A4.prototype._createBarsGroup=function(a){var b=this.createGroup({single:!0});a._style_list.element().appendTo(b);return b};
|
|
A4.prototype._createPropertiesGroup=function(a,b){var c=this.createGroup({single:!0});if(!this._onWidget){var d=$("<span>").addClass("button iconed properties apply-common-tooltip").append(svgAsset("properties","17x17")).appendTo(c);d.on(a,function(a){a.pageX=d.offset().left;a.pageY=d.offset().top+d.height()+15;a=b.activeChartWidget.value().showChartProperties({_lastEvent:a});d.addClass("active");a.on("destroy",function(){d.removeClass("active")})});d.attr("title",$.t("Chart Properties"))}return c};
|
|
A4.prototype._createCompareGroup=function(a,b,c){a=this.createGroup({single:!0});var d=$('<a class="button toggle-caption compare apply-common-tooltip">').append(svgAsset("compare")).append($('<span class="caption">'+$.t("Compare")+"</span>")).appendTo(a);this._compareButton=d;this._compareButton.on(c,function(a){a.preventDefault();a=(new TradingView.CompareDialog(b)).show();d.addClass("active");a.on("destroy",function(){d.removeClass("active")})});this._compareButton.attr("title",
|
|
$.t("Compare or Add Symbol"));return a};
|
|
A4.prototype._createIndicatorsGroup=function(a,b){var c=this.createGroup({single:!0});this._indicatorsButton=$('<a class="button toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append(svgAsset("indicators")).append($('<span class="caption">'+$.t("Indicators")+"</span>")).appendTo(c);this._indicatorsButton.attr("title",$.t("Indicators, Fundamentals, Economy and Add-ons"));this._indicatorsButton.on(a,function(a){a.stopPropagation();
|
|
a.preventDefault();window.studyMarket.isVisible()?window.studyMarket.hide():window.studyMarket.show()});TradingView.keyboardBinder.registerListener("IndicatorsHotkey",function(a){if("47"==a.which&&$(a.target).is("body")&&!window.studyMarket.isVisible())return window.studyMarket.show(),window.studyMarket.selectSearchPage(),a.preventDefault(),a.stopPropagation(),!0});window.studyMarket.visibilityChanged.subscribe(this,function(a){this._indicatorsButton.toggleClass("active",a)});!TradingView.onWidget()&&
|
|
R77.enabled("study_templates")&&studyTemplates.appendMenuButtonTo(c);return c};A4.prototype.createGroup=function(a){a=a||{};var b=$("<div>").addClass("group");a.right&&b.addClass("right");a.single&&b.addClass("space-single");return b};A4.prototype.bindToModel=function(){var a=this.D4.model();a.mainSeries().properties();this.D0=a};A4.prototype.backButton=function(){return this._backButton};
|
|
A4.prototype.saveLoadWidget=function(){return this._saveLoad||console.warn("No save-load widget created in footer")};A4.prototype.styleIconPosition=function(a){return"-%1px 0".replace("%1",19*~~a)};A4.styleIconPosition=A4.prototype.styleIconPosition;A5=function(a){function b(){if(!a.favoriteChartTypes)return[];var b={Bars:TradingView.Series.STYLE_BARS,Candles:TradingView.Series.STYLE_CANDLES,Line:TradingView.Series.STYLE_LINE,Area:TradingView.Series.STYLE_AREA,"Heiken Ashi":TradingView.Series.STYLE_HEIKEN_ASHI,"Hollow Candles":TradingView.Series.STYLE_HOLLOW_CANDLES};return a.favoriteChartTypes.map(function(a){return b[a]})}a=a||{};var c=this.D5=a.D6,d=this.D4=
|
|
c.activeChartWidget.value(),e=this._onWidget=d.onWidget(),f=this,g=Modernizr.touch?"touchstart":"click",h=$(".header-chart-panel").eq(0);this._$right=h.find(".right");this._$left=h.find(".left");this._itemsVisibility=a.itemsVisibility;TradingView.isMobileView&&!TradingView.winMobileMode&&this._createBackButton(this);if(!c.readOnly()){if(R77.enabled("header_symbol_search")){var h=this.createGroup().appendTo(this._$left),h=$('<div class="symbol-edit-widget no-last"></div>').appendTo(h),k=$('<div class="symbol-edit-wrap">').appendTo(h),
|
|
h=null;!R77.enabled("charting_library_base")&&A69.canShowSpreadActions()&&(h=$('<div class="symbol-edit-buttonswrap">').appendTo(k),h=$('<div class="spread-actions">').appendTo(h).on("mousedown",function(a){a.preventDefault()}));var l=$('<div class="symbol-edit-inputspacer">').appendTo(k),m=$('<input type="text" class="symbol-edit" maxlenght="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'">').appendTo(l);A69.bindToInput(m,{syncWithChartWidget:!0,spreadActions:h});
|
|
(function(){var a=!1;m.on("focus",function(){a=!0;k.addClass("expanded")});m.on("blur",function(){a=!1;setTimeout(function(){a||k.removeClass("expanded")},40)})})()}if(R77.enabled("header_resolutions")){h=this.createGroup({single:!0}).appendTo(this._$left);l={onWidget:e,submenuBtnAddClass:"apply-common-tooltip"};a.interval_options&&$.extend(l,a.interval_options);!TradingView.isMobileView&&R77.enabled("items_favoriting")||$.extend(l,{notShowQuicks:!0,popupSpacing:1});TradingView.isOnFeaturePage&&
|
|
$.extend(l,{notShowQuicks:!0});this._interval=new A21(l);if(R77.enabled("charting_library_base"))D16.on("configuration_received",function(){f._interval.forceUpdate()});this._interval.element().addClass("no-first").appendTo(h);this._interval.onResize.subscribe(c,c.updateLayout);a.favoriteIntervals&&this._interval.setUpStarredItemsList(a.favoriteIntervals)}R77.enabled("header_chart_type")&&(h=R77.enabled("charting_library_base")?[{id:TradingView.Series.STYLE_BARS,
|
|
title:$.t("Bars"),svgname:"bars"},{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles"),svgname:"candles"},{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles"),svgname:"hollowCandles"},{id:TradingView.Series.STYLE_LINE,title:$.t("Line"),svgname:"line"},{id:TradingView.Series.STYLE_AREA,title:$.t("Area"),svgname:"area"},{id:TradingView.Series.STYLE_HEIKEN_ASHI,title:$.t("Heiken Ashi"),svgname:"heikenAshi"}]:[{id:TradingView.Series.STYLE_BARS,title:$.t("Bars"),svgname:"bars"},
|
|
{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles"),svgname:"candles"},{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles"),svgname:"hollowCandles"},{id:TradingView.Series.STYLE_HEIKEN_ASHI,title:$.t("Heiken Ashi"),svgname:"heikenAshi"},{id:TradingView.Series.STYLE_LINE,title:$.t("Line"),svgname:"line"},{id:TradingView.Series.STYLE_AREA,title:$.t("Area"),svgname:"area"},{id:TradingView.Series.STYLE_RENKO,title:$.t("Renko"),svgname:"renko"},{id:TradingView.Series.STYLE_PB,
|
|
title:$.t("Line Break"),svgname:"lineBreak"},{id:TradingView.Series.STYLE_KAGI,title:$.t("Kagi"),svgname:"kagi"},{id:TradingView.Series.STYLE_PNF,title:$.t("Point & Figure"),svgname:"pointFigure"}],l=b()||[1,4,5,6],!TradingView.isMobileView&&!TradingView.isOnFeaturePage||R77.enabled("charting_library_base")||(l=[]),e?l=[1,3]:R77.enabled("collapsible_header")&&this._createMinimizeButton(a.headerChartPanel),this._style_list=new A14("StyleWidget",$.map(h,function(a){return{id:a.id,
|
|
title:a.title,svg:$(svgAsset(a.svgname,"26x26")),favoriteButton:{title:a.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:l,addClass:"chart-style-widget",popupAddClass:"chart-style-popup",notShowQuicks:!!TradingView.isMobileView||!R77.enabled("items_favoriting"),showJustDefaultQuicks:l&&l.length&&R77.enabled("predefined_items_only_may_be_starred"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"}),c.activeChartStyle.subscribe(function(a){f._style_list.setValue(a)},
|
|
{callWithLast:!0}),f._style_list.onChange().subscribe(this,function(a){c.activeChartStyle.setValue(a)}),f._style_list.onResize().subscribe(c,c.updateLayout));window.studyMarket=new A1(c,window.user,{onWidget:e});this._createLayout(a,f,g)}R77.enabled("header_saveload")&&(e=R77.enabled("header_saveload_to_the_right")?this._$right:this._$left,h=this.createGroup({single:!0}).appendTo(e),e=$("<div>").addClass("save-load-buttons in-header").appendTo(h),this._saveLoad=
|
|
new TradingView.SaveLoadWidget(e,c,{popupDirection:"down",popupReverse:!0}),this._saveLoad.onTitleSizeChanged.subscribe(c,c.updateLayout));this.D4.readOnly()||TradingView.isMobileView||!R77.enabled("header_undo_redo")||(this._undoRedo=new A78(this._$left,this.D4),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"));if(R77.enabled("header_screenshot")){var e=$('<div class="group space-single"></div>').appendTo(this._$right),
|
|
n=$('<span class="button screenshot iconed"><i></i></span>').appendTo(e);e.click(function(a){if(!R77.enabled("show_dialog_on_snapshot_ready")){if(n.hasClass("process"))return;n.addClass("process");c.onScreenshotReady().subscribe(null,function(a){n.removeClass("process")},!0)}d.actions().takeScreenshot.callbacks().fire();a.preventDefault()})}!R77.enabled("header_layouttoggle")||TradingView.isMobileView||c.readOnly()||(e=$("<div>").attr("title",$.t("Select Layout")).addClass("layout-toggle-container").addClass("apply-common-tooltip").appendTo(this._$right),
|
|
this._layoutToggle=new TradingView.LayoutWidget(e,c));R77.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none");d.withModel(this,A4.prototype.bindToModel)};inherit(A5,A4);
|
|
A5.prototype._createUndoRedoGroup=function(){this._undoRedo=new A78(this._$left,this.D4);this._undoRedo.undoElement().addClass("apply-common-tooltip");this._undoRedo.redoElement().addClass("apply-common-tooltip");return this.createGroup({single:!0}).append(this._undoRedo.element())};
|
|
A5.prototype._createFullscreenGroup=function(){this._fullscreen=new TradingView.FullscreenWidget;var a=this.createGroup({single:!0});this._fullscreen.element().addClass("apply-common-tooltip").appendTo(a);return a};
|
|
A5.prototype._createLayout=function(a,b,c){var d=[];R77.enabled("header_chart_type")&&d.push(this._createBarsGroup(b));R77.enabled("header_settings")&&d.push(this._createPropertiesGroup(c,a.D6));R77.enabled("header_indicators")&&d.push(this._createIndicatorsGroup(c));R77.enabled("header_compare")&&d.push(this._createCompareGroup(b,a.D6,c));!R77.enabled("header_undo_redo")||this.D4.readOnly()||
|
|
TradingView.isMobileView||d.push(this._createUndoRedoGroup());R77.enabled("header_fullscreen_button")&&!TradingView.isMobileView&&d.push(this._createFullscreenGroup());d.forEach(function(a){a.appendTo(this._$left)},this)};A5.prototype._createMinimizeButton=function(a){if(a&&a.size())$(document.createElement("span")).addClass("tv-close-panel top").appendTo(a).on("click",function(b){b.isDefaultPrevented()||(b.preventDefault(),a.toggleClass("hidden"),$(window).trigger("resize"))})};TradingView.ScriptEditorWidget=function(){function a(a){if(c)return c;c=this;b=a.activate;a.$body.css("overflow","hidden");d=this._scriptEditor=new TradingView.TVScriptWidget(a.D6,{$body:a.$body,height:a.height,visible:a.visible,$button:e});this._scriptEditor.show()}var b=null,c=null,d=null,e=null;a.onRegister=function(a){a.activate&&(b=a.activate)};a.onTabShow=function(a){a.$button&&(e=a.$button.find(".title"))};a.open=function(a){b&&b();d&&d.show(a)};a.loadedScriptIdPart=function(){return d?
|
|
d.loadedScriptIdPart():!1};a.onScriptModified=function(a,b){if(d)d.onScriptModified(a,b)};a.onScriptDeleted=function(a,b){if(d)d.onScriptDeleted(a,b)};a.onScriptRenamed=function(a,b){if(d)d.onScriptRenamed(a,b)};return a}();TradingView.LineToolPropertiesWidget=function(a){this.D5=a;this._bindings=[];this.init();this.attachHandlers()};TradingView.LineToolPropertiesWidget.prototype._POSITION_KEY="properties_toolbar.position";TradingView.LineToolPropertiesWidget.prototype.activeChartWidget=function(){return this.D5.activeChartWidget.value()};TradingView.LineToolPropertiesWidget.prototype.selectedSource=function(){return this.D5.selectedSource.value()};
|
|
TradingView.LineToolPropertiesWidget.prototype.init=function(){var a=this,b=$('<div class="properties-toolbar"><div class="drag-handler"><i></i></div></div>').css("position","absolute").hide().draggable({handle:".drag-handler",stop:function(){TVSettings.setJSON(a._POSITION_KEY,b.offset())}});$(window).resize(function(){a._visible&&a._updatePositoin()});this._$widget=b;this._$templates=$('<div class="tools-group">').css("display","inline-block").appendTo(b).hide();this._$properties=$('<div class="tools-group properties-tools-group">').css("display",
|
|
"inline-block").appendTo(b).hide();this._$sourceActions=$('<div class="tools-group">').css("display","inline-block").appendTo(b).hide();this.createSourceActions();this._$widget.appendTo(document.body)};TradingView.LineToolPropertiesWidget.prototype.attachHandlers=function(){TradingView.drawingState.tool.subscribe(function(a){this.onToolChanged(a)}.bind(this),{callWithLast:!0});this.D5.selectedSource.subscribe(function(a){this.onSourceChanged(a)}.bind(this))};
|
|
TradingView.LineToolPropertiesWidget.prototype.onToolChanged=function(a,b){if(a&&-1!=a.toLowerCase().indexOf("linetool"))b=b instanceof J52?b:new J52(a.toLowerCase()),this.hideSourceActions(),this.showPropertiesOf(a,b),this.showTemplatesOf({tool:a,properties:b}),this._updateVisibility();else if(this.selectedSource())this.onSourceChanged(this.selectedSource());else this.hide()};
|
|
TradingView.LineToolPropertiesWidget.prototype.findSourceOnWidget=function(a){for(var b=0;b<this.activeChartWidget().model().panes().length;b++)for(var c=this.activeChartWidget().model().panes()[b].orderedSources(),d=0;d<c.length;d++)if(c[d]===a)return c[d]};
|
|
TradingView.LineToolPropertiesWidget.prototype.onSourceChanged=function(a){a?(a instanceof R47&&!(a instanceof R96)&&this.findSourceOnWidget(a)?(!a.userEditEnabled()||"LineToolBrush"!==a.toolname&&this.activeChartWidget().model().lineBeingCreated()?this.hideSourceActions():this.showSourceActions(a),this.showPropertiesOf(a.getConstructor(),a.properties()),this.showTemplatesOf({source:a}),this._updateVisibility()):this.hide(),this._setupToggleLockButton(a)):
|
|
this.hide()};
|
|
TradingView.LineToolPropertiesWidget.prototype.showTemplatesOf=function(a){if(R77.enabled("line_tool_templates")){var b=a.source,c,d;b?(c=b.getConstructor(),d=b.properties()):(c=a.tool,d=a.properties);this._$templates.hide().empty();var e=this;a=new TradingView.LinetoolTemplatesList(c,function(a){b?(b.restoreTemplate(a),e.activeChartWidget().model().model().updateSource(this._linetool),e.onSourceChanged(b)):(d.merge(a),d.listeners().fire(this),d.saveDefaults(),e.onToolChanged(c,d))},{buttonInner:'Template <span class="icon"></span>',
|
|
defaultsCallback:function(){d.restoreFactoryDefaults();e.showPropertiesOf(c,d)},saveAsText:$.t("Save Drawing Template As..."),applyDefaultText:$.t("Apply Default Drawing Template"),getDataForSaveAs:b?function(){return b.template()}:null});var f=a.createButton().attr("title",$.t("Templates"));this.templatesList=a;this._$templates.append(f);R77.enabled("charting_library_base")||this._$templates.show();this._templatesVisible=!0}};
|
|
TradingView.LineToolPropertiesWidget.prototype.createSourceActions=function(){function a(a,b,c,d){a=$("<div>").addClass("button apply-common-tooltip").attr("title",b).on("click",function(a){c(a)});d&&a.append(d);return a}var b=this,c=a("Settings",$.t("Settings"),function(){(new TradingView.EditObjectDialog(b.selectedSource(),b.activeChartWidget().model())).show()},$(svgAsset("config","15x15")).css({"margin-top":"8px"}));this.$zOrder=a("ZOrder",$.t("Visual Order"),function(){b.zOrderButtonHandler()},
|
|
$(svgAsset("linetool-layers","18x18")).css({"margin-top":"7px"}));this.$zOrder.addClass("with-arrow");TradingView.bindPopupMenu(this.$zOrder,null,{direction:"down",event:"button-popup",reverse:!1,notCloseOnButtons:!0});var d=$.t("Clone");R77.enabled("datasource_copypaste")&&(d=d+", "+$.t("Copy"));R77.enabled("support_multicharts")&&(d=d+", "+$.t("Sync"));this.$clone=a("Clone",d,function(){b.cloneButtonHandler()},$(svgAsset("linetool-clone","18x18")).css({"margin-top":"7px"}));this.$clone.addClass("with-arrow");
|
|
TradingView.bindPopupMenu(this.$clone,null,{direction:"down",event:"button-popup",reverse:!1,notCloseOnButtons:!0});this.$lock=a("Lock",$.t("Lock"),function(){b.activeChartWidget().toggleLockSelectedObject()},$(svgAsset("lockAllDrawings","26x26")).css({"margin-top":"2px"}));this._lockChangeListener=function(a){b.$lock.toggleClass("active",a.value())};var d=a("Hide",$.t("Hide"),function(){b.activeChartWidget().hideSelectedObject()},$(svgAsset("linetool-visibility","15x15")).css({"margin-top":"8px"})),
|
|
e=a("Remove",$.t("Remove"),function(){b.activeChartWidget().model().removeSelectedSource()},$(svgAsset("bucket",{width:20,height:20})).css({"margin-top":"5px"}));R77.enabled("alerts")&&TradingView.D18("drawing_alerts")?(this.$editAlert=a("alert",$.t("Edit Alert"),function(){runOrSignIn(function(){b.selectedSource().getAlert(function(a){TradingView.Alert.editAlert(a,b.activeChartWidget())})})},$(svgAsset("alarm-clock","20x20")).css({"margin-top":"5px"})),this.$addAlert=a("add-alert",
|
|
$.t("Add Alert"),function(){runOrSignIn(function(){new TradingView.MakeAlertDialog(b.activeChartWidget(),{drawing:b.selectedSource()})})},$(svgAsset("alarm-clock-plus","20x20")).css({"margin-top":"5px"})),this._$sourceActions.append(c,this.$editAlert,this.$addAlert,this.$zOrder,this.$clone,this.$lock,d,e)):this._$sourceActions.append(c,this.$zOrder,this.$clone,this.$lock,d,e)};
|
|
TradingView.LineToolPropertiesWidget.prototype.zOrderButtonHandler=function(){this.$zOrder.hasClass("active")||this.$zOrder.trigger("button-popup",[this._getZOrderActions()])};TradingView.LineToolPropertiesWidget.prototype.cloneButtonHandler=function(){this.$clone.hasClass("active")||this.$clone.trigger("button-popup",[this._getCloneActions()])};
|
|
TradingView.LineToolPropertiesWidget.prototype._getCloneActions=function(){var a=this.activeChartWidget().model(),b=this.selectedSource(),c={title:$.t("Clone"),action:function(){a.cloneLineTool(b)}};if(!R77.enabled("datasource_copypaste"))return[c];var d={title:$.t("Copy"),shortcut:"Ctrl-C",action:function(){a.copySourceToClip(b)}};if(!R77.enabled("support_multicharts"))return[c,d];var e={title:$.t("Sync"),action:function(){a.copyToOtherCharts(b)}};return[c,d,e]};
|
|
TradingView.LineToolPropertiesWidget.prototype._getZOrderActions=function(){var a=[],b=this.selectedSource(),c=this.activeChartWidget().model(),d={title:$.t("Bring to Front"),action:function(){c.bringToFront(b)}},e={title:$.t("Send to Back"),action:function(){c.sendToBack(b)}},f={title:$.t("Bring Forward"),action:function(){c.changeZOrder(b,1)}},g={title:$.t("Send Backward"),action:function(){c.changeZOrder(b,-1)}},h=c.paneForSource(this.selectedSource()).getZOrderMinMax();b.zorder()===h.minZOrder&&
|
|
(e.disabled=!0,g.disabled=!0);b.zorder()===h.maxZOrder&&(f.disabled=!0,d.disabled=!0);a.push(d,e,f,g);return a};
|
|
TradingView.LineToolPropertiesWidget.prototype._getPossibleProperty=function(a){for(var b=[],c=this._defaultToolProperties(),d=!0,e=!1,f=0;f<c.length;f++){var g=c[f];g.name in a?(d=!1,b.push(g)):g.divider&&(b.push(g),e=!0)}a.extendLeft||(b=b.map(function(a){"leftEnd"==a.name&&(a.comboboxOptions=a.comboboxOptions.filter(function(a){return a.value!=TradingView.LineToolPropertiesWidget.LINE_EXTEND}));return a}));a.extendRight||(b=b.map(function(a){"rightEnd"==a.name&&(a.comboboxOptions=a.comboboxOptions.filter(function(a){return a.value!=
|
|
TradingView.LineToolPropertiesWidget.LINE_EXTEND}));return a}));2===b.length&&e&&(b=$.grep(b,function(a){return!a.divider}));return d?[]:b};
|
|
TradingView.LineToolPropertiesWidget.prototype.showPropertiesOf=function(a,b){this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases());var c=this._toolExceptionCases[a]||this._getPossibleProperty(b);this._$properties.empty();this._propertiesVisible=!1;if(c.length){for(var d=0;d<c.length;d++){var e=c[d];if(e.divider)this._$properties.append('<div class="divider"></div>');else{var f=b[e.name];if("function"!=typeof e.showIf||e.showIf(f,b))e=new this.propertyControl(this,
|
|
f,e,b),this._$properties.append(e.el),this._propertiesVisible=!0}}this._$properties.toggle(this._propertiesVisible)}else this._$properties.hide()};
|
|
TradingView.LineToolPropertiesWidget.prototype.showSourceActions=function(a){function b(c){d.$editAlert.hide();d.$addAlert.hide();a.canHasAlert()&&(c?d.$editAlert.show():d.$addAlert.show());a.hasAlert.subscribe(b,!0)}var c=TradingView.className((a||this.selectedSource()).constructor),d=this;this.activeChartWidget().model().model().isSingleInstanceLineTool(c)?this.$clone.hide():this.$clone.show();d.$editAlert&&d.$addAlert&&b(a.hasAlert.value());this._$sourceActions.show();this._sourceActionsVisible=
|
|
!0};TradingView.LineToolPropertiesWidget.prototype.hideSourceActions=function(){this._$sourceActions.hide();this._sourceActionsVisible=!1};TradingView.LineToolPropertiesWidget.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()};TradingView.LineToolPropertiesWidget.prototype.hide=function(){this._$widget.hide();this._setupToggleLockButton();this._visible=!1};
|
|
TradingView.LineToolPropertiesWidget.prototype._show=function(){this._$widget.show();this._updatePositoin();this._visible=!0};TradingView.LineToolPropertiesWidget.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())};
|
|
TradingView.LineToolPropertiesWidget.prototype._setupToggleLockButton=function(a){a!=this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),a&&a.properties().frozen&&(a.properties().frozen.subscribe(this,this._lockChangeListener),this.$lock.toggleClass("active",a.properties().frozen.value())),this._selectedSourceBk=a)};
|
|
TradingView.LineToolPropertiesWidget.prototype._updatePositoin=function(){var a=this._$widget,b=$(window),c=b.height()-a.outerHeight(),b=b.width()-a.outerWidth(),d=TVSettings.getJSON(this._POSITION_KEY,{left:b/2,top:window.headerChartPanel.outerHeight()+15}),d={top:Math.min(c,Math.max(d.top,0)),left:Math.min(b,Math.max(d.left,0))};a.css(d);a.draggable("option","containment",[0,0,b,c])};TradingView.LineToolPropertiesWidget.prototype.bindControl=function(a){this._bindings.push(a)};
|
|
TradingView.LineToolPropertiesWidget.prototype.clearBindings=function(a){for(a=this._bindings.length;a--;)this._bindings[a].destroy();this._bindings.length=0};
|
|
TradingView.LineToolPropertiesWidget.prototype.propertyControl=function(a,b,c,d){if(b&&c&&a&&c.inputType){"combobox"!==c.inputType||c.comboboxOptions||console.warn('inputType combobox, needs "comboboxOptions" option');this._toolbarWidget=a;var e=c.inputType,f;if("colorPicker"===e)f=D7.prototype.createColorPicker(),c.icon&&f.addClass("svg-"+c.icon),a.bindControl(new TradingView.ColorBinding(f,b,!0,a.activeChartWidget().model()));else if("combobox"===e){e=!0;!0===c.simple?(f=$.map(c.comboboxOptions,
|
|
function(a){return{value:a,html:'<div class="combobox-simple">'+a+"</div>"}}),e=!1):f=$.map(c.comboboxOptions,function(a){var b=$('<div class="combobox-icon"></div>');b.append(svgAsset(a.icon,"32x25"));return{value:a.value,html:b}});var g=new TradingView.HTMLHelper.Combobox(f,{horizontal:e});f=g.render();e&&f.find(".items").width(41*c.comboboxOptions.length+2-1);c.propertyProxy&&(b=c.propertyProxy(d,a.activeChartWidget().model()));a.bindControl(new D11(g,b,null,!0,a.activeChartWidget().model()))}c.title&&
|
|
f.attr("title",c.title);"string"==typeof c.addClass&&f.addClass(c.addClass);f.addClass("apply-common-tooltip");this.el=f}};
|
|
TradingView.LineToolPropertiesWidget.prototype.createLineEndPropertyProxy=function(a,b){return function(c,d){var e;e=c[b]&&c[b].value()?TradingView.LineToolPropertiesWidget.LINE_EXTEND:c[a].value();e=new Property(e);e.subscribe(this,function(e){e=e.value();2>e?(d.beginUndoMacro(""),c[a].setValue(e),c[b]&&c[b].setValue(!1)):(d.beginUndoMacro(""),c[a].setValue(R47.LINEEND_NORMAL),c[b]&&c[b].setValue(!0));d.endUndoMacro()});return e}};
|
|
TradingView.LineToolPropertiesWidget.LINE_EXTEND=42;
|
|
TradingView.LineToolPropertiesWidget.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",icon:"bucket",title:$.t("Background Color")},{divider:!1},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}],
|
|
title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,icon:"line-width-1"},{value:1,icon:"line-dotted"},{value:2,icon:"line-dashed"}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:R47.LINEEND_NORMAL,icon:"line-left-normal"},{value:R47.LINEEND_ARROW,icon:"line-left-arrow"},{value:TradingView.LineToolPropertiesWidget.LINE_EXTEND,icon:"line-left-extend"}],propertyProxy:this.createLineEndPropertyProxy("leftEnd",
|
|
"extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:R47.LINEEND_NORMAL,icon:"line-right-normal"},{value:R47.LINEEND_ARROW,icon:"line-right-arrow"},{value:TradingView.LineToolPropertiesWidget.LINE_EXTEND,icon:"line-right-extend"}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",icon:"bucket"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",icon:"bucket"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",icon:"pencil"}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",inputType:"colorPicker",icon:"pencil"}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",icon:"bucket",showIf:function(a,b){return b&&b.fillBackground?!!b.fillBackground.value():!0}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",icon:"pencil"},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",icon:"pencil"},
|
|
{divider:!1},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",icon:"pencil"},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",icon:"font"},{divider:!1},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",icon:"pencil",title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",icon:"bucket",showIf:function(a,b){return b.fillBackground.value()},title:$.t("Background Color")},{divider:!1},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}],
|
|
title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:R47.LINEEND_NORMAL,icon:"line-left-normal"},{value:R47.LINEEND_ARROW,icon:"line-left-arrow"}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:R47.LINEEND_NORMAL,icon:"line-right-normal"},{value:R47.LINEEND_ARROW,
|
|
icon:"line-right-arrow"}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]};
|
|
TradingView.LineToolPropertiesWidget.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:[],LineToolFibTimeZone:[],LineToolBrush:TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases(),LineToolPolyline:TradingView.LineToolPropertiesWidget.prototype._brushPropertiesExceptionCases(),LineToolText:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),
|
|
LineToolBalloon:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolCallout:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:TradingView.LineToolPropertiesWidget.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolThumbUp:[],LineToolThumbDown:[],LineToolElliottCircle:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),
|
|
LineToolElliottSubminuette:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:TradingView.LineToolPropertiesWidget.prototype._elliottPropertiesExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",icon:"bucket"}],
|
|
LineToolNote:TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:TradingView.LineToolPropertiesWidget.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",icon:"pencil"}],LineToolRiskRewardLong:TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:TradingView.LineToolPropertiesWidget.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",
|
|
title:$.t("Color"),inputType:"colorPicker",icon:"bucket"}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",icon:"bucket"},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",icon:"bucket"},{divider:!1},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,icon:"line-width-1"},{value:2,icon:"line-width-2"},{value:3,icon:"line-width-3"},{value:4,icon:"line-width-4"}]}]}};TradingView.FavoriteDrawingToolBar=function(a){this.drawingToolbar=a;this.tools=this.drawingToolbar.favorites;this._active=TradingView.drawingState.tool.value();this.visibleProperty=new Property(TVSettings.getBool("ChartFavoriteDrawingToolbarWidget.visible",!0));this.visibleProperty.subscribe(this,function(a){this.toggle(a.value());TVSettings.setValue("ChartFavoriteDrawingToolbarWidget.visible",a.value())});this.init();this._attach();this.visibleProperty.value()&&0<this.tools.length&&(this.render(),
|
|
this.showWidget())};TradingView.FavoriteDrawingToolBar.prototype._POSITION_KEY="chart.favoriteDrawingsPosition";TradingView.FavoriteDrawingToolBar.prototype._attach=function(){this.drawingToolbar._favoritesEvent.subscribe(this,this._onEvent);TradingView.drawingState.tool.subscribe(function(){this._active=TradingView.drawingState.tool.value();this.render()}.bind(this))};
|
|
TradingView.FavoriteDrawingToolBar.prototype._onEvent=function(a,b){this.tools=this.drawingToolbar.favorites;this._visible||this.visibleProperty.value()?0<this.tools.length?(this.render(),this._visible||this.showWidget(),this._updatePosition()):this.hideWidget():"add"==a&&0<this.tools.length&&this.setVisible(!0)};
|
|
TradingView.FavoriteDrawingToolBar.prototype.render=function(){this._$toolsContainer.empty();this.tools.forEach(function(a){if(a.drawing){var b=a.drawing.tool==this._active,c=$(svgAsset(a.drawing.tool,"30x30")),b=$('<span class="button apply-common-tooltip" />').attr("title",a.drawing.localizedName).append(c).toggleClass("active",b).on("click",function(){TradingView.drawingState.tool.value()==a.drawing.tool?TradingView.drawingState.resetToCursor():a.drawing.action.call(this.drawingToolbar,a.drawing)});
|
|
this._$toolsContainer.append(b)}}.bind(this))};
|
|
TradingView.FavoriteDrawingToolBar.prototype.init=function(){var a=this,b=$('<div class="drawing-favorites-toolbar"><div class="drag-handler"><i></i></div></div>').css("position","absolute").hide().draggable({handle:".drag-handler",stop:function(){TVSettings.setJSON(a._POSITION_KEY,b.offset())}});$(window).resize(function(){a._visible&&a._updatePosition()});b.on("contextmenu",function(b){b.preventDefault();var c=new TradingView.Action({text:$.t("Hide Favorite Drawings Toolbar")});c.callbacks().subscribe(null,
|
|
function(){var b=a.drawingToolbar.activeChartWidget().model();if(b){var c=!a.visibleProperty.value();b.setProperty(a.visibleProperty,c,$.t("Hide Favorite Drawings Toolbar"))}});TradingView.ContextMenu.createMenu([c]).show(b)});this._$widget=b;this._$toolsContainer=$('<div class="tools-group"/>').appendTo(b);this._$widget.appendTo(document.body);var c;this._$toolsContainer.sortable({tolerance:"pointer",start:function(a,b){TradingView.Tooltip.hide();c=b.item.index()},stop:function(a,b){var f=b.item.index();
|
|
c!=f&&(this.tools.splice(f,0,this.tools.splice(c,1)[0]),this.drawingToolbar._favoritesEvent.fire("reorder"))}.bind(this)})};
|
|
TradingView.FavoriteDrawingToolBar.prototype._updatePosition=function(){var a=this._$widget,b=$(window),c=b.height()-a.outerHeight(),b=b.width()-a.outerWidth(),d=TVSettings.getJSON(this._POSITION_KEY,{left:b/2,top:window.headerChartPanel.outerHeight()+61}),d={top:Math.min(c,Math.max(d.top,0)),left:Math.min(b,Math.max(d.left,0))};a.css(d);a.draggable("option","containment",[0,0,b,c])};
|
|
TradingView.FavoriteDrawingToolBar.prototype.showWidget=function(){this._visible=!0;this.render();this._$widget.show();this._updatePosition()};TradingView.FavoriteDrawingToolBar.prototype.hideWidget=function(){this._$widget.hide();this._visible=!1};TradingView.FavoriteDrawingToolBar.prototype.setVisible=function(a){this.visibleProperty.setValue(a)};TradingView.FavoriteDrawingToolBar.prototype.toggle=function(a){a?this.show():this.hide()};
|
|
TradingView.FavoriteDrawingToolBar.prototype.show=function(){!this._visible&&0<this.tools.length&&this.showWidget()};TradingView.FavoriteDrawingToolBar.prototype.hide=function(){this._visible&&this.hideWidget()};A6=function(a){function b(){var a=p.last();c.toolsGroupsHeight=a.offset().top+a.outerHeight();$(window).resize()}var c=this;this.options=a=a||{};TradingView.drawingState.init();var d=this._container=a.container;this.D5=a.D6;this._container.on("contextmenu",function(a){a.preventDefault()});if(!a.onWidget&&!TradingView.isMobileView){var e=$("<span>").addClass("main-menu apply-common-tooltip common-tooltip-vertical");d.append($("<div>").addClass("tools-group").append(e));
|
|
this._mainMenuWidget=new TradingView.MainMenuWidget(e)}this._allToolGroups=[];this._toolsFilter=a.drawingsAccess?new A6.ModernToolsFilter(a.drawingsAccess):new A6.ObsoleteToolsFilter(a.enabledDrawings,a.disabledDrawings);this.favorites=TVSettings.getJSON("chart.favoriteDrawings",[]);if(!a.readOnly){this._main=e=$("<div>").addClass("tools-group no-delimiter").appendTo(d);this.appendToolsGroup([{tool:"cursor",name:$.t("Cross")},{tool:"dot",
|
|
name:$.t("Dot")},{tool:"arrow",name:$.t("Arrow")},{tool:"eraser",name:$.t("Eraser")}]);this.appendToolsGroup([{tool:"LineToolTrendLine",name:$.t("Trend Line")},{tool:"LineToolTrendAngle",name:$.t("Trend Angle")},{tool:"LineToolHorzLine",name:$.t("Horizontal Line")},{tool:"LineToolHorzRay",name:$.t("Horizontal Ray")},{tool:"LineToolVertLine",name:$.t("Vertical Line")},{tool:"LineToolArrow",name:$.t("Arrow")},{tool:"LineToolRay",name:$.t("Ray")},{tool:"LineToolExtended",name:$.t("Extended")},{tool:"LineToolParallelChannel",
|
|
name:$.t("Parallel Channel")},{tool:"LineToolDisjointAngle",name:$.t("Disjoint Angle")},{tool:"LineToolFlatBottom",name:$.t("Flat Top/Bottom")},{tool:"LineToolRegressionTrend",name:$.t("Regression Trend")}]);this.appendToolsGroup([{tool:"LineToolPitchfork",name:$.t("Pitchfork")},{tool:"LineToolSchiffPitchfork2",name:$.t("Schiff Pitchfork")},{tool:"LineToolSchiffPitchfork",name:$.t("Modified Schiff Pitchfork")},{tool:"LineToolInsidePitchfork",name:$.t("Inside Pitchfork")},{tool:"LineToolPitchfan",
|
|
name:$.t("Pitchfan")},{tool:"LineToolGannSquare",name:$.t("Gann Box")},{tool:"LineToolGannComplex",name:$.t("Gann Square")},{tool:"LineToolGannFan",name:$.t("Gann Fan")},{tool:"LineToolFibRetracement",name:$.t("Fib Retracement")},{tool:"LineToolTrendBasedFibExtension",name:$.t("Trend-Based Fib Extension")},{tool:"LineToolFibSpeedResistanceFan",name:$.t("Fib Speed Resistance Fan")},{tool:"LineToolFibTimeZone",name:$.t("Fib Time Zone")},{tool:"LineToolTrendBasedFibTime",name:$.t("Trend-Based Fib Time")},
|
|
{tool:"LineToolFibCircles",name:$.t("Fib Circles")},{tool:"LineToolFibSpiral",name:$.t("Fib Spiral")},{tool:"LineToolFibSpeedResistanceArcs",name:$.t("Fib Speed Resistance Arcs")},{tool:"LineToolFibWedge",name:$.t("Fib Wedge")},{tool:"LineToolFibChannel",name:$.t("Fib Channel")}]);this.appendToolsGroup([{tool:"LineToolBrush",name:$.t("Brush")},{tool:"LineToolRectangle",name:$.t("Rectangle")},{tool:"LineToolRotatedRectangle",name:$.t("Rotated Rectangle")},{tool:"LineToolEllipse",name:$.t("Ellipse")},
|
|
{tool:"LineToolTriangle",name:$.t("Triangle")},{tool:"LineToolPolyline",name:$.t("Polyline")},{tool:"LineToolBezierQuadro",name:$.t("Curve")},{tool:"LineToolBezierCubic",name:$.t("Double Curve")},{tool:"LineToolArc",name:$.t("Arc")}]);this.appendToolsGroup([{tool:"LineToolText",name:$.t("Text")},{tool:"LineToolTextAbsolute",name:$.t("Anchored Text")},{tool:"LineToolNote",name:$.t("Note")},{tool:"LineToolNoteAbsolute",name:$.t("Anchored Note")},{tool:"LineToolCallout",name:$.t("Callout")},{tool:"LineToolBalloon",
|
|
name:$.t("Balloon")},{tool:"LineToolPriceLabel",name:$.t("Price Label")},{tool:"LineToolArrowMarkLeft",name:$.t("Arrow Mark Left")},{tool:"LineToolArrowMarkRight",name:$.t("Arrow Mark Right")},{tool:"LineToolArrowMarkUp",name:$.t("Arrow Mark Up")},{tool:"LineToolArrowMarkDown",name:$.t("Arrow Mark Down")},{tool:"LineToolFlagMark",name:$.t("Flag Mark")}]);this.appendToolsGroup([{tool:"LineTool5PointsPattern",name:$.t("XABCD Pattern")},{tool:"LineToolABCD",name:$.t("ABCD Pattern")},{tool:"LineToolTrianglePattern",
|
|
name:$.t("Triangle Pattern")},{tool:"LineToolThreeDrivers",name:$.t("Three Drivers Pattern")},{tool:"LineToolHeadAndShoulders",name:$.t("Head & Shoulders")},{tool:"LineToolElliottImpulse",name:$.t("Elliott Impulse Wave (12345)")},{tool:"LineToolElliottTriangle",name:$.t("Elliott Triangle Wave (ABCDE)")},{tool:"LineToolElliottTripleCombo",name:$.t("Elliott Triple Combo Wave (WXYXZ)")},{tool:"LineToolElliottCorrection",name:$.t("Elliott Correction Wave (ABC)")},{tool:"LineToolElliottDoubleCombo",name:$.t("Elliott Double Combo Wave (WXY)")},
|
|
{tool:"LineToolCircleLines",name:$.t("Cyclic Lines")},{tool:"LineToolTimeCycles",name:$.t("Time Cycles")},{tool:"LineToolSineLine",name:$.t("Sine Line")}]);this.appendToolsGroup([{tool:"LineToolRiskRewardLong",name:$.t("Long Position")},{tool:"LineToolRiskRewardShort",name:$.t("Short Position")},{tool:"LineToolPrediction",name:$.t("Forecast")},{tool:"LineToolDateRange",name:$.t("Date Range")},{tool:"LineToolPriceRange",name:$.t("Price Range")},{tool:"LineToolBarsPattern",name:$.t("Bars Pattern")},
|
|
{tool:"LineToolProjection",name:$.t("Projection")}]);if(this._toolsFilter.isToolEnabled("Font Icons")){var f=new this.Button(this.createIconActions(),{addClass:"font-awesome line-tool-icons-popup",buttonClass:"font-awesome"},!0);this._icons=f;e.append(f.element());this._allToolGroups.push(f)}if(!TradingView.isMobileView){e=$("<div>").addClass("tools-group").appendTo(d);f=new this.Button({tool:"zoom",name:"Zoom In",action:function(){TradingView.drawingState.tool.setValue("zoom")}});e.append(f.element());
|
|
this._allToolGroups.push(f);if(c.D5){var g=new this.Button({tool:"zoom-out",name:"Zoom Out",action:function(){var a=c.D5;a&&(a=a.activeChartWidget.value().model())&&a.zoomFromViewport()}});e.append(g.element());g.element().addClass("hidden");(function(){function a(){var d=c.D5.activeChartWidget.value(),e=d.model(),f=!1;e?(b!==e&&(b&&b.zoomStack().onChange().unsubscribe(null,a),e.zoomStack().onChange().subscribe(null,a),b=e),f=!e.zoomStack().isEmpty()):
|
|
d.withModel(null,a);g.element().toggleClass("hidden",!f)}var b=null;c.D5.activeChartWidget.subscribe(a,{callWithLast:!0})})()}f=new this.Button({tool:"measure",name:"Measure (Shift + Click on the chart)",action:function(){TradingView.drawingState.tool.setValue("measure")}});e.append(f.element());this._allToolGroups.push(f)}var e=$("<div>").addClass("tools-group").appendTo(d),f=!!TradingView.drawingState.properties().magnet.value(),h=new this.Button({tool:"magnet",name:"Magnet Mode",
|
|
action:this.ToolbarActions.magnet.bind(this)});this.magnet=h;e.append(h.element());h.activate(f);TradingView.drawingState.properties().magnet.subscribe(this,function(a){h.activate(a.value())});if(!a.onWidget&&!TradingView.isMobileView||R77.enabled("charting_library_base")){var f=!!TradingView.drawingState.properties().stayInDrawingMode.value(),k=new this.Button({tool:"drawginmode",name:"Stay in Drawing Mode",action:this.ToolbarActions.drawingmode.bind(this)});this.drawingmode=k;e.append(k.element());
|
|
k.activate(f);TradingView.drawingState.properties().stayInDrawingMode.subscribe(this,function(a){k.activate(a.value())});var f=!!TradingView.drawingState.lockDrawings().value(),l=new this.Button({tool:"lockAllDrawings",name:"Lock All Drawing Tools",action:this.ToolbarActions.lockDrawings.bind(this)});this.lockDrawings=l;e.append(l.element());l.activate(f);TradingView.drawingState.lockDrawings().subscribe(this,function(a){l.activate(a.value())});var f=!!TradingView.drawingState.hideAllDrawings().value(),
|
|
m=new this.Button({tool:"hideAllDrawings",name:"Hide All Drawing Tools",action:this.ToolbarActions.hideAllDrawings.bind(this)});this.hideAllDrawings=m;e.append(m.element());m.activate(f);TradingView.drawingState.hideAllDrawings().subscribe(this,function(a){m.activate(a.value())});if(R77.enabled("support_multicharts")){var f=!!TradingView.drawingState.drawOnAllCharts().value(),n=new this.Button({tool:"SyncDrawing",name:$.t("Sync drawings to all charts"),action:this.ToolbarActions.drawAllCharts.bind(this)});
|
|
this.drawOnAllCharts=n;e.append(n.element());n.activate(f);TradingView.drawingState.drawOnAllCharts().subscribe(this,function(a){n.activate(a.value())})}this.removeAndObjectsTreeTools=e=$("<div>").addClass("tools-group").appendTo(d);this.showObjectsTree=f=new this.Button({tool:"showObjectsTree",name:$.t("Show Objects Tree"),action:this.ToolbarActions.showObjectsTree.bind(this)});e.append(f.element());this.removeTools=f=new this.Button({tool:"removeAllDrawingTools",name:"Remove All Drawing Tools",
|
|
action:this.ToolbarActions.removeTools.bind(this)});e.append(f.element());e=$("<div>").addClass("tools-group no-delimiter").appendTo(d);this.responsiveToolbar=new this.ResponsiveToolbar(this);e.append(this.responsiveToolbar.getButton().element())}TVSettings.getValue("chart.cursorPreference","cursor");this._favoritesEvent=new Delegate;this._favoritesEvent.subscribe(this,function(a){~["add","remove","reorder"].indexOf(a)&&TVSettings.setJSON("chart.favoriteDrawings",this.favorites.map(function(a){return{tool:a.drawing.tool}}))});
|
|
a.onWidget||(this.favoriteDrawingToolbar=new TradingView.FavoriteDrawingToolBar(this))}a.onWidget||TradingView.isMobileView||$(window).load(function(){this.createBugReportButton();this.createHelpButton(a);loginStateChange.subscribe(this,function(b){!b&&window.is_authenticated&&(this.createBugReportButton(),this.createHelpButton(a))})}.bind(this));a.readOnly||TradingView.drawingState.tool.subscribe(function(a){this._syncView(a)}.bind(this),{callWithLast:!0});$(document).bind("keydown","esc",function(){TradingView.drawingState.resetToCursor(!0)});
|
|
this._twoColumnLayout=!1;if(!a.onWidget&&!TradingView.isMobileView||R77.enabled("charting_library_base")){var p=d.find(".tools-group");window.loaded?b():$(window).load(b);$(window).on("resize",this.updateToolsVisibility.bind(this))}this.visible=new Property;this.visible.subscribe(this,function(a){this._fold(!a.value());TVSettings.setValue("ChartSideToolbarWidget.visible",a.value())});this.visible.setValue("boolean"==typeof a.forceVisible?a.forceVisible:TVSettings.getBool("ChartSideToolbarWidget.visible",
|
|
!0));$('<a href="#" class="tv-close-panel left" title="'+$.t("Hide Drawings Toolbar")+'"></a>').on("click",function(a){var b=this.activeChartWidget().model();b&&(b.setProperty(this.visible,!this.visible.value(),$.t("Hide Drawings Toolbar")),a.preventDefault())}.bind(this)).appendTo(d);a.onResize&&(this.onResize=a.onResize);$(window).on("resize",this.updateLayout.bind(this))};
|
|
A6.prototype.updateToolsVisibility=function(){var a=$(window).height()<this.toolsGroupsHeight+10;a!=this._twoColumnLayout&&(this.magnet.element().toggle(),this.drawingmode.element().toggle(),this.lockDrawings.element().toggle(),this.hideAllDrawings.element().toggle(),this.drawOnAllCharts&&this.drawOnAllCharts.element().toggle(),this.showObjectsTree.element().toggle(),this.removeTools.element().toggle(),this.removeAndObjectsTreeTools.toggle(),this.responsiveToolbar.getButton().toggle(),
|
|
this._twoColumnLayout=a,$(window).resize())};A6.prototype.updateLayout=function(){if(this.onResize)this.onResize(this._container)};A6.prototype.appendToolsGroup=function(a){a=this.filterEnabledTools(this.extendTools(a));0<a.length&&(a=new this.Button(a),this._main.append(a.element()),this._allToolGroups.push(a))};
|
|
A6.prototype.filterEnabledTools=function(a){return a.filter(function(a){return this._toolsFilter.isToolEnabled(a.name)},this)};A6.prototype.element=function(){return this._container};
|
|
A6.prototype._syncView=function(a){if(this._allToolGroups)for(var b=this._allToolGroups.length;b--;){var c=this._allToolGroups[b];if(c.textAsIcon)c.activate("LineToolIcon"==a);else{for(var d=!1,e=c.tools.length;e--;)c.tools[e].tool===a&&(c.setCurrent(e),d=!0);c.activate(d)}}};A6.prototype.activeChartWidget=function(){return this.D5.activeChartWidget.value()};
|
|
A6.prototype.extendTools=function(a){var b=this,c=this._addToFavorite.bind(this),d=b._removeFromFavorite.bind(this),e=this.favorites.reduce(function(a,b){a.push(b.tool);return a},[]);return $.map(a,function(a){var g={tool:a.tool,name:a.name,localizedName:$.t(a.name),addClass:b._toolsFilter.isToolGrayed(a.name)&&" grayed",action:function(){TradingView.drawingState.tool.value()!==a.tool&&(TradingView.supportTouch()&&b.D5.selectedSource.value()&&b.activeChartWidget().model().lineBeingCreated()&&
|
|
b.activeChartWidget().model().cancelCreatingLine(),TradingView.drawingState.tool.setValue(a.tool))},favOptions:{allowMakeFavorite:!b.options.onWidget,addToFavorite:c,removeFromFavorite:d}},h=!!~e.indexOf(a.tool);if(h)for(var k=0;k<b.favorites.length;k++)b.favorites[k].tool==a.tool&&(b.favorites[k].drawing=g);g.favOptions.isFavorite=h;return g})};
|
|
A6.prototype._addToFavorite=function(a){a.favOptions.isFavorite=!0;a={drawing:a,tool:a.tool};this.favorites.push(a);this._favoritesEvent.fire("add",a)};A6.prototype._removeFromFavorite=function(a){a.favOptions.isFavorite=!1;for(var b=0;b<this.favorites.length;b++)this.favorites[b].drawing.tool===a.tool&&(this.favorites.splice(b,1),this._favoritesEvent.fire("remove",a))};
|
|
A6.prototype.createIconActions=function(a){var b=this;a=TradingView.LineToolIcon.availIcons;var c=TVSettings.getJSON("linetoolicon.recenticons");c&&(a=c.concat(["separator"]).concat(a));return $.map(a,function(a){return"separator"===a?{separator:!0}:{tool:"LineToolIcon",name:String.fromCharCode(a),addClass:b._toolsFilter.isToolGrayed("Font Icons")&&" grayed",action:function(){var c=defaults("linetoolicon");c.icon=a;TradingView.saveDefaults("linetoolicon",c);TradingView.drawingState.tool.setValue("LineToolIcon");
|
|
b._icons.setTools(b.createIconActions());c=TVSettings.getJSON("linetoolicon.recenticons")||[];c=$.grep(c,function(b){return b!=a});c.unshift(a);10<c.length&&(c=c.slice(0,10));TVSettings.setJSON("linetoolicon.recenticons",c)}}})};A6.prototype.changeTool=function(a){a?this.D4.setCurrentTool(a):this.D4.setCurrentTool(this.D4.currentCursorTool())};
|
|
A6.prototype._fold=function(a){this._container.toggleClass("hidden",!!a);$(window).resize()};A6.prototype.createHelpButton=function(a){if(window.widgetbar){var b=widgetbar.layout.setHelpButton(),c;a.withWizard&&a.D6&&(c=a.D6.activeChartWidget.value());new TradingView.ChartHelpMenu(b,!!a.withWizard,c)}};
|
|
A6.prototype.createBugReportButton=function(){if(window.widgetbar){var a=widgetbar.layout.setBugReportButton();a.click(function(b){runOrSignIn(function(){a.addClass("active");(new TradingView.UserBugReportDialog).show().on("destroy",a.removeClass.bind(a,"active"))})})}};
|
|
A6.prototype.Button=function(a,b,c){a=Array.isArray(a)?a:[a];this.isGroup=1<a.length;this.textAsIcon=c;this.setTools(a);this._e=$("<span>").addClass("button").addClass("apply-common-tooltip common-tooltip-vertical");this._main=$("<span>").addClass("main");c&&(this._main.addClass("text-as-icon"),this._main.text(this._firstNonGrayedTool().localizedName));this.isGroup&&(this._side=$("<span>").addClass("side"),this._e.addClass("subgroup"));var d=c?"Icon":this.tools[0].localizedName;
|
|
this._e.append(this._main).attr("title",d).append(this._side);c||this._e.hover($.proxy(this,"_hover"),$.proxy(this,"_unhover"));this.isGroup&&(b=$.extend({direction:TradingView.isMobileView?"up":"right",event:"button-popup",addClass:"drawings-popup-list favored-list",reverse:!1,popupSpacing:TradingView.isMobileView?15:4,svg:c?!1:!0},b||{}),c||(b.addClass+=" iconed"),"function"===typeof TradingView.setWidgetLogoOverlayVisibility&&(this._e.on(b.event,function(){TradingView.setWidgetLogoOverlayVisibility(!1)}),
|
|
b.onRemove=function(){TradingView.setWidgetLogoOverlayVisibility(!0)}),TradingView.bindPopupMenu(this._e,null,b));this.activated=a.activated||!1;this.setCurrent(this.tools.indexOf(this._firstNonGrayedTool()));this.isGroup?(Modernizr.touch?(this._main.bind("touchstart",$.proxy(this,"_startclick")),this._main.bind("touchend",$.proxy(this,"_stopclick"))):(this._main.mousedown($.proxy(this,"_startclick")),this._main.mouseup($.proxy(this,"_stopclick"))),this._side.click($.proxy(this,"_submenu")),this._e.click(function(){return!1})):
|
|
this._e.click($.proxy(this,"action"))};A6.prototype.Button.prototype.toggle=function(){switch(this.element().css("display")){case "none":this.element().css("display","block");break;case "block":this.element().css("display","none")}};A6.prototype.Button.prototype._isToolGrayed=function(a){return a.addClass&&-1<a.addClass.indexOf("grayed")};
|
|
A6.prototype.Button.prototype._firstNonGrayedTool=function(){for(var a=0;a<this.tools.length;++a){var b=this.tools[a];if(!this._isToolGrayed(b)&&!b.separator)return b}return this.tools[0]};A6.prototype.Button.prototype.element=function(){return this._e};
|
|
A6.prototype.Button.prototype.setTools=function(a){if(Array.isArray(a)){var b=this;this.tools=$.map(a,$.proxy(function(a,d){return a.separator?{separator:!0}:{icon:b.textAsIcon?a.name:a.tool,name:a.name,localizedName:a.localizedName||$.t(a.name),tool:a.tool,addClass:a.addClass,action:"function"===typeof a.action?a.action:b._defaultAction,favOptions:a.favOptions}},this))}};
|
|
A6.prototype.Button.iconIndices={LineToolTextAbsolute:0,LineToolArc:1,LineToolArrowMarkDown:2,LineToolArrowMarkUp:3,LineToolCircleLines:4,LineToolArrowMarkLeft:5,LineToolArrowMarkRight:6,LineToolFibSpeedResistanceArcs:7,arrow:8,LineToolBalloon:9,LineToolBrush:10,LineToolFibSpeedResistanceFan:11,LineToolArrow:12,cursor:13,LineToolHorzLine:14,LineToolFibRetracement:15,LineToolPitchfork:16,LineToolText:17,LineToolTrendLine:18,LineToolTrendAngle:82,LineToolFibTimeZone:19,
|
|
LineToolVertLine:20,dot:21,LineToolEllipse:22,LineToolFlagMark:23,eraser:24,LineToolExtended:25,LineToolFibCircles:26,LineToolFibSpiral:74,LineToolGannFan:27,LineToolGannSquare:28,LineToolGannComplex:67,LineToolParallelChannel:29,LineToolDisjointAngle:75,LineToolFlatBottom:76,LineToolPolyline:30,LineToolRectangle:31,LineToolRotatedRectangle:81,LineToolCallout:32,LineToolPriceLabel:77,LineToolRay:33,LineToolSchiffPitchfork:72,LineToolSchiffPitchfork2:34,LineToolTrendBasedFibExtension:37,LineToolTrendBasedFibTime:66,
|
|
LineToolTriangle:38,modes:39,LineToolElliottImpulse:40,LineToolElliottTriangle:41,LineToolElliottTripleCombo:42,LineToolElliottCorrection:43,LineToolElliottDoubleCombo:44,LineToolRegressionTrend:45,LineToolFibWedge:46,zoom:47,LineToolPitchfan:48,LineToolHorzRay:49,LineToolPrediction:50,"zoom-out":51,LineToolPriceRange:52,LineToolDateRange:53,LineToolRiskRewardLong:54,LineToolRiskRewardShort:55,removeAllDrawingTools:57,LineToolBarsPattern:59,LineToolProjection:60,LineTool5PointsPattern:61,LineToolABCD:62,
|
|
LineToolTrianglePattern:63,LineToolThreeDrivers:64,LineToolHeadAndShoulders:65,LineToolInsidePitchfork:68,measure:69,magnet:70,drawginmode:71,LineToolFibChannel:73,lockAllDrawings:78,hideAllDrawings:79,showObjectsTree:80,LineToolNote:83,LineToolNoteAbsolute:84,SyncDrawing:85,LineToolBezierQuadro:86,LineToolBezierCubic:87,LineToolTimeCycles:89,LineToolSineLine:88,group:90};A6.prototype.Button.prototype._getBackgroundByTile=function(a,b){return[b?33:1,32*a+2]};
|
|
A6.prototype.Button.prototype._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};A6.prototype.Button.prototype._getIconBackgroundPosition=function(a,b){return this._getBackgroundPosition(this._getIconOffset(a,b))};A6.prototype.Button.prototype._getIconOffset=function(a,b){return this._getBackgroundByTile(A6.prototype.Button.iconIndices[a],b)};
|
|
A6.prototype.Button.prototype._setIcon=function(a,b,c){c||(a=$(svgAsset(a,"30x30")),this._main.empty().append(a))};A6.prototype.Button.prototype._setTextAsIcon=function(a){this._main.text(a)};A6.prototype.Button.prototype.setIcon=function(a){this.icon=a;this.textAsIcon?this._setTextAsIcon(a):this._setIcon(a,this.activated)};
|
|
A6.prototype.Button.prototype._hover=function(){this._setIcon(this.icon,!0,!0)};A6.prototype.Button.prototype._unhover=function(){this._setIcon(this.icon,this.activated||!1)};
|
|
A6.prototype.Button.prototype._getPopupIcon=function(a){a=A6.prototype.Button.iconIndices[a];return{image:TradingView.wrapUrl("url('/static/images/sidetoolbar/instruments.png')"),offset:{x:-64,y:32*-a}}};
|
|
A6.prototype.Button.prototype._getPopupMenuItems=function(){function a(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")}var b=this;return $.map(this.tools,function(c,d){if(c.separator)return c;var e;!b.textAsIcon&&c.favOptions.allowMakeFavorite&&(e=$('<span class="to-quick" title="'+a(c.favOptions.isFavorite)+'"></span>').append(svgAsset("star","16x16")).toggleClass("quicked",!!c.favOptions.isFavorite));return{title:""+c.localizedName,action:function(){b._isToolGrayed(c)?
|
|
D17.emit("onGrayedObjectClicked",{type:"drawing",name:c.name}):(b.setCurrent(d),c.action.call(b,c),$(document).trigger("click"),$(document).trigger("touch"))},active:d==b.current,icon:b.textAsIcon?null:b._getPopupIcon(c.icon),svg:b.textAsIcon?!1:$(svgAsset(c.icon,"30x30")),addClass:c.addClass,buttons:b.textAsIcon||!c.favOptions.allowMakeFavorite?void 0:[{el:e,handler:function(b){c.favOptions.isFavorite?(c.favOptions.removeFromFavorite(c),e.removeClass("quicked").attr("title",
|
|
a(!1))):(c.favOptions.addToFavorite(c),e.addClass("quicked").attr("title",a(!0)));b.stopPropagation();b.preventDefault()}}]}})};A6.prototype.Button.prototype._defaultAction=function(){this.activate()};A6.prototype.Button.prototype._startclick=function(){this._e.hasClass("active")?($(document).trigger("click"),this.action()):this._delay=setTimeout($.proxy(function(){this._delay=null;this.openSubmenu()},this),200)};
|
|
A6.prototype.Button.prototype._stopclick=function(){this._delay&&(clearTimeout(this._delay),this._delay=null,this.action())};A6.prototype.Button.prototype._submenu=function(){this._e.hasClass("active")?$(document).trigger("click"):this.openSubmenu()};
|
|
A6.prototype.Button.prototype.activate=function(a){(this.activated=a=void 0!==a?!!a:!0)?this._e.addClass("selected"):this._e.removeClass("selected");this.textAsIcon||this._setIcon(this.icon,a)};A6.prototype.Button.prototype.action=function(){var a=this.getCurrent();this._isToolGrayed(a)?D17.emit("onGrayedObjectClicked",{type:"drawing",name:a.name}):a.action.call(this,a)};
|
|
A6.prototype.Button.prototype.openSubmenu=function(){this._e.trigger("button-popup",[this._getPopupMenuItems()])};A6.prototype.Button.prototype.setCurrent=function(a){if(0<=a&&a<this.tools.length){var b=this.tools[a];this.setIcon(b.icon);this._isToolGrayed(b)?this._e.find(".main").addClass(" grayed"):this._e.find(".main").removeClass(" grayed");this.isGroup&&!this.textAsIcon&&this._e.attr("title",b.localizedName);this.current=a}};
|
|
A6.prototype.Button.prototype.getCurrent=function(){return this.tools[this.current]};A6.prototype.Button.prototype.setCurrentTool=function(a,b){var c=this;if("LineToolIcon"===a){var d=String.fromCharCode(defaults("linetoolicon").icon);$.each(this.tools,function(a,b){if(b.icon==d)return c.setCurrent(a),c.activate(),!1})}else $.each(this.tools,function(b,d){if(d.tool==a)return c.setCurrent(b),c.activate(),!1})};
|
|
A6.prototype.ResponsiveToolbar=function(a,b){this.initButton(a,b);this.initPopupMenu()};
|
|
A6.prototype.ResponsiveToolbar.prototype.initButton=function(a){var b=[this.getMenuItem("Magnet Mode",a.ToolbarActions.magnet.bind(a),a.magnet.activated),this.getMenuItem("Stay in Drawing Mode",a.ToolbarActions.drawingmode.bind(a),a.drawingmode.activated),this.getMenuItem("Lock All Drawing Tools",a.ToolbarActions.lockDrawings.bind(a),a.lockDrawings.activated),this.getMenuItem("Hide All Drawing Tools",a.ToolbarActions.hideAllDrawings.bind(a),a.hideAllDrawings.activated),
|
|
a.drawOnAllCharts&&this.getMenuItem("Sync drawings to all charts",a.ToolbarActions.drawAllCharts.bind(a),a.drawOnAllCharts.activated),this.getSeparator(),this.getMenuItem("Show Objects Tree...",a.ToolbarActions.showObjectsTree.bind(a)),this.getMenuItem("Remove All Drawing Tools",a.ToolbarActions.removeTools.bind(a))].filter(function(a){return void 0!=a});this.button=new A6.prototype.Button({tool:"group",name:$.t("Show Hidden Tools"),addClass:"block",action:function(){this.button.activate(!this.button.activated);
|
|
this.button.element().trigger("button-popup",[b])}.bind(this)});this.button.element().hide()};A6.prototype.ResponsiveToolbar.prototype.getSeparator=function(){return{separator:!0}};A6.prototype.ResponsiveToolbar.prototype.getMenuItem=function(a,b,c){return{title:$.t(a),action:b,addClass:this.getClass(c)}};
|
|
A6.prototype.ResponsiveToolbar.prototype.initPopupMenu=function(){TradingView.bindPopupMenu(this.button.element(),null,{direction:"right",event:"button-popup",reverse:!0,notCloseOnButtons:!0,onRemove:function(){this.button.activate(!1)}.bind(this)})};A6.prototype.ResponsiveToolbar.prototype.getClass=function(a){var b="setting-hidden";a&&(b+=" checked");return b};
|
|
A6.prototype.ResponsiveToolbar.prototype.getButton=function(){return this.button};A6.prototype.ResponsiveToolbar.prototype.getButtonElement=function(){return this.button.element()};
|
|
A6.prototype.ToolbarActions={magnet:function(a){this.magnet.activate(!this.magnet.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().magnet.setValue(this.magnet.activated);TradingView.saveDefaultProperties(!1)},drawingmode:function(){this.drawingmode.activate(!this.drawingmode.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().stayInDrawingMode.setValue(this.drawingmode.activated);TradingView.saveDefaultProperties(!1)},
|
|
lockDrawings:function(){this.lockDrawings.activate(!this.lockDrawings.activated);TradingView.drawingState.lockDrawings().setValue(this.lockDrawings.activated)},hideAllDrawings:function(){this.hideAllDrawings.activate(!this.hideAllDrawings.activated);TradingView.drawingState.hideAllDrawings().setValue(this.hideAllDrawings.activated)},drawAllCharts:function(){this.drawOnAllCharts.activate(!this.drawOnAllCharts.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.drawOnAllCharts().setValue(this.drawOnAllCharts.activated);
|
|
TradingView.saveDefaultProperties(!1)},showObjectsTree:function(){this.activeChartWidget().showSourceProperties()},removeTools:function(){this.D5.activeChartWidget.value().model().removeAllDrawingTools()}};A6.ObsoleteToolsFilter=function(a,b){this._enabledTools=a;this._disabledTools=b};
|
|
A6.ObsoleteToolsFilter.prototype.isToolEnabled=function(a){var b=!!this._enabledTools&&0<this._enabledTools.length,c=!!this._disabledTools&&0<this._disabledTools.length;if(b&&c)throw"Unable to use enabled drawings list and disabled drawings one together. Please use just one of them.";return!c&&!b||b&&0<=this._enabledTools.indexOf(a)||c&&0>this._disabledTools.indexOf(a)};A6.ObsoleteToolsFilter.prototype.isToolGrayed=function(){return!1};
|
|
A6.ModernToolsFilter=function(a){this._toolsAccess=a};A6.ModernToolsFilter.prototype._findTool=function(a){for(var b=null,c=0;c<this._toolsAccess.tools.length;++c){var d=this._toolsAccess.tools[c];if(d.name==a){b=d;break}}return b};A6.ModernToolsFilter.prototype.isToolEnabled=function(a){return(a=this._findTool(a))&&a.grayed?!0:"black"==this._toolsAccess.type?!a:!!a};
|
|
A6.ModernToolsFilter.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};A78=function(){this._$wrap=$(document.createElement("span"));this._undo=$('<span class="button undo disabled"></span>').append(svgAsset("undo")).attr("title","").appendTo(this._$wrap);this._redo=$('<span class="button redo disabled"></span>').append(svgAsset("redo")).attr("title","").appendTo(this._$wrap);var a=this;this._undo.click(function(){a.undo()});this._redo.click(function(){a.redo()});A77.undoStack().onChange().subscribe(this,this.update);A77.redoStack().onChange().subscribe(this,
|
|
this.update)};
|
|
A78.prototype.update=function(){var a=A77.undoStack(),b=A77.redoStack();a.isEmpty()?(this._undo.addClass("disabled"),this._undo.attr("title",null)):(this._undo.removeClass("disabled"),this._undo.attr("title",$.t("Undo {0}").format(a.head().text()||"")));b.isEmpty()?(this._redo.addClass("disabled"),this._redo.attr("title",null)):(this._redo.removeClass("disabled"),this._redo.attr("title",$.t("Redo {0}").format(b.head().text()||"")))};
|
|
A78.prototype.undo=function(){this._undo.hasClass("disabled")||(TradingView.trackEvent("GUI","Undo"),A77.undo())};A78.prototype.redo=function(){this._redo.hasClass("disabled")||(TradingView.trackEvent("GUI","Redo"),A77.redo())};A78.prototype.element=function(){return this._$wrap};A78.prototype.undoElement=function(){return this._undo};
|
|
A78.prototype.redoElement=function(){return this._redo};TradingView.FullscreenWidget=function(){var a=this;this.isFullscreen=!1;this._e=$("<span>").addClass("button fullscreen iconed apply-common-tooltip").attr("title",$.t("Fullscreen mode")).append(svgAsset("fullscreen","18x18"));this._e.click(function(){a.startFullscreen()});$(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",function(){var b;["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"].some(function(a){if(!(a in
|
|
document))return!1;b=!!document[a]});null!=b&&(b?a._onStartFullscreen():a._onExitFullscreen())})};TradingView.FullscreenWidget.prototype.element=function(){return this._e};TradingView.FullscreenWidget.prototype.startFullscreen=function(){["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"].some(function(a){if("function"===typeof document.documentElement[a])return document.documentElement[a](),!0});this._onStartFullscreen()};
|
|
TradingView.FullscreenWidget.prototype._onStartFullscreen=function(){var a=this;R77.enabled("side_toolbar_in_fullscreen_mode")?$(".header-chart-panel").hide():$("#chart-area").addClass("fullscreen");this._$exitButton||(this._$exitButton=$('<div class="exit-fullscreen">'+$.t("Exit Full Screen (ESC)")+"</div>").on("click",this.exitFullscreen.bind(this)).appendTo(document.body));$(window).resize();$(document).off("keyup.toggleFullscreen").on("keyup.toggleFullscreen",function(b){27==b.keyCode&&
|
|
a.exitFullscreen()})};TradingView.FullscreenWidget.prototype.exitFullscreen=function(){["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"].some(function(a){if("function"===typeof document[a])return document[a](),!0});this._onExitFullscreen()};
|
|
TradingView.FullscreenWidget.prototype._onExitFullscreen=function(){this._$exitButton&&($(".exit-fullscreen").remove(),delete this._$exitButton);R77.enabled("side_toolbar_in_fullscreen_mode")?$(".header-chart-panel").show():$("#chart-area").removeClass("fullscreen");$(window).resize();$(document).off("keyup.toggleFullscreen")};A53=function(a,b,c){this._chart=a;this.dialog=a.dialog;this._state=b;this._disableContextMenu=!!c;this.lhsPriceAxisWidget=new A54(this,A54.LHS);this.rhsPriceAxisWidget=new A54(this,A54.RHS);this.jqPane=$(document.createElement("td"));this.jqPane.addClass("chart-markup-table");this.jqPane.addClass("pane");this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height","100%");this._dv.css("position",
|
|
"relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqPane);this.canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order","1");$(this.top_canvas).css("left",
|
|
0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this._zoomSelector=$("<div>");this._zoomSelector.addClass("zoom-selector");this._zoomSelector.css("display","none");this._zoomSelector.appendTo(this._dv);this._tooltipSelector=$("<div>");this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden");this._tooltipSelector.appendTo(this._dv);this.legendWidget=new A23(this,this._chart.model(),this._chart._jqMainDiv);this.jqRow=$(document.createElement("tr"));
|
|
this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow);this.jqPane.appendTo(this.jqRow);this.legendWidget.jqTable.appendTo(this._dv);this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow);this.setCursorForTool();TradingView.setMouseEventHandler($(this.top_canvas),this,!0);b&&b!==this._chart.model().panes()[0]&&!this._chart.readOnly()&&(this.paneControls=new A51(this,this._chart.model(),this._dv));this.updateScalesVisibility();this.actions=[];this.readonlyActions=[];this._onKeyUpListener=
|
|
this._onKeyUpListener.bind(this);this._lineCancelledCallback=this._lineCancelledCallback.bind(this);$(window).on("keyup.panewidget",this._onKeyUpListener);this._chart.withModel(this,this._lineCancelledCallback);this._overlays={};this._contextMenuY=this._contextMenuX=0;this._lockDrawingsProperty=TradingView.drawingState.lockDrawings();this._chart.withModel(this,function(){var a=this._chart.model();a.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom);a.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)});
|
|
b&&R77.enabled("move_logo_to_main_pane")&&b._isMainPane&&a.createLogo&&a.createLogo(null,this._dv,!0)};
|
|
A53.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener);this.legendWidget&&(this.legendWidget.jqTable.remove(),delete this.legendWidget);this.paneControls&&(this.paneControls.jqDiv.remove(),delete this.paneControls);this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var a in this)delete this[a]};
|
|
A53.prototype.cancelZoom=function(){this._zoomSelector.css("display","none");delete this._firstZoomPoint};A53.prototype._onKeyUpListener=function(a){27==a.keyCode&&(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom(),this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip())};
|
|
A53.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(a){}};A53.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()};
|
|
A53.prototype.priceAxisByCanvas=function(a){return a===this.lhsPriceAxisWidget.canvas||a===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:a===this.rhsPriceAxisWidget.canvas||a===this.rhsPriceAxisWidget.canvas?this.rhsPriceAxisWidget:null};A53.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value());this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())};
|
|
A53.prototype.chart=function(){return this._chart};A53.prototype.state=function(){return this._state};A53.prototype.setState=function(a){this._state=a};A53.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:R75.DEFAULT_STRETCH_FACTOR};A53.prototype.setStretchFactor=function(a){this._state&&(this._state._stretchFactor=a)};
|
|
A53.prototype.mouseEnterEvent=function(a){if(a=this._chart.model())a.crossHairSource().visible=!0};A53.prototype.isLineTool=function(a){a=TradingView[a];return"function"===typeof a&&a.prototype instanceof R47};A53.prototype.hideInplaceEditor=function(){return this._inplaceEditor?(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0):!1};
|
|
A53.prototype._processMouseMoveWhileZoom=function(a){this._state.defaultPriceScale().coordinateToPrice(a.localY);var b=Math.floor(this._chart.model().timeScale().coordinateToIndex(a.localX)),b=this._chart.model().timeScale().indexToCoordinate(b)-.5*this._chart.model().timeScale().barSpacing(),c=a.localY,d=Math.abs(b-this._firstZoomPoint.x),c=Math.abs(c-this._firstZoomPoint.y);b<this._firstZoomPoint.x?this._zoomSelector.css("left",b):this._zoomSelector.css("left",this._firstZoomPoint.x);
|
|
a.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",a.localY):this._zoomSelector.css("top",this._firstZoomPoint.y);this._zoomSelector.width(d);this._zoomSelector.height(c)};
|
|
A53.prototype._finishZoom=function(a){var b=this._state.defaultPriceScale().coordinateToPrice(a.localY);a=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX));a!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,a,this._firstZoomPoint.price,b,this.state());this._zoomSelector.css("display","none");this._firstZoomPoint=null;TradingView.drawingState.resetToCursor()};
|
|
A53.EvironmentState=function(a){a.shiftKey&&(this.shift=!0);a.ctrlKey&&(this.control=!0)};A53.prototype.checkMovepoint=function(a){return a==TradingView.HitTestResult.MOVEPOINT||a==TradingView.HitTestResult.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()};
|
|
A53.prototype.mouseDownEvent=function(a){document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear();this._updateCommonTooltip(null);var b=this._chart.model(),c=new A53.EvironmentState(a);this.hideInplaceEditor();TradingView.supportTouch()&&
|
|
(this._skipFirstMove=!0);var d=this._state.defaultPriceScale();if(!d.isEmpty()&&!b.timeScale().isEmpty()){var e=b.crossHairSource();TradingView.supportTouch()&&"LineToolBrush"!=TradingView.drawingState.tool.value()||b.setCurrentPosition(a.localX,a.localY,this._state);var d=e.price,f=e.index;e.startMeasurePoint()&&e.endMeasurePoint()&&e.clearMeasure();c.shift&&TradingView.drawingState.toolIsCursor(TradingView.drawingState.tool.value())&&TradingView.drawingState.tool.setValue("measure");if("measure"!==
|
|
TradingView.drawingState.tool.value()||e.startMeasurePoint())if(e.startMeasurePoint()&&!e.endMeasurePoint())e.finishMeasure({price:d,index:f,x:a.localX,y:a.localY}),TradingView.drawingState.resetToCursor();else if(this._firstZoomPoint)this._finishZoom(a);else if("zoom"===TradingView.drawingState.tool.value())b=b.timeScale().indexToCoordinate(f)-.5*b.timeScale().barSpacing(),this._firstZoomPoint={price:d,index:f,x:b,y:a.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",
|
|
b),this._zoomSelector.css("top",a.localY),this._zoomSelector.width(0),this._zoomSelector.height(0);else if(b.createUndoCheckpoint(),this.isLineTool(TradingView.drawingState.tool.value())||b.lineBeingCreated())this._mouseDownEventForLineTool(a,c,f,d);else{d=(e=this.dataSourceAtPoint(a.localX,a.localY))&&e.source&&e.source.customization?e.source.customization:{};if(e.hittest&&e.hittest.result()==TradingView.HitTestResult.CUSTOM){var g=e.hittest.data().mouseDownHandler;g&&g()}if(!this._chart.readOnly()){e&&
|
|
!d.disableSelection&&((g=(g=e.hittest&&e.hittest.result()>TradingView.HitTestResult.MOVEPOINT_BACKGROUND)||e.hittest&&e.hittest.result()==TradingView.HitTestResult.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any())?b.setSelectedSource(e.source,e.hittest&&e.hittest.data()):b.setSelectedSource(null));if(e.source&&"eraser"===TradingView.drawingState.tool.value()&&!d.disableErasing&&(TradingView.isInherited(e.source.constructor,R47)||TradingView.isInherited(e.source.constructor,
|
|
TradingView.Study))){f=e.hittest.eraseMarker();a.ctrlKey&&void 0!==f&&e.source.processErase?e.source.processErase(b,f):b.removeSource(e.source);return}d=e.source&&TradingView.isInherited(e.source.constructor,R47)&&e.source.isLocked();if(!this._lockDrawingsProperty.value()&&!d){if(e.source&&e.source.userEditEnabled&&!e.source.userEditEnabled())return;if(e.hittest&&e.hittest.result()===TradingView.HitTestResult.CHANGEPOINT){d=e.source.priceScale();d=d.coordinateToPrice(a.localY);
|
|
b.startChangingLinetool(e.source,{index:f,price:d},e.hittest.data(),c);this._updateTooltip(a.localX,a.localY);return}if(e.hittest&&this.checkMovepoint(e.hittest.result())){e.source.isFixed&&e.source.isFixed()?b.startMovingSource(e.source,new MathEx.Point(a.localX,a.localY),e.hittest.data()):(d=e.source.priceScale(),d=d.coordinateToPrice(a.localY),b.startMovingSource(e.source,{index:f,price:d},e.hittest.data()));return}}if(e.source&&TradingView.isInherited(e.source.constructor,TradingView.PriceDataSource)){this._chart.draggingSource=
|
|
e.source;return}}e.hittest&&e.hittest.result()==TradingView.HitTestResult.REGULAR||(this._processing=!0)}else e.startMeasuring({price:d,index:f,x:a.localX,y:a.localY},this._state)}};A53.prototype._finishTool=function(a){var b=this._chart.model(),c=TradingView.drawingState.tool.value();TradingView.drawingState.resetToCursor();this._hideTooltip();b.setSelectedSource(a);this._chart.isTextTool(c)&&(c=b.createUndoCheckpoint(),a=new TradingView.EditObjectDialog(a,b,c),a.show(),a.focusOnText())};
|
|
A53.prototype._mouseDownEventForLineTool=function(a,b,c,d){var e=this._chart.model(),f=!1,g=null,h=a.localX,k=a.localY,l=this._chart.model().model().crossHairSource(),m=TradingView.drawingState.tool.value();TradingView.drawingState.hideAllDrawings().setValue(!1);TradingView.drawingState.lockDrawings().setValue(!1);TradingView.supportTouch()&&this.isLineTool(m)&&"LineToolBrush"!==m&&!e.lineBeingCreated()&&(this._startTouchPoint=new MathEx.Point(h,k),this._initCrossHairPosition=l.currentPoint(),
|
|
this._skipFirstMove=!0);if(!e.lineBeingCreated()||e.lineBeingCreated()instanceof TradingView.LineToolBrush)TradingView.supportTouch()&&"LineToolBrush"!=m||(g=e.createLineTool(this._state,{index:c,price:d},m),e.lineBeingCreated()||(f=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint){this._startTouchPoint=new MathEx.Point(h,k);d=e.lineBeingCreated().points();d=d.item(d.size()-1);a=e.timeScale().indexToCoordinate(d.index);d=d.price;b=e.lineBeingCreated().priceScale();
|
|
b.isPercent()&&(e=e.lineBeingCreated().ownerSource().firstValue(),d=b.priceRange().convertToPercent(d,e));e=b.priceToCoordinate(d);this._lastDrawingPoint=new MathEx.Point(a,e);return}}else g=e.lineBeingCreated(),f=e.paneForSource(g),f!==this._state&&(d=this._dv.offset(),h=a.localX+d.left,k=a.localY+d.top,d=this._chart.paneByState(f)._dv.offset(),h-=d.left,k-=d.top,d=g.priceScale().coordinateToPrice(k),c=Math.round(e.timeScale().coordinateToIndex(h))),f=e.coninueCreatingLine({index:c,price:d},b);e.setSelectedSource(g);
|
|
f?this._finishTool(g):TradingView.supportTouch()&&"LineToolBrush"!=m||this._updateTooltip(a.localX,a.localY)};A53.prototype._equalsCursorCache=function(a,b){return TradingView.drawingState.toolIsCursor(a.tool)?a.tool===b.tool&&a.theme===b.theme&&a.crosshair===b.crosshair:a.tool===b.tool&&a.theme===b.theme};
|
|
A53.prototype._setCursor=function(a){this._cursorCache&&this._equalsCursorCache(this._cursorCache,a)||(this._cursorCache=a,TradingView.drawingState.toolIsCursor(a.tool)?this.jqPane.css("cursor",a.crosshair):this.jqPane.css("cursor",TradingView.cursorCss(a.state.name,a.state.hotspot,a.theme)))};
|
|
A53.prototype.setCursorForTool=function(a,b){var c={_default:{name:"cursor_cross",hotspot:"11 11"},zoom:{name:"zoom",hotspot:"5 5"},pointer:{name:"cursor_pointinghand",hotspot:"13 7"},dragger:{name:"cursor_closed_hand",hotspot:"8 8"}},d=TradingView.drawingState.tool.value();TradingView.drawingState.toolIsCursor(d)&&(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved()?d="dragger":a&&(d="pointer"));this._chart.model()&&this._chart.model().lineBeingEdited()?
|
|
d=this._chart.model().lineBeingEdited()._constructor:b==TradingView.HitTestResult.CHANGEPOINT&&(d=a._constructor);var e=c._default;d in c&&(e=c[d]);this._setCursor({tool:d,theme:"light",state:e,crosshair:this.defaultPaneCursor("light")})};A53.prototype.setDragToAnotherPaneCursor=function(){this._setCursor({tool:"dragger",theme:"light",state:{name:"cursor_closed_hand_move",hotspot:"8 8"},crosshair:this.defaultPaneCursor("light")})};
|
|
A53.prototype.defaultPaneCursor=function(a){var b={cursor:{name:"cursor_cross",hotspot:"11 11"},dot:{name:"cursor_dot",hotspot:"11 11"},crosshair:{name:"cursor_cross",hotspot:"11 11"},eraser:{name:"cursor_eraser",hotspot:"5 5"}},c=b[TradingView.drawingState.tool.value()];c||(c=b[TradingView.drawingState.cursorTool.value()]);return c?TradingView.cursorCss(c.name,c.hotspot,a):"default"};
|
|
A53.prototype.gestureStartEvent=function(a){this._prev_pinch_scale=1;this._pinching=!0};
|
|
A53.prototype.gestureChangeEvent=function(a){var b=(a.originalEvent.pageX||a.originalEvent.offsetX)-5,c=this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,d=this._chart.model().timeScale().width();c&&(b=Math.max(0,b-c));b=Math.min(b,d);b=2*(b/d-.5);c=5*(a.scale-this._prev_pinch_scale);0<c?this._chart.model().zoomIn(b,c):this._chart.model().zoomOut(b,-c);this._prev_pinch_scale=a.scale};A53.prototype.gestureEndEvent=function(a){this._pinching=!1};
|
|
A53.prototype._updateCommonTooltip=function(a){var b=this._lastCommonTooltipData,c=null;a&&a.hittest&&a.hittest.result()===TradingView.HitTestResult.CUSTOM&&(a=a.hittest.data())&&(c=a.tooltip||null);if(null!=b||null!=c)null==c?(this._lastCommonTooltipData=null,TradingView.Tooltip.hide()):b&&c.text===b.text&&c.rect.x===b.rect.x&&c.rect.y===b.rect.y&&c.rect.w===b.rect.w&&c.rect.h===b.rect.h||(this._lastCommonTooltipData=c,b=TradingView.clone(c),c=this.jqPane.offset(),b.rect.x+=c.left,
|
|
b.rect.y+=c.top,TradingView.Tooltip.show(b))};
|
|
A53.prototype.mouseMoveEvent=function(a){var b=this._chart.model();if(b){var c=a.localX,d=a.localY,e=new A53.EvironmentState(a);if(this._firstZoomPoint)this._processMouseMoveWhileZoom(a);else{if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())){this.setCursorForTool();var f=TradingView.drawingState.tool.value(),g=null;this._processing||!TradingView.drawingState.toolIsCursor(f)&&"eraser"!==f||(g=this.dataSourceAtPoint(a.localX,a.localY),
|
|
g.hittest&&g.hittest.result()>TradingView.HitTestResult.MOVEPOINT_BACKGROUND?(this.setCursorForTool(g.source,g.hittest?g.hittest.result():null),!g.source||"eraser"===f&&g.source.constructor===TradingView.Series?b.setHoveredSource(null):b.setHoveredSource(g.source,g.hittest.data())):b.setHoveredSource(null));this._updateCommonTooltip(g)}this._chart.readOnly()&&(g=this.dataSourceAtPoint(a.localX,a.localY),b.hoveredSource(),null!==g.source?b.setHoveredSource(g.source,g.hittest.data()):b.setHoveredSource(null,
|
|
null));if(this._chart.model().lineBeingCreated()&&(a=this._chart.model().lineBeingCreated(),a=this._chart.model().paneForSource(a),a!==this._state)){e=this._dv.offset();c+=e.left;d+=e.top;e=this._chart.paneByState(a)._dv.offset();c-=e.left;d-=e.top;b.setCurrentPosition(c,d,a);return}f=TradingView.drawingState.tool.value();TradingView.supportTouch()&&this.isLineTool(f)||(b.setCurrentPosition(c,d,this._state,e),this._updateTooltip(c,d))}}};
|
|
A53.prototype.pressedMouseMoveEvent=function(a){if(!this._pinching){this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0;var b=new A53.EvironmentState(a),c=this._chart.model(),d=a.localX,e=a.localY;if(this._firstZoomPoint)this._processMouseMoveWhileZoom(a),this._firstZoomPoint.draggingMode=!0;else{var f=TradingView.drawingState.tool.value();if(TradingView.supportTouch()&&this._startTouchPoint&&this.isLineTool(f)&&"LineToolBrush"!==
|
|
f&&!c.lineBeingCreated())this._chart.model().model().crossHairSource(),c=this._initCrossHairPosition,a=(new MathEx.Point(d,e)).substract(this._startTouchPoint),c=c.add(a),this._chart.model().setCurrentPosition(c.x,c.y,this._state),this._updateTooltip(c.x,c.y);else if(!TradingView.supportTouch()||!c.lineBeingCreated()||c.lineBeingCreated()instanceof TradingView.LineToolBrush){c.setCurrentPosition(d,e,this._state,b);this._updateTooltip(d,e);var g=TradingView.drawingState.tool.value();if(!this.isLineTool(g)||
|
|
"LineToolBrush"===f)if(0===a.button||Modernizr.touch)"LineToolBrush"===g?(g=this._state.defaultPriceScale(),g.isEmpty()||(g=g.coordinateToPrice(a.localY),f=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX)),this._chart.model().coninueCreatingLine({index:f,price:g}))):(this._chart.draggingSource&&(f=a.target,(g=this._chart.paneByCanvas(f))&&(g!==this?g.setDragToAnotherPaneCursor():g.setCursorForTool()),(g=this._chart.priceAxisByCanvas(f))&&g.jqCell.css("cursor",TradingView.cursorCss("cursor_closed_hand",
|
|
"8 8")),(f=this._chart.timeAxisByCanvas(f))&&f.jqCell.css("cursor",TradingView.cursorCss("cursor_closed_hand_move","8 8"))),c.timeScale().isEmpty()||(c.lineBeingEdited()?(c.changeLinePoint({x:d,y:e},b),this._updateTooltip(d,e),this.setCursorForTool()):c.sourceBeingMoved()?(g=c.sourceBeingMoved().priceScale(),g.isEmpty()||(f=this._chart.model().timeScale().coordinateToIndex(a.localX),g=g.coordinateToPrice(a.localY),a=c.sourceBeingMoved(),this.setCursorForTool(),TradingView.isInherited(a.constructor,
|
|
R47)&&a.isFixed()?c.moveSource(new MathEx.Point(d,e)):c.moveSource({index:f,price:g},b))):(g=this._state.defaultPriceScale(),this._startScrollingPos||(this._startScrollingPos={x:a.clientX,y:a.clientY}),!this._startScrollingPos||this._startScrollingPos.x===a.clientX&&this._startScrollingPos.y===a.clientY||this._isScrolling||(c.beginUndoMacro("scroll"),g.isEmpty()||c.startScrollPrice(this._state,g,a.localY),c.startScrollTime(a.localX),this._isScrolling=!0,this.setCursorForTool(),
|
|
TradingView.trackEvent("GUI","Scrolling by pane content dragging")),this._isScrolling&&(g.isEmpty()||c.scrollPriceTo(this._state,g,a.localY),c.scrollTimeTo(a.localX)))))}else this._startTouchPoint&&(e=c.lineBeingCreated(),d=this._lastDrawingPoint.x+(a.localX-this._startTouchPoint.x),a=this._lastDrawingPoint.y+(a.localY-this._startTouchPoint.y),e=this._chart.model().paneForSource(e),c.setCurrentPosition(d,a,e),this._updateTooltip(d,a))}}};
|
|
A53.prototype._processMouseUpForCustomHandler=function(a){a=this.dataSourceAtPoint(a.localX,a.localY);a.hittest&&a.hittest.result()==TradingView.HitTestResult.CUSTOM&&(a=a.hittest.data().mouseUpHandler)&&a()};
|
|
A53.prototype.mouseUpEvent=function(a){this._processMouseUpForCustomHandler(a);var b=this._chart.model(),c=this._touchMove;delete this._touchMove;var d=TradingView.drawingState.tool.value();if(TradingView.supportTouch()&&!c&&"LineToolBrush"!==d&&this.isLineTool(d)&&!b.lineBeingCreated()){var e=b.crossHairSource().currentPoint(),c=this._state.defaultPriceScale(),c=c.coordinateToPrice(e.y),f=Math.round(b.timeScale().coordinateToIndex(e.x)),f=b.createLineTool(this._state,{index:f,
|
|
price:c},d);b.setSelectedSource(f);b.lineBeingCreated()||this._finishTool(f);this._updateTooltip(e.x,e.y);delete this._startTouchPoint}else if(!b.lineBeingCreated()||b.lineBeingCreated()instanceof TradingView.LineToolBrush||!this._startTouchPoint)if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)this._finishZoom(a);else{if(0===a.button||TradingView.supportTouch()){this._processing=!1;b=this._chart.model();if(b.lineBeingEdited()){b.endChangingLinetool();this._hideTooltip();return}if("LineToolBrush"===
|
|
d){b.finishLineTool();c=this._state.defaultPriceScale();if(c.isEmpty())return;c=c.coordinateToPrice(a.localY);f=Math.round(this._chart.model().timeScale().coordinateToIndex(a.localX));this._chart.model().coninueCreatingLine({index:f,price:c});return}if(f=b.sourceBeingMoved()){b.endMovingSource();this._hideTooltip();this.setCursorForTool(f);b.D20(new A22(A22.UPDATE_CURSOR_ONLY));return}f=this._isScrolling&&A77.undoStack().head()instanceof
|
|
TradingView.UndoMacroCommand;if(this._isScrolling){c=this._state.defaultPriceScale();b.endScrollPrice(this._state,c);var g=this,h=function(){b.endScrollTime();b.endUndoMacro();g._startScrollingPos=void 0;g._isScrolling=!1;g.setCursorForTool()};if(TradingView.supportTouch()){var c=b.timeScale().m_scrollStartPoint,k=.05*(a.localX-c),l=null,m=function(c){null===l&&(l=c);c=.01*Math.min(100,3*(c-l));c=Math.sqrt(c);b.scrollTimeTo(a.localX+k*c);1<=c?h():requestAnimationFrame(m)};requestAnimationFrame(m)}else h()}if(this._chart.draggingSource){d=
|
|
a.target;(e=this._chart.paneByCanvas(d))&&e!=this&&(c=e._state.findSuitableScale(this._chart.draggingSource),f&&(f=!1,A77.undo()),this._chart.model().move(this._chart.draggingSource,e._state,c));if(c=this._chart.priceAxisByCanvas(d))e=c.pane,c=c._isLeft?e._state.leftPriceScale():e._state.rightPriceScale(),f&&(f=!1,A77.undo()),this._chart.model().move(this._chart.draggingSource,e._state,c);if(c=this._chart.timeAxisByCanvas(d))f&&(f=!1,A77.undo()),
|
|
this._chart.model().move(this._chart.draggingSource,null,null),c.jqCell.css("cursor","");this._chart.draggingSource=null;f=this.dataSourceAtPoint(a.localX,a.localY);this.setCursorForTool(f.source,f.hittest||null)}}delete this._touchMove}else{d=!1;delete this._startTouchPoint;if(!c){f=b.lineBeingCreated();d=f.points().last();c=d.price;e=f.priceScale();if(e.isPercent())var n=b.lineBeingCreated().ownerSource().firstValue(),c=e.priceRange().convertToPercent(c,n);d=b.coninueCreatingLine({index:d.index,
|
|
price:c},{});delete this._lastDrawingPoint}d&&this._finishTool(f)}};A53.prototype.mouseLeaveEvent=function(a){if(a=this._chart.model())TradingView.isMobile.any()||a.model().clearCurrentPosition(),a.setHoveredSource(null),this._updateCommonTooltip(null)};A53.prototype.mouseClickEvent=function(a){if(this._chart.model().hoveredSource()instanceof R96)this._chart.model().hoveredSource().onClicked()};
|
|
A53.prototype.showEditDialogForSource=function(a){this.chart().onWidget()||a.userEditEnabled&&!a.userEditEnabled()||(this._editDialog=new TradingView.EditObjectDialog(a,this._chart.model()),this._editDialog.show())};
|
|
A53.prototype.mouseDoubleClickEvent=function(a){var b=(a=!this._chart.readOnly()&&!this.isLineTool(TradingView.drawingState.tool.value())&&this.dataSourceAtPoint(a.localX,a.localY))&&a.hittest&&a.source;b&&a.hittest.result()<=TradingView.HitTestResult.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(b=null);b&&b.customization&&b.customization.disableSelection&&(b=null);b&&b._metaInfo&&"Sessions@tv-basicstudies"==b._metaInfo.id&&(b=this._chart.model().mainSeries());b&&(a.source instanceof
|
|
TradingView.AlertLabel?TradingView.Alert.editAlert(a.source.alert(),this._chart):b instanceof R96||this.showEditDialogForSource(b))};
|
|
A53.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this._chart.model().setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):TradingView.isInherited(a.constructor,TradingView.ESDStudyBase)?this._studyEsdContextMenu(a).show(b):TradingView.isInherited(a.constructor,TradingView.Study)?this._studyContextMenu(a).show(b):TradingView.isInherited(a.constructor,TradingView.PublishedChartsTimeline)?this._publishedChartsContextMenu(a).show(b):
|
|
TradingView.isInherited(a.constructor,TradingView.LineToolOrder)||TradingView.isInherited(a.constructor,TradingView.LineToolPosition)?this._tradingDrawingsContextMenu(a).show(b):TradingView.isInherited(a.constructor,R47)?this._lineContextMenu(a).show(b):TradingView.isInherited(a.constructor,TradingView.AlertLabel)&&!a.fake&&this._alertLabelContextMenu(a).show(b))};
|
|
A53.prototype.contextMenuEvent=function(a,b){if(R77.enabled("pane_context_menu"))if(this._chart.model().crossHairSource().startMeasurePoint())this._chart.model().crossHairSource().clearMeasure();else if(!(this._pinching||this._disableContextMenu||this.chart().readOnly()||(this._firstZoomPoint&&this.cancelZoom(),this._chart.model().mainSeries().createSessStudy(),this._chart.updateActions(),this.hideInplaceEditor())))if(TradingView.drawingState.toolIsCursor(TradingView.drawingState.tool.value())){this._contextMenuX=
|
|
a.localX;this._contextMenuY=a.localY;var c=this.dataSourceAtPoint(a.localX,a.localY),d=c?c.source:null,c=c&&c.hittest?c.hittest.result():0,c=c>=TradingView.HitTestResult.REGULAR||c>=TradingView.HitTestResult.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any();null!==d&&c?this.showContextMenuForSource(d,a):(this._contextMenu(a).show(a),this._chart.model().setSelectedSource(null));this.paint()}else TradingView.isMobile.any()||(TradingView.drawingState.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),
|
|
this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())};
|
|
A53.prototype._contextMenu=function(a){var b=this._initActions(a);a=this._customActions();a.remove.forEach(function(a){for(var c=0;c<b.length;c++)if(b[c].text===a){b.splice(c,1);break}});a=a.top.concat(b).concat(a.bottom);for(var c=a.length-1;0<c;c--)null===a[c].text&&null===a[c-1].text&&a.splice(c,1);a.length&&null===a[0].text&&a.splice(0,1);a.length&&null===a[a.length-1].text&&a.splice(a.length-1,1);return TradingView.ContextMenu.createMenu(a)};
|
|
A53.prototype.createIndicatorsMenu=function(){var a=this._chart.actions(),b=new TradingView.Action({text:$.t("Indicators")});b.subActions||(b.subActions=[]);var c=b.subActions;c.push(a.insertIndicator);TradingView.isMobile.any()||R77.enabled("charting_library_base")||c.push(a.scriptEditor);c.push(new TradingView.ActionSeparator);c.push(a.paneRemoveAllStudies);return b};
|
|
A53.prototype.createDrawingMenu=function(){var a=this._chart.actions(),b=new TradingView.Action({text:$.t("Drawing Tools")});b.subActions||(b.subActions=[]);var c=b.subActions;c.push(a.drawingToolbarAction);R77.enabled("charting_library_base")||c.push(a.favoriteDrawingToolbar);c.push(new TradingView.ActionSeparator);c.push(a.magnetAction);c.push(a.stayInDrawingModeAction);R77.enabled("support_multicharts")&&c.push(a.syncModeAction);c.push(new TradingView.ActionSeparator);
|
|
c.push(a.lockDrawingsAction);c.push(a.hideAllDrawingsAction);c.push(a.paneRemoveAllDrawingTools);return b};
|
|
A53.prototype._initActions=function(a){var b=this,c=this._chart.actions(),d=[];if(R77.enabled("datasource_copypaste")){var e=TradingView.AppClipboard.get();!e||"study"!==e.type&&"drawing"!==e.type||(e=new TradingView.Action({text:$.t("Paste %s",e.title||e.type),shortcut:"Ctrl-V"}),e.callbacks().subscribe(null,function(){b._chart.onAppClipboardPaste(b.state())}),d.push(e))}R77.enabled("alerts")&&(d.length&&d.push(new TradingView.ActionSeparator),d.push(this._createActionAddAlert({e:a})));
|
|
this.chart().onWidget()||(e=this.createActionTrade(a))&&d.push(e);d.length&&d.push(new TradingView.ActionSeparator);d.push(c.chartReset);d.push(c.symbolSearch);!window.widgetbar||window.widgetbar._customization&&!window.widgetbar._customization.watchlist||d.push(c.addToWatchlist);R77.enabled("symbol_info")&&d.push(c.showSymbolInfoDialog);d.push(new TradingView.ActionSeparator);d.push(this._createLockTimeAxisAction(a));d.push(this._createHVLineAction(a));d.push(this._createHVLineAction(a,"vertical"));
|
|
d.push(new TradingView.ActionSeparator);d.push(c.paneObjectTree);d.push(this.createIndicatorsMenu());R77.enabled("charting_library_base")||d.push(c.applyStudyTemplate);d.push(this.createDrawingMenu());R77.enabled("charting_library_base")&&d.push(c.hideAllMarks);d.push(c.compareOrAdd);(a=this._priceAxisMenu())&&d.push(a);(a=this._timeAxisMenu())&&d.push(a);d.push(new TradingView.ActionSeparator);R77.enabled("charting_library_base")||d.push(c.applyColorTheme);d.push(c.chartProperties);
|
|
pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&(d.push(new TradingView.ActionSeparator),d.push(this._createMTPredictorActions()));return d};
|
|
A53.prototype._customActions=function(){var a={top:[],bottom:[],remove:[]},b=this._chart.model().timeScale(),c=this._state.defaultPriceScale();if(!R77.enabled("custom_items_in_context_menu"))return a;b=b.isEmpty()?void 0:b.indexToUserTime(b.coordinateToIndex(this._contextMenuX));D17.emit("onContextMenu",{unixtime:b?b/1E3:void 0,price:c.isEmpty()?void 0:c.coordinateToPrice(this._contextMenuY),callback:function(b){[].concat(b).forEach(function(b){if(b.text)if(1<
|
|
b.text.length&&"-"===b.text[0])a.remove.push(b.text.slice(1));else{var c;"-"===b.text?c=new TradingView.ActionSeparator:(c=new TradingView.Action({text:b.text}),c.callbacks().subscribe(null,b.click));b.position&&"top"==b.position?a.top.push(c):a.bottom.push(c)}})}});return a};A53.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var a=this._chart.getTimeScale();return new TradingView.Action({text:$.t("Time Scale"),subActions:a.getContextMenuActions()})};
|
|
A53.prototype._priceAxisMenu=function(){var a=this._state.defaultPriceScale();if(a.isEmpty())return null;a=a===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget();return new TradingView.Action({text:$.t("Price Scale"),subActions:a.getContextMenuActions()})};
|
|
A53.prototype._seriesContextMenu=function(a){var b=this._chart.actions(),c=a.properties().visible.value(),d=null;if(this._chart.readOnly())a=[c?b.seriesHide:this.createActionShow(a),new TradingView.ActionSeparator,this.createActionShowCountdown(a),new TradingView.ActionSeparator,this.createActionScaleLeft(a),this.createActionScaleRight(a),this.createActionNoScale(a)],R77.enabled("countdown")||a.splice(3,1),d=TradingView.ContextMenu.createMenu(a);else{d=this._mergeContentMenuItems(a);
|
|
c=[b.showSymbolInfoDialog,b.compare,c?b.seriesHide:this.createActionShow(a),this.createVisualOrderAction(a),new TradingView.ActionSeparator,this.createActionShowCountdown(a),new TradingView.ActionSeparator];R77.enabled("countdown")||c.splice(5,2);R77.enable("symbol_info")||c.splice(0,1);this.chart().onWidget()||c.unshift(b.format);this.chart().canCreateAlertForDataSource(a)&&c.unshift(this._createActionAddAlert({series:a}));if(b=this.createActionLockScale(a))c.push(b),c.push(new TradingView.ActionSeparator);
|
|
if(0<d.length){for(b=0;b<d.length;b++)c.push(d[b]);c.push(new TradingView.ActionSeparator)}c.push(this.createActionScaleLeft(a));c.push(this.createActionScaleRight(a));c.push(this.createActionNoScale(a));pro.hasPackage("mtp-mtpredictor")&&(c.push(new TradingView.ActionSeparator),c.push(this._createMTPredictorActions()));d=TradingView.ContextMenu.createMenu(c)}return d};
|
|
A53.prototype.toggleLockTimeAxis=function(a,b){"boolean"!=typeof b&&(b=!TradingView.drawingState.lockTimeAxis().value());if(b){var c=this._chart.model().timeScale(),d=c.coordinateToIndex(a),c=c.points().roughTime(d);TradingView.drawingState.lockTimeAxisTime.setValue(c)}TradingView.drawingState.lockTimeAxis().setValue(b)};
|
|
A53.prototype._createLockTimeAxisAction=function(a){var b=new TradingView.Action({text:$.t("Lock Cursor In Time"),checkable:!0}),c=TradingView.drawingState.lockTimeAxis().value();b.setChecked(c);b.callbacks().subscribe(null,this.toggleLockTimeAxis.bind(this,a.localX,!c));return b};
|
|
A53.prototype._createHVLineAction=function(a,b){b="vertical"==b&&"vertical"||"horizontal";var c=new TradingView.Action({text:$.t("Create "+("vertical"==b?"Vertical":"Horizontal")+" Line")});c.callbacks().subscribe(this,function(){var c=this._chart.model().timeScale().coordinateToIndex(a.localX),e=this._state.defaultPriceScale().coordinateToPrice(a.localY),c=this._chart.model().createLineTool(this._state,{index:c,price:e},"vertical"==b&&"LineToolVertLine"||"LineToolHorzLine");this._finishTool(c)});
|
|
return c};
|
|
A53.prototype._createMTPredictorActions=function(){var a=this,b=function(b,d,e){b=new TradingView.Action({text:b});b.callbacks().subscribe(a,function(){var a=this._chart.model(),b=a.timeScale(),c=this._state.defaultPriceScale();b.isEmpty()||c.isEmpty()||(e?(c=c.coordinateToPrice(this._contextMenuY),b=Math.round(b.coordinateToIndex(this._contextMenuX)),a.createLineTool(this._state,{index:b,price:c},d)):TradingView.drawingState.tool.setValue(d))});return b};return new TradingView.Action({text:$.t("MTPredictor"),subActions:[b($.t("Apply Manual Risk/Reward"),
|
|
"LineStudyMtpRiskReward",!1),b($.t("Apply Manual Decision Point"),"LineStudyMtpDecisionPoint",!0),b($.t("Analyze Trade Setup"),"LineStudyMtpAnalysis",!0),new TradingView.Action({text:$.t("Apply WPT Up Wave"),subActions:[b($.t("Apply Elliot Wave Intermediate"),"LineStudyMtpElliotWaveMain",!0),b($.t("Apply Elliot Wave Major"),"LineStudyMtpElliotWaveMajor",!0),b($.t("Apply Elliot Wave Minor"),"LineStudyMtpElliotWaveMinor",!0)]}),new TradingView.Action({text:$.t("Apply WPT Up Wave"),subActions:[b($.t("Up Wave 1 or A"),
|
|
"LineStudyMtpUpWave1OrA",!1),b($.t("Up Wave 2 or B"),"LineStudyMtpUpWave2OrB",!1),b($.t("Up Wave C"),"LineStudyMtpUpWaveC",!1),b($.t("Up Wave 3"),"LineStudyMtpUpWave3",!1),b($.t("Up Wave 4"),"LineStudyMtpUpWave4",!1),b($.t("Up Wave 5"),"LineStudyMtpUpWave5",!1)]}),new TradingView.Action({text:$.t("Apply WPT Down Wave"),subActions:[b($.t("Down Wave 1 or A"),"LineStudyMtpDownWave1OrA",!1),b($.t("Down Wave 2 or B"),"LineStudyMtpDownWave2OrB",!1),b($.t("Down Wave C"),"LineStudyMtpDownWaveC",!1),b($.t("Down Wave 3"),
|
|
"LineStudyMtpDownWave3",!1),b($.t("Down Wave 4"),"LineStudyMtpDownWave4",!1),b($.t("Down Wave 5"),"LineStudyMtpDownWave5",!1)]})]})};A53.prototype.createEarningsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowEarnings;a=new TradingView.Action({checkable:!0,text:"Show Earnings",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Earnings")});return a};
|
|
A53.prototype.createDividendsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowDividends;a=new TradingView.Action({checkable:!0,text:"Show Dividends",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Dividends")});return a};
|
|
A53.prototype.createSplitsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowSplits;a=new TradingView.Action({checkable:!0,text:"Show Splits",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().setProperty(b,a.checked,"Show Splits")});return a};
|
|
A53.prototype._studyEsdContextMenu=function(a){var b=[];this._chart.readOnly()||(b.push(this.createDividendsShow(a)),b.push(this.createSplitsShow(a)),b.push(this.createEarningsShow(a)));return TradingView.ContextMenu.createMenu(b)};
|
|
A53.prototype._studyContextMenu=function(a){var b=this._chart.actions(),c=a.properties().visible.value(),d=[],e=null;if(!a.userEditEnabled())return e=TradingView.ContextMenu.createMenu(d);var f=this._chart;a.properties().linkedToSeries&&a.properties().linkedToSeries.value()?this._chart.readOnly()?d.push(c?b.studyHide:this.createActionShow(a)):(this._chart.canCreateAlertForDataSource(a)&&d.push(this._createActionAddAlert({series:a})),d.push(b.format),d.push(c?b.studyHide:this.createActionShow(a)),
|
|
d.push(this.createVisualOrderAction(a)),d.push(new TradingView.ActionSeparator),d.push(b.studyRemove)):this._chart.readOnly()?d=[c?b.studyHide:this.createActionShow(a),new TradingView.ActionSeparator,this.createActionScaleLeft(a),this.createActionScaleRight(a),this.createActionNoScale(a)]:(e=[],d=a.metaInfo(),d.TVScriptSourceCode&&d.scriptIdPart&&(e=[b.viewSourceCode]),d=[],d=d.concat([b.format]),d=d.concat(e),d=d.concat([c?b.studyHide:this.createActionShow(a),this.createVisualOrderAction(a),new TradingView.ActionSeparator]),
|
|
c=this._mergeContentMenuItems(a),c.length&&c.push(new TradingView.ActionSeparator),d=d.concat(c),d.push(this.createActionScaleLeft(a)),d.push(this.createActionScaleRight(a)),d.push(this.createActionNoScale(a)),d.push(new TradingView.ActionSeparator),R77.enabled("datasource_copypaste")&&(c=new TradingView.Action({text:$.t("Copy"),shortcut:"Ctrl-C"}),c.callbacks().subscribe(null,function(){f.onAppClipboardCopy(a)}),d.push(c)),d.push(b.studyRemove),this._chart.canCreateAlertForDataSource(a)&&
|
|
d.unshift(this._createActionAddAlert({series:a})));return e=TradingView.ContextMenu.createMenu(d)};
|
|
A53.prototype.createLineToolTemplateAction=function(a){var b=a.properties(),c=window.lineToolPropertiesToolbar.templatesList,d=new TradingView.Action({text:$.t("Templates")});d.subActions||(d.subActions=[]);var e=d.subActions,f=new TradingView.Action({text:$.t("Save As...")});f.callbacks().subscribe(this,function(){c.showSaveDialog(a)});e.push(f);f=new TradingView.Action({text:$.t("Apply Default")});f.callbacks().subscribe(this,function(){b.restoreFactoryDefaults();window.lineToolPropertiesToolbar.onSourceChanged(a)});
|
|
e.push(f);var g=$.Deferred();c.templatesLoaded().then(function(){var a=c.getData(),b=[];0!==a.length&&b.push(new TradingView.ActionSeparator);$.each(a,function(a,d){var e=new TradingView.Action({text:d});e.callbacks().subscribe(this,function(){c.loadTemplate(d)});e.deleteButton={action:function(a){return function(){var b=this.getTopLevelMenu();b&&b.hide();c.deleteAction(a);return!0}}(e.text)};b.push(e)});g.resolve(b)});f=new TradingView.ActionPlaceholder(g);e.push(f);return d};
|
|
A53.prototype._publishedChartsContextMenu=function(a){var b=this._chart.actions(),c=[];c.push(b.lineHide);if(is_authenticated){var b=new TradingView.Action({checked:a.properties().filter.value()==TradingView.PublishedChartsTimeline.FILTER_NONE,checkable:!0,text:$.t("Suggested ideas & my ideas"),callbackContext:{target:a,value:TradingView.PublishedChartsTimeline.FILTER_NONE}}),d=new TradingView.Action({checked:a.properties().filter.value()==TradingView.PublishedChartsTimeline.FILTER_FOLLOWING,
|
|
checkable:!0,text:$.t("Ideas of the people I follow & my ideas"),callbackContext:{target:a,value:TradingView.PublishedChartsTimeline.FILTER_FOLLOWING}});a=new TradingView.Action({checked:a.properties().filter.value()==TradingView.PublishedChartsTimeline.FILTER_PRIVATE,checkable:!0,text:$.t("My ideas only"),callbackContext:{target:a,value:TradingView.PublishedChartsTimeline.FILTER_PRIVATE}});var e=function(a){var b=a.callbackContext();a=b.target;b=b.value;console.log(b);a.properties().filter.setValue(b);
|
|
a.updateAllViews();a.D0.updateSource(a)};b.callbacks().subscribe(null,e);d.callbacks().subscribe(null,e);a.callbacks().subscribe(null,e);c.push(new TradingView.ActionSeparator);c.push(b);c.push(d);c.push(a)}return TradingView.ContextMenu.createMenu(c)};
|
|
A53.prototype._lineContextMenu=function(a){var b=this._chart.actions(),c=[],d=this._chart;if(this._chart.readOnly())c.push(b.lineHide);else if(a.userEditEnabled()){R77.enabled("alerts")&&TradingView.D18("drawing_alerts")&&!this.chart().onWidget()&&(a.hasAlert.value()?c.push(this._createEditAlertDrawingAction(a)):a.canHasAlert()&&c.push(this._createActionAddAlert({drawing:a})));TradingView.PropertyPagesFactory.hasStylesPropertyPage(a,this._chart.model())&&c.push(b.format);
|
|
c.push(b.paneObjectTree);R77.enabled("charting_library_base")||c.push(this.createLineToolTemplateAction(a));c.push(this.createVisualOrderAction(a));c.push(new TradingView.ActionSeparator);c.push(b.lineHide);c.push(b.lineToggleLock);if(a.properties().clonable){var e=new TradingView.Action({text:$.t("Clone"),callbackContext:{target:a}});e.callbacks().subscribe(this,A53.prototype.cloneLineTool.bind(this,a));c.push(e)}R77.enabled("datasource_copypaste")&&!a.properties().blockCopying&&
|
|
(e=new TradingView.Action({text:$.t("Copy"),shortcut:"Ctrl-C"}),e.callbacks().subscribe(null,function(){d.onAppClipboardCopy(a)}),c.push(e));R77.enabled("support_multicharts")&&(a.linkKey?c.push(b.lineUnlink):c.push(b.lineCopyToCharts));c.push(b.lineRemove);if(a.additionalActions)for(c.push(new TradingView.ActionSeparator),b=a.additionalActions(this._chart.model()),e=0;e<b.length;e++)c.push(b[e])}return TradingView.ContextMenu.createMenu(c)};
|
|
A53.prototype._alertLabelContextMenu=function(a){a=[this._createEditAlertLabelAction(a),this._createStopAlertLabelAction(a),this._createDeleteAlertLabelAction(a),new TradingView.ActionSeparator,this._createAlertToggleHorzLineLabelAction(a),new TradingView.ActionSeparator,this._createShowGlobalAlertPropertiesLabelAction(a)];return TradingView.ContextMenu.createMenu(a)};A53.prototype._tradingDrawingsContextMenu=function(a){return TradingView.ContextMenu.createMenu(a.contextMenuItems())};
|
|
A53.prototype._createAlertToggleHorzLineLabelAction=function(a){var b=a.properties().line.visible,c=new TradingView.Action({checkable:!0,text:$.t("Extend Alert Line"),enabled:!0,checked:b.value()});c.callbacks().subscribe(this,function(a){a=a.checked;var c=(a?$.t("Show"):$.t("Hide"))+" alert label line";this._chart.model().setProperty(b,a,c)});c.setEnabled(a.globalProperties().line.visible.value());return c};
|
|
A53.prototype._createShowGlobalAlertPropertiesLabelAction=function(a){var b=this.chart();a=new TradingView.Action({text:"Visual settings..."});a.callbacks().subscribe(this,function(a){a=b.showChartProperties().find(".properties-tabs-label").filter(function(){return"Events"===$(this).text()});a.length&&a.trigger("click")});return a};
|
|
A53.prototype._createEditAlertDrawingAction=function(a){if(a.hasAlert.value()){var b=this.chart(),c=new TradingView.Action({text:"Edit "+a.title()+" Alert..."});c.callbacks().subscribe(null,function(){runOrSignIn(function(){a.getAlert(function(c){c?TradingView.Alert.editAlert(c,b):console.warn("[Alerts] No alert for "+a.title())})})});return c}};
|
|
A53.prototype._createEditAlertLabelAction=function(a){var b=this.chart(),c=new TradingView.Action({text:"Edit Alert..."});c.callbacks().subscribe(this,function(){TradingView.Alert.editAlert(a.alert(),b)});return c};A53.prototype._createDeleteAlertLabelAction=function(a){var b=new TradingView.Action({text:"Delete Alert"});b.callbacks().subscribe(this,function(){TradingView.Alert.deleteAlert(a.alert())});return b};
|
|
A53.prototype._createStopAlertLabelAction=function(a){var b=new TradingView.Action({text:"Stop Alert"});b.callbacks().subscribe(this,function(){TradingView.Alert.stopAlert(a.alert())});return b};A53.prototype.cloneLineTool=function(a){this._chart.model().cloneLineTool(a)};A53.prototype.setPriceAxisSize=function(a,b){this._priceAxisWidget(a).setSize(b)};
|
|
A53.prototype.setPriceAxisVisible=function(a,b){this._priceAxisWidget(a).setVisible(b);this._cachedStatus=null};A53.prototype.resetPriceAxisOptimalWidth=function(a){this._priceAxisWidget(a).resetOptimalWidth();this._cachedStatus=null};
|
|
A53.prototype.setSize=function(a){this.size&&this.size.equals(a)||(this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,a),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(a.w),this.jqPane.height(a.h),this._cachedStatus=null)};
|
|
A53.prototype.dataSourceAtPoint=function(a,b){var c=null,d=null;if(!this._state)return null;for(var e=this._state.hitTestSources(),f=e.length;0<f--;){var g=e[f],h=g.paneViews(this._state);if(h)for(var k=h.length;0<k--;){var l=h[k].renderer();if(l&&l.hitTest&&(l=l.hitTest(new MathEx.Point(a,b)))){var m=d?d.result():0;l.result()>m&&(d=l,c=g)}}}if(this.containsMainSeries()){e=this._chart.model().barsMarksSources();for(f=0;f<e.length;++f)for(g=e[f],h=g.paneViews(),k=0;k<h.length;k++)if(l=
|
|
h[k].renderer(),l=l.hitTest(new MathEx.Point(a,b))){d=l;c=g;break}if(g=(f=this._chart.model().getActiveStrategySource())&&f._strategyOrdersPaneView){var g=g.renderer(),n;g&&(n=g.hitTest(new MathEx.Point(a,b)))&&(d=n,c=f)}}null===c&&(c=this.legendWidget.dataSourceAtPoint(a,b));return{source:c,hittest:d}};A53.prototype.update=function(){this.lhsPriceAxisWidget.update();this.rhsPriceAxisWidget.update();this.legendWidget.update();this.paneControls&&this.paneControls.update()};
|
|
A53.prototype.updateControls=function(){this.paneControls&&this.paneControls.update()};A53.prototype.drawBackground=function(a,b){TradingView.clearRect(a,0,0,this.size.w,this.size.h,b)};A53.prototype.drawGrid=function(a){for(var b=this._chart.model().gridSource().paneViews(this._state),c=0;c<b.length;c++){a.save();var d=b[c].renderer();d&&d.draw(a);a.restore()}};
|
|
A53.prototype.drawWatermark=function(a){for(var b=this._chart.model().watermarkSource().paneViews(this._state),c=0;c<b.length;c++){a.save();var d=b[c].renderer();d&&d.draw(a);a.restore()}};A53.prototype.drawCrossHair=function(a){var b=this._chart.model().crossHairSource();!b.visible&&TradingView.drawingState.lockTimeAxis().value()&&(b.setLockedPosition(this._state),b.updateAllViews());this._drawSource(b,a)};
|
|
A53.prototype._drawSource=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.length;d++){var e=c[d].renderer();e&&(b.save(),e.draw(b),b.restore())}};A53.prototype._drawSourceStrategyOrders=function(a,b){var c=a._strategyOrdersPaneView;c&&(c=c.renderer())&&(b.save(),c.draw(b),b.restore())};
|
|
A53.prototype._drawSourceBackground=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.length;d++){var e=c[d].renderer();e&&e.drawBackground&&(b.save(),e.drawBackground(b),b.restore())}};
|
|
A53.prototype.drawActiveLineTool=function(a){for(var b=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()],c=0;c<b.length;c++){var d=b[c];d&&this._chart.model().paneForSource(d)===this._state&&this._drawSource(d,a)}};A53.prototype.disableDrawOnTop=function(a){return a&&a.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===a._metaInfo.id};
|
|
A53.prototype.drawSources=function(a){var b=this._state.orderedSources(),c=this._state.model(),d=this._chart.model().hoveredSource(),c=c.crossHairSource(),e=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];this.disableDrawOnTop(d)&&(d=void 0);for(var f=0;f<b.length;f++)this._drawSourceBackground(b[f],a);for(f=0;f<b.length;f++){var g=b[f];g!==c&&g!==d&&-1===e.indexOf(g)&&this._drawSource(g,a)}d&&-1===e.indexOf(d)&&
|
|
-1!==b.indexOf(d)&&this._drawSource(d,a);(b=this._chart.model().getActiveStrategySource())&&this.containsMainSeries()&&this._drawSourceStrategyOrders(b,a)};A53.prototype.recalculatePriceScale=function(){var a=this._state;a.recalculatePriceScale(a.m_rightPriceScale);a.recalculatePriceScale(a.m_leftPriceScale);for(var b=a.D19(),c=0;c<b.length;++c){var d=b[c];a.isOverlay(d)&&(d instanceof R47||a.recalculatePriceScale(d.priceScale()),d.updateAllViews())}};
|
|
A53.prototype.containsMainSeries=function(){return this._state.containsMainSeries()};A53.prototype.drawBarsMarks=function(a,b){if(this.containsMainSeries()&&!b){var c=this;this._chart.model().barsMarksSources().map(function(b){c._drawSource(b,a)})}};
|
|
A53.prototype._syncOverlays=function(){var a=this._state.orderedSources(),b={},c=this;$.each(a,function(){var a=this.paneViews(c._state);if(a)for(var d=0;d<a.length;d++){var g=a[d];g.uid&&(b[g.uid()]=g)}});for(var d in this._overlays)b[d]||(this._dv.remove(this._overlays[d]),this._overlays[d]=void 0);for(d in b)this._overlays[d]||(a=b[d].overlay(),this._dv.append(a),this._overlays[d]=a)};
|
|
A53.prototype.paint=function(a,b){if(a&&this._chart.model())if(this.lhsPriceAxisWidget.paint(a),this.rhsPriceAxisWidget.paint(a),a===A22.FULL_UPDATE&&(this._cachedStatus=null),a===A22.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var c=this.ctx;this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h);this.drawBackground(c,this.backgroundColor());
|
|
this._state&&(this.recalculatePriceScale(),this.drawGrid(c),this.drawWatermark(c),this.drawSources(c),this.drawBarsMarks(c,b),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx))}};A53.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget};A53.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget};
|
|
A53.prototype._priceAxisWidget=function(a){return A54.isLeft(a)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget};A53.prototype.statusWidget=function(){return this.legendWidget};A53.prototype.onScaleLeft=function(a){a=a.callbackContext();-1===this._state.leftPriceScale().D19().indexOf(a)&&this.chart().model().move(a,this._state,this._state.leftPriceScale())};
|
|
A53.prototype.onScaleRight=function(a){a=a.callbackContext();-1===this._state.rightPriceScale().D19().indexOf(a)&&this.chart().model().move(a,this._state,this._state.rightPriceScale())};A53.prototype.onNoScale=function(a){a=a.callbackContext();this._state.isOverlay(a)||this.chart().model().move(a,this._state,null)};A53.prototype.onRiskReward=function(a){a.callbackContext()};
|
|
A53.prototype.createActionTrade=function(a){if(!TradingView.Trading||!TradingView.Trading.availableBrokers().length)return null;var b=this._state.D19().filter(function(a){return a instanceof TradingView.Series})[0];a=TradingView.Trading.chartContextMenuActions(b,a);return new TradingView.Action({text:$.t("Trading"),subActions:a})};
|
|
A53.prototype.createActionRiskReward=function(a){var b=new TradingView.Action({checkable:!1,text:"Risk/Reward",enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onRiskReward);return b};
|
|
A53.prototype.createActionScaleLeft=function(a){var b=new TradingView.Action({checkable:!0,text:$.t("Scale Left"),enabled:!0});b.setCallbackContext(a);b.setChecked(-1!==this._state.leftPriceScale().D19().indexOf(a));b.callbacks().subscribe(this,A53.prototype.onScaleLeft);return b};
|
|
A53.prototype.createActionScaleRight=function(a){var b=new TradingView.Action({checkable:!0,text:$.t("Scale Right"),enabled:!0});b.setCallbackContext(a);b.setChecked(-1!==this._state.rightPriceScale().D19().indexOf(a));b.callbacks().subscribe(this,A53.prototype.onScaleRight);return b};
|
|
A53.prototype.createActionNoScale=function(a){var b=this._chart.model().paneForSource(a).actionNoScaleIsEnabled(a),b=new TradingView.Action({checkable:!0,text:$.t("Screen (No Scale)"),enabled:b});b.setCallbackContext(a);b.setChecked(this._state.isOverlay(a));b.callbacks().subscribe(this,A53.prototype.onNoScale);return b};
|
|
A53.prototype.createActionShowCountdown=function(a){a=new TradingView.Action({checkable:!0,text:$.t("Show Countdown"),enabled:!0});var b=this._chart.model().mainSeries().properties();a._binding=new D14(a,b.showCountdown,this._chart.model(),a.text);a._binding.setValue(b.showCountdown.value());return a};
|
|
A53.prototype.createActionLockScale=function(a){if(!(a instanceof TradingView.Series))return null;var b=new TradingView.Action({checkable:a.properties().lockScale.value(),text:$.t("Lock Scale"),enabled:!0});b._binding=new D14(b,a.properties().lockScale,this._chart.model(),b.text,function(b){this._undoModel.setLockScaleProperty(this._property,b.checked,a,this._undoText)});return b};
|
|
A53.prototype.createActionMergeUp=function(a){if(this._chart.model().paneForSource(a)===this._chart.model().panes()[0])return null;var b=new TradingView.Action({checkable:!1,text:$.t("Merge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onMergeUp);return b};
|
|
A53.prototype.onMergeUp=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().panes()[b-1],c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
A53.prototype.createActionUnmergeUp=function(a){if(!(1<this._chart.model().paneForSource(a).D19().filter(function(a){return TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&a.showInObjectTree()}).length))return null;var b=new TradingView.Action({checkable:!1,text:$.t("Unmerge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onUnmergeUp);return b};
|
|
A53.prototype.onUnmergeUp=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().createPane(b),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
A53.prototype.createActionMergeDown=function(a){var b=this._chart.model().paneForSource(a),c=this._chart.model().panes();if(b===c[c.length-1])return null;b=new TradingView.Action({checkable:!1,text:$.t("Merge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onMergeDown);return b};
|
|
A53.prototype.onMergeDown=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().panes()[b+1],c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
A53.prototype.createActionUnmergeDown=function(a){if(!(1<this._chart.model().paneForSource(a).D19().filter(function(a){return TradingView.isInherited(a.constructor,TradingView.PriceDataSource)&&a.showInObjectTree()}).length))return null;var b=new TradingView.Action({checkable:!1,text:$.t("Unmerge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,A53.prototype.onUnmergeDown);return b};
|
|
A53.prototype.onUnmergeDown=function(a){a=a.callbackContext();var b=this._chart.model().paneForSource(a),b=this._chart.model().panes().indexOf(b),b=this._chart.model().createPane(b+1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
A53.prototype._mergeContentMenuItems=function(a){var b=[],c=this.createActionMergeUp(a);c&&b.push(c);(c=this.createActionUnmergeUp(a))&&b.push(c);(c=this.createActionMergeDown(a))&&b.push(c);(c=this.createActionUnmergeDown(a))&&b.push(c);return b};
|
|
A53.prototype.createActionShow=function(a){var b=new TradingView.Action({checkable:!0,text:$.t("Show"),enabled:!0});b._binding=new D14(b,a.properties().visible,this._chart.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};A53.prototype.bringObjectForward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,1)};
|
|
A53.prototype.sendObjectToBack=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().sendToBack(a)};A53.prototype.bringObjectToFront=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().bringToFront(a)};A53.prototype.sendObjectBackward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,-1)};
|
|
A53.prototype.createVisualOrderAction=function(a){var b=new TradingView.Action({text:$.t("Visual Order")});b.subActions||(b.subActions=[]);var c=new TradingView.Action({text:$.t("Bring to Front")});c.callbacks().subscribe(this,A53.prototype.bringObjectToFront);b.subActions.push(c);var d=new TradingView.Action({text:$.t("Send to Back")});d.callbacks().subscribe(this,A53.prototype.sendObjectToBack);b.subActions.push(d);var e=new TradingView.Action({text:$.t("Bring Forward")});
|
|
e.callbacks().subscribe(this,A53.prototype.bringObjectForward);b.subActions.push(e);var f=new TradingView.Action({text:$.t("Send Backward")});f.callbacks().subscribe(this,A53.prototype.sendObjectBackward);b.subActions.push(f);var g=this._chart.model().paneForSource(a).getZOrderMinMax();d.setEnabled(!0);e.setEnabled(!0);f.setEnabled(!0);c.setEnabled(!0);a.zorder()===g.minZOrder&&(d.setEnabled(!1),f.setEnabled(!1));a.zorder()===g.maxZOrder&&(e.setEnabled(!1),c.setEnabled(!1));
|
|
return b};
|
|
A53.prototype._createActionAddAlert=function(a){function b(a){void 0===a||null===a||TradingView.isNaN(a)||(e+=" ("+a+") ",d.value=a)}var c=this._chart,d={},e=$.t("Add Alert"),f=this._state;if(a.series){var g,h;a.series instanceof TradingView.Series?h=a.series.lastValueData(null,!0,!0):a.series instanceof TradingView.Study&&(f=a.series.metaInfo().plots[0].id,h=a.series.lastValueData(f,!0,!0));h&&(g=h.price);g&&(f=(a.series.priceScale()||this._state.mainDataSource().priceScale()||c.model().mainSeries().priceScale()).formatter(),
|
|
f.formatAsDecimal&&(g=f.formatAsDecimal(g)),b(g));d.series=a.series}else a.e?(g=f.defaultPriceScale(),a=g.coordinateToPrice(a.e.localY),g.isPercentage()&&(h=this._state.mainDataSource().firstValue(),a="undefined"!=typeof h?g.priceRange().convertFromPercent(a,h):null),b(this._state.mainDataSource().formatter().formatAsDecimal(a)),a=f.mainDataSource(),d.series=a):a.drawing&&(e+=" on "+a.drawing.title(),d={drawing:a.drawing});e+="...";a=new TradingView.Action({text:e});a.callbacks().subscribe(null,function(){runOrSignIn(function(){new TradingView.MakeAlertDialog(c,
|
|
d)})});return a};A53.prototype.image=function(){var a={};a.leftAxis=this.leftPriceAxisWidget().image();a.rightAxis=this.rightPriceAxisWidget().image();a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;return a};A53.prototype._updateTooltip=function(a,b){if(!this._rafSet){var c=this;requestAnimationFrame(function(){c._updateTooltipImpl(a,b);c._rafSet=!1});this._rafSet=!0}};
|
|
A53.prototype._updateTooltipImpl=function(a,b){function c(c){TradingView[f].getTooltipText&&(c=TradingView[f].getTooltipText(g)||c);d._tooltipSelector.html(c).removeClass("tooltip-selector-hidden").css(TradingView.isMobile.any()?{left:a-d._tooltipSelector.outerWidth()-16,top:b-d._tooltipSelector.outerHeight()-16}:{left:a+16,top:b+16})}if(this._chart){for(var d=this,e=this._chart.paneWidgets(),f=TradingView.drawingState.tool.value(),g=this._state.model().lineBeingCreated(),h=e.length-
|
|
1;0<=h;h--)e[h]._hideTooltip();TradingView.Study.isStudyLineTool(f)&&!TradingView.isMobile.any()?c($.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!=f&&d.isLineTool(f)&&!d._chart.model().lineBeingCreated()?c($.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!=f&&d.isLineTool(f)&&c($.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor"))}};
|
|
A53.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")};A53.prototype._updateCrosshairOnZoom=function(){if(TradingView.drawingState.lockTimeAxis().value()){var a=this._chart.model().crossHairSource();a.setPosition(a.index,a.price,this._state)}};TradingView.EditObjectDialog=function(a,b,c){this.R99=a;this.D0=b;this._undoCheckpoint=c};$.extend(TradingView.EditObjectDialog,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_PRIORITY_PROPERTIES:250,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_PROPERTIES:"Properties",TAB_NAME_GRAPHICS:"Graphics",TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300});
|
|
TradingView.EditObjectDialog.prototype.hide=function(a){A83.destroy(this._dialogTitle,{undoChanges:!!a})};
|
|
TradingView.EditObjectDialog.prototype._onDestroy=function(a,b){var c=(b||{}).undoChanges;$(window).unbind("keyup.hidePropertyDialog");c?(c=this._undoCheckpoint?this._undoCheckpoint:this._undoCheckpointOnShow)&&this.D0.undoToCheckpoint(c):this.R99.hasAlert.value()&&this.R99.needSynchronizeAlertWithServer&&this.R99.synchronizeAlert(!0);this._undoCheckpointOnShow&&delete this._undoCheckpointOnShow;window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.refresh()};
|
|
TradingView.EditObjectDialog.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")};TradingView.EditObjectDialog.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()};
|
|
TradingView.EditObjectDialog.prototype.switchTab=function(a,b){if(this._tabs){var c=null;a?a=a.valueOf():null===a&&(a=void 0);"string"==typeof a&&$.each(this._tabs,function(b,d){if(d.name==a)return c=d,!1});"object"==typeof a&&$.each(this._tabs,function(b,d){if(a==d||$(d.labelObject).is(a)||$(d.wrapperObject).is(a))return c=d,!1});c||(c=this._tabs[~~a]);if(!c)return!1;$.each(this._tabs,function(a,b){var d=b==c;$(b.wrapperObject)[d?"show":"hide"]();$(b.labelObject)[d?"addClass":"removeClass"]("active")});
|
|
if(b){var d=this.activeTabSettingsName();d&&TVSettings.setValue(d,c.name)}return!0}};
|
|
TradingView.EditObjectDialog.prototype.appendToTab=function(a,b,c,d,e,f){if(!$(a).is("table")||$(a).find("tr").size()){var g;this._tabs||(this._tabs=[]);$.each(this._tabs,function(a,c){if(c.name==b)return g=a,!1});void 0===g&&(this._tabs.push({name:b,localizedName:$.t(b),objects:$(),displayPriority:0,defaultOpen:0,isButton:!!e,callback:e?f||function(){}:null}),g=this._tabs.length-1);e=this._tabs[g];e.objects=e.objects.add(a);e.displayPriority=Math.max(e.displayPriority||0,c||0);e.defaultOpen=Math.max(e.defaultOpen||
|
|
0,d||0)}};
|
|
TradingView.EditObjectDialog.prototype.insertTabs=function(){function a(a){e&&e===a.name&&(a.defaultOpen=Math.max(~~a.defaultOpen,TradingView.EditObjectDialog.TAB_OPEN_USERSAVE));if(!c||~~c.defaultOpen<~~a.defaultOpen)c=a;a.labelObject=$('<a href="#" class="properties-tabs-label"></a>').text(a.localizedName).appendTo(b._tabContainer);a.labelObject.bind("click",function(a){a.preventDefault();b.switchTab(this,!0)});var d=$('<div class="main-properties"></div>');a.wrapperObject=$().add(d);a.objects.each(function(b,
|
|
c){var e=$(c);e.is("table")?(e.data("layout-separated")&&(a.wrapperObject=a.wrapperObject.add('<div class="properties-separator"></div>').add(d=$('<div class="main-properties"></div>')),e.removeData("layout-separated")),d.append(e),e.children("tbody").each(function(b,e){if(0!==b&&$(e).data("layout-separated")){a.wrapperObject=a.wrapperObject.add('<div class="properties-separator"></div>').add(d=$('<div class="main-properties"></div>'));var h=$(c).clone(!0,!1).appendTo(d);h.children().remove();h.append(e);
|
|
$(e).removeData("layout-separated")}})):d.append(e)});a.wrapperObject.appendTo(b._container)}if(this._tabs){this._tabs.sort(function(a,b){return(b.displayPriority||0)-(a.displayPriority||0)});var b=this,c=null,d=this.activeTabSettingsName();if(d)var e=TVSettings.getValue(d);$.each(this._tabs,function(c,d){d.isButton?(d.labelObject=$('<a href="#" class="properties-tabs-label"></a>').text(d.localizedName).appendTo(b._tabContainer),d.labelObject.bind("click",d.callback)):a(d)});this.switchTab(c)}};
|
|
TradingView.EditObjectDialog.prototype.activeTabSettingsName=function(){var a=this.R99;if(a){if(a instanceof TradingView.Series||a instanceof A7)return"properties_dialog.active_tab.chart";if(a instanceof R47)return"properties_dialog.active_tab.drawing";if(a instanceof TradingView.Study)return"properties_dialog.active_tab.study"}};
|
|
TradingView.EditObjectDialog.prototype.show=function(a){function b(a){return a&&a.D0&&a.D0._undoModel&&a.D0._undoModel.D4||null}function c(){h.hide(!0)}a=a||{};TradingView.isInherited(this.R99.constructor,A7)&&TradingView.trackEvent("GUI","Chart Properties");TradingView.isInherited(this.R99.constructor,TradingView.Study)&&TradingView.trackEvent("GUI","Study Properties");TradingView.isInherited(this.R99.constructor,DataSource)&&this.D0.setSelectedSource(this.R99);
|
|
var d=TradingView.PropertyPagesFactory.createStudyStrategyPropertyPage(this.R99,this.D0),e=TradingView.PropertyPagesFactory.createInputsPropertyPage(this.R99,this.D0),f=TradingView.PropertyPagesFactory.createStylesPropertyPage(this.R99,this.D0),g=TradingView.PropertyPagesFactory.createDisplayPropertyPage(this.R99,this.D0);if(e||f||d){var h=this,k=null!==e,l=this.R99.title(),m=A83.createDialog(l,{hideTitle:!0,dragHandle:".properties-tabs"}),n=m.find(".tv-dialog-content"),
|
|
p=$('<div class="properties-tabs"></div>').appendTo(n);this._tabs=[];this._dialog=m;this._dialogTitle=l;this._dialog=m;this._container=n;this._tabContainer=p;this._undoCheckpointOnShow=this.D0.createUndoCheckpoint();m.on("destroy",function(a,b){h._onDestroy(a,b);e&&e.destroy();f&&f.destroy();g&&g.destroy()});a.selectScales&&f.setScalesOpenTab&&f.setScalesOpenTab();a.selectTmz&&f.setTmzOpenTab&&f.setTmzOpenTab();!this.D0.readOnly()&&d&&d.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");
|
|
isNaN(c)&&(c=TradingView.EditObjectDialog.TAB_PRIORITY_PROPERTIES);var d=~~$(b).data("layout-tab-open"),e=$(b).data("layout-tab");void 0===e&&(e=TradingView.EditObjectDialog.TAB_NAME_PROPERTIES);h.appendToTab(b,e,c,d)});this.D0.readOnly()||!k||e.widget().is(":empty")||e.widget().each(function(a,b){var c=e instanceof J14,d=+$(b).data("layout-tab-priority");TradingView.isNaN(d)&&(d=c?TradingView.EditObjectDialog.TAB_PRIORITY_COORDINATES:TradingView.EditObjectDialog.TAB_PRIORITY_INPUTS);
|
|
var f=~~$(b).data("layout-tab-open"),g=$(b).data("layout-tab");void 0===g&&(g=c?TradingView.EditObjectDialog.TAB_NAME_COORDINATES:TradingView.EditObjectDialog.TAB_NAME_INPUTS);h.appendToTab(b,g,d,f)});f&&f.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");TradingView.isNaN(c)&&(c=TradingView.EditObjectDialog.TAB_PRIORITY_STYLE);var d=~~$(b).data("layout-tab-open");!d&&f instanceof J49&&(d=TradingView.EditObjectDialog.TAB_OPEN_DEFAULT);var e=
|
|
$(b).data("layout-tab");void 0===e&&(e=TradingView.EditObjectDialog.TAB_NAME_STYLE);h.appendToTab(b,e,c,d)});g&&g.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");TradingView.isNaN(c)&&(c=TradingView.EditObjectDialog.TAB_PRIORITY_DISPLAY);var d=~~$(b).data("layout-tab-open"),e=$(b).data("layout-tab");void 0===e&&(e=TradingView.EditObjectDialog.TAB_NAME_DISPLAY);h.appendToTab(b,e,c,d)});this.R99 instanceof TradingView.Study&&this.R99.metaInfo().isTVScript&&this.R99.metaInfo().TVScriptSourceCode&&
|
|
!TradingView.isMobileView&&h.appendToTab(null,$.t("Source Code"),null,null,!0,function(){this.hide();var a=this.R99.metaInfo();TradingView.ScriptEditorWidget.open({scriptSource:a.TVScriptSourceCode,scriptIdPart:a.scriptIdPart})}.bind(this));R77.enabled("alerts")&&TradingView.D18("drawing_alerts")&&this.R99.canHasAlert()&&!TradingView.isMobileView&&h.appendToTab(null,$.t("Alert"),null,null,!0,function(){runOrSignIn(function(){h.hide();h.R99.hasAlert.value()?h.R99.getAlert(function(a){TradingView.Alert.editAlert(a,
|
|
b(h.R99))}):new TradingView.MakeAlertDialog(b(h.R99),{drawing:h.R99})})});this.insertTabs();this._helpItemRequired()&&this._createHelp();a=$('<div class="main-properties main-properties-aftertabs"></div>').appendTo(n);a=$('<div class="dialog-buttons">').appendTo(a);d=function(){function a(b){b._childs&&b._childs.length&&$.each(b._childs,function(c,d){"percentage"==d?b.percentage.listeners().fire(b.percentage):a(b[d])})}var b=[];f&&"function"==typeof f.defaultProperties&&(b=b.concat(f.defaultProperties()));
|
|
e&&"function"==typeof e.defaultProperties&&(b=b.concat(e.defaultProperties()));0===b.length&&h.R99.properties?b=[h.R99.properties()]:h.R99._sessionsStudy&&(b=b.concat(h.R99._sessionsStudy.properties()));if(b.length){$.each(b,function(b,c){h.D0.restoreFactoryDefaults(c);a(c)});h.R99.properties().minTick&&h.R99.properties().minTick.listeners().fire(h.R99.properties().minTick);h.R99.properties().precision&&h.R99.properties().precision.listeners().fire(h.R99.properties().precision);
|
|
e&&e.loadData();if(f.onResoreDefaults)f.onResoreDefaults();f&&f.loadData()}};if(f&&"function"==typeof f.createTemplateButton&&!R77.enabled("charting_library_base"))f.createTemplateButton({defaultsCallback:d}).addClass("tv-left").appendTo(a);else if(TradingView.isInherited(this.R99.constructor,TradingView.Study)){var r=[{title:$.t("Reset Settings"),action:d},{title:$.t("Save As Default"),action:function(){h.R99.properties().saveDefaults()}}],d=$('<a href="#" class="tv-button tv-left">'+
|
|
$.t("Defaults")+'<span class="icon-dropdown"></span></a>');d.on("click",function(a){a.preventDefault();a=$(this);a.is(".active")||a.trigger("button-popup",[r,!0])}).appendTo(a);TradingView.bindPopupMenu(d,null,{direction:"down",event:"button-popup",notCloseOnButtons:!0})}else $('<a class="tv-button tv-left">'+$.t("Defaults")+"</a>").appendTo(a).click(d);$('<a class="tv-button ok">'+$.t("OK")+"</a>").appendTo(a).click(function(){h.hide()});$('<a class="tv-button cancel">'+$.t("Cancel")+"</a>").appendTo(a).on("click",
|
|
c);m.find(".tv-dialog-title a").on("click",c);$(window).bind("keyup.hidePropertyDialog",function(a){"13"==a.keyCode&&"textarea"!==a.target.tagName.toLowerCase()&&h.hide()});$("select",n).each(function(){var a=$(this),b="tv-select-container dialog";a.hasClass("tv-select-container-fontsize")&&(b+=" tv-select-container-fontsize");a.selectbox({speed:100,classHolder:b})});$('input[type="text"]',n).addClass("tv-text-input inset dialog");$("input.ticker",n).TVTicker();m.css("min-width","400px");A83.applyHandlers(m);
|
|
n={top:($(window).height()-m.height())/2,left:($(window).width()-m.width())/2};f&&"function"==typeof f.dialogPosition&&(n=f.dialogPosition(n,m)||n);A83.positionDialog(m,n);window.lineToolPropertiesToolbar&&window.lineToolPropertiesToolbar.hide();return m}};TradingView.EditObjectDialog.prototype._helpItemRequired=function(){return this.R99._metaInfo&&!!this.R99._metaInfo.helpURL};
|
|
TradingView.EditObjectDialog.prototype._createHelp=function(){var a=$('<a class="help" href="#" target="_blank" title="'+$.t("Help")+'"></a>');a.attr("href",this.R99._metaInfo.helpURL);this._tabContainer.prepend(a)};TradingView.ObjectTreeDialog=function(a,b){this._defaultOptions={maxHeight:550,padding:20,minHeight:258};this.options=$.extend({},this._defaultOptions,a||{});this.D0=b};
|
|
TradingView.ObjectTreeDialog.prototype.getSourceProperties=function(){for(var a={groups:[],model:this.D0,drawings:[]},b=0;b<this.D0.panes().length;b++){for(var c=this.D0.panes()[b],d=[],e=c.orderedSources(),f=0;f<e.length;f++){var g=e[f];g.showInObjectTree()&&d.push({datasource:g,name:g.title()})}c=c.D19();for(f=0;f<c.length;f++)g=c[f],g instanceof R47&&g.showInObjectTree()&&a.drawings.push({datasource:g,name:g.title(),symbol:A68.shortName(g.symbol())});
|
|
d.length&&a.groups.push({children:d})}return a};TradingView.ObjectTreeDialog.prototype.calcHeight=function(a,b){for(var c=0,d=0;d<a.length;d++)if(a[d]>b){c=0===d?a[0]:a[d-1];break}else c=a[d];c<this.options.minHeight&&(c=this.options.minHeight);return c};TradingView.ObjectTreeDialog.prototype.tabChanged=function(a){0===a?this.objectsTreeTab.tabChanged():this.manageDrawingsTab.tabChanged()};
|
|
TradingView.ObjectTreeDialog.prototype.onDestroy=function(){this.objectsTreeTab.unsubscribeListeners();this.manageDrawingsTab&&this.manageDrawingsTab.unsubscribeListeners()};
|
|
TradingView.ObjectTreeDialog.prototype.show=function(a){this.title=$.t("Objects Tree");TradingView.trackEvent("GUI","Objects Tree");var b,c,d,e=A83.createDialog(this.title,{hideTitle:!0,dragHandle:".properties-tabs"}),f=e.find(".tv-dialog-content");b=$('<div class="properties-tabs"></div>').appendTo(f);c=$('<a href="#" class="properties-tabs-label with-filter"></a>').text($.t("Objects Tree")).appendTo(b);f=$("<div>").appendTo(f);f.addClass("with-drawings");d=$(window).height();var g=d>this.options.maxHeight?
|
|
this.options.maxHeight:d,g=g-b.height(),g=g-this.options.padding,h=$('<div class="main-tree-page active">').appendTo(f);h.addClass("no-top-border");R77.enabled("support_manage_drawings")&&($('<a href="#" class="properties-tabs-label"></a>').text($.t("Manage Drawings")).appendTo(b),d=$('<div class="main-tree-page active">').appendTo(f),this.manageDrawingsTab=new TradingView.ManageDrawingsTab(this,this.options,this.D0,e),this.manageDrawingsTab.createView(d,g));this.objectsTreeTab=new TradingView.ObjectsTreeTab(this,
|
|
this.options,this.D0,e);this.objectsTreeTab.createView(h,c,g,a);this.tabs=new A71(b,f,{saveTab:"ObjectsTreeDialog.tab",activeTab:this.options.activeTab});this.tabs.tabChanged.subscribe(this,this.tabChanged);A83.applyHandlers(e);A83.positionDialog(e);var k=this;e.on("destroy",this.onDestroy.bind(this));setTimeout(function(){e.unbind("mousedownoutside");e.on("mousedownoutside",function(a){$(a.target).parents().andSelf().is(".tv-dialog, .properties-toolbar, .colorpicker, .charts-popup-list, .tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .context-menu")||
|
|
(A83.destroy(k.title),e.unbind("mousedownoutside"))})})};TradingView.ObjectTreeDialog._getBackgroundByTile=function(a){a=A6.prototype.Button.iconIndices[a];return void 0!==a?[1,32*a+1]:null};TradingView.ObjectTreeDialog._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};TradingView.ObjectTreeDialog.List=function(a,b,c,d){this.model=a;this.datasources={};this.contentHeights=[];this.content=b;this.dialog=c;this.options=d};
|
|
TradingView.ObjectTreeDialog.List.prototype.setDefaultItemClass=function(a){this.defaultItemClass=a};TradingView.ObjectTreeDialog.List.prototype.setActiveListener=function(a){this.activeListener=a};TradingView.ObjectTreeDialog.List.prototype.setActive=function(a){this.content.find(".tv-dialog-tree-item").removeClass("active");a.addClass("active");this.activeListener&&this.activeListener(a);a=this.datasources[a.attr("id")];this.model.setSelectedSource(a.datasource);this.model.D20(new A22(A22.LIGHT_UPDATE))};
|
|
TradingView.ObjectTreeDialog.List.prototype.createItem=function(a,b,c){var d=this,e=$('<a class="tv-dialog-tree-item"></a>').appendTo(b);b=$('<span class="tree-icon-container">').appendTo(e);a.skipped&&e.addClass("skipped");e.attr("id",a.datasource.id());this.defaultItemClass&&e.addClass(this.defaultItemClass);this.datasources[a.datasource.id()]=a;this.contentHeights.push(this.content.height());var f=$('<div class="name-column"></div>').appendTo(e);$('<span class="name">'+$.t(a.name)+"</span>").appendTo(f);
|
|
this.setIcon(e,a);this.setVisible(e,a);e.mousedown(function(a){d.setActive(e)});if(a.datasource.userEditEnabled()){if(TradingView.isInherited(a.datasource.constructor,R47)){var g=$('<a class="button icon-lock" title="'+$.t("Lock/Unlock")+'">');g.click(function(b){b=a.datasource.properties().frozen.value();d.model.setProperty(a.datasource.properties().frozen,!b,"Lock/Unlock "+a.datasource.title())});g.appendTo(b);$('<span class="icon">').appendTo(g);a.datasource.properties().frozen.value()&&
|
|
(e.addClass("locked"),g.addClass("active"));a.datasource.properties().frozen.subscribe(this,function(a){a=a.value();e.toggleClass("locked",a);g.toggleClass("active",a)})}else c&&$('<div class="button hidden"> </div>').appendTo(b);var h=$('<a class="button icon-hide" title="'+$.t("Show/Hide")+'">');h.click(function(b){b=a.datasource.properties().visible.value();e.toggleClass("hidden",b);h.toggleClass("active",b);d.model.setProperty(a.datasource.properties().visible,!b,"Show/Hide "+a.datasource.title())});
|
|
h.appendTo(b);$('<span class="icon">').appendTo(h);a.datasource.properties().visible.value()||(e.addClass("hidden"),h.addClass("active"));a.datasource.properties().visible.subscribe(this,function(a){a=a.value();e.toggleClass("hidden",!a);h.toggleClass("active",!a)});this.createPropertyIcon(a,b,e)}return e};TradingView.ObjectTreeDialog.List.prototype.contextMenuEvent=function(a,b){this.options.D3.paneByState(this.model.paneForSource(b)).showContextMenuForSource(b,a)};
|
|
TradingView.ObjectTreeDialog.List.prototype.createPropertyIcon=function(a,b,c){var d=this;if(a.datasource instanceof R47&&!a.datasource.isActualSymbol())$('<div class="button hidden"> </div>').appendTo(b);else if(a.datasource===this.model.mainSeries()&&this.options.D3&&this.options.D3.onWidget())$('<div class="button hidden"> </div>').appendTo(b);else if(TradingView.PropertyPagesFactory.hasStylesPropertyPage(a.datasource)||TradingView.PropertyPagesFactory.hasInputsPropertyPage(a.datasource))b=
|
|
$('<a class="button format" title="'+$.t("Format")+'">').click(function(b){(new TradingView.EditObjectDialog(a.datasource,d.model)).show()}).appendTo(b),$('<span class="icon">').appendTo(b),c.dblclick(function(b){(new TradingView.EditObjectDialog(a.datasource,d.model)).show()}),c.on("contextmenu",function(b){d.contextMenuEvent(b,a.datasource);b.preventDefault();b.stopPropagation()})};
|
|
TradingView.ObjectTreeDialog.List.prototype.updateItem=function(a){var b=this.content.find("#"+a.datasource.id());b.find(".name").text($.t(a.name));this.setIcon(b,a);this.setVisible(b,a)};TradingView.ObjectTreeDialog.List.prototype.findItem=function(a){return this.content.find("#"+a.id())};TradingView.ObjectTreeDialog.List.prototype.removeItem=function(a){this.findItem(a).remove()};
|
|
TradingView.ObjectTreeDialog.List.prototype.setIcon=function(a,b){var c=a.find(".name-column");c.find(".instrument").remove();if(b.datasource.getType){var d=TradingView.ObjectTreeDialog._getBackgroundByTile(b.datasource.getType());if(d){var e=$('<span class="instrument linetool">').appendTo(c);e.css("background-position",TradingView.ObjectTreeDialog._getBackgroundPosition(d))}}b.datasource instanceof TradingView.LineToolIcon&&(e=b.datasource.properties().icon.value(),e=String.fromCharCode(e),$('<span class="instrument lineicon">'+
|
|
e+"</span>").appendTo(c));b.datasource===this.model.mainSeries()&&(e=$('<span class="instrument series">').appendTo(c),c=this.model.mainSeries().properties().style.value(),d=A4.styleIconPosition(c),e.css("background-position",d))};TradingView.ObjectTreeDialog.List.prototype.setVisible=function(a,b){b.datasource.properties().visible.value()?a.removeClass("hidden"):a.addClass("hidden")};TradingView.ManageDrawingsTab=function(a,b,c){this.dialog=a;this.options=b||{};this.model=c};TradingView.ManageDrawingsTab.prototype.toolCompare=function(a,b){var c=$(a).find(".name").text(),d=$(b).find(".name").text();return c.localeCompare(d)};TradingView.ManageDrawingsTab.prototype.symbolCompare=function(a,b){var c=$(a).find(".symbol").text(),d=$(b).find(".symbol").text();return c.localeCompare(d)};TradingView.ManageDrawingsTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};
|
|
TradingView.ManageDrawingsTab.prototype.addItemControls=function(a,b){var c=this,d=b.find(".tree-icon-container");$('<span class="symbol">'+a.symbol+"</span>").appendTo(b);a.datasource.userEditEnabled()&&(d=$('<a class="button delete" title="'+$.t("Delete")+'">').click(function(d){d.stopPropagation();d=c.itemList.find(".tv-dialog-tree-item");var f=d.index(b),g=d.length;0<g&&(f!==g-1?c.selectedId=$(d[f+1]).attr("id"):0!==f&&(c.selectedId=$(d[f-1]).attr("id")));c.items.model.removeSource(a.datasource)}).appendTo(d),
|
|
$('<span class="icon">').appendTo(d))};TradingView.ManageDrawingsTab.prototype.setActiveHeader=function(a){this.itemHeader.find(".item .label").removeClass("active");$.each(this.itemHeader.find(".item .label"),function(){$(this).data("sort")===a&&$(this).addClass("active")})};
|
|
TradingView.ManageDrawingsTab.prototype.sortList=function(){var a=TVSettings.getValue("manageDrawingsDialog.sort.field")||"symbol",b=TVSettings.getBool("manageDrawingsDialog.sort.asc")||!1,c;c="tool"===a?this.toolSort:this.symbolSort;c.setIsAscending(b);this.itemList.find(".tv-dialog-tree-item").sort(c.getPredicate()).appendTo(this.itemList);this.setActiveHeader(a)};
|
|
TradingView.ManageDrawingsTab.prototype.sortClick=function(a){a=$(a.target).data("sort");var b;b="tool"===a?this.toolSort:this.symbolSort;b.inverse();TVSettings.setValue("manageDrawingsDialog.sort.field",a);TVSettings.setValue("manageDrawingsDialog.sort.asc",b.isAscending);this.sortList()};
|
|
TradingView.ManageDrawingsTab.prototype.createView=function(a,b){this.items=this.dialog.getSourceProperties();this.maxHeight=b;var c=$("<div>").appendTo(a);this.itemHeader=$('<div class="tv-dialog-tree-item-list-header">').appendTo(c);this.contentContainer=$('<div class="main-tree-container">').appendTo(c);this.noDrawings=$('<div class="no-drawings">'+$.t("No drawings yet")+"</div>").appendTo(c);this.contentWrap=$('<div class="main-tree-wrap"></div>').appendTo(this.contentContainer);this.content=
|
|
$('<div class="main-tree"></div>').appendTo(this.contentWrap);var c=$('<div class="item tool">').appendTo(this.itemHeader),d=$('<div class="item symbol">').appendTo(this.itemHeader);this.itemList=$('<div class="tv-dialog-tree-item-list">').appendTo(this.content);this.symbolSort=new TradingView.LoadChartDialog.SortObject(this.symbolCompare);this.toolSort=new TradingView.LoadChartDialog.SortObject(this.toolCompare);this.list=new TradingView.ObjectTreeDialog.List(this.items.model,this.content,this.dialog,
|
|
this.options);this.list.setActiveListener(this.activeListener.bind(this));this.items.model.selectedSource()&&(this.selectedId=this.items.model.selectedSource().id());$('<span class="label">'+$.t("TOOL")+"</span>").data("sort","tool").appendTo(c).click($.proxy(this,"sortClick"));$('<span class="label">'+$.t("SYMBOL")+"</span>").data("sort","symbol").appendTo(d).click($.proxy(this,"sortClick"));this.fillList();c=this.dialog.calcHeight(this.list.contentHeights,this.maxHeight-this.itemHeader.height());
|
|
this.contentContainer.height(c);this.noDrawings.height(c);this.addScroll();var e=this;this.updateListListener=function(){e.updateList()};this.fillListListener=function(){e.fillList()};this.removeSourceListener=function(a){e.list.removeItem(a);e.updateList()};this.model.on("setProperty",this.updateListListener);this.model.on("removeSource",this.removeSourceListener);this.model.on("cloneLineTool",this.fillListListener);return this.contentContainer};
|
|
TradingView.ManageDrawingsTab.prototype.unsubscribeListeners=function(){this.model.removeListener("setProperty",this.updateListListener);this.model.removeListener("removeSource",this.removeSourceListener);this.model.removeListener("cloneLineTool",this.fillListListener)};TradingView.ManageDrawingsTab.prototype.updateList=function(){for(var a=this.dialog.getSourceProperties(),b=0;b<a.drawings.length;b++)this.list.updateItem(a.drawings[b])};
|
|
TradingView.ManageDrawingsTab.prototype.updateList=function(){0===this.itemList.children().length?(this.noDrawings.show(),this.contentContainer.hide(),this.itemHeader.hide()):(this.noDrawings.hide(),this.contentContainer.show(),this.itemHeader.show())};
|
|
TradingView.ManageDrawingsTab.prototype.fillList=function(){this.itemList.empty();for(var a=this.dialog.getSourceProperties(),b=0;b<a.drawings.length;b++){var c=a.drawings[b],d=this.list.createItem(c,this.itemList);d.unbind("contextmenu");d.unbind("dblclick");c.datasource.id()===this.selectedId&&this.list.setActive(d);this.addItemControls(c,d)}this.sortList();this.updateList()};
|
|
TradingView.ManageDrawingsTab.prototype.addScroll=function(){this._scroll=new A59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};TradingView.ManageDrawingsTab.prototype.tabChanged=function(){};TradingView.ObjectsTreeTab=function(a,b,c){this.dialog=a;this.options=b||{};this.model=c};TradingView.ObjectsTreeTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};TradingView.ObjectsTreeTab.prototype.changeZOrder=function(a){this.model.removeListener("changeZOrder",this.changeZorderListener);a();this.model.on("changeZOrder",this.changeZorderListener)};
|
|
TradingView.ObjectsTreeTab.prototype.addSortable=function(a){var b=0,c=this;a.sortable({scroll:!0,scrollSensitivity:100,scrollSpeed:100,axis:"y",helper:"clone",start:function(a,c){b=c.item.index()},stop:function(a,e){var f=e.item.index();if(0!==b-f){var g=c.list.datasources[e.item.attr("id")],h=0<b-f?1:-1;c.changeZOrder(function(){c.items.model.beginUndoMacro("Change "+g.datasource.title()+" Z order");for(var a=0;a<Math.abs(b-f);a++)c.items.model.changeZOrder(g.datasource,h);c.items.model.endUndoMacro()})}c.setFirstLastItems(e.item.parent())}})};
|
|
TradingView.ObjectsTreeTab.prototype.addItemControls=function(a,b,c,d,e){var f=this;c=b.find(".tree-icon-container");d=$('<div class="button up" title="'+$.t("Move Up")+'">').click(function(c){c.stopPropagation();c.preventDefault();c=b.prev(":visible");if(c.length){var d=b.prev(":hidden").length;b.insertBefore(c.last());f.changeZOrder(function(){for(var b=0;b<1+d;b++)f.items.model.changeZOrder(a.datasource,1)});f.setFirstLastItems(b.parent());f._scroll.scrollTo(b)}}).prependTo(c);$('<span class="icon">').appendTo(d);
|
|
d=$('<a class="button down" title="'+$.t("Move Down")+'">').click(function(c){c.stopPropagation();c.preventDefault();c=b.next(":visible");if(c.length){var d=b.next(":hidden").length;b.insertAfter(c.first());f.changeZOrder(function(){for(var b=0;b<1+d;b++)f.items.model.changeZOrder(a.datasource,-1)});f.setFirstLastItems(b.parent());f._scroll.scrollTo(b)}}).prependTo(c);$('<span class="icon">').appendTo(d);a.datasource!==f.items.model.mainSeries()&&a.datasource.isUserDeletable()?(c=$('<a class="button delete" title="'+
|
|
$.t("Delete")+'">').click(function(c){c.stopPropagation();c=f.content.find(".tv-dialog-tree-item");var d=c.index(b),e=c.length;0<e&&(d!==e-1?f.selectedId=$(c[d+1]).attr("id"):0!==d&&(f.selectedId=$(c[d-1]).attr("id")));f.items.model.removeSource(a.datasource)}).appendTo(c),$('<span class="icon">').appendTo(c)):$('<div class="button hidden"> </div>').appendTo(c)};
|
|
TradingView.ObjectsTreeTab.prototype.createView=function(a,b,c){this.items=this.dialog.getSourceProperties();this.maxHeight=c;this.contentContainer=$('<div class="main-tree-container">').appendTo(a);this.contentWrap=$('<div class="main-tree-wrap"></div>').appendTo(this.contentContainer);this.content=$('<div class="main-tree"></div>').appendTo(this.contentWrap);this.list=new TradingView.ObjectTreeDialog.List(this.items.model,this.content,this.dialog,this.options);this.list.setDefaultItemClass("objects");
|
|
this.list.setActiveListener(this.activeListener.bind(this));this.items.model.selectedSource()&&(this.selectedId=this.items.model.selectedSource().id());this.updateListListener=this.updateList.bind(this);this.fillListListener=this.fillList.bind(this);this.changeZorderListener=function(a){this.fillList();this._scroll.scrollTo(this.list.findItem(a))}.bind(this);this.model.on("setProperty",this.updateListListener);this.model.on("removeSource",this.fillListListener);this.model.on("cloneLineTool",this.fillListListener);
|
|
this.model.on("setChartStyleProperty",this.updateListListener);this.model.on("changeZOrder",this.changeZorderListener);this.model.on("moveSource",this.fillListListener);this.filter=new TradingView.ObjectsTreeTabFilter(b);this.filter.onChange.subscribe(this,this.fillListListener);this.filter.setValue("all");a=this.dialog.calcHeight(this.list.contentHeights,this.maxHeight);this.contentContainer.height(a);this.addScroll();return this.contentContainer};
|
|
TradingView.ObjectsTreeTab.prototype.unsubscribeListeners=function(){this.model.removeListener("setProperty",this.updateListListener);this.model.removeListener("removeSource",this.fillListListener);this.model.removeListener("cloneLineTool",this.fillListListener);this.model.removeListener("setChartStyleProperty",this.updateListListener);this.model.removeListener("changeZOrder",this.changeZorderListener);this.model.removeListener("moveSource",this.fillListListener)};
|
|
TradingView.ObjectsTreeTab.prototype.updateList=function(){this.items=this.dialog.getSourceProperties();for(var a=0;a<this.items.groups.length;a++){var b=this.items.groups[a];if(b.children.length)for(var c=b.children.length-1;0<=c;c--)this.list.updateItem(b.children[c])}};TradingView.ObjectsTreeTab.prototype.setFirstLastItems=function(a){a=a.find(".tv-dialog-tree-item:visible");a.length&&(a.removeClass("first last"),a.first().addClass("first"),a.last().addClass("last"))};
|
|
TradingView.ObjectsTreeTab.prototype.fillList=function(){this.content.empty();this.items=this.dialog.getSourceProperties();for(var a="studies"!=this.filter.value()&&this.items.drawings.length,b=0;b<this.items.groups.length;b++){var c=this.filter.applyToGroup(this.items.groups[b]);if(c.children.length){var d=$('<div class="tv-dialog-tree-group">').appendTo(this.content);0<b&&d.append('<div class="tv-dialog-tree-head">');var e=$('<div class="tv-dialog-tree-item-list">').appendTo(d);Modernizr.touch||
|
|
this.addSortable(e);for(var f=!0,g=c.children.length-1;0<=g;g--){var h=c.children[g],k=this.list.createItem(h,e,a);f&&!h.skipped&&(f=!1);h.datasource.id()===this.selectedId&&this.list.setActive(k);this.addItemControls(h,k,d,g,c)}f&&d.addClass("empty");this.setFirstLastItems(e)}}};TradingView.ObjectsTreeTab.prototype.addScroll=function(){this._scroll=new A59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};TradingView.ObjectsTreeTab.prototype.tabChanged=function(){};
|
|
TradingView.ObjectsTreeTabFilter=function(a){this.$container=a;this.$button=$('<div class="button-filter">').click(function(a){this.$button.trigger("button-popup",[this._getActions()]);a.stopPropagation()}.bind(this)).appendTo(a);TradingView.bindPopupMenu(this.$button,null,{event:"button-popup",addClass:"tree-tab-filter"});this.onChange=new Delegate};
|
|
TradingView.ObjectsTreeTabFilter.prototype._getActions=function(){return[{name:"all",title:$.t("Show All")},{name:"drawings",title:$.t("Show Only Drawings")},{name:"studies",title:$.t("Show Only Studies")}].map(function(a){a.name==this._value?a.active=!0:a.action=this.setValue.bind(this,a.name);return a}.bind(this))};TradingView.ObjectsTreeTabFilter.prototype.value=function(){return this._value};TradingView.ObjectsTreeTabFilter.prototype.setValue=function(a){a!=this._value&&(this._value=a,this.onChange.fire(a))};
|
|
TradingView.ObjectsTreeTabFilter.prototype.applyToGroup=function(a){if("all"==this._value)return a;for(var b=0,c;b<a.children.length;b++)c=a.children[b],c.skipped=!TradingView.isInherited(c.datasource.constructor,TradingView.Series)&&!TradingView.isInherited(c.datasource.constructor,"drawings"==this._value?R47:TradingView.Study);return a};A23=function(a,b,c){this.D0=b;this._paneWidget=a;this._chart=a._chart;this._mainDiv=c;this.jqTable=$(document.createElement("table"));this.jqTable.addClass("pane-legend");this._itemsBinding=[];this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout);this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout);this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,
|
|
this.updateLayout);this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);a=this._chart.properties().scalesProperties.textColor;a.listeners().subscribe(this,function(a){this.jqTable.css("color",a)});this.jqTable.css("color",a.value());this.updateLayout()};
|
|
A23.prototype.contextMenuEvent=function(a,b){!this.D0.chartModel().readOnly()&&R77.enabled("legend_context_menu")&&this._paneWidget.showContextMenuForSource(b.source,a)};
|
|
A23.prototype.updateLayout=function(){this._itemsBinding.length=0;this.jqTable.find(".apply-common-tooltip").trigger("mouseleave");this.jqTable.empty();var a=this._paneWidget.state();if(a&&this.D0){var b={showStudyTitles:this.D0.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),
|
|
showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value()},c=this.D0.mainSeries(),a=a.orderedSources().slice(),d=a.indexOf(c);-1<d&&(a.splice(d,1),a.push(c));for(d=a.length-1;0<=d;d--){var e=a[d],f=e.statusView();if(f){var g=e==c;if(!g||b.showSeriesTitle||b.showSeriesOHLC)if(g||b.showStudyTitles||b.showStudyValues){var h=$("<tr>"),k=$("<td>");h.appendTo(this.jqTable);k.addClass("pane-legend-line");g?k.addClass("main"):k.addClass("study");e.properties().visible.value()||
|
|
k.addClass("disabled");k.appendTo(h);k.source=e;this._generateItemsForRow(k,f,b);TradingView.setMouseEventHandler(k,this,!0)}}}this.update()}};
|
|
A23.prototype._generateItemsForRow=function(a,b,c){var d=a.source,e=this,f=d==this.D0.mainSeries();if(f&&c.showSeriesTitle||!f&&c.showStudyTitles){var g=$("<span>");g.addClass("pane-legend-line");R77.enabled("legend_context_menu")||g.addClass("no-context-menu");f&&g.addClass("main");d.properties().visible.value()||g.addClass("disabled");g.css({"font-weight":b.bold()?"bold":"normal","font-size":b.size()});g.click(function(b){e.contextMenuEvent(b,a)});g.appendTo(a);
|
|
this._itemsBinding.push({value:b,cell:g,source:a.source});if(!this._chart.readOnly()&&d.userEditEnabled()&&R77.enabled("edit_buttons_in_legend")){b=$('<span class="pane-legend-icon-container">').appendTo(a);$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').appendTo(b).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,d));$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').appendTo(b).on("click touchend",
|
|
this._generateItemsForRow._onFormatClick.bind(this,d));if(d instanceof TradingView.Study&&d.metaInfo().isTVScript&&void 0!==d.metaInfo().TVScriptSourceCode&&!TradingView.isMobileView&&(g=$('<a class="pane-legend-icon apply-common-tooltip source" title="'+$.t("Show Source Code")+'">').appendTo(b).on("click touchend",this._generateItemsForRow._onViewSorceClick.bind(this,d)),TradingView.ScriptEditorWidget)){var h=TradingView.ScriptEditorWidget.loadedScriptIdPart();h&&d.metaInfo().scriptIdPart===h&&g.addClass("active")}if(!f)$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+
|
|
$.t("Delete")+'">').appendTo(b).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,d))}else $("<span> </span>").appendTo(a)}b=d.dataWindowView();b=d.dataWindowView();if(this.isDataWindowValuesVisible(b)&&(f&&c.showSeriesOHLC||!f&&c.showStudyValues)){c=[];g=[];h=$("<div>");h.addClass("pane-legend-item-value-container");for(var k=0;k<b.items().size();k++){b.items().item(k);var l=f?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(h):null,m=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(h);
|
|
f&&m.addClass("main");d.properties().visible.value()||(m.addClass("disabled"),l&&l.addClass("disabled"));c.push(m);l&&g.push(l)}k=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(h);h.appendTo(a);this._itemsBinding.push({value:b,cell:c,titleCells:g.length?g:null,source:d,additional:k})}R77.enabled("alerts")&&f&&(d=$('<span class="pane-legend-icon-container">').appendTo(a),this.alertWidget&&this.alertWidget.destroy(),this.D0.chartModel().readOnly()||(this.alertWidget=
|
|
new TradingView.AlertsLegendWidget(d,this.D0)))};A23.prototype.isDataWindowValuesVisible=function(a){return this._chart.onWidget()?!!a&&!this._chart.isSmall():!!a};A23.prototype._generateItemsForRow._onShowhideClick=function(a){this.D0.setProperty(a.properties().visible,!a.properties().visible.value(),"Show/Hide "+a.title())};
|
|
A23.prototype._generateItemsForRow._onFormatClick=function(a,b){a.userEditEnabled()&&(new TradingView.EditObjectDialog(a,this.D0)).show()};A23.prototype._generateItemsForRow._onDeleteClick=function(a){a.isUserDeletable()&&this.D0.removeSource(a)};
|
|
A23.prototype._generateItemsForRow._onViewSorceClick=function(a){var b=a.metaInfo();a={scriptSource:a.metaInfo().TVScriptSourceCode,scriptIdPart:b.scriptIdPart};TradingView.ScriptEditorWidget&&TradingView.ScriptEditorWidget.open(a)};A23.prototype.setItemEnabled=function(a,b){var c=!a.hasClass("disabled"),d=a.closest("td.pane-legend-line");b&&!c?(a.removeClass("disabled"),d.removeClass("disabled")):!b&&c&&(a.addClass("disabled"),d.addClass("disabled"))};
|
|
A23.prototype.valueChanged=function(a,b,c){return a[b]!==c?(a[b]=c,!0):!1};
|
|
A23.prototype.updateTitle=function(){for(var a,b,c=this._itemsBinding.length;c--;)if(b=this._itemsBinding[c],!Array.isArray(b.cell)){b.last||(b.last={});var d=b.last,e=b.source;a=e.properties().visible.value();this.valueChanged(d,"sourceVisible",a)&&this.setItemEnabled(b.cell,a);a=b.value.color();var e=e!=this.D0.mainSeries()&&e===this.D0.selectedSource()?"bold":"normal",f=b.value.text();(this.valueChanged(d,"color",a)||this.valueChanged(d,"fontWeight",e)||this.valueChanged(d,
|
|
"text",f))&&b.cell.text(TradingView.clean(f,!0)).css({color:a,"border-color":a,"font-weight":e})}};
|
|
A23.prototype.update=function(a){this.updateTitle();for(var b,c,d,e,f,g,h=this._itemsBinding.length;h--;)if(d=this._itemsBinding[h],a=d.cell,b=d.titleCells,c=d.source.properties().visible.value(),Array.isArray(a)){d.last||(d.last={},d.last.dwView||(d.last.dwView={}));var k=d.last;e=d.value.items();for(f=0;f<a.length;f++)g=e.item(f),k[f]||(k[f]={}),this.valueChanged(k,"sourceVisible",c)&&this.setItemEnabled(a[f],c),this.valueChanged(k[f],"text",g.text())&&(a[f][0].textContent=
|
|
g.text()),g.color()&&this.valueChanged(k[f],"color",g.color())&&a[f].css("color",g.color()),b&&(this.valueChanged(k,"sourceVisible",c)&&this.setItemEnabled(b[f],c),this.valueChanged(k[f],"title",g.title())&&(b[f][0].textContent=g.title()));d.additional&&d.value.additional&&this.valueChanged(k,"additional",d.value.additional())&&d.additional.text(d.value.additional()||"")}};A23.prototype.dataSourceAtPoint=function(a,b){return null};
|
|
A23.prototype.renderTo=function(a,b,c){a.save();a.fillStyle=this._chart.properties().scalesProperties.textColor.value();a.textBaseline="middle";for(var d=0,e=0;e<this._itemsBinding.length;++e){var f=this._itemsBinding[e],g=f.value,h=f.source==this.D0.mainSeries(),k=h?12:8,h=h?25:17;Array.isArray(f.cell)||(a.font=g.size()+" Verdana, Arial",a.fillText(g.text(),b,c+d+k),d+=h)}a.restore()};A52=function(a,b,c){this.chart=a;this.paneA=a.paneWidgets()[b];this.paneB=a.paneWidgets()[c];this.jqRow=$(document.createElement("tr"));this.jqRow.height(A52.HEIGHT);this.jqCell=$(document.createElement("td"));this.jqCell.appendTo(this.jqRow);this.jqCell.addClass("pane-separator");this.jqCell.attr("colspan","3");this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value());this.jqCell.click(function(){});this.handle=$('<div class="handle">').appendTo(this.jqCell);
|
|
$(this.handle).css("cursor",TradingView.cursorCss("cursor_size_vertical","16 15"));TradingView.setMouseEventHandler(this.handle,this)};A52.HEIGHT=1;
|
|
A52.prototype.mouseDownEvent=function(a){if(0===a.button||Modernizr.touch)this.startY=a.pageY,this.deltaY=0,this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight};
|
|
A52.prototype.pressedMouseMoveEvent=function(a){if(0===a.button||Modernizr.touch){a.preventDefault();this.deltaY=a.pageY-this.startY;var b=this.paneA.size.h,c=MathEx.clamp(b+this.deltaY,this.minPaneHeight,this.maxPaneHeight)*this.pixelStretchFactor,d=this.totalStretch-c;this.paneA.setStretchFactor(c);this.paneB.setStretchFactor(d);this.chart._adjustSize();this.paneA.size.h!==b&&(this.startY=a.pageY);this.chart.paint()}};
|
|
A52.prototype.mouseUpEvent=function(a){if(0===a.button||Modernizr.touch)this.chart.D0.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.pixelStretchFactor=this.maxPaneHeight=this.minPaneHeight=this.totalStretch=this.totalHeight=this.deltaY=this.startY=0};A52.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())};
|
|
A52.prototype.paint=function(){};
|
|
A52.prototype.image=function(){var a={},b=A52.HEIGHT,c=this.paneA.lhsPriceAxisWidget.size.w,d=this.paneA.size.w,e=this.paneA.rhsPriceAxisWidget.size.w,f,g;f=$('<canvas width="'+c+'" height="'+b+'">')[0];g=f.getContext("2d");g.fillStyle=this.chart.properties().scalesProperties.lineColor.value();g.fillRect(0,0,c,b);a.leftAxis={content:f.toDataURL(),contentWidth:c,contentHeight:b};f=$('<canvas width="'+d+'" height="'+b+'">')[0];g=f.getContext("2d");g.fillStyle=
|
|
this.chart.properties().scalesProperties.lineColor.value();g.fillRect(0,0,d,b);a.content=f.toDataURL();a.contentWidth=d;a.contentHeight=b;f=$('<canvas width="'+e+'" height="'+b+'">')[0];g=f.getContext("2d");g.fillStyle=this.chart.properties().scalesProperties.lineColor.value();g.fillRect(0,0,e,b);a.rightAxis={content:f.toDataURL(),contentWidth:e,contentHeight:b};return a};A51=function(a,b,c){this.D0=b;this._paneWidget=a;this._chart=a._chart;this._mainDiv=c;this.jqDiv=$('<div class="pane-controls">').appendTo(c);this.update()};
|
|
A51.prototype.update=function(){var a=this,b=a.D0,c=a._paneWidget.state(),b=b.panes().indexOf(c),d=!1;if(!c.containsMainSeries()){for(var e=0,c=c.D19(),f=c.length;f--;)if(c[f]instanceof TradingView.Study&&(e++,1<e)){d=!0;break}c=null}0<b?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").attr("title",$.t("Move Up")).on("click",function(){a.D0.rearrangePanes(a._chart,a.D0.panes().indexOf(a._paneWidget.state()),
|
|
"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach();b<this.D0.panes().length-1?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").attr("title",$.t("Move Down")).on("click",function(){a.D0.rearrangePanes(a._chart,a.D0.panes().indexOf(a._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach();d?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").attr("title",
|
|
$.t("Delete")).on("click",function(){a.D0.removePane(a._chart,a.D0.panes().indexOf(a._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach()};A54=function(a,b,c){this.pane=a;this._isLeft=A54.isLeft(b);this._disableContextMenu=!!c;this.jqCell=$(document.createElement("td"));this.jqCell.addClass("chart-markup-table");this.jqCell.addClass("price-axis");this.jqCell.width(25);this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height","100%");this._dv.css("position","relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqCell);this.canvas=TradingView.addCanvasTo(this._dv,
|
|
new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order","1");$(this.top_canvas).css("left",0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this._optimalWidth=40;this.setFont(11,
|
|
"Arial","");this.ctx.setFont(this.baseFont);this.top_ctx.setFont(this.baseFont);this._tickmarksCache=new TradingView.LabelsImageCache(this.baseFont,this.textColor(),11,100);var d=this;this.pane.chart().model().model().properties().scalesProperties.textColor.listeners().subscribe(null,function(a){d._tickmarksCache.reset(a.value())});this.restoreDefaultCursor();this.update();TradingView.setMouseEventHandler(this.jqCell,this,!0);this.dialog=this.pane.chart().dialog;this.contextMenu=null;this.actions=
|
|
{};this._isVisible=!0};A54.prototype._BORDER_SIZE=1;A54.prototype._MAJOR_TICK_LENGTH=4;A54.prototype._MINOR_TICK_LENGTH=2;A54.LHS=1;A54.RHS=2;A54.isLeft=function(a){if(a===A54.LHS)return!0;a!==A54.RHS&&TradingView.logDebugChart("PriceAxisWidget.isLeft: wrong side");return!1};
|
|
A54.prototype.backgroundColor=function(){return this.pane.chart().model().model().properties().paneProperties.background.value()};A54.prototype.lineColor=function(){return this.pane.chart().model().model().properties().scalesProperties.lineColor.value()};A54.prototype.textColor=function(){return this.pane.chart().model().model().properties().scalesProperties.textColor.value()};
|
|
A54.prototype.mouseDownEvent=function(a){if(!this.priceScale().isEmpty()){var b=this.pane.chart().model(),c=this.pane.state();this._mousedown=!0;this.jqCell.css("cursor",TradingView.cursorCss("cursor_size_vertical","15 15"));b.startScalePrice(c,this.priceScale(),a.localY);TradingView.trackEvent("GUI","Scaling price scale")}};
|
|
A54.prototype.pressedMouseMoveEvent=function(a){var b=this.pane.chart().model(),c=this.pane.state(),d=this.priceScale();b.scalePriceTo(c,d,a.localY)};A54.prototype.mouseDownOutsideEvent=function(a){a=this.pane.chart().model();var b=this.pane.state(),c=this.priceScale();this._mousedown&&(this._mousedown=!1,a.endScalePrice(b,c),this.restoreDefaultCursor())};
|
|
A54.prototype.mouseUpEvent=function(a){a=this.pane.chart().model();var b=this.pane.state(),c=this.priceScale();this._mousedown=!1;a.endScalePrice(b,c);this.restoreDefaultCursor()};
|
|
A54.prototype._initActions=function(a){if(this.pane.state()){var b=this;this.actions.reset=new TradingView.Action({text:$.t("Reset Scale")});this.actions.reset.callbacks().subscribe(this,A54.prototype.reset);a=function(a){this._undoModel.setLockScaleProperty(this._property,a.checked,b.priceScale().mainSource(),this._undoText)};delete this.actions.setLockScale;this.priceScale().mainSource()instanceof TradingView.Series&&(this.actions.setLockScale=new TradingView.Action({text:$.t("Lock Scale"),
|
|
checkable:!0,checked:this.priceScale().mainSource().properties().lockScale.value()}),this._lockScaleBinding=new D14(this.actions.setLockScale,this.priceScale().mainSource().properties().lockScale,this.pane.chart().model(),"Undo LockScale",a),this._lockScaleBinding.setValue(this.priceScale().mainSource().properties().lockScale.value()));this.actions.setAutoScale=new TradingView.Action({text:$.t("Auto Scale"),checkable:!0,checked:!0});this._autoScaleBinding=new D14(this.actions.setAutoScale,
|
|
this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",function(){this._undoModel.setAutoScaleProperty(this._property,this.value(),b.priceScale(),this._undoText)});this._autoScaleBinding.setValue(this._autoScaleBinding.property().value());this.actions.setPercentage=new TradingView.Action({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setPercentage.binding=new D14(this.actions.setPercentage,this.priceScale().properties().percentage,
|
|
this.pane.chart().model(),"Undo Percentage",function(){this._undoModel.setPercentProperty(this._property,this.value(),b.priceScale(),this._undoText)});this.actions.setLog=new TradingView.Action({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setLog.binding=new D14(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale");this.actions.alignLabels=new TradingView.Action({text:$.t("Precise Labels",{context:"scale_menu"}),
|
|
checkable:!0,checked:!1});this.actions.alignLabels.binding=new D14(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"Precise Labels");this._updateScalesActions()}};
|
|
A54.prototype._updateScalesActions=function(){var a=this.priceScale(),b=a.mainSource()instanceof TradingView.Series,c=a.mainSource().properties();this.actions.setPercentage.setEnabled(!a.isLog()&&!(b&&c.lockScale.value())&&!(b&&c.style.value()===TradingView.Series.STYLE_PNF));this.actions.setLog.setEnabled(!a.isPercent()&&!(b&&c.lockScale.value())&&!(b&&c.style.value()===TradingView.Series.STYLE_PNF));this.actions.setAutoScale.setChecked(a.D2.autoScale.value());this.actions.setAutoScale.setEnabled(!a.properties().autoScaleDisabled.value())};
|
|
A54.prototype.mouseClickEvent=function(a){};A54.prototype.mouseDoubleClickEvent=function(a){this.reset();TradingView.trackEvent("GUI","Double click price scale")};A54.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&R77.enabled("scales_context_menu")&&this._createContextMenu().show(a)};A54.prototype._createContextMenu=function(){return TradingView.ContextMenu.createMenu(this.getContextMenuActions())};
|
|
A54.prototype.getContextMenuActions=function(){this._initActions();var a=this.pane.chart().actions(),b=[this.actions.reset,new TradingView.ActionSeparator,a.showLeftAxis,a.showRightAxis,new TradingView.ActionSeparator,this.actions.setAutoScale,a.scaleSeriesOnly,new TradingView.ActionSeparator,this.actions.setPercentage,this.actions.setLog,new TradingView.ActionSeparator,a.showSymbolLabelsAction,a.showSeriesLastValue,a.showStudyPlotNamesAction,a.showStudyLastValue];R77.enabled("countdown")&&
|
|
b.push(a.showCountdown);b.push(this.actions.alignLabels);TradingView.onWidget()||(b.push(new TradingView.ActionSeparator),b.push(a.scalesProperties));this.actions.setLockScale&&b.splice(6,0,this.actions.setLockScale);return b};
|
|
A54.prototype.backLabels=function(a){var b=[],c=this.priceScale().orderedSources().slice(),d=this.pane,e=d.chart().model(),d=d.state(),f=[],g=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated();g&&f.push(g);e.selectedSource()&&f.push(e.selectedSource());e.hoveredSource()&&f.push(e.hoveredSource());if(this.priceScale()===d.defaultPriceScale())for(g=this.pane.state().D19(),e=0;e<g.length;e++)d.isOverlay(g[e])&&c.push(g[e]);for(e=0;e<c.length;++e)if(g=c[e],
|
|
a||-1===f.indexOf(g))if(g=g.priceAxisViews(d,g.priceScale()))for(var h=0;h<g.length;h++)b.push(g[h]);return b};
|
|
A54.prototype.optimalWidth=function(){if(!this.isVisible())return 0;var a=0;if(this.pane.state()){var b=this.ctx,c=this.priceScale().marks();b.textBaseline="middle";b.textAlign=this._isLeft?"right":"left";b.setFont(this.baseFont);$.each(c,function(){var c=Math.round(b.measureText(this.label).width+10);c>a&&(a=c)});b.setFont(this.labelFont);for(var c=this.backLabels(!0),d,e=0;e<c.length;e++){c[e].font&&(d=b.font,b.setFont(c[e].font()));var f=Math.round(b.measureText(c[e].text()).width+
|
|
10);f>a&&(a=f);c[e].font&&b.setFont(d)}}return this._optimalWidth=this._BORDER_SIZE+this._MAJOR_TICK_LENGTH+a+-1};A54.prototype.resetOptimalWidth=function(){this._optimalWidth=0};A54.prototype.setFont=function(a,b,c){this.labelFont=this.baseFont=TradingView.makeFont(a,b,c);this.fontSize=a};
|
|
A54.prototype.setSize=function(a){this.size&&this.size.equals(a)||(this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,a),this.ctx=this.canvas.getContext("2d"),this.top_ctx=this.top_canvas.getContext("2d"),this.ctx.setFont(this.baseFont),this.top_ctx.setFont(this.baseFont),this.jqCell.css({width:a.w,"min-width":a.w,height:a.h}))};A54.prototype.update=function(){};
|
|
A54.prototype._hightlightBackground=function(a,b,c){for(var d=b.item(0).price,e=b.item(0).price,f=1;f<b.size();f++)d=Math.min(d,b.item(f).price),e=Math.max(e,b.item(f).price);b=this.priceScale();b.isPercent()&&c&&(c=c.firstValue(),d=b.priceRange().convertToPercent(d,c),e=b.priceRange().convertToPercent(e,c));d=this.priceScale().priceToCoordinate(d);e=this.priceScale().priceToCoordinate(e);TradingView.clearRect(a,1,d,this.size.w-1,e-d,"rgba(109, 158, 235, 0.3)")};
|
|
A54.prototype.drawBackground=function(a){TradingView.clearRect(a,0,0,this.size.w,this.size.h,this.backgroundColor());var b=this.pane.chart().model(),c=b.model().selectedSource();if(c&&c.priceScale()==this.priceScale()&&c instanceof R47){var d=c.axisPoints();if(0===d.size())return;this._hightlightBackground(a,d,c.ownerSource())}b=b.model().crossHairSource();b.startMeasurePoint()&&this._hightlightBackground(a,b.measurePoints(),this.pane.state().mainDataSource())};
|
|
A54.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();var b=this.size.h,c,d;this._isLeft?(a.translate(-.5,-.5),c=this.size.w-this._BORDER_SIZE-1,d=this.size.w-1):(a.translate(.5,-.5),c=0,d=c+this._BORDER_SIZE);a.fillRect(c,0,d-c,b);a.restore()};
|
|
A54.prototype.drawTickMarks=function(a){a.save();a.strokeStyle=this.lineColor();var b=this.priceScale().marks();a.textBaseline="middle";a.textAlign=this._isLeft?"right":"left";a.fillStyle=this.textColor();a.setFont(this.baseFont);var c=this.size.w-1;a.translate(-.5,-.5);var d=b.length,e;if(TradingView.D18("tv4603_tv4590"))if(this._isLeft){e=c-this._BORDER_SIZE;a.fillStyle=this.lineColor();for(a.beginPath();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,
|
|
a.rect(e-c,b[d].coord,c,1);a.fill();a.fillStyle=this.textColor();for(d=b.length;d--;)this._tickmarksCache.paintTo(a,b[d].label,e-this._MAJOR_TICK_LENGTH,b[d].coord,"rght")}else{e=this._BORDER_SIZE+1;a.fillStyle=this.lineColor();for(a.beginPath();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.rect(e,b[d].coord,c+1,1);a.fill();a.fillStyle=this.textColor();for(d=b.length;d--;)this._tickmarksCache.paintTo(a,b[d].label,e+this._MAJOR_TICK_LENGTH+1,b[d].coord,"left")}else if(this._isLeft){e=
|
|
c-this._BORDER_SIZE;for(a.fillStyle=this.lineColor();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(e-c,b[d].coord,c,1);a.fillStyle=this.textColor();for(d=b.length;d--;)a.fillText(b[d].label,e-this._MAJOR_TICK_LENGTH,b[d].coord)}else{e=this._BORDER_SIZE+1;for(a.fillStyle=this.lineColor();d--;)c=b[d].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(e,b[d].coord,c+1,1);a.fillStyle=this.textColor();for(d=b.length;d--;)a.fillText(b[d].label,e+this._MAJOR_TICK_LENGTH+
|
|
1,b[d].coord)}a.restore()};
|
|
A54.prototype._alignLabels=function(){var a=this.size.h/2,b=[],c=this.priceScale().orderedSources().slice(),d=this.pane;d.chart().model();var e=d.state();if(this.priceScale()===e.defaultPriceScale())for(var f=this.pane.state().D19(),d=0;d<f.length;d++)e.isOverlay(f[d])&&c.push(f[d]);for(var g=this.priceScale().mainSource(),d=0;d<c.length;++d){var h=c[d],k=h.priceAxisViews(e,h.priceScale());if(k){for(f=0;f<k.length;f++)b.push(k[f]);g==h&&0<k.length&&(a=k[0]._floatCoordinate)}}f=
|
|
b.filter(function(b){return b._floatCoordinate<=a});c=b.filter(function(b){return b._floatCoordinate>a});f.sort(function(a,b){return(b._floatCoordinate||b.coordinate())-(a._floatCoordinate||a.coordinate())});f.length&&c.length&&c.push(f[0]);c.sort(function(a,b){return(a._floatCoordinate||a.coordinate())-(b._floatCoordinate||b.coordinate())});b.forEach(function(a){a._fixedCoordinate=a.coordinate()});d=this.priceScale().properties();if(d.alignLabels&&d.alignLabels.value()){for(d=1;d<f.length;d++)b=
|
|
f[d],e=f[d-1],g=e.renderer().height(!1),b.coordinate()>e._fixedCoordinate-g&&(e=e._fixedCoordinate-g,b._fixedCoordinate=e);for(f=1;f<c.length;f++)b=c[f],e=c[f-1],g=e.renderer().height(!0),b.coordinate()<e._fixedCoordinate+g&&(e=e._fixedCoordinate+g,b._fixedCoordinate=e)}};
|
|
A54.prototype.drawBackLabels=function(a){a.save();a.setFont(this.labelFont);for(var b=this.backLabels(),c=0;c<b.length;c++){var d=b[c],e=d.renderer();d._fixedCoordinate&&(e._data.coordinate=d._fixedCoordinate);e.draw(a,this._isLeft,this.size.w,this.size.h)}a.restore()};
|
|
A54.prototype.drawCrossHairLabel=function(a){var b=this.pane.chart().model().model(),c=[],d=b.sourceBeingMoved()||b.lineBeingEdited()||b.lineBeingCreated();d&&c.push({source:d,scale:d.priceScale()});b.selectedSource()&&c.push({source:b.selectedSource(),scale:b.selectedSource().priceScale()});b.hoveredSource()&&c.push({source:b.hoveredSource(),scale:b.hoveredSource().priceScale()});c.push({source:b.crossHairSource(),scale:this.priceScale()});b=this.pane.state();for(d=0;d<c.length;d++){var e=
|
|
c[d];if(e=e.source.priceAxisViews(b,e.scale))for(var f=0;f<e.length;f++){var g=e[f];a.save();a.setFont(this.labelFont);var h=g.renderer();g._fixedCoordinate&&(h._data.coordinate=g._fixedCoordinate);h.draw(a,this._isLeft,this.size.w,this.size.h);a.restore()}}};
|
|
A54.prototype.priceScale=function(){var a=this.pane.state(),b=[],b=this._isLeft?[a.leftPriceScale(),a.rightPriceScale()]:[a.rightPriceScale(),a.leftPriceScale()];return null===b[0].mainSource()?null===b[1].mainSource()?b[0]:b[1]:b[0]};A54.prototype.isVisible=function(){return this._isVisible};A54.prototype.setVisible=function(a){(this._visible=a)?this.jqCell.show():this.jqCell.hide();this._isVisible=!!a};
|
|
A54.prototype.setAutoScale=function(a){var b=this.pane.state,c=this.priceScale();this.pane.chart().model().setPriceAutoScale(b,c,a)};A54.prototype.reset=function(){var a=this.pane.state(),b=this.priceScale();this.pane.chart().model().resetPriceScale(a,b)};
|
|
A54.prototype.paint=function(a){this._isVisible&&a&&(this._alignLabels(),a===A22.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))};
|
|
A54.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};A54.prototype.image=function(){var a={};a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;return a};A73=function(a,b){this.chart=a;this.contextMenu=null;this._disableContextMenu=!!b;this.jqRow=$(document.createElement("tr"));this.jqLhsTimeAxisStub=$(document.createElement("td"));this.jqLhsTimeAxisStub.addClass("chart-markup-table");this.jqLhsTimeAxisStub.appendTo(this.jqRow);this.jqLhsStub=$("<div>");this.jqLhsStub.css("width","100%");this.jqLhsStub.css("height","100%");this.jqLhsStub.css("position","relative");this.jqLhsStub.css("overflow","hidden");this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub);
|
|
this.lhsCanvas=TradingView.addCanvasTo(this.jqLhsStub,new A61(16,16));$(this.lhsCanvas).css("position","absolute");$(this.lhsCanvas).css("z-order","2");$(this.lhsCanvas).css("left",0);$(this.lhsCanvas).css("top",0);this.lhsCtx=this.lhsCanvas.getContext("2d");this.jqCell=$(document.createElement("td"));this.jqCell.appendTo(this.jqRow);this.jqCell.addClass("chart-markup-table");this.jqCell.addClass("time-axis");this.jqCell.height(25);this._dv=$("<div>");this._dv.css("width","100%");this._dv.css("height",
|
|
"100%");this._dv.css("position","relative");this._dv.css("overflow","hidden");this._dv.appendTo(this.jqCell);this.canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.canvas).css("position","absolute");$(this.canvas).css("z-order","2");$(this.canvas).css("left",0);$(this.canvas).css("top",0);this.ctx=this.canvas.getContext("2d");this.top_canvas=TradingView.addCanvasTo(this._dv,new A61(16,16));$(this.top_canvas).css("position","absolute");$(this.top_canvas).css("z-order",
|
|
"1");$(this.top_canvas).css("left",0);$(this.top_canvas).css("top",0);this.top_ctx=this.top_canvas.getContext("2d");this.jqRhsTimeAxisStub=$(document.createElement("td"));this.jqRhsTimeAxisStub.addClass("chart-markup-table");this.jqRhsTimeAxisStub.appendTo(this.jqRow);this.jqRhsStub=$("<div>");this.jqRhsStub.css("width","100%");this.jqRhsStub.css("height","100%");this.jqRhsStub.css("position","relative");this.jqRhsStub.css("overflow","hidden");this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub);this.rhsCanvas=
|
|
TradingView.addCanvasTo(this.jqRhsStub,new A61(16,16));$(this.rhsCanvas).css("position","absolute");$(this.rhsCanvas).css("z-order","2");$(this.rhsCanvas).css("left",0);$(this.rhsCanvas).css("top",0);this.rhsCtx=this.rhsCanvas.getContext("2d");this.setFont(11,"Arial","");this.ctx.setFont(this.baseFont);this.top_ctx.setFont(this.baseFont);this.restoreDefaultCursor();this.update();this._minVisibleSpan=TradingView.MINUTE_SPAN;TradingView.setMouseEventHandler(this.jqCell,this,!0);this.updatePriceScalesVisibility()};
|
|
A73.prototype.BORDER_SIZE=1;A73.prototype.MAJOR_TICK_LENGTH=4;A73.prototype.MINOR_TICK_LENGTH=2;A73.prototype.backgroundColor=function(){var a=this.chart.model();return a?a.model().properties().paneProperties.background.value():"#ffffff"};A73.prototype.lineColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.lineColor.value():"#ffffff"};
|
|
A73.prototype.textColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.textColor.value():"#ffffff"};A73.prototype.updatePriceScalesVisibility=function(){this.chart.properties().scalesProperties.showLeftScale.value()?this.jqLhsTimeAxisStub.show():this.jqLhsTimeAxisStub.hide();this.chart.properties().scalesProperties.showRightScale.value()?this.jqRhsTimeAxisStub.show():this.jqRhsTimeAxisStub.hide()};
|
|
A73.prototype.mouseDownEvent=function(a){if(this._mousedown)return!0;this._mousedown=!0;var b=this.chart.model();b.timeScale().isEmpty()||($(this.jqCell).css("cursor",TradingView.cursorCss("cursor_size_horizontal","15 15")),b.startScaleTime(a.localX))};A73.prototype.mouseDownOutsideEvent=function(a){a=this.chart.model();!a.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,a.endScaleTime(),this.restoreDefaultCursor())};
|
|
A73.prototype.pressedMouseMoveEvent=function(a){var b=this.chart.model();if(!b.timeScale().isEmpty()){var c=!1,d=(new Date).valueOf();this._lastScrollScaleTime&&100>d-this._lastScrollScaleTime&&(c=!0);c||(TradingView.trackEvent("GUI","Scaling time scale"),b.scaleTimeTo(a.localX),this._lastScrollScaleTime=d)}};A73.prototype.mouseUpEvent=function(a){this._mousedown=!1;a=this.chart.model();a.timeScale().isEmpty()||(a.endScaleTime(),this.restoreDefaultCursor())};
|
|
A73.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&R77.enabled("scales_context_menu")&&this._createContextMenu().show(a)};A73.prototype._createContextMenu=function(){return TradingView.ContextMenu.createMenu(this.getContextMenuActions())};
|
|
A73.prototype.getContextMenuActions=function(){var a=this.chart;a.model().mainSeries().createSessStudy();a.updateActions();var a=a.actions(),b=R77.enabled("charting_library_base")?[a.timeScaleReset,new TradingView.ActionSeparator,a.applyTimeZone]:[a.timeScaleReset,new TradingView.ActionSeparator,a.applyTimeZone,a.sessionBreaks,a.extendedHours];b.push(new TradingView.ActionSeparator,a.tmzProperties);return b};A73.prototype.mouseClickEvent=function(a){};
|
|
A73.prototype.mouseDoubleClickEvent=function(a){TradingView.trackEvent("GUI","Double click time scale");this.chart.model().resetTimeScale()};A73.prototype.optimalHeight=function(){return this.BORDER_SIZE+this.MAJOR_TICK_LENGTH+this.maxFontSize+6};A73.prototype.setFont=function(a,b,c){this.baseFont=TradingView.makeFont(a,b,c);this.baseBoldFont=TradingView.makeFont(a,b,c+" bold");this.labelFont=this.baseFont;this.maxFontSize=a};
|
|
A73.prototype.setSize=function(a,b,c){this.size&&this.size.equals(a)||(this.lhsStubSize=b,TradingView.setCanvasSize(this.lhsCanvas,b),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqLhsTimeAxisStub.width(b.w),this.jqLhsTimeAxisStub.height(b.h),this.rhsStubSize=c,TradingView.setCanvasSize(this.rhsCanvas,c),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.jqRhsTimeAxisStub.width(c.w),this.jqRhsTimeAxisStub.height(c.h),this.size=a,TradingView.setCanvasSize(this.canvas,a),TradingView.setCanvasSize(this.top_canvas,
|
|
a),this.ctx=this.canvas.getContext("2d"),this.top_ctx=this.top_canvas.getContext("2d"),this.ctx.setFont(this.baseFont),this.top_ctx.setFont(this.baseFont),this.jqCell.width(a.w),this.jqCell.height(a.h))};A73.prototype._spanIndex=function(a){for(var b=[TradingView.MINUTE_SPAN,TradingView.HOUR_SPAN,TradingView.DAY_SPAN,TradingView.MONTH_SPAN,TradingView.YEAR_SPAN],c=b.length-1;0<c&&!(b[c]<=a);)c--;return c};
|
|
A73.prototype._spanOffset=function(a,b){if(b<a)throw Error("actual span cuold not be less then base");return this._spanIndex(b)-this._spanIndex(a)};A73.prototype.update=function(){if(this.chart.model()){var a=this.chart.model().timeScale().marks();if(a){var b=this;this._minVisibleSpan=TradingView.YEAR_SPAN;$.each(a,function(){b._minVisibleSpan=Math.min(this.span,b._minVisibleSpan)})}}};
|
|
A73.prototype._hightlightBackground=function(a,b){for(var c=this.chart.model().timeScale(),d=b.item(0).index,e=b.item(0).index,f=1;f<b.size();f++)d=Math.min(d,b.item(f).index),e=Math.max(e,b.item(f).index);d=c.indexToCoordinate(d);c=c.indexToCoordinate(e);TradingView.clearRect(a,d,1,c-d,this.size.h-1,"rgba(109, 158, 235, 0.3)")};
|
|
A73.prototype.drawBackground=function(a){TradingView.clearRect(a,0,0,this.size.w,this.size.h,this.backgroundColor());var b=this.chart.model();if(b){var c=b.timeScale(),d=b.model().selectedSource();if(d&&d instanceof R47&&!c.isEmpty()){c=d.axisPoints();if(0===c.size())return;this._hightlightBackground(a,c)}b=b.model().crossHairSource();b.startMeasurePoint()&&this._hightlightBackground(a,b.measurePoints())}};
|
|
A73.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();a.fillRect(-.5,.5,this.size.w+.5,this.BORDER_SIZE);a.restore()};
|
|
A73.prototype.drawStubs=function(){var a=this.BORDER_SIZE,b=2*this.BORDER_SIZE,c=this.lhsCtx;TradingView.clearRect(c,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(this.lhsStubSize.w-b-.5,.5,b,a);c.fillRect(this.lhsStubSize.w-b-.5,-.5,a,a);c=this.rhsCtx;TradingView.clearRect(c,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(-.5,.5,b,a);c.fillRect(.5,-.5,a,a)};
|
|
A73.prototype.drawTickMarks=function(a){var b=this.chart.model().timeScale().marks();if(b&&0!==b.length){var c=b.reduce(function(a,b){return a.span>b.span?a:b}).span;30<c&&40>c&&(c=30);a.save();a.strokeStyle=this.lineColor();a.textBaseline="top";a.textAlign="center";a.translate(.5,.5);a.fillStyle=this.lineColor();for(var d=b.length;d--;)a.fillRect(b[d].coord,this.BORDER_SIZE,1,b[d].major?this.MAJOR_TICK_LENGTH:this.MINOR_TICK_LENGTH);a.fillStyle=this.textColor();for(var e={},
|
|
d=0;d<b.length;d++){var f=b[d].span>=c?this.baseBoldFont:this.baseFont,g=e[f]||[];g.push(b[d]);e[f]=g}for(var h in e)for(a.setFont(h),b=e[h],d=0;d<b.length;d++)a.fillText(b[d].label,b[d].coord,this.BORDER_SIZE+this.MAJOR_TICK_LENGTH-1);a.restore()}};
|
|
A73.prototype.drawBackLabels=function(a){a.save();a.setFont(this.labelFont);for(var b=this.chart.model().D19(),c=this.chart.model(),c=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated(),d=0;d<b.length;d++){var e=b[d];if(e!==this.chart.model().crossHairSource()&&e!==c&&e.timeAxisViews&&(e=e.timeAxisViews()))for(var f=0;f<e.length;f++)e[f].renderer().draw(a,this.size.w,this.size.h)}a.restore()};
|
|
A73.prototype.drawCrossHairLabel=function(a){this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h);var b=this.chart.model();if(b=b.sourceBeingMoved()||b.lineBeingEdited()||b.lineBeingCreated()){if(a.save(),b.timeAxisViews&&(b=b.timeAxisViews()))for(var c=0;c<b.length;c++)b[c].renderer().draw(a,this.size.w,this.size.h)}else if(a.save(),a.setFont(this.labelFont),b=this.chart.model().crossHairSource().timeAxisView())for(c=0;c<b.length;c++)b[c].renderer().draw(a,this.size.w,this.size.h);
|
|
a.restore()};A73.prototype.paint=function(a){this.top_ctx.setFont(this.labelFont);0!==a&&(a===A22.UPDATE_CURSOR_ONLY?this.drawCrossHairLabel(this.top_ctx):(a=this.ctx,this.drawBackground(a),this.drawBorder(a),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(a),this.drawBackLabels(a),this.drawCrossHairLabel(this.top_ctx))))};
|
|
A73.prototype.setStubVisible=function(a,b){var c=A54.isLeft(a)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;b?c.show():c.hide()};A73.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};
|
|
A73.prototype.image=function(){var a={};a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;a.lhsStub={};a.lhsStub.content=this.lhsCanvas.toDataURL();a.lhsStub.contentWidth=this.lhsStubSize.w;a.lhsStub.contentHeight=this.lhsStubSize.h;a.rhsStub={};a.rhsStub.content=this.rhsCanvas.toDataURL();a.rhsStub.contentWidth=this.rhsStubSize.w;a.rhsStub.contentHeight=this.rhsStubSize.h;return a};J41=function(a,b,c,d){D7.call(this,a,b);this.D1=c;this._showOnlyConfirmInputs=d;this.prepareLayout()};inherit(J41,D7);
|
|
J41.prototype._addSessionEditor=function(a,b,c,d){if("session"!==c.type)TradingView.logError("Session editor adding FAILED: wrong input type.");else{c=function(a,b){var c=$("<td/>");c.appendTo(a);c.css("padding-left","0px");c.css("padding-right","0px");var d=$("<input>");d.attr("type","text");d.addClass("ticker");d.css("width","40px");d.attr("id",b);d.appendTo(c)};var e=function(a,b,c){var d=$("<td/>");d.css("padding-left",c);d.css("padding-right",c);d.appendTo(a);
|
|
a=$("<div/>");a.appendTo(d);a.append(b);a.css("font-size","150%")},f=$("<table/>");f.appendTo(a);a=$("<tr/>");a.appendTo(f);f=["start_hours","start_minutes","end_hours","end_minutes"];c.call(this,a,f[0]);e.call(this,a,":",0);c.call(this,a,f[1]);e.call(this,a,"-",4);c.call(this,a,f[2]);e.call(this,a,":",0);c.call(this,a,f[3]);this.bindControl(new D8(a,f,b,!1,this.model(),d))}};
|
|
J41.prototype.prepareLayoutImpl=function(a,b){for(var c=0;c<a.inputs.length;c++){var d=a.inputs[c],e=d.id;if("first_visible_bar_time"!=e&&"last_visible_bar_time"!=e&&"time"!=d.type&&!d.isHidden&&(!this._showOnlyConfirmInputs||d.confirm)){var f=d.name||e.toLowerCase().replace(/\b\w/g,function(a){return a.toUpperCase()}),g="Change "+f,h=$("<tr/>");h.appendTo(b);var k=$("<td/>");k.appendTo(h);k.addClass($.t("propertypage-name-label",{context:"css_class"}));k.text($.t(f,
|
|
{context:"input"}));f=$("<td/>");f.appendTo(h);h=null;if("resolution"===d.type)h=$('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1h</option><option value="120">2h</option><option value="180">3h</option><option value="D">1d</option><option value="W">1w</option></select>');else if("symbol"===d.type)h=$('<input class="symbol-edit single">'),A69.bindToInput(h);
|
|
else if("session"===d.type)this._addSessionEditor(f,this._property.inputs[e],d,g);else if(d.options)for(h=$("<select/>"),k=0;k<d.options.length;k++){var l=d.options[k];$("<option value='"+l+"'>"+l+"</option>").appendTo(h)}else h=$("<input/>"),"bool"===d.type?h.attr("type","checkbox"):h.attr("type","text");h&&(h.appendTo(f),h.is(":checkbox")||h.css("width","100px"));d.options?this.bindControl(new D11(h,this._property.inputs[e],null,!0,this.model(),g)):"bar_time"===d.type?
|
|
(this.bindControl(new D9(h,this._property.inputs[e],!0,this.model(),g,this.model().mainSeries(),10)),h.addClass("ticker")):"integer"===d.type?(k=[TradingView.ToIntTransformer(d.defval)],(0===d.min||d.min)&&k.push(TradingView.GreateTransformer(d.min)),(0===d.max||d.max)&&k.push(TradingView.LessTransformer(d.max)),this.bindControl(new TradingView.SimpleStringBinder(h,this._property.inputs[e],k,!1,this.model(),g)),h.addClass("ticker"),isFinite(d.step)&&0<d.step&&h.attr("data-step",
|
|
d.step)):"float"===d.type?(k=[TradingView.ToFloatTransformer(d.defval)],(0===d.min||d.min)&&k.push(TradingView.GreateTransformer(d.min)),(0===d.max||d.max)&&k.push(TradingView.LessTransformer(d.max)),this.bindControl(new TradingView.SimpleStringBinder(h,this._property.inputs[e],k,!1,this.model(),g)),h.addClass("ticker"),isFinite(d.step)&&0<d.step&&h.attr("data-step",d.step)):"text"===d.type?this.bindControl(new TradingView.SimpleStringBinder(h,this._property.inputs[e],null,!1,this.model(),g)):"bool"===
|
|
d.type?this.bindControl(new D12(h,this._property.inputs[e],!0,this.model(),g)):"resolution"===d.type?this.bindControl(new D11(h,this._property.inputs[e],TradingView.UppercaseTransformer,!0,this.model(),"Change Interval")):"symbol"===d.type&&this.bindControl(new D10(h,this._property.inputs[e],!0,this.model(),"Change Symbol"))}}this._property.offset&&(f=this._property.offset.title?this._property.offset.title.value():"Offset",h=this.addOffsetEditorRow(b,
|
|
f),k=[TradingView.ToIntTransformer(this._property.offset.val)],k.push(TradingView.GreateTransformer(this._property.offset.min)),k.push(TradingView.LessTransformer(this._property.offset.max)),this.bindControl(new TradingView.SimpleStringBinder(h,this._property.offset.val,k,!1,this.model(),"Undo "+f)));this._property.offsets&&$.each(a.plots,function(a,c){if(this._property.offsets[c.id]){var d=this._property.offsets[c.id];if(void 0===d.isHidden||!d.isHidden.value()){var e=d.title.value(),f=this.addOffsetEditorRow(b,
|
|
e),g=[TradingView.ToIntTransformer(d.val)];g.push(TradingView.GreateTransformer(d.min));g.push(TradingView.LessTransformer(d.max));this.bindControl(new TradingView.SimpleStringBinder(f,d.val,g,!1,this.model(),"Undo "+e))}}}.bind(this))};
|
|
J41.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.D1.metaInfo();this.prepareLayoutImpl(a,this._table);this.loadData()};J41.prototype.widget=function(){return this._table};J47=function(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()};
|
|
inherit(J47,D7);
|
|
J47.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a={},b=0;b<this.D1.metaInfo().plots.length;++b)if(!(this.D1.isSelfColorerPlot(b)||this.D1.isTextColorerPlot(b)||this.D1.isDataOffsetPlot(b)||this.D1.isOHLCColorerPlot(b))){var c=this.D1.metaInfo().plots[b];this.D1.isLinePlot(b)||this.D1.isBarColorerPlot(b)||
|
|
this.D1.isBgColorerPlot(b)?this._prepareLayoutForPlot(b,c):this.D1.isPlotArrowsPlot(b)?this._prepareLayoutForArrowsPlot(b,c):this.D1.isPlotCharsPlot(b)?this._prepareLayoutForCharsPlot(b,c):this.D1.isPlotShapesPlot(b)?this._prepareLayoutForShapesPlot(b,c):this.D1.isOHLCSeriesPlot(b)?(c=this.D1.metaInfo().plots[b].target,a[c]||(a[c]=c,c={id:c,type:"ohlc"},this.D1.isOHLCBarsPlot(b)?this._prepareLayoutForBarsPlot(b,c):this.D1.isOHLCCandlesPlot(b)&&this._prepareLayoutForCandlesPlot(b,
|
|
c))):console.error("Unknown plot type: "+c.type)}if(b=this.D1.properties().transparency)c=$('<tr class="line"/>'),c.appendTo(this._table),$("<td/>").appendTo(c),a=$("<td/>"),a.appendTo(c),a.addClass("propertypage-name-label"),a.html($.t("Transparency")),a=$("<td/>"),a.attr("colspan","3"),a.appendTo(c),c=TradingView.createTransparencyEditor().width(270),c.appendTo(a),this.bindControl(new TradingView.SliderBinder(c,b,!0,this.model(),"Change Study Transparency"));var d=this.D1.properties().bands;
|
|
if(d&&0<d.childCount())for(b=0;b<d.childCount();b++){a=d[b];c=$('<tr class="line"/>');c.appendTo(this._table);var e=$("<td/>");e.appendTo(c);var f=$("<input type='checkbox' class='visibility-switch'/>");f.appendTo(e);e=a.name.value();this.createLabeledCell(e,f).appendTo(c).addClass($.t("propertypage-name-label",{context:"css_class"}));e=$("<td/>");e.appendTo(c);e.addClass("colorpicker-cell");var e=TradingView.addColorPicker(e),g=$("<td/>");g.appendTo(c);var h=TradingView.createLineWidthEditor();h.appendTo(g);
|
|
var k=$('<td colspan="4">').css({whiteSpace:"nowrap"});k.appendTo(c);g=TradingView.createLineStyleEditor();g.render().appendTo(k);var l=$("<input class='property-page-bandwidth' type='text'/>");l.appendTo(k);k=[TradingView.ToFloatTransformer(a.value.value())];c="Change band";this.bindControl(new TradingView.SimpleStringBinder(l,a.value,k,!1,this.model(),c));this.bindControl(new D12(f,a.visible,!0,this.model(),c));this.bindControl(new TradingView.ColorBinding(e,a.color,!0,this.model(),
|
|
c));this.bindControl(new D11(g,a.linestyle,parseInt,!0,this.model(),c));this.bindControl(new TradingView.SliderBinder(h,a.linewidth,!0,this.model(),c))}this.D1.properties().bandsBackground&&(a=this.D1.properties().bandsBackground,f=$.t("Background"),c=$.t("Change band background"),c=this._prepareFilledAreaBackground(a.fillBackground,a.backgroundColor,a.transparency,f,c),c.appendTo(this._table));this.D1.properties().areaBackground&&(a=this.D1.properties().areaBackground,
|
|
f=$.t("Background"),c=$.t("Change area background"),c=this._prepareFilledAreaBackground(a.fillBackground,a.backgroundColor,a.transparency,f,c),c.appendTo(this._table));d=this.D1.metaInfo().filledAreas;if(void 0!==d)for(b=0;b<d.length;++b)c=d[b],a=this.D1.properties().filledAreasStyle[c.id],f=c.title||$.t("Background"),c="Change "+f,c=this._prepareFilledAreaBackground(a.visible,a.color,a.transparency,f,c),c.appendTo(this._table);for(var m in this.D1.metaInfo().graphics){var b=this.D1.metaInfo().graphics[m],
|
|
n;for(n in b)a=this._property.graphics[m][n],J47["_createRow_"+m].call(this,this._table,a)}1==this._table.find("tr").length&&(e=this._table.find(".visibility-cell"),e.css("display","none"),a=this._table.find(".propertypage-name-label"),a.css("padding-left",0));m=this._prepareStudyPropertiesLayout();this._table=this._table.add(m);TradingView.StudyMetaInfo.isScriptStrategy(this.D1.metaInfo())&&(m=this._prepareOrdersSwitches(),this._table=this._table.add(m));this.loadData()};
|
|
J47.prototype._prepareOrdersSwitches=function(){function a(){var a=e.prop("checked");l.D1.ordersVisible.setValue(a);f.toggleClass("disabled",!a);g.prop("disabled",!a);h.toggleClass("disabled",!a);k.prop("disabled",!a)}var b=$('<table class="property-page study-strategy-properties" cellspacing="0" cellpadding="2">'),c="chart-orders-switch_"+Date.now().toString(36),d=$("<tr>").appendTo(b),e=$('<input id="'+c+'" type="checkbox">').appendTo($("<td>").appendTo(d));$('<label for="'+
|
|
c+'">'+$.t("Trades on Chart")+"</label>").appendTo($("<td>").appendTo(d));var c="chart-orders-labels-switch_"+Date.now().toString(36),f=$("<tr>").appendTo(b),g=$('<input id="'+c+'" type="checkbox">').appendTo($("<td>").appendTo(f));$('<label for="'+c+'">'+$.t("Signal Labels")+"</label>").appendTo($("<td>").appendTo(f));var c="chart-orders-qty-switch_"+Date.now().toString(36),h=$("<tr>").appendTo(b),k=$('<input id="'+c+'" type="checkbox">').appendTo($("<td>").appendTo(h));$('<label for="'+c+'">'+$.t("Quantity")+
|
|
"</label>").appendTo($("<td>").appendTo(h));this.D1.ordersVisible.subscribe(function(a){e.prop("checked",a)},{callWithLast:!0});this.D1.ordersLabelsVisible.subscribe(function(a){g.prop("checked",a)},{callWithLast:!0});this.D1.ordersQtyVisible.subscribe(function(a){k.prop("checked",a)},{callWithLast:!0});var l=this;e.change(a);a();g.change(function(){l.D1.ordersLabelsVisible.setValue(g.prop("checked"))});k.change(function(){l.D1.ordersQtyVisible.setValue(k.prop("checked"))});return b};
|
|
J47.prototype._prepareLayoutForPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),f=e.palette,g=e.paletteProps,e="Change "+c;if(f)this._prepareLayoutForPalette(a,b,f,g,e);else{f=$('<tr class="line"/>');f.appendTo(this._table);var h=$("<td/>");h.appendTo(f);h.addClass("visibility-cell");g=$("<input type='checkbox' class='visibility-switch'/>");g.appendTo(h);c=this.D1.properties().styles[c].title.value();this.createLabeledCell(c,
|
|
g).appendTo(f).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(f);c.addClass("colorpicker-cell");var c=TradingView.addColorPicker(c),k=$("<td/>");k.appendTo(f);h=TradingView.createLineWidthEditor();h.appendTo(k);var l=$("<td>");l.appendTo(f);k=TradingView.createPlotEditor();k.appendTo(l);var m=$("<td>");m.appendTo(f);var n=TradingView.createTransparencyEditor(c);n.appendTo(m);l=d.plottype.value();m.css("display",this._isStyleNeedsTransparency(l)?"block":"none");
|
|
l=$("<td>");l.appendTo(f);var p=$("<input type='checkbox'>");p.appendTo(l);this.createLabeledCell("Price Line",p).appendTo(f);this.bindControl(new D12(g,d.visible,!0,this.model(),e));this.bindControl(new TradingView.ColorBinding(c,d.color,!0,this.model(),e));this.bindControl(new TradingView.SliderBinder(h,d.linewidth,!0,this.model(),e));this.bindControl(new D11(k,d.plottype,parseInt,!0,this.model(),e));this.bindControl(new TradingView.SliderBinder(n,
|
|
d.transparency,!0,this.model(),e));this.bindControl(new D12(p,d.trackPrice,!0,this.model(),"Change Price Line"));e=function(){var a=d.plottype.value();m.css("display",this._isStyleNeedsTransparency(a)?"table-cell":"none");n.css("display",this._isStyleNeedsTransparency(a)?"inline-block":"none")}.bind(this);e();d.plottype.listeners().subscribe(null,e)}};
|
|
J47.prototype._prepareLayoutForBarsPlot=function(a,b){var c=b.id,d=this.D1.properties().ohlcPlots[c],e=this._findPlotPalette(a,b),f=e.palette,e=e.paletteProps,c="Change "+c,g=$('<tr class="line"/>');g.appendTo(this._table);var h=$("<td/>");h.appendTo(g);h.addClass("visibility-cell");var k=$("<input type='checkbox' class='visibility-switch'/>");k.appendTo(h);this.bindControl(new D12(k,d.visible,!0,this.model(),c));h=d.title.value();this.createLabeledCell(h,
|
|
k).appendTo(g).addClass($.t("propertypage-name-label",{context:"css_class"}));f?this._prepareLayoutForPalette(a,b,f,e,c):(f=$("<td/>"),f.appendTo(g),f.addClass("colorpicker-cell"),f=TradingView.addColorPicker(f),this.bindControl(new TradingView.ColorBinding(f,d.color,!0,this.model(),c)))};
|
|
J47.prototype._prepareLayoutForCandlesPlot=function(a,b){this._prepareLayoutForBarsPlot(a,b);var c=b.id,d=this.D1.properties().ohlcPlots[c],c="Change "+c,e=$('<tr class="line"/>');e.appendTo(this._table);var f=$("<td/>");f.appendTo(e);f.addClass("visibility-cell");var g=$("<input type='checkbox' class='visibility-switch'/>");g.appendTo(f);this.bindControl(new D12(g,d.drawWick,!0,this.model(),c));this.createLabeledCell("Wick",g).appendTo(e).addClass($.t("propertypage-name-label",
|
|
{context:"css_class"}));f=$("<td/>");f.appendTo(e);f.addClass("colorpicker-cell");e=TradingView.addColorPicker(f);this.bindControl(new TradingView.ColorBinding(e,d.wickColor,!0,this.model(),c))};
|
|
J47.prototype._prepareLayoutForShapesPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),f=e.palette,g=e.paletteProps,e="Change "+c,h=$('<tr class="line"/>');h.appendTo(this._table);var k=$("<td/>");k.appendTo(h);k.addClass("visibility-cell");var l=$("<input type='checkbox' class='visibility-switch'/>");l.appendTo(k);this.bindControl(new D12(l,d.visible,!0,this.model(),e));c=this.D1.properties().styles[c].title.value();
|
|
this.createLabeledCell(c,l).appendTo(h).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(h);l=TradingView.createShapeStyleEditor();l.appendTo(c);this.bindControl(new D11(l,d.plottype,null,!0,this.model(),e));c=$("<td/>");c.appendTo(h);h=TradingView.createShapeLocationEditor();h.appendTo(c);this.bindControl(new D11(h,d.location,null,!0,this.model(),e));f?this._prepareLayoutForPalette(a,b,f,g,e):(h=$('<tr class="line"/>'),
|
|
h.appendTo(this._table),$("<td/>").appendTo(h),$("<td/>").appendTo(h),f=$("<td/>"),f.appendTo(h),f.addClass("colorpicker-cell"),g=TradingView.addColorPicker(f),this.bindControl(new TradingView.ColorBinding(g,d.color,!0,this.model(),e)),f=$("<td>"),f.appendTo(h),h=TradingView.createTransparencyEditor(g),h.appendTo(f),this.bindControl(new TradingView.SliderBinder(h,d.transparency,!0,this.model(),e)))};
|
|
J47.prototype._prepareLayoutForCharsPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e=this._findPlotPalette(a,b),f=e.palette,g=e.paletteProps,e="Change "+c,h=$('<tr class="line"/>');h.appendTo(this._table);var k=$("<td/>");k.appendTo(h);k.addClass("visibility-cell");var l=$("<input type='checkbox' class='visibility-switch'/>");l.appendTo(k);this.bindControl(new D12(l,d.visible,!0,this.model(),e));c=this.D1.properties().styles[c].title.value();
|
|
this.createLabeledCell(c,l).appendTo(h).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");c.appendTo(h);l=TradingView.createTextEditor();l.appendTo(c);l.keyup(function(){var a=$(this),b=a.val();b&&(a.val(b.split("")[b.length-1]),a.change())});this.bindControl(new TradingView.SimpleStringBinder(l,d["char"],null,!1,this.model(),e));c=$("<td/>");c.appendTo(h);h=TradingView.createShapeLocationEditor();h.appendTo(c);this.bindControl(new D11(h,d.location,
|
|
null,!0,this.model(),e));f?this._prepareLayoutForPalette(a,b,f,g,e):(h=$('<tr class="line"/>'),h.appendTo(this._table),$("<td/>").appendTo(h),$("<td/>").appendTo(h),f=$("<td/>"),f.appendTo(h),f.addClass("colorpicker-cell"),g=TradingView.addColorPicker(f),this.bindControl(new TradingView.ColorBinding(g,d.color,!0,this.model(),e)),f=$("<td>"),f.appendTo(h),h=TradingView.createTransparencyEditor(g),h.appendTo(f),this.bindControl(new TradingView.SliderBinder(h,d.transparency,!0,this.model(),e)))};
|
|
J47.prototype._isStyleNeedsTransparency=function(a){return 0<=[TradingView.StudyConsts.PLOT_AREA,TradingView.StudyConsts.PLOT_AREA_WITH_BREAKS,TradingView.StudyConsts.PLOT_COLUMNS].indexOf(a)};J47.prototype._isStyleNeedsConnectPoints=function(a){return 0<=[TradingView.StudyConsts.PLOT_CROSS,TradingView.StudyConsts.PLOT_CIRCLES].indexOf(a)};
|
|
J47.prototype._prepareLayoutForPalette=function(a,b,c,d,e){b=b.id;var f=this.D1.properties().styles[b];b=0;var g,h=function(){var a=f.plottype.value();g.css("display",this._isStyleNeedsTransparency(a)?"block":"none")}.bind(this),k;for(k in c.colors){var l=d.colors[k];c=$('<tr class="line"/>');c.appendTo(this._table);$("<td/>").appendTo(c);var m=$("<td/>");m.appendTo(c);m.addClass($.t("propertypage-name-label",{context:"css_class"}));m.html($.t(l.name.value()));
|
|
m=$("<td/>");m.appendTo(c);m.addClass("colorpicker-cell");m=TradingView.addColorPicker(m);this.bindControl(new TradingView.ColorBinding(m,l.color,!0,this.model(),e));if(0===b&&(this.D1.isBgColorerPlot(a)||this.D1.isPlotCharsPlot(a)||this.D1.isPlotShapesPlot(a))){var n=$("<td>");n.appendTo(c);g=TradingView.createTransparencyEditor(m);g.appendTo(n);this.bindControl(new TradingView.SliderBinder(g,f.transparency,!0,this.model(),e))}if(this.D1.isLinePlot(a)){n=$("<td/>");n.appendTo(c);
|
|
var p=TradingView.createLineWidthEditor();p.appendTo(n);this.bindControl(new TradingView.SliderBinder(p,l.width,!0,this.model(),e));l=$("<td>");l.appendTo(c);0===b&&(n=TradingView.createPlotEditor(),n.appendTo(l),this.bindControl(new D11(n,f.plottype,parseInt,!0,this.model(),e)),n=$("<td>"),n.appendTo(c),g=TradingView.createTransparencyEditor(m),g.appendTo(n),this.bindControl(new TradingView.SliderBinder(g,f.transparency,!0,this.model(),e)),h(),f.plottype.listeners().subscribe(null,
|
|
h),l=$("<input type='checkbox'>"),m=$('<td colspan="4">').css({whiteSpace:"nowrap"}),n=$("<span>").html($.t("Price Line")),p=$("<span>"),p.append(l),m.append(p).append(n).appendTo(c),this.bindControl(new D12(l,f.trackPrice,!0,this.model(),"Change Price Line")))}b++}};
|
|
J47.prototype._prepareLayoutForArrowsPlot=function(a,b){var c=b.id,d=this.D1.properties().styles[c],e="Change "+c,f=$('<tr class="line"/>');f.appendTo(this._table);var g=$("<td/>");g.appendTo(f);g.addClass("visibility-cell");var h=$("<input type='checkbox' class='visibility-switch'/>");h.appendTo(g);c=this.D1.properties().styles[c].title.value();this.createLabeledCell(c,h).appendTo(f).addClass($.t("propertypage-name-label",{context:"css_class"}));c=$("<td/>");
|
|
c.appendTo(f);c.addClass("colorpicker-cell");c=TradingView.addColorPicker(c);g=$("<td/>");g.appendTo(f);g.addClass("colorpicker-cell");var g=TradingView.addColorPicker(g),k=$("<td>");k.appendTo(f);f=TradingView.createTransparencyEditor();f.appendTo(k);this.bindControl(new D12(h,d.visible,!0,this.model(),e));this.bindControl(new TradingView.ColorBinding(c,d.colorup,!0,this.model(),e));this.bindControl(new TradingView.ColorBinding(g,d.colordown,!0,this.model(),e));this.bindControl(new TradingView.SliderBinder(f,
|
|
d.transparency,!0,this.model(),e))};
|
|
J47.prototype._findPlotPalette=function(a,b){var c=b.id,d=null,e=null,f=this.D1.metaInfo().plots;if(this.D1.isBarColorerPlot(a)||this.D1.isBgColorerPlot(a))d=this.D1.metaInfo().palettes[b.palette],e=this.D1.properties().palettes[b.palette];else for(var g=0;g<f.length;g++)if(f[g].target===c&&(this.D1.isSelfColorerPlot(g)||this.D1.isOHLCColorerPlot(g))){d=this.D1.metaInfo().palettes[f[g].palette];e=this.D1.properties().palettes[f[g].palette];break}return{palette:d,
|
|
paletteProps:e}};
|
|
J47.prototype._prepareStudyPropertiesLayout=function(){var a=$('<table class="property-page study-properties" cellspacing="0" cellpadding="2">');if(!this.D1.metaInfo().is_price_study){var b=this.createPrecisionEditor(),c=$("<tr>");c.appendTo(a);$("<td>"+$.t("Precision")+"</td>").appendTo(c);$("<td>").append(b).appendTo(c);this.bindControl(new D11(b,this.D1.properties().precision,null,!0,this.model(),"Change Precision"))}"Compare@tv-basicstudies"==this.D1.metaInfo().id&&
|
|
(b=this.createSeriesMinTickEditor(),c=$("<tr>"),c.appendTo(a),$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(c),$("<td>").append(b).appendTo(c),this.bindControl(new D11(b,this.D1.properties().minTick,null,!0,this.model(),"Change MinTick")));this._putStudyDefaultStyles(a);return a};
|
|
J47.prototype._putStudyDefaultStyles=function(a,b){var c=null,d=this.D1;if(d.properties().linkedToSeries&&d.properties().linkedToSeries.value())return!1;$.each(this.D0.m_model.panes(),function(a,b){$.each(b.D19(),function(a,e){if(e==d)return c=b,!1})});this._pane=c;var e;this._pane&&(-1!==this._pane.leftPriceScale().D19().indexOf(this.D1)?e="left":-1!==this._pane.rightPriceScale().D19().indexOf(this.D1)?e="right":this._pane.isOverlay(this.D1)&&
|
|
(e="none"));if(e){var f=this;e=this.createKeyCombo({left:$.t("Scale Left"),right:$.t("Scale Right"),none:$.t("Screen (No Scale)")}).val(e).change(function(){switch(this.value){case "left":f.D0.move(f.D1,f._pane,f._pane.leftPriceScale());break;case "right":f.D0.move(f.D1,f._pane,f._pane.rightPriceScale());break;case "none":f.D0.move(f.D1,f._pane,null)}});var g=this.addRow(a);$("<td>"+$.t("Scale")+"</td>").appendTo(g);e=$("<td>").appendTo(g).append(e);b&&2<b&&e.attr("colspan",
|
|
b-1)}return a};J47.prototype.widget=function(){return this._table};
|
|
J47.prototype._prepareFilledAreaBackground=function(a,b,c,d,e){var f=$('<tr class="line"/>'),g=$("<td/>");g.appendTo(f);var h=$("<input type='checkbox' class='visibility-switch'/>");h.appendTo(g);this.createLabeledCell(d,h).appendTo(f).addClass($.t("propertypage-name-label",{context:"css_class"}));d=$("<td/>");d.appendTo(f);d.addClass("colorpicker-cell");d=TradingView.addColorPicker(d);g=$("<td/>");g.attr("colspan","3");g.appendTo(f);var k=TradingView.createTransparencyEditor(d).width(230);
|
|
k.appendTo(g);this.bindControl(new D12(h,a,!0,this.model(),e+" visibility"));this.bindControl(new TradingView.ColorBinding(d,b,!0,this.model(),e+" color"));this.bindControl(new TradingView.SliderBinder(k,c,!0,this.model(),e+" transparency"));return f};J39=function(a,b,c){D7.call(this,a,b);this.D1=c;this._property=a;this.prepareLayout()};inherit(J39,D7);
|
|
J39.prototype.prepareLayout=function(){this.D1.properties().linkedToSeries&&this.D1.properties().linkedToSeries.value();this._table=$()};J39.prototype.widget=function(){return this._table};
|
|
J47._createRow_horizlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),f=this.createColorPicker(),g=TradingView.createLineWidthEditor(),h=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h.render()).appendTo(c);this.bindControl(new D12(e,b.visible,
|
|
!0,this.model(),"Change "+d+" visibility"));this.bindControl(new TradingView.ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new TradingView.SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
J47._createRow_vertlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),f=this.createColorPicker(),g=TradingView.createLineWidthEditor(),h=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h.render()).appendTo(c);this.bindControl(new D12(e,b.visible,
|
|
!0,this.model(),"Change "+d+" visibility"));this.bindControl(new TradingView.ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new TradingView.SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
J47._createRow_lines=function(a,b){var c=this.addRow(a),d=b.title.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),f=this.createColorPicker(),g=TradingView.createLineWidthEditor(),h=TradingView.createLineStyleEditor();$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h.render()).appendTo(c);this.bindControl(new D12(e,b.visible,
|
|
!0,this.model(),"Change "+d+" visibility"));this.bindControl(new TradingView.ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new TradingView.SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
J47._createRow_hlines=function(a,b){var c=this.addRow(a),d=b.name.value(),e=$("<input type='checkbox' class='visibility-switch'/>"),f=this.createColorPicker(),g=TradingView.createLineWidthEditor(),h=TradingView.createLineStyleEditor(),k=$("<input type='checkbox'>");$("<td>").append(e).appendTo(c);this.createLabeledCell(d,e).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h.render()).appendTo(c);$("<td>").appendTo(c);$("<td>").append(k).appendTo(c);
|
|
this.createLabeledCell("Show Price",k).appendTo(c);this.bindControl(new D12(e,b.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new TradingView.ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new TradingView.SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"));this.bindControl(new D12(k,
|
|
b.showPrice,!0,this.model(),"Change "+d+" show price"));b.enableText.value()&&(c=this.addRow(a),$('<td colspan="2">').appendTo(c),e=$("<input type='checkbox'>"),$('<td class="text-center">').append(e).appendTo(c),this.createLabeledCell("Show Text",e).appendTo(c),this.bindControl(new D12(e,b.showText,!0,this.model(),"Change "+d+" show text")),e=TradingView.createTextPosEditor(),$("<td>").append(e.render()).appendTo(c),this.bindControl(new D11(e,b.textPos,
|
|
parseInt,!0,this.model(),"Change "+d+" text position")),e=this.createFontSizeEditor(),$('<td colspan="2">').append(e).appendTo(c),this.bindControl(new D11(e,b.fontSize,parseInt,!0,this.model(),"Change "+d+" font size")))};
|
|
J47._createRow_hhists=function(a,b){var c=b.title.value(),d=[],e=[],f=[],g=this.addRow(a),h=TradingView.createVisibilityEditor();$("<td>").append(h).appendTo(g);this.createLabeledCell(c,h).appendTo(g);this.bindControl(new D12(h,b.visible,!0,this.model(),"Change "+c+" Visibility"));g=this.addRow(a);h=$("<input/>");h.attr("type","text");h.addClass("ticker");this.createLabeledCell("Width (% of the Box)",h).appendTo(g);$("<td>").append(h).appendTo(g);
|
|
g=[TradingView.ToIntTransformer(40)];g.push(TradingView.GreateTransformer(0));g.push(TradingView.LessTransformer(100));this.bindControl(new TradingView.SimpleStringBinder(h,b.percentWidth,g,!1,this.model(),"Change Percent Width"));g=this.addLabeledRow(a,"Placement");h=TradingView.createHHistDirectionEditor();$("<td>").append(h).appendTo(g);this.bindControl(new D11(h,b.direction,null,!0,this.model(),"Change "+c+" Placement"));g=this.addRow(a);h=$("<input type='checkbox'>");
|
|
$("<td>").append(h).appendTo(g);this.createLabeledCell("Show Values",h).appendTo(g);this.bindControl(new D12(h,b.showValues,!0,this.model(),"Change "+c+" Show Values"));g=this.addRow(a);h=this.createColorPicker();this.createLabeledCell("Text Color",h).appendTo(g);$("<td>").append(h).appendTo(g);this.bindControl(new TradingView.ColorBinding(h,b.valuesColor,!0,this.model(),"Change "+c+" Text Color"));for(var k in b.colors)isNumber(parseInt(k,10))&&(g=this.addRow(a),d[k]=b.titles[k].value(),
|
|
e[k]=this.createColorPicker(),f[k]=TradingView.createTransparencyEditor(e[k]),$("<td>").append(d[k]).appendTo(g),$("<td>").append(e[k]).appendTo(g),$("<td>").append(f[k]).appendTo(g),this.bindControl(new TradingView.ColorBinding(e[k],b.colors[k],!0,this.model(),"Change "+d[k]+" color")),this.bindControl(new TradingView.SliderBinder(f[k],b.transparencies[k],!0,this.model(),"Change "+d[k]+" transparency")))};
|
|
J47._createRow_backgrounds=function(a,b){var c=this.addRow(a),d=$("<input type='checkbox' class='visibility-switch'/>"),e=b.name.value(),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f);$("<td>").append(d).appendTo(c);this.createLabeledCell(e,d).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);this.bindControl(new D12(d,b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new TradingView.ColorBinding(f,
|
|
b.color,!0,this.model(),"Change "+e+" color"));this.bindControl(new TradingView.SliderBinder(g,b.transparency,!0,this.model(),"Change "+e+" transparency"))};
|
|
J47._createRow_polygons=function(a,b){var c=this.addRow(a),d=b.name.value(),e=this.createColorPicker(),f=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);$("<td>").append(e).appendTo(c);$("<td>").append(f).appendTo(c);this.bindControl(new TradingView.ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new TradingView.SliderBinder(f,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
J47._createRow_trendchannels=function(a,b){var c=this.addRow(a),d=b.name.value(),e=this.createColorPicker(),f=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);$("<td>").append(e).appendTo(c);$("<td>").append(f).appendTo(c);this.bindControl(new TradingView.ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new TradingView.SliderBinder(f,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
J47._createRow_textmarks=function(a,b){var c=this.addLabeledRow(a),d=b.name.value(),e=this.createColorPicker(),f=this.createColorPicker(),g=this.createFontEditor(),h=this.createFontSizeEditor(),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),m=TradingView.createTransparencyEditor(e);$("<td>").append(d).appendTo(c);
|
|
"rectangle"!==b.shape.value()&&$("<td>").append(e).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(h).appendTo(c);$("<td>").append(k).appendTo(c);$("<td>").append(l).appendTo(c);$("<td>").append(m).appendTo(c);this.bindControl(new TradingView.ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new TradingView.ColorBinding(f,b.fontColor,!0,this.model(),"Change "+d+" text color"));this.bindControl(new D11(h,
|
|
b.fontSize,parseInt,!0,this.model(),"Change "+d+" font size"));this.bindControl(new D11(g,b.fontFamily,null,!0,this.model(),"Change "+d+" font"));this.bindControl(new D12(k,b.fontBold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(l,b.fontItalic,!0,this.model(),"Change Text Font Italic"));this.bindControl(new TradingView.SliderBinder(m,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
J47._createRow_shapemarks=function(a,b){var c=this.addRow(a),d=$("<input type='checkbox' class='visibility-switch'/>"),e=b.name.value(),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),h=$("<input/>");h.attr("type","text");h.addClass("ticker");$("<td>").append(d).appendTo(c);this.createLabeledCell(e,d).appendTo(c);$("<td>").append(f).appendTo(c);$("<td>").append(g).appendTo(c);this.createLabeledCell("Size",h).appendTo(c);$("<td>").append(h).appendTo(c);
|
|
this.bindControl(new D12(d,b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new TradingView.ColorBinding(f,b.color,!0,this.model(),"Change "+e+" back color"));this.bindControl(new TradingView.SliderBinder(g,b.transparency,!0,this.model(),"Change "+e+" transparency"));this.bindControl(new TradingView.SimpleStringBinder(h,b.size,null,!1,this.model(),"Change size"))};TradingView.StudyStrategyPropertyPage=function(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()};inherit(TradingView.StudyStrategyPropertyPage,D7);TradingView.StudyStrategyPropertyPage.prototype._getStrategyInputs=function(){for(var a=0,b=this.D1.metaInfo(),c={},d;a<b.inputs.length;a++)d=b.inputs[a],d.internalID&&(c[d.internalID]=b.inputs[a]);return c};
|
|
TradingView.StudyStrategyPropertyPage.prototype._setStdInput=function(a,b,c){if(a){var d=a.id,e="study_input-"+d+"-"+Date.now().toString(36)+"-"+Math.random().toString(36),f=$("<tr>").appendTo(this._$table),g="Change "+b;b=$('<label for="'+e+'">'+$.t(b,{context:"input"})+"</label>");if("bool"==a.type)a=$('<td colspan="3">').appendTo(f),e=$('<input id="'+e+'" type="checkbox">').appendTo(a),b.appendTo(a),!0!==c&&this.bindControl(new D12(e,this._property.inputs[d],!0,this.model(),
|
|
g));else if($("<td>").addClass($.t("propertypage-name-label",{context:"css_class"})).append(b).appendTo(f),b=$('<td colspan="2">').appendTo(f),a.options){for(var e=$('<select id="'+e+'">').appendTo(b),h=0;h<a.options.length;h++)b=a.options[h],b instanceof jQuery?b.appendTo(e):$('<option value="'+b+'">'+b+"</option>").appendTo(e);!0!==c&&this.bindControl(new D11(e,this._property.inputs[d],null,!0,this.model(),g))}else{e=$('<input id="'+e+'" type="text">').appendTo(b);if(!0!==
|
|
c){if("integer"==a.type||"float"==a.type)h=["integer"==a.type?TradingView.ToIntTransformer(a.defval):TradingView.ToFloatTransformer(a.defval)],(0===a.min||a.min)&&h.push(TradingView.GreateTransformer(a.min)),(0===a.max||a.max)&&h.push(TradingView.LessTransformer(a.max));this.bindControl(new TradingView.SimpleStringBinder(e,this._property.inputs[d],h,!1,this.model(),g))}e.addClass("ticker")}return e}};
|
|
TradingView.StudyStrategyPropertyPage.prototype._setPyramidingInputs=function(a){var b=this._setStdInput({id:"pyramiding_switch",type:"bool"},"Pyramiding",!0),c=this._property.inputs[a.pyramiding.id],d=this._setStdInput(a.pyramiding,"Allow up to"),e=d.closest("tr");c.subscribe(this,function(a){a.value()||(b.prop("checked",!1),d.attr("disabled","disabled"),e.addClass("disabled"))});b.change(function(){var a=!b.prop("checked");c.setValue(a?0:1);a?d.attr("disabled","disabled"):d.removeAttr("disabled");
|
|
e.toggleClass("disabled",a)});c.value()?b.prop("checked",!0):(b.prop("checked",!1),d.attr("disabled","disabled"),e.addClass("disabled"));e.children().last().removeAttr("colspan");$("<td>").text("orders").appendTo(e)};
|
|
TradingView.StudyStrategyPropertyPage.prototype._setQtyInputs=function(a){var b=this,c=a.default_qty_value;a=$.extend({},a.default_qty_type);var d=this._property.inputs[c.id],c=this._setStdInput(c,"Order size",!0),d=new TradingView.SimpleStringBinder(c,d,function(a){a=+a;if(isNaN(a)||0>a)return 0;"percent_of_equity"!=f.val()?a=parseInt(a):100<a&&(a=100);return a},!1,this.model(),"Change Order Size");this.bindControl(d);c=c.closest("td");c.removeAttr("colspan");var d=this.D1.reportData()&&this.D1.reportData().currency||
|
|
"USD",e=$('<option value="cash_per_order">'+d+"</option>");a.options=[$('<option value="fixed">Contracts</option>'),e,$('<option value="percent_of_equity">% of equity</option>')];var f=this._setStdInput(a,"type");a=f.closest("td");d=a.closest("tr");a.removeAttr("colspan");a.detach().insertAfter(c);d.remove();this.D1.watchedData.subscribe(function(){var a=b.D1.reportData()&&b.D1.reportData().currency||"USD";e.text(a);f.closest("td").find("a[href=#cash_per_order]").text(a)})};
|
|
TradingView.StudyStrategyPropertyPage.prototype._setFillLimitsInputs=function(a){var b=this._setStdInput({id:"fill_limits_switch",type:"bool"},"Verify Price for Limit Orders",!0),c=b.closest("td");c.find("label").addClass("always-enabled");c.removeAttr("colspan");var d=c.closest("tr");a=a.backtest_fill_limits_assumption;var e=this._property.inputs[a.id],f=this._setStdInput(a,"ticks");a=f.closest("td");var g=a.closest("tr");a.removeAttr("colspan").detach().insertAfter(c);g.remove();$("<td>").text("ticks").insertAfter(a);
|
|
e.subscribe(this,function(a){a.value()||(b.prop("checked",!1),f.attr("disabled","disabled"),d.addClass("disabled"))});b.change(function(){var a=!b.prop("checked");e.setValue(a?0:1);a?f.attr("disabled","disabled"):f.removeAttr("disabled");d.toggleClass("disabled",a)});e.value()?b.prop("checked",!0):(b.prop("checked",!1),f.attr("disabled","disabled"),d.addClass("disabled"))};
|
|
TradingView.StudyStrategyPropertyPage.prototype.prepareLayout=function(){this._$table=$(document.createElement("table")).addClass("property-page strategy-properties").attr("cellspacing","0").attr("cellpadding","2");var a=this._getStrategyInputs();a.initial_capital.min=1;this._setStdInput(a.initial_capital,"Initial capital");this._setStdInput(a.currency,"Base currency");$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table);this._setPyramidingInputs(a);$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table);
|
|
this._setQtyInputs(a);$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table);this._setStdInput(a.calc_on_order_fills,"Recalculate After Order filled");$('<tr class="spacer"><td colspan="3"></td></tr>').appendTo(this._$table);this._setFillLimitsInputs(a);this.loadData()};TradingView.StudyStrategyPropertyPage.prototype.widget=function(){return this._$table};A85=function(a,b,c){a=b.m_model.properties();D7.call(this,a,b);var d=this._series=b.mainSeries();this._chart=b.m_model;this.D0=b;this.R99=c;this._property=a;this._seriesProperty=d.properties();this._scaleProperty=d.m_priceScale.properties();this._mainAxisProperty=d.properties().priceAxisProperties;var e=null;$.each(b.m_model.panes(),function(a,b){$.each(b.D19(),function(a,c){if(c==d)return e=b,!1})});this._pane=e;this.prepareLayout();this._themes=
|
|
[]};inherit(A85,D7);inherit(A85,TradingView.SeriesStylePropertyPageMixin);A85.prototype.setScalesOpenTab=function(){this.scalesColumnLeft&&this.scalesColumnLeft.data("layout-tab-open",TradingView.EditObjectDialog.TAB_OPEN_OVERRIDE)};A85.prototype.setTmzOpenTab=function(){this.tmzSessTable&&this.tmzSessTable.data("layout-tab-open",TradingView.EditObjectDialog.TAB_OPEN_OVERRIDE)};
|
|
A85.prototype.prepareLayout=function(){var a=this,b,c,d,e,f,g,h,k,l,m,n,p,r,t,v;if(R77.enabled("chart_property_page_style")){b=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style"));c=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style"));d=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style"));this._prepareSeriesStyleLayout(b,
|
|
c,d,this._seriesProperty);this._hasSeriesStyleLayout=!0;g=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style"));var w=$('<input type="checkbox">'),u=this.addLabeledRow(g,$.t("Price Line"),w);$("<td>").append(w).prependTo(u);this.bindControl(new D12(w,this._seriesProperty.showPriceLine,!0,this.model(),"Change Price Price Line"));var x=TradingView.createLineWidthEditor();$("<td>").append(x).appendTo(u);this.bindControl(new TradingView.SliderBinder(x,
|
|
this._seriesProperty.priceLineWidth,!0,this.model(),"Change Price Line Width"));h=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style"));var C=this.createSeriesMinTickEditor(),A=$("<tr>");A.appendTo(h);$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(A);$("<td>").append(C).appendTo(A);this.bindControl(new D11(C,this._seriesProperty.minTick,null,!0,this.model(),"Change MinTick"))}if(R77.enabled("chart_property_page_scales")){var y=
|
|
$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),D=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){a.D0.m_model.D20(new A22(A22.LIGHT_UPDATE))},0)}),E=this.addLabeledRow(y,$.t("Auto Scale"),D);$("<td>").append(D).prependTo(E);this.bindControl(new D12(D,this._scaleProperty.autoScale,!0,this.model(),"Auto Scale",function(b){this._undoModel.setAutoScaleProperty(this._property,
|
|
b,a._series.priceScale(),this._undoText)}));this.bindControl(new TradingView.DisabledBinder(D,this._scaleProperty.autoScaleDisabled,!0,this.model(),"Auto Scale"));var z=$('<input type="checkbox">'),F=this.addLabeledRow(y,$.t("Percentage"),z);$("<td>").append(z).prependTo(F);this.bindControl(new D12(z,this._mainAxisProperty.percentage,!0,this.model(),"Scale Percentage",function(b){this._undoModel.setPercentProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new TradingView.DisabledBinder(z,
|
|
this._mainAxisProperty.percentageDisabled,!0,this.model(),"Scale Percentage"));var K=$('<input type="checkbox">'),Q=this.addLabeledRow(y,$.t("Log Scale"),K);$("<td>").append(K).prependTo(Q);this.bindControl(new D12(K,this._mainAxisProperty.log,!0,this.model(),"Log Scale",function(b){this._undoModel.setLogProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new TradingView.DisabledBinder(K,this._mainAxisProperty.logDisabled,!0,this.model(),"Log Scale"));
|
|
var B=$('<input type="checkbox">').change(function(){this.checked&&setTimeout(function(){a.D0.m_model.D20(new A22(A22.LIGHT_UPDATE))},0)}),J=this.addLabeledRow(y,$.t("Scale Series Only"),B);$("<td>").append(B).prependTo(J);this.bindControl(new D12(B,this._property.scalesProperties.scaleSeriesOnly,!0,this.model(),"Scale Series Only"));var O=$("<input type='checkbox'/>"),q=this.addLabeledRow(y,$.t("Lock scale"),O);$("<td>").append(O).prependTo(q);
|
|
this.bindControl(new D12(O,this._seriesProperty.lockScale,!0,this.model(),"Change lock scale",function(b){this._undoModel.setLockScaleProperty(this._property,b,a._series,this._undoText)}));this._seriesProperty.style.listeners().subscribe(this,function(a){q.toggle(a.value()==TradingView.Series.STYLE_PNF)});var T=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),I=$('<input type="text" class="ticker">'),M=this.addLabeledRow(T,$.t("Top Margin"),
|
|
I);$("<td>").appendTo(M).append(I);$("<td>%</td>").appendTo(M);var S=[TradingView.ToIntTransformer(this._property.paneProperties.topMargin.value())];S.push(TradingView.LessTransformer(25));S.push(TradingView.GreateTransformer(0));this.bindControl(new TradingView.SimpleStringBinder(I,this._property.paneProperties.topMargin,S,!0,this.model(),"Top Margin"));var N=$('<input type="text" class="ticker">'),W=this.addLabeledRow(T,$.t("Bottom Margin"),N);$("<td>").appendTo(W).append(N);$("<td>%</td>").appendTo(W);
|
|
var V=[TradingView.ToIntTransformer(this._property.paneProperties.bottomMargin.value())];V.push(TradingView.LessTransformer(25));V.push(TradingView.GreateTransformer(0));this.bindControl(new TradingView.SimpleStringBinder(N,this._property.paneProperties.bottomMargin,V,!0,this.model(),"Bottom Margin"));var R=$('<input type="text" class="ticker">'),aa=this.addLabeledRow(T,$.t("Right Margin"),R);$("<td>").appendTo(aa).append(R);$("<td>"+$.t("bars",{context:"margin"})+"</td>").appendTo(aa);var U=[TradingView.ToIntTransformer(this._property.timeScale.rightOffset.value())];
|
|
U.push(TradingView.LessTransformer(~~this._chart.m_timeScale.maxOffset()));U.push(TradingView.GreateTransformer(-200));this.bindControl(new TradingView.SimpleStringBinder(R,this._property.timeScale.rightOffset,U,!0,this.model(),"Right Margin"));var L=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),X;this._pane&&(-1!==this._pane.leftPriceScale().D19().indexOf(this._series)?X="left":-1!==this._pane.rightPriceScale().D19().indexOf(this._series)?
|
|
X="right":this._pane.isOverlay(this._series)&&(X="none"));if(X){var G={left:$.t("Scale Left"),right:$.t("Scale Right")};a._pane.actionNoScaleIsEnabled(a._series)&&(G.none=$.t("Screen (No Scale)"));var P=this.createKeyCombo(G).val(X).change(function(){switch(this.value){case "left":a.D0.move(a._series,a._pane,a._pane.leftPriceScale());break;case "right":a.D0.move(a._series,a._pane,a._pane.rightPriceScale());break;case "none":a.D0.move(a._series,a._pane,null)}}),ta=this.addRow(L);$("<td>").appendTo(ta).append(P)}var ba=
|
|
$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),ea=$("<input type='checkbox' />"),na=this.addLabeledRow(ba,$.t("Left Axis"),ea);$("<td>").append(ea).prependTo(na);setTimeout(function(){this.bindControl(new D12(ea,this._property.scalesProperties.showLeftScale,!0,this.model(),"Show Left Axis"))}.bind(this),0);var ja=$("<input type='checkbox' />"),ga=this.addLabeledRow(ba,$.t("Right Axis"),ja);$("<td>").append(ja).prependTo(ga);
|
|
setTimeout(function(){this.bindControl(new D12(ja,this._property.scalesProperties.showRightScale,!0,this.model(),"Show Right Axis"))}.bind(this),0);if(R77.enabled("countdown")){var ka=$("<input type='checkbox'>"),Aa=this.addLabeledRow(ba,$.t("Countdown"),ka);$("<td>").append(ka).prependTo(Aa);this.bindControl(new D12(ka,this._seriesProperty.showCountdown,!0,this.model(),"Change Show Countdown"))}var qa=$('<input type="checkbox">'),oa=this.addLabeledRow(ba,
|
|
$.t("Symbol Last Value"),qa);$("<td>").append(qa).prependTo(oa);this.bindControl(new D12(qa,this._property.scalesProperties.showSeriesLastValue,!0,this.model(),"Change Symbol Last Value Visibility"));var Qa=$('<input type="checkbox">'),Va=this.addLabeledRow(ba,$.t("Indicator Last Value"),Qa);$("<td>").append(Qa).prependTo(Va);this.bindControl(new D12(Qa,this._property.scalesProperties.showStudyLastValue,!0,this.model(),"Change Indicator Last Value Visibility"));
|
|
var Ia=$('<input type="checkbox">'),Ua=this.addLabeledRow(ba,$.t("Symbol Labels"),Ia);$("<td>").append(Ia).prependTo(Ua);this.bindControl(new D12(Ia,this._property.scalesProperties.showSymbolLabels,!0,this.model(),"Show Symbol Labels"));var Ja=$('<input type="checkbox">'),Ra=this.addLabeledRow(ba,$.t("Indicator Labels"),Ja);$("<td>").append(Ja).prependTo(Ra);this.bindControl(new D12(Ja,this._property.scalesProperties.showStudyPlotLabels,!0,this.model(),
|
|
"Show Study Plots Labels"));var fa=$("<input type='checkbox' />"),Pa=this.addLabeledRow(ba,$.t("Precise Labels"),fa);$("<td>").append(fa).prependTo(Pa);this.bindControl(new D12(fa,this._scaleProperty.alignLabels,!0,this.model(),"Precise Labels"));k=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales"));l=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales"));this.scalesColumnLeft=k;l.append(L);l.append(ba);k.append(y);k.append(T)}if(R77.enabled("chart_property_page_background")){var ca=
|
|
$('<table class="property-page" cellspacing="0" cellpadding="2">'),Ka=this.createColorPicker(),Wa=this.addLabeledRow(ca,$.t("Background"));$('<td colspan="4">').append(Ka).appendTo(Wa);this.bindControl(new TradingView.ColorBinding(Ka,this._property.paneProperties.background,!0,this.model(),"Change Chart Background Color"));var Ba=this.addLabeledRow(ca,$.t("Vert Grid Lines")),Xa=this.createColorPicker();$("<td>").append(Xa).appendTo(Ba);this.bindControl(new TradingView.ColorBinding(Xa,this._property.paneProperties.vertGridProperties.color,
|
|
!0,this.model(),"Change Vert Grid Lines Color"));var Ca=TradingView.createLineStyleEditor();$('<td colspan="3">').append(Ca.render()).appendTo(Ba);this.bindControl(new D11(Ca,this._property.paneProperties.vertGridProperties.style,parseInt,!0,this.model(),"Change Vert Grid Lines Style"));var ua=this.addLabeledRow(ca,$.t("Horz Grid Lines")),Sa=this.createColorPicker();$("<td>").append(Sa).appendTo(ua);this.bindControl(new TradingView.ColorBinding(Sa,this._property.paneProperties.horzGridProperties.color,
|
|
!0,this.model(),"Change Horz Grid Lines Color"));var Da=TradingView.createLineStyleEditor();$('<td colspan="3">').append(Da.render()).appendTo(ua);this.bindControl(new D11(Da,this._property.paneProperties.horzGridProperties.style,parseInt,!0,this.model(),"Change Horz Grid Lines Style"));var ra=this.createColorPicker(),Ea=this.addLabeledRow(ca,$.t("Scales Text"));$('<td colspan="4">').append(ra).appendTo(Ea);this.bindControl(new TradingView.ColorBinding(ra,this._property.scalesProperties.textColor,
|
|
!0,this.model(),"Change Scales Text Color"));var La=this.createColorPicker(),da=this.addLabeledRow(ca,$.t("Scales Lines"));$('<td colspan="4">').append(La).appendTo(da);this.bindControl(new TradingView.ColorBinding(La,this._property.scalesProperties.lineColor,!0,this.model(),"Change Scales Lines Color"));var H=this.addLabeledRow(ca,$.t("Watermark")),Fa=this.createColorPicker();$("<td>").append(Fa).appendTo(H);this.bindControl(new TradingView.ColorBinding(Fa,this._property.symbolWatermarkProperties.color,
|
|
!0,this.model(),"Change Symbol Watermark Color"));var Y=TradingView.createTransparencyEditor(Fa);$('<td colspan="3">').append(Y).appendTo(H);this.bindControl(new TradingView.SliderBinder(Y,this._property.symbolWatermarkProperties.transparency,!0,this.model(),"Change Symbol Watermark Transparency"));var Ma=this.addLabeledRow(ca,$.t("Crosshair")),va=this.createColorPicker();$("<td>").append(va).appendTo(Ma);this.bindControl(new TradingView.ColorBinding(va,this._property.paneProperties.crossHairProperties.color,
|
|
!0,this.model(),"Change Crosshair Color"));var ma=TradingView.createLineStyleEditor();$("<td>").append(ma.render()).appendTo(Ma);this.bindControl(new D11(ma,this._property.paneProperties.crossHairProperties.style,parseInt,!0,this.model(),"Change Crosshair Style"));var Na=TradingView.createTransparencyEditor(va);$("<td>").append(Na).appendTo(this.addRow(ca).prepend("<td/><td/>"));this.bindControl(new TradingView.SliderBinder(Na,this._property.paneProperties.crossHairProperties.transparency,
|
|
!0,this.model(),"Change Crosshair Transparency"));var Ya=TradingView.createLineWidthEditor();$("<td>").append(Ya).appendTo(this.addRow(ca).prepend("<td/><td/>"));this.bindControl(new TradingView.SliderBinder(Ya,this._property.paneProperties.crossHairProperties.width,!0,this.model(),"Change Crosshair Width"));var wa=$('<table class="property-page" cellspacing="0" cellpadding="2">'),ha=$('<input type="checkbox">'),pa=this.addLabeledRow(wa,$.t("Symbol Description"),ha);$("<td>").append(ha).prependTo(pa);
|
|
this.bindControl(new D12(ha,this._property.paneProperties.legendProperties.showSeriesTitle,!0,this.model(),"Change Symbol Description Visibility"));var Ga=$('<input type="checkbox">'),la=this.addLabeledRow(wa,$.t("OHLC Values"),Ga);$("<td>").append(Ga).prependTo(la);this.bindControl(new D12(Ga,this._property.paneProperties.legendProperties.showSeriesOHLC,!0,this.model(),"Change OHLC Values Visibility"));var Oa=$('<input type="checkbox">'),ia=this.addLabeledRow(wa,
|
|
$.t("Indicator Titles"),Oa);$("<td>").append(Oa).prependTo(ia);this.bindControl(new D12(Oa,this._property.paneProperties.legendProperties.showStudyTitles,!0,this.model(),"Change Indicator Titles Visibility"));var xa=$('<input type="checkbox">'),gb=this.addLabeledRow(wa,$.t("Indicator Arguments"),xa),sa=function(a){xa.prop("disabled",!a.value())};$("<td>").append(xa).prependTo(gb);this.bindControl(new D12(xa,this._property.paneProperties.legendProperties.showStudyArguments,
|
|
!0,this.model(),"Change Indicator Arguments Visibility"));this._property.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,sa);sa(this._property.paneProperties.legendProperties.showStudyTitles);var Z=$('<input type="checkbox">'),ya=this.addLabeledRow(wa,$.t("Indicator Values"),Z);$("<td>").append(Z).prependTo(ya);this.bindControl(new D12(Z,this._property.paneProperties.legendProperties.showStudyValues,!0,this.model(),"Change Indicator Values Visibility"));
|
|
m=$('<div class="property-page-column-2">').data("layout-tab",$.t("Background"));n=$('<div class="property-page-column-2">').data("layout-tab",$.t("Background"));m.append(ca);n.append(wa)}if(R77.enabled("chart_property_page_timezone_sessions")){this.tmzSessTable=r=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Timezone/Sessions"));var aa=$("<tr>").appendTo(r),za=$("<td>").appendTo(aa),lb=$('<table cellspacing="0" cellpadding="0">').appendTo(za),hb=
|
|
$("<tr>");hb.appendTo(lb);var mb=$("<td>");mb.appendTo(hb);mb.text($.t("Time Zone"));var fb=$('<td colspan="2" class="tzeditor">');fb.appendTo(hb);for(var ib,db="",Za=0;Za<TradingView.availableTimezones.length;Za++)db+='<option value="'+TradingView.availableTimezones[Za].id+'">'+TradingView.availableTimezones[Za].title+"</option>";var bb=$("<select>"+db+"</select>").change(function(){var b=$(this).val();ib||(ib=setTimeout(function(){a._chart._chartApi.switchTimezone(b);ib=!1},300))});bb.appendTo(fb);
|
|
this.bindControl(new D11(bb,this._property.timezone,null,!0,this.model(),"Change Timezone"));R77.enabled("charting_library_base")||(this._series.createSessStudy(),this.createSessTable(r))}if(R77.enabled("chart_property_page_evetns_alerts")&&(R77.enabled("alerts")||TradingView.D18("esdindicatorfeature"))&&!R77.enabled("charting_library_base")){var nb=R77.enabled("alerts")?"Events & Alerts":$.t("Events");v=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",
|
|
nb);this.R99 instanceof TradingView.ESDStudyBase&&v.data("layout-tab-open",TradingView.EditObjectDialog.TAB_OPEN_OVERRIDE);this.createEventsTable(v)}TradingView.D18("paper_trading")&&(R77.enabled("trading_options")||R77.enabled("chart_property_page_trading")||R77.enabled("cqg_terminal"))&&(t=this.createTradingTable());e=$('<table class="property-page" cellspacing="0" cellpadding="2">');f=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-separated",
|
|
!0);p=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Drawings"));this._table=$().add(b).add(c).add(d).add(e).add(f).add(g).add(h).add(k).add(l).add(m).add(n).add(p).add(r).add(t).add(v);this.loadData()};A85.prototype.widget=function(){return this._table};A85.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};
|
|
A85.prototype.loadTheme=function(a){var b=this;$.get("/theme/?themeName="+encodeURIComponent(a),function(c){b.D0._lastLoadedTheme=a;b.applyTheme(JSON.parse(c.content))})};A85.prototype.applyTheme=function(a){var b=this._seriesProperty.extendedHours.value();this.D0.model().restoreTheme(a);this._seriesProperty.extendedHours.value()!==b&&this._seriesProperty.extendedHours.listeners().fire(this._seriesProperty.extendedHours);this.loadData()};
|
|
A85.prototype.createTemplateButton=function(a){if(!R77.enabled("chart_property_page_template_button"))return $("<span />");var b=this;a||(a={});var c=function(){var c=[];c.push({title:$.t("Save As..."),action:function(){runOrSignIn(function(){TradingView.showThemeSaveDialog(b.D0)},!0)},addClass:"special"});"function"===typeof a.defaultsCallback&&c.push({title:$.t("Apply Defaults"),action:a.defaultsCallback,addClass:"special"});var d=[];$.each(b._themes,
|
|
function(a,c){d.push({title:$.t(c),action:function(){b.loadTheme(c)},deleteAction:is_authenticated?function(){var a=this,d=$.t("Do you realy want to delete theme",{theme:c?'"'+c+'"':""});A83.showConfirm("Theme",d,function(){a instanceof $&&a.remove();$.post("/remove-theme/",{name:c}).error(function(a){console.error(a.responseText)});TradingView.getThemesList.D20();for(var d=b._themes.length;d--;)b._themes[d]==c&&b._themes.splice(d,1)})}:void 0})});d.length&&(d.sort(function(a,b){a=a.title.toUpperCase();
|
|
b=b.title.toUpperCase();return a==b?0:a>b?1:-1}),c.push({separator:!0}),c=c.concat(d));return c},d=$('<a href="#" class="tv-button">'+$.t("Themes")+'<span class="icon-dropdown"></span></a>');TradingView.bindPopupMenu(d,null,{direction:"up",event:"button-popup",notCloseOnButtons:!0});d.bind("click",function(){var a=$(this);a.is(".active")||TradingView.getThemesList(function(d){b._themes=d;a.trigger("button-popup",[c(),!0])})});return d};
|
|
A85.prototype.switchStyle=function(){if(this._hasSeriesStyleLayout)switch($(this._barsTbody).add(this._barsColorerTbody).add(this._renkoTbody).add(this._pbTbody).add(this._kagiTbody).add(this._pnfTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).add(this._haTbody).add(this._haColorerTbody).css("display","none"),this._seriesProperty.style.value()){case TradingView.Series.STYLE_BARS:this._barsTbody.css("display",
|
|
"table-row-group");this._barsColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_CANDLES:this._candlesTbody.css("display","table-row-group");this._candlesColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_AREA:this._areaTbody.css("display","table-row-group");
|
|
break;case TradingView.Series.STYLE_RENKO:this._renkoTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_PB:this._pbTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_KAGI:this._kagiTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_PNF:this._pnfTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._haTbody.css("display","table-row-group"),this._haColorerTbody.css("display","table-row-group")}};
|
|
A85.prototype.onResoreDefaults=function(){var a=this.D0.model().properties().paneProperties.topMargin,b=this.D0.model().properties().paneProperties.bottomMargin;a.listeners().fire(a);b.listeners().fire(b);TradingView.bottomWidgetBar&&(A77.setWatchedValue(TradingView.bottomWidgetBar.hideFloatingPanel,!1,"Restore Defaults"),A77.setWatchedValue(TradingView.bottomWidgetBar.hideCompletedOrders,!1,"Restore Defaults"),A77.setWatchedValue(TradingView.bottomWidgetBar.noConfirmEnabled,
|
|
!1,"Restore Defaults"))};
|
|
A85.prototype.defaultProperties=function(){var a=this,b=[a._seriesProperty.extendedHours,a._property.scalesProperties.showLeftScale,a._property.scalesProperties.showRightScale,a._property.timeScale.rightOffset].map(function(a){return{property:a,previousValue:a.value()}});setTimeout(function(){b.forEach(function(a){a.property.value()!==a.previousValue&&a.property.listeners().fire(a.property)});var c=new J52("chartproperties.paneProperties.rightAxisProperties");$.each(["autoScale",
|
|
"percentage","log"],function(b,e){var f=a._scaleProperty[e],g=c[e].value();g!==f.value()&&f.setValue(g)})},0);return[this._property,this._seriesProperty]};
|
|
A85.prototype.createEventsTable=function(a){if(TradingView.D18("esdindicatorfeature")){var b=$("<tr>").appendTo(a),c=$('<input type="checkbox" />'),d=this.addLabeledRow(b,$.t("Show Dividends on Chart"),c);$("<td>").append(c).prependTo(d);d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowDividends,!0,this.model(),"Change Show or Hide Dividends"));c=$('<input type="checkbox" />');d=this.addLabeledRow(b,$.t("Show Splits on Chart"),
|
|
c);$("<td>").append(c).prependTo(d);d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowSplits,!0,this.model(),"Change Show or Hide Splits"));c=$('<input type="checkbox" />');d=this.addLabeledRow(b,$.t("Show Earnings on Chart"),c);$("<td>").append(c).prependTo(d);d.append("<td>");this.bindControl(new D12(c,this._seriesProperty.esdShowEarnings,!0,this.model(),"Change Show or Hide Earnings"));var d=this.createTableInTable(a),e=$('<input type="checkbox" />'),
|
|
b=TradingView.createLineStyleEditor(),c=TradingView.addColorPicker(),f=TradingView.createLineWidthEditor(),d=this.addLabeledRow(d,$.t("Earnings breaks"),e);$("<td>").append(e).prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(b.render()).appendTo(d);$("<td>").append(f).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new D12(e,this._seriesProperty.esdShowBreaks,!0,this.model(),"Change Show or Hide Earnings"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._seriesProperty.esdBreaksStyle.color,!0,this.model(),"Change earnings color"));this.bindControl(new D11(b,this._seriesProperty.esdBreaksStyle.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new TradingView.SliderBinder(f,this._seriesProperty.esdBreaksStyle.width,!0,this.model(),"Change width"));this._seriesProperty.esdShowEarnings.listeners().subscribe(this,function(a){e.prop("disabled",!a.value())})}if(R77.enabled("alerts")){d=$("<tr>").appendTo(a);
|
|
b=$('<input type="checkbox" />');d=this.addLabeledRow(d,$.t("Show Alert Labels"),b);$("<td>").append(b).prependTo(d);d.append("<td>");var g=this._property.alertsProperties.labels.visible;this.bindControl(new D12(b,g,!0,this.model(),"Change Show or Hide Alert Labels",function(a){this.D0.beginUndoMacro("Show Alert Labels");this.D0.setProperty(g,a,"Show Alert Labels");this.D0.endUndoMacro()}.bind(this)));var d=this.createTableInTable(a),h=$('<input type="checkbox">');
|
|
a=TradingView.addColorPicker();var k=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),l=b.render(),d=this.addLabeledRow(d,$.t("Extended Alert Line"),h);$("<td>").append(h).prependTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(l).appendTo(d);$("<td>").append(k).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new D12(h,this._property.alertsProperties.labels.line.visible,!0,this.model(),"Change Show or Hide Alert Labels Lines"));
|
|
this.bindControl(new TradingView.ColorBinding(a,this._property.alertsProperties.labels.color,!0,this.model(),"Change Alerts Labels color"));this.bindControl(new D11(b,this._property.alertsProperties.labels.line.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new TradingView.SliderBinder(k,this._property.alertsProperties.labels.line.width,!0,this.model(),"Change width"));g.listeners().subscribe(this,function(a){h.prop("disabled",!a.value());l.prop("disabled",
|
|
!a.value());k.prop("disabled",!a.value())})}};
|
|
A85.prototype.createSessTable=function(a){var b=this._series.sessionsStudy().properties(),c=this.createTableInTable(a),d=b.name.value(),e=$("<input type='checkbox' />"),c=this.addLabeledRow(c,$.t("Session Breaks"),e),f=TradingView.createLineStyleEditor(),g=TradingView.addColorPicker(),h=TradingView.createLineWidthEditor();$("<td>").append(e).prependTo(c);$("<td>").append(g).appendTo(c);$("<td>").append(f.render()).appendTo(c);$("<td>").append(h).appendTo(c);this.bindControl(new D12(e,
|
|
b.graphics.vertlines.sessBreaks.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new TradingView.ColorBinding(g,b.graphics.vertlines.sessBreaks.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new D11(f,b.graphics.vertlines.sessBreaks.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new TradingView.SliderBinder(h,b.graphics.vertlines.sessBreaks.width,!0,this.model(),"Change "+d+" width"));c=this.createTableInTable(a);
|
|
d=this._extendedHoursEditor=$('<input type="checkbox" />');c=this.addLabeledRow(c,$.t("Extended Hours (Intraday Only)"),d);$("<td>").append(d).prependTo(c);this.bindControl(new D12(d,this._seriesProperty.extendedHours,!0,this.model(),"Change Extended Hours"));this._seriesProperty.sessVis=b.graphics.vertlines.sessBreaks.visible;var c=this.createTableInTable(a),k=this._createStudySessRow(c,$.t("Extended Hours"),b.graphics.backgrounds.outOfSession),l=this._createStudySessRow(c,
|
|
$.t("In Session"),b.graphics.backgrounds.inSession);a=function(a){k.prop("disabled",!a.value());l.prop("disabled",!a.value())};this._seriesProperty.extendedHours.listeners().subscribe(this,a);a(this._seriesProperty.extendedHours);a=this._series.isIntradayInterval();e.prop("disabled",!a);return c};
|
|
A85.prototype._createStudySessRow=function(a,b,c){var d=$("<input type='checkbox' />");a=this.addLabeledRow(a,b,d);var e=TradingView.addColorPicker($("<td>").appendTo(a)),f=TradingView.createTransparencyEditor(e);this.bindControl(new D12(d,c.visible,!0,this.model(),"Change "+b+" visibility"));this.bindControl(new TradingView.ColorBinding(e,c.color,!0,this.model(),b+" color"));this.bindControl(new TradingView.SliderBinder(f,c.transparency,!0,this.model(),
|
|
b+" transparency"));$("<td>").append(d).prependTo(a);a.addClass("offset-row");$("<td>").append(f).appendTo(a);return d};
|
|
A85.prototype.createTradingTable=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Trading")),b=$("<tr>").appendTo(a),c=$("<td>").appendTo(b),c=$('<table cellspacing="0" cellpadding="0">').appendTo(c),d=$('<input type="checkbox">'),b=this.addLabeledRow(c,$.t("Show Positions"),d);$("<td>").append(d).prependTo(b);this.bindControl(new D12(d,this._property.tradingProperties.showPositions,!0,
|
|
this.model(),"Change Positions Visibility"));d=$('<input type="checkbox">');b=this.addLabeledRow(c,$.t("Show Orders"),d);$("<td>").append(d).prependTo(b);this.bindControl(new D12(d,this._property.tradingProperties.showOrders,!0,this.model(),"Change Orders Visibility"));b=$('<input type="checkbox">');d=this.addLabeledRow(c,$.t("Extend Lines Left"),b);$("<td>").append(b).prependTo(d);this.bindControl(new D12(b,this._property.tradingProperties.extendLeft,!0,
|
|
this.model(),"Extend Lines Left"));b=TradingView.createLineWidthEditor();this.bindControl(new TradingView.SliderBinder(b,this._property.tradingProperties.lineWidth,!0,this.model(),"Change Connecting Line Width"));d=TradingView.createLineStyleEditor();this.bindControl(new D11(d,this._property.tradingProperties.lineStyle,parseInt,!0,this.model(),"Change Connecting Line Style"));var e=$('<input type="text" class="ticker">'),f=[TradingView.ToIntTransformer(this._property.tradingProperties.lineLength.value()),
|
|
TradingView.LessTransformer(100),TradingView.GreateTransformer(0)];this.bindControl(new TradingView.SimpleStringBinder(e,this._property.tradingProperties.lineLength,f,!0,this.model(),"Change Connecting Line Length"));f=$("<tbody>");f=this.addLabeledRow(c,$.t("Connecting Line"),f);$("<td>").prependTo(f);$("<td>").append(b).appendTo(f);$('<td colspan="3">').append(d.render()).appendTo(f);$('<td colspan="3">').append(e).appendTo(f);$("<td>%</td>").appendTo(f);b=$('<input type="checkbox">');d=this.addLabeledRow(c,
|
|
$.t("Show Executions"),b);$("<td>").append(b).prependTo(d);this.bindControl(new D12(b,this._property.tradingProperties.showExecutions,!0,this.model(),"Change Executions Visibility"));TradingView.bottomWidgetBar&&(b=$('<input type="checkbox">'),d=this.addLabeledRow(c,$.t("Show Buy/Sell Panel"),b),$("<td>").append(b).prependTo(d),this.bindControl(new TradingView.CheckboxWVBinding(b,TradingView.bottomWidgetBar.hideFloatingPanel,null,"Change buy/sell panel visibility",!0)),b=$('<input type="checkbox">'),
|
|
d=this.addLabeledRow(c,$.t("Show Active Orders Only"),b),$("<td>").append(b).prependTo(d),this.bindControl(new TradingView.CheckboxWVBinding(b,TradingView.bottomWidgetBar.hideCompletedOrders,null,"Change completed orders visibility")),b=$('<input type="checkbox">'),c=this.addLabeledRow(c,$.t("Require Order Confirmation"),b),$("<td>").append(b).prependTo(c),this.bindControl(new TradingView.CheckboxWVBinding(b,TradingView.bottomWidgetBar.noConfirmEnabled,null,"Change order confirmation state",!0)));
|
|
return a};J38=function(a,b){D7.call(this,a,b);this.prepareLayout()};inherit(J38,D7);
|
|
J38.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createKeyCombo({open:$.t("Open"),high:$.t("High"),low:$.t("Low"),close:$.t("Close")}),b=this.addLabeledRow(this._table,$.t("Source",{context:"compare"}));$("<td>").appendTo(b).append(a);this.bindControl(new D11(a,this._property.inputs.source,
|
|
null,!0,this.model(),"Change Price Source"));this.loadData()};J38.prototype.widget=function(){return this._table};TradingView.SoundSelector=function(a){a.container||console.error("[SoundSelector] options.container is required");a=$.extend(this.defaultOptions(),a);this.fileName=new WatchedValue(a.fileName);this.duration=new WatchedValue(a.duration);this._$container=a.container;this._$durationContainer=a.durationContainer;this._onChange=a.onChange||function(){console.warn("[SoundSelector] 'onChange' callback is not defined")};this._options=a;this._nowPlaying=null;this._attachHandlers();this._render()};
|
|
TradingView.SoundSelector.prototype.soundList=function(){this._soundListArray||(this._soundListArray=$.map(TradingView.Sound.alertSounds(),function(a){return{fileName:a.path,title:a.title}}));return this._soundListArray};TradingView.SoundSelector.prototype.defaultOptions=function(){return{fileName:this.soundList()[0].fileName,duration:""}};
|
|
TradingView.SoundSelector.prototype._attachHandlers=function(){var a=this;a.fileName.subscribe(function(b){a._onChange(b,a.duration.value());a._$button.find(".title").text(a._fileName2title(b))});a.duration.subscribe(function(b){a._onChange(a.fileName.value(),b)})};
|
|
TradingView.SoundSelector.prototype._render=function(){var a=this;a._$container.empty();a._$button=$('<a class="tv-button with-arrow"><span class="title">'+a._fileName2title(a.fileName.value())+'</span><span class="icon-dropdown"></span></a>');a._$button.appendTo(a._$container);TradingView.bindPopupMenu(a._$button,function(){return $.map(a.soundList(),function(b){var d=$('<span class="manage-sound-button"></span>'),e=function(){var e=!!TradingView.Sound.isPlaying(b.fileName);d.toggleClass("stop",
|
|
e);d.toggleClass("play",!e);a._nowPlaying=e?b.fileName:null};e();if(TradingView.Sound.isPlaying(b.fileName))TradingView.Sound.onStopped(b.fileName,e);return{title:b.title,action:function(){a.fileName.setValue(b.fileName)},active:b.fileName===a.fileName.value(),buttons:[{el:d,handler:function(f){f.stopPropagation();d.hasClass("play")?(TradingView.Sound.stop(),TradingView.Sound.play(b.fileName,!1,a.duration.value()),TradingView.Sound.onStopped(b.fileName,e)):d.hasClass("stop")&&TradingView.Sound.stop(b.fileName);
|
|
e()}}]}})},{direction:"down",addClass:"sound-selector"});if(a._$durationContainer){a._$durationContainer.empty();var b=$('<select><option value="0">'+$.t("Once")+'</option><option value="5">'+$.t("5 seconds")+'</option><option value="10">'+$.t("10 seconds")+'</option><option value="30">'+$.t("30 seconds")+'</option><option value="60">'+$.t("1 minute")+"</option></select>");b.change(function(){var c=parseInt(b.val());a.duration.setValue(c)});b.appendTo(a._$durationContainer);b.val(a.duration.value()||
|
|
0)}};TradingView.SoundSelector.prototype._fileName2title=function(a){for(var b=this.soundList(),c=0;c<b.length;c++)if(b[c].fileName===a)return b[c].title};TradingView.SoundSelector.prototype.destroy=function(){var a=this;a.fileName.unsubscribe(function(b){a._onChange({fileName:b})});a.duration.unsubscribe(function(b){a._onChange({duration:b})});TradingView.unbindPopupMenu(a._$button);a._nowPlaying&&TradingView.Sound.stop(a._nowPlaying)};TradingView.LabelsImageCache=function(a,b,c,d){this._cacheSize=50;this._labelsWidth=d;this._fontSize=c;this._canvas=$("<canvas>").attr("width",d).attr("height",(c+2)*this._cacheSize);this._ctx=this._canvas.get(0).getContext("2d");this._ctx.font=a;this._ctx.textBaseline="bottom";this._ctx.fillStyle=b;this._labelsMap={};this._actualSize=this._usageCounter=0;this._indexTolabelCache={}};
|
|
TradingView.LabelsImageCache.prototype.reset=function(a){this._ctx.clearRect(0,0,this._labelsWidth,(this._fontSize+2)*this._cacheSize);this._ctx.fillStyle=a;this._indexTolabelCache={};this._labelsMap={};this._actualSize=0};
|
|
TradingView.LabelsImageCache.prototype.paintTo=function(a,b,c,d,e){b=this.getLabelImage(b);"left"==e?a.drawImage(this._canvas.get(0),0,b.y,this._labelsWidth,this._fontSize+2,c,Math.ceil(d-(this._fontSize+2)/2),this._labelsWidth,this._fontSize+2):a.drawImage(this._canvas.get(0),0,b.y,this._labelsWidth,this._fontSize+2,c-b.width,Math.ceil(d-(this._fontSize+2)/2),this._labelsWidth,this._fontSize+2)};
|
|
TradingView.LabelsImageCache.prototype.getLabelImage=function(a){if(this._labelsMap[a])this._labelsMap[a].accessTimestamp=this._usageCounter;else{if(this._actualSize<this._cacheSize){for(var b=0;b<this._cacheSize;b++)if(!this._indexTolabelCache[b]){this._indexTolabelCache[b]=a;this._actualSize++;var c=b*(this._fontSize+2);this._ctx.clearRect(0,c,this._labelsWidth,this._fontSize+2);this._ctx.fillText(a,0,c+(this._fontSize+2));var d=this._ctx.measureText(a).width;this._labelsMap[a]={y:c,accessTimestamp:this._usageCounter,
|
|
index:b,width:d};this._usageCounter++;return this._labelsMap[a]}throw"internal LabelsImageCache failure";}b=null;d="";for(c in this._labelsMap){var e=this._labelsMap[c].accessTimestamp;if(null===b||b>e)b=e,d=c}b=this._labelsMap[d];delete this._labelsMap[d];this._indexTolabelCache[b.index]=a;this._ctx.clearRect(0,b.y,this._labelsWidth,this._fontSize+2);this._ctx.fillText(a,0,b.y+(this._fontSize+2));d=this._ctx.measureText(a).width;this._labelsMap[a]={y:b.y,accessTimestamp:this._usageCounter,index:b.index,
|
|
width:d}}this._usageCounter++;return this._labelsMap[a]};TradingView.TextImageCache=function(a,b,c,d,e){this._canvasesMap={};this._lines=a.split(/[^\S\r\n]*(?:\r\n|\r|\n)/);this._font=this._fontStyle(b,c,d,e);this._fontSize=e;a=$("<canvas>").get(0).getContext("2d");a.font=this._font;for(c=b=0;c<this._lines.length;c++)d=a.measureText(this._lines[c]).width,b=Math.max(b,d);this.textImageWidth=b+1;this.textImageHeight=this._lines.length*e};
|
|
TradingView.TextImageCache.prototype.paintTo=function(a,b,c,d,e,f){b=this._getTextImage(b);c=this._x(c,e,this.textImageWidth);d=this._y(d,f,this.textImageHeight);a.drawImage(b,c-.5,d-.5)};
|
|
TradingView.TextImageCache.prototype._getTextImage=function(a){if(this._canvasesMap[a])return this._canvasesMap[a].get(0);var b=$("<canvas>").attr("width",this.textImageWidth).attr("height",this.textImageHeight),c=b.get(0).getContext("2d");c.textBaseline="top";c.font=this._font;c.textAlign="center";c.fillStyle=a;for(var d=Math.round(this.textImageWidth/2),e=0,f=0;f<this._lines.length;f++)c.fillText(this._lines[f],d,e),e+=this._fontSize;this._canvasesMap[a]=b;return b.get(0)};
|
|
TradingView.TextImageCache.prototype._x=function(a,b,c){switch(b){case "right":a-=c;break;case "center":a-=c/2}return Math.round(a)};TradingView.TextImageCache.prototype._y=function(a,b,c){switch(b){case "bottom":a-=c;break;case "middle":a-=c/2}return Math.round(a)};TradingView.TextImageCache.prototype._fontStyle=function(a,b,c,d){return(a?"bold ":"")+(b?"italic ":"")+d+"px "+c};J14=function(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()};inherit(J14,D7);
|
|
J14.prototype.createPriceEditor=function(a){var b=this._linetool.ownerSource().formatter(),c=function(a){a=b.parse(a);if(a.res)return a.price},d=$("<input type='text'>");d.TVTicker({step:b._minMove/b._priceScale||1,formatter:function(a){return b.format(a)},parser:c});a&&this.bindControl(new TradingView.SimpleStringBinder(d,a,[function(b){b=c(b);return void 0===b?a.value():b}],!1,this.model(),"Change "+this._linetool+" point price")).addFormatter(function(a){return b.format(a)});
|
|
return d};
|
|
J14.prototype._createPointRow=function(a,b,c){a=$("<tr>");var d=$("<td>");d.html($.t("Price")+c);d.appendTo(a);c=$("<td>");c.appendTo(a);this.createPriceEditor(b.price).appendTo(c);c=$("<td>");c.html($.t("Bar #"));c.appendTo(a);d=$("<td>");d.appendTo(a);c=$("<input type='text'>");c.appendTo(d);c.addClass("ticker");d=[TradingView.ToIntTransformer(b.bar.value()),TradingView.GreateTransformer(-5E4),TradingView.LessTransformer(15E3)];this.bindControl(new TradingView.SimpleStringBinder(c,b.bar,
|
|
d,!1,this.model(),"Change "+this._linetool+" point bar index"));return a};J14.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=this._linetool.points(),b=a.size(),c=0;c<a.size();c++){var d=a.item(c),e=this._linetool.properties().points[c];e&&this._createPointRow(d,e,(c||1<b?" "+(c+1):"")+"").appendTo(this._table)}this.loadData()};
|
|
J14.prototype.widget=function(){return this._table};A91=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A91,J49);
|
|
A91.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=$("<tbody>").appendTo(this._table),b=this.createColorPicker(),c=this.addLabeledRow(a,"Color");$("<td>").append(b).appendTo(c);var d=$('<select><option value="0">'+$.t("HL Bars")+'</option><option value="2">'+$.t("OC Bars")+'</option><option value="1">'+
|
|
$.t("Line - Close")+'</option><option value="3">'+$.t("Line - Open")+'</option><option value="4">'+$.t("Line - High")+'</option><option value="5">'+$.t("Line - Low")+'</option><option value="6">'+$.t("Line - HL/2")+"</option></select>"),c=this.addLabeledRow(a,"Mode");$("<td>").append(d).appendTo(c);c=$("<tr>").appendTo(a);$("<td>"+$.t("Mirrored")+"</td>").appendTo(c);var e=$("<input type='checkbox'>");$("<td>").append(e).appendTo(c);c=$("<tr>").appendTo(a);$("<td>"+$.t("Flipped")+"</td>").appendTo(c);
|
|
a=$("<input type='checkbox'>");$("<td>").append(a).appendTo(c);this.bindControl(new D12(e,this._linetool.properties().mirrored,!0,this.model(),"Change Bars Pattern Mirroring"));this.bindControl(new D12(a,this._linetool.properties().flipped,!0,this.model(),"Change Bars Pattern Flipping"));this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Bars Pattern Color"));this.bindControl(new D11(d,
|
|
this._linetool.properties().mode,null,!0,this.model(),"Change Bars Pattern Mode"));this.loadData()};A91.prototype.widget=function(){return this._table};A90=function(a,b,c){J14.call(this,a,b,c)};inherit(A90,J14);
|
|
A90.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._linetool.points().item(0);var a=$("<tr>");a.appendTo(this._table);var b=$("<td>");b.html($.t("Price"));b.appendTo(a);var c=$("<td>");c.appendTo(a);b=$("<input type='text'>");b.appendTo(c);c=$("<td>");c.html($.t("Bar #"));c.appendTo(a);c=$("<td>");c.appendTo(a);
|
|
a=$("<input type='text'>");a.appendTo(c);a.addClass("ticker");var c=this._linetool.properties().points[0],d=[TradingView.ToFloatTransformer(c.price.value())];this.bindControl(new TradingView.SimpleStringBinder(b,c.price,d,!1,this.model(),"Change "+this._linetool+" point price"));d=[TradingView.ToIntTransformer(c.bar.value()),TradingView.GreateTransformer(-5E3),TradingView.LessTransformer(15E3)];this.bindControl(new TradingView.SimpleStringBinder(a,c.bar,d,!1,this.model(),"Change "+this._linetool+
|
|
" point bar index"));this.loadData()};A93=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A93,J49);
|
|
A93.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createFontSizeEditor(),c=this.createFontEditor(),d=this.createTextEditor(350,200),e=this.createColorPicker(),f=TradingView.createTransparencyEditor(e),g=TradingView.createLineWidthEditor(),h=this.createColorPicker(),k=$('<input type="checkbox">'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');
|
|
this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Text Color"));this.bindControl(new D11(b,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(c,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new TradingView.SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),"Change Text"));
|
|
this.bindControl(new TradingView.ColorBinding(e,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new TradingView.SliderBinder(f,this._linetool.properties().transparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new TradingView.ColorBinding(h,this._linetool.properties().bordercolor,!0,this.model(),"Change Text Color"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().linewidth,!0,this.model(),
|
|
"Change Border Width"));this.bindControl(new D12(k,this._linetool.properties().wordWrap,!0,this.model(),"Change Text Wrap"));this.bindControl(new D12(l,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(m,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));var n=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab-open",TradingView.EditObjectDialog.TAB_OPEN_OVERRIDE),
|
|
p=$('<table class="property-page" cellspacing="0" cellpadding="2">'),r=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=n.add(r).add(p);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(b)).append($(document.createElement("td")).attr({width:1}).append(l)).append($(document.createElement("td")).append(m)).appendTo(n);
|
|
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(n);a=this.addLabeledRow(p,"Text Wrap",k);$("<td>").append(k).prependTo(a);a=this.addLabeledRow(r,"Background");$("<td>").append(e).appendTo(a);$("<td>").append(f).appendTo(a);a=this.addLabeledRow(r,"Border");$("<td>").append(h).appendTo(a);$("<td>").append(g).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};
|
|
A93.prototype.widget=function(){return this._table};J32=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J32,J49);
|
|
J32.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);var e=$("<tbody>").appendTo(this._table),f=
|
|
$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),g=$('<input type="checkbox">').appendTo(f),h=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),k=$('<input type="checkbox">').appendTo(h),l=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),m=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),a=this.addLabeledRow(e,$.t("Left End"));$('<td colspan="3">').appendTo(a).append(l).append(f);
|
|
a=this.addLabeledRow(e,$.t("Right End"));$('<td colspan="3">').appendTo(a).append(m).append(h);a=this.addLabeledRow(e,$.t("Stats Text Color"));f=this.createColorPicker();$("<td>").append(f).appendTo(a);this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));f=$('<input type="checkbox">');$('<input type="checkbox">');var h=$('<input type="checkbox">'),n=$('<input type="checkbox">'),p=$('<input type="checkbox">'),r=$('<input type="checkbox">'),
|
|
t=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Show Price Range"));$('<td colspan="3">').appendTo(a).append(f);a=this.addLabeledRow(e,$.t("Show Bars Range"));$('<td colspan="3">').appendTo(a).append(h);a=this.addLabeledRow(e,$.t("Show Date/Time Range"));$('<td colspan="3">').appendTo(a).append(n);a=this.addLabeledRow(e,$.t("Show Distance"));$('<td colspan="3">').appendTo(a).append(p);a=this.addLabeledRow(e,$.t("Show Angle"));$('<td colspan="3">').appendTo(a).append(r);a=this.addLabeledRow(e,
|
|
$.t("Always Show Stats"));$('<td colspan="3">').appendTo(a).append(t);this.bindControl(new D12(g,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Line Extending Left")));this.bindControl(new D12(k,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Trend Line Extending Right")));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));this.bindControl(new D11(c,
|
|
this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new D11(l,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Trend Line Left End")));this.bindControl(new D11(m,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Trend Line Right End")));
|
|
this.bindControl(new D12(f,this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new D12(h,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new D12(n,this._linetool.properties().showDateTimeRange,!0,this.model(),$.t("Change Trend Line Show Date/Time Range")));this.bindControl(new D12(p,
|
|
this._linetool.properties().showDistance,!0,this.model(),"Change Trend Line Show Distance"));this.bindControl(new D12(r,this._linetool.properties().showAngle,!0,this.model(),$.t("Change Trend Line Show Angle")));this.bindControl(new D12(t,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};J32.prototype.widget=function(){return this._table};J12=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J12,J49);
|
|
J12.prototype.prepareLayout=function(){this._res=$("<div>");this._table=$('<table class="property-page" cellspacing="0" cellpadding="2" style="width:100%"></table>').appendTo(this._res);var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Line");$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$('<td colspan="3">').append(b.render().css("display","block")).appendTo(d);
|
|
var e=$("<input type='checkbox' class='visibility-switch'>"),d=$("<tr>").appendTo(this._table);$('<td colspan="3">').append($("<label>").append(e).append($.t("Show Price"))).prependTo(d);var f=$("<input type='checkbox'>"),d=$("<tr>").appendTo(this._table);$('<td colspan="3">').append($("<label>").append(f).append($.t("Show Text"))).prependTo(d);var d=this.addLabeledRow(this._table,"Text:"),g=this.createColorPicker(),h=this.createFontSizeEditor(),k=this.createFontEditor(),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
|
|
m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(g).appendTo(d);$("<td>").append(k).appendTo(d);$("<td>").append(h).appendTo(d);$("<td>").append(l).appendTo(d);$("<td>").append(m).appendTo(d);d=$("<tr>").appendTo(this._table);$("<td colspan='2'>").append($.t("Text Alignment:")).appendTo(d);var n=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+
|
|
"</option></select>"),p=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>").data("selectbox-css",{display:"block"});$("<td>").append(n).appendTo(d);$("<td colspan='3'>").append(p).appendTo(d);var r=$("<textarea rows='7' cols='60'>").css("width","100%"),d=$("<tr>").appendTo(this._table);$("<td colspan='7'>").append(r).appendTo(d);this.bindControl(new D12(f,this._linetool.properties().showLabel,
|
|
!0,this.model(),"Change Horz Line Text Visibility"));this.bindControl(new D11(n,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new D11(p,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new TradingView.SimpleStringBinder(r,this._linetool.properties().text,null,!0,this.model(),"Change Text"));this.bindControl(new D12(e,
|
|
this._linetool.properties().showPrice,!0,this.model(),"Change Horz Line Price Visibility"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Horz Line Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Horz Line Style"));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Horz Line Width"));this.bindControl(new D11(h,
|
|
this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(k,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new TradingView.ColorBinding(g,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new D12(l,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(m,
|
|
this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));this.loadData()};J12.prototype.widget=function(){return this._res};J11=function(a,b,c){J14.call(this,a,b,c)};inherit(J11,J14);
|
|
J11.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');if(this._linetool.points().item(0)){var a=this._linetool.properties().points[0],a=this.createPriceEditor(a.price),b=$("<tr>").appendTo(this._table);$("<td>"+$.t("Price")+"</td>").appendTo(b);$("<td>").append(a).appendTo(b);this.loadData()}};J36=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J36,J49);
|
|
J36.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Line");$("<td>").prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(b.render()).appendTo(d);
|
|
var e=$("<input type='checkbox' class='visibility-switch'>"),d=$("<tr>").appendTo(this._table);$("<td>").append(e).prependTo(d);this.createLabeledCell(2,"Show Time",e).appendTo(d);this.bindControl(new D12(e,this._linetool.properties().showTime,!0,this.model(),"Change Vert Line Time Visibility"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Vert Line Color"));this.bindControl(new D11(b,
|
|
this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Vert Line Style"));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Vert Line Width"));this.loadData()};J36.prototype.widget=function(){return this._table};J35=function(a,b,c){J14.call(this,a,b,c)};
|
|
inherit(J35,J14);
|
|
J35.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');if(this._linetool.points().item(0)){var a=$('<input type="text" class="ticker">'),b=$("<tr>").appendTo(this._table);$("<td>"+$.t("Bar #")+"</td>").appendTo(b);$("<td>").append(a).appendTo(b);var b=this._linetool.properties().points[0],c=[TradingView.ToIntTransformer(b.bar.value()),TradingView.GreateTransformer(-5E3),TradingView.LessTransformer(15E3)];
|
|
this.bindControl(new TradingView.SimpleStringBinder(a,b.bar,c,!1,this.model(),"Change "+this._linetool+" point bar index"));this.loadData()}};J18=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J18,J49);J18.prototype.onResoreDefaults=function(){this._linetool.properties().style.listeners().fire(this._linetool.properties().style)};
|
|
J18.prototype.addLevelEditor=function(a,b,c){c=$("<tr>");c.appendTo(this._table);if(a){var d=$("<td>");d.appendTo(c);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(c);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new TradingView.SimpleStringBinder(e,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),
|
|
!1,this.model(),"Change Pitchfork Line Coeff"))}else $("<td></td>").appendTo(c),$("<td>"+$.t("Median")+"</td>").appendTo(c);a=$("<td class='colorpicker-cell'>");a.appendTo(c);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(c);d=TradingView.createLineWidthEditor();d.appendTo(e);e=$("<td>");e.appendTo(c);c=TradingView.createLineStyleEditor();c.render().appendTo(e);this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(c,
|
|
b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new TradingView.SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfork Line Width"))};
|
|
J18.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().median,!1);for(var a=0;8>=a;a++){var b="level"+a;this.addLevelEditor($.t("Level {0}").format(a+1),this._linetool.properties()[b],!1)}a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");
|
|
$("<td>").append(b).appendTo(a);this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);var d=$("<select><option value='0'>"+$.t("Original")+"</option><option value='3'>"+$.t("Schiff")+"</option><option value='1'>"+$.t("Modified Schiff")+"</option><option value='2'>"+$.t("Inside")+"</option></select>"),a=$("<tr>");a.appendTo(this._table);$("<td>"+$.t("Style")+"</td>").appendTo(a);$("<td>").append(d).appendTo(a);this.bindControl(new D11(d,
|
|
this._linetool.properties().style,parseInt,!0,this.model(),"Change Pitchfork Style"));this.bindControl(new D12(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new TradingView.SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.loadData()};J18.prototype.widget=function(){return this._table};J17=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J17,J49);
|
|
J17.prototype.addLevelEditor=function(a,b,c){c=$("<tr>");c.appendTo(this._table);if(a){var d=$("<td>");d.appendTo(c);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(c);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new TradingView.SimpleStringBinder(e,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),
|
|
!1,this.model(),"Change Pitchfork Line Coeff"))}else $("<td colspan='2'>"+$.t("Median")+"</td>").appendTo(c);a=$("<td class='colorpicker-cell'>");a.appendTo(c);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(c);d=TradingView.createLineWidthEditor();d.appendTo(e);e=$("<td>");e.appendTo(c);c=TradingView.createLineStyleEditor();c.render().appendTo(e);this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(c,
|
|
b.linestyle,parseInt,!0,this.model(),"Change Pitchfan Line Style"));this.bindControl(new TradingView.SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfan Line Width"))};
|
|
J17.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().median,!1);for(var a=0;8>=a;a++){var b="level"+a;this.addLevelEditor("Level "+(a+1),this._linetool.properties()[b],!1)}a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");
|
|
$("<td>").append(b).appendTo(a);this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new TradingView.SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};
|
|
J17.prototype.widget=function(){return this._table};TradingView.LineToolTextInplaceEditor=function(a,b){this.D4=a;this._undoModel=b};
|
|
TradingView.LineToolTextInplaceEditor.prototype.attachSource=function(a,b){this.R99=a;this._edit=$("<textarea>");this._edit.css("width","300");this._edit.css("height","150");this._edit.appendTo(this.D4._jqMainDiv);TradingView.setAbsolutePos(this._edit,b);this._edit.val(a.properties().text.value());this._edit.focus();var c=this._edit;c.select();this._binding=new TradingView.SimpleStringBinder(c,a.properties().text,null,!0,this._undoModel,"change line tool text");this._edit.focusout(function(){a.properties().text.setValue(c.val())});
|
|
this._edit.mousedown(function(a){return!0});return c};J27=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J27,J49);
|
|
J27.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createColorPicker(),c=this.createFontSizeEditor(),d=this.createFontEditor(),e=this.createTextEditor(350,200),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),h=$('<input type="checkbox" class="visibility-switch">'),k=$('<input type="checkbox" class="visibility-switch">'),l=$('<input type="checkbox">'),m=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
|
|
n=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().color,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D11(c,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(d,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));
|
|
this.bindControl(new TradingView.SimpleStringBinder(e,this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Text Background")));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().backgroundTransparency,!0,this.model(),$.t("Change Text Background Transparency")));this.bindControl(new D12(h,this._linetool.properties().fillBackground,
|
|
!0,this.model(),$.t("Change Text Background Fill")));this.bindControl(new D12(k,this._linetool.properties().drawBorder,!0,this.model(),$.t("Change Text Border")));this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().borderColor,!0,this.model(),$.t("Change Text Border Color")));this.bindControl(new D12(l,this._linetool.properties().wordWrap,!0,this.model(),$.t("Change Text Wrap")));this.bindControl(new D12(m,this._linetool.properties().bold,
|
|
!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(n,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));var p=$('<table class="property-page" cellspacing="0" cellpadding="2">'),r=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=p.add(t).add(r);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(m)).append($(document.createElement("td")).append(n)).appendTo(p);
|
|
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(e)).appendTo(p);a=this.addLabeledRow(r,$.t("Text Wrap"),l);$("<td>").append(l).prependTo(a);a=this.addLabeledRow(t,$.t("Background"),h);$("<td>").append(h).prependTo(a);$("<td>").append(f).appendTo(a);$("<td>").append(g).appendTo(a);a=this.addLabeledRow(t,$.t("Border"),k);$("<td>").append(k).prependTo(a);$("<td>").append(b).appendTo(a);this.loadData();setTimeout(function(){e.select();e.focus()},20)};
|
|
J27.prototype.widget=function(){return this._table};
|
|
J27.prototype.dialogPosition=function(a,b){var c=0,d=this._linetool,e=d.D0.paneForSource(d),f;$.each(this.D0.D4.paneWidgets(),function(a,b){if(b._state==e)return c=$(b.canvas).offset().top,!1});a||(a={});var g=a.left,h=a.top,k=this._linetool.paneViews()[0];k&&(f=k._floatPoints.item(0));f&&(g=f.x,h=f.y+c);f=$(b).outerHeight();k=$(window).height();d=d.properties().fontsize.value();return{top:h+f+d+5<=k?h+d+5:h-f-5,left:g}};J23=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J23,J49);
|
|
J23.prototype.prepareLayout=function(){function a(){g.slider("option","disabled",!h.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
|
|
f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(f).appendTo(d);$("<td>").append(g).appendTo(d);var h=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Rectangle Filling"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().color,!0,this.model(),"Change Rectangle Line Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Rectangle Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Rectangle Border Width"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Rectangle Background Transparency"));
|
|
this.loadData()};J23.prototype.widget=function(){return this._table};A98=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A98,J49);
|
|
A98.prototype.prepareLayout=function(){function a(){g.slider("option","disabled",!h.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
|
|
f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(f).appendTo(d);$("<td>").append(g).appendTo(d);var h=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Ellipse Filling"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().color,!0,this.model(),"Change Ellipse Line Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Ellipse Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Ellipse Border Width"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Ellipse Background Transparency"));
|
|
this.loadData()};A98.prototype.widget=function(){return this._table};A87=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A87,J49);
|
|
A87.prototype.prepareLayout=function(){function a(){g.slider("option","disabled",!h.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
|
|
f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(f).appendTo(d);$("<td>").append(g).appendTo(d);var h=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Arc Filling"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().color,!0,this.model(),"Change Arc Line Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Arc Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Arc Border Width"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Arc Background Transparency"));this.loadData()};
|
|
A87.prototype.widget=function(){return this._table};J34=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J34,J49);
|
|
J34.prototype.prepareLayout=function(){function a(){g.slider("option","disabled",!h.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
|
|
f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(f).appendTo(d);$("<td>").append(g).appendTo(d);var h=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Triangle Filling"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().color,!0,this.model(),"Change Triangle Line Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Triangle Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Triangle Border Width"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Triangle Background Transparency"));
|
|
this.loadData()};J34.prototype.widget=function(){return this._table};J16=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J16,J49);
|
|
J16.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=$("<tr>").appendTo(a);$("<td></td><td>"+$.t("Channel")+"</td>").appendTo(e);$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);
|
|
$("<td>").append(c.render()).appendTo(e);var e=$("<tr>").appendTo(a),f=$("<td>").appendTo(e),g=$("<input type='checkbox' class='visibility-switch'>");g.appendTo(f);this.createLabeledCell("Middle",g).appendTo(e);var f=TradingView.createLineWidthEditor(),h=TradingView.createLineStyleEditor(),k=this.createColorPicker();$("<td>").append(k).appendTo(e);$("<td>").append(f).appendTo(e);$("<td>").append(h.render()).appendTo(e);var e=$("<tr>").appendTo(a),l=$("<td>").appendTo(e),a=$("<input type='checkbox' class='visibility-switch'>");
|
|
a.appendTo(l);this.createLabeledCell("Background",a).appendTo(e);l=this.createColorPicker();$("<td>").append(l).appendTo(e);var m=TradingView.createTransparencyEditor(l);$('<td colspan="2">').append(m).appendTo(e);var n=$("<tbody>").appendTo(this._table),e=this.addEditorRow(n,"Extend Left",$("<input type='checkbox'>"),2),n=this.addEditorRow(n,"Extend Right",$("<input type='checkbox'>"),2),p=this._linetool.properties();this.bindControl(new D12(a,p.fillBackground,!0,this.model(),
|
|
"Change Parallel Channel Fill Background"));this.bindControl(new D12(g,p.showMidline,!0,this.model(),"Change Parallel Channel Show Center Line"));this.bindControl(new D12(e,p.extendLeft,!0,this.model(),"Change Parallel Channel Extending Left"));this.bindControl(new D12(n,p.extendRight,!0,this.model(),"Change Parallel Channel Extending Right"));this.bindControl(new TradingView.ColorBinding(d,p.linecolor,!0,this.model(),"Change Parallel Channel Color"));
|
|
this.bindControl(new D11(c,p.linestyle,parseInt,!0,this.model(),"Change Parallel Channel Style"));this.bindControl(new TradingView.SliderBinder(b,p.linewidth,!0,this.model(),"Change Parallel Channel Width"));this.bindControl(new TradingView.ColorBinding(k,p.midlinecolor,!0,this.model(),"Change Parallel Channel Middle Color"));this.bindControl(new D11(h,p.midlinestyle,parseInt,!0,this.model(),"Change Parallel Channel Middle Style"));this.bindControl(new TradingView.SliderBinder(f,
|
|
p.midlinewidth,!0,this.model(),"Change Parallel Channel Middle Width"));this.bindControl(new TradingView.ColorBinding(l,p.backgroundColor,!0,this.model(),"Change Parallel Channel Back Color"));this.bindControl(new TradingView.SliderBinder(m,p.transparency,!0,this.model(),"Change Parallel Channel Background Transparency"));this.loadData()};J16.prototype.widget=function(){return this._table};A88=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A88,J49);
|
|
A88.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">').css({width:"100%"});var a=$("<input type='text'>").css({width:"100%"}),b=$('<div class="property-page-fullwidth-wrapper">').append(a),c=this.createColorPicker(),d=this.createFontEditor(),e=$("<tr>").appendTo(this._table);$("<td>").css({width:"0"}).html($.t("Text")).appendTo(e);$('<td colspan="2">').append(b).appendTo(e);e=this.addLabeledRow(this._table,
|
|
"Text Font");e.children().css({whiteSpace:"nowrap"});$("<td>").append(c).appendTo(e).css({width:"0"});$("<td>").append(d).appendTo(e);this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Arrow Mark Text Color"));this.bindControl(new TradingView.SimpleStringBinder(a,this._linetool.properties().text,null,!0,this.model(),"Change Arrow Mark Text"));this.bindControl(new D11(d,this._linetool.properties().font,null,!0,this.model(),
|
|
"Change Arrow Mark Font"));this.loadData();setTimeout(function(){a.select();a.focus()},20)};A88.prototype.widget=function(){return this._table};J21=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J21,J49);
|
|
J21.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.createFontSizeEditor(),c=this.createColorPicker(),d=TradingView.createTransparencyEditor(c),e=this.createColorPicker(),f=this.addLabeledRow(this._table,$.t("Text"));$("<td>").append(a).appendTo(f);$("<td>").append(b).appendTo(f);
|
|
f=this.addLabeledRow(this._table,$.t("Background"));$("<td>").append(c).appendTo(f);$("<td>").append(d).appendTo(f);f=this.addLabeledRow(this._table,$.t("Border"));$("<td>").append(e).appendTo(f);this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().color,!0,this.model(),$.t("Change Price Text Color")));this.bindControl(new D11(b,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Price Text Font Size")));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Background Color")));this.bindControl(new TradingView.SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),$.t("Change Background Transparency")));this.bindControl(new TradingView.ColorBinding(e,this._linetool.properties().borderColor,!0,this.model(),$.t("Change Border Color")));this.loadData()};J21.prototype.widget=function(){return this._table};A89=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A89,J49);
|
|
A89.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-tab-open",TradingView.EditObjectDialog.TAB_OPEN_OVERRIDE),b=$('<table class="property-page" cellspacing="0" cellpadding="0">');this._table=a.add(b);var c=$("<input type='text'>").css({width:"100%"}),d=this.createColorPicker(),e=this.createFontSizeEditor(),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),
|
|
h=this.createColorPicker(),a=$("<tr>").appendTo(a),k=$('<div class="property-page-fullwidth-wrapper">').append(c);$("<td>").append(k).appendTo(a);a=this.addLabeledRow(b,$.t("Text"));$("<td>").append(d).appendTo(a);$("<td>").append(e).appendTo(a);a=this.addLabeledRow(b,$.t("Background"));$("<td>").appendTo(a).append(f);$("<td>").appendTo(a).append(g);a=this.addLabeledRow(b,$.t("Border"));$("<td>").appendTo(a).append(h);$("<td>");this.bindControl(new TradingView.SimpleStringBinder(c,this._linetool.properties().text,
|
|
null,!0,this.model(),$.t("Change Balloon Text")));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().color,!0,this.model(),$.t("Change Balooon Text Color")));this.bindControl(new D11(e,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Balloon Text Font Size")));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Balloon Background Color")));this.bindControl(new TradingView.SliderBinder(g,
|
|
this._linetool.properties().transparency,!0,this.model(),$.t("Change Balloon Background Transparency")));this.bindControl(new TradingView.ColorBinding(h,this._linetool.properties().borderColor,!0,this.model(),$.t("Change Balloon Border Color")));this.loadData();setTimeout(function(){c.select();c.focus()},0)};A89.prototype.widget=function(){return this._table};A92=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A92,J49);
|
|
A92.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=TradingView.createLineWidthEditor(),b=this.createColorPicker(),c=$('<input type="checkbox" class="visibility-switch">'),d=this.createColorPicker(),e=TradingView.createTransparencyEditor(d),f=this.addLabeledRow(this._table,"Line");$("<td>").prependTo(f);$("<td>").append(b).appendTo(f);$("<td>").append(a).appendTo(f);f=this.addLabeledRow(this._table,
|
|
"Background",c);$("<td>").append(c).prependTo(f);$("<td>").append(d).appendTo(f);$("<td>").append(e).appendTo(f);var g=$("<tbody>").appendTo(this._table),h=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),k=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),f=this.addLabeledRow(g,$.t("Left End"));$("<td>").prependTo(f);$('<td colspan="3">').appendTo(f).append(h);f=this.addLabeledRow(g,
|
|
$.t("Right End"));$("<td>").prependTo(f);$('<td colspan="3">').appendTo(f).append(k);this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().linecolor,!0,this.model(),"Change Brush Color"));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Brush Line Width"));this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Brush Filling"));this.bindControl(new TradingView.ColorBinding(d,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),"Change Brush Background Color"));this.bindControl(new TradingView.SliderBinder(e,this._linetool.properties().transparency,!0,this.model(),"Change Brush Background Transparency"));this.bindControl(new D11(h,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Trend Line Left End")));this.bindControl(new D11(k,this._linetool.properties().rightEnd,parseInt,!0,this.model(),
|
|
$.t("Change Trend Line Right End")));this.loadData()};A92.prototype.widget=function(){return this._table};J20=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J20,J49);
|
|
J20.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),c=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=a.add(b).add(c);var d=this.createColorPicker(),e=TradingView.createLineWidthEditor(),a=this.addLabeledRow(a,"Line");$("<td>").append(d).appendTo(a);$("<td>").append(e).appendTo(a);
|
|
var a=$("<tr>").appendTo(b),b=$("<td>").appendTo(a).css({"vertical-align":"top",width:"50%"}),a=$("<td>").appendTo(a).css({"vertical-align":"top",width:"50%"}),f=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(b),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo(a),b=this.addColorPickerRow(f,"Source back color"),a=this.addColorPickerRow(f,"Source text color"),h=this.addColorPickerRow(f,"Source border color"),k=this.addColorPickerRow(f,"Success back color"),
|
|
f=this.addColorPickerRow(f,"Success text color"),l=this.addColorPickerRow(g,"Target back color"),m=this.addColorPickerRow(g,"Target text color"),n=this.addColorPickerRow(g,"Target border color"),p=this.addColorPickerRow(g,"Failure back color"),g=this.addColorPickerRow(g,"Failure text color"),r=TradingView.createTransparencyEditor(l);this.addEditorRow(c,"Transparency",r);this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color"));this.bindControl(new TradingView.SliderBinder(e,
|
|
this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width"));this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().sourceBackColor,!0,this.model(),"Forecast Source Background Color"));this.bindControl(new TradingView.ColorBinding(h,this._linetool.properties().sourceStrokeColor,!0,this.model(),"Forecast Source Border Color"));this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().sourceTextColor,!0,this.model(),"Forecast Source Text Color"));
|
|
this.bindControl(new TradingView.ColorBinding(l,this._linetool.properties().targetBackColor,!0,this.model(),"Forecast Target Background Color"));this.bindControl(new TradingView.ColorBinding(n,this._linetool.properties().targetStrokeColor,!0,this.model(),"Forecast Target Border Color"));this.bindControl(new TradingView.ColorBinding(m,this._linetool.properties().targetTextColor,!0,this.model(),"Forecast Target Text Color"));this.bindControl(new TradingView.ColorBinding(k,this._linetool.properties().successBackground,
|
|
!0,this.model(),"Forecast Success Back Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().successTextColor,!0,this.model(),"Forecast Success Text Color"));this.bindControl(new TradingView.ColorBinding(p,this._linetool.properties().failureBackground,!0,this.model(),"Forecast Failure Back Color"));this.bindControl(new TradingView.ColorBinding(g,this._linetool.properties().failureTextColor,!0,this.model(),"Forecast Failure Text Color"));this.bindControl(new TradingView.SliderBinder(r,
|
|
this._linetool.properties().transparency,!0,this.model(),"Change Forecast Background Transparency"));this.loadData()};J20.prototype.widget=function(){return this._table};J19=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J19,J49);
|
|
J19.prototype.prepareLayout=function(){function a(){g.slider("option","disabled",!h.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");d.prepend("<td>");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var e=$('<input type="checkbox" class="visibility-switch">'),
|
|
f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),d=this.addLabeledRow(this._table,"Background",e);$("<td>").append(e).prependTo(d);$("<td>").append(f).appendTo(d);$("<td>").append(g).appendTo(d);var h=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Polyline Filling"));this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().linecolor,!0,this.model(),"Change Polyline Line Color"));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Polyline Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Polyline Border Width"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Polyline Background Transparency"));
|
|
this.loadData()};J19.prototype.widget=function(){return this._table};J10=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J10,J49);
|
|
J10.prototype.addLevelEditor=function(a,b,c){b=$("<tr>");b.appendTo(a);var d=$("<td>");d.appendTo(b);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(b);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new TradingView.SimpleStringBinder(e,c.coeff,TradingView.ToFloatTransformer(c.coeff.value()),
|
|
!1,this.model(),"Change Pitchfork Line Coeff"));a=$("<td class='colorpicker-cell'>");a.appendTo(b);b=TradingView.addColorPicker(a);this.bindControl(new TradingView.ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
|
|
J10.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tbody>").appendTo(this._table),b=$("<tr>");b.appendTo(a);var c=$('<td width="50%">');c.appendTo(b);a=$('<td width="50%">');a.appendTo(b);b=$('<table cellspacing="0" cellpadding="2">');b.appendTo(c);
|
|
b.addClass("property-page");c=$('<table cellspacing="0" cellpadding="2">');c.appendTo(a);c.addClass("property-page");$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(b);$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(c);for(a=1;7>=a;a++){var d="hlevel"+a;this.addLevelEditor(b,"Level "+a,this._linetool.properties()[d])}for(a=1;7>=a;a++)d="vlevel"+a,this.addLevelEditor(c,"Level "+a,this._linetool.properties()[d]);var c=$("<input type='checkbox' class='visibility-switch'>"),
|
|
d=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),f=$("<input type='checkbox' class='visibility-switch'>"),g=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),b=$("<tr>").appendTo(g),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(b)),
|
|
a=this.addLabeledRow(h,$.t("Left Labels"),c);$("<td>").append(c).prependTo(a);a=this.addLabeledRow(b,$.t("Right Labels"),d);$("<td>").append(d).prependTo(a);a=this.addLabeledRow(h,$.t("Top Labels"),e);$("<td>").append(e).prependTo(a);a=this.addLabeledRow(b,$.t("Bottom Labels"),f);$("<td>").append(f).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new D12(d,
|
|
this._linetool.properties().showRightLabels,!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new D12(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new D12(f,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility"));this._table=this._table.add(g);a=$("<tr>");a.appendTo(h);c=$("<input type='checkbox' class='visibility-switch'>");
|
|
$("<td>").append(c).appendTo(a);d=TradingView.createTransparencyEditor();$("<td>").append(d).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillHorzBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new TradingView.SliderBinder(d,this._linetool.properties().horzTransparency,!0,this.model(),"Change Gann Square Background Transparency"));a=$("<tr>");a.appendTo(b);c=$("<input type='checkbox' class='visibility-switch'>");
|
|
$("<td>").append(c).appendTo(a);d=TradingView.createTransparencyEditor();$("<td>").append(d).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillVertBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new TradingView.SliderBinder(d,this._linetool.properties().vertTransparency,!0,this.model(),"Change Gann Square Background Transparency"));this.loadData()};
|
|
J10.prototype.widget=function(){return this._table};J8=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J8,J49);
|
|
J8.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tr>");a.appendTo(this._table);var b=this._linetool.properties(),c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);var d=$("<tr>");$("<td colspan='3'>"+$.t("Levels")+"</td>").appendTo(d);
|
|
d.appendTo(c);for(var e in b.levels._childs){var f=b.levels[e],g=$("<tr>");g.appendTo(c);$("<td>"+e+"</td>").appendTo(g);d=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(d).appendTo(g);var h=$("<td class='colorpicker-cell'>");h.appendTo(g);var h=TradingView.addColorPicker(h),k=$("<td>");k.appendTo(g);g=TradingView.createLineWidthEditor();g.appendTo(k);this.bindControl(new D12(d,f.visible,!0,this.model(),"Change Gann Line Visibility"));this.bindControl(new TradingView.ColorBinding(h,
|
|
f.color,!0,this.model(),"Change Gann Line Color"));this.bindControl(new TradingView.SliderBinder(g,f.width,!0,this.model(),"Change Gann Line Width"))}c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);d=$("<tr>");$("<td colspan='4'>"+$.t("Fans")+"</td>").appendTo(d);d.appendTo(c);for(e in b.fanlines._childs)f=b.fanlines[e],g=$("<tr>"),g.appendTo(c),d=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(d).appendTo(g),h=f.x.value()+"x"+f.y.value(),$("<td>"+h+"</td>").appendTo(g),
|
|
h=$("<td class='colorpicker-cell'>"),h.appendTo(g),h=TradingView.addColorPicker(h),k=$("<td>"),k.appendTo(g),g=TradingView.createLineWidthEditor(),g.appendTo(k),this.bindControl(new D12(d,f.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new TradingView.ColorBinding(h,f.color,!0,this.model(),"Change Gann Fan Color")),this.bindControl(new TradingView.SliderBinder(g,f.width,!0,this.model(),"Change Gann Line Width"));c=$("<table>");$("<td valign='top'>").append(c).appendTo(a);
|
|
a=$("<tr>");$("<td colspan='4'>"+$.t("Arcs")+"</td>").appendTo(a);a.appendTo(c);for(e in b.arcs._childs)a=b.arcs[e],g=$("<tr>"),g.appendTo(c),d=$("<input type='checkbox' class='visibility-switch'>"),$("<td>").append(d).appendTo(g),h=a.x.value()+"x"+a.y.value(),$("<td>"+h+"</td>").appendTo(g),h=$("<td class='colorpicker-cell'>"),h.appendTo(g),h=TradingView.addColorPicker(h),k=$("<td>"),k.appendTo(g),g=TradingView.createLineWidthEditor(),g.appendTo(k),this.bindControl(new D12(d,
|
|
a.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new TradingView.ColorBinding(h,a.color,!0,this.model(),"Change Gann Arc Color")),this.bindControl(new TradingView.SliderBinder(g,a.width,!0,this.model(),"Change Gann Line Width"));a=$("<tbody>").appendTo(this._table);b=$('<input type="checkbox" class="visibility-switch">');e=TradingView.createTransparencyEditor();a=$("<tr>").appendTo(a);d=$("<table>");$('<td colspan="3">').append(d).appendTo(a);a=$("<tr>").appendTo(d);$("<td>"+
|
|
$.t("Background")+"</td>").appendTo(a);$("<td>").append(b).appendTo(a);$("<td>").append(e).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().arcsBackground.fillBackground,!0,this.model(),"Change Gann Square Filling"));this.bindControl(new TradingView.SliderBinder(e,this._linetool.properties().arcsBackground.transparency,!0,this.model(),"Change Gann Square Background Transparency"))};J8.prototype.widget=function(){return this._table};J9=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J9,J49);
|
|
J9.prototype.addLevelEditor=function(a,b,c,d){var e=$("<tr>");e.appendTo(this._tbody);d="control-level-"+c+"-"+d;var f=$("<td>");f.appendTo(e);c=$("<input type='checkbox' class='visibility-switch' id='"+d+"'>");c.appendTo(f);this.createLabeledCell(a).appendTo(e).find("label").attr("for",d);a=$("<td class='colorpicker-cell'>");a.appendTo(e);a=TradingView.addColorPicker(a);f=$("<td>");f.appendTo(e);d=TradingView.createLineWidthEditor();d.appendTo(f);f=$("<td>");
|
|
f.appendTo(e);e=TradingView.createLineStyleEditor();e.render().appendTo(f);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Gann Fan Line Visibility"));this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Gann Fan Line Color"));this.bindControl(new D11(e,b.linestyle,parseInt,!0,this.model(),"Change Gann Fan Line Style"));this.bindControl(new TradingView.SliderBinder(d,b.linewidth,!0,this.model(),"Change Gann Fan Line Width"))};
|
|
J9.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._tbody=$("<tbody>").appendTo(a);for(var c=1;9>=c;c++){var d="level"+c,d=this._linetool.properties()[d],e=d.coeff1.value(),f=d.coeff2.value();this.addLevelEditor("<sup>"+e+"</sup>⁄<sub>"+f+"</sub>",d,e,f)}d=$("<input type='checkbox' class='visibility-switch'>");c=this.addLabeledRow(b,
|
|
"Labels",d);$("<td>").append(d).prependTo(c);this.bindControl(new D12(d,this._linetool.properties().showLabels,!0,this.model(),"Change Gann Fan Labels Visibility"));this._table=a.add(b);c=$("<tr>");c.appendTo(this._table);a=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(a).appendTo(c);this.createLabeledCell("Background",a).appendTo(c);b=TradingView.createTransparencyEditor();$('<td colspan="3">').append(b).appendTo(c);this.bindControl(new D12(a,
|
|
this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};J9.prototype.widget=function(){return this._table};A84=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A84,J49);
|
|
A84.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);if(a){e=$("<td>");e.appendTo(d);var f=$("<input type='text'>");f.appendTo(e);f.css("width","70px");this.bindControl(new TradingView.SimpleStringBinder(f,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))}else this.createLabeledCell("Trend Line",
|
|
c).appendTo(d);e=$("<td class='colorpicker-cell'>");e.appendTo(d);var e=TradingView.addColorPicker(e),g=$("<td>");g.appendTo(d);f=TradingView.createLineWidthEditor();f.appendTo(g);a||(a=$("<td>"),a.appendTo(d),d=TradingView.createLineStyleEditor(),d.render().appendTo(a),this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Circle Style")));this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Fib Circle Visibility"));this.bindControl(new TradingView.ColorBinding(e,
|
|
b.color,!0,this.model(),"Change Fib Circle Line Color"));this.bindControl(new TradingView.SliderBinder(f,b.linewidth,!0,this.model(),"Change Fib Circle Width"))};
|
|
A84.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var c=$("<input type='checkbox' class='visibility-switch'>"),a=this.addLabeledRow(this._table,
|
|
"Levels",c);$("<td>").append(c).prependTo(a);b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,"Coeffs As Percents",b);$("<td>").append(b).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Circle Levels Visibility"));a=$("<tr>");a.appendTo(this._table);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(a);this.createLabeledCell("Background",c).appendTo(a);
|
|
var d=TradingView.createTransparencyEditor();$('<td colspan="3">').append(d).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new TradingView.SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.bindControl(new D12(b,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));
|
|
this.loadData()};A84.prototype.widget=function(){return this._table};J1=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J1,J49);
|
|
J1.prototype.addLevelEditor=function(a,b){var c=b||$("<tr>").appendTo(this._table),d=$("<td>");d.appendTo(c);var e=$("<input type='checkbox' class='visibility-switch'>");e.appendTo(d);b&&e.css("margin-left","15px");d=$("<td>");d.appendTo(c);var f=$("<input type='text'>");f.appendTo(d);f.css("width","70px");this.bindControl(new TradingView.SimpleStringBinder(f,a.coeff,TradingView.ToFloatTransformer(a.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"));
|
|
d=$("<td class='colorpicker-cell'>");d.appendTo(c);d=TradingView.addColorPicker(d);this.bindControl(new D12(e,a.visible,!0,this.model(),"Change Fib Retracement Line Visibility"));this.bindControl(new TradingView.ColorBinding(d,a.color,!0,this.model(),"Change Fib Retracement Line Color"));return c};
|
|
J1.prototype.prepareLayout=function(){this._div=$(document.createElement("div")).addClass("property-page");var a=this._linetool.properties().trendline,b=$("<table>").appendTo(this._div).css("padding-bottom","3px");if(a){var c=$("<tr>").appendTo(b),d=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(d).appendTo(c);$("<td>").append("Trend Line").appendTo(c);this.bindControl(new D12(d,a.visible,!0,this.model(),
|
|
"Change Fib Retracement Line Visibility"));d=$("<td class='colorpicker-cell'>").appendTo(c);d=TradingView.addColorPicker(d);this.bindControl(new TradingView.ColorBinding(d,a.color,!0,this.model(),"Change Fib Retracement Line Color"));var d=$("<td>").appendTo(c),e=TradingView.createLineWidthEditor();e.appendTo(d);this.bindControl(new TradingView.SliderBinder(e,a.linewidth,parseInt,this.model(),"Change Fib Retracement Line Width"));c=$("<td>").appendTo(c);d=TradingView.createLineStyleEditor();d.render().appendTo(c);
|
|
this.bindControl(new D11(d,a.linestyle,parseInt,!0,this.model(),"Change Fib Retracement Line Style"))}a=this._linetool.properties().levelsStyle;b=$("<tr>").appendTo(b);$("<td>").appendTo(b);$("<td>Levels Line</td>").appendTo(b);$("<td>").appendTo(b);d=$("<td>").appendTo(b);e=TradingView.createLineWidthEditor();e.appendTo(d);this.bindControl(new TradingView.SliderBinder(e,a.linewidth,parseInt,this.model(),"Change Fib Retracement Line Width"));c=$("<td>").appendTo(b);d=TradingView.createLineStyleEditor();
|
|
d.render().appendTo(c);this.bindControl(new D11(d,a.linestyle,parseInt,!0,this.model(),"Change Fib Retracement Line Style"));this._table=$(document.createElement("table")).appendTo(this._div);this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");a={};for(c=0;24>c;c++)d=c%8,b=a[d],e="level"+(c+1),a[d]=this.addLevelEditor(this._linetool.properties()[e],b);var a=$("<table cellpadding=0 cellspacing=0>").appendTo(this._div),c=$("<tr>").appendTo(a),f;this._linetool.properties().extendLines&&
|
|
(f=$("<input type='checkbox' class='visibility-switch'>"),b=$("<label>").append(f).append("Extend Lines"),$("<td>").append(b).appendTo(c));var g;this._linetool.properties().extendLeft&&(g=$("<input type='checkbox' class='visibility-switch'>"),b=$("<label>").append(g).append("Extend Left"),$("<td>").append(b).appendTo(c));var h;this._linetool.properties().extendRight&&(h=$("<input type='checkbox' class='visibility-switch'>"),b=$("<label>").append(h).append("Extend Right"),$("<td>").append(b).appendTo(c));
|
|
var k;this._linetool.properties().reverse&&(k=$("<input type='checkbox' class='visibility-switch'>"),b=$("<label>").append(k).append("Reverse"),$("<td>").append(b).appendTo(c));e=$("<tr>").appendTo(a);a=$("<input type='checkbox' class='visibility-switch'>");b=$("<label>").append(a).append("Levels");$("<td>").append(b).appendTo(e);c=$("<input type='checkbox' class='visibility-switch'>");b=$("<label>").append(c).append("Prices");$("<td>").append(b).appendTo(e);d=$("<input type='checkbox' class='visibility-switch'>");
|
|
b=$("<label>").append(d).append("Percents");$("<td>").append(b).appendTo(e);var l=$("<table cellspacing='0' cellpadding='0'>").appendTo(this._div),e=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),m=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>"),b=$("<tr>");b.append("<td>"+
|
|
$.t("Labels")+"</td>").append(e).append("<td> </td>").append(m);b.appendTo(l);b=$("<table cellspacing='0' cellpadding='0'>").appendTo(this._div);b=$("<tr>").appendTo(b);l=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(l).appendTo(b);this.createLabeledCell("Background",l).appendTo(b);var n=TradingView.createTransparencyEditor();$("<td>").append(n).appendTo(b);this.bindControl(new D11(e,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),
|
|
"Change Fib Retracement Labels Alignment"));this.bindControl(new D11(m,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this.bindControl(new D12(c,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility"));this.bindControl(new D12(a,this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility"));this.bindControl(new D12(l,
|
|
this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this._linetool.properties().extendLines&&this.bindControl(new D12(f,this._linetool.properties().extendLines,!0,this.model(),"Change Fib Retracement Extend Lines"));this._linetool.properties().extendLeft&&this.bindControl(new D12(g,
|
|
this._linetool.properties().extendLeft,!0,this.model(),"Change Fib Retracement Extend Lines"));this._linetool.properties().extendRight&&this.bindControl(new D12(h,this._linetool.properties().extendRight,!0,this.model(),"Change Fib Retracement Extend Lines"));this._linetool.properties().reverse&&this.bindControl(new D12(k,this._linetool.properties().reverse,!0,this.model(),"Change Fib Retracement Reverse"));this.bindControl(new D12(d,
|
|
this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};J1.prototype.widget=function(){return this._div};A99=function(a,b,c){J1.call(this,a,b,c)};inherit(A99,J1);J30=function(a,b,c){J1.call(this,a,b,c)};inherit(J30,J1);J31=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J31,J49);
|
|
J31.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new TradingView.SimpleStringBinder(e,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",
|
|
c).appendTo(d);a=$("<td class='colorpicker-cell'>");a.appendTo(d);a=TradingView.addColorPicker(a);var f=$("<td>");f.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(f);f=$("<td>");f.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(f);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,
|
|
b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new TradingView.SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
J31.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}a=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"});
|
|
a=$("<tr>").appendTo(a);$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a));$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a));a=$("<input type='checkbox' class='visibility-switch'>");b=this.addLabeledRow(this._table,"Show Labels",a);$("<td>").append(a).prependTo(b);var c=$("<table cellspacing='0' cellpadding='0'>"),d=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+
|
|
$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),e=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),b=$("<tr>");b.append("<td>"+$.t("Labels")+"</td>").append(d).append("<td> </td>").append(e);b.appendTo(c);b=$("<tr>");$("<td colspan='5'>").append(c).appendTo(b);b.appendTo(this._table);this.bindControl(new D11(d,this._linetool.properties().horzLabelsAlign,
|
|
null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment"));this.bindControl(new D11(e,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment"));b=$("<tr>");b.appendTo(this._table);c=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(c).appendTo(b);this.createLabeledCell("Background",c).appendTo(b);d=TradingView.createTransparencyEditor();$('<td colspan="3">').append(d).appendTo(b);this.bindControl(new D12(c,
|
|
this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new TradingView.SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this.bindControl(new D12(a,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Retracement Extend Lines"));this.loadData()};J31.prototype.widget=function(){return this._table};J3=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J3,J49);
|
|
J3.prototype.addLevelEditor=function(a,b,c){b=$("<tr>");b.appendTo(a);var d=$("<td>");d.appendTo(b);a=$("<input type='checkbox' class='visibility-switch'>");a.appendTo(d);d=$("<td>");d.appendTo(b);var e=$("<input type='text'>");e.appendTo(d);e.css("width","70px");this.bindControl(new D12(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new TradingView.SimpleStringBinder(e,c.coeff,TradingView.ToFloatTransformer(c.coeff.value()),
|
|
!1,this.model(),"Change Pitchfork Line Coeff"));a=$("<td class='colorpicker-cell'>");a.appendTo(b);b=TradingView.addColorPicker(a);this.bindControl(new TradingView.ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
|
|
J3.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page property-page-unpadded");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this._table.css({width:"100%"});var a=$("<tbody>").appendTo(this._table),b=$("<tr>");b.appendTo(a);var c=$('<td width="50%">');c.appendTo(b);a=$('<td width="50%">');a.appendTo(b);b=$('<table cellspacing="0" cellpadding="2">');
|
|
b.appendTo(c);b.addClass("property-page");c=$('<table cellspacing="0" cellpadding="2">');c.appendTo(a);c.addClass("property-page");$("<tr><td align='center' colspan='4'>"+$.t("Price Levels")+"</td></tr>").appendTo(b);$("<tr><td align='center' colspan='4'>"+$.t("Time Levels")+"</td></tr>").appendTo(c);for(a=1;7>=a;a++){var d="hlevel"+a;this.addLevelEditor(b,"Level "+a,this._linetool.properties()[d])}for(a=1;7>=a;a++)d="vlevel"+a,this.addLevelEditor(c,"Level "+a,this._linetool.properties()[d]);var c=
|
|
$("<input type='checkbox' class='visibility-switch'>"),d=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),f=$("<input type='checkbox' class='visibility-switch'>"),b=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),a=$("<tr>").appendTo(b),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a)),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(a)),
|
|
a=this.addLabeledRow(g,"Left Labels",c);$("<td>").append(c).prependTo(a);a=this.addLabeledRow(h,"Right Labels",d);$("<td>").append(d).prependTo(a);a=this.addLabeledRow(g,"Top Labels",e);$("<td>").append(e).prependTo(a);a=this.addLabeledRow(h,"Bottom Labels",f);$("<td>").append(f).prependTo(a);this.bindControl(new D12(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new D12(d,this._linetool.properties().showRightLabels,
|
|
!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new D12(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new D12(f,this._linetool.properties().showBottomLabels,!0,this.model(),"Change Gann Square Bottom Labels Visibility"));d=$('<table class="property-page" cellspacing="0" cellpadding="2">');e=TradingView.createLineWidthEditor();f=TradingView.createLineStyleEditor();
|
|
g=this.createColorPicker();c=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(d,"Grid",c);$("<td>").append(c).prependTo(a);$("<td>").append(g).appendTo(a);$("<td>").append(e).appendTo(a);$("<td>").append(f.render()).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().grid.visible,!0,this.model(),"Change Fib Speed Resistance Fan Grid Visibility"));this.bindControl(new TradingView.ColorBinding(g,this._linetool.properties().grid.color,!0,
|
|
this.model(),"Change Fib Speed Resistance Fan Grid Line Color"));this.bindControl(new D11(f,this._linetool.properties().grid.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Style"));this.bindControl(new TradingView.SliderBinder(e,this._linetool.properties().grid.linewidth,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Width"));this._table=this._table.add(b).add(d);a=$("<tr>");a.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");
|
|
$("<td>").append(c).appendTo(a);this.createLabeledCell("Background",c).appendTo(a);b=TradingView.createTransparencyEditor();$('<td colspan="3">').append(b).appendTo(a);this.bindControl(new D12(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Speed/Resistance Fan Background Visibility"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Fib Speed/Resistance Fan Background Transparency"));this.loadData()};
|
|
J3.prototype.widget=function(){return this._table};J2=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J2,J49);
|
|
J2.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);if(a){e=$("<td>");e.appendTo(d);var f=$("<input type='text'>");f.appendTo(e);f.css("width","70px");this.bindControl(new TradingView.SimpleStringBinder(f,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))}else $("<td>"+
|
|
$.t("Trend Line")+"</td>").appendTo(d);e=$("<td class='colorpicker-cell'>");e.appendTo(d);var e=TradingView.addColorPicker(e),g=$("<td>");g.appendTo(d);f=TradingView.createLineWidthEditor();f.appendTo(g);a||(a=$("<td>"),a.appendTo(d),d=TradingView.createLineStyleEditor(),d.render().appendTo(a),this.bindControl(new D11(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Arcs Style")));this.bindControl(new D12(c,b.visible,!0,this.model(),
|
|
$.t("Change Fib Speed Resistance Arcs Visibility")));this.bindControl(new TradingView.ColorBinding(e,b.color,!0,this.model(),$.t("Change Fib Speed Resistance Arcs Line Color")));this.bindControl(new TradingView.SliderBinder(f,b.linewidth,!0,this.model(),$.t("Change Fib Speed Resistance Arcs Width")))};
|
|
J2.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,
|
|
$.t("Levels"));$("<td>").append(b).prependTo(a);this.bindControl(new D12(b,this._linetool.properties().showCoeffs,!0,this.model(),$.t("Change Fib Speed Resistance Arcs Levels Visibility")));b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,$.t("Full Circles"));$("<td>").append(b).prependTo(a);this.bindControl(new D12(b,this._linetool.properties().fullCircles,!0,this.model(),$.t("Change Fib Speed Resistance Arcs Full Cirlces Mode")));
|
|
a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(b).appendTo(a);$("<td>"+$.t("Background")+"</td>").appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Fib Arcs Background Visibility")));this.bindControl(new TradingView.SliderBinder(c,this._linetool.properties().transparency,
|
|
!0,this.model(),$.t("Change Fib Arcs Background Transparency")));this.loadData()};J2.prototype.widget=function(){return this._table};J4=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J4,J49);
|
|
J4.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,"Line");$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);this.bindControl(new TradingView.ColorBinding(d,
|
|
this._linetool.properties().linecolor,!0,this.model(),"Change Fib Spiral Line Color"));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Fib Spiral Line Style"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Spiral Line Width"));this.loadData()};J4.prototype.widget=function(){return this._table};J5=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J5,J49);
|
|
J5.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new TradingView.SimpleStringBinder(e,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",
|
|
c).appendTo(d);a=$("<td class='colorpicker-cell'>");a.appendTo(d);a=TradingView.addColorPicker(a);var f=$("<td>");f.appendTo(d);e=TradingView.createLineWidthEditor();e.appendTo(f);f=$("<td>");f.appendTo(d);d=TradingView.createLineStyleEditor();d.render().appendTo(f);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new D11(d,
|
|
b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new TradingView.SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
J5.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=$("<input type='checkbox' class='visibility-switch'>"),
|
|
e=this.addLabeledRow(this._table,"Show Labels",d);$("<td>").append(d).prependTo(e);var f=$("<table cellspacing='0' cellpadding='0'>"),g=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+"</option></select>"),h=$("<select><option value='top'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='bottom'>"+$.t("bottom")+"</option></select>"),e=$("<tr>");e.append("<td>"+$.t("Labels")+
|
|
"</td>").append(g).append("<td> </td>").append(h);e.appendTo(f);e=$("<tr>");$("<td colspan='5'>").append(f).appendTo(e);e.appendTo(this._table);this.bindControl(new D11(g,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment"));this.bindControl(new D11(h,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment"));e=$("<tr>");e.appendTo(this._table);
|
|
f=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(f).appendTo(e);this.createLabeledCell("Background",f).appendTo(e);g=TradingView.createTransparencyEditor();$('<td colspan="3">').append(g).appendTo(e);this.bindControl(new D12(d,this._linetool.properties().showLabels,!0,this.model(),"Change Fib Time Zone Labels Visibility"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Fib Time Zone Color"));
|
|
this.bindControl(new D11(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Fib Time Zone Style"));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Time Zone Width"));this.bindControl(new D12(f,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,
|
|
!0,this.model(),"Change Fib Retracement Background Transparency"));this.loadData()};J5.prototype.widget=function(){return this._table};J6=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J6,J49);
|
|
J6.prototype.addLevelEditor=function(a,b,c){var d=$("<tr>");d.appendTo(this._table);var e=$("<td>");e.appendTo(d);c=$("<input type='checkbox' class='visibility-switch'>");c.appendTo(e);a?(a=$("<td>"),a.appendTo(d),e=$("<input type='text'>"),e.appendTo(a),e.css("width","70px"),this.bindControl(new TradingView.SimpleStringBinder(e,b.coeff,TradingView.ToFloatTransformer(b.coeff.value()),!1,this.model(),"Change Pitchfork Line Coeff"))):this.createLabeledCell("Trend Line",
|
|
c).appendTo(d);a=$("<td class='colorpicker-cell'>");a.appendTo(d);a=TradingView.addColorPicker(a);e=$("<td>");e.appendTo(d);d=TradingView.createLineWidthEditor();d.appendTo(e);this.bindControl(new D12(c,b.visible,!0,this.model(),"Change Fib Wedge Visibility"));this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Fib Wedge Line Color"));this.bindControl(new TradingView.SliderBinder(d,b.linewidth,!0,this.model(),"Change Fib Wedge Width"))};
|
|
J6.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");this.addLevelEditor(null,this._linetool.properties().trendline,!1);for(var a=1;11>=a;a++){var b="level"+a;this.addLevelEditor("Level "+a,this._linetool.properties()[b],!1)}b=$("<input type='checkbox' class='visibility-switch'>");a=this.addLabeledRow(this._table,
|
|
"Levels",b);$("<td>").append(b).prependTo(a);this.bindControl(new D12(b,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Wedge Levels Visibility"));a=$("<tr>");a.appendTo(this._table);b=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(b).appendTo(a);this.createLabeledCell("Background",b).appendTo(a);var c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(a);this.bindControl(new D12(b,
|
|
this._linetool.properties().fillBackground,!0,this.model(),"Change Wedge Background Visibility"));this.bindControl(new TradingView.SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Wedge Background Transparency"));this.loadData()};J6.prototype.widget=function(){return this._table};A94=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A94,J49);
|
|
A94.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=TradingView.createLineStyleEditor(),c=this.createColorPicker(),d=this.addLabeledRow(this._table,"Lines");$("<td>").append(c).appendTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(b.render()).appendTo(d);this.bindControl(new TradingView.ColorBinding(c,
|
|
this._linetool.properties().linecolor,!0,this.model(),"Change Circle Lines Color"));this.bindControl(new D11(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Circle Lines Style"));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Circle Lines Width"));this.loadData()};A94.prototype.widget=function(){return this._table};TradingView.LineToolTimeCyclesPropertyPage=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(TradingView.LineToolTimeCyclesPropertyPage,J49);
|
|
TradingView.LineToolTimeCyclesPropertyPage.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);var e,f,g;this._linetool.properties().fillBackground&&
|
|
($("<td>").prependTo(a),e=$('<input type="checkbox" class="visibility-switch">'),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),a=$("<tbody>").appendTo(this._table),a=$("<tr>").appendTo(a),$("<td>").append(e).appendTo(a),$("<td>").append($.t("Background")).appendTo(a),$("<td>").append(f).appendTo(a),$("<td>").append(g).appendTo(a));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Time Cycles Color")));this.bindControl(new D11(c,
|
|
this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Time Cycles Line Style")));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Time Cycles Line Width")));e&&(this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Time Cycles Filling"))),this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Time Cycles Background Color"))),
|
|
this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),$.t("Change Time Cycles Background Transparency"))))};TradingView.LineToolTimeCyclesPropertyPage.prototype.widget=function(){return this._table};J24=function(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()};inherit(J24,J14);
|
|
J24.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">'),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":TradingView.EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":TradingView.EditObjectDialog.TAB_PRIORITY_INPUTS});this._table=a.add(b);for(var c=this._linetool.points(),d=0;d<c.size();d++){c.item(d);var e=$("<tr>");e.appendTo(a);var f=$("<td>");f.html($.t("Point bar",
|
|
{point:d+1}));f.appendTo(e);f=$("<td>");f.appendTo(e);e=$("<input type='text'>");e.appendTo(f);e.addClass("ticker");var f=this._linetool.properties().points[d],g=[TradingView.ToIntTransformer(f.bar.value()),TradingView.GreateTransformer(-5E3),TradingView.LessTransformer(15E3)];this.bindControl(new TradingView.SimpleStringBinder(e,f.bar,g,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=TradingView.StudyMetaInfo.findStudyMetaInfo(this.D0.studiesMetaData(),"RegressionTrend@tv-basicstudies");
|
|
J41.prototype.prepareLayoutImpl.call(this,a,b)};J24.prototype.widget=function(){return this._table};A95=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A95,J49);
|
|
A95.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(a,"Line");$("<td>").prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var d=this.createColorPicker(),e=this.createColorPicker(),f=this.createFontSizeEditor(),g=this.createFontEditor();this.createTextEditor(350,
|
|
200);var h=this.createColorPicker(),k=TradingView.createTransparencyEditor(h),l=$('<input type="checkbox" class="visibility-switch">'),m=this.createColorPicker(),n=TradingView.createTransparencyEditor(m),p=$('<input type="checkbox" class="visibility-switch">');this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new D11(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));
|
|
this.bindControl(new D11(g,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new TradingView.ColorBinding(h,this._linetool.properties().labelBackgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new TradingView.SliderBinder(k,this._linetool.properties().labelBackgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new D12(l,this._linetool.properties().fillLabelBackground,
|
|
!0,this.model(),"Change Text Background Fill"));this.bindControl(new TradingView.ColorBinding(m,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new D12(p,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill"));this.bindControl(new TradingView.ColorBinding(e,
|
|
this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color"));e=this.addLabeledRow(a,"Background",p);$("<td>").append(p).prependTo(e);$("<td>").append(m).appendTo(e);$('<td colspan="2">').append(n).appendTo(e);m=this.addLabeledRow(a,"Label");$("<td>").prependTo(m);$("<td>").append(d).appendTo(m);$("<td>").append(g).appendTo(m);$("<td>").append(f).appendTo(m);e=this.addLabeledRow(a,"Label Background",l);$("<td>").append(l).prependTo(e);$("<td>").append(h).appendTo(e);$('<td colspan="2">').append(k).appendTo(e);
|
|
this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Date Range Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Date Range Line Width"));this.loadData()};A95.prototype.widget=function(){return this._table};J22=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J22,J49);
|
|
J22.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.createColorPicker(),c=TradingView.createTransparencyEditor(a),d=this.addLabeledRow(this._table,"Background");$("<td>").append(a).appendTo(d);$("<td>").append(b).appendTo(d);$("<td>").append(c).appendTo(d);var e=TradingView.createLineWidthEditor(),
|
|
f=this.createColorPicker(),d=this.addLabeledRow(this._table,"Border");$("<td>").append(f).appendTo(d);$("<td>").appendTo(d);$("<td>").append(e).appendTo(d);this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().trendline.color,!0,this.model(),"Change Projection Line Color"));this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().color1,!0,this.model(),"Change Projection Background Color"));this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().color2,
|
|
!0,this.model(),"Change Projection Background Color"));this.bindControl(new TradingView.SliderBinder(e,this._linetool.properties().linewidth,!0,this.model(),"Change Projection Border Width"));this.bindControl(new TradingView.SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Projection Background Transparency"));this.loadData()};J22.prototype.widget=function(){return this._table};J15=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J15,J49);
|
|
J15.prototype.prepareLayout=function(){function a(){n.slider("option","disabled",!p.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.createColorPicker(),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),
|
|
f=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),g=this.createFontSizeEditor(),h=this.createFontEditor(),k=this.addLabeledRow(this._table,"Border");k.prepend("<td>");$("<td>").append(c).appendTo(k);$("<td>").append(b).appendTo(k);var l=$('<input type="checkbox" class="visibility-switch">'),m=this.createColorPicker(),n=TradingView.createTransparencyEditor(m),h=this.createFontEditor(),k=this.addLabeledRow(this._table,"Background",l);$("<td>").append(l).prependTo(k);
|
|
$("<td>").append(m).appendTo(k);$("<td>").append(n).appendTo(k);var p=this._linetool.properties().fillBackground;a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(l,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().textcolor,
|
|
!0,this.model(),"Change Pattern Text Color"));this.bindControl(new TradingView.ColorBinding(m,this._linetool.properties().backgroundColor,!0,this.model(),"Change Pattern Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new D11(g,
|
|
this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(f,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));b=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).attr({width:1}).append(g)).append($(document.createElement("td")).css("vertical-align",
|
|
"top").attr({width:1}).append(e)).append($(document.createElement("td")).css("vertical-align","top").append(f)).append($("</tr></table>"));k=this.addLabeledRow(this._table,"");$('<td colspan="5">').append(b).appendTo(k);this.loadData()};J15.prototype.widget=function(){return this._table};A86=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A86,J49);
|
|
A86.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=TradingView.createLineWidthEditor(),b=this.createColorPicker(),c=this.createColorPicker(),d=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),
|
|
f=this.createFontSizeEditor(),g=this.createFontEditor(),g=this.addLabeledRow(this._table,"Border");g.prepend("<td>");$("<td>").append(b).appendTo(g);$("<td>").append(a).appendTo(g);g=this.createFontEditor();this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new TradingView.SliderBinder(a,
|
|
this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new D11(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(g,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(d,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(e,
|
|
this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));a=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(g)).append($(document.createElement("td")).attr({width:1}).append(f)).append($(document.createElement("td")).css("vertical-align","top").attr({width:1}).append(d)).append($(document.createElement("td")).css("vertical-align",
|
|
"top").append(e)).append($("</tr></table>"));g=this.addLabeledRow(this._table,"");$('<td colspan="5">').append(a).appendTo(g);this.loadData()};A86.prototype.widget=function(){return this._table};TradingView.LineToolNotePropertyPage=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(TradingView.LineToolNotePropertyPage,J49);
|
|
TradingView.LineToolNotePropertyPage.prototype.prepareLayout=function(){var a=this.createColorPicker(),b=this.createFontSizeEditor(),c=this.createFontEditor(),d=this.createTextEditor(350,200),e=this.createColorPicker(),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f),h=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new TradingView.ColorBinding(a,
|
|
this._linetool.properties().textColor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D11(b,this._linetool.properties().fontSize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(c,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new TradingView.SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new TradingView.ColorBinding(e,
|
|
this._linetool.properties().markerColor,!0,this.model(),$.t("Change Marker and Border Color")));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Background Color")));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Background Transparency"));this.bindControl(new D12(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));
|
|
this.bindControl(new D12(k,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));var l=$('<table class="property-page" cellspacing="0" cellpadding="2">'),m=$('<table class="property-page" cellspacing="0" cellpadding="2">'),n=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=l.add(n).add(m);$(document.createElement("tr")).append($(document.createElement("td")).attr({width:1}).append(a)).append($(document.createElement("td")).attr({width:1}).append(c)).append($(document.createElement("td")).attr({width:1}).append(b)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).append(k)).appendTo(l);
|
|
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(l);a=this.addLabeledRow(n,$.t("Label"));$("<td>").attr("colspan",2).append(e).appendTo(a);a=this.addLabeledRow(n,$.t("Background"));$("<td>").append(f).appendTo(a);$("<td>").append(g).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};TradingView.LineToolNotePropertyPage.prototype.widget=function(){return this._table};
|
|
TradingView.LineToolNotePropertyPage.prototype.dialogPosition=function(a,b){if(a&&b){for(var c=0,d=this._linetool.D0.paneForSource(this._linetool),e=A45.getChartWidget(),f;c<e.paneWidgets().length;c++)if(e.paneWidgets()[c]._state==d){f=$(e.paneWidgets()[c].canvas).offset().left;break}c=this._linetool.paneViews()[0];d=new MathEx.Point(0,0);c&&(d=c._floatPoints.item(0)||this._linetool._fixedPoints.item(0));c=TradingView.LineToolNote.TOOLTIP_WIDTH;f=(f||0)+d.x-c/2;d=b.outerWidth();
|
|
if(a.left<f&&a.left+d+10>f)return a.left-=a.left+d+10-f,a;if(a.left>f&&a.left<f+c+10)return a.left+=f+c+10-a.left,a}};J43=function(a,b,c){D7.call(this,a,b);this._linetool=c;this.prepareLayout()};inherit(J43,J14);
|
|
J43.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">'),b=$('<table class="property-page" cellspacing="0" cellpadding="0">').data({"layout-tab":TradingView.EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":TradingView.EditObjectDialog.TAB_PRIORITY_INPUTS});this._table=a.add(b);for(var c=this._linetool.points(),d=0;d<c.size();d++){c.item(d);var e=$("<tr>");e.appendTo(a);var f=$("<td>");f.html("Point "+
|
|
(d+1)+" Bar #");f.appendTo(e);f=$("<td>");f.appendTo(e);e=$("<input type='text'>");e.appendTo(f);e.addClass("ticker");var f=this._linetool.properties().points[d],g=[TradingView.ToIntTransformer(f.bar.value()),TradingView.GreateTransformer(-5E3),TradingView.LessTransformer(15E3)];this.bindControl(new TradingView.SimpleStringBinder(e,f.bar,g,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=TradingView.StudyMetaInfo.findStudyMetaInfo(this.D0.studiesMetaData(),this._linetool.studyId());
|
|
J41.prototype.prepareLayoutImpl.call(this,a,b)};J43.prototype.widget=function(){return this._table};J44=function(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()};inherit(J44,D7);inherit(J44,TradingView.SeriesStylePropertyPageMixin);
|
|
J44.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">'),c=$('<table class="property-page" cellspacing="0" cellpadding="2">'),d=$('<table class="property-page" cellspacing="0" cellpadding="2">'),e=$('<table class="property-page" cellspacing="0" cellpadding="2">'),f=this.D1.properties();this._prepareSeriesStyleLayout(a,b,c,f);this._table=
|
|
a.add(b).add(c).add(d).add(e);a=$('<input type="checkbox">');d=this.addLabeledRow(d,"Price Line",a);$("<td>").append(a).prependTo(d);this.bindControl(new D12(a,f.showPriceLine,!0,this.model(),"Change Price Price Line"));d=this.createSeriesMinTickEditor();a=$("<tr>");a.appendTo(e);$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(a);$("<td>").append(d).appendTo(a);this.bindControl(new D11(d,f.minTick,null,!0,this.model(),"Change MinTick"));J47.prototype._putStudyDefaultStyles.call(this,
|
|
e)};J44.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};
|
|
J44.prototype.switchStyle=function(){$(this._barsTbody).add(this._barsColorerTbody).add(this._candlesTbody).add(this._candlesColorerTbody).add(this._hollowCandlesTbody).add(this._lineTbody).add(this._areaTbody).css("display","none");switch(this.D1.properties().style.value()){case TradingView.Series.STYLE_BARS:this._barsTbody.css("display","table-row-group");this._barsColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_CANDLES:this._candlesTbody.css("display",
|
|
"table-row-group");this._candlesColorerTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._hollowCandlesTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_LINE:this._lineTbody.css("display","table-row-group");break;case TradingView.Series.STYLE_AREA:this._areaTbody.css("display","table-row-group")}};J44.prototype.widget=function(){return this._table};A97=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A97,J49);
|
|
A97.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=this.createKeyCombo(TradingView.LineToolElliott.degrees);a.width(300);var b=this.createColorPicker();$('<input type="checkbox" class="visibility-switch">');var c=$('<input type="checkbox" class="visibility-switch">'),d=this.addLabeledRow(this._table,"Degree");$("<td>").prependTo(d);$("<td>").append(a).appendTo(d);var d=this.addLabeledRow(this._table,
|
|
"Line Width"),e=TradingView.createLineWidthEditor();$("<td>").prependTo(d);$("<td>").append(e).appendTo(d);d=this.addLabeledRow(this._table,"Color");$("<td>").prependTo(d);$("<td>").append(b).appendTo(d);d=this.addLabeledRow(this._table,"Show Wave",c);$("<td>").append(c).prependTo(d);this.bindControl(new TradingView.ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Elliott Label Color"));this.bindControl(new D11(a,this._linetool.properties().degree,
|
|
parseInt,!0,this.model(),"Change Elliott Wave Size"));this.bindControl(new D12(c,this._linetool.properties().showWave,!0,this.model(),"Change Elliott Labels Background"));this.bindControl(new TradingView.SliderBinder(e,this._linetool.properties().linewidth,parseInt,this.model(),"Change Elliott Wave Line Width"));this.loadData()};A97.prototype.widget=function(){return this._table};J25=function(a,b,c){J14.call(this,a,b,c);this.prepareLayout()};inherit(J25,J14);
|
|
J25.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=this.addLabeledRow(a,"Stop Level. Ticks:"),c=$("<input type='text'>");$("<td>").append(c).appendTo(b);c.addClass("ticker");var d=$("<input type='text'>");$("<td>"+$.t("Price:")+"</td>").appendTo(b);$("<td>").append(d).appendTo(b);var e=this.addLabeledRow(a,"Entry price:"),f=$("<input type='text'>");
|
|
$('<td colspan="2">').append(f).appendTo(e);var g=this.addLabeledRow(a,"Profit Level. Ticks:"),e=$("<input type='text'>");$("<td>").append(e).appendTo(g);e.addClass("ticker");var h=$("<input type='text'>");$("<td>"+$.t("Price:")+"</td>").appendTo(g);$("<td>").append(h).appendTo(g);"LineToolRiskRewardLong"==this._linetool.getConstructor()&&(b.detach().appendTo(a),g.detach().prependTo(a));a=[TradingView.ToIntTransformer(this._linetool.properties().stopLevel.value()),TradingView.GreateTransformer(0),
|
|
TradingView.LessTransformer(1E9)];this.bindControl(new TradingView.SimpleStringBinder(c,this._linetool.properties().stopLevel,a,!1,this.model(),"Change "+this._linetool+" stop level"));a=[TradingView.ToIntTransformer(this._linetool.properties().profitLevel.value()),TradingView.GreateTransformer(0),TradingView.LessTransformer(1E9)];this.bindControl(new TradingView.SimpleStringBinder(e,this._linetool.properties().profitLevel,a,!1,this.model(),"Change "+this._linetool+" profit level"));a=[TradingView.ToFloatTransformer(this._linetool.properties().entryPrice.value())];
|
|
this.bindControl(new TradingView.SimpleStringBinder(f,this._linetool.properties().entryPrice,a,!1,this.model(),"Change "+this._linetool+" entry price"));var k=this,a=[TradingView.ToFloatTransformer(this._linetool.properties().stopPrice.value()),function(a){return k._linetool.preparseStopPrice(a)}];this.bindControl(new TradingView.SimpleStringBinder(d,this._linetool.properties().stopPrice,a,!1,this.model(),"Change "+this._linetool+" stop price"));a=[TradingView.ToFloatTransformer(this._linetool.properties().targetPrice.value()),
|
|
function(a){return k._linetool.preparseProfitPrice(a)}];this.bindControl(new TradingView.SimpleStringBinder(h,this._linetool.properties().targetPrice,a,!1,this.model(),"Change "+this._linetool+" stop price"))};J25.prototype.widget=function(){return this._table};J26=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};
|
|
inherit(J26,J49);
|
|
J26.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.addLabeledRow(a,"Lines");$("<td>").append(c).appendTo(d);$("<td>").append(b).appendTo(d);var d=this.addLabeledRow(a,"Stop Color:"),e=this.createColorPicker();$("<td>").append(e).appendTo(d);var f=TradingView.createTransparencyEditor(e);
|
|
$('<td colspan="2">').append(f).appendTo(d);var d=this.addLabeledRow(a,"Target Color:"),g=this.createColorPicker();$("<td>").append(g).appendTo(d);var h=TradingView.createTransparencyEditor(g);$('<td colspan="2">').append(h).appendTo(d);var d=this.addLabeledRow(a,"Text:"),a=this.createColorPicker(),k=this.createFontSizeEditor(),l=this.createFontEditor();$("<td>").append(a).appendTo(d);$("<td>").append(l).appendTo(d);$("<td>").append(k).appendTo(d);this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().linecolor,
|
|
!0,this.model(),"Change Risk/Reward line Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Risk/Reward line width"));this.bindControl(new TradingView.ColorBinding(e,this._linetool.properties().stopBackground,!0,this.model(),"Change stop color"));this.bindControl(new TradingView.SliderBinder(f,this._linetool.properties().stopBackgroundTransparency,!0,this.model(),"Change Stop Background Transparency"));this.bindControl(new TradingView.ColorBinding(g,
|
|
this._linetool.properties().profitBackground,!0,this.model(),"Change target color"));this.bindControl(new TradingView.SliderBinder(h,this._linetool.properties().profitBackgroundTransparency,!0,this.model(),"Change Profit Background Transparency"));this.bindControl(new D11(k,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new D11(l,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));
|
|
this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.loadData()};J26.prototype.widget=function(){return this._table};J33=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J33,J49);
|
|
J33.prototype.prepareLayout=function(){function a(){n.slider("option","disabled",!p.value())}this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var b=TradingView.createLineWidthEditor(),c=this.createColorPicker(),d=this.createColorPicker(),e=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),f=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>'),
|
|
g=this.createFontSizeEditor(),h=this.createFontEditor(),k=this.addLabeledRow(this._table,"Border");k.prepend("<td>");$("<td>").append(c).appendTo(k);$("<td>").append(b).appendTo(k);var l=$('<input type="checkbox" class="visibility-switch">'),m=this.createColorPicker(),n=TradingView.createTransparencyEditor(m),h=this.createFontEditor(),k=this.addLabeledRow(this._table,"Background",l);$("<td>").append(l).prependTo(k);$("<td>").append(m).appendTo(k);$("<td>").append(n).appendTo(k);var p=this._linetool.properties().fillBackground;
|
|
a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new D12(l,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new TradingView.ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new TradingView.ColorBinding(m,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),"Change Pattern Background Color"));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));
|
|
this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new D12(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new D12(f,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));b=$('<table class="property-page" cellspacing="0" cellpadding="2"><tr>').append($(document.createElement("td")).attr({width:1}).append(d)).append($(document.createElement("td")).attr({width:1}).append(h)).append($(document.createElement("td")).attr({width:1}).append(g)).append($(document.createElement("td")).css("vertical-align",
|
|
"top").attr({width:1}).append(e)).append($(document.createElement("td")).css("vertical-align","top").append(f)).append($("</tr></table>"));k=this.addLabeledRow(this._table,"");$('<td colspan="5">').append(b).appendTo(k);this.loadData()};J33.prototype.widget=function(){return this._table};A96=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(A96,J49);
|
|
A96.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);$('<td colspan="3">').append(c.render()).appendTo(e);var e=this.addLabeledRow(a,$.t("Text")),
|
|
a=this.createColorPicker(),f=this.createFontSizeEditor(),g=this.createFontEditor(),h=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(a).appendTo(e);$("<td>").append(g).appendTo(e);$("<td>").append(f).appendTo(e);$("<td>").append(h).appendTo(e);$("<td>").append(k).appendTo(e);var e=$("<tbody>").appendTo(this._table),l=$('<input type="checkbox" class="visibility-switch">'),
|
|
m=this.createColorPicker(),n=TradingView.createTransparencyEditor(m),e=this.addLabeledRow(e,$.t("Background"),l),p=$("<table>");$('<td colspan="5">').append(p).appendTo(e);e=$("<tr>").appendTo(p);$("<td>").append(l).appendTo(e);$("<td>").append(m).appendTo(e);$("<td>").append(n).appendTo(e);var r=$("<tbody>").appendTo(this._table),t=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),p=$('<input type="checkbox">').appendTo(t),v=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
|
|
w=$('<input type="checkbox">').appendTo(v),u=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),x=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(r,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(u).append(t);e=this.addLabeledRow(r,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(x).append(v);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
|
|
r=$("<input type='checkbox'>");t=$("<label style='display:block'>").append(r).append($.t("Show Prices"));$("<td colspan='2'>").append(t).appendTo(e);this.bindControl(new D11(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(g,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().textcolor,
|
|
!0,this.model(),$.t("Change Text Color")));this.bindControl(new D12(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(k,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new D12(r,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new D12(p,
|
|
this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));this.bindControl(new D12(w,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),
|
|
$.t("Change Disjoint Angle Style")));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));this.bindControl(new D11(u,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new D11(x,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new D12(l,
|
|
this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new TradingView.ColorBinding(m,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};A96.prototype.widget=function(){return this._table};J7=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J7,J49);
|
|
J7.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),e=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(e);$("<td>").append(b).appendTo(e);$('<td colspan="3">').append(c.render()).appendTo(e);var e=this.addLabeledRow(a,$.t("Text")),a=
|
|
this.createColorPicker(),f=this.createFontSizeEditor(),g=this.createFontEditor(),h=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(a).appendTo(e);$("<td>").append(g).appendTo(e);$("<td>").append(f).appendTo(e);$("<td>").append(h).appendTo(e);$("<td>").append(k).appendTo(e);var e=$("<tbody>").appendTo(this._table),l=$('<input type="checkbox" class="visibility-switch">'),
|
|
m=this.createColorPicker(),n=TradingView.createTransparencyEditor(m),e=this.addLabeledRow(e,$.t("Background"),l),p=$("<table>");$('<td colspan="5">').append(p).appendTo(e);e=$("<tr>").appendTo(p);$("<td>").append(l).appendTo(e);$("<td>").append(m).appendTo(e);$("<td>").append(n).appendTo(e);var r=$("<tbody>").appendTo(this._table),t=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),p=$('<input type="checkbox">').appendTo(t),v=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
|
|
w=$('<input type="checkbox">').appendTo(v),u=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),x=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(r,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(u).append(t);e=this.addLabeledRow(r,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(x).append(v);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
|
|
r=$("<input type='checkbox'>");t=$("<label style='display:block'>").append(r).append($.t("Show Prices"));$("<td colspan='2'>").append(t).appendTo(e);this.bindControl(new D11(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new D11(g,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new TradingView.ColorBinding(a,this._linetool.properties().textcolor,
|
|
!0,this.model(),$.t("Change Text Color")));this.bindControl(new D12(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(k,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new D12(r,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new D12(p,
|
|
this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));this.bindControl(new D12(w,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),
|
|
$.t("Change Disjoint Angle Style")));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));this.bindControl(new D11(u,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new D11(x,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new D12(l,
|
|
this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new TradingView.ColorBinding(m,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new TradingView.SliderBinder(n,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};J7.prototype.widget=function(){return this._table};J13=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J13,J49);
|
|
J13.prototype.prepareLayout=function(){this._table=$(document.createElement("table"));this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.createColorPicker(),b=this.addLabeledRow(this._table,"Color:");$("<td>").append(a).appendTo(b);b=this._linetool.properties();this._div=$("<div>").append(this._table);this.bindControl(new TradingView.ColorBinding(a,b.color,!0,this.model(),"Change Icon Color"));
|
|
this.loadData()};J13.prototype.widget=function(){return this._div};J29=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(J29,J49);
|
|
J29.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=$("<tbody>").appendTo(this._table),b=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),a=this.addLabeledRow(a,$.t("Line"));$("<td>").append(d).appendTo(a);$("<td>").append(b).appendTo(a);$('<td colspan="3">').append(c.render()).appendTo(a);var e=$("<tbody>").appendTo(this._table),
|
|
a=this.addLabeledRow(e,$.t("Text")),f=this.createColorPicker(),g=this.createFontSizeEditor(),h=this.createFontEditor(),k=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-bold"></span></span>'),l=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');$("<td>").append(f).appendTo(a);$("<td>").append(h).appendTo(a);$("<td>").append(g).appendTo(a);$("<td>").append(k).appendTo(a);$("<td>").append(l).appendTo(a);var m=$('<input type="checkbox">'),
|
|
n=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Extend Right End"));$('<td colspan="3">').appendTo(a).append(m);a=this.addLabeledRow(e,$.t("Extend Left End"));$('<td colspan="3">').appendTo(a).append(n);var p=$('<input type="checkbox">'),r=$('<input type="checkbox">'),t=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Show Price Range"));$('<td colspan="3">').appendTo(a).append(p);a=this.addLabeledRow(e,$.t("Show Bars Range"));$('<td colspan="3">').appendTo(a).append(r);a=this.addLabeledRow(e,
|
|
$.t("Always Show Stats"));$('<td colspan="3">').appendTo(a).append(t);this.bindControl(new D12(p,this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new D12(r,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new D11(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));
|
|
this.bindControl(new D11(h,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new TradingView.ColorBinding(f,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new D12(k,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new D12(l,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));
|
|
this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new TradingView.SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new D12(m,this._linetool.properties().extendRight,
|
|
!0,this.model(),$.t("Change Trend Angle Extending Right")));this.bindControl(new D12(n,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Angle Extending Left")));this.bindControl(new D12(t,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};J29.prototype.widget=function(){return this._table};
|
|
J28=function(a,b,c){J14.call(this,a,b,c)};inherit(J28,J14);
|
|
J28.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=this._linetool.points().item(0),b=this._linetool.properties().points[0];if(a&&b){var c=this._createPointRow(a,b,"");this._table.append(c);c=$("<tr>").appendTo(this._table);$("<td>").append($.t("Angle")).appendTo(c);a=$("<input type='text'>");$("<td>").append(a).appendTo(c);b=[TradingView.ToFloatTransformer(b.price.value()),TradingView.GreateTransformer(-360),
|
|
TradingView.LessTransformer(360)];this.bindControl(new TradingView.SimpleStringBinder(a,this._linetool.properties().angle,b,!1,this.model(),$.t("Change angle")));this.loadData()}};J28.prototype.widget=function(){return this._table};TradingView.LineToolBezierStylesPropertyPage=function(a,b,c){J49.call(this,a,b,c);this.prepareLayout()};inherit(TradingView.LineToolBezierStylesPropertyPage,J49);
|
|
TradingView.LineToolBezierStylesPropertyPage.prototype.prepareLayout=function(){this._block=$("<div>").addClass("property-page");var a=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),b=$("<tbody>").appendTo(a),a=TradingView.createLineWidthEditor(),c=TradingView.createLineStyleEditor(),d=this.createColorPicker(),b=this.addLabeledRow(b,$.t("Line"));$("<td>").append(d).appendTo(b);$("<td>").append(a).appendTo(b);$('<td colspan="3">').append(c.render()).appendTo(b);var b=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),
|
|
b=this.addLabeledRow(b,$.t("Background"),e),e=$('<input type="checkbox" class="visibility-switch">'),f=this.createColorPicker(),g=TradingView.createTransparencyEditor(f);$("<td>").append(e).prependTo(b);$("<td>").append(f).appendTo(b);$("<td>").append(g).appendTo(b);var h=$('<table cellspacing="0" cellpadding="2">').appendTo(this._block),k=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),l=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+
|
|
$.t("Arrow")+"</option></select>"),m=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),n=$('<input type="checkbox">').appendTo(m),p=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),r=$('<input type="checkbox">').appendTo(p),b=this.addLabeledRow(h,$.t("Left End"));$('<td colspan="3">').appendTo(b).append(k).append(m);b=this.addLabeledRow(h,$.t("Right End"));$('<td colspan="3">').appendTo(b).append(l).append(p);this.bindControl(new TradingView.ColorBinding(d,this._linetool.properties().linecolor,
|
|
!0,this.model(),$.t("Change Curve Line Color")));this.bindControl(new D11(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Curve Line Style")));this.bindControl(new TradingView.SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Curve Line Width")));this.bindControl(new D12(e,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Curve Filling")));this.bindControl(new TradingView.ColorBinding(f,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Curve Background Color")));this.bindControl(new TradingView.SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),$.t("Change Curve Background Transparency")));this.bindControl(new D11(k,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Curve Line Left End")));this.bindControl(new D11(l,this._linetool.properties().rightEnd,parseInt,!0,
|
|
this.model(),$.t("Change Curve Line Right End")));this.bindControl(new D12(n,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Curve Line Extending Left")));this.bindControl(new D12(r,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Curve Line Extending Right")));this.loadData()};TradingView.LineToolBezierStylesPropertyPage.prototype.widget=function(){return this._block};J42=function(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()};inherit(J42,D7);
|
|
J42.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=a.add(b);for(var c=this.D1.properties(),d=[[$.t("Base"),c.styles.baseLine],[$.t("Up"),c.styles.upLine],[$.t("Down"),c.styles.downLine]],e,f=0;f<d.length;f++){var g=d[f],h=$("<input type='checkbox' class='visibility-switch'/>"),k=this.createColorPicker(),l=
|
|
TradingView.createLineWidthEditor(),m=TradingView.createLineStyleEditor(),n=this.addLabeledRow(a,g[0],h);f||(e=k);$("<td>").append(h).prependTo(n);$("<td>").append(k).appendTo(n);$("<td>").append(l).appendTo(n);$("<td>").append(m.render()).appendTo(n);n="Change "+g[0];this.bindControl(new D12(h,g[1].visible,!0,this.model(),n));this.bindControl(new TradingView.ColorBinding(k,g[1].color,!0,this.model(),n));this.bindControl(new TradingView.SliderBinder(l,g[1].linewidth,!0,this.model(),
|
|
n));this.bindControl(new D11(m,g[1].linestyle,parseInt,!0,this.model(),n))}a=$("<input type='checkbox' class='visibility-switch'/>");d=$("<input type='checkbox'/>");n=$("<tr>").appendTo(b);$("<td>").append(a).appendTo(n);this.createLabeledCell($.t("Pearson's R"),a).appendTo(n);n=$("<tr>").appendTo(b);$("<td>").append(d).appendTo(n);this.createLabeledCell($.t("Extend Lines"),d).appendTo(n);n=$("<tr>").appendTo(b);$("<td>").appendTo(n);$("<td>"+$.t("Background")+"</td>").appendTo(n);
|
|
b=TradingView.createTransparencyEditor(e);$("<td>").append(b).appendTo(n);this.bindControl(new D12(a,c.styles.showPearsons,!0,this.model(),"Change show Pearson's R"));this.bindControl(new D12(d,c.styles.extendLines,!0,this.model(),"Change Extend Lines"));this.bindControl(new TradingView.SliderBinder(b,c.styles.transparency,!0,this.model(),"Change Background Transparency"))};J42.prototype.widget=function(){return this._table};J50=function(a,b,c){D7.call(this,a,b);this.D1=c;this.prepareLayout()};inherit(J50,D7);
|
|
J50.prototype.prepareLayout=function(){var a=this.D1.properties();this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var b=this.addLabeledRow(this._table,"Volume"),c=TradingView.createPlotEditor();$("<td>").append(c).appendTo(b);this.bindControl(new D11(c,a.styles.vol.plottype,parseInt,!0,this.model(),"Change Volume Plot Style"));c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.ColorBinding(c,
|
|
a.palettes.volumePalette.colors[0].color,!0,this.model(),"Change Up Volume color"));c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.ColorBinding(c,a.palettes.volumePalette.colors[1].color,!0,this.model(),"Change Down Volume color"));c=TradingView.createTransparencyEditor();$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.SliderBinder(c,a.transparency,!0,this.model(),"Change Volume Transparency"));c=$("<input type='checkbox'>");$("<td>").appendTo(b);
|
|
$("<td>").append(c).appendTo(b);$("<td>"+$.t("Price Line")+"</td>").appendTo(b);this.bindControl(new D12(c,a.styles.vol.trackPrice,!0,this.model(),"Change Price Line"));a=a.styles.vol_ma;b=this.addLabeledRow(this._table,"Volume MA");c=TradingView.createPlotEditor();$("<td>").append(c).appendTo(b);this.bindControl(new D11(c,a.plottype,parseInt,!0,this.model(),"Change Volume MA Plot Style"));$("<td>").html(" ").appendTo(b);c=this.createColorPicker();
|
|
$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.ColorBinding(c,a.color,!0,this.model(),"Change Volume MA color"));c=TradingView.createTransparencyEditor(c);$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.SliderBinder(c,a.transparency,!0,this.model(),"Change Volume MA Transparency"));c=TradingView.createLineWidthEditor();$("<td>").append(c).appendTo(b);this.bindControl(new TradingView.SliderBinder(c,a.linewidth,!0,this.model(),"Change Volume MA Line Width"));c=$("<input type='checkbox'>");
|
|
$("<td>").append(c).appendTo(b);$("<td>"+$.t("Price Line")+"</td>").appendTo(b);this.bindControl(new D12(c,a.trackPrice,!0,this.model(),"Change Price Line"));J47.prototype._putStudyDefaultStyles.call(this,this._table,8)};J50.prototype.widget=function(){return this._table};A3=function(a){this._$container=$(a);this._$header=this._$container.parent().find(".header").eq(0)};A3.prototype.setSelectableHeader=function(a){var b=this._$container.parent().find(".header");b.addClass("selectable").append($("<span>").addClass("dropdown"));this._title=b.find(".title");b=b.find(".title, .dropdown");b.on("click",a);TradingView.bindPopupMenu(b,null,{event:"show-popup",addClass:"narrow",careBottomBorder:!0})};
|
|
A3.prototype.updateTitleFull=function(a,b){this._notification_count=this._notification_count||0;b&&(this._notification_count+=b);this._notification_count=0<=this._notification_count||0;var c=this._$container.parent().find(".header .title");c.text(a);this._notification_count&&c.prepend($("<span>").addClass("ch-new-counter").text(this._notification_count))};A3.prototype.clearNotifications=function(){this._notification_count=0;this.updateTitle()};
|
|
A3.prototype.HIGHLIGHT_NUM_FLICKS=5;A3.prototype.resize=$.noop;TradingView.SymbolListContextMenuActions=function SymbolListContextMenuActions(b){if(R77.enabled("symbollist_context_menu")){if(!(this instanceof SymbolListContextMenuActions))return new SymbolListContextMenuActions(b);b=b||{};this.list=b.list;this.commonActionsFunctions=b.commonActionsFunctions||[];this.symbolActionsFunctions=b.symbolActionsFunctions||[];this.addDefaultActions();this.bindActions()}};
|
|
TradingView.SymbolListContextMenuActions.prototype.bindActions=function(){var a=this;this.list.$element.on("contextmenu",function(b){var c=[],c=c.concat(a.getActionObj(a.commonActionsFunctions)),d=$(b.target).closest(".symbol-list-item"),e=d.data("symbol-full")||d.data("symbol-orig");e&&(TradingView.onWidget()||c.push(new TradingView.ActionSeparator),d=d.data("symbol-short")||e,c=c.concat(a.getActionObj(a.symbolActionsFunctions,e,d)));b.preventDefault();TradingView.ContextMenu.createMenu(c).show(b)})};
|
|
TradingView.SymbolListContextMenuActions.prototype.getActionObj=function(a){var b=Array.prototype.slice.call(arguments,1);return a.reduce(function(a,d){var e=d.apply(this,b);Array.isArray(e)?a=a.concat(e):a.push(e);return a},[])};
|
|
TradingView.SymbolListContextMenuActions.prototype.addDefaultActions=function(){this.symbolActionsFunctions.push(function(a,b){var c=new TradingView.Action({text:"New "+b+" chart..."});c.callbacks().subscribe(this,function(){TradingView.openNewChart({symbol:a})});return c});this.symbolActionsFunctions.push(function(a,b){var c=new TradingView.Action({text:b+" ideas..."});c.callbacks().subscribe(this,function(){window.open("/chart/"+encodeURI(b))});return c})};TradingView.MarketSummaryWidget=function(a){this._bridge=a;this.D2=a.properties||{};this.D2.symbols=this.D2.symbols||this.defaults().symbols;this._initLayout();this._bridge.visible.subscribe(this._visibilityChanged.bind(this));this._bridge.height.subscribe(this._onHeightChange.bind(this))};
|
|
TradingView.MarketSummaryWidget.prototype.defaults=function(){return{symbols:[{symbol:"S&P 500",symbol_full:"FX:SPX500",short_name:"SPX500",color:"#e0725e"},{symbol:"Nikkei 225",symbol_full:"FX:JPN225",short_name:"JPN225",color:"#64a81e"},{symbol:"Nasdaq",symbol_full:"FX:NAS100",short_name:"NAS100",color:"#fdaf48"}],minHeight:150}};
|
|
TradingView.MarketSummaryWidget.prototype._initLayout=function(){var a=this._bridge.$body;a.addClass("market-summary");var b=$.map(this.D2.symbols,function(a){return{symbol:a.symbol_full,options:{line:{color:a.color}}}});this.$chart=$('<div class="mini-chart" style="position: relative;"></div>');this.$timeframes=$('<div class="timeframe"></div>');this._chart=new TradingView.MiniChart(b,this.$chart,{showMessage:!1,timeframe:{container:this.$timeframes,value:"1m",visible:!0},showTimeframes:!0,
|
|
chartOptions:{minHeight:this.defaults().minHeight,minWidth:R77.enabled("browser_extension")?330:null,grid:{xIsVisible:!1,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#ebedf0"}},yScale:{visible:!0,position:"right",isPercentage:!0,paddingLeft:10,paddingRight:4,marginInPercents:0,font:{size:10,family:"Helvetica",color:"#c8cacd"},drawOverPlotArea:!1,drawTickMarkLine:!1,maxTickMarkAmount:5},xScale:{visible:!0,font:{size:10,family:"Helvetica",color:"#c8cacd"}},plot:{line:{width:2},
|
|
belowLineFillStyle:"transparent",aboveLineFillStyle:"transparent"},loading:{showWhileNoPlots:!0}}});this.$quotes=$(Mustache.render('<table class="quote-tickers"><tr>{{#symbols}}<td><div class="market-summary-quote-ticker chart-legend" data-symbol="{{symbol_full}}"><a href="/chart/?symbol={{symbol_full}}" target="_blank" class="chart-link" data-symbol="{{symbol_full}}" style="border-color: {{color}}"><div class="symbol-name symbol-short-name">{{symbol}}</div><div class="symbol-tiker symbol-change-direction symbol-last"> </div></a></div></td>{{/symbols}}</tr></table>',
|
|
{symbols:this.D2.symbols}));this._quotes=[];var c=this;this.$quotes.find(".market-summary-quote-ticker").each(function(){var a=$(this);c._quotes.push(new TradingView.QuoteTicker(a.data("symbol"),a))});a.append(this.$timeframes,this.$chart,this.$quotes);this._onHeightChange()};TradingView.MarketSummaryWidget.prototype._onHeightChange=function(a){a=this._bridge.$body.height()-this.$quotes.outerHeight(!0)-this.$timeframes.outerHeight(!0);a=Math.max(a,this.defaults().minHeight);this.$chart.height(a)};
|
|
TradingView.MarketSummaryWidget.prototype._visibilityChanged=function(a){a||this.$chart.css("visibility","hidden");this._quotes.forEach(function(b){b.enabled=!!a});a?this._chart.connect(function(){this.$chart.css("visibility","visible");this._onHeightChange()}.bind(this)):this._chart.disconnect()};TradingView.ChatProgressBar=function(a,b,c,d,e){this._$bar=a;this._value=0;this._state="off";this._halt=c;this._tick=d;this._step=this._halt*this._tick/b;this._animations=e};TradingView.ChatProgressBar.prototype.start=function(a){"running"==this._state&&this.stop();this._transaction=a;this._$bar.css("opacity","1");this._$bar.css("background-color","#18BE8A");this._state="running";this._intervalID=setInterval(this.update.bind(this),this._tick)};
|
|
TradingView.ChatProgressBar.prototype.stop=function(){clearInterval(this._intervalID);this._value=0};TradingView.ChatProgressBar.prototype.update=function(){this._value>=this._halt?this.stop():"running"==this._state&&(this._value+=this._step,this._$bar.width(this._value+"%"))};
|
|
TradingView.ChatProgressBar.prototype.finish=function(a,b){"off"!=this._state&&this._transaction==a&&(this.stop(),this.transaction=-1,b&&this._$bar.css("background-color","red"),this._state="off",this._$bar.animate({width:"100%"},this._animations[0]),this._$bar.animate({opacity:"0"},b?this._animations[2]:this._animations[1],function(){this._$bar.width(0)}.bind(this)))};TradingView.ChatProgressBar.prototype.finishOnError=function(a){this.finish(a,!0)};
|
|
TradingView.ChatSettingsDialog=function(a,b,c){this._bridge=a;this._handler=b;this._rooms=c;this.favoritesSettings=TVSettings.getJSON("publiccharts.favorites",{});this.notificationsSettings=TVSettings.getJSON("publiccharts.notifications",{bitcoin:1,stock:1,general:1});this._handler(this.getMenu())};
|
|
TradingView.ChatSettingsDialog.prototype.soundSettings=[{title:"Sound on every message",state:{onMessage:!0,onMessageForUser:!0}},{title:"Sound on addressed to me messages",state:{onMessage:!1,onMessageForUser:!0}},{title:"No Sound notifications",state:{onMessage:!1,onMessageForUser:!1}}];
|
|
TradingView.ChatSettingsDialog.prototype.getMenu=function(){var a=[],b=this;this._bridge.private_chat&&!this._bridge.standalone&&(a=a.concat(this._bridge.privateMenuItems()),a.length&&a.push({separator:!0}));a=a.concat(this.soundMenuItems(this.soundSettings,TVSettings.getJSON(this._bridge.private_chat?"privatemessages.sound":"chat.sound",TradingView.ChatSoundControl.prototype._default_state)));a.push({separator:!0});this._bridge.standalone||this._bridge.options&&this._bridge.options.layoutWithSelect||
|
|
(a.push(this._bridge.chatNotificationControl.desktopMenuItem()),a.push(this._bridge.chatNotificationControl.emailMenuItem()),a.push({separator:!0}));a.push({title:"Show chart snapshot preview",icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool("chat.show_snapshot_preview")?"0 -16px":void 0},action:function(a){this._bridge.postMessage("toggle_snaphot_preview")}.bind(this)});this._bridge.private_chat||this._bridge.standalone||a.push({title:"Show only favorite rooms",
|
|
icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool("chat.show_only_favorites")?"0 -16px":void 0},action:function(a){this._bridge.postMessage("toggle_show_only_favorites")}.bind(this)});a.push({separator:!0});a.push({title:"Ignored users...",action:function(a){this.showIgnoreList()}.bind(this)});if(!this._bridge.standalone){var c=!this._bridge.private_chat&&this._bridge._room in this.favoritesSettings,d,e=0;for(;e<this._rooms.length;e++)if(this._rooms[e].room_id==this._bridge._room){d=
|
|
this._rooms[e];break}d&&(a.push({separator:!0}),e=TradingView.ChatWidget.getLaunchInSeparateWindowAction(b._bridge._room,function(){return!!b._bridge.private_chat}),this._bridge.private_chat?a.push(e):(d.pinned||a.push({title:c?$.t("Remove this room from favorites"):$.t("Add this room to favorites"),action:function(a){this._bridge.postMessage("toggle_favorite_room",a);this.favoritesSettings=TVSettings.getJSON("publiccharts.favorites",{})}.bind(this,this._bridge._room)}),a=a.concat(TradingView.PublicChatsWidget.publicMenuItems(this._bridge._room,
|
|
this._bridge,this)),a.push(e),d.pinned||d.user_id!=user.id&&!user.is_staff||(a.push({title:"Edit room...",action:function(){this._bridge.postMessage("chat_edit_room",this._bridge._room)}.bind(this)}),a.push({title:"Delete room",action:function(){this._bridge.postMessage("chat_delete_room",this._bridge._room)}.bind(this)}))))}return a};TradingView.ChatSettingsDialog.prototype.update=function(){this._handler(this.getMenu(),!0)};TradingView.ChatSettingsDialog.prototype._radioIcon="data:image/gif;base64,R0lGODlhBgAGAMIGAIuMjo+QkpOUlrS1tra2uLe4uf///////yH5BAEKAAcALAAAAAAGAAYAAAMQeCVSRyACEiQIVYZhx2NOAgA7";
|
|
TradingView.ChatSettingsDialog.prototype.soundMenuItems=function(a,b){"boolean"===typeof b&&(b=$.extend(TradingView.ChatSoundControl.prototype._default_state,{onMessage:b}));return a.map(function(a){var d=!0,e;for(e in b)if((e in a.state||!b[e])&&a.state[e]!==b[e]){d=!1;break}a.icon={image:"url("+this._radioIcon+")"};a.icon.offset=d?{x:5,y:5}:{x:-30,y:-30};a.action=function(b){this._bridge.postMessage("chat_set_sound_state",{isPrivate:!!this._bridge.private_chat,state:a.state})}.bind(this);return a}.bind(this))};
|
|
TradingView.ChatSettingsDialog.prototype.showIgnoreList=function(){A83.createModalDialog("Ignored users list");A83.modalDialog.find(".tv-dialog").css("width","400px");A83.modalDialog.find(".tv-dialog-content").html('<div class="main" style="overflow-y: auto; max-height: 300px;"></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide cancel" type="button" value="Close"/></div>');var a=A83.modalDialog.find(".main"),b="",c;for(c in user.ignore_list)b+=
|
|
'<div class="ch-ignore-list-item"><span>'+user.ignore_list[c]+'</span><a href="#" class="delete" data-id="'+c+'">Delete</a></div>';b||(b="<center><i>You have no ignored users</i></center>");a.html(b);a.on("click",".delete",function(a){a=$(this).data("id");delete user.ignore_list[a];$.post("/conversation-ignore/",{user_id:a,action:"remove"});$(this).parent().remove();return!1});A83.modalDialog.find(".cancel").click(function(){A83.destroy()});A83.positionDialog();A83.applyHandlers()};
|
|
TradingView.ChatNotificationControl=function(a){a?(this._settingsKey="messages.show_desktop_notifications",this._eventKey="privatemessages.toggledesktopnotifications",this._title=$.t("Desktop notifications"),this._emailKey="privatemessages.send_email_notifications",this._emailTitle=$.t("Email notifications")):(this._settingsKey="publicchats.show_desktop_notifications",this._event="publicchats.toggledesktopnotifications",this._title=$.t("Desktop notifications when I'm mentioned"),this._emailKey="publicchats.send_email_notifications",
|
|
this._emailTitle=$.t("Email notifications when I'm mentioned"));this._isOn=TVSettings.getBool(this._settingsKey,!0);this._isOnEmail=TVSettings.getBool(this._emailKey,!0);TVXWindowEvents.on(this._eventKey,this._toggle.bind(this))};TradingView.ChatNotificationControl.prototype.destroy=function(){TVXWindowEvents.off(this._eventKey,this._toggle.bind(this))};TradingView.ChatNotificationControl.prototype._toggle=function(a){this._isOn="true"===a?!0:!1};
|
|
TradingView.ChatNotificationControl.prototype.isOn=function(){return this._isOn};TradingView.ChatNotificationControl.prototype.desktopMenuItem=function(){return{title:$.t("Desktop notifications"),icon:{image:TradingView.wrapUrl("url('/static/images/dialogs/checkbox.png')"),offset:this._isOn?"0 -16px":void 0},action:function(a){TVSettings.setValue(this._settingsKey,!this._isOn);TVXWindowEvents.emit(this._eventKey,!this._isOn);this._isOn=!this._isOn}.bind(this)}};
|
|
TradingView.ChatNotificationControl.prototype.emailMenuItem=function(){return{title:this._emailTitle,icon:{image:TradingView.wrapUrl("url('/static/images/dialogs/checkbox.png')"),offset:this._isOnEmail?"0 -16px":void 0},action:function(a){TVSettings.setValue(this._emailKey,!this._isOnEmail);this._isOnEmail=!this._isOnEmail}.bind(this)}};
|
|
TradingView.ChatSoundControl=function(a){this._settingsKey=a;this.state=this._getState();this._updateSettingsListener=this._setFromAnother.bind(this);TVXWindowEvents.on("chat-sound-control-changed",this._updateSettingsListener);loginStateChange.subscribe(null,this._updateSettingsListener)};TradingView.ChatSoundControl.prototype._default_state={onMessage:!1,onMessageForUser:!0};
|
|
TradingView.ChatSoundControl.prototype._getState=function(a){var b=$.extend({},this._default_state);a=TVSettings.getJSON(this._settingsKey,null,a);null!==a&&("boolean"===typeof a?$.extend(b,{onMessage:a}):$.extend(b,a));return b};TradingView.ChatSoundControl.prototype.set=function(a){this._set(a);TVSettings.setJSON(this._settingsKey,this.state);TVXWindowEvents.emit("chat-sound-control-changed")};TradingView.ChatSoundControl.prototype._setFromAnother=function(){this._set(this._getState(!0))};
|
|
TradingView.ChatSoundControl.prototype._set=function(a){this.state=$.extend({},this._default_state,a)};TradingView.ChatSoundControl.prototype.destroy=function(){this._updateSettingsListener&&(TVXWindowEvents.off("chat-sound-control-changed",this._updateSettingsListener),loginStateChange.unsubscribe(null,this._updateSettingsListener))};TradingView.ChatRoomListSearchFilter=function(a,b){this.parentWidget=a;this.isParentDependent=b;this.isOn=!1};
|
|
TradingView.ChatRoomListSearchFilter.prototype.appendInput=function(a){this._$searchInputWrap=$('<div class="msg-input-wrap msg-input-wrap-hidden">').appendTo(a);this._$searchInput=$('<div class="msg-input">').appendTo(this._$searchInputWrap);this._$searchInputText=$('<input type="text" placeholder="Find existing chat"></textarea>').appendTo(this._$searchInput);this._$searchInputReset=$('<a class="input-reset" style="display: none;">').appendTo(this._$searchInput);var b=this;this._$searchInputText.on("keydown",
|
|
function(a){if(13==a.which||38==a.which||40==a.which)return!1}).on("keyup",function(a){var d=b._$searchInputText.val(),e=new RegExp(d.split("").map(TradingView.RegExpEscape).join(".*"),"i");27==a.which?(""===b._$searchInputText.val()&&(b.isOn=!1,b._$searchInputWrap.addClass("msg-input-wrap-hidden"),b.parentWidget.resize(),b._$searchButton.removeClass("active"),b.newRoom?(b.parentWidget._scroll.animateTo(b.newRoom.position().top),b.newRoom=""):b.parentWidget._scroll.restore()),b._$searchInputText.val(""),
|
|
b.showRooms(),b._$searchInputReset.hide()):(b.hideRooms(),0===b._$searchInputText.val().length?(b._$searchInputReset.hide(),b.showRooms()):(b._$searchInputReset.show(),b.parentWidget._scroll.scrollToStart(),b._$data.find(".title").each(function(){e.test($(this).text())&&$(this).parent().show()})))});this._$searchInputReset.on("click",function(a){b._$searchInputText.val("");b._$searchInputReset.hide();b.showRooms();b._$searchInputText.focus()})};
|
|
TradingView.ChatRoomListSearchFilter.prototype.appendButton=function(a){var b=this;this._$searchButton=$('<a class="button" title="Find existing chat">').append(svgAsset("chat-search","17x17")).appendTo(a);this._$searchButton.on("click",function(a){b.isOn?(b.isOn=!1,b._$searchButton.removeClass("active"),b._$searchInputWrap.addClass("msg-input-wrap-hidden"),b._$searchInputText.val(""),b._$searchInputReset.hide(),b.showRooms(),b.parentWidget.resize(),b.newRoom?(b.parentWidget._scroll.animateTo(b.newRoom.position().top),
|
|
b.newRoom=""):b.parentWidget._scroll.restore()):(b.isOn=!0,b._$searchButton.addClass("active"),b.isParentDependent&&b.parentWidget.hideAddInput(),b.parentWidget._scroll.save(),b._$searchInputWrap.removeClass("msg-input-wrap-hidden"),b.parentWidget.resize(),b._$searchInputText.focus())})};TradingView.ChatRoomListSearchFilter.prototype.setRoomList=function(a){this._$data=a};TradingView.ChatRoomListSearchFilter.prototype.hideRooms=function(){this._$data.children().each(function(){$(this).hide()})};
|
|
TradingView.ChatRoomListSearchFilter.prototype.showRooms=function(){this._$data.children().each(function(){$(this).show()})};TradingView.ChatRoomListSearchFilter.prototype.getButton=function(){return this._$searchButton};TradingView.ChatRoomListSearchFilter.prototype.hideInput=function(){this._$searchButton.removeClass("active");this._$searchInputWrap.addClass("msg-input-wrap-hidden");this._$searchInputText.val("");this._$searchInputReset.hide();this.showRooms();this.parentWidget.resize()};
|
|
TradingView.ChatRoomListSearchFilter.prototype.getInputHeight=function(){return this._$searchInputWrap.hasClass("msg-input-wrap-hidden")?0:this._$searchInputWrap.outerHeight()};TradingView.ChatRoomListSearchFilter.prototype.isOpen=function(){return this.isOn};TradingView.ChatRoomListSearchFilter.prototype.setNewRoom=function(a){this.newRoom=a};A12=function(a){this._charWidgetCollection=a.getChartWidgetCollection();this.D4=null;this._views=[];this._headerBinding=[];this._boxesBinding=[];this.$container=$('<div class="chart-data-window"></div>').appendTo(a.$body);this._scroll=new A59(a.$body,this.$container);this.visible=a.visible.value();this._updateSource();this._upadateLayout();this._charWidgetCollection.activeChartWidget.subscribe(this.fullUpdate.bind(this));a.visible.subscribe(this._onVisibilityChange.bind(this));
|
|
this._charWidgetCollection.selectedSource.subscribe(function(a){this.updateHighlight({source:a,updateScroll:!0})}.bind(this));a.setTitle($.t("Data Window"))};
|
|
A12.prototype._updateSource=function(){if(this.visible){this._views=[];this.D4&&(this.D4._dataWindowWidget=null);this.D4=this._charWidgetCollection.activeChartWidget.value();this.D4._dataWindowWidget=this;var a=this.D4.model();if(a)for(var a=a.model().D19(),b=0;b<a.length;b++){var c=a[b].dataWindowView();c&&this._views.push(c)}}};
|
|
A12.prototype._upadateLayout=function(){var a;if(this.visible){this.$container.empty();this._headerBinding=[];for(var b=this._boxesBinding.length-1;0<=b;b--)a=this._boxesBinding[b],a.src.properties().visible.unsubscribe(this,a.visibilityHandler);this._boxesBinding=[];for(b=0;b<this._views.length;++b)a=this._views[b],a.items().size()&&a.header()&&this._bindView(a);this.updateHighlight();this.updateValues();this._scroll.resize()}};
|
|
A12.prototype._bindView=function(a){function b(a){return a?$.t("Hide data"):$.t("Show data")}function c(a){f.toggleClass("hidden",!a.value()).find(".toggle-source-icon").attr("title",b(a))}var d=this,e,f,g;if(a instanceof TradingView.SeriesDataWindowView)e=a._series;else if(a instanceof TradingView.StudyDataWindowView||a instanceof A49)e=a.D1;else return;f=$('<div class="box"><div class="chart-data-window-header"><span class="text"></span><div class="hover-source-icon"></div></div><div class="chart-data-window-body"></div></div>').appendTo(d.$container).addClass("with-actions").toggleClass("hidden",
|
|
!e.properties().visible.value()).on("click",function(a){a.preventDefault();d.setSelectedSource(e)}).on("contextmenu",function(a){a.preventDefault();d.D4.readOnly()||d.showContextMenuForSource(e,a)});g=f.find(".chart-data-window-header").on("dblclick",function(){(new TradingView.EditObjectDialog(e,d.D4.model())).show()}).append($('<div class="toggle-source-icon" title="'+b(e.properties().visible.value())+'"></div>').on("click",function(a){a.stopPropagation();a=e.properties().visible.value();
|
|
d.D4.model().setProperty(e.properties().visible,!a,(a?"Hide ":"Show ")+e.title())}));e.properties().visible.subscribe(d,c);d._headerBinding.push({value:a,$el:g.find(".text")});d._boxesBinding.push({view:a,src:e,$el:f,$body:f.find(".chart-data-window-body"),visibilityHandler:c})};A12.prototype.update=function(){this.visible&&(this.updateHighlight(),this.updateValues())};
|
|
A12.prototype.updateHighlight=function(a){var b=(a||{}).source;a=!!(a||{}).updateScroll;if(this.visible&&this.D4&&this.D4.model()){for(var c=this.D4.model().hoveredSource(),b=b||this._charWidgetCollection.selectedSource.value(),d,e=0;e<this._boxesBinding.length;++e){var f=this._boxesBinding[e].src,g=this._boxesBinding[e].$el;if(f){var h=!(!b||f!==b);this._boxesBinding[e].$el.toggleClass("hover",!(!c||f!==c)).toggleClass("active",h);h&&(d=g)}}d&&
|
|
a&&this._scroll.scrollTo(d)}};
|
|
A12.prototype.updateValues=function(){function a(a){return{value:a.value(),title:TradingView.clean(a.title(),!0),color:a.color(),showColorInBox:b._showColorInBox(a.color())}}var b=this,c;if(this.visible){for(var d=0;d<this._boxesBinding.length;++d)c=this._boxesBinding[d],c.$body.html(Mustache.render('{{# items }}<div class="chart-data-window-item"><div class="chart-data-window-item-title">{{ title }}</div><div class="chart-data-window-item-value">{{# showColorInBox }}<div class="real-color" title="\u0421olor line" style="background-color:{{ color }}"></div>{{ value }}{{/ showColorInBox }}{{^ showColorInBox }}<span style="color:{{ color }}">{{ value }}</span>{{/ showColorInBox }}</div></div>{{/ items }}',{items:$.map(c.view.items().toArray(),
|
|
a)}));for(d=0;d<this._headerBinding.length;d++)this._headerBinding[d].$el.html(this._headerBinding[d].value.header()).attr("title",this._headerBinding[d].value.title())}};A12.prototype.fullUpdate=function(){this._updateSource();this._upadateLayout()};A12.prototype._onVisibilityChange=function(a){this.visible=!!a;a&&this.fullUpdate()};
|
|
A12.prototype._showColorInBox=function(a){return a&&20>255-(new TradingView.RGBColor(a)).grayChannel()?!0:!1};A12.prototype.setSelectedSource=function(a){this.D4.model().setSelectedSource(a)};
|
|
A12.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this.setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):TradingView.isInherited(a.constructor,TradingView.Study)&&this._studyContextMenu(a).show(b))};
|
|
A12.prototype._seriesContextMenu=function(a,b){var c=this.D4.actions(),d=a.properties().visible.value(),d=[c.format,d?c.seriesHide:this.createActionShow(a)];a!=this.D4.model().mainSeries()&&d.push(c.seriesRemove);return TradingView.ContextMenu.createMenu(d)};
|
|
A12.prototype._studyContextMenu=function(a,b){var c=this.D4.actions(),d=a.properties().visible.value();return TradingView.ContextMenu.createMenu([c.format,d?c.studyHide:this.createActionShow(a),c.studyRemove])};
|
|
A12.prototype.createActionShow=function(a){var b=new TradingView.Action({checkable:!0,text:$.t("Show"),enabled:!0});b._binding=new D14(b,a.properties().visible,this.D4.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};$(function(){var a=function(){function a(){l&&(clearTimeout(l),l=null)}function b(a){if(!h)return 0;var c=!!h&&jQuery.contains(document.body,h[0]);c||h.css("position","fixed").appendTo(document.body);a=h[a]();c||h.css("position","").detach();return a}var e,f,g,h,k,l,m;return{sendMessage:function(){var a=h.find('[name="message-text"]'),b=String(a.val()).replace(/^\s+|\s+$/g,"");b?(TradingView.messagesWidget.sendMessageToUser(b,f.id),this.close()):a.css("border-color","#E0735E").focus()},isActiveTarget:function(a){return h&&
|
|
g&&g.is(a)},isSameUser:function(a){return(a=a.data())&&f&&a.id==f.id},update:function(b,d){if(this.isActiveTarget(b)||this.isSameUser(b))return a(),this;k&&this.close();f=d||b.data();f.large_badge=!0;f.is_self=f.username==window.user.username;f.current_user_is_staff=window.user.is_staff;f.show_add_status_btn=!window.user.status&&is_authenticated;f.is_realtime=f.is_pro&&"pro_realtime"==f.pro_plan;f.is_premium=f.is_pro&&"pro_premium"==f.pro_plan;f.is_trial=f.is_pro&&"pro_realtime_trial"==f.pro_plan;
|
|
g=b;var l=Mustache.render(TradingView.templates.userlinkPopup,f,TradingView.templates);h=$(l).on("mouseenter",function(){a()}).on("mouseleave",function(a){e||$(a.target).is(".content")||this.close(m||500)}.bind(this));h.find(".userlink").removeClass("userlink");if(!f.is_self&&(g.hasClass("ch-userlink")||g.hasClass("ch-item-userpic"))&&(l=g.closest(".ch-item"),l.length&&!l.data("ch-is-standalone"))){var t=g,l=$('<div class="ignore-ban-wrapper"></div>').appendTo(h.find(".content .username")),v=!!user.ignore_list[f.id],
|
|
w=f.is_staff?null:$('<a href="#" class="ch-ignore-lnk'+(v?" active":"")+'">').text(v?$.t("Unignore"):$.t("Ignore")).click(f,function(a){a.preventDefault();v?$.post("/conversation-ignore/",{user_id:a.data.id,action:"remove"},function(b){b.error?A83.showNotice("Error",b.error):(delete user.ignore_list[a.data.id],h&&(h.find(".ch-ignore-lnk").removeClass("active").text($.t("Ignore")),v=!1),t.trigger("userignorechange",!1))}):A83.showConfirm($.t("Confirm"),$.t("Are you sure you want to ignore messages from __username__?",
|
|
{username:a.data.username}),function(){$.post("/conversation-ignore/",{user_id:a.data.id,username:a.data.username},function(b){b.error?A83.showNotice($.t("Error"),b.error):(user.ignore_list[a.data.id]=a.data.username,t.trigger("userignorechange",!0))})})}),u=!!f.is_banned,x=user.is_staff&&!f.is_staff?$('<a href="#" class="ch-ban-lnk'+(u?" active":"")+'">').text(u?$.t("Unban"):$.t("Ban")).click(f,function(a){a.preventDefault();u?(new TradingView.UnbanUserDialog(f.id,f.username,function(){h&&
|
|
(h.find(".ch-ban-lnk").removeClass("active").text($.t("Ban")),u=!1);t.trigger("userbanchange",!1)})).show():(f.user_id=f.id,(new TradingView.BanUserDialog(null,a.data,{modal:!0},function(){t.trigger("userbanchange",!0)})).show())}):null;w&&w.appendTo(l);w&&x&&$("<span> | </span>").appendTo(l);x&&x.appendTo(l)}return this},setForm:function(){h.on("keyup",function(a){27==a.which&&this.close()}.bind(this)).addClass("form-layout");h.find('[name="message-text"]').focus();h.find("textarea").on("keyup",
|
|
function(a){13==a.which&&a.ctrlKey&&this.sendMessage()}.bind(this));h.find(".message-user.send").on("click",this.sendMessage.bind(this));h.find(".message-user.cancel").on("click",this.close.bind(this));e=!0;return this},open:function(){a();if(k||!h)return e&&h.css({top:.45*$(window).height()+$(document).scrollTop(),left:""}),this;h&&jQuery.contains(document.body,h[0])||h.css("position","fixed").appendTo(document.body);var l=0,m=0,r=b("width"),l=b("height");e?(l=.45*$(window).height()+$(document).scrollTop(),
|
|
m=""):(l=g.offset().top-l,0>l-$(document).scrollTop()&&(l=g.offset().top+g.height()),m=g.offset().left-20,m+r>$(window).width()&&(m=$(window).width()-r));h.css({position:"",top:l,left:m}).hide().fadeIn("fast",function(){e&&h.find('[name="message-text"]').focus();f.btc_address&&new TradingView.CoinWidget(f.btc_address,h.find(".btc-tip"),"br")});k=!0;return this},close:function(b){if(b&&"number"==typeof b)return l=setTimeout(this.close,b),m=b,this;a();if(!k)return this;h.remove();h=g=f=null;k=e=!1;
|
|
return this},isForm:function(){return e}}}(),b;TradingView.userLinkPopup=a;TradingView.openPMDialog=function(b,d,e,f){var g=$({});a.update(g,{id:b,username:d}).setForm().open();e&&f&&a.setText($.t({not_suggested:"Hi,\n\nI'm a moderator for TradingView. I reviewed your idea at __chart__ and had to mark it as \"Not Suggested\" because it doesn't comply with our House Rules https://www.tradingview.com/house-rules/.\n\nPay attention to these rules to get into the Suggested stream more often, or even become a Suggested Author. Please let me know if you have any questions, will be happy to help."}[e],
|
|
f))};TradingView.noteForAuthor=function(a,b,e){TradingView.openPMDialog(a,b,"not_suggested",{chart:window.location.protocol+"//"+window.location.host+e})};$(document).on("mouseenter",".userlink, .ch-userlink, .ch-item-userpic",function(){if(!R77.enabled("disable_userlink_popup")&&!a.isForm()){var c=$(this);if(a.isActiveTarget(c))a.open();else{var d="/u/"+(c.data("username")||c.text())+"/info/",e={type:"POST",success:function(b){b&&!b.error&&a.update(c,b).open()}};if($.browser.msie||/\btrident\b/i.test(navigator.userAgent))e.cache=
|
|
!1;b=$.ajax(d,e)}}}).on("mouseleave",".userlink, .ch-userlink, .ch-item-userpic",function(){a.isForm()||(b&&b.abort(),a.close(500))}).on("click","button.message-user.message, button.profile-action.profile-message",function(){var b=$(this);runOrSignIn(function(){a.update(b).setForm().open()})})});A60=function(a,b,c,d){var e=this;this._options=d||{};this._readonly=!!this._options.readonly;this._container=a;this._chart=b;this._panes=c;this._pane_header_height=34;this._hidden_panes_count=0;this.prepareLayout();setInterval(function(){e.paint()},66)};
|
|
A60.prototype.prepareLayout=function(){var a=this;this._widget=$('<div class="chart-sidebar">').appendTo(this._container);this._widget.toggleClass("hidden",void 0!==this._options.hidden?this._options.hidden:TVSettings.getBool("sidebar.hidden",!1));this._separator=$('<div class="separator"><div class="separator-bar"><div class="separator-icon"></div></div></div>').appendTo(this._widget);this._separator.click(function(){a._widget.toggleClass("hidden");a._readonly||TVSettings.setValue("sidebar.hidden",
|
|
a._widget.is(".hidden"));$(window).resize()});this._panes.forEach(function(b,c){void 0===b.ratio&&(b.ratio=TVSettings.getFloat("sidebar.pane."+b.id+".ratio",1));void 0===b.state&&(b.state=TVSettings.getBool("sidebar.pane."+b.id+".state",!0),this._hidden_panes_count+=b.state?0:1);b.$pane=$('<div class="chart-sidebar-pane">').addClass("tv-"+b.id).appendTo(this._widget);b.$header=$('<div class="header"><span class="icon"></span><span class="title">'+b.title+"</span></div>").click(function(){b.state=
|
|
!b.state;a._readonly||TVSettings.setValue("sidebar.pane."+b.id+".state",b.state);a._hidden_panes_count+=b.state?-1:1;a.resize()}).appendTo(b.$pane);b.index=c;b.$container=$('<div class="container">').appendTo(b.$pane);b.widgetObject=new b.widget(b.$container,this._chart,b.options);c<this._panes.length-1&&$('<div class="chart-sidebar-vseparator"><div class="handle"></div></div>').on("mousedown touchstart",function(b){var c=$(this),f=c.prevAll(".chart-sidebar-pane:not(.minimized)").first(),g=c.nextAll(".chart-sidebar-pane:not(.minimized)").first();
|
|
if(!f.length||!g.length)return!1;a._drag_start=b.pageY||b.originalEvent.pageY||b.originalEvent.touches&&b.originalEvent.touches[0].pageY||0;a._drag_prev_h=f.height();a._drag_next_h=g.height();$(window).on("mousemove.sidebarDrag touchmove.sidebarDrag",function(b){b=(b.pageY||b.originalEvent.pageY||b.originalEvent.touches&&b.originalEvent.touches[0].pageY||0)-a._drag_start;f.height(a._drag_prev_h+b).data("paneObj").widgetObject.resize();g.height(a._drag_next_h-b).data("paneObj").widgetObject.resize()});
|
|
$(window).one("mouseup touchend",function(b){$(window).unbind("mousemove.sidebarDrag touchmove.sidebarDrag");var d=c.prevAll(".chart-sidebar-pane:not(.minimized)").first();b=c.nextAll(".chart-sidebar-pane:not(.minimized)").first();var f=(a._widget.height()-a._hidden_panes_count*a._pane_header_height-(a._panes.length-1))/(a._panes.length-a._hidden_panes_count),g=(d.height()+a._pane_header_height)/f,d=d.data("paneObj");d.ratio=g;f=(b.height()+a._pane_header_height)/f;d=b.data("paneObj");d.ratio=f;a.resize()});
|
|
b.preventDefault()}).appendTo(this._widget);b.$pane.data("paneObj",b)},this);$(window).resize(function(){a.resize()});this.resize()};A60.prototype.normalizeRatios=function(){var a=this,b=this._panes.length-this._hidden_panes_count,c=0,d=0;this._panes.forEach(function(a){a.state&&(c+=a.ratio)});d=(c-b)/b;this._panes.forEach(function(b){b.state&&(b.ratio-=d,a._readonly||TVSettings.setValue("sidebar.pane."+b.id+".ratio",b.ratio.toFixed(2)))})};
|
|
A60.prototype.resize=function(){this.normalizeRatios();var a=(this._widget.height()-this._hidden_panes_count*this._pane_header_height-(this._panes.length-1))/(this._panes.length-this._hidden_panes_count);this._panes.forEach(function(b,c){b.state?b.$pane.height(a*b.ratio-this._pane_header_height):b.$pane.height(0);b.widgetObject.resize(!0);b.$pane.toggleClass("minimized",!b.state);b.$container.trigger("paneStateChange",[b.state])},this)};
|
|
A60.prototype.getPaneIndexById=function(a){for(var b=0;b<this._panes.length;b++)if(this._panes[b].id===a)return b;return null};A60.prototype.getPaneById=function(a){a=this.getPaneIndexById(a);return null===a?null:this._panes[a]};A60.prototype.highlightPane=function(a,b,c){this._panes[a].$header.highlight(b,c)};A60.prototype.highlightWidget=function(a,b,c){this.highlightPane(this.getPaneIndexById(a),b,c)};
|
|
A60.prototype.paint=function(){this._panes.forEach(function(a,b){a.widgetObject.paint&&a.widgetObject.paint()},this)};A60.prototype.setPaneState=function(a,b,c){a&&(a.state=!!b,b=c&&c.doNotSave,this._readonly||b||TVSettings.setValue("sidebar.pane."+a.id+".state",a.state),this._hidden_panes_count=this._panes.filter(function(a){return!a.state}).length,this.resize())};
|
|
A59=function(a,b,c){var d=this;this._options=$.extend({},this._defaultOptions,c||{});this._$wrapper=a;this._$content=b;this._scroll_speed=40;this._shadow_offset=10;this._header_height=this._options.headerHeight;this.scrolled=new Delegate;this.scrolltoend=new Delegate;this.scrolltostart=new Delegate;(this._touch=Modernizr.touch||navigator.msMaxTouchPoints)?(this._$content.css("position","relative"),this._$wrapper.css({"overflow-y":"scroll","-webkit-overflow-scrolling":"touch",
|
|
"-ms-overflow-style":"-ms-autohiding-scrollbar"}).scroll(this._onScroll.bind(this))):(this._$wrapper.css("overflow","hidden"),this._$wrapper.mouseenter(function(){d._bottomFixed||d._dragging||(d._options.alwaysVisible||d._$scrollBar.addClass("active"),d._onScroll())}).mouseleave(function(){d._bottomFixed||d._dragging||(d._options.alwaysVisible||d._$scrollBar.removeClass("active"),d._onScroll())}).mousewheel(function(a,b){if(!a.isDefaultPrevented())return d.scroll(b)}),this._$shadowTop=$('<div class="sb-inner-shadow top">').appendTo(this._$wrapper),
|
|
this._$shadowTop.hide(),this._$shadowBottom=$('<div class="sb-inner-shadow">').appendTo(this._$wrapper),this._header_height&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),a=this._options.additionalClass?" "+this._options.additionalClass:"",b=this._options.alwaysVisible?" active-always":"",this._$scrollBarWrapper=$('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper),this._$scrollBar=$('<div class="sb-scrollbar sb-scrollbar-body'+a+b+'"></div>').appendTo(this._$scrollBarWrapper),
|
|
this._onScroll())};A59.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0};A59.prototype.initDraggable=function(){if(this._dragInitialized)return this;var a=this;this._$wrapper.offset();this._$scrollBar.draggable({axis:"y",containment:this._$scrollBarWrapper,start:function(){a._dragging=!0},stop:function(){a._dragging=!1},drag:function(b,c){a.updateScroll()}});this._dragInitialized=!0;return this};
|
|
A59.prototype.updateScroll=function(){if(this._touch)return this;var a=Math.ceil(this._$scrollBar.position().top-1-this._header_height),b=this._$wrapper.height()-this._header_height,c=this._$content.height();if(0>=b)return this;this._scroll_target_top=0>=c-b-1?this._header_height:-a*c/b+this._header_height;a+this._$scrollBar.height()+2>=b?this.scrollToEnd():(this._$content.css("top",this._scroll_target_top+"px"),this._onScroll());return this};
|
|
A59.prototype.updateScrollBar=function(){if(this._touch)return this;var a=this._$content.position().top,b=this._$content.height(),c=this._$wrapper.height(),d=c-this._header_height,e=1+this._header_height,f=d-2,a=(Math.abs(a)-this._header_height)*f/b,c=c*c/b;b<d?(this._$scrollBar.hide(),this._$wrapper.removeClass("sb-scroll-active")):(this._$scrollBar.show().height(c).css("top",e+a),this._$wrapper.addClass("sb-scroll-active"),this.initDraggable());return this};
|
|
A59.prototype.scroll=function(a,b){if(this._touch)return this;var c=this._$content.position().top,d=this._$content.height(),e=this._$wrapper.height()-this._header_height,d=d-e-1;if(0>=d)return!0;this._scroll_target_top=Math.max(-d+this._header_height,Math.min(this._header_height,c+a*(b||this._scroll_speed)));this.setContentTop(this._scroll_target_top);this._onScroll();return!1};
|
|
A59.prototype.animateTo=function(a){if(this._touch)return this;this._$content.position();var b=this._$content.height(),c=this._$wrapper.height()-this._header_height,b=b-c-1;if(0>=b)return!0;this._scroll_target_top=Math.max(-b+this._header_height,Math.min(this._header_height,-a));this._$content.animate({top:this._scroll_target_top},500,function(){this._onScroll()}.bind(this))};
|
|
A59.prototype.resize=function(){if(!this._bottomFixed){this._$content.position();var a=this._$content.height(),b=this._$wrapper.height();!this._options.vAlignBottom&&a<b?this.atStart()||this.scrollToStart():this.atEnd()?this.scrollToEnd():"number"==typeof this._stickyBottom&&this.setContentTop(Math.min(0,this._stickyBottom+this._$wrapper.height()-this._$content.height()))}};
|
|
A59.prototype.resizeHeader=function(a){var b=a-this._header_height;this._header_height=a;this._scroll_target_top+=b;this._$shadowTop&&this._$shadowTop.css("top",this._header_height-this._shadow_offset);this.resize()};
|
|
A59.prototype.scrollTo=function(a,b){b=$.extend({position:"visible",areaHeight:a instanceof $?a.height():0},b);a instanceof $&&(a=a.position().top);var c=this._$content.position().top,d=this._$content.height(),e=this._$wrapper.height()-this._header_height;if(0>=d-e-1)return!0;c=-1*(c-this._header_height);e=c+e;d=0;if("visible"==b.position){if(a>c&&a+b.areaHeight<e)return!1;d=a+b.areaHeight>e?e-a-b.areaHeight:c-a}else"top"==b.position&&(d=c-a);this.scroll(d,1);this._onScroll();
|
|
return!1};A59.prototype.scrollToEnd=function(){var a=this._$content.position().top,b=this._$content.height(),c=this._$wrapper.height();this.setContentTop(a+(c-(b+a))+1);this._onScroll();return this};A59.prototype.scrollToStart=function(){this.setContentTop(this._header_height);this._onScroll();return this};A59.prototype.atStart=function(){return Math.round(this._$content.position().top)>=this._header_height};
|
|
A59.prototype.atEnd=function(a){"number"==typeof a&&isFinite(a)||(a=0);var b=this._$content.position().top,c=this._$content.height(),d=this._$wrapper.height();return c-Math.abs(b)-1<=d+a};
|
|
A59.prototype._onScroll=function(a){this._touch||this._$content.css("bottom","auto");this.scrolled.fire();this._dragging&&!0!==a||this.updateScrollBar();a=this.atStart();var b=this.atEnd();this._$shadowTop&&this._$shadowTop.toggle(!a);this._$shadowBottom&&this._$shadowBottom.toggle(!b);!this._atStart&&a?(this._atStart=!0,this.scrolltostart.fire()):this._atStart&&!a&&delete this._atStart;!this._atEnd&&b?(this._atEnd=!0,this.scrolltoend.fire()):this._atEnd&&!b&&delete this._atEnd;
|
|
this._options.vAlignBottom&&(this._stickyBottom=this._$content.height()-Math.abs(this._$content.position().top)-this._$wrapper.height())};A59.prototype.save=function(){this._saved={top:this._$content.position().top,height:this._$content.height()};return this};
|
|
A59.prototype.restore=function(){if(this._saved){if(this._saved.top==this._$content.position().top&&this._saved.height==this._$content.height())return delete this._saved,this;this._options.vAlignBottom&&(this._saved.top-=this._$content.height()-this._saved.height,this._saved.top>this._header_height&&(this._saved.top=this._header_height));this.setContentTop(this._saved.top);delete this._saved;this._onScroll(!0)}return this};
|
|
A59.prototype.fixBottom=function(){if(this._bottomFixed)return this;if(this._touch){var a=this._$content.height(),b=this._$wrapper.scrollTop();this._tempIntervalID=setInterval(function(){this._$wrapper.scrollTop(b+(this._$content.height()-a))}.bind(this),0)}else this._$content.css({top:"auto",bottom:this._$wrapper.height()-this._$content.position().top-this._$content.height()});this._bottomFixed=!0;return this};
|
|
A59.prototype.releaseBottom=function(){if(!this._bottomFixed)return this;this._touch?clearInterval(this._tempIntervalID):this._$content.css({top:this._$content.position().top,bottom:"auto"});delete this._bottomFixed;this._onScroll();return this};
|
|
A59.prototype.setContentTop=function(a){this._touch?this._options.vAlignBottom&&this._$content.height()<this._$wrapper.height()?(this._$wrapper.css("overflow-y","visible"),this._$content.css({position:"absolute",bottom:0})):(this._$content.css({position:"relative",bottom:"auto"}),this._$wrapper.css("overflow-y","scroll"),this._$wrapper.scrollTop(-a)):this._$content.css("top",a);return this};TradingView.SaveLoadWidget=function(a,b,c){function d(){b.metaInfo.name.value()||e._readOnly?e.setTitle(b.metaInfo.name.value()):e.hideTitle()}this._options=c=$.extend({popupDirection:"up",popupReverse:!1},c||{});this.onTitleSizeChanged=new Delegate;this._container=a=$(a);this.D5=b;this._readOnly=b.readOnly();this._savedCharts=[];this._editEnabled=!0;this.loadChartDialog=new TradingView.LoadChartDialog;this.renameChartDialog=new TradingView.RenameChartDialog;this._load=$('<span class="load button first apply-common-tooltip"></span>').append($('<svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-download"></use><description>Load</description></svg>')).attr("title",
|
|
$.t("Load Chart Layout")).click(this.signInOrLoadChart.bind(this)).appendTo(a);this._title=$('<span class="title apply-common-tooltip"></span>');c.hideChartTitle&&this._title.hide();this._sep=$("<span>").addClass("separator");this._optionsMenu=$('<span class="button with-arrow options last">').append($("<span>").addClass("arrow-icon"));TradingView.bindPopupMenu(this._optionsMenu,this._getSavedCharts.bind(this),{direction:c.popupDirection,reverse:c.popupReverse,notCloseOnButtons:!0,popupSpacing:c.popupSpacing});
|
|
this._readOnly?(this._save=$(),this._copy=$('<span class="copy">'+$.t("Copy")+"</span>").appendTo(a).click($.proxy(this,"cloneChart")),this._title.addClass("read-only"),this._titleReadOnly=$("<span>").addClass("read-only").appendTo(this._title),this._sep.appendTo(this._copy),this._optionsMenu.hide()):(c=$.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout"),this._save=$('<span class="save button apply-common-tooltip"></span>').attr("title",
|
|
c).append($('<svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-upload"></use><description>Save</description></svg>')).appendTo(a).click($.proxy(this,"signInOrSaveChart")),this._copy=$(),this._titleInput=$('<span type="text" maxlength="80">').appendTo(this._title),this._title.bind("click",$.proxy(this,"_renameChart")),this._title.attr("title",$.t("Rename Chart Layout")),this._titleSize=$('<span class="sizer">').appendTo(this._title),this._sep.appendTo(this._save));this._title.appendTo(a);
|
|
this._optionsMenu.appendTo(a);this._savecopy=$().add(this._save).add(this._copy).mousedown(function(a){if(a.button)return!1;this._save.addClass("active")}.bind(this)).mouseup(function(){this._save.removeClass("active")}.bind(this));var e=this;b.metaInfo.name.subscribe(function(){d()});d();loginStateChange.subscribe(this,this._refreshSavedChartsList);TVXWindowEvents.on("saved-charts-change",$.proxy(this._otherTabUpdated,this));TVXWindowEvents.on("saved-charts-change-favorites",$.proxy(this._favoritesUpdated,
|
|
this));A77.undoStack().onChange().subscribe(this,function(){if(!A77.undoStack().isEmpty()){var a=A77.undoStack().head().text();if("scroll"==a||"scale time"==a)return}this._setChanges(!0);this.autosave()});TradingView.keyboardBinder.registerListener("LoadChartDialogHotkey",function(a){return a.ctrlKey?!1:"46"==a.which&&$(a.target).is("body")?(this.loadMenu(),a.preventDefault(),a.stopPropagation(),!0):!1}.bind(this));this.favorites=TVSettings.getJSON(TradingView.SaveLoadWidget.FAVORITES_KEY,
|
|
{})};TradingView.SaveLoadWidget.FAVORITES_KEY="loadChartDialog.favorites";TradingView.SaveLoadWidget.prototype._favoritesUpdated=function(a){this.favorites=JSON.parse(a);this.loadChartDialog.updateFavoritesData(this.favorites)};TradingView.SaveLoadWidget.prototype._otherTabUpdated=function(a){this._savedCharts=JSON.parse(a);this.loadChartDialog.updateChartsData(this._getLoadMenuCharts())};
|
|
TradingView.SaveLoadWidget.prototype._renameChart=function(){var a=this;a._editEnabled&&this.renameChartDialog.show(this.getTitle()).then(function(b){a.setTitle(b);a.saveChart()})};
|
|
TradingView.SaveLoadWidget.prototype._setTitle=function(a){this._titleInput.text(a);this._titleValue=a;this._savecopy.removeClass("last").addClass("titled");a?this._options.hideChartTitle||(this._optionsMenu.show(),this._title.show()):(this._optionsMenu.hide(),this._title.hide(),this._savecopy.addClass("last").removeClass("titled"));this._setInputSuze();this._setChanges(!0)};
|
|
TradingView.SaveLoadWidget.prototype._setReadOnlyTitle=function(a){this._titleReadOnly.html(a).attr("title",a.replace(/<[^>]+>/g,""));this._savecopy.removeClass("last").addClass("titled");this._title.addClass("last");this._options.hideChartTitle||this._title.show()};
|
|
TradingView.SaveLoadWidget.prototype.setTitle=function(a){if(this._readOnly){var b=TradingView.clean(this.D5.metaInfo.username.value());a=(a?a+": ":"")+"view-only chart by "+'<a href="/u/%1">%1</a>'.replace(/%1/g,b);this._setReadOnlyTitle(a)}else this._setTitle(a)};TradingView.SaveLoadWidget.prototype.hideTitle=function(){this._title.hide();this._optionsMenu.hide();this._titleInput.text("");this._savecopy.removeClass("titled").addClass("last")};
|
|
TradingView.SaveLoadWidget.prototype.getTitle=function(){return this._titleValue};TradingView.SaveLoadWidget.prototype._setInputSuze=function(){this._titleSize.text(this._titleInput.text());this._titleInput.width(this._titleSize.width());this.onTitleSizeChanged.fire()};
|
|
TradingView.SaveLoadWidget.prototype.cloneChart=function(){var a=this;R77.enabled("save_old_chart_before_save_as")&&this.D5.metaInfo.id.value()&&this._saveChart();(new TradingView.RenameChartDialog($.t("Copy Chart Layout"))).show($.t("{0} copy").format(a.D5.metaInfo.name.value())).then(function(b){R77.enabled("saved_charts_count_restriction")&&!user.is_pro&&5<=a._savedCharts.length?A83.showGoProDialog({feature:"savedChartsLimit"}):R77.enabled("saveload_storage_customization")?
|
|
(a.D5.metaInfo.uid.setValue(void 0),a.D5.metaInfo.id.setValue(void 0),a.setTitle(b),a.saveChart()):window.open("/chart/?clone="+a.D5.metaInfo.uid.value()+"&name="+encodeURIComponent(b),"_blank")}.bind(this))};TradingView.SaveLoadWidget.prototype._setChanges=function(a){this._haveChanges=a=!!a;!a&&this.getTitle()?this._save.addClass("no-change"):this._save.removeClass("no-change")};
|
|
TradingView.SaveLoadWidget.prototype._process=function(a){a?this._save.addClass("process"):this._save.removeClass("process")};
|
|
TradingView.SaveLoadWidget.prototype._saveChart=function(a,b){if(!this._readOnly&&!this._saving&&this._haveChanges){var c=function(){this._saving=!1;this._process(!1);this._editEnabled=!0;clearTimeout(this._saveTimeout)}.bind(this);this._saving=!0;this._process(!0);this._editEnabled=!1;this._saveTimeout=setTimeout(c,7E3);try{window.saver.saveChartSilently(function(){c();this._setChanges(!1);"function"==typeof a&&a.call(this)}.bind(this),null,function(){c();"function"==typeof b&&b.call(this)})}catch(d){c(),
|
|
"undefined"!=typeof console&&console.log&&console.log("Error while saving",d)}}};TradingView.SaveLoadWidget.prototype._autosaveInterval=6E4;TradingView.SaveLoadWidget.prototype.autosave=function(){R77.enabled("charts_auto_save")&&(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){this.D5.metaInfo.id.value()&&this._saveChart()}.bind(this),this._autosaveInterval))};
|
|
TradingView.SaveLoadWidget.prototype._goChartPage=function(a){"/chart/"==location.pathname&&(location.href="/chart/"+a+(TradingView.isMobileView?"?mobile=1":""))};
|
|
TradingView.SaveLoadWidget.prototype.saveChart=function(){var a=this.getTitle();a?(this.D5.metaInfo.name.setValue(a),this._saveChart(function(){TradingView.trackEvent("GUI","Save Chart Layout");this._goChartPage(this.D5.metaInfo.uid.value());"undefined"!=typeof TradingView.UaTitleManager&&TradingView.UaTitleManager.instance&&TradingView.UaTitleManager.instance.updateView();this._refreshSavedChartsList()}.bind(this),function(){this.D5.metaInfo.name.setValue("");
|
|
this.setTitle("")}.bind(this))):TradingView.showChartNameDialog(function(a){this.setTitle(a);this.saveChart()}.bind(this),void 0,$.t("Chart layout name"),64)};TradingView.SaveLoadWidget.prototype.signInOrSaveChart=function(){R77.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"saveChart")):this.saveChart()};TradingView.SaveLoadWidget.prototype.signInOrLoadChart=function(){R77.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"loadMenu")):this.loadMenu()};
|
|
TradingView.SaveLoadWidget.prototype.saveChartByEnter=function(a){"13"==a.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())};TradingView.SaveLoadWidget.prototype._refreshSavedChartsList=function(a){R77.enabled("saveload_requires_authentication")&&!is_authenticated?this._savedCharts=[]:TradingView.getSavedChartsList(function(a){this._savedCharts=a;TVXWindowEvents.emit("saved-charts-change",JSON.stringify(a))}.bind(this)).then(function(){TVSettings.getJSON(this._FAV_KEY,[]);a&&a()})};
|
|
TradingView.SaveLoadWidget.prototype._getSavedChartsList=function(){return this._savedCharts};TradingView.SaveLoadWidget.prototype._fastDelete=function(a,b){this._savedCharts.splice(b,1);a==this.D5.metaInfo.id.value()&&(R77.enabled("saveload_storage_customization")?(this.D5.clearChartMetaInfo(),this.setTitle(void 0)):location.href="/chart/")};
|
|
TradingView.SaveLoadWidget.prototype._getSavedCharts=function(){var a=[];this.isSaved()&&a.push({title:this.getTitle(),disabled:!0,addClass:"save-load-chart-title"});if(!this._readOnly&&(a.push({title:$.t("Save Chart Layout"),action:this.signInOrSaveChart.bind(this)}),this.isSaved()&&(a.push({title:$.t("Save As..."),action:this.cloneChart.bind(this)}),a.push({title:$.t("Rename..."),action:this._renameChart.bind(this)})),!R77.enabled("charting_library_base"))){var b=new TradingView.bindPopupMenu.Group;
|
|
b.push({addClass:"button-new",title:$.t("Load"),action:this.loadMenu.bind(this)});b.push({addClass:"button-load",title:$.t("New"),action:this.loadChartDialog.openNewChart.bind(this.loadChartDialog)});a.push(b)}return a};TradingView.SaveLoadWidget.prototype.isSaved=function(){return!!this.getTitle()};
|
|
TradingView.SaveLoadWidget.prototype._getLoadMenuCharts=function(){var a=[],b=this,c=this._getSavedChartsList();c.length&&$.each(c,function(c,e){a.push({id:e.id,title:e.name,symbol:e.short_symbol,interval:e.interval,toolsCount:0,modified:e.modified_iso,active:function(){return e.id==b.D5.metaInfo.id.value()},openAction:function(){TradingView.openSavedChart(e)},deleteAction:function(a){TradingView.deleteChart(e.image_url,function(){b._fastDelete(e.id,c);TVXWindowEvents.emit("saved-charts-change",
|
|
JSON.stringify(b._savedCharts));a.resolve()})},favoriteAction:function(a){b.favorites=a;TVSettings.setJSON(TradingView.SaveLoadWidget.FAVORITES_KEY,a);TVXWindowEvents.emit("saved-charts-change-favorites",JSON.stringify(a))}})});return a};TradingView.SaveLoadWidget.prototype.loadMenu=function(){var a=this;this._load.addClass("process");this._refreshSavedChartsList(function(){a._load.removeClass("process");a.loadChartDialog.show(a._getLoadMenuCharts(),a.favorites)})};A9=function(a,b,c){this._chart=a;this._parent=b;this.zoom_active=!1;this._real=c;this._state="stop";this.init();c&&this.initToRealChart();this.initHandlers()};
|
|
A9.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent);$('<div class="control-bar">').append(svgAsset("left",{"class":"move-left-button-control-bar"})).append(svgAsset("minus",{"class":"zoom-out-right-button-control-bar"})).append(svgAsset("restore",{"class":"turn-button-control-bar"})).append(svgAsset("plus",{"class":"zoom-in-button-control-bar"})).append(svgAsset("right",{"class":"move-right-button-control-bar"})).appendTo(this._widget);
|
|
this._buttons={zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")}};
|
|
A9.prototype.initToRealChart=function(){var a=this;this._back=$(svgAsset("right-stop",{"class":"back-to-present hidden"})).appendTo(this._parent);this._back.on("click",function(){a._chart.model().timeScale().scrollToRealtime(!0);a._chart.model().model()._invalidateHandler(new A22(A22.FULL_UPDATE))});var b=function(){var b=a._chart.maxRhsPriceAxisWidth+4;b&&a._back.css("marginRight",b)};this._chart.rhsPriceAxisWidthChanged.subscribe(this,
|
|
b);b();this._chart.withModel(this,function(){this._chart.model().model().setInterval(function(){a.check()},1E3)})};A9.prototype.check=function(){this._chart.model()&&0>this._chart.model().timeScale().rightOffset()?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present hidden")};
|
|
A9.prototype._move=function(a){"stop"==this._state&&this._chart.model().beginUndoMacro(1==a?"Move Left":"Move Right");this._state="moving";this._moveType="animated";this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0);this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0);this._startTime=+new Date;if(!this._movingTimeout){var b=this._startTime;this._movingTimeout=setTimeout(function d(){this._moveStep.call(this,
|
|
b,0,50*a,1E3);this._movingTimeout=setTimeout(d.bind(this),10)}.bind(this),10)}};A9.prototype._moveStep=function(a,b,c,d){if(!this._chart.model().timeScale().isEmpty())return a=1-(Math.max(0,a+d-+new Date)/d||0),1>a&&(d=jQuery.easing.easeOutCubic(null,d*a,0,1,d),this.currentDistance=(c-b)*d+b),this._chart.model().scrollChart(this.currentDistance),a};
|
|
A9.prototype._finishMove=function(a){clearTimeout(this._movingTimeout);this._deferredFinishTimeout=this._movingTimeout=0;var b=this.currentDistance,c=+new Date;this._finishingTimeout=setTimeout(function e(){1>this._moveStep.call(this,c,b,0,700)?this._finishingTimeout=setTimeout(e.bind(this),10):(this._state="stop",this._moveType="",this.currentDistance=this._movingTimeout=0,this._chart.model().endUndoMacro())}.bind(this),10)};
|
|
A9.prototype._stopMove=function(a){"moving"==this._state&&(this._state="wait_finishing",200>(new Date).getTime()-this._startTime?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())};
|
|
A9.prototype._moveByBar=function(a){"stop"==this._state&&this._chart.model().beginUndoMacro(1==a?"Move Left":"Move Right");var b=this._chart.model().timeScale(),c=b.indexToCoordinate(b.visibleBars().lastBar())+b.barSpacing()/2;Math.abs(b.width()-c)>b.barSpacing()/6&&this._chart.model().scrollChart(b.width()-c);this._state="moving";this._moveType="by_bar";this._startTime=+new Date;if(!this._movingTimeout){var d=150,e=0;this._movingTimeout=setTimeout(function g(){this._moveByBarStep(a);
|
|
e++;100<d&&(d-=e/5*20);this._movingTimeout=setTimeout(g.bind(this),d)}.bind(this),400);this._moveByBarStep(a)}};A9.prototype._moveByBarStep=function(a){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(a)};A9.prototype._stopMoveByBar=function(a){"moving"==this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this.currentDistance=this._movingTimeout=0,this._chart.model().endUndoMacro())};
|
|
A9.prototype.initHandlers=function(){var a=this._chart;$(".control-bar span");var b=Modernizr.touch?"touchstart":"mousedown",c=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(b,this._moveByBar.bind(this,1));this._buttons.moveLeft.on(c,this._stopMoveByBar.bind(this,1));this._buttons.moveRight.on(b,this._moveByBar.bind(this,-1));this._buttons.moveRight.on(c,this._stopMoveByBar.bind(this,-1));this._buttons.turn.on("click",function(){a.GUIResetScales()});
|
|
this._buttons.zoomOut.on("click",function(){a.model()&&a.model().zoomOut()});this._buttons.zoomIn.on("click",function(){a.model()&&a.model().zoomIn()});var d={};$("body").on("keydown",function(a){if(!($(a.target).closest("input, textarea").length||a.which in d))switch(d[a.which]=!0,a.which){case 37:a.ctrlKey||a.altKey?this._move(1):this._moveByBar(1);a.preventDefault();break;case 39:a.ctrlKey||a.altKey?this._move(-1):this._moveByBar(-1),a.preventDefault()}}.bind(this)).on("keyup",function(a){if(!$(a.target).closest("input, textarea").length)switch(delete d[a.which],
|
|
a.which){case 37:case 39:"by_bar"==this._moveType?this._stopMoveByBar():this._stopMove()}}.bind(this))};TradingView.SeriesControlWidget=function(){function a(a){var c=this,d=this.D4=a.D3;this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(a.parent);d.onWidget()||R77.enabled("charting_library_base")?this._$extendedHoursButton=null:this._$extendedHoursButton=$(document.createElement("a")).text($.t("ext")).attr("title",$.t("The Extended Trading Hours feature is available only for intraday charts")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);
|
|
this._$percButton=$(document.createElement("a")).text("%").attr("title",$.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$logButton=$(document.createElement("a")).text($.t("log")).attr("title",$.t("Toggle Log Scale")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$autoScaleButton=$(document.createElement("a")).text($.t("auto",{context:"scale"})).attr("title",$.t("Toggle Auto Scale")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);
|
|
var e=$(document.createElement("a")).attr("title",$.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);this._$fullscreenChartButton=$(document.createElement("a")).attr("title",$.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls);var f=$(document.createElementNS("http://www.w3.org/2000/svg","svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"});$(document.createElementNS("http://www.w3.org/2000/svg",
|
|
"desc")).text("SP").appendTo(f);$(document.createElementNS("http://www.w3.org/2000/svg","path")).attr({d:"M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"}).appendTo(f);
|
|
e.append(f);f=$(document.createElementNS("http://www.w3.org/2000/svg","svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"});f.get(0).setAttribute("viewBox","0 0 24 24");$(document.createElementNS("http://www.w3.org/2000/svg","desc")).text("FS").appendTo(f);$(document.createElementNS("http://www.w3.org/2000/svg","path")).attr({d:"M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z"}).appendTo(f);
|
|
this._$fullscreenChartButton.append(f);this._$percButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries(),c=b.priceScale(),e=c.properties();b.properties().lockScale.value()||(a.beginUndoMacro($.t("Toggle Percentage")),e.log.value()&&a.setLogProperty(e.log,!1,c,$.t("Toggle Log Scale")),a.setPercentProperty(e.percentage,!e.percentage.value(),c,$.t("Toggle Percentage")),a.endUndoMacro())});this._$logButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries(),
|
|
c=b.priceScale(),e=c.properties();b.properties().lockScale.value()||(a.beginUndoMacro($.t("Toggle Log Scale")),e.percentage.value()&&a.setPercentProperty(e.percentage,!1,c,$.t("Toggle Percentage")),a.setLogProperty(e.log,!e.log.value(),c,$.t("Toggle Log Scale")),a.endUndoMacro())});this._$autoScaleButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries().priceScale(),c=b.properties();a.beginUndoMacro($.t("Toggle Auto Scale"));c.autoScale.value()&&c.percentage.value()&&a.setPercentProperty(c.percentage,
|
|
!1,b,$.t("Toggle Percentage"));a.setAutoScaleProperty(c.autoScale,!c.autoScale.value(),b,$.t("Toggle Auto Scale"));a.endUndoMacro()});e.on("click",function(a){a.preventDefault();e.addClass("active");d.showScalesProperties().on("remove",function(){e.removeClass("active")})});if(this._$extendedHoursButton)this._$extendedHoursButton.on("click",function(a){a.preventDefault();a=d.model();var b=a.mainSeries().properties().extendedHours;a.setProperty(b,!b.value(),"Extended Hours")});this._$dateRanges=$(document.createElement("div")).attr("class",
|
|
"chart-controls-bar-buttons date-range-wrapper").appendTo(a.parent);d.withModel(null,function(){var a=d.model().mainSeries(),b=a.priceScale();c.updateScaleButtons();a.priceScaleChanged.subscribe(c,c.updateScaleButtons);b.properties().autoScale.subscribe(c,c.updateScaleButtons);c.updateDateRangeButtons();a.onStatusChanged().subscribe(c,c.updateDateRangeButtons);R77.enabled("update_timeframes_set_on_symbol_resolve")&&a.onSymbolResolved().subscribe(c,c.updateDateRangeButtons);a.properties().lockScale.subscribe(c,
|
|
c.updateDateRangeButtons);c.updateExtendedHoursButton();a.properties().extendedHours.subscribe(c,c.updateExtendedHoursButton);a.properties().interval.subscribe(c,c.updateExtendedHoursButton)});c.updateFullscreenChartButton();var g=this.D4.D5;g&&(g.layout.subscribe(this.updateFullscreenChartButton.bind(this)),g.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)),this._$fullscreenChartButton.on("click",function(){g.activeChartWidget.setValue(d);
|
|
g.maximizeCurrentChart.setValue(!g.maximizeCurrentChart.value())}))}a.prototype.updateScaleButtons=function(){var a=this.D4.model().mainSeries().priceScale().properties(),c=a.log.value(),d=a.percentage.value(),a=a.autoScale.value();this._$logButton.toggleClass("active",c);this._$percButton.toggleClass("active",d);this._$autoScaleButton.toggleClass("active",a)};a.prototype.updateDateRangeButtons=function(){function a(b){c.model().loadRange(b.data)}var c=this.D4;if(c.model().mainSeries().status()!=
|
|
TradingView.Series.STATUS_LOADING){var d=c._dateRangeResolutions();if(d.length){this._$dateRanges.empty();for(var e=0;e<d.length;e++){var f=d[e],g=$(document.createElement("a")).text(f.text);g.appendTo(this._$dateRanges);g.click({val:f.value,res:f.targetResolution},a)}}}};a.prototype.updateExtendedHoursButton=function(){this._$extendedHoursButton&&(this.D4.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"))};
|
|
a.prototype.updateFullscreenChartButton=function(){var a=this.D4.D5;a&&"s"!==a.layout.value()?(this._$fullscreenChartButton.show(),this._$fullscreenChartButton.toggleClass("active",a.maximizeCurrentChart.value())):this._$fullscreenChartButton.hide()};a.prototype.updateUI=function(){this.updateScaleButtons()};return a}();A69=function(){function a(b){if(!(this instanceof a))throw new TypeError("SymbolSearch is a constructor");this._inputParserMixin=R77.enabled("symbol_search_parser_mixin")?new A70(this):void 0;b=b||{};this._inputElement=$(b.input).get(0);if(!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");this.$list=$(b.list).eq(0);0===this.$list.size()&&delete this.$list;if(void 0!==b.callback){if("function"!==
|
|
typeof b.callback)throw new TypeError("options.callback must be function");this._callback=b.callback}if(void 0!==b.onValueChanged){if("function"!==typeof b.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=b.onValueChanged}if(void 0!==b.onEmptyApply){if("function"!==typeof b.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=b.onEmptyApply}b.ignoreInterval&&(this._ignoreInterval=!0);a.resetStoredInterval();
|
|
b.hidePro&&(this._hidePro=!0);b.allowMultipleSymbols&&(this._allowMultipleSymbols=!0);if(void 0!==b.onParse){if("function"!==typeof b.onParse)throw new TypeError("options.onParse must be function");this._onParse=b.onParse}this._state={};$(this._inputElement).data("symbol-search-instance",this);for(var c=this._boundListener=this._eventListener.bind(this),d=this.boundTimeoutListener=function(a){setTimeout(function(){c(a)},0)},f=0;f<e.length;f++)if(e[f].immediate)$(this._inputElement).on(e[f].name,c);
|
|
else $(this._inputElement).on(e[f].name,d);this._boundOnKeyDown=this._onKeyDown.bind(this);this._boundOnKeyPress=this._onKeyPress.bind(this);$(this._inputElement).on("keydown",this._boundOnKeyDown).on("keypress",this._boundOnKeyPress);this._eventListener();b.autoFocus&&a.registerAutoFocus(this)}function b(a,b){var c=D16.supportedSymbolsTypes(),d=TVSettings.getValue("symboledit.filter");!c.some(function(a){return a.value===d})&&0<c.length&&(d=c[0].value);if(0===c.length)return!1;c.forEach(function(c){var e=
|
|
c.value;c=$('<a class="type-filter">').attr("href","#"+e).text($.t(c.name));e===d&&c.addClass("active");c.on("click",function(c){c.preventDefault();b.find(".type-filter").removeClass("active");$(this).addClass("active");a.typeFilter(e);TVSettings.setValue("symboledit.filter",e)});c.appendTo(b)});a.typeFilter(d);return!0}function c(a,b){var c=D16.supportedExchangesList(),d=TVSettings.getValue("symboledit.exchangefilter");if("bovespa"!==TradingView.widgetCustomer){!c.some(function(a){return a.value===
|
|
d})&&0<c.length&&(d=c[0].value);if(0===c.length)return!1;var e=$('<div class="exchange-filter">').appendTo(b),f=$("<select>").appendTo(e);c.forEach(function(a){var b=a.value,c=a.name||b,e=a.desc||c,b=$("<option>").addClass("filter-item").addClass(a.flag).attr("value",b).text($.t(c)).data("custom-option-text",$.t(e)).appendTo(f);a.value===d&&b.attr("selected",!0)});f.change(function(){var b=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",b);a.exchangeFilter(b)});f.selectbox({speed:0,
|
|
classHolder:"tv-unstyled-select-container tv-symbol-select",classOptions:"sbOptions three-column-filter"});a.exchangeFilter(d);return!0}}function d(a){return a.ctrlKey||a.metaKey||!a.charCode||!a.which||32>=a.which||/^(input|textarea)$/i.test(a.target.tagName)||A83.modalDialog?!1:!0}var e=[{name:"input",immediate:!0},{name:"sync",immediate:!0},{name:"keypress"},{name:"keydown"},{name:"keyup"},{name:"mousedown"},{name:"mouseup"},{name:"cut"},{name:"paste"}],f=[/^e\-m/i];a.registerAutoFocus=function(b){b instanceof
|
|
jQuery&&(b=b.data("symbol-search-instance"));if(!(b instanceof a))throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");TradingView.keyboardBinder.registerListener("symbolEdit",function(a){d(a)&&(a.preventDefault(),this.resetState(),this._skipAutoFocus=!0,this._inputElement.focus(),a=String.fromCharCode(a.charCode),"function"==typeof this._setInputValue?this._setInputValue(a):this._inputElement.value=a,this._eventListener())}.bind(b))};a.prototype.resetState=
|
|
function(){this._state={}};a.prototype.typeFilter=function(a){if(0<arguments.length)a!==this._state.typeFilter&&(null==a?delete this._state.typeFilter:this._state.typeFilter=a+"",delete this._state.keepListFor,this._onSelectionChanged());else return this._state.typeFilter};a.prototype.exchangeFilter=function(a){if(0<arguments.length)a!==this._state.exchangeFilter&&(null==a?delete this._state.exchangeFilter:this._state.exchangeFilter=a+"",delete this._state.keepListFor,this._onSelectionChanged());
|
|
else return this._state.exchangeFilter};a.prototype._moveSelection=function(a,b){if(this._state.suggestOptions&&0!==this._state.suggestOptions.length){var c=this.$list.find("tbody tr:not(.group-close):not(.hidden)"),d=this.$list.find("tr.symbol-edit-popup-active"),e=-1,f;d.size()?(e=c.index(d),f=Math.max(0,Math.min(e+a,c.size()-1))):f=0;e!=f&&(c=c.eq(f),e=c.data("item"),d.length&&d.removeClass("symbol-edit-popup-active"),e.groupTitle?(c.addClass("symbol-edit-popup-active"),this._selectedGroupItem=
|
|
e,delete this._state.highlightIndex,this._scrollHighlightIntoView()):(this._selectedGroupItem&&(this._selectedGroupItem=null),d=this._state.suggestOptions.indexOf(e),this._highlightOption(~d&&d||0,!0,b)))}};a.prototype._groupSetCollapsed=function(a,b){a.groupTitle&&this._groupListHandler&&this._groupListHandler.setCollapsed(a.root,b)};a.prototype._onKeyDown=function(a){if(40===a.keyCode||38===a.keyCode)this._moveSelection(40===a.keyCode?1:-1,!0),a.preventDefault();!this._selectedGroupItem||37!==a.keyCode&&
|
|
39!==a.keyCode||(this._groupSetCollapsed(this._selectedGroupItem,37===a.keyCode),a.preventDefault())};a.prototype._onKeyPress=function(a){if(40===a.keyCode||38===a.keyCode){if(a.charCode)return;if(this._boundOnKeyDown){$(this._inputElement).off("keydown",this._boundOnKeyDown);delete this._boundOnKeyDown;a.preventDefault();return}this._moveSelection(40===a.keyCode?1:-1);a.preventDefault()}13===a.keyCode&&(this._selectedGroupItem?(this._groupSetCollapsed(this._selectedGroupItem,!1),a.preventDefault()):
|
|
this.acceptTypeIn())};a.prototype._eventListener=function(a,b){var c=this._inputElement,d=this._getInputValue().toUpperCase(),e=!1;this._state.value!==d&&(this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(d),this._state.value=d,e=!0,this._inputParserMixin&&this._inputParserMixin.parse());this._fixIntervalCase();d=this._limitInputSelectionValue("selectionStart");this._state.selectionStart!==d&&(this._state.selectionStart=d,e=!0);d=this._limitInputSelectionValue("selectionEnd");
|
|
this._state.selectionEnd!==d&&(this._state.selectionEnd=d,e=!0);this._state.selectionDirection!==c.selectionDirection&&(this._state.selectionDirection=c.selectionDirection,e=!0);e&&(this._onSelectionChanged(void 0,b),e=!1,this._getInputValue()!==this._state.value&&(this._setInputValue(this._state.value),e=!0),(e||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&c.setSelectionRange&&c.setSelectionRange(this._state.selectionStart,
|
|
this._state.selectionEnd,this._state.selectionDirection))};a.prototype._fixIntervalCase=function(){if(this._selectionInsideInterval()){var b=a.detachInterval(this._inputElement.value);/[a-z]/.test(b.detached)&&(this._inputElement.value=b.rest+b.detached.toUpperCase())}};a.prototype._selectionInsideInterval=function(b){if(this._ignoreInterval)return!1;var c=a.detachInterval(this._inputElement.value);return c?"string"==typeof b?this._inputElement[b]>c.rest.length:this._inputElement.selectionStart>c.rest.length&&
|
|
this._inputElement.selectionEnd>c.rest.length:!1};a.prototype._limitInputSelectionValue=function(b){return this._selectionInsideInterval(b)?a.detachInterval(this._inputElement.value).rest.length:b in this._inputElement?this._inputElement[b]:this._inputElement.value.length};a.prototype._getInputValue=function(){if(this._ignoreInterval)return this._inputElement.value;var b=a.detachStoreInterval(this._inputElement.value);$(this._inputElement).toggleClass("interval-error",a.intervalError());return b};
|
|
a.prototype._setInputValue=function(b){this._inputElement.value=this._ignoreInterval?b:a.recallAttachInterval(b)};a.prototype._onSelectionChanged=function(a,b){function c(a,b,e,f){d._state.contextTicker=a;d._state.contextExchange=b;d._state.contextType=e;d._state.keepListFor&&d._state.keepListFor===f||(d._getSuggestList(),delete d._state.keepListFor)}var d=this;if(!f.some(function(a){return a.test(d._state.value)})&&this._inputParserMixin&&!0!==b)this._inputParserMixin.onSelectionChanged(c);else{var e=
|
|
this._state.value;c(e,this._state.exchangeFilter,this._state.typeFilter,this._state._selectedTicker||e)}};a.prototype._clearSelectionState=function(){delete this._state.contextTicker;delete this._state.contextExchange;delete this._state.contextType;delete this._state.contextToken;delete this._state.keepListFor};a.prototype._getSuggestList=function(){var a=this,b=this._state.contextTicker||"",c=this._state.contextExchange||this._state.exchangeFilter||"",d=this._state.typeFilter||"";this._showLoading();
|
|
D16.searchSymbolsByName(b,c,d,"undefined"!=typeof D3?D3:void 0,function(e){b===(a._state.contextTicker||"")&&c===(a._state.contextExchange||a._state.exchangeFilter||"")&&d===(a._state.typeFilter||"")&&a._renderSuggestList(e)})};a.prototype._showLoading=function(){this.$list&&(this._clearSuggestList(),$('<div class="symbol-search-loading">').appendTo(this.$list))};a.prototype._renderSuggestList=function(b){if(this.$list){var c=this,d=this._state;this._clearSuggestList();
|
|
var e=d.suggestOptions=[],f=TradingView.RegExpEscape(d.contextTicker).trim(),n=new RegExp(f.replace(" ","|"),"i"+(1<f.length?"g":""));delete d.highlightIndex;this._hidePro&&(b=b.filter(function(a){return!a.params||-1===a.params.indexOf("pro")}));if(0===b.length)this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+$.t("No symbols matched your criteria")+"</div>");else{var p=$('<table class="symbol-edit-popup">').appendTo(this.$list),r=new a.GroupListHandler(p,n);
|
|
b.forEach(function(a){a.ticker||(a.ticker=a.full_name);var b=$('<tr class="symbol-edit-popup">'),c=$('<td class="symbol-edit-popup-td name apply-overflow-title">');c.html(a.symbol.replace(n,"<strong>$&</strong>"));c.appendTo(b);$('<td class="symbol-edit-popup-td desc apply-overflow-title">').html(n.test(a.symbol)?a.description:a.description.replace(n,"<strong>$&</strong>")).appendTo(b);c=$('<td class="symbol-edit-popup-td type apply-overflow-title">').appendTo(b);"undefined"!=typeof a.params&&~a.params.indexOf("eod")&&
|
|
($("<i>").text("eod").addClass("eod").prependTo(c),c.append(" "));switch(a.type){case "index":c.append($.t(a.type));break;default:c.append($.t(a.type)+" - "+a.exchange)}c.appendTo(b);"futures"==a.type?r.append(a,b):b.appendTo(p);a._$tr=b;b.data("item",a)});r.collapse();this._groupListHandler=r;b=0;for(var f=this.$list.find("tbody tr:not(.group-close)"),t,v;b<f.size();b++)t=f.eq(b),t=t.data("item"),e.push(t),t.ticker===d.contextTicker&&t.exchange===d.contextExchange&&void 0===v&&(v=b);"number"==
|
|
typeof v&&this._highlightOption(v);p.on("click","tr",function(a){a.isDefaultPrevented()||(a.preventDefault(),c._state.suggestOptions&&(a=$(this).data("item"))&&a.full_name&&c.accept(a.full_name,a.ticker))})}}};a.prototype._highlightOption=function(a,b,c){var d=this._state;d.highlightIndex!==a&&(void 0!==d.highlightIndex&&d.suggestOptions[this._state.highlightIndex]._$tr&&d.suggestOptions[this._state.highlightIndex]._$tr.removeClass("symbol-edit-popup-active"),d.highlightIndex=a,(a=d.suggestOptions[a]._$tr)&&
|
|
a.addClass("symbol-edit-popup-active"),this._scrollHighlightIntoView(),b&&this._replaceCurrentSymbol(c))};a.prototype._scrollHighlightIntoView=function(){var a=this.$list.find("tr.symbol-edit-popup-active");a.length&&(a.offset().top<this.$list.offset().top?this.$list.scrollTop(this.$list.scrollTop()-(this.$list.offset().top-a.offset().top)):a.offset().top+a.outerHeight()>this.$list.offset().top+this.$list.outerHeight()&&this.$list.scrollTop(this.$list.scrollTop()+(a.offset().top+a.outerHeight()-(this.$list.offset().top+
|
|
this.$list.outerHeight()))))};a.prototype._clearSuggestList=function(){delete this._state.suggestOptions;this.$list&&this.$list.empty()};a.prototype._showErrorNotice=function(){this.$list&&(this._clearSuggestList(),this.$list.text("Invalid expression"))};a.prototype._replaceCurrentSymbol=function(a){var b=this._state;if(b.suggestOptions&&void 0!==b.highlightIndex){var c=b.suggestOptions[b.highlightIndex],d="",e=0;if(this._inputParserMixin&&!0!==a){c=this._inputParserMixin.replaceCurrentSymbol(c);
|
|
if(!c.ok)return;d=c.newValue;e=c.newCaretPos;b.keepListFor=c.keepListFor}else d=!0===a&&c.full_name&&this._inputParserMixin?c.full_name:c.symbol,e=d.length,this._state._selectedTicker=b.keepListFor=c.ticker||c.symbol;this._setInputValue(d);this._inputElement.setSelectionRange?this._inputElement.setSelectionRange(e,e):this._inputElement.select();this._eventListener(void 0,a)}};a.prototype.splitAndAcceptUserInput=function(){for(var a=this._getInputValue().split(","),b=0;b<a.length;b++)this.acceptSymbolIn(a[b])};
|
|
a.prototype.acceptSymbolIn=function(a){var b,c;this._inputParserMixin?b=this._inputParserMixin.parseSymbol(a):(b=a,c=this._state._selectedTicker||a);this.accept(b,c)};a.prototype.acceptTypeIn=function(){this._allowMultipleSymbols?this.splitAndAcceptUserInput():this.acceptSymbolIn(this._getInputValue())};a.prototype.accept=function(b,c){if(c=c||b){delete this._state.keepListFor;var d=this._ignoreInterval?void 0:a.getInterval(!0);this._inputElement.value=b;this._eventListener();this._callback&&this._callback(c,
|
|
d);$(this._inputElement).trigger("accept-symbol",[c])}};a.prototype.bindListWrapper=function(a){a=$(a).eq(0);if(0===a.size())throw new TypeError("element must be a DOM element, jQuery object or selector");this.$list=a;this._clearSelectionState();this._eventListener()};a.prototype.removeListWrapper=function(){delete this.$list;this._clearSuggestList();this._clearSelectionState();this._eventListener()};a.showDialog=function(d){d=d||{};if(!A83.get("Symbol Search")){var e=A83.createDialog("Symbol Search",
|
|
{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"650px",content:TradingView.templates.dialogs.symbolSearch});A83.positionDialog(e);var f=e.find(".tv-dialog-content").addClass("symbol-search-dialog"),l=f.find(".results");l.mousewheel(function(a,b){var c=$(this);0<b?c.scrollTop(c.scrollTop()-15):c.scrollTop(c.scrollTop()+15)});var m=f.find("input").get(0);d.initialValue&&(m.value=d.initialValue);"selectionStart"in m&&(m.selectionStart=m.selectionEnd=m.value.length);m.focus();var n;
|
|
if(this.canShowSpreadActions()){var p,r;d.ignoreInterval||(p=a.getInputValueGetter(m),r=a.getInputValueSetter(m));n=A70.addSpreadActions(f.find(".spread-actions"),m,p,r)}n=new a({input:m,list:f.find(".results").get(0),callback:function(a,b){d.callback&&d.callback(a,b);A83.destroy("Symbol Search")},onParse:n,ignoreInterval:d.ignoreInterval});f=f.find(".filter");p=b(n,f);n=c(n,f);p||n||f.attr("style","display: none");A83.resizeContent(e.height(),l);A83.applyHandlers(e);
|
|
A83.positionDialog(e);e.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",m.value)});return e}};a.bindToInput=function(d,e){function f(){t&&(C.removeListWrapper(),t.off(),t.remove(),t=null)}function l(a){a.preventDefault()}function m(a){a=a&&A45.seriesShortSymbol.value()||A45.symbol.value()||"";d.val(a);C.resetState()}e=e||{};d=$(d).eq(0);var n=e.callback,p=null,r=null,t=null,v,w=e.spreadActions&&$(e.spreadActions).eq(0);if(w&&w.size()&&
|
|
this.canShowSpreadActions()){var u,x;e.ignoreInterval||(u=a.getInputValueGetter(d.get(0)),x=a.getInputValueSetter(d.get(0)));v=A70.addSpreadActions(w,d.get(0),u,x)}var C=new a({input:d,onValueChanged:function(){if(!t){var a=C,d=$('<div class="symbol-edit-popup">').appendTo(document.body),e=$('<div class="filter">').appendTo(d);b(a,e);c(a,e);var f=$('<div class="table-wrapper">').appendTo(d),g=$(a._inputElement),a=g.offset(),h=Math.max(0,Math.min(a.left+0,$(window).width()-
|
|
d.outerWidth()));d.css("left",h+"px");d.css("top",a.top+g.outerHeight()+1);var h=parseInt($(window).height(),10),e=e.outerHeight(),k=$(window).scrollTop(),g=g.height();f.css("maxHeight",h-(a.top-k)-g/2-g-e+"px");t=d;C.bindListWrapper(f);t.on("focus","*",l);t.on("click","*",l);t.on("mousedown","*",l)}R77.enabled("charting_library_base")&&(d=this._state,d.keepListFor&&(d.suggestOptions&&void 0!==d.highlightIndex?(d=d.suggestOptions[d.highlightIndex],f=this._getInputValue().toUpperCase(),d.symbol!=
|
|
f&&delete this._state.keepListFor):delete this._state.keepListFor))},callback:function(a,b){f();"function"===typeof r&&r(a,b)||("function"===typeof n&&n(a,b),"function"===typeof p&&p(a,b));e.clearAfterAccept&&d.val("");e.keepFocus?d.get(0).focus():d.get(0).blur();C.resetState()},hidePro:e.hidePro,autoFocus:e.autoFocus,onEmptyApply:e.onEmptyApply,onParse:v,allowMultipleSymbols:e.allowMultipleSymbols,ignoreInterval:e.ignoreInterval}),A=!1;d.on("focus",function(a,b){A=!0;C._skipAutoFocus?delete C._skipAutoFocus:
|
|
setTimeout(function(){A&&d.get(0).select()},0)});d.on("blur",function(a){A=!1;setTimeout(function(){A||f()},0)});e.syncWithChartWidget&&(m(!0),A45.seriesShortSymbol.subscribe(function(){m(!0)}),p=function(a,b){a&&A45.symbol.setValue(a);b&&A45.interval.setValue(b)},r=function(a,b){if(b)return!1;if(a===A45.symbol.value()||a===A45.seriesShortSymbol.value())return!0},d.on("keypress",function(a){27===a.keyCode&&(d.get(0).blur(),
|
|
m(!1))}),d.on("keydown",function(a){27===a.keyCode&&(d.get(0).blur(),m(!1))}));return C};a.GroupListHandler=function(a,b){this._$container=a;this._tickerRegExp=b;this._roots={}};a.GroupListHandler.prototype.addRoot=function(a,b,c,d){var e=this,f=d.clone().addClass("group-title").click(function(b){b.preventDefault();e[f.hasClass("collapsed")?"expand":"collapse"](a)});f.find("td.name").html("<div>"+b.replace(this._tickerRegExp,"<strong>$&</strong>")+"</div>");f.find("td.type").html(c.type+(c.exchange&&
|
|
" - "+c.exchange||""));f.appendTo(this._$container);f.data("item",{groupTitle:!0,root:a});b=$('<tr class="group-close"><td colspan="3"></td></tr>').appendTo(this._$container);this._roots[a]={titleRow:f,closeRow:b}};a.GroupListHandler.prototype.append=function(a,b){var c=D16.futuresRegex().exec(String(a.symbol));if(c){var c=c[1],d=(a.exchange||"unknown")+"_"+c;this._roots[d]||this.addRoot(d,c,a,b);b.addClass("root-"+d).insertBefore(this._roots[d].closeRow)}else b.appendTo(this._$container)};
|
|
a.GroupListHandler.prototype.setCollapsed=function(a,b){if(!a)for(a in this._roots)this.setCollapsed(a,b);else if(this._roots[a]){var c=!0===b?"addClass":"removeClass";this._roots[a].titleRow[c]("collapsed");this._$container.find("tr.root-"+a)[c]("hidden")}};a.GroupListHandler.prototype.collapse=function(a){this.setCollapsed(a,!0)};a.GroupListHandler.prototype.expand=function(a){this.setCollapsed(a,!1)};a.isIntervalInit=function(a){return/[\d,]/.test(a)&&R77.enabled("show_interval_dialog_on_key_press")};
|
|
a.isIntervalChar=function(a){return/[\dhdwm]/i.test(a)};a.parseIntervalValue=function(a){var b=/^[,\s]*(\d*)\s*([hdwm]?)\s*$/i.exec(a)||[];a=~~b[1];var b=b[2]&&b[2].toUpperCase(),c={qty:!a&&b?1:a,unit:b||null};c.error=!a&&!b;c.intraday=!c.error&&(!c.unit||"H"==c.unit);return c};a.sanitizeIntervalValue=function(b){b=a.parseIntervalValue(b);var c=b.qty,d=b.unit;if(b.error)return null;"H"==d&&(c*=60,d=null);return c&&!d?String(c):!d||c&&1!=c?c+d:d};a.detachInterval=function(a){var b=/,[^,]*$/i.exec(a)||
|
|
[];if(b[0])return{rest:a.substr(0,a.length-b[0].length),detached:b[0]}};a.intervalIsSupported=function(b){if(R77.enabled("allow_supported_resolutions_set_only"))return b=this.sanitizeIntervalValue(b),null===b?!1:TradingView.IntervalHelper.isAvailable(b);b=a.parseIntervalValue(b);if(b.error)return!1;if(b.intraday)return A45.intraday.value();var c=A45.supportedResolutions.value();return c?!!~c.indexOf(b.unit):!0};(function(){var b="",c=null;a.resetStoredInterval=
|
|
function(){b="";c=null};a.detachStoreInterval=function(d){var e=a.detachInterval(d);if(e)return b=e.detached,c=a.sanitizeIntervalValue(b),e.rest;a.resetStoredInterval();return d};a.recallAttachInterval=function(a){return a+b};a.getInterval=function(b){var d=c;!0===b&&a.resetStoredInterval();return d};a.getInputValueGetter=function(b){return function(){return a.detachStoreInterval(b.value)}};a.getInputValueSetter=function(b){return function(c){b.value=a.recallAttachInterval(c)}};a.intervalError=function(){return!b||
|
|
/^,\s*$/.test(b)?!1:!c}})();a.registerDialogKeypressHandler=function(b){if(!b)throw new TypeError("D3 is required");TradingView.keyboardBinder.pushBackListener("symbolEdit",function(b){d(b)&&(b.preventDefault(),b=String.fromCharCode(b.charCode),a.isIntervalInit(b)?(new TradingView.ChangeIntervalDialog({callback:function(a){A45.interval.setValue(a)}})).show(b):a.showDialog({initialValue:b,callback:function(a,b){A45.symbol.setValue(a);b&&A45.interval.setValue(b)}}))})};
|
|
a.canShowSpreadActions=function(){return"undefined"!=typeof A70&&"cme"!==TradingView.widgetCustomer&&"bovespa"!==TradingView.widgetCustomer};return a}();TradingView.MiniChartWidget=function(a,b,c){this.$container=b;var d=this._options=$.extend(!0,this.defaults(),c||{});this._ctx=this._canvas=null;this._plots=$.map(a||[],function(a){return new TradingView.MiniChartWidgetPlot(a.data,$.extend(!0,{},d.plot,a.options))});this._initCanvas();a=function(){return this._plots}.bind(this);this._xScale=new TradingView.MiniChartWidgetXScale(a,this._ctx,this._options.xScale);this._yScale=new TradingView.MiniChartWidgetYScale(a,this._ctx,this._options.yScale);this._plotArea=
|
|
new TradingView.MiniChartWidgetPlotArea(a,this._ctx,this._xScale,this._yScale,{grid:this._options.grid,plot:this._options.plot,loading:this._options.loading});this.height=new WatchedValue(0);this.width=new WatchedValue(0);this._initSizeHandling();this._onPlotsChanged();!0!==c.noAutoResize&&this.bindOnResize()};
|
|
TradingView.MiniChartWidget.prototype.defaults=function(){return{minWidth:100,minHeight:75,bgColor:null,grid:{xIsVisible:!0,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#e9e9ea"}},xScale:{visible:!0,position:"bottom",isTimeScale:!0,height:null,paddingTop:4,paddingBottom:4,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},yScale:{visible:!0,position:"right",isPercentage:!1,
|
|
paddingLeft:4,paddingRight:4,marginInPercents:10,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},plot:{line:{width:2,color:"#ff7965"},belowLineFillStyle:"rgba(180, 180, 180, 0.2)",aboveLineFillStyle:null},loading:{lines:9,length:0,width:5,radius:8,corners:1,color:null,speed:.75}}};
|
|
TradingView.MiniChartWidget.prototype._initCanvas=function(){this._canvas=TradingView.addCanvasTo(this.$container,{w:this._options.minWidth,h:this._options.minHeight});$(this._canvas).css("display","block");this._ctx=this._canvas.getContext("2d");this._ctx._fillText=function(a,b,c){b=Math.round(b);c=Math.round(c);this._ctx.fillText(a,b,c)}.bind(this)};
|
|
TradingView.MiniChartWidget.prototype._initSizeHandling=function(){function a(){var a=e._options.drawOverPlotArea||!e._options.visible?d.height.value():d.height.value()-e.height.value();g.height.setValue(a)}function b(){var a=f._options.drawOverPlotArea||!f._options.visible?d.width.value():d.width.value()-f.width.value();g.width.setValue(a)}function c(){var a=0;"right"===f._options.position&&(a=f._options.drawOverPlotArea||!f._options.visible?g.width.value()-f.width.value():g.width.value());f.originX.setValue(a)}
|
|
var d=this,e=this._xScale,f=this._yScale,g=this._plotArea;d.height.subscribe(a);e.height.subscribe(a);g.height.subscribe(function(a){f.height.setValue(a);a=0;"bottom"===e._options.position&&(a=e._options.drawOverPlotArea||!e._options.visible?g.height.value()-e.height.value():g.height.value());e.originY.setValue(a)});d.width.subscribe(b);f.width.subscribe(b);f.width.subscribe(function(){var a=0;"left"===f._options.position&&(a=f.width.value());g.originX.setValue(a)});f.width.subscribe(c);f.width.subscribe(function(){var a=
|
|
0;"left"===f._options.position&&(a=f.width.value());e.originX.setValue(a)});g.width.subscribe(function(a){e.width.setValue(a);c()})};
|
|
TradingView.MiniChartWidget.prototype.resetSize=function(){var a=this.$container.height()||this._options.minHeight,b=this.$container.width()||this._options.minWidth;this._xScale.originX.setValue("left"===this._yScale._options.position?this._yScale.width.value():0);this._yScale.originY.setValue("top"===this._xScale._options.position?this._xScale.height.value():0);TradingView.setCanvasSize(this._canvas,{h:a,w:b});this.height.setValue(a);this.width.setValue(b)};
|
|
TradingView.MiniChartWidget.prototype.onResize=function(){this.resetSize();this.draw()};TradingView.MiniChartWidget.prototype.bindOnResize=function(){this._onResize||(this._onResize=this.onResize.bind(this));this.$container.resize(this._onResize)};TradingView.MiniChartWidget.prototype.unbindOnResize=function(){this._onResize&&(this.$container.off("resize",this._onResize),delete this._onResize)};
|
|
TradingView.MiniChartWidget.prototype.addPlot=function(a){var b=a;if(!(b instanceof TradingView.MiniChartWidgetPlot)){if(!b.data){console.error("[MiniChartWidget] wrong plot format");return}b=new TradingView.MiniChartWidgetPlot(b.data,$.extend(!0,{},this._options.plot,b.options))}if(!$.grep(this._plots,function(a){return a.id===b.id}).length)return this._plots.push(b),b.dataChanged.subscribe(this,this._onPlotsChanged),this._onPlotsChanged(),b};
|
|
TradingView.MiniChartWidget.prototype._onPlotsChanged=function(){this.resetSize();this._yScale.onPlotsChanged();this._xScale.onPlotsChanged();this.draw()};TradingView.MiniChartWidget.prototype.removePlot=function(a){this._plots=$.grep(this._plots,function(b){return b.id!==a.id});this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};
|
|
TradingView.MiniChartWidget.prototype.removeAllPlots=function(){this._plots=[];this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};TradingView.MiniChartWidget.prototype.draw=function(){this._plotArea.draw();this._yScale.draw();this._xScale.draw()};TradingView.MiniChartWidget.prototype.showMessage=function(a){this._options.showMessage&&this._writeMessage(a)};
|
|
TradingView.MiniChartWidget.prototype.writeText=function(a){this._options.bgColor&&"transparent"!==this._options.bgColor?(this._ctx.fillStyle=this._options.bgColor,this._ctx.fillRect(0,0,this.width.value(),this.height.value())):this._ctx.clearRect(0,0,this.width.value(),this.height.value());var b=this._ctx.measureText(a).width;this._ctx.fillStyle=this._options.xScale.font.color;this._ctx.font=this._options.xScale.font.size+"px "+this._options.xScale.font.family;this._ctx._fillText(a,(this.width.value()-
|
|
b)/2,(this.height.value()-this._options.xScale.font.size)/2)};TradingView.MiniChartWidget.prototype.xScale=function(){return this._xScale};TradingView.MiniChartWidget.prototype.yScale=function(){return this._yScale};TradingView.MiniChartWidgetPlot=function(a,b){this.id=TradingView.guid();this._options=$.extend(!0,{},b);this._y=this._x=null;a&&this.setData(a,!0);this.dataChanged=new Delegate};
|
|
TradingView.MiniChartWidgetPlot.prototype.setData=function(a,b){a.x&&a.y||console.error("[MiniChartWidgetPlot] wrong data format");this._x=a.x;this._y=a.y;b||this.dataChanged.fire()};TradingView.MiniChartWidgetPlot.prototype.x=function(){return this._x};TradingView.MiniChartWidgetPlot.prototype.y=function(a){var b=this._y;if(!a)return b;var c=function(){for(var a=0,c=b.length;a<c;a++)if(isNumber(b[a]))return b[a]}()/100;return $.map(b,function(a){return isNumber(a)?a/c-100:void 0})};
|
|
TradingView.MiniChartWidgetRectangle=function(a,b,c,d){this.originX=new WatchedValue(a||0);this.originY=new WatchedValue(b||0);this.width=new WatchedValue(c||0);this.height=new WatchedValue(d||0)};TradingView.MiniChartWidgetRectangle.prototype.left=function(){return this.originX.value()};TradingView.MiniChartWidgetRectangle.prototype.right=function(){return this.originX.value()+this.width.value()};TradingView.MiniChartWidgetRectangle.prototype.top=function(){return this.originY.value()};
|
|
TradingView.MiniChartWidgetRectangle.prototype.bottom=function(){return this.originY.value()+this.height.value()};TradingView.MiniChartWidgetRectangle.prototype.clearBack=function(){var a=this._ctx,b=this.left()-.5,c=this.top()-.5,d=this.right()+.5,e=this.bottom()+.5;this._options.bgColor&&"transparent"!==this._options.bgColor?(a.fillStyle=this._options.bgColor,a.fillRect(b,c,d,e)):a.clearRect(b,c,d,e)};
|
|
TradingView.MiniChartWidgetPlotArea=function(a,b,c,d,e){TradingView.MiniChartWidgetRectangle.call(this);this.getWidgetPlots=a;this._ctx=b;this._xScale=c;this._yScale=d;this._options=e;this.originY.setValue("bottom"===this._xScale._options.position?0:this._xScale.height.value());this.originY.setValue=function(){console.warn("[MiniChartWidgetPlotArea] updating originY forbidden")}};inherit(TradingView.MiniChartWidgetPlotArea,TradingView.MiniChartWidgetRectangle);
|
|
TradingView.MiniChartWidgetPlotArea.prototype.draw=function(){this.clearBack();this._drawGrid();this.getWidgetPlots().length?(this._drawPlots(),this._hideLoading()):this._options.loading.showWhileNoPlots&&this._showLoading()};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawGrid=function(a){a=this._ctx;var b=this.left(),c=this.right(),d=this.top(),e=this.bottom(),f,g,h,k;a.lineWidth=this._options.grid.line.width;a.strokeStyle=this._options.grid.line.color;a.lineStyle=this._options.grid.line.style;var l=this._xScale.tickMarks();if(l.length&&this._options.grid.xIsVisible)for(var m=0;m<l.length;m++)f=l[m].coordinate,g=d,h=l[m].coordinate,k=e,CanvasEx.drawLine(a,f,g,h,k);d=this._yScale.tickMarks();if(d.length&&this._options.grid.yIsVisible)for(m=
|
|
0;m<d.length;m++)f=b,g=d[m].coordinate,h=c,k=d[m].coordinate,CanvasEx.drawLine(a,f,g,h,k)};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawPlots=function(){function a(a){return e(a)}function b(a){return f(a)}var c=this.getWidgetPlots(),d=this._ctx,e=this._xScale.valueToCoord.bind(this._xScale),f=this._yScale.valueToCoord.bind(this._yScale);this.left();this.right();for(var g=this.top(),h=this.bottom(),k,l,m,n=0;n<c.length;n++)k=c[n],l=$.map(k.x(),a),m=$.map(k.y(this._yScale._options.isPercentage),b),1===l.length?this._drawCircle(l[0],m[0],k._options.line.width,k._options.line.color):
|
|
(k._options.belowLineFillStyle&&"transparent"!==k._options.belowLineFillStyle&&this._drawNearAroundArea(d,l,m,h,k._options.belowLineFillStyle),k._options.aboveLineFillStyle&&"transparent"!==k._options.aboveLineFillStyle&&this._drawNearAroundArea(d,l,m,g,k._options.aboveLineFillStyle),this._drawLine(d,l,m,k._options.line.width,k._options.line.color))};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawNearAroundArea=function(a,b,c,d,e){var f=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),g=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==f||null!==g){a.fillStyle=e;a.beginPath();a.moveTo(b[f],d);for(e=f;e<=g;e++)isNumber(b[e])&&isNumber(c[e])&&a.lineTo(b[e],c[e]);a.lineTo(b[g],d);a.closePath();a.fill()}};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawLine=function(a,b,c,d,e){var f=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),g=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==f||null!==g){a.lineWidth=d;a.strokeStyle=e;a.moveTo(b[f],c[f]);a.beginPath();for(d=f;d<=g;d++)isNumber(b[d])&&isNumber(c[d])&&a.lineTo(b[d],c[d]);a.stroke()}};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawCircle=function(a,b,c,d,e){isNumber(b)&&isNumber(c)&&(a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!1),a.fillStyle=e,a.fill())};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._showLoading=function(){this._$loadingIndicator||(this._$loadingIndicator=$("<div></div>"),(new Spinner({lines:this._options.loading.lines,length:this._options.loading.length,width:this._options.loading.width,radius:this._options.loading.radius,corners:this._options.loading.corners,rotate:0,direction:1,color:this._options.loading.color||this._options.grid.line.color,speed:this._options.loading.speed,trail:100,shadow:!1,hwaccel:!1,className:"spinner",zIndex:1,
|
|
top:"50%",left:"50%"})).spin(this._$loadingIndicator.get(0)),this._$loadingIndicator.insertAfter(this._ctx.canvas));this._$loadingIndicator.show()};TradingView.MiniChartWidgetPlotArea.prototype._hideLoading=function(){this._$loadingIndicator&&this._$loadingIndicator.hide()};TradingView.MiniChartWidgetAbstractScale=function(a,b,c){TradingView.MiniChartWidgetRectangle.call(this);this._ctx=b;this._options=c;this._max=this._min=null;this._tickMarks=[];this.getWidgetPlots=a};
|
|
inherit(TradingView.MiniChartWidgetAbstractScale,TradingView.MiniChartWidgetRectangle);
|
|
TradingView.MiniChartWidgetAbstractScale.prototype._calculateTickMarks=function(a,b,c){function d(a){return Math.round(1E6*a)/1E6+(h._options.isPercentage?"%":"")}function e(a){var e=d(a);a=h.valueToCoord(a);if("vertical"===c&&!p)return a;if("vertical"===c&&p)return a+.5*b(e);if("horizontal"===c&&!p)return a;if("horizontal"===c&&p)return a-.5*b(e)}function f(a){var e=d(a);a=h.valueToCoord(a);if("vertical"===c&&!p)return a-h._GREED_MARGIN-b(e);if("vertical"===c&&p)return a-.5*b(e);if("horizontal"===
|
|
c&&!p)return a+h._GREED_MARGIN+b(e);if("horizontal"===c&&p)return a+.5*b(e)}function g(a,b){return"vertical"===c?f(a)-n>e(b):f(a)+n<e(b)}var h=this,k=h._min,l=h._max;if(!a||null===k||null===l||"function"!==typeof b)return[];c=c||"vertical";var m=h._options.maxTickMarkAmount||10,n=a/(m||20),p=!h._options.drawOverPlotArea;a=[];if(k===l)a=[k];else for(;0<m;){a=(l-k)/m;var r=Math.pow(10,Math.ceil(Math.log(a)/Math.LN10));r/5>=a&&(r/=5);r/2>=a&&(r/=2);var t=Math.floor(k/r)*r;t<k&&(t=Math.ceil(k/r)*r);for(a=
|
|
[t];a[a.length-1]+r<=l;)a.push(a[a.length-1]+r);for(var r=!1,v,w=1;w<a.length;w++)if(v=a[w],g(t,v))t=v;else{r=!0;break}if(r)m--;else break}return $.map(a,function(a){return{text:d(a),coordinate:Math.round(h.valueToCoord(a))}})};TradingView.MiniChartWidgetAbstractScale.prototype.tickMarks=function(){return this._tickMarks};
|
|
TradingView.MiniChartWidgetAbstractScale.prototype.draw=function(){if(this._options.visible){var a=this._tickMarks,b=this._ctx;this._options.drawOverPlotArea||this.clearBack();if(!this._options.drawOverPlotArea&&this._options.borderColor&&"transparent"!==this._options.borderColor){b.strokeStyle=this._options.borderColor;b.lineWidth=1;b.beginPath();switch(this._options.position){case "left":b.moveTo(this.right(),this.top());b.lineTo(this.right(),this.bottom());break;case "right":b.moveTo(this.left(),
|
|
this.top());b.lineTo(this.left(),this.bottom());break;case "top":b.moveTo(this.left(),this.bottom());b.lineTo(this.right(),this.bottom());break;case "bottom":b.moveTo(this.left(),this.top()),b.lineTo(this.right(),this.top())}b.stroke()}b.fillStyle=this._options.font.color;b.font=this._options.font.size+"px "+this._options.font.family;for(var c=0;c<a.length;c++)b=a[c],this._drawLabel(b.coordinate,b.text)}};
|
|
TradingView.MiniChartWidgetXScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._series=[];this.height.setValue("number"==typeof this._options.height&&this._options.height||this._options.paddingBottom+this._options.font.size+this._options.paddingTop);this.height.setValue=function(){console.warn("[MiniChartWidgetXScale] updating height forbidden")};this.width.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=2};
|
|
inherit(TradingView.MiniChartWidgetXScale,TradingView.MiniChartWidgetAbstractScale);TradingView.MiniChartWidgetXScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.right()-this.left())/2:this.left()+this._pixelsPerValue*(a-this._min)};TradingView.MiniChartWidgetXScale.prototype.onPlotsChanged=function(){this._updateSeries();this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetXScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks()};
|
|
TradingView.MiniChartWidgetXScale.prototype._updateSeries=function(){this._series=this.getWidgetPlots().length?this.getWidgetPlots()[0].x():[]};TradingView.MiniChartWidgetXScale.prototype._updateMinMax=function(){this._min=this._series.length?this._series[0]:null;this._max=this._series.length?this._series[this._series.length-1]:null};TradingView.MiniChartWidgetXScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=this.width.value()/(this._max-this._min)};
|
|
TradingView.MiniChartWidgetXScale.prototype._updateTickMarks=function(){var a=this.width.value(),b=function(a){return this._ctx.measureText(a).width}.bind(this);this._tickMarks=this._options.isTimeScale?this._calculateTimeTickMarks(a,b):this._calculateTickMarks(a,b,"horizontal")};
|
|
TradingView.MiniChartWidgetXScale.prototype._calculateTimeTickMarks=function(a,b){if(!a||null===this._min||null===this._max||"function"!==typeof b)return[];var c=this._max-this._min,d=c/86400,e=[],f=[],e=this._ctx;e.font=this._options.fontSize+"px "+this._options.fontFamily;e.fillStyle=this._options.fontColor;e.textBaseline="bottom";2>d?e=this._timeSplit(a,b,this._trimToHour,this._formatHour):3>d?e=this._timeSplit(a,b,this._trimToHour,this._formatDayHour):6>d?e=this._timeSplit(a,b,this._trimToDay,
|
|
this._formatDay):6>c/604800?e=this._timeSplit(a,b,this._trimToWeek,this._formatDay):15>c/2592E3?(e=(new Date(1E3*this._max)).getFullYear()===(new Date).getFullYear()?this._formatMonthOnly:this._formatMonthYear,e=this._timeSplit(a,b,this._trimToMonth,e)):(e=c/31104E3,e=6>e?this._timeSplit(a,b,this._trimToYear,this._formatYear):30>e?this._timeSplit(a,b,this._trimTo5Years,this._formatYear):50>e?this._timeSplit(a,b,this._trimTo10Years,this._formatYear):this._timeSplit(a,b,this._trimTo25Years,this._formatYear));
|
|
c=0;for(d=e.length;c<d;c++){var g=this.valueToCoord(this._series[e[c].index]);f.push({text:""+e[c].text,coordinate:g})}return f};
|
|
TradingView.MiniChartWidgetXScale.prototype._timeSplit=function(a,b,c,d){for(var e=[],f=null,g=a/20,h=0,k=this._series.length;h<k;h++){var l=c.call(this,new Date(1E3*this._series[h])),m=d.call(this,l);if(null===f)f=l;else{var n=this.valueToCoord(this._series[h]),p=0<n&&n<a;if(e.length&&p)var p=this.valueToCoord(this._series[e[e.length-1].index]),r=b(e[e.length-1].text),p=p+r+g<=n;p&&f.valueOf()!==l.valueOf()&&(e.push({index:h,text:m}),f=l)}}return e};
|
|
TradingView.MiniChartWidgetXScale.prototype._trimToHour=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())};TradingView.MiniChartWidgetXScale.prototype._trimToDay=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())};TradingView.MiniChartWidgetXScale.prototype._trimToMonth=function(a){return new Date(a.getFullYear(),a.getMonth(),1)};TradingView.MiniChartWidgetXScale.prototype._trimToYear=function(a){return new Date(a.getFullYear(),1,1)};
|
|
TradingView.MiniChartWidgetXScale.prototype._trimToWeek=function(a){a=this._trimToDay(a);return new Date(a.valueOf()-864E5*a.getDay())};TradingView.MiniChartWidgetXScale.prototype._trimTo5Years=function(a){a=a.getFullYear();return new Date(a-a%5,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo10Years=function(a){a=a.getFullYear();return new Date(a-a%10,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo25Years=function(a){a=a.getFullYear();return new Date(a-a%25,1,1)};
|
|
TradingView.MiniChartWidgetXScale.prototype._monthNames="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");TradingView.MiniChartWidgetXScale.prototype._formatHour=function(a){a=a.getHours().toString();1===a.length&&(a="0"+a);return a+":00"};TradingView.MiniChartWidgetXScale.prototype._formatDayHour=function(a){return this._formatDay(a)+" "+this._formatHour(a)};TradingView.MiniChartWidgetXScale.prototype._formatDay=function(a){return this._monthNames[a.getMonth()]+","+a.getDate()};
|
|
TradingView.MiniChartWidgetXScale.prototype._formatMonthOnly=function(a){return this._monthNames[a.getMonth()]};TradingView.MiniChartWidgetXScale.prototype._formatMonthYear=function(a){return this._monthNames[a.getMonth()]+", "+a.getFullYear()};TradingView.MiniChartWidgetXScale.prototype._formatYear=function(a){return a.getFullYear()};
|
|
TradingView.MiniChartWidgetXScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=c.measureText(b).width,d=this._options.drawOverPlotArea?a+this._GREED_MARGIN:a-d/2,d=Math.min(this.right(),d),d=Math.max(this.left(),d),e="bottom"===this._options.position?this.bottom()-this._options.paddingBottom:this.top()+this._options.paddingTop+this._options.font.size;c.textBaseline="bottom";c._fillText(b,d,e);this._options.drawTickMarkLine&&this._options.borderColor&&"transparent"!==this._options.borderColor&&
|
|
(c.strokeStyle=this._options.borderColor,c.beginPath(),"bottom"===this._options.position?(c.moveTo(a,this.top()),c.lineTo(a,this.top()+2)):(c.moveTo(a,this.bottom()),c.lineTo(a,this.bottom()-2)),c.stroke())};TradingView.MiniChartWidgetYScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._max=this._min=null;this.height.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=1};inherit(TradingView.MiniChartWidgetYScale,TradingView.MiniChartWidgetAbstractScale);
|
|
TradingView.MiniChartWidgetYScale.prototype.onPlotsChanged=function(){this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetYScale.prototype._updateMinMax=function(){for(var a=this.getWidgetPlots(),b=null,c=null,d,e,f=0;f<a.length;f++){d=MathEx.min(a[f].y(this._options.isPercentage));e=MathEx.max(a[f].y(this._options.isPercentage));if(null===b||d<b)b=d;if(null===c||c<e)c=e}this._min=b;this._max=c};
|
|
TradingView.MiniChartWidgetYScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=(this.height.value()-2*this._margin())/(this._max-this._min)};TradingView.MiniChartWidgetYScale.prototype._updateTickMarks=function(){var a=this.height.value(),b=function(){return this._options.font.size}.bind(this);this._tickMarks=this._calculateTickMarks(a,b,"vertical")};
|
|
TradingView.MiniChartWidgetYScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks();var a="number"==typeof this._options.width&&this._options.width||this._options.paddingLeft+this._maxLabelWidth()+this._options.paddingRight;this.width.setValue(a)};TradingView.MiniChartWidgetYScale.prototype._maxLabelWidth=function(){for(var a=0,b=0;b<this._tickMarks.length;b++)a=Math.max(a,this._ctx.measureText(this._tickMarks[b].text).width);return a};
|
|
TradingView.MiniChartWidgetYScale.prototype._margin=function(){return this.height.value()*this._options.marginInPercents/100};TradingView.MiniChartWidgetYScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.bottom()-this.top())/2:this.height.value()-this._margin()-this._pixelsPerValue*(a-this._min)};
|
|
TradingView.MiniChartWidgetYScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=this._options.drawOverPlotArea?a-this._GREED_MARGIN:a+this._options.font.size/2,d=Math.max(this.top()+this._options.font.size,d),d=Math.min(this.bottom(),d),e="number"==typeof this._options.width&&this._options.width||this._options.paddingLeft+this._maxLabelWidth()+this._options.paddingRight,e="left"===this._options.position?this.left()+e-this._ctx.measureText(b).width-this._options.paddingRight:this.right()-e+
|
|
this._options.paddingLeft;c.textBaseline="bottom";c._fillText(b,e,d);this._options.drawTickMarkLine&&(this._options.borderColor&&"transparent"!==this._options.borderColor&&(c.strokeStyle=this._options.borderColor),c.beginPath(),"left"===this._options.position?(c.moveTo(this.right(),a),c.lineTo(this.right()-2,a)):(c.moveTo(this.left(),a),c.lineTo(this.left()+2,a)),c.stroke())};TradingView.MiniChartWidget=function(a,b,c){this.$container=b;var d=this._options=$.extend(!0,this.defaults(),c||{});this._ctx=this._canvas=null;this._plots=$.map(a||[],function(a){return new TradingView.MiniChartWidgetPlot(a.data,$.extend(!0,{},d.plot,a.options))});this._initCanvas();a=function(){return this._plots}.bind(this);this._xScale=new TradingView.MiniChartWidgetXScale(a,this._ctx,this._options.xScale);this._yScale=new TradingView.MiniChartWidgetYScale(a,this._ctx,this._options.yScale);this._plotArea=
|
|
new TradingView.MiniChartWidgetPlotArea(a,this._ctx,this._xScale,this._yScale,{grid:this._options.grid,plot:this._options.plot,loading:this._options.loading});this.height=new WatchedValue(0);this.width=new WatchedValue(0);this._initSizeHandling();this._onPlotsChanged();!0!==c.noAutoResize&&this.bindOnResize()};
|
|
TradingView.MiniChartWidget.prototype.defaults=function(){return{minWidth:100,minHeight:75,bgColor:null,grid:{xIsVisible:!0,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#e9e9ea"}},xScale:{visible:!0,position:"bottom",isTimeScale:!0,height:null,paddingTop:4,paddingBottom:4,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},yScale:{visible:!0,position:"right",isPercentage:!1,
|
|
paddingLeft:4,paddingRight:4,marginInPercents:10,font:{size:10,family:"Helvetica",color:"#83888d"},drawOverPlotArea:!0,bgColor:"transparent",borderColor:"transparent",drawTickMarkLine:!1,maxTickMarkAmount:10},plot:{line:{width:2,color:"#ff7965"},belowLineFillStyle:"rgba(180, 180, 180, 0.2)",aboveLineFillStyle:null},loading:{lines:9,length:0,width:5,radius:8,corners:1,color:null,speed:.75}}};
|
|
TradingView.MiniChartWidget.prototype._initCanvas=function(){this._canvas=TradingView.addCanvasTo(this.$container,{w:this._options.minWidth,h:this._options.minHeight});$(this._canvas).css("display","block");this._ctx=this._canvas.getContext("2d");this._ctx._fillText=function(a,b,c){b=Math.round(b);c=Math.round(c);this._ctx.fillText(a,b,c)}.bind(this)};
|
|
TradingView.MiniChartWidget.prototype._initSizeHandling=function(){function a(){var a=e._options.drawOverPlotArea||!e._options.visible?d.height.value():d.height.value()-e.height.value();g.height.setValue(a)}function b(){var a=f._options.drawOverPlotArea||!f._options.visible?d.width.value():d.width.value()-f.width.value();g.width.setValue(a)}function c(){var a=0;"right"===f._options.position&&(a=f._options.drawOverPlotArea||!f._options.visible?g.width.value()-f.width.value():g.width.value());f.originX.setValue(a)}
|
|
var d=this,e=this._xScale,f=this._yScale,g=this._plotArea;d.height.subscribe(a);e.height.subscribe(a);g.height.subscribe(function(a){f.height.setValue(a);a=0;"bottom"===e._options.position&&(a=e._options.drawOverPlotArea||!e._options.visible?g.height.value()-e.height.value():g.height.value());e.originY.setValue(a)});d.width.subscribe(b);f.width.subscribe(b);f.width.subscribe(function(){var a=0;"left"===f._options.position&&(a=f.width.value());g.originX.setValue(a)});f.width.subscribe(c);f.width.subscribe(function(){var a=
|
|
0;"left"===f._options.position&&(a=f.width.value());e.originX.setValue(a)});g.width.subscribe(function(a){e.width.setValue(a);c()})};
|
|
TradingView.MiniChartWidget.prototype.resetSize=function(){var a=this.$container.height()||this._options.minHeight,b=this.$container.width()||this._options.minWidth;this._xScale.originX.setValue("left"===this._yScale._options.position?this._yScale.width.value():0);this._yScale.originY.setValue("top"===this._xScale._options.position?this._xScale.height.value():0);TradingView.setCanvasSize(this._canvas,{h:a,w:b});this.height.setValue(a);this.width.setValue(b)};
|
|
TradingView.MiniChartWidget.prototype.onResize=function(){this.resetSize();this.draw()};TradingView.MiniChartWidget.prototype.bindOnResize=function(){this._onResize||(this._onResize=this.onResize.bind(this));this.$container.resize(this._onResize)};TradingView.MiniChartWidget.prototype.unbindOnResize=function(){this._onResize&&(this.$container.off("resize",this._onResize),delete this._onResize)};
|
|
TradingView.MiniChartWidget.prototype.addPlot=function(a){var b=a;if(!(b instanceof TradingView.MiniChartWidgetPlot)){if(!b.data){console.error("[MiniChartWidget] wrong plot format");return}b=new TradingView.MiniChartWidgetPlot(b.data,$.extend(!0,{},this._options.plot,b.options))}if(!$.grep(this._plots,function(a){return a.id===b.id}).length)return this._plots.push(b),b.dataChanged.subscribe(this,this._onPlotsChanged),this._onPlotsChanged(),b};
|
|
TradingView.MiniChartWidget.prototype._onPlotsChanged=function(){this.resetSize();this._yScale.onPlotsChanged();this._xScale.onPlotsChanged();this.draw()};TradingView.MiniChartWidget.prototype.removePlot=function(a){this._plots=$.grep(this._plots,function(b){return b.id!==a.id});this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};
|
|
TradingView.MiniChartWidget.prototype.removeAllPlots=function(){this._plots=[];this._yScale.onPlotsChanged.call(this._yScale);this._xScale.onPlotsChanged.call(this._xScale);this.draw()};TradingView.MiniChartWidget.prototype.draw=function(){this._plotArea.draw();this._yScale.draw();this._xScale.draw()};TradingView.MiniChartWidget.prototype.showMessage=function(a){this._options.showMessage&&this._writeMessage(a)};
|
|
TradingView.MiniChartWidget.prototype.writeText=function(a){this._options.bgColor&&"transparent"!==this._options.bgColor?(this._ctx.fillStyle=this._options.bgColor,this._ctx.fillRect(0,0,this.width.value(),this.height.value())):this._ctx.clearRect(0,0,this.width.value(),this.height.value());var b=this._ctx.measureText(a).width;this._ctx.fillStyle=this._options.xScale.font.color;this._ctx.font=this._options.xScale.font.size+"px "+this._options.xScale.font.family;this._ctx._fillText(a,(this.width.value()-
|
|
b)/2,(this.height.value()-this._options.xScale.font.size)/2)};TradingView.MiniChartWidget.prototype.xScale=function(){return this._xScale};TradingView.MiniChartWidget.prototype.yScale=function(){return this._yScale};TradingView.MiniChartWidgetPlot=function(a,b){this.id=TradingView.guid();this._options=$.extend(!0,{},b);this._y=this._x=null;a&&this.setData(a,!0);this.dataChanged=new Delegate};
|
|
TradingView.MiniChartWidgetPlot.prototype.setData=function(a,b){a.x&&a.y||console.error("[MiniChartWidgetPlot] wrong data format");this._x=a.x;this._y=a.y;b||this.dataChanged.fire()};TradingView.MiniChartWidgetPlot.prototype.x=function(){return this._x};TradingView.MiniChartWidgetPlot.prototype.y=function(a){var b=this._y;if(!a)return b;var c=function(){for(var a=0,c=b.length;a<c;a++)if(isNumber(b[a]))return b[a]}()/100;return $.map(b,function(a){return isNumber(a)?a/c-100:void 0})};
|
|
TradingView.MiniChartWidgetRectangle=function(a,b,c,d){this.originX=new WatchedValue(a||0);this.originY=new WatchedValue(b||0);this.width=new WatchedValue(c||0);this.height=new WatchedValue(d||0)};TradingView.MiniChartWidgetRectangle.prototype.left=function(){return this.originX.value()};TradingView.MiniChartWidgetRectangle.prototype.right=function(){return this.originX.value()+this.width.value()};TradingView.MiniChartWidgetRectangle.prototype.top=function(){return this.originY.value()};
|
|
TradingView.MiniChartWidgetRectangle.prototype.bottom=function(){return this.originY.value()+this.height.value()};TradingView.MiniChartWidgetRectangle.prototype.clearBack=function(){var a=this._ctx,b=this.left()-.5,c=this.top()-.5,d=this.right()+.5,e=this.bottom()+.5;this._options.bgColor&&"transparent"!==this._options.bgColor?(a.fillStyle=this._options.bgColor,a.fillRect(b,c,d,e)):a.clearRect(b,c,d,e)};
|
|
TradingView.MiniChartWidgetPlotArea=function(a,b,c,d,e){TradingView.MiniChartWidgetRectangle.call(this);this.getWidgetPlots=a;this._ctx=b;this._xScale=c;this._yScale=d;this._options=e;this.originY.setValue("bottom"===this._xScale._options.position?0:this._xScale.height.value());this.originY.setValue=function(){console.warn("[MiniChartWidgetPlotArea] updating originY forbidden")}};inherit(TradingView.MiniChartWidgetPlotArea,TradingView.MiniChartWidgetRectangle);
|
|
TradingView.MiniChartWidgetPlotArea.prototype.draw=function(){this.clearBack();this._drawGrid();this.getWidgetPlots().length?(this._drawPlots(),this._hideLoading()):this._options.loading.showWhileNoPlots&&this._showLoading()};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawGrid=function(a){a=this._ctx;var b=this.left(),c=this.right(),d=this.top(),e=this.bottom(),f,g,h,k;a.lineWidth=this._options.grid.line.width;a.strokeStyle=this._options.grid.line.color;a.lineStyle=this._options.grid.line.style;var l=this._xScale.tickMarks();if(l.length&&this._options.grid.xIsVisible)for(var m=0;m<l.length;m++)f=l[m].coordinate,g=d,h=l[m].coordinate,k=e,CanvasEx.drawLine(a,f,g,h,k);d=this._yScale.tickMarks();if(d.length&&this._options.grid.yIsVisible)for(m=
|
|
0;m<d.length;m++)f=b,g=d[m].coordinate,h=c,k=d[m].coordinate,CanvasEx.drawLine(a,f,g,h,k)};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawPlots=function(){function a(a){return e(a)}function b(a){return f(a)}var c=this.getWidgetPlots(),d=this._ctx,e=this._xScale.valueToCoord.bind(this._xScale),f=this._yScale.valueToCoord.bind(this._yScale);this.left();this.right();for(var g=this.top(),h=this.bottom(),k,l,m,n=0;n<c.length;n++)k=c[n],l=$.map(k.x(),a),m=$.map(k.y(this._yScale._options.isPercentage),b),1===l.length?this._drawCircle(l[0],m[0],k._options.line.width,k._options.line.color):
|
|
(k._options.belowLineFillStyle&&"transparent"!==k._options.belowLineFillStyle&&this._drawNearAroundArea(d,l,m,h,k._options.belowLineFillStyle),k._options.aboveLineFillStyle&&"transparent"!==k._options.aboveLineFillStyle&&this._drawNearAroundArea(d,l,m,g,k._options.aboveLineFillStyle),this._drawLine(d,l,m,k._options.line.width,k._options.line.color))};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawNearAroundArea=function(a,b,c,d,e){var f=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),g=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==f||null!==g){a.fillStyle=e;a.beginPath();a.moveTo(b[f],d);for(e=f;e<=g;e++)isNumber(b[e])&&isNumber(c[e])&&a.lineTo(b[e],c[e]);a.lineTo(b[g],d);a.closePath();a.fill()}};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawLine=function(a,b,c,d,e){var f=function(){for(var a=0,d=b.length;a<d;a++)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}(),g=function(){for(var a=b.length-1;0<=a;a--)if(isNumber(b[a])&&isNumber(c[a]))return a;return null}();if(null!==f||null!==g){a.lineWidth=d;a.strokeStyle=e;a.moveTo(b[f],c[f]);a.beginPath();for(d=f;d<=g;d++)isNumber(b[d])&&isNumber(c[d])&&a.lineTo(b[d],c[d]);a.stroke()}};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._drawCircle=function(a,b,c,d,e){isNumber(b)&&isNumber(c)&&(a.beginPath(),a.arc(b,c,d,0,2*Math.PI,!1),a.fillStyle=e,a.fill())};
|
|
TradingView.MiniChartWidgetPlotArea.prototype._showLoading=function(){this._$loadingIndicator||(this._$loadingIndicator=$("<div></div>"),(new Spinner({lines:this._options.loading.lines,length:this._options.loading.length,width:this._options.loading.width,radius:this._options.loading.radius,corners:this._options.loading.corners,rotate:0,direction:1,color:this._options.loading.color||this._options.grid.line.color,speed:this._options.loading.speed,trail:100,shadow:!1,hwaccel:!1,className:"spinner",zIndex:1,
|
|
top:"50%",left:"50%"})).spin(this._$loadingIndicator.get(0)),this._$loadingIndicator.insertAfter(this._ctx.canvas));this._$loadingIndicator.show()};TradingView.MiniChartWidgetPlotArea.prototype._hideLoading=function(){this._$loadingIndicator&&this._$loadingIndicator.hide()};TradingView.MiniChartWidgetAbstractScale=function(a,b,c){TradingView.MiniChartWidgetRectangle.call(this);this._ctx=b;this._options=c;this._max=this._min=null;this._tickMarks=[];this.getWidgetPlots=a};
|
|
inherit(TradingView.MiniChartWidgetAbstractScale,TradingView.MiniChartWidgetRectangle);
|
|
TradingView.MiniChartWidgetAbstractScale.prototype._calculateTickMarks=function(a,b,c){function d(a){return Math.round(1E6*a)/1E6+(h._options.isPercentage?"%":"")}function e(a){var e=d(a);a=h.valueToCoord(a);if("vertical"===c&&!p)return a;if("vertical"===c&&p)return a+.5*b(e);if("horizontal"===c&&!p)return a;if("horizontal"===c&&p)return a-.5*b(e)}function f(a){var e=d(a);a=h.valueToCoord(a);if("vertical"===c&&!p)return a-h._GREED_MARGIN-b(e);if("vertical"===c&&p)return a-.5*b(e);if("horizontal"===
|
|
c&&!p)return a+h._GREED_MARGIN+b(e);if("horizontal"===c&&p)return a+.5*b(e)}function g(a,b){return"vertical"===c?f(a)-n>e(b):f(a)+n<e(b)}var h=this,k=h._min,l=h._max;if(!a||null===k||null===l||"function"!==typeof b)return[];c=c||"vertical";var m=h._options.maxTickMarkAmount||10,n=a/(m||20),p=!h._options.drawOverPlotArea;a=[];if(k===l)a=[k];else for(;0<m;){a=(l-k)/m;var r=Math.pow(10,Math.ceil(Math.log(a)/Math.LN10));r/5>=a&&(r/=5);r/2>=a&&(r/=2);var t=Math.floor(k/r)*r;t<k&&(t=Math.ceil(k/r)*r);for(a=
|
|
[t];a[a.length-1]+r<=l;)a.push(a[a.length-1]+r);for(var r=!1,v,w=1;w<a.length;w++)if(v=a[w],g(t,v))t=v;else{r=!0;break}if(r)m--;else break}return $.map(a,function(a){return{text:d(a),coordinate:Math.round(h.valueToCoord(a))}})};TradingView.MiniChartWidgetAbstractScale.prototype.tickMarks=function(){return this._tickMarks};
|
|
TradingView.MiniChartWidgetAbstractScale.prototype.draw=function(){if(this._options.visible){var a=this._tickMarks,b=this._ctx;this._options.drawOverPlotArea||this.clearBack();if(!this._options.drawOverPlotArea&&this._options.borderColor&&"transparent"!==this._options.borderColor){b.strokeStyle=this._options.borderColor;b.lineWidth=1;b.beginPath();switch(this._options.position){case "left":b.moveTo(this.right(),this.top());b.lineTo(this.right(),this.bottom());break;case "right":b.moveTo(this.left(),
|
|
this.top());b.lineTo(this.left(),this.bottom());break;case "top":b.moveTo(this.left(),this.bottom());b.lineTo(this.right(),this.bottom());break;case "bottom":b.moveTo(this.left(),this.top()),b.lineTo(this.right(),this.top())}b.stroke()}b.fillStyle=this._options.font.color;b.font=this._options.font.size+"px "+this._options.font.family;for(var c=0;c<a.length;c++)b=a[c],this._drawLabel(b.coordinate,b.text)}};
|
|
TradingView.MiniChartWidgetXScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._series=[];this.height.setValue("number"==typeof this._options.height&&this._options.height||this._options.paddingBottom+this._options.font.size+this._options.paddingTop);this.height.setValue=function(){console.warn("[MiniChartWidgetXScale] updating height forbidden")};this.width.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=2};
|
|
inherit(TradingView.MiniChartWidgetXScale,TradingView.MiniChartWidgetAbstractScale);TradingView.MiniChartWidgetXScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.right()-this.left())/2:this.left()+this._pixelsPerValue*(a-this._min)};TradingView.MiniChartWidgetXScale.prototype.onPlotsChanged=function(){this._updateSeries();this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetXScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks()};
|
|
TradingView.MiniChartWidgetXScale.prototype._updateSeries=function(){this._series=this.getWidgetPlots().length?this.getWidgetPlots()[0].x():[]};TradingView.MiniChartWidgetXScale.prototype._updateMinMax=function(){this._min=this._series.length?this._series[0]:null;this._max=this._series.length?this._series[this._series.length-1]:null};TradingView.MiniChartWidgetXScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=this.width.value()/(this._max-this._min)};
|
|
TradingView.MiniChartWidgetXScale.prototype._updateTickMarks=function(){var a=this.width.value(),b=function(a){return this._ctx.measureText(a).width}.bind(this);this._tickMarks=this._options.isTimeScale?this._calculateTimeTickMarks(a,b):this._calculateTickMarks(a,b,"horizontal")};
|
|
TradingView.MiniChartWidgetXScale.prototype._calculateTimeTickMarks=function(a,b){if(!a||null===this._min||null===this._max||"function"!==typeof b)return[];var c=this._max-this._min,d=c/86400,e=[],f=[],e=this._ctx;e.font=this._options.fontSize+"px "+this._options.fontFamily;e.fillStyle=this._options.fontColor;e.textBaseline="bottom";2>d?e=this._timeSplit(a,b,this._trimToHour,this._formatHour):3>d?e=this._timeSplit(a,b,this._trimToHour,this._formatDayHour):6>d?e=this._timeSplit(a,b,this._trimToDay,
|
|
this._formatDay):6>c/604800?e=this._timeSplit(a,b,this._trimToWeek,this._formatDay):15>c/2592E3?(e=(new Date(1E3*this._max)).getFullYear()===(new Date).getFullYear()?this._formatMonthOnly:this._formatMonthYear,e=this._timeSplit(a,b,this._trimToMonth,e)):(e=c/31104E3,e=6>e?this._timeSplit(a,b,this._trimToYear,this._formatYear):30>e?this._timeSplit(a,b,this._trimTo5Years,this._formatYear):50>e?this._timeSplit(a,b,this._trimTo10Years,this._formatYear):this._timeSplit(a,b,this._trimTo25Years,this._formatYear));
|
|
c=0;for(d=e.length;c<d;c++){var g=this.valueToCoord(this._series[e[c].index]);f.push({text:""+e[c].text,coordinate:g})}return f};
|
|
TradingView.MiniChartWidgetXScale.prototype._timeSplit=function(a,b,c,d){for(var e=[],f=null,g=a/20,h=0,k=this._series.length;h<k;h++){var l=c.call(this,new Date(1E3*this._series[h])),m=d.call(this,l);if(null===f)f=l;else{var n=this.valueToCoord(this._series[h]),p=0<n&&n<a;if(e.length&&p)var p=this.valueToCoord(this._series[e[e.length-1].index]),r=b(e[e.length-1].text),p=p+r+g<=n;p&&f.valueOf()!==l.valueOf()&&(e.push({index:h,text:m}),f=l)}}return e};
|
|
TradingView.MiniChartWidgetXScale.prototype._trimToHour=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours())};TradingView.MiniChartWidgetXScale.prototype._trimToDay=function(a){return new Date(a.getFullYear(),a.getMonth(),a.getDate())};TradingView.MiniChartWidgetXScale.prototype._trimToMonth=function(a){return new Date(a.getFullYear(),a.getMonth(),1)};TradingView.MiniChartWidgetXScale.prototype._trimToYear=function(a){return new Date(a.getFullYear(),1,1)};
|
|
TradingView.MiniChartWidgetXScale.prototype._trimToWeek=function(a){a=this._trimToDay(a);return new Date(a.valueOf()-864E5*a.getDay())};TradingView.MiniChartWidgetXScale.prototype._trimTo5Years=function(a){a=a.getFullYear();return new Date(a-a%5,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo10Years=function(a){a=a.getFullYear();return new Date(a-a%10,1,1)};TradingView.MiniChartWidgetXScale.prototype._trimTo25Years=function(a){a=a.getFullYear();return new Date(a-a%25,1,1)};
|
|
TradingView.MiniChartWidgetXScale.prototype._monthNames="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");TradingView.MiniChartWidgetXScale.prototype._formatHour=function(a){a=a.getHours().toString();1===a.length&&(a="0"+a);return a+":00"};TradingView.MiniChartWidgetXScale.prototype._formatDayHour=function(a){return this._formatDay(a)+" "+this._formatHour(a)};TradingView.MiniChartWidgetXScale.prototype._formatDay=function(a){return this._monthNames[a.getMonth()]+","+a.getDate()};
|
|
TradingView.MiniChartWidgetXScale.prototype._formatMonthOnly=function(a){return this._monthNames[a.getMonth()]};TradingView.MiniChartWidgetXScale.prototype._formatMonthYear=function(a){return this._monthNames[a.getMonth()]+", "+a.getFullYear()};TradingView.MiniChartWidgetXScale.prototype._formatYear=function(a){return a.getFullYear()};
|
|
TradingView.MiniChartWidgetXScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=c.measureText(b).width,d=this._options.drawOverPlotArea?a+this._GREED_MARGIN:a-d/2,d=Math.min(this.right(),d),d=Math.max(this.left(),d),e="bottom"===this._options.position?this.bottom()-this._options.paddingBottom:this.top()+this._options.paddingTop+this._options.font.size;c.textBaseline="bottom";c._fillText(b,d,e);this._options.drawTickMarkLine&&this._options.borderColor&&"transparent"!==this._options.borderColor&&
|
|
(c.strokeStyle=this._options.borderColor,c.beginPath(),"bottom"===this._options.position?(c.moveTo(a,this.top()),c.lineTo(a,this.top()+2)):(c.moveTo(a,this.bottom()),c.lineTo(a,this.bottom()-2)),c.stroke())};TradingView.MiniChartWidgetYScale=function(a,b,c){TradingView.MiniChartWidgetAbstractScale.apply(this,arguments);this._max=this._min=null;this.height.subscribe(this._updateSize.bind(this));this._GREED_MARGIN=1};inherit(TradingView.MiniChartWidgetYScale,TradingView.MiniChartWidgetAbstractScale);
|
|
TradingView.MiniChartWidgetYScale.prototype.onPlotsChanged=function(){this._updateMinMax();this._updateSize()};TradingView.MiniChartWidgetYScale.prototype._updateMinMax=function(){for(var a=this.getWidgetPlots(),b=null,c=null,d,e,f=0;f<a.length;f++){d=MathEx.min(a[f].y(this._options.isPercentage));e=MathEx.max(a[f].y(this._options.isPercentage));if(null===b||d<b)b=d;if(null===c||c<e)c=e}this._min=b;this._max=c};
|
|
TradingView.MiniChartWidgetYScale.prototype._updatePixelsPerValue=function(){this._pixelsPerValue=(this.height.value()-2*this._margin())/(this._max-this._min)};TradingView.MiniChartWidgetYScale.prototype._updateTickMarks=function(){var a=this.height.value(),b=function(){return this._options.font.size}.bind(this);this._tickMarks=this._calculateTickMarks(a,b,"vertical")};
|
|
TradingView.MiniChartWidgetYScale.prototype._updateSize=function(){this._updatePixelsPerValue();this._updateTickMarks();var a="number"==typeof this._options.width&&this._options.width||this._options.paddingLeft+this._maxLabelWidth()+this._options.paddingRight;this.width.setValue(a)};TradingView.MiniChartWidgetYScale.prototype._maxLabelWidth=function(){for(var a=0,b=0;b<this._tickMarks.length;b++)a=Math.max(a,this._ctx.measureText(this._tickMarks[b].text).width);return a};
|
|
TradingView.MiniChartWidgetYScale.prototype._margin=function(){return this.height.value()*this._options.marginInPercents/100};TradingView.MiniChartWidgetYScale.prototype.valueToCoord=function(a){return this._min===this._max?(this.bottom()-this.top())/2:this.height.value()-this._margin()-this._pixelsPerValue*(a-this._min)};
|
|
TradingView.MiniChartWidgetYScale.prototype._drawLabel=function(a,b){var c=this._ctx,d=this._options.drawOverPlotArea?a-this._GREED_MARGIN:a+this._options.font.size/2,d=Math.max(this.top()+this._options.font.size,d),d=Math.min(this.bottom(),d),e="number"==typeof this._options.width&&this._options.width||this._options.paddingLeft+this._maxLabelWidth()+this._options.paddingRight,e="left"===this._options.position?this.left()+e-this._ctx.measureText(b).width-this._options.paddingRight:this.right()-e+
|
|
this._options.paddingLeft;c.textBaseline="bottom";c._fillText(b,e,d);this._options.drawTickMarkLine&&(this._options.borderColor&&"transparent"!==this._options.borderColor&&(c.strokeStyle=this._options.borderColor),c.beginPath(),"left"===this._options.position?(c.moveTo(this.right(),a),c.lineTo(this.right()-2,a)):(c.moveTo(this.left(),a),c.lineTo(this.left()+2,a)),c.stroke())};TradingView.RenameChartDialog=function(a,b,c){this.title=a||$.t("Rename Chart Layout");this.label=b||$.t("Enter a new chart layout name");this.maxlength=c||""};
|
|
TradingView.RenameChartDialog.prototype.show=function(a){var b=$.Deferred(),c=A83.createDialog(this.title),d=function(){var a=c.find('input[name="name"]'),d=a.val();d?(b.resolve(d),A83.destroy(this.title)):(A83.showError($.t("Please enter chart layout name"),A83.get(this.title)),a.focus());return!1}.bind(this);c.css("width","400px");c.find(".tv-dialog-content").html('<div class="main"><form><p>'+this.label+':</p><p class="tv-dialogs-name"><input type="text" name="name" maxlength="'+
|
|
this.maxlength+'"/></p><p class="tv-dialog-right"></p></form></div>');c.find("form").submit(d);$('<a class="tv-button wide ok">'+$.t("OK")+"</a>").click(d).css({"margin-right":"5px"}).appendTo(c.find(".tv-dialog-right"));$('<a class="tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){A83.destroy(this.title)}.bind(this)).appendTo(c.find(".tv-dialog-right"));A83.positionDialog(c,{left:$(window).width()/2-c.width()/2,top:$(window).height()/2-c.height()/2});A83.applyHandlers(c);
|
|
c.find('input[name="name"]').val(a).focus().select();return b};TradingView.LoadChartDialog=function(){this.title=$.t("Load Chart Layout");this.options={};this.inputDelegate=new Delegate;this.matchedItems=[];this.itemsData=[];this.qs=new TradingView.LoadChartDialog.QuickSearch(this.inputDelegate,this.fieldsExtractor,this.searchResult.bind(this));this.sortObj=new TradingView.LoadChartDialog.SortObject(this.modifiedCompare);this.nameSort=new TradingView.LoadChartDialog.SortObject(this.nameCompare);this.symbolSort=new TradingView.LoadChartDialog.SortObject(this.symbolCompare);
|
|
this.toolsSort=new TradingView.LoadChartDialog.SortObject(this.toolsCompare);D17.on("chart_loaded",TradingView.LoadChartDialog.onChartLoaded,this)};TradingView.LoadChartDialog.onChartLoaded=function(){this.itemsData&&0<this.itemsData.length&&this._refreshChartsList()};TradingView.LoadChartDialog.QuickSearch=function(a,b,c){this.fieldsExtractor=b;this.callback=c;this.regExps=[];a.subscribe(this,this.onInput)};
|
|
TradingView.LoadChartDialog.QuickSearch.prototype.onInput=function(a){this.query=a;this.createRegexps(a);this.search()};TradingView.LoadChartDialog.QuickSearch.prototype.createRegexps=function(a){this.regExps=[];this.regExps.push(new RegExp("("+a.split("").map(function(a){return TradingView.RegExpEscape(a)}).join(")(.*?)(")+")","i"))};
|
|
TradingView.LoadChartDialog.QuickSearch.prototype.match=function(a){for(var b=0;b<this.regExps.length;b++){var c=this.regExps[b];c.lastIndex=0;for(var d=this.fieldsExtractor(a),e=0;e<d.length;e++)if(c.test(d[e]))return!0}return!1};TradingView.LoadChartDialog.QuickSearch.prototype.search=function(){for(var a=[],b=0;b<this.items.length;b++){var c=this.items[b];this.match(c)&&a.push(c)}this.callback(a,this.regExps)};TradingView.LoadChartDialog.QuickSearch.prototype.setItems=function(a){this.items=a};
|
|
TradingView.LoadChartDialog.SortObject=function(a,b){this.isAscending=!1;this.sortingFunc=a;this.getPredicate=function(){return function(a,b){var e=this.sortingFunc(a,b);this.isAscending&&(e*=-1);return e}.bind(this)};this.inverse=function(){this.isAscending=!this.isAscending};this.setIsAscending=function(a){"boolean"==typeof a&&(this.isAscending=a);return this.isAscending};this.reset=function(){this.isAscending=!1}};
|
|
TradingView.LoadChartDialog.prototype.fieldsExtractor=function(a){var b=TradingView.LoadChartDialog.symbolWrap(a);return[a.title,b]};TradingView.LoadChartDialog.prototype.saveFavorite=function(a,b){b?this.favorites[a]=b:delete this.favorites[a]};TradingView.LoadChartDialog.prototype.filterFavorites=function(){var a={};this.itemsData.map(function(b){this.favorites.hasOwnProperty(b.id)&&(a[b.id]=!0)}.bind(this));this.favorites=a};TradingView.LoadChartDialog.prototype.getFavorite=function(a){return this.favorites.hasOwnProperty(a)};
|
|
TradingView.LoadChartDialog.prototype._appendListItem=function(a){var b=$('<div class="item">').appendTo(this.itemsList);a.active()&&b.addClass("active");var c=moment.unix(a.modified),d=$('<div class="value name first">').appendTo(b);if(R77.enabled("items_favoriting")){var e=$('<div class="icon-favorite">').appendTo(d).click(function(b){this.saveFavorite(a.id,!this.getFavorite(a.id));this.filterFavorites();this.fillList();a.favoriteAction(this.favorites);b.stopPropagation()}.bind(this));this.getFavorite(a.id)&&
|
|
e.addClass("active")}$('<span class="text">').text(a.title).appendTo(d);d=$('<div class="actions">').appendTo(b);$('<div class="icon-delete">').appendTo(d).click(function(b){var c=this,d=$.Deferred();a.deleteAction(d);d.then(function(){c.removeItem(a)});b.stopPropagation()}.bind(this));$('<div class="value modified">').text(c.format("L LT")).appendTo(b);c=""===a.symbol?"multiple charts":a.symbol+", "+a.interval;$('<div class="value symbol last">').text(c).appendTo(b);b.click(function(b){!0!==this.itemsList.executing&&
|
|
(this.itemsList.executing=!0,a.openAction(),setTimeout(function(){this.itemsList.executing=!1}.bind(this),1E3))}.bind(this))};TradingView.LoadChartDialog.prototype.removeItem=function(a){a=this.itemsData.indexOf(a);-1<a&&this.itemsData.splice(a,1);this.setChartsData(this.itemsData)};TradingView.LoadChartDialog.prototype.modifiedCompare=function(a,b){var c=a.modified;return moment(b.modified).diff(moment(c))};TradingView.LoadChartDialog.prototype.nameCompare=function(a,b){return a.title.localeCompare(b.title)};
|
|
TradingView.LoadChartDialog.symbolWrap=function(a){return""===a.symbol?"multiple charts":a.symbol+" "+a.interval};TradingView.LoadChartDialog.prototype.symbolCompare=function(a,b){return TradingView.LoadChartDialog.symbolWrap(a).localeCompare(TradingView.LoadChartDialog.symbolWrap(b))};TradingView.LoadChartDialog.prototype.toolsCompare=function(a,b){var c=a.toolsCount,d=b.toolsCount;return c<d?-1:c==d?0:1};
|
|
TradingView.LoadChartDialog.prototype.sortClick=function(a){this.setSort($(a.target).data("sort"),!0);this.fillList()};
|
|
TradingView.LoadChartDialog.prototype.setSort=function(a,b){var c=TVSettings.getValue("loadChartDialog.sort.field")||"modified",d=TVSettings.getValue("loadChartDialog.sort.asc")||"0",e=a||c,f=b?"0"==d?"1":"0":d,g;if(!this.currentSortObj||(g=e!=c))this.currentSortObj="name"==e?this.nameSort:"symbol"==e?this.symbolSort:"tools"==e?this.toolsSort:this.sortObj,g&&TVSettings.setValue("loadChartDialog.sort.field",e);this.currentSortObj.setIsAscending("1"==f);f!=d&&TVSettings.setValue("loadChartDialog.sort.asc",
|
|
f);$.each(this.header.children(".item"),function(){$(this).data("sort");$(this)[$(this).data("sort")==e?"addClass":"removeClass"]("active")})};TradingView.LoadChartDialog.prototype.sortList=function(){var a=[],b=[];this.matchedItems.map(function(c){this.favorites.hasOwnProperty(c.id)?a.push(c):b.push(c)}.bind(this));if(void 0!==this.currentSortObj){var c=this.currentSortObj.getPredicate();b.sort(c);a.sort(c)}this.matchedItems=a.concat(b)};
|
|
TradingView.LoadChartDialog.prototype.fillList=function(){var a=this;this.sortList();this.itemsList.children(".item").remove();$.each(this.matchedItems,function(){a._appendListItem(this)});this.highlightOccurrences(this.qs.regExps)};TradingView.LoadChartDialog.prototype.searchResult=function(a,b){this.matchedItems=a;this.fillList()};TradingView.LoadChartDialog.prototype.updateChartsData=function(a){this.setChartsData(a)};
|
|
TradingView.LoadChartDialog.prototype.updateFavoritesData=function(a){this.favorites=a;this.itemsList&&this.inputDelegate.fire(this.input.val())};TradingView.LoadChartDialog.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData);this.inputDelegate.fire(this.input.val())};TradingView.LoadChartDialog.prototype.setChartsData=function(a){this.itemsList&&(this.itemsData=a,this.qs.setItems(a),this.inputDelegate.fire(this.input.val()))};
|
|
TradingView.LoadChartDialog.prototype.layoutHeader=function(){var a=$('<div class="list-header">').appendTo(this.content);$('<div class="item name first">').text($.t("Chart Layout Name")).data("sort","name").appendTo(a);$('<div class="item modified">').text($.t("Last Modified")).data("sort","modified").appendTo(a);$('<div class="item symbol last">').text($.t("Active Symbol")).data("sort","symbol").appendTo(a);return a};
|
|
TradingView.LoadChartDialog.prototype.resetSort=function(){this.sortObj.reset();this.nameSort.reset();this.symbolSort.reset();this.toolsSort.reset();this.currentSortObj=this.sortObj};TradingView.LoadChartDialog.prototype.resetSearchClick=function(){this.input.val("").trigger("input").focus()};
|
|
TradingView.LoadChartDialog.prototype.show=function(a,b){this.options.width="654px";this.options.content='<div class="load-chart">'+(R77.enabled("new_chart_creation_available")?'<a class="button new-chart">'+$.t("NEW CHART LAYOUT")+"</a>":"")+'<div class="chart-search"><input type="text" name="q" value="" autocomplete="off" placeholder="'+$.t("Search")+'"><a class="input-reset"></a><div class="search-icon"></div></div></div>';var c=A83.createDialog(this.title,this.options);A83.positionDialog(c);
|
|
this.input=c.find(".chart-search input");this.inputReset=c.find(".chart-search .input-reset");this.content=$('<div class="list-content"></div>').appendTo(c.find(".load-chart"));this.header=this.layoutHeader();this.setSort();this.itemsListContainer=$('<div class="charts-list-container">').appendTo(this.content);this.itemsList=$('<div class="charts-list">').appendTo(this.itemsListContainer);this._scroll=new A59(this.itemsListContainer,this.itemsList,{showBottomShadow:!1});
|
|
c.find(".new-chart").click(this.openNewChart);this.header.children(".item").click($.proxy(this,"sortClick"));this.inputReset.click($.proxy(this,"resetSearchClick"));this.input.on("input propertychange",function(){this._scroll.scrollTo(0);this.inputDelegate.fire(this.input.val());""!==this.input.val()?this.inputReset.show():this.inputReset.hide()}.bind(this));var d;R77.enabled("saveload_requires_authentication")&&!is_authenticated&&(this.content.hide(),d=$('<div class="please-log-in"></div>').appendTo(c.find(".load-chart")),
|
|
$('<a href="#" class="link">'+$.t("You are not logged in. Please sign in.")+"</a>").appendTo(d).click(function(a){a.preventDefault();A83.destroy(this.title);A83.showSignInDialog(null,{mode:"signin"})}.bind(this)));this.favorites=b;this.setChartsData(a);var e=this;A83.applyHandlers(c,{doNotCloseOnBgClickIfShadowbox:!0,beforeDestroy:function(){D17.on("chart_loaded",TradingView.LoadChartDialog.onChartLoaded,e)}});var f=this.itemsListContainer;d&&(f=d);A83.resizeContent(c.height(),
|
|
f);A83.positionDialog(c)};TradingView.LoadChartDialog.prototype.openNewChart=function(){TradingView.openNewChart()};TradingView.LoadChartDialog.prototype.highlightOccurrences=function(a){this.itemsList.children(".item").each(function(){var b=$(this).find(".value.name").find("span"),c=b.text(),c=TradingView.LoadChartDialog.highlightText(c,a);b.html(c);b=$(this).find(".value.symbol");c=b.text();c=TradingView.LoadChartDialog.highlightText(c,a);b.html(c)})};
|
|
TradingView.LoadChartDialog.highlightText=function(a,b){a=$("<div>").text(a).html();if(0===b.length)return a;for(var c=0;c<b.length;c++){var d=b[c];d.lastIndex=0;var e="",f="";if((f=d.exec(a))&&f.length)for(var g=1;g<f.length;g++)e=g%2?e+('<span class="match">$'+g+"</span>"):e+("$"+g);if((f=a.replace(d,e))&&f!==a)return f}};TradingView.ChangeIntervalDialog=function(a){this._options=a||{};this._setInput();this._caption=$('<i class="interval-caption">').html(" ");this._helpTooltipTrigger=$('<i class="help-tooltip-trigger">').text("?").blueTooltip($.t("interval_dialog_description"),"bottom");this._dialogTitle=$.t("Change Interval")};
|
|
TradingView.ChangeIntervalDialog.prototype._setInput=function(){this._input=$('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">');this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate();this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))};
|
|
TradingView.ChangeIntervalDialog.prototype._validate=function(){var a=this._input.val();this._parsed=A69.parseIntervalValue(a);this._valid=!this._parsed.error;(this._supported=!this._parsed.error&&A69.intervalIsSupported(a))&&(!this._parsed.unit||"H"==this._parsed.unit)&&1440<this._parsed.qty*("H"==this._parsed.unit?60:1)&&(this._supported=!1)};
|
|
TradingView.ChangeIntervalDialog.prototype._updateCaption=function(){var a;this._valid&&this._supported?(a=this._parsed.qty||1,a=a+" "+$.t(this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month"}[this._parsed.unit]:"minute",{count:a}),this._input.add(this._caption).removeClass("error")):(a=this._parsed.error?" ":$.t("Not applicable"),this._input.add(this._caption).addClass("error"));this._caption.html(a)};
|
|
TradingView.ChangeIntervalDialog.prototype._handleInput=function(a){13===a.which?this._submit():a.ctrlKey||a.metaKey||!a.charCode||!a.which||32>=a.which||A69.isIntervalChar(String.fromCharCode(a.charCode))||a.preventDefault()};
|
|
TradingView.ChangeIntervalDialog.prototype._submit=function(){if(A83.isOpen(this._dialogTitle)){if(this._valid&&this._supported){var a=A69.sanitizeIntervalValue(this._input.val()),b=A45.interval.value();a&&b!=a&&"function"==typeof this._options.callback&&this._options.callback(a)}this._helpTooltipTrigger.trigger("mouseleave");A83.destroy(this._dialogTitle)}};
|
|
TradingView.ChangeIntervalDialog.prototype._setInitialValue=function(a){a=a||this._options.initialValue;var b="",c=!1;a&&","!=a?b=A69.sanitizeIntervalValue(a)||"":(b=a=A45.interval.value(),c=!0);this._input.val(b);c&&this._input.select()};TradingView.ChangeIntervalDialog.prototype.isValid=function(){return Boolean(this._valid)};
|
|
TradingView.ChangeIntervalDialog.prototype.show=function(a){var b=A83.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),c=b.find(".tv-dialog-content");b.css("min-width",0);c.css("min-width",0).mousedown(function(a){this._input.is(a.target)||a.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger));A83.applyHandlers(b);A83.positionDialog(b);this._setInitialValue(a);this._validate();this._updateCaption();
|
|
return b};TradingView.UserBugReport=function(a){this._options=a||{};this._eventName=a.eventName||"unknown";this._info=a.info||{};this._snapshotURL=null;this._ready=$.Deferred();this._sent=$.Deferred();TradingView.BrowserInfo().ready().then(this._generateSnapshot.bind(this))};
|
|
TradingView.UserBugReport.prototype._generateSnapshot=function(){var a=this._options.D6||TradingView.UserBugReport.getChartWidgetCollection();if(a){var b=this;TradingView.takeSnapshot(a,function(a){b._snapshotURL=location.protocol+"//"+location.host+"/x/"+a;b._ready.resolve()},this._ready.resolve.bind(this._ready))}else this._ready.resolve()};TradingView.UserBugReport.prototype.setInfo=function(a){this._info=a||{};return this};
|
|
TradingView.UserBugReport.prototype.setEventName=function(a){a&&"string"==typeof a&&(this._eventName=a);return this};
|
|
TradingView.UserBugReport.prototype._sendImpl=function(){var a=this._info||{};this._snapshotURL&&(a.snapshotURL=this._snapshotURL);a.browserInfo=TradingView.BrowserInfo().state();var b=this._extendedHours();"boolean"==typeof b&&(a.extendedHours=b);b=this._chartSessionDisconnects();"number"==typeof b&&(a.chartSessionDisconnects=b);a.is_pro=this._userIsPro();b=this._proOffers();Array.isArray(b)&&b.length&&(a.proOffers=b);A72.sendReport(this._eventName,a,null,!0).then(this._sent.resolve.bind(this._sent),
|
|
this._sent.reject.bind(this._sent))};TradingView.UserBugReport.prototype._extendedHours=function(){var a=this._options.D6||TradingView.UserBugReport.getChartWidgetCollection();if(a){var b;try{b=a.activeChartWidget.value().model().mainSeries().properties().extendedHours.value()}catch(c){}return b}};TradingView.UserBugReport.prototype._chartSessionDisconnects=function(){return window.D16&&D16.disconnectCount()};
|
|
TradingView.UserBugReport.prototype._userIsPro=function(){return Boolean(window.user&&user.is_pro)};TradingView.UserBugReport.prototype._proOffers=function(){return window.pro&&pro.offers()};TradingView.UserBugReport.prototype.send=function(){this._ready.done(this._sendImpl.bind(this));return this._sent};TradingView.UserBugReport.prototype.ready=function(){return this._ready};TradingView.UserBugReport.prototype.sent=function(){return this._sent};
|
|
(function(){var a;TradingView.UserBugReport.setChartWidgetCollection=function(b){b instanceof A8&&(a=b)};TradingView.UserBugReport.getChartWidgetCollection=function(){return a}})();
|
|
TradingView.BrowserInfo=function(){function a(a){if(Modernizr.websockets){var b=window.WebSocket||window.MozWebSocket;if(b){var c=Date.now().toString(36),d=new b("wss://echo.websocket.org/"),e;d.onopen=function(b){d.send(c);e=setTimeout(function(){a("Error. Websocket response timeout")},3E4)};d.onerror=function(b){clearTimeout(e);a("Error. "+b.data)};d.onmessage=function(b){clearTimeout(e);a(b.data==c?"Success":"Error. Incorrect response");d.close()}}else a("Error. Websocket constructor is undefined")}else a("Error. Not Supported")}
|
|
function b(){if(e)return e;if(!(this instanceof b))return new b;e=this;this._ready=$.Deferred();a(function(a){a&&(d=a);this._ready.resolve()}.bind(this))}var c=!1,d="Pending",e,f,g,h;b.prototype.browser=function(){if(f)return f;var a=String(navigator.userAgent).toLowerCase().match(/(opera|ie|firefox|chrome|trident|crios|version)[\s\/:]([\w\d\.]+)?.*?(safari|(?:rv[\s\/:]|version[\s\/:])([\w\d\.]+)|$)/)||[null,"unknown",0];"trident"==a[1]?(a[1]="ie",a[4]&&(a[2]=a[4])):"crios"==a[1]&&(a[1]="chrome");
|
|
var b=String("version"==a[1]?a[3]:a[1]),a=parseFloat("opera"==a[1]&&a[4]?a[4]:a[2]),b="ie"==b?"Internet Explorer":b.replace(/^[a-z]/,function(a){return a.toUpperCase()});return b+" "+a};b.prototype.setBrowser=function(a){"string"==typeof a&&a&&(f=a)};b.prototype.os=function(){if(g)return g;for(var a=0,b="Unknown",c=[[/Win16/,"Windows 3.11"],[/(Windows 95|Win95|Windows_95)/,"Windows 95"],[/(Win 9x 4.90|Windows ME)/,"Windows ME"],[/(Windows 98|Win98)/,"Windows 98"],[/Windows CE/,"Windows CE"],[/(Windows NT 5.0|Windows 2000)/,
|
|
"Windows 2000"],[/(Windows NT 5.1|Windows XP)/,"Windows XP"],[/Windows NT 5.2/,"Windows Server 2003"],[/Windows NT 6.0/,"Windows Vista"],[/(Windows 7|Windows NT 6.1)/,"Windows 7"],[/(Windows 8.1|Windows NT 6.3)/,"Windows 8.1"],[/(Windows 8|Windows NT 6.2)/,"Windows 8"],[/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/,"Windows NT 4.0"],[/Android/,"Android"],[/OpenBSD/,"Open BSD"],[/SunOS/,"Sun OS"],[/(Linux|X11)/,"Linux"],[/(iPhone|iPad|iPod)/,"iOS"],[/Mac OS X/,"Mac OS X"],[/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/,
|
|
"Mac OS"]],d=String(navigator.userAgent);a<c.length;a++)if(c[a][0].test(d)){b=c[a][1];break}return g=b};b.prototype.setOS=function(a){"string"==typeof a&&a&&(g=a)};b.prototype.cookieEnabled=function(){return navigator.cookieEnabled};b.prototype.flashVersion=function(){function a(b){return(b.match(/\d+/g)||[]).slice(0,3).join(",")}if(h)return h;var b,c;try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6")}catch(d){}if(c){try{c.AllowScriptAccess="always"}catch(e){b="6,0,0"}if(b)return h=a(b)||
|
|
"0,0,0"}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(f){}if(c){try{b=c.GetVariable("$version")}catch(g){}if(b)return h=a(b)||"0,0,0"}return(b=navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"])&&b.enabledPlugin&&(b=(b=navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"])&&b.description)?h=a(b)||"0,0,0":h="0,0,0"};b.prototype.viewportSize=function(){return $(window).width()+" x "+$(window).height()};b.prototype.screenSize=function(){return window.screen&&
|
|
(screen.width||screen.availWidth)+" x "+(screen.height||screen.availHeight)||"unknown"};b.prototype.colorDepth=function(){return window.screen&&screen.colorDepth||"unknown"};b.prototype.pixelRatio=function(){return window.hidpiCanvasRatio||window.devicePixelRatio||0};b.prototype.wsTestResult=function(){return d};b.prototype.confirmBrowser=function(){c=!0};b.prototype.browserConfirmed=function(){return c};b.prototype.ready=function(){return this._ready};b.prototype.state=function(){return{os:this.os(),
|
|
browser:this.browser(),browserConfirmed:c,cookieEnabled:this.cookieEnabled(),flashVersion:this.flashVersion(),websocketTest:this.wsTestResult(),viewportSize:this.viewportSize(),screenSize:this.screenSize(),colorDepth:this.colorDepth(),pixelRatio:this.pixelRatio()}};return b}();TradingView.UserBugReportDialog=function(a){this._options=a||{};this._dialogTitle=$.t("Report data issues");this._reportEventName="data_issue";this._emailRegExp=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/};
|
|
TradingView.UserBugReportDialog.prototype._setBrowserInfo=function(){this._$browserInfoWrap=$('<div class="browser-info">').html("<span>"+$.t("You are using")+' </span><span class="broswer">'+TradingView.BrowserInfo().browser()+'</span><span> on </span><span class="os">'+TradingView.BrowserInfo().os()+"</span>. ").appendTo(this._$container);TradingView.BrowserInfo().browserConfirmed()||(this._$confirmWrap=$("<span>").appendTo(this._$browserInfoWrap),$("<span>"+$.t("Correct")+"?</span>").appendTo(this._$confirmWrap),
|
|
this._$yesButton=$('<a href="#yes">'+$.t("Yes")+"</a>").click(this._onConfirmBrowserYesClick.bind(this)).appendTo(this._$confirmWrap),this._$noButton=$('<a href="#no">'+$.t("No")+"</a>").click(this._onConfirmBrowserNoClick.bind(this)).appendTo(this._$confirmWrap))};
|
|
TradingView.UserBugReportDialog.prototype._onConfirmBrowserNoClick=function(a){a.preventDefault();this._$browserInfoWrap.addClass("editing");this._$browserInput=$(document.createElement("input")).attr("type","text").val(TradingView.BrowserInfo().browser()).addClass("tv-text-input").appendTo(this._$browserInfoWrap.find(".broswer").empty());this._$osInput=$(document.createElement("input")).attr("type","text").val(TradingView.BrowserInfo().os()).addClass("tv-text-input").appendTo(this._$browserInfoWrap.find(".os").empty());
|
|
this._$yesButton.text("ok").detach();this._$confirmWrap.empty().append(this._$yesButton);this._$browserInput.focus()};
|
|
TradingView.UserBugReportDialog.prototype._onConfirmBrowserYesClick=function(a){a.preventDefault();this._$confirmWrap&&(this._$confirmWrap.html("Thanks!"),setTimeout(function(){this._$confirmWrap.remove();this._$confirmWrap=null}.bind(this),1500));this._$browserInfoWrap.hasClass("editing")&&(TradingView.BrowserInfo().setBrowser(this._$browserInput.val().trim()),this._$browserInfoWrap.find(".broswer").text(TradingView.BrowserInfo().browser()),TradingView.BrowserInfo().setOS(this._$osInput.val().trim()),
|
|
this._$browserInfoWrap.find(".os").text(TradingView.BrowserInfo().os()),this._$browserInfoWrap.removeClass("editing"));TradingView.BrowserInfo().confirmBrowser()};
|
|
TradingView.UserBugReportDialog.prototype._checkForm=function(){var a=this._$issueTypeInput.val(),b=this._$descriptionInput.val().trim(),c=this._$emailInput.val().trim();return"none"==a?(this._$issueTypeInput.parent().find(".tv-select-container").addClass("error"),!1):"Alerts issue"!==a||"none"!==this._$alertInput.val()&&"_reset_"!==this._$alertInput.val()?b?c&&this._emailRegExp.test(c)?!0:(this._$emailInput.addClass("error").focus(),!1):(this._$descriptionInput.addClass("error").focus(),!1):(this._$alertInput.parent().find(".tv-select-container").addClass("error"),
|
|
!1)};
|
|
TradingView.UserBugReportDialog.prototype._setForm=function(){this._$form=$("<form>").appendTo(this._$container);var a=Date.now().toString(36),b=[$.t("Chart does not load"),$.t("No real-time data"),$.t("Price incorrect"),$.t("Study not loading"),$.t("Gap in the data"),$.t("Alerts issue"),$.t("Slow scrolling or chart loading")];$('<table><tbody><tr><td><label for="issue-type-'+a+'">'+$.t("Issue Type")+'</label></td><td><select id="issue-type-'+a+'" name="issue-type"><option value="none" selected disabled>'+$.t("Select type...")+
|
|
"</option>"+b.map(function(a){return'<option value="'+a+'">'+a+"</option>"}).join()+'</select><div class="alert-input-container"></div><div class="alert-input-message">'+$.t("Please do not modify the alert so we can investigate the issue.")+'</div></td></tr><tr><td><label for="description-'+a+'">'+$.t("Description")+'</label></td><td><textarea id="description-'+a+'" name="description"></textarea></td></tr><tr><td><label for="email-'+a+'">'+$.t("E-mail")+'</label></td><td><input id="email-'+a+'" class="tv-text-input" name="email" type="text"'+
|
|
(window.user&&user.email?' value="'+user.email+'"':"")+'></td></tr><tr><td class="buttons" colspan="2"><input class="tv-button ok" type="submit" value="'+$.t("Send")+'"><input class="tv-button cancel" type="button" value="'+$.t("Cancel")+'"></td></tr></tbody></table>').appendTo(this._$form);var c=this;this._$issueTypeInput=this._$form.find("select[name=issue-type]");this._$alertInputContainer=this._$form.find(".alert-input-container");this._$alertInputMessage=this._$form.find(".alert-input-message");
|
|
this._$alertInput=$();this._$descriptionInput=this._$form.find("textarea[name=description]");this._$emailInput=this._$form.find("input[name=email]");this._$submit=this._$form.find("input[type=submit]");this._$issueTypeInput.change(function(){"Alerts issue"===c._$issueTypeInput.val()?c._setAlertInput():(c._$alertInputMessage.hide(),c._$alertInputContainer.hide())});this._initSelect(this._$issueTypeInput);this._$form.find("input[type=button].cancel").click(function(){A83.destroy(!0===c._options.modal?
|
|
null:c._dialogTitle)});this._$form.on("input change",function(){$(this).find(".error").removeClass("error")}).submit(function(a){a.preventDefault();c._submit()})};
|
|
TradingView.UserBugReportDialog.prototype._setAlertInput=function(a){function b(a,b){c._$alertInput=$(Mustache.render('<select name="alert-id"><option value="none" selected disabled>Select alert</option>{{# alerts }}<option value="{{value}}">{{title}}</option>{{/ alerts }}'+(b?"":'<option value="_reset_">Load all alerts...</option>')+"</select>",{alerts:$.map(a,function(a){return{value:a.id(),title:a.title()+" "+a.description()}})}));c._$alertInputContainer.empty();c._$alertInput.appendTo(c._$alertInputContainer).change(function(){var a=
|
|
c._$alertInput.val();"_reset_"===a&&setTimeout(function(){c._setAlertInput(!0)},0);/^\d+$/.test(a)&&c._$alertInputMessage.show()});c._initSelect(c._$alertInput)}var c=this,d=TradingView.alertsDispatcher.stash.getAllAlerts();c._$alertInputContainer.html('<div class="loading-indicator-small"></div>').show();d.length&&!a?b(d):TradingView.alertsDispatcher.requestList({success:function(a){b(a,!0)},error:function(){c._$alertInputContainer.empty()}})};
|
|
TradingView.UserBugReportDialog.prototype._initSelect=function(a){a.selectbox({speed:100,classHolder:"tv-select-container dialog placeholder"}).change(function(){var a=$(this);a.parent().find(".tv-select-container").toggleClass("placeholder","none"==a.val())});return a};TradingView.UserBugReportDialog.prototype._onSubmitSuccess=function(){delete this._sending;A83.destroy(!0===this._options.modal?null:this._dialogTitle)};
|
|
TradingView.UserBugReportDialog.prototype._onSubmitFailure=function(){delete this._sending;this._$submit.removeClass("process");this._$form.removeClass("readonly").find("select, textarea, input[type=text]").prop("readonly",!1);this._$confirmWrap&&this._$confirmWrap.css("display","");A83.showError("Could not send your report")};
|
|
TradingView.UserBugReportDialog.prototype._submitImpl=function(){var a={issueType:this._$issueTypeInput.val(),description:this._$descriptionInput.val().trim(),email:this._$emailInput.val().trim()};"Alerts issue"===a.issueType&&(a.alertIds=[this._$alertInput.val()]);this._report.setInfo(a).send().then(this._onSubmitSuccess.bind(this),this._onSubmitFailure.bind(this))};
|
|
TradingView.UserBugReportDialog.prototype._submit=function(){!this._sending&&this._checkForm()&&(this._sending=!0,this._$confirmWrap&&this._$confirmWrap.css("display","none"),this._$form.addClass("readonly").find("select, textarea, input[type=text]").prop("readonly",!0),this._$submit.addClass("process"),this._report.ready().then(this._submitImpl.bind(this)))};
|
|
TradingView.UserBugReportDialog.prototype._prepareLayout=function(){$($.t('<p>This report is only for data issues, questionable prices or chart performance issues. This report goes directly to the backend team, so they can ensure the highest quality of the data feed. Mark on your chart in detail which bar is incorrect and any other notes – a screenshot of your chart is sent with the report automatically. While we analyze all problems, be advised that only PRO users are guaranteed a reply.</p><p class="nb"><strong>IMPORTANT:</strong> All feature requests, ideas and other questions should be posted to <a href="https://getsatisfaction.com/tradingview" target="_blank">Suggestions and Feedback Section</a>.</p>')).appendTo(this._$container);this._setBrowserInfo();
|
|
this._setForm()};TradingView.UserBugReportDialog.prototype.show=function(){this._report=new TradingView.UserBugReport({eventName:this._reportEventName});var a=A83[!0===this._options.modal?"createModalDialog":"createDialog"](this._dialogTitle,{addClass:"bug-report-dialog"});this._$container=a.find(".tv-dialog-content");this._prepareLayout();a.css("min-width",0);A83.applyHandlers(a,{notFocusFirst:!0});A83.positionDialog(!0===this._options.modal?null:a);return a};TradingView.SymbolInfoDialog=function(){return function(a,b){null==a&&(a=A45.symbol.value());if(null!=a){a+="";var c=$.t("Symbol Info"),c=A83.createDialog(c,{width:400}),d=c.find(".tv-dialog-content"),d=$(document.createElement("div")).addClass("main").addClass("symbol-info-dialog").appendTo(d),e=[{title:"Symbol Name",propName:"pro_name"},{title:"Symbol Description",propName:"description"},{title:"Symbol Type",propName:"type"},{title:"Point Value",propName:"pointvalue"},{title:"Exchange",
|
|
propName:"exchange"},{title:"Listed Exchange",propName:"listed_exchange"},{title:"Currency",propName:"currency_code",formatter:function(a){return a||"USD"},defValue:"USD"},{title:"Price Scale",propName:"pricescale"},{title:"Min Move",propName:"minmov"},{title:"Min Move 2",propName:"minmove2"},{title:"Sector",propName:"sector"},{title:"Industry",propName:"industry"}],f=$("<table cellspacing=0>").appendTo(d);e.forEach(function(a){var b=$("<tr>").appendTo(f);$("<td>").addClass("symbol-info-column").append(a.title).appendTo(b);
|
|
a.$element=$("<td>").addClass("symbol-info-value").appendTo(b)});var g=function(a){return a||"-"};e.forEach(function(a){a.$element.text(a.defValue||"-")});var h="symbolinfodialog."+TradingView.guid();quoteSessionMultiplexerInstance.full.subscribe(h,a,function(a,b){for(var c=0;c<e.length;c++){var d=e[c].propName;null!=b.values[d]&&(d=b.values[d],d=(e[c].formatter||g)(d),e[c].$element.text(d))}});A83.positionDialog(c);A83.applyHandlers(c);c.on("destroy",function(){quoteSessionMultiplexerInstance.full.unsubscribe(h,
|
|
a)});return c}}}();TradingView.MiniWidgetRenderer=function(a){this._options=this._prepareOptions(a);this._$container=this._options.container&&this._options.container instanceof $?this._options.container:$('<div style="width:100%; height:100%;"></div>').appendTo(document.body);this._tabs=this._options.tabs;this._symbols=this._options.symbols;this._current_symbol=null;this._graphs={};this._init()};
|
|
TradingView.MiniWidgetRenderer.prototype._prepareOptions=function(a){if(a.miniChartOptions&&a.miniChartOptions.chartOptions&&a.miniChartOptions.chartOptions.plot&&a.miniChartOptions.chartOptions.plot.belowLineFillStyle&&/^#[0-9a-f]{6}/i.test(a.miniChartOptions.chartOptions.plot.belowLineFillStyle)){var b=/^#(\w{2})(\w{2})(\w{2})$/.exec(a.miniChartOptions.chartOptions.plot.belowLineFillStyle);a.miniChartOptions.chartOptions.plot.belowLineFillStyle="rgba("+[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],
|
|
16),"0.3"].join()+")"}b=$.extend(!0,{},this.defaultOptions,a);b.minWidth=0;var c="https://www.tradingview.com/chart/"===a.large_chart_url,d=!a.large_chart_url;b.large_chart_url=Modernizr.canvas&&Modernizr.canvastext?c||d?this.defaultOptions.large_chart_url+"?symbol=":a.large_chart_url+"?tvwidgetsymbol=":"";b.tabs=this.defaultOptions.tabs;b.symbols=this.defaultOptions.symbols;if($.isArray(a.symbols))b.tabs=null,b.symbols=a.symbols;else if(a.tabs&&0<a.tabs.length){var e=[],f={};a.tabs.forEach(function(b){a.symbols.hasOwnProperty(b)&&
|
|
(e.push(b),f[b]=a.symbols[b])});0<e.length&&(b.tabs=e,b.symbols=f)}return b};TradingView.MiniWidgetRenderer.prototype.width=function(){return this._$container.width()};TradingView.MiniWidgetRenderer.prototype.height=function(){return this._$container.height()};
|
|
TradingView.MiniWidgetRenderer.prototype.defaultOptions={chartBottomMargin:21,symbols:{Indices:"ES1! NQ1! YM1! EW1! SP1! ND1! DJ1! VI1!".split(" "),Metals:"GC1! SI1! HG1! PL1! PA1! YG1! YI1!".split(" "),Currencies:"B61! D61! J61! S61! E61! A61! M61! N61!".split(" ")},tabs:["Indices","Metals","Currencies"],large_chart_url:"https://www.tradingview.com/chart/",noGraph:!1,miniChartOptions:{timeframe:{value:"1y",visible:!0},showDescription:!1,chartOptions:{minHeight:200,grid:{xIsVisible:!1,yIsVisible:!0,
|
|
line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#e9e9ea"}},yScale:{maxTickMarkAmount:5},xScale:{visible:!0},plot:{line:{width:2,color:"#4bafe9"},belowLineFillStyle:"rgba(219,239,251,0.5)"}}}};TradingView.MiniWidgetRenderer.prototype._init=function(){this.buildFrame();this.fixFrameSize();this.selectFirstSymbol();this._$container.resize();$(window).on("resize",this.onResize.bind(this))};
|
|
TradingView.MiniWidgetRenderer.prototype.buildFrame=function(){var a=this,b=a._options.noGraph;a._$container.addClass("mini-widget");a._$tabs=$('<div class="tabs">').appendTo(a._$container);a._$graphs=b?$():$('<div class="graph">').appendTo(a._$container);a._$divider=b?$():$('<div class="divider"></div>').appendTo(a._$container);a._$pages=$('<div class="pages">').appendTo(a._$container);a._$footer=$('<div class="footer"><span class="fade">Quotes by </span><a href="https://www.tradingview.com/chart/'+
|
|
(a._options.utmQuery?"?"+a._options.utmQuery:"")+'" target="_blank">TradingView</a></div>').appendTo(a._$container);a._tabs?$.each(a._tabs,function(c,d){var e=a.createPage(a._symbols[d]).appendTo(a._$pages),f=$('<div class="tab">').appendTo(a._$tabs);f.append($("<a></a>").text(d)).mousedown(function(c){c.preventDefault();a._$tabs.children().removeClass("active");a._$pages.children().hide();f.addClass("active");e.show();b||a.selectFirstSymbol(e)});a._options.minWidth+=f.outerWidth(!0)}):(a._$tabs.addClass("empty"),
|
|
a.createPage(a._symbols).appendTo(a._$pages));a._options.minWidth&&a._$container.css("min-width",a._options.minWidth)};TradingView.MiniWidgetRenderer.prototype.createPage=function(a){var b=$('<div class="page">'),c=$('<table class="table"></table>').appendTo(b);$('<thead><tr><td>Symbol</td><td class="symbol-last">Last</td><td>Change</td><td>(%)</td><tr></thead>').appendTo(c);c=$("<tbody>").appendTo(c);this.createTickers(a,c);return b};
|
|
TradingView.MiniWidgetRenderer.prototype.createTickers=function(a,b){function c(){d.showGraph($(this).data("symbol"));d._setTickerInactiveView($(".ticker"));d._setTickerActiveView($(this))}for(var d=this,e=0,f=a.length;e<f;e++){var g=new TradingView.WidgetRendererSymbol(a[e]),h={largeChartUrl:d._options.large_chart_url?d._options.large_chart_url+encodeURIComponent(g.name()):"",name:g.name(),description_or_name:g.description()||g.name(),description:g.description()||""},h=$(Mustache.render('<tr class="ticker"><td class="symbol-short-name-container" title="{{name}}"><a{{#largeChartUrl}} href="{{largeChartUrl}}" target="_blank"{{/largeChartUrl}}{{^description}} class="symbol-short-name"{{/description}} >{{ description_or_name }}</a></td><td class="symbol-last"> </td><td class="symbol-change"> </td><td class="symbol-change-pt"> </td></tr>',
|
|
h));h.appendTo(b);h.data("symbol",g);d._options.noGraph||(h.mousedown(c),1<f&&h.find("td").css("cursor","pointer"));new TradingView.QuoteTicker(g.name(),h,{changePercentInBrackets:!0,signPositive:!0})}};
|
|
TradingView.MiniWidgetRenderer.prototype.showGraph=function(a){if(!(!a||this._current_symbol&&a.equalTo(this._current_symbol)||this._options.noGraph)){var b=this;b._current_symbol=a;for(var c in b._graphs)b._graphs[c].model.connected()&&b._graphs[c].model.disconnect();c=a.name();if(b._graphs[c])b._$graphs.children().hide(),b._graphs[c].el.show(),b._graphs[c].model.connect();else{var d=$("<div></div>"),e=$.extend(!0,{},b._options.miniChartOptions||{},{onFirstData:function(){Modernizr.canvas&&Modernizr.canvastext&&
|
|
b._$graphs.children().css("opacity","1");b._$graphs.children().hide();d.show()},description:a.description(),timeframe:{value:a.timeframe()}});Modernizr.canvas&&Modernizr.canvastext?b._$graphs.children().css("opacity","0.6"):b._$graphs.children().hide();d.appendTo(b._$graphs);try{b._graphs[c]={el:d,model:new TradingView.MiniChart(a.name(),d,e)}}catch(f){console.warn(f)}1!=b._$graphs.children().length&&d.hide()}}};
|
|
TradingView.MiniWidgetRenderer.prototype.fixFrameSize=function(a){a=this.height.bind(this);var b=TradingView.MiniChartWidget.prototype.defaults().minHeight,c=MathEx.max($.map(this._$pages.find("table"),function(a){return $(a).outerHeight(!0)})),d=this._$tabs.outerHeight(),e=this._$divider.outerHeight(),f=this._$footer.outerHeight(),g=b;this._options.noGraph?(a=a()-d-e-f,this._$pages.height(a)):(d+g+e+c+f<a()&&(g=Math.max(a()-d-e-c-f,b),this._$pages.height(c)),this._$graphs.height(g),d+g+e+c+f!=a()&&
|
|
(c=a()-d-g-e-f,this._$pages.height(c)),d+g+e+c+f!=a()&&console.warn("bad height"))};TradingView.MiniWidgetRenderer.prototype.onResize=function(){var a=this;a.fixFrameSize();$.each(a._graphs,function(b,c){c.el&&(c.el.height(a._$graphs.height()),c.el.width(a._$container.width()));if(c.model)c.model.widget().onResize()})};
|
|
TradingView.MiniWidgetRenderer.prototype.selectFirstSymbol=function(a){if(this._tabs&&!a){var b=this._$pages.children(),c=b.eq(0),d=this._$tabs.children(),e=d.eq(0);d.removeClass("active");e.addClass("active");b.hide();c.show()}this._options.noGraph||(a=(a||this._$container).find(".ticker"),this._setTickerInactiveView(a),a=a.eq(0),this._setTickerActiveView(a),this.showGraph(a.data("symbol")))};
|
|
TradingView.MiniWidgetRenderer.prototype._setTickerInactiveView=function(a){a.removeClass("active").css("background-color","")};TradingView.MiniWidgetRenderer.prototype._setTickerActiveView=function(a){var b=this._options.activeTickerBackgroundColor;a.addClass("active");b&&a.css("background-color",b)};
|
|
TradingView.WidgetRendererSymbol=function(a){if($.isArray(a))this._symbol_description=a[0],this._symbol_name=a[1].split("|")[0],this._symbol_timeframe=a[1].split("|")[1];else if("string"===typeof a)this._symbol_name=a.split("|")[0],this._symbol_timeframe=a.split("|")[1];else{console.error("Symbol should be array ['description', 'symbol_name'] or string 'symbol_name'");return}this._symbol=a};TradingView.WidgetRendererSymbol.prototype.description=function(a){a&&(this._symbol_description=a);return this._symbol_description};
|
|
TradingView.WidgetRendererSymbol.prototype.shortName=function(a){a?this._symbol_short_name=a:this._symbol_short_name||(this._symbol_short_name=this._symbol_name.replace(/^(.+:)/,""));return this._symbol_short_name};TradingView.WidgetRendererSymbol.prototype.name=function(){return this._symbol_name};TradingView.WidgetRendererSymbol.prototype.timeframe=function(){return this._symbol_timeframe};
|
|
TradingView.WidgetRendererSymbol.prototype.equalTo=function(a){return a instanceof TradingView.WidgetRendererSymbol?this.name()==a.name()&&this.description()==a.description():(console.warn("Symbol "+a+" should be instance of TradingView.WidgetRendererSymbol"),!1)};TradingView.MediumWidgetRenderer=function(a,b,c){this._symbols=this._prepareSymbols(b);this._options=$.extend(!0,{},this.defaultOptions(),c||{});c.fundamentalsOptions&&c.fundamentalsOptions.structure&&(this._options.fundamentalsOptions.structure=c.fundamentalsOptions.structure);this.layout={jqContainer:null,jqLabelsContainer:null,jqPagesContainer:null};this._tabs=[];this._createLayout(a);this._createTabs();this.selectTab(0)};
|
|
TradingView.MediumWidgetRenderer.prototype.defaultOptions=function(){return{chartOnly:!1,miniChartOptions:{showDescription:!1,timeframe:{value:"1y",visible:!0},chartOptions:{minHeight:200,grid:{xIsVisible:!1,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#e9e9ea"}},yScale:{maxTickMarkAmount:5},xScale:{visible:!0},plot:{line:{width:2,color:"#4bafe9"},belowLineFillStyle:"rgba(219,239,251,0.5)"}}},hideFooter:!1,fundamentalsOptions:{horzDividerInPercents:4,structure:[["prev_close_price",
|
|
"open_price"],["market_cap_basic","earnings_per_share_basic_ttm"],["price_earnings_ttm","beta_1_year"]],showSymbol:!1},quoteTickerOptions:{chartLinkByType:!1},showSymbolButtons:!1}};TradingView.MediumWidgetRenderer.prototype._prepareSymbols=function(a){a=$.isArray(a)?a:[a];for(var b=[],c=0;c<a.length;c++){var d=new TradingView.WidgetRendererSymbol(a[c]);b.push(d)}return b};
|
|
TradingView.MediumWidgetRenderer.prototype._createLayout=function(a){a=$(a).addClass("tv-mediumwidget");var b=$('<div class="tv-mediumwidget-labels"></div>'),c=$('<div class="tv-mediumwidget-pages"></div>'),d=this._$footer=$(this._options.hideFooter?"":'<div class="footer"><span class="fade">Quotes by </span><a href="https://www.tradingview.com/chart/'+(this._options.utmQuery?"?"+this._options.utmQuery:"")+'" target="_blank">TradingView</a></div>');this.layout={jqContainer:a,jqLabelsContainer:b,jqPagesContainer:c,
|
|
jqFooter:d};a.append(b,c,d)};
|
|
TradingView.MediumWidgetRenderer.prototype._createTabs=function(){var a=1==this._symbols.length,b={chartOnly:!!this._options.chartOnly,miniChartOptions:this._options.miniChartOptions,showSymbolButtons:!!this._options.showSymbolButtons,fundamentalsOptions:this._options.fundamentalsOptions,quoteTickerOptions:this._options.quoteTickerOptions};this.layout.jqLabelsContainer.toggleClass("empty",a);for(var c=0;c<this._symbols.length;c++){var d=new TradingView.MediumWidgetRenderer.prototype.Tab(this,this._symbols[c],
|
|
b);$(window).resize(d.onResize.bind(d));$(this.layout.jqContainer).resize(d.onResize.bind(d));a||this.layout.jqLabelsContainer.append(d.jqLabel);this.layout.jqPagesContainer.append(d.jqPage);this._tabs.push(d)}};TradingView.MediumWidgetRenderer.prototype.selectTab=function(a){if(!TradingView.isInteger(a))a:{for(var b=this._tabs.length-1;0<=b;b--)if(a.equalTo(this._tabs[b].symbol)){a=b;break a}a=null}if(TradingView.isInteger(a)){for(b=this._tabs.length-1;0<=b;b--)this._tabs[b].hide();this._tabs[a].show()}};
|
|
TradingView.MediumWidgetRenderer.prototype.setSymbols=function(a){this._symbols=this._prepareSymbols(a)};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab=function(a,b,c){var d=this;c=c||{};d.widget=a;d.symbol=b;d.created=new Delegate;d.visible=new WatchedValue(!1);d.jqPage=$('<div class="tv-mediumwidget-page clearfix"></div>');if(c.chartOnly)d.jqAboveChart=$();else{d.jqAboveChart=$('<table class="ticker-fundamental-container">'+(c.showSymbolButtons?'<tr><td class="ticker-cell" rowspan="2"></td><td class="buttons-cell"></td></tr><tr><td class="fundamentals-cell"></td></tr>':'<tr><td class="ticker-cell"></td><td class="fundamentals-cell"></td></tr>')+
|
|
"</table>");a=d._createQuoteTicker(b,c.quoteTickerOptions);var e=d._createFundamentals(b,c.fundamentalsOptions||{}),f=c.showSymbolButtons?d._createSymbolButtons(b):$();d.jqAboveChart.find(".ticker-cell").append(a);d.jqAboveChart.find(".fundamentals-cell").append(e);d.jqAboveChart.find(".buttons-cell").append(f);d.jqAboveChart.appendTo(d.jqPage)}d._createMiniChart(b,c.miniChartOptions).appendTo(d.jqPage);d.jqLabel=$('<div class="tv-mediumwidget-label"></div>');d.jqLabel.text(b.description()||b.shortName());
|
|
d.jqLabel.click(function(){d.widget.selectTab(d.symbol)})};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype.onResize=function(){if(this.ticker)this.ticker.onResize();if(this.miniChart){var a=this.widget.layout.jqContainer.height()-this.widget.layout.jqLabelsContainer.outerHeight(!0)-this.jqAboveChart.outerHeight(!0)-(this.widget.layout.jqFooter.outerHeight(!0)||0)-parseFloat(this.miniChart.widget().$container.css("margin-top"))-parseFloat(this.miniChart.widget().$container.css("margin-bottom"));this.miniChart.widget().$container.css("height",a);this.miniChart.widget().onResize()}};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._createQuoteTicker=function(a,b){var c=this;b=b||{};var d=$(Mustache.render('<table class="tv-mediumwidget-ticker"><tr><td class="symbol-ticker-name"><div class="symbol-short-name-container"><span class="symbol-short-name">{{ shortName }}</span>{{# chartLinkByType }}<a href="" target="_blank" class="symbol-type-link" data-href="{{chartLinkByType}}" style="display: none;"> <span class="symbol-type"></span> CHART</a>{{/ chartLinkByType }}</div><div class="symbol-description-name"> </div></td></tr><tr><td class="symbol-ticker-value"><div class="symbol-last" title="Last price"> </div><div class="symbol-change-container"><div class="symbol-change" title="Change"> </div><div class="symbol-change-pt" title="Change, %"> </div></div></td></tr></table>',
|
|
{shortName:a.shortName(),chartLinkByType:b.chartLinkByType})),e=d.find(".symbol-type-link"),f=e.find(".symbol-type"),g=function(a){if(b.chartLinkByType){var c=(a||{}).type,d={stock:{name:"Stock",link:"/stocks/"},bitcoin:{name:"Bitcoin",link:"/bitcoin/"},index:{name:"Index",link:"/indices/"},forex:{name:"Forex",link:"/currencies/"},futures:{name:"Commodities Futures",link:"/commodities/"}};c in d?(e.show().attr("href",function(){return $(this).data("href")+d[c].link}),f.text(d[c].name)):e.hide()}};
|
|
c.ticker={jqEl:d,onResize:function(){var a=d.find(".symbol-ticker-value");a.css("white-space","nowrap");var b=c.jqPage.width(),e=c.jqAboveChart.width();b<e&&a.css("white-space","normal")}};c.visible.subscribe(function(){new TradingView.QuoteTicker(a.name(),d,{changePercentInBrackets:!0,setStateHook:function(a,b){g(a);c.onResize()}})},{once:!0});return d};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._fundametalsData=function(){return{prev_close_price:{title:"Previous Close Price",abbr:"Prev"},price_earnings_ttm:{title:"Price/Earnings, TTM",abbr:"PE"},earnings_per_share_basic_ttm:{title:"Earnings per Share, Basic, TTM",abbr:"EPS"},market_cap_basic:{title:"Market Cap - Basic",abbr:"Mkt Cap"},open_price:{title:"Open Price",abbr:"Open"},beta_1_year:{title:"Beta - 1 Year",abbr:"Beta"}}};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._createFundamentals=function(a,b){var c=this._createFundamentalsTemplate(b),d={shortSymbol:a.shortName()||""},c=$(Mustache.render(c,d)),d=Object.keys(this._fundametalsData());new TradingView.MediumWidgetFundamentals(a.name(),d,c);return c};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._createFundamentalsTemplate=function(a){var b=(a||{}).structure,c=(a||{}).horzDividerInPercents,d=(a||{}).showSymbol;if(!b)return"";var e=this._fundametalsData();a=2*MathEx.max($.map(b,function(a){return a.length}));var f=0,g=0,h=c||0,g=f=Math.floor((100-h*(a-1))/a),k='<div class="tv-mediumwidget-fundamentals"><table>';b.forEach(function(a){k+="<tr>";var b=a.length;a.forEach(function(a,c){if(a in e){var l=e[a].title;k+='<td class="fundamental-name" title="'+
|
|
l+'" style="width: '+f+'%;">'+(d?"{{ shortSymbol }} ":"")+e[a].abbr+"</td>";k+='<td class="fundamental-value '+a+'" title="'+l+'" style="width: '+g+'%;"> </td>';c+1<b&&(k+='<td class="fundamental-divider" style="width: '+h+'%;"> </td>')}});k+="</tr>"});return k+="</table></div>"};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._createMiniChart=function(a,b){var c=this,d=$('<div class="tv-mediumwidget-minichart"></div>'),e=$.extend(!0,{},b,{timeframe:{value:a.timeframe()}});c.visible.subscribe(function(b){c.miniChart=new TradingView.MiniChart(a.name(),d,e)},{once:!0});return d};
|
|
TradingView.MediumWidgetRenderer.prototype.Tab.prototype._createSymbolButtons=function(a){var b=$('<div class="tv-mediumwidget-symbolbuttons"></div>'),c=!TradingView.onWidget();b.append(Mustache.render('<a href="/chart/?symbol={{ symbol }}" target="_blank" class="tv-button green">'+$.t("Expand sym chart",{symbol:"{{ shortName }}"})+"</a>"+(c?'<a class="button-follow-symbol tv-button ok"><span class="not-bold">${{ shortName }}</span></a>':""),{symbol:a.name(),shortName:a.shortName()}));A16.makeButton({$button:b.find(".button-follow-symbol"),
|
|
symbol:a.name()});return b};TradingView.MediumWidgetRenderer.prototype.Tab.prototype.show=function(){this.jqPage.addClass("active");this.jqLabel.addClass("active");this.visible.setValue(!0);this.onResize()};TradingView.MediumWidgetRenderer.prototype.Tab.prototype.hide=function(){this.jqPage.removeClass("active");this.jqLabel.removeClass("active");this.visible.setValue(!1)};
|
|
TradingView.MediumWidgetFundamentals=function(a,b,c){this.fields=b;this._symbol=a;this._jqContainer=c;this._volumeFormatter=new TradingView.VolumeFormatter;this._priceFormatter=new TradingView.PriceFormatter(100,1,!1);setTimeout(this.connect.bind(this),0)};TradingView.MediumWidgetFundamentals.prototype.quoteSession=null;TradingView.MediumWidgetFundamentals.assignQuoteSession=function(a){this.prototype.quoteSession||(this.prototype.quoteSession=a)};
|
|
TradingView.MediumWidgetFundamentals.prototype.connect=function(){this.quoteSession.subscribe("medium-widget-fundamentals",this._symbol,this.onData.bind(this))};TradingView.MediumWidgetFundamentals.prototype.disconnect=function(a){clearTimeout(this._loadErrorTimeout);this.connected=!1;this.quoteSession.unsubscribe("medium-widget-fundamentals",this._symbol,a)};
|
|
TradingView.MediumWidgetFundamentals.prototype.onData=function(a){switch(a.status){case "ok":a.values?this.fillValues(a.values):console.warn("[Medium Widget Fundamentals] Message doesn't contain required data");break;case "permission_denied":console.warn("[Medium Widget Fundamentals] permision denied");break;case "error":console.warn("[Medium Widget Fundamentals] error")}};
|
|
TradingView.MediumWidgetFundamentals.prototype.fillValues=function(a){for(var b=this.fields.length-1;0<=b;b--){var c=this.fields[b],d=parseFloat(a[c]),e=d,c=this._jqContainer.find("."+c),e=/n\/a/i;!d||e.test(d)||TradingView.isNaN(d)?e="N/A":(e=(TradingView.isInteger(d)?this._volumeFormatter:this._priceFormatter).format(d),c.attr("title",d));c.text(e)}};svgAsset.register({"alarm-clock":'<svg width="21" height="21" viewBox="0 0 21 21" xmlns="http://www.w3.org/2000/svg"><path d="M4.81.048C2.598.048.8 1.848.8 4.058c0 .754.225 1.445.59 2.05C2.82 3.82 5.095 2.113 7.77 1.413 7.033.593 5.992.046 4.81.046v.002zM16.152.046c-1.185 0-2.226.546-2.96 1.368 2.683.7 4.943 2.406 6.377 4.694.36-.605.59-1.294.59-2.05 0-2.208-1.8-4.01-4.01-4.01V.045zm-5.65 2.508c-5.087 0-9.203 4.16-9.203 9.248 0 1.987.61 3.827 1.68 5.33l-1.32 1.685a1.25 1.25 0 1 0 1.96 1.55l1.09-1.41c1.58 1.274 3.592 2.048 5.79 2.048 2.18 0 4.21-.74 5.78-2.004l1.05 1.37a1.25 1.25 0 1 0 1.958-1.55l-1.276-1.64c1.082-1.51 1.686-3.37 1.686-5.37 0-5.09-4.114-9.25-9.202-9.25zm0 2.368c3.785 0 6.835 3.095 6.835 6.88 0 1.8-.694 3.427-1.822 4.646a1.24 1.24 0 0 0-.092.092c-1.242 1.29-2.98 2.096-4.92 2.096-3.785 0-6.835-3.05-6.835-6.833 0-3.785 3.05-6.88 6.835-6.88zm-.09 1.185a.948.948 0 0 0-.138.044.948.948 0 0 0-.73.96v4.29l-1.822 1.91a.95.95 0 1 0 1.368 1.32l2.096-2.185.275-.273V7.11a.948.948 0 0 0-1.05-1z" stroke="null"/></svg>',
|
|
base:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="27.1" viewBox="2 6 27.1 22"><path d="M12.1 24h-2v-1h.4c-.5-.3-.9-.7-1.4-1.2v.2H4v-1h4.3c-.3-.3-.5-.7-.7-1H4v-1h3c-.2-.3-.3-.7-.4-1H4v-1h2.3c-.2-.8-.3-1.6-.3-2.5 0-1.6.4-3.1 1-4.5H2v18h15v-3h-.5c-1.6 0-3.1-.4-4.4-1zM9 26H4v-1h5v1zm0-2H4v-1h5v1zm6 2h-5v-1h5v1zm8.5-6.6c1-1.4 1.5-3 1.5-4.9C25 9.8 21.2 6 16.5 6S8 9.8 8 14.5s3.8 8.5 8.5 8.5c1.8 0 3.5-.6 4.9-1.5l5.6 5.6 2.1-2.1-5.6-5.6zM22 18.1L20.1 20c-1 .7-2.3 1.1-3.6 1.1-3.6 0-6.5-2.9-6.5-6.5S12.9 8 16.5 8s6.5 2.9 6.5 6.5c0 1.3-.4 2.5-1 3.6z"/></svg>',
|
|
"bug-report":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" enable-background="new 0 0 595.3 841.9" width="30" height="30"><path d="M23 11h-2.8c-.5-.8-1.1-1.5-1.8-2L20 7.4 18.6 6l-2.2 2.2C16 8.1 15.5 8 15 8c-.5 0-1 .1-1.4.2L11.4 6 10 7.4 11.6 9c-.7.5-1.3 1.2-1.8 2H7v2h2.1c-.1.3-.1.7-.1 1v1H7v2h2v1c0 .3 0 .7.1 1H7v2h2.8c1 1.8 3 3 5.2 3s4.2-1.2 5.2-3H23v-2h-2.1c.1-.3.1-.7.1-1v-1h2v-2h-2v-1c0-.3 0-.7-.1-1H23v-2zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" height="23" width="21" viewBox="4 4 21 23"><path d="M23 9v15H7V9H5v17h20V9h-2zm-4-3h-2v4h2V6zm-6 0h-2v4h2V6zm-2 8H9v2h2v-2zm5 0h-2v2h2v-2zm5 0h-2v2h2v-2zm-2 7h2v-2h-2v2zm-3-2h-2v2h2v-2zm-5 0H9v2h2v-2z"/></svg>',
|
|
chat:'<svg xmlns="http://www.w3.org/2000/svg" height="21" width="23" viewBox="4 6 23 21"><path d="M22 6H5v12h1v4l4-4h3v-6h9V6zm-8 7v10h8l4 3v-3h1V13H14z"/></svg>',hotlists:'<svg xmlns="http://www.w3.org/2000/svg" height="23" width="21" viewBox="6 6 21 23"><path d="M22 14s-.8 1.8-1 4c0 0-1.6-8.8-8.3-13 0 0 2.8 4.5.9 6.5 0 0-1.2 1.4-1.6 3.5 0 0-.4 1.5 0 3 .3 1-2-.6-2-3 0 0-1.4 1.7 1 6 0 0 1.3 1.7 1 3 0 0-2.7-.6-4-4 0 0 .1 4.2 2 6 2 1.8 4.5 2 6 2 0 0 6.6 0 7-5 .5-5.2-1.6-6.5-1-9z"/></svg>',"messages - Copy":'<svg xmlns="http://www.w3.org/2000/svg" height="21" width="23" viewBox="4 6 23 21"><path d="M15.5 18.6h3.136v-3.15H15.5v3.15zm-2.09-5.25v10.5h9.408L25.955 27v-3.15H27v-10.5H13.41zm6.272 2.1v4.2H15.5v3.15h-1.045v-8.4h5.227v1.05zm6.273 0v7.35H24.91v-6.3h-1.046v1.05h-1.046V16.5h-1.046v6.3h-1.045v-8.4h1.046v1.05h1.045v1.05h1.046v-1.05h1.045V14.4h1.04v1.05zM21.773 6H4v12.6h1.045v4.2l4.182-4.2h3.136v-6.3h9.41V6z"/></svg>',
|
|
messages:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="4 6 23 21" width="23" height="21"><path d="M16 18h3v-3h-3v3zm-2-5v10h9l3 3v-3h1V13H14zm6 2v4h-4v3h-1v-8h5v1zm6 0v7h-1v-6h-1v1h-1v-1h-1v6h-1v-8h1v1h1v1h1v-1h1v-1h1v1zm-4-9H5v12h1v4l4-4h3v-6h9V6z"/></svg>',notes:'<svg xmlns="http://www.w3.org/2000/svg" height="26" width="26" viewBox="300 310 25.999995 25.999997"><path d="M321 321.99v2h5v-2h-5zM314 310h-2v4.998h2V310zm8.976 4.94l-1.41-1.412-3.543 3.54 1.412 1.41 3.54-3.54zm-19.953 16.11l1.412 1.41 3.542-3.54-1.412-1.41-3.54 3.54zm4.99-14.477l-3.59-3.575-1.435 1.435 3.577 3.575 1.447-1.435zm9.975 12.84l3.577 3.576 1.435-1.44-3.576-3.58-1.436 1.435zm-7.106 2.635h-.023v2.81l.69.447.66.694h1.61l.62-.7.72-.448v-2.812h-4.284zm8.07-8.76c.095-.777.036-1.33.036-1.33-.33-2.27-1.564-3.492-2.764-4.162-.87-.494-1.906-.788-2.93-.8H313c-1.86.06-3.177.823-3.977 1.47-.6.482-.905.905-.905.905-.812 1.03-1.106 2.09-1.118 3.05-.012 1.26.435 2.38.835 3.12.306.577.588.918.588.918.424.54.683 1.188.824 1.776.212.87.2 1.2.2 1.2.035.764.294 1.187.482 1.293.05.036.15.083.27.083l.49.457h4.67l.46-.457h.08c.422-.06.66-.778.705-1.236.047-.47.06-.704.06-.704 0-.046.01-.105.01-.175.107-1.104 1.166-2.715 1.166-2.715.06-.07.106-.13.153-.2.61-.812.86-1.74.95-2.482zm-13.96-1.29h-5v1.998h5v-2z"/></svg>',
|
|
notifications:'<svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" viewBox="5 6 21 21"><path d="M15.5 27c1.2 0 2.2-.9 2.4-2H13c.3 1.1 1.3 2 2.5 2zm6.5-7v-6c-.2-2.9-2.3-5.3-5.1-5.9 0-.2.1-.4.1-.6 0-.8-.7-1.5-1.5-1.5S14 6.7 14 7.5c0 .2.1.4.2.6-2.8.6-4.9 3-5.1 5.9v5.9C9 22.7 7 23 7 23v1h17v-1s-2-.3-2-3z"/></svg>'});var TVXWindowEvents=function(){var a={};$(window).on("storage",function(b){if(null!==b.originalEvent.newValue){var c=b.originalEvent.key;c.startsWith("tvxwevents.")&&(c=c.substr(11),$.browser.msie&&TVXWindowEvents._emitting?TVXWindowEvents._emitting=!1:a[c]&&a[c].forEach(function(a){a.call(b.originalEvent.newValue,b.originalEvent.newValue)}))}});return{on:function(b,c){a[b]||(a[b]=[]);a[b].push(c)},off:function(b,c){if(a[b]){var d=a[b].indexOf(c);-1!==d&&(1===a[b].length?delete a[b]:a[b].splice(d,
|
|
1))}},current:function(a){return localStorage.getItem("tvxwevents."+a)},emit:function(a,c){void 0===c&&(c=+new Date);c!=localStorage.getItem("tvxwevents."+a)&&($.browser.msie&&(TVXWindowEvents._emitting=!0),localStorage.setItem("tvxwevents."+a,c))}}}();TradingView.cleanButAmpersand=function(a,b){return TradingView.clean(a,b,b?["&"]:["&"])};TradingView.strip_tags=function(a){return a&&a.replace?a.replace(/(<([^>]+)>)/ig,""):a};TradingView.encodeSpread=function(a){return encodeURIComponent(a)};
|
|
TradingView.clean=function(a,b,c){var d=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"]],e=a;if(!a||!a.replace)return e;for(a=0;a<d.length;a++){var f=d[a][0],g=d[a][1];c&&c.indexOf&&-1!==c.indexOf(b?g:f)||(e=b?e.replace(new RegExp(g,"g"),f):e.replace(new RegExp(f,"g"),g))}return e};function truncate(a,b){if(!a)return a;b=void 0===b?140:b;return a.length>b?a.substr(0,a.indexOf(" ",b))+"\u2026":a}
|
|
"undefined"!=typeof module&&module&&module.exports&&(module.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand});$(document).ajaxSend(function(a,b,c){"POST"==c.type&&(b.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),b.setRequestHeader("sessionid",$.cookie("sessionid")))});String.prototype.format||(String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})});
|
|
"string"===typeof $.cookie("csrftoken")&&""!==$.cookie("csrftoken")?$("#update-status-li").append('<a href="#" onclick="TradingView.showChangeUserStatusDialog(); return false;">'+$.t("Update Status")+"</a>"):$("#update-status-li").empty();
|
|
$(document).ready(function(){$(".tv-select").selectbox({speed:100,classHolder:"tv-select-container"});Modernizr.canvas&&Modernizr.canvastext||"undefined"!=typeof FlashCanvas||A83.showNotice("Oops, your browser can't display our charts!",{html:'It appears that your browser does not support <strong>Canvas</strong> technology, which is needed for TradingView to work.<br/>Please use one of the following browsers:<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="http://www.mozilla.com" target="_blank">Firefox</a></li><li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li><li><a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home" target="_blank">Internet Explorer 9+</a></li></ul>',classSuffix:"slim",
|
|
doNotCloseOnBgClick:!0});!R77.enabled("websocket_connection")||"WebSocket"in window||swfobject.hasFlashPlayerVersion("9.0.0")||A83.showNotice("TradingView Notice",{html:'It appears that your browser does not support <strong>WebSocket</strong> technology and does not have <strong>Adobe Flash</strong> plugin installed, one of which is essential for our portal.<br/>Please, <a href="http://get.adobe.com/flashplayer/" target="_blank">install Flash plugin</a> or consider updating to one of these modern browsers with WebSocket support:<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="http://www.apple.com/safari/" target="_blank">Safari</a></li></ul>',
|
|
classSuffix:"slim",doNotCloseOnBgClick:!0})});var loginStateChange=new Delegate;loginStateChange.subscribe(null,onLoginStateChange);TVXWindowEvents.on("loginStateChange",function(){var a=JSON.parse(this);user=a.user;is_authenticated=!!a.is_authenticated;loginStateChange.fire()});
|
|
TradingView.trackEvent=function(a,b,c){window._UNIT_TESTS||"undefined"===typeof _gaq||(a=["_trackEvent",a,b],"undefined"!==typeof c&&a.push(c),_gaq.push(a),window.quoteSessionMultiplexerInstance&&window.quoteSessionMultiplexerInstance.full&&window.quoteSessionMultiplexerInstance.full._symbol_data&&(c=Object.keys(window.quoteSessionMultiplexerInstance.full._symbol_data)[0])&&(c=window.quoteSessionMultiplexerInstance.full._symbol_data[c].values)&&_gaq.push(["_trackEvent",c.listed_exchange,c.short_name,
|
|
b]))};var assert=function(a,b){if(!a)throw Error("Assertion failed"+(b?": "+b:""));};TradingView.changeLoginState=function(a){is_authenticated=a?!0:!1;TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user}));loginStateChange.fire()};
|
|
function loginUser(a){user=$.extend({},a);TradingView.changeLoginState(!0);"function"==typeof A83.onSigninSuccess&&(A83.onSigninSuccess(),A83.onSigninSuccess=void 0);A83.modalDialog&&"Log in"==A83.modalDialog.data("title")&&A83.destroy()}TradingView.signOut=function(){$.get("/accounts/logout/",function(){TradingView.changeLoginState(!1)})};function runOrSignIn(a){is_authenticated||R77.enabled("charting_library")?a():A83.showSignInDialog(a)}
|
|
TradingView.runOrGoPro=function(a,b){user&&user.is_pro?a():A83.showGoProDialog(b)};function following(){runOrSignIn(function(){document.location="/following/"})}function followers(){runOrSignIn(function(){document.location="/followers/"})}TradingView.handleIfNotError=function(a,b){a.error?console.log(a.error):b(a)};TradingView.handleIfNotErrorFunc=function(a){return function(b){TradingView.handleIfNotError(b,a)}};
|
|
function relationChange(a,b,c){var d=$(a);runOrSignIn(function(){var a;a=void 0===d.data("type")?b:d.data("type");$.post("/social/follow-the-user/",{targetId:c,follow:a},function(b){a?(d.addClass("unfollow").removeClass("follow"),user.following++):(d.removeClass("unfollow").addClass("follow"),user.following--);d.mouseleave();d.hasClass("follow-big")||followButtonTooltip(d);$(".following_count").text(user.following);d.data("type",1-a)},"json")})}
|
|
function followButtonsHandler(a){a.on("click",".follow-big",function(){var a=$(this);a.hasClass("unfollow")?relationChange(a,0,a.data("userid")):(relationChange(a,1,a.data("userid")),a.hover())}).on("mouseenter",".follow-big",function(){$(this).hasClass("unfollow")&&$(this).text($.t("Unfollow"))}).on("mouseleave",".follow-big",function(){$(this).hasClass("unfollow")&&$(this).text($.t("Following"))})}
|
|
TradingView.bindIdeasStreamFilter=function(a,b){b=b||{};var c=a.find(".filter").map(function(){function a(d,f){var g=$(this),h=g.data("name");if(!0===w||w[h])d&&d.preventDefault();else{m&&v.find(".temp").remove();if(!is_authenticated&&g.hasClass("authorization-required"))return A83.showSignInDialog(null,0),!1;var n=h?k.filter("[name="+h+"]"):k,t=g.data("value");if(n&&n.val()!=t||b.forceChange)r.filter(".active").filter(h?"[data-name="+h+"]":"*").removeClass("active").find(".active-underline").remove(),
|
|
g.addClass("active"),n.val(t).change(),f||"function"!=typeof b.onChange||setTimeout(function(){b.onChange(d,n.attr("name"),t)},0);var u=g.data("hook");u&&Object.keys(u).forEach(function(a){c.forEach(function(b){-1<b.inputs.indexOf(a)&&b.obj.setValue(u[a],a)})});m&&0===v.find("a[data-value="+t+"]").length&&g.clone(!0).addClass("temp item").append('<span class="active-underline"></span>').appendTo(v);!b.notPreventDefault&&b.onChange&&d&&d.preventDefault();if(!m){var F=r.filter(".active[data-filter-title]:first").data("filter-title")||
|
|
p;F?r.filter(".active").each(function(){F=F.replace("%"+$(this).data("name")+"%",$(this).contents(":first").text())}):F=g.contents(":first").text();l.text(F)}e(!0)}}function e(a){"boolean"!=typeof a&&(a=h);a?(g.stop(!0,!1).fadeOut(n),f.unbind("clickoutside").removeClass("active"),h=!1):(g.stop(!0,!1).fadeIn(n),f.one("clickoutside",e).addClass("active"),h=!0)}var f=$(this),g=f.find(".dropdown"),h=!1,k=f.find("input"),l=f.find(".selected"),m=!1,n="undefined"==typeof b.speed?50:b.speed,p=f.data("filter-title");
|
|
f.find(".selected").on("click",e);g.on("click","a",a);var r=g.find("a"),t=f.parent(".filter-tabbed"),v;t.length&&(m=!0,v=t.find(".tabs"),r=r.add(v.find("a:not(.temp)")),v.on("click","a",a));var w={};f.find(".sub-group.inactive").find("a:first").each(function(a,b){w[$(b).data("name")]=!0}.bind(this));var u={setValue:function(b,c){var e=r.filter("a[data-value="+b+"]"+(1<k.length&&c?"[data-name="+c+"]":""));a.apply(e,[void 0,!0])},getActiveTitle:function(){return l.text()},disabled:function(a,b){b?$("[data-name="+
|
|
b+"]",f).closest(".sub-group").addClass("inactive"):m?t.addClass("inactive "):f.addClass("inactive ");a||(b?("object"!=typeof w&&(w={}),w[b]=!0):w=!0)},enabled:function(a){a?($("[data-name="+a+"]",f).closest(".sub-group").removeClass("inactive"),"object"==typeof w&&(w[a]=!1)):(m?t.removeClass("inactive "):f.removeClass("inactive "),w=!1)}};f.data("interface",u);return{inputs:k.map(function(a,b){return $(b).attr("name")}).get(),obj:u}}).get()};TradingView.bindProfileTabsFilter=TradingView.bindIdeasStreamFilter;
|
|
A18=function(a,b){function c(a,b){var c={};if(a||d.options&&d.options.defaultSymbol)c.symbol=String(a||d.options.defaultSymbol).toUpperCase();b&&(c.interval=b);var h="/chart/";Object.keys(c).length&&(h+="?"+$.param(c));location.href=h}this.$element=a;this.$field=this.$element.find("input");this.$button=this.$element.find("span");this.options=b;this.$button.on("click",function(){if(!this.$field.val()){var a=(d.options||{}).defaultSymbol||"";a&&this.$field.val(String(a).toUpperCase())}this.symbolSearch.acceptTypeIn()}.bind(this));
|
|
this.$element.on("keyup",function(){this.$element.toggleClass("not-empty",!!this.$field.val().length)}.bind(this));this.symbolSearch=A69.bindToInput(this.$field,$.extend((this.options||{}).symbolSearch,{callback:c,onEmptyApply:c}));var d=this};A18.prototype.updateOptions=function(a){$.extend(this.options,a)};
|
|
TradingView.SearchChartField=function(a){this.$element=a;this.$field=this.$element.find("input");this.$button=this.$element.find(".button");this.symbolSearch=A69.bindToInput(this.$field,{callback:function(a){a&&(a=a.toUpperCase(),location.href="/chart/"+TradingView.encodeSpread(a)+"/")}});this.$field.placeholder();this.$field.on("focus",function(){this.$element.addClass("active")}.bind(this)).on("blur",function(){this.$element.removeClass("active")}.bind(this)).on("keyup",function(){this.$element.toggleClass("not-empty",
|
|
!!this.$field.val().length)}.bind(this));this.$button.on("click",function(){this.symbolSearch.acceptTypeIn()}.bind(this))};TradingView.applyReadMoreToChart=function(a){var b=a.find(".desc");b.html(b.html().replace(/<br>/g," ")).ellipsis(111,!1,function(b){b=a.find(".chart-read-more-container");b.css("display","block");b.is(b.parent().children(":visible").last())&&a.css("padding-bottom","0px")})};
|
|
function chartWithCover(a){a.find(".date").each(function(){var a=$(this),c=new Date(a.text());TradingView.agoDateFormatter(a,c)});a.find(".desc").each(function(){var a=$(this);a.height(a.parent().outerHeight()-a.position().top-5)}).ellipsis()}
|
|
TradingView.deleteChart=function(a,b){var c=[a];A83.showConfirm($.t("Confirmation"),$.t("Are you sure you want to delete this chart?"),function(){if(R77.enabled("saveload_storage_customization"))return TradingView.ChartingLibraryBackend.removeChart(a,b);$.post("/deletechart/",{uid:c},function(a){a.error||("string"===typeof b?document.location=b:"function"===typeof b?b():window.location.reload())})},null,{addClass:"delete-chart-dialog"})};
|
|
TradingView.saveChart=function(a,b,c,d,e){e=e||{};if(R77.enabled("saveload_storage_customization"))return TradingView.ChartingLibraryBackend.saveChart(a.name,a.short_name,a.resolution,a,b.id.value(),function(a){b.id.value()||(b.id.setValue(a),b.uid.setValue(a));"function"==typeof c&&c()},d);$.post("/savechart/",a,function(a){"ok:"===a.substr(0,3)?(a=a.substr(3),a=JSON.parse(a),b.id.value()||(b.id.setValue(a.id),b.uid.setValue(a.uid)),"function"==typeof c&&c({uid:b.uid.value()},a.count||0)):
|
|
"saved_chart_limit_reached"==a||""===a?("function"==typeof d&&d(),e.noDefaultOnFail||A83.showGoProDialog({feature:"savedChartsLimit"})):("function"==typeof d&&d(),$("#error").html(a))})};TradingView.openSavedChart=function(a){R77.enabled("saveload_storage_customization")?TradingView.ChartingLibraryBackend.loadChart(a):open("/chart/"+a.url+"/"+(TradingView.isMobileView?"?mobile=1":""),"_blank")};
|
|
function toggleTitleOfModerationButton(a,b,c){c?(a.attr("title",b),a.addClass("apply-common-tooltip")):(a.removeAttr("title"),a.removeClass("apply-common-tooltip"))}function recommendChart(a,b){var c=b?$(b):$("#chart-recommend-button");c.toggleClass("active");$.post("/recommend/",{id:a,type:"recommend"},function(a){c.toggleClass("active",!!a.state)})}
|
|
function bullseyeChart(a,b){var c=b?$(b):$("#chart-bullseye-button");c.hasClass("disabled")||(c.toggleClass("active"),$.post("/recommend/",{id:a,type:"bullseye"},function(a){c.toggleClass("active",!!a.state)}))}
|
|
function updateSuggestedView(a,b){var c=$("#chart-"+a+"-suggested-button"),d=$("#chart-"+a+"-not-suggested-button");c.toggleClass("active",!!b);d.toggleClass("active",!b);toggleTitleOfModerationButton(c,"By "+user.username,!!b);toggleTitleOfModerationButton(d,"By "+user.username,!b);$("#chart-"+a).removeClass("not-moderated")}function suggestChart(a,b){updateSuggestedView(a,b);$.post("/recommend/",{id:a,type:"hot",state:(!!b).toString()},function(b){updateSuggestedView(a,b.state)})}
|
|
function chartTogglePublic(a,b){var c=b?$(b):$("#chart-public-button");c.toggleClass("active");$.post("/togglepublic/",{id:a},function(a){toggleTitleOfModerationButton(c,"By "+user.username,a.state);c.toggleClass("active",!!a.state)})}function chartRepostSTTW(a,b){var c=$(b);c.addClass("active");$.post("/repoststtw/",{id:a},function(a){c.toggleClass("active",!!a.state)})}
|
|
function chartToggleIOTD(a,b){function c(){d.toggleClass("active",e)}var d=b?$(b):$("#chart-iotd-button");if(!d.is(".disabled")){var e=d.hasClass("active");d.toggleClass("active",!e);$.post("/toggle-iotd/",{id:a},function(b){b.state&&updateSuggestedView(a,!0)}).done(function(a){if(a.error)return c();d.toggleClass("active",!!a.state).toggleClass("disabled",!!a.disabled)}).fail(c)}}
|
|
function trendingPeople(a){a.on("click",".column-trending-people .tabs a",function(b){var c=$(this);if(c.hasClass("active"))return!1;c.addClass("active").siblings("a").removeClass("active");a.find(".top-user-group").hide().filter("."+c.attr("href").slice(1)).show();b.preventDefault()})}
|
|
$.fn.TVTicker=function(a){function b(a){a=Math.abs(a);var b=1;!TradingView.isInteger(a)&&1<a&&(a=parseFloat(a.toString().replace(/^.+\./,"0.")));0<a&&1>a&&(b=Math.pow(10,a.toString().length-2));return b}a=a||{};this.each(function(){function c(a){g.trigger("tvticker-beforechange");var c=g.data("TVTicker"),d=c&&c.step,e;e=c.parser?c.parser(g.val()):TradingView.isInteger(d)?parseInt(g.val(),10):parseFloat(g.val());isNaN(e)&&(e=0);var f=b(e),d=b(d),f=Math.max(d,f);a=a(e,f);c.formatter&&(a=c.formatter(a));
|
|
g.val(a);g.change()}function d(){var a=g.data("TVTicker"),b=a&&a.step,d=a&&a.max;c(function(a,c){var e=(Math.round(a*c)+Math.round(b*c))/c;void 0!==d&&null!==d&&d<e&&(e=a);return e})}function e(){var a=g.data("TVTicker"),b=a&&a.step,d=a&&a.min;c(function(a,c){var e=(Math.round(a*c)-Math.round(b*c))/c;void 0!==d&&null!==d&&e<d&&(e=a);return e})}var f=!1,g=$(this),h=g.data("TVTicker");h?f=!0:h={step:+g.data("step")||1};"step"in a&&(h.step=+a.step||h.step);"min"in a&&(h.min=a.min);"max"in a&&(h.max=
|
|
a.max);"formatter"in a&&(h.formatter=a.formatter);"parser"in a&&(h.parser=a.parser);g.data("TVTicker",h);f||(f=$('<div class="tv-ticker">').appendTo(g.parent()),$('<div class="icon up">').appendTo(f),$('<div class="icon down">').appendTo(f),g.next().find(".up, .down").on("mousedown",function(a){a.preventDefault();g.focus()}),g.next().find(".up").click(function(){g.is(":disabled")||d()}),g.next().find(".down").click(function(){g.is(":disabled")||e()}),g.keydown(function(a){g.is(":disabled")||(38==
|
|
a.keyCode?g.next().find(".up").addClass("active"):40==a.keyCode&&g.next().find(".down").addClass("active"))}),g.keyup(function(a){g.is(":disabled")||(38==a.keyCode?(d(),g.next().find(".up").removeClass("active")):40==a.keyCode&&(e(),g.next().find(".down").removeClass("active")))}),g.mousewheel(function(a,b){0<b?g.next().find(".up").click():g.next().find(".down").click()}))});return this};
|
|
(function(){function a(a){var b=0;!0===a&&(D16.disconnect(),b=500);setTimeout(D16.connect.bind(D16),b)}function b(b,c){var f=$('<div class="buttons">').appendTo(b.find(".tv-dialog-content .main"));$('<input type="button" class="tv-button ok" value="'+$.t("Report a data issue")+'">').css("margin-right",15).click(function(){A83.destroy();runOrSignIn(function(){(new TradingView.UserBugReportDialog({modal:!0})).show().on("destroy",function(){a(c)})})}).appendTo(f);
|
|
$('<input type="button" class="tv-button ok" value="'+$.t("Reconnect")+'">').click(function(){A83.destroy();a(c)}).appendTo(f)}function c(){TradingView.trackEvent("System","Disconnect");var a="<p>"+$.t("Connection to server was lost")+"</p><p>"+$.t("How to fix:")+"</p><ol><li>"+$.t("Check firewall settings and make sure access to websocket ("+window.WEBSOCKET_HOST+" port "+window.WEBSOCKET_PORT+") is open. Then click Reconnect or press F5.")+"</li><li>"+$.t('Your browser doesn\u2019t support <strong>WebSocket</strong> technology and does not have <strong>Adobe Flash</strong> plugin installed.<br>Please, <a href="http://get.adobe.com/flashplayer/" target="_blank">install Flash plugin</a> or consider updating to one of these modern browsers with WebSocket support:')+
|
|
'<ul><li><a href="http://www.google.com/chrome/" target="_blank">Chrome</a></li><li><a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">Firefox</a></li></ul></li><li>'+$.t("Server broke the connection. Click Reconnect or press F5.")+"</li></ol>";b(A83.showNotice($.t("Connection is lost"),{html:a,classSuffix:"disconnect",doNotCenter:!0,doNotCloseOnBgClick:!0}))}window.showDisconnectedMessage=function(){"MozWebSocket"in window&&TradingView.WEB_SOCKET_WAS_CONNECTED?setTimeout(c,
|
|
15E3):c()};window.showCriticalErrorMessage=function(){TradingView.trackEvent("System","Critical Error");b(A83.showNotice($.t("Oops, something went wrong"),{html:$.t("Please report the issue or click Reconnect."),classSuffix:"critical",doNotCenter:!0,doNotCloseOnBgClick:!0}),!0)}})();
|
|
function toggleUserSavedCharts(a){var b=$(a).toggleClass("active");$(".my-saved-charts").toggle();b.is(".active")?$(document).bind("click.toggleUserSavedCharts",function(b){$(b.target).is(".saved-charts-button")||toggleUserSavedCharts(a)}):$(document).unbind("click.toggleUserSavedCharts")}function makeDirectionName(){return function(a,b){var c=b(a);return"0"==c?$.t("Neutral"):"1"==c?$.t("Long"):$.t("Short")}}function gotochart(a){location.href="/v/"+a+"/"}
|
|
$.fn.ellipsis=function(){return this.each(function(a,b,c){var d=$(this),e=d.text(),f=e,g=$(this.cloneNode(!0)).hide().css({position:"absolute",overflow:"visible",height:"auto",width:d.width()});a=a||d.height();d.after(g);for(var h=g.height()-a,k,l=0;0<h;)if(f=f.substr(0,f.length-h/2),g.text(f+"\u2026"),h=g.height()-a,k=!0,500<l++){console.warn("Error: too long text");break}d.html(g.text());k&&"function"===typeof c&&c(d);b&&e!=g.text()&&d.attr("title",e);g.remove()},arguments)};
|
|
(function(a){var b=a('<div class="blue-tooltip-icon icon" />'),c=a('<div class="blue-tooltip-text" />'),d=a('<div class="blue-tooltip blue-tooltip-hidden" />').append(b).append(c);a.fn.blueTooltip=function(e,f,g){d.parent().length||d.appendTo(document.body);return this.each(function(){var h=a(this);h.data("tooltip",e);h.off("mouseenter.tooltip").on("mouseenter.tooltip",function(){if(!Modernizr.touch){g=g||"";c.html(h.data("tooltip"));d.attr("class","blue-tooltip");d.addClass("blue-tooltip-"+f).addClass(g);
|
|
var e=(h.outerWidth()-d.outerWidth())/2,l=0,m=e+h.offset().left+d.outerWidth(),n=e+h.offset().left,p=a(window).width()-5;5>n?l=5-n:m>p&&(l=p-m);e=h.offset().left+e+l;m=0;n="";"top"===f?(m=h.offset().top-d.outerHeight()-10,n="-=10"):"bottom"==f&&(m=h.offset().top+h.outerHeight()+10,n="+=10");d.css({left:e,top:m,opacity:0});b.css({left:Math.round(d.width()/2)-l});d.stop().animate({top:n,opacity:1},200)}}).off("mouseleave.tooltip").on("mouseleave.tooltip",function(a){d.addClass("blue-tooltip-hidden").removeClass(g)})})}})(jQuery);
|
|
TradingView.Tooltip=function(){function a(){clearTimeout(g);clearTimeout(h);jQuery.contains(document.body,e[0])&&(e.css("opacity","0"),h=setTimeout(e.detach.bind(e),250))}function b(a){a=$(a);if(0===a.size())return!1;a:{var b=a.data("commonTooltipText"),d=a.attr("title");if(b)d&&(b=d,a.data("commonTooltipText",b),a.removeAttr("title"));else{if(!d){a=void 0;break a}b=d;a.data("commonTooltipText",b);a.removeAttr("title")}d={y:a.offset().top-$(window).scrollTop(),x:a.offset().left-$(window).scrollLeft(),
|
|
w:a.outerWidth(),h:a.outerHeight()};a={text:b,rect:d,vertical:a.hasClass("common-tooltip-vertical")}}a&&c(a)}function c(a){var b=jQuery.contains(document.body,e[0]);clearTimeout(g);clearTimeout(h);b?(f.text(a.text),d(a),e.css("opacity","1")):g=setTimeout(function(){e.appendTo(document.body);c(a)},500)}function d(a){var b=a.rect;e.attr("class","common-tooltip-wrapper").css({top:"auto",right:"auto",bottom:"auto",left:"auto"});Modernizr.pointerevents||e.addClass("no-pointer-events");f.css({left:"0",
|
|
width:"auto"});f.width(f.width()+2);var c=$(window).width(),d=$(window).height();((a=a.vertical)&&20>b.w||!a&&20>b.h)&&e.addClass("farther");a?(e.addClass("vertical").css({left:b.x+b.w,top:b.y-(e.outerHeight()-b.h)/2}),f.offset().left+f.outerWidth()+10>c?e.addClass("otl").css({left:"auto",right:c-b.x}):e.addClass("otr")):(e.css({bottom:d-b.y,left:b.x-(e.outerWidth()-b.w)/2}),10>f.offset().top?e.addClass("below").css({bottom:"auto",top:b.y+b.h}):e.addClass("above"),0>f.offset().left-10?f.css("left",
|
|
Math.abs(f.offset().left)+10):f.offset().left+f.outerWidth()+10>c&&f.css("left",c-(f.offset().left+f.outerWidth()+10)))}var e=$("<div />").css("opacity","0"),f=$('<div class="common-tooltip-body" />').appendTo(e),g,h;if(!Modernizr.touch)$(document).on("mouseenter",".apply-common-tooltip",function(c){function d(){e.off("mouseleave mousedown",d);a()}if("buttons"in c){if(c.buttons&1)return}else if(1==c.which)return;var e=$(this);b(e);e.on("mouseleave mousedown",d)});return{show:c,showOnElement:b,hide:a}}();
|
|
$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){$(this).attr("title")||this.offsetWidth>=this.scrollWidth||$(this).attr("title",$(this).text())})});
|
|
A17=function(a,b){this._options=b||{};var c=this;this.id=a.id;var d=this._lastId();if(!d)this._setLastId(this.id);else if(!(this.id<=d||(c=this,this.container=$(Mustache.render(TradingView.templates.globalNotification,a)).prependTo($("body")),c.container.show(),this._options.addClass&&this.container.addClass(this._options.addClass),c.container.css("top",0),this._options.notShiftBody||$("body").addClass("padding-animate").css({paddingTop:c.container.outerHeight()}),this.container.find(".global-notification-close").on("click",
|
|
function(){c.close()}),$.browser.msie)))TVXWindowEvents.on(this.KEY+"-close",this._onCloseInAnotherTab.bind(this))};A17.prototype.KEY="globalNotification";
|
|
A17.prototype._lastId=function(){var a=TVSettings.getInt(this.KEY,0,!0),b=TVSettings.getInt(this.KEY,0),c=Math.max(b,a);a!=b&&TVSettings.setValue(this.KEY,c);!c&&$.cookie("notification_id")&&(c=~~$.cookie("notification_id"),TVSettings.setValue(this.KEY,c),$.cookie("notification_id",0,{expires:-1,path:"/"}));return c};A17.prototype._setLastId=function(a){TVSettings.setValue(this.KEY,a)};
|
|
A17.prototype.close=function(a){var b=this;this.container&&(a?(this.container.remove(),this.container=null):(b.container.css("top",-1*this.container.outerHeight()+"px"),setTimeout(function(){b.container.remove();b.container=null;$(window).resize();b._options.notShiftBody||$("body").removeClass("padding-animate")},1500),TVXWindowEvents.emit(b.KEY+"-close",JSON.stringify([b.id,+new Date])),this._setLastId(b.id)),this._options.notShiftBody||$("body").css({paddingTop:0}))};
|
|
A17.prototype._onCloseInAnotherTab=function(a){a=JSON.parse(a);this.id<=a[0]&&this.close(!0)};function closeGlobalNotification(a){$.cookie("notification_id",a,{expires:365,path:"/"});$(".tv-global-notification").slideUp(400,function(){$(window).resize()})}
|
|
TradingView.RequestCache=function(a){function b(a){"function"==typeof a&&a([]);return a}function b(b){d||e||(e=!0,$.getJSON(a,function(a){e=!1;d=!0;c=a;"function"==typeof b&&b(a)}));c&&"function"==typeof b&&b(c);return c}b.D20=function(){};if(R77.enabled("charting_library_base"))return b;var c,d=!1,e=!1;b.D20=function(){c=null;d=!1};return b};
|
|
R77.enabled("charting_library_base")?TradingView.ChartingLibraryBackend?(TradingView.getStudyTemplatesList=TradingView.ChartingLibraryBackend.getStudyTemplatesList,TradingView.getStudyTemplatesList.D20=TradingView.ChartingLibraryBackend.clearStudyTemplatesListCache):(TradingView.getStudyTemplatesList=function(){},TradingView.getStudyTemplatesList.D20=function(){}):(TradingView.getStudyTemplatesList=new TradingView.RequestCache("/study-templates-ext/"),TradingView.getThemesList=
|
|
new TradingView.RequestCache("/themes/"));
|
|
TradingView.showThemeSaveDialog=function(a){this.showChartNameDialog(function(b){b&&$.get("/theme/"+b+"/").success(function(c){var d=!!c.content;c={name:b,content:JSON.stringify(a.model().theme())};d?(d=$.t("Do you realy want to replace")+' "'+b+'"?',A83.showConfirm($.t("Confirm replacing"),d,function(){$.post("/save-theme/",c).error(function(a){console.error(a.responseText)});a._lastLoadedTheme=b})):($.post("/save-theme/",c).error(function(a){console.error(a.responseText)}),TradingView.getThemesList.D20(),
|
|
a._lastLoadedTheme=b)})},$.t("Save theme as..."),$.t("Theme name"),128)};
|
|
TradingView.getImageOfChart=function(a,b,c){function d(c){c=R77.enabled("charting_library_base")?(b.snapshotUrl?"":"http://www.tradingview.com/x/")+c:window.location.protocol+"//"+window.location.host+"/x/"+c+"/";k.attr({href:c});l.attr("data-clipboard-text",c);m.val(c);g.remove();h.css({visibility:"visible"});setTimeout(function(){var a=m.get(0);a.focus&&a.focus();a.select&&a.select()},0);c=TradingView.ShareTwitterSnapshot.getStatus(a.activeChartWidget.value().symbolProperty().value(),c);
|
|
$('<a class="twitter-share-button tv-dialog-social tv-dialog-social-twitter"></a>').attr({href:"https://twitter.com/share?count=none&text="+encodeURIComponent(c)+"&url=%20"}).appendTo(n);$('<script src="//platform.twitter.com/widgets.js">\x3c/script>').appendTo(n);var d=new ZeroClipboard(l);d.on("ready",function(a){d.on("aftercopy",function(a){A83.showMessage($.t("Copied to clipboard"))})})}b=b||{};A83.createModalDialog($.t("Image URL"),{addClass:"tv-dialog-min-width"});var e=A83.modalDialog,
|
|
f=e.find(".tv-dialog-content"),g=$("<p><img src="+TradingView.wrapUrl('"/static/images/loading-small.gif"')+"/></p>").css({textAlign:"center",position:"absolute",width:"100%"}).appendTo(f),h=$('<div class="main">').css({visibility:"hidden"}).appendTo(f),k=$("<a>").text($.t("Save image")).attr({target:"_blank"}).css("text-decoration","underline"),l=$('<span class="copy-clipboard-button tv-button">'+$.t("Copy link")+"</span>").css({position:"absolute",top:"1px",right:"-1px",padding:"9px 10px 7px"}),
|
|
m=$("<input>").attr({type:"text",readonly:!0}).css({width:"289px",position:"relative"}).bind("click focus",function(){this.select&&this.select()});$("<p>").appendTo(h).append(k," "+$.t("or copy url:"));$("<p>").css({position:"relative"}).appendTo(h).append($("<form>").append(l,m));var n=$('<p class="tv-dialog-socials">').appendTo(h);A83.positionDialog();A83.applyHandlers();TradingView.trackEvent("GUI","Get image button");ZeroClipboard.config({swfPath:TradingView.wrapUrl("/static/images/ZeroClipboard.swf")});
|
|
TradingView.takeSnapshot(a,function(a){c&&c(a);d(a)},function(){e.find(".tv-dialog-error").text("URL cannot be received.").show()},{snapshotUrl:b.snapshotUrl});return!1};TradingView.getImageOfChartSilently=function(a,b,c){TradingView.takeSnapshot(a,function(a){c&&c(a)},function(){console.warn("Error while trying to create snapshot.")},{snapshotUrl:b.snapshotUrl});return!1};
|
|
function onLoginStateChange(a){$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan).toggleClass("is-not-trial",!(is_authenticated&&user&&"pro_realtime_trial"===user.pro_plan)).toggleClass("is-mobile",!!TradingView.isMobileView);TVSettings.sync(user.settings);
|
|
is_authenticated?(a||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(TradingView.userBadge(user,!0,"strong"))),$(".user-info-username").html(user.username),$(".following_count").html(user.following),$(".followers_count").html(user.followers),$(".saved_charts_count").html(user.saved_charts),$(".published_charts_count").html(user.published_charts),$(".treated_charts_count").html(user.treated_charts_count),$("img.user-picture, .user-picture img").attr("src",
|
|
user.userpic),$(".trial-days-left").html(user.trial_days_left||""),$(".header-item-profile").find("a").each(function(a,c){c=$(c);var d=c.attr("rel");d&&c.attr("href",d.replace("%u",user.username))}),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&(TradingView.trackEvent("Conversion","First login"),user.prort_trial_started&&(A83.showTrialMessageSuccess(),delete user.prort_trial_started),delete user.is_first_login),TradingView.setTrialAvailiable(user.trial_availiable)):(user=
|
|
{username:"Guest",following:"0",followers:"0",ignore_list:{}},$(".user-info-username").html(user.username),window.localStorage&&localStorage.removeItem("trial_availiable"));window.studyTemplates&&(window.studyTemplates.refreshStudyTemplateList(),window.studyTemplates.refreshFavoriteDropdownMenu())}
|
|
function markNewsAsRead(){$(".user-picture .notifications-counter").hide().addClass("hide");$(".notifications-counter.counter").removeClass("new").text("0");TVXWindowEvents.emit("zero-notification-counter")}function followButtonTooltip(a){var b=a.hasClass("unfollow")?"Unfollow":"Follow";a.attr("title",b)}TradingView.followButtonToolipAll=function(){$(".follow-link").each(function(a,b){b=$(b);b.data("tv_tooltip")||followButtonTooltip(b)})};
|
|
TradingView.getSavedChartsList=function(a){return R77.enabled("charting_library_base")?TradingView.ChartingLibraryBackend.getCharts(a):$.getJSON("/my-charts/",a)};function isOnChartEditPage(){var a=new RegExp(TradingView.urlRegExp.publishedChart),b=new RegExp(TradingView.urlRegExp.publishedScript);return(new RegExp(TradingView.urlRegExp.publishedChartOld)).test(location.pathname)||a.test(location.pathname)||b.test(location.pathname)}
|
|
function refreshChartMenuState(){function a(){d.hide();c.show()}function b(b){b={charts:b};if(b.charts&&b.charts.length){e.empty();e.append(Mustache.render(TradingView.templates.lists.savedCharts,b));var c=new A59(e,e.find("ul").eq(0),{additionalClass:"gray",alwaysVisible:!0});e.parent().one("hover",function(){c.updateScrollBar()});e.find("li").each(function(b,c){c=$(c);var d=c.find(".name").text();20<d.length&&c.attr("title",d);$("span.icon",c).click(function(b){var c=
|
|
$(this).data("id");e.mouseleave();TradingView.deleteChart(c,function(){user.saved_charts--;var c=$(b.target).parent().attr("href");$(b.target).parent().parent().remove();user.saved_charts||a();!isOnChartEditPage()||user.saved_charts&&"/chart/"+D3.metaInfo().uid+"/"!=c||(location.href="/chart/")});return!1})})}else a()}var c=$(".header-button.header-item-chart"),d=$(".header-menu.header-item-chart"),e=d.find(".popup-subblock");d.length&&e.length&&(d.on("closeMenu",function(){e.empty()}),d.on("openMenu",
|
|
function(){TradingView.getSavedChartsList(b)}),is_authenticated&&user.saved_charts?(c.hide(),d.show()):a())}
|
|
TradingView.urlize=function(a){var b,c=[],d=0,e=a.match(new RegExp("(https://|http://)(www.tradingview.com|beta\\d?.tradingview.com|webcharts\\d?|localhost\\:6285)"+TradingView.urlRegExp.publishedImage,"g"));if(e)for(b=0;b<e.length;b++)a=a.replace(e[b],"<"+d++ +">"),c.push('<div class="ch-item-snapshot-link"><i class="icon icon-snapshot-small" title="Chart Snapshot"></i> <a href="'+e[b]+'" target="_blank">Chart Snapshot</a></div><a target="_blank" href="'+e[b]+'" class="ch-item-snapshot-preview"><img src="'+
|
|
e[b]+'" alt="" class="snapshot-preview"/></a>');if(e=a.match(new RegExp("(https://|http://)(www.tradingview.com|beta\\d?.tradingview.com|webcharts\\d?|localhost\\:6285)(("+TradingView.urlRegExp.publishedChartOld+")|("+TradingView.urlRegExp.publishedChart+")|("+TradingView.urlRegExp.publishedScript+"))","g")))for(b=0;b<e.length;b++){a=a.replace(e[b],"<"+d++ +">");var f=TradingView.parsePublishedChartUrl(e[b]);c.push(Mustache.render('<div class="ch-item-chart-link"><i class="icon icon-snapshot-small" title="Published Idea"></i> <a href="{{chartHref}}" target="_blank" data-id="{{chartId}}"{{#symbol}} data-symbol="{{symbol}}"{{/symbol}}{{#title}} data-title="{{title}}"{{/title}}>Published Idea</a></div><a href="{{chartHref}}" target="_blank" class="ch-item-chart-preview" data-id="{{chartId}}"{{#symbol}} data-symbol="{{symbol}}"{{/symbol}}{{#title}} data-title="{{title}}"{{/title}}><img src="{{imageHref}}" alt="" class="idea-preview"/></a>',
|
|
{chartHref:TradingView.createPublishedChartUrl(f.image_url,f.symbol,f.title),imageHref:TradingView.createPublishedChartImageUrl(f.image_url),chartId:f.image_url,symbol:f.symbol,title:f.title}))}if(e=a.match(/(http:\/\/|http:\/\/www\.|https:\/\/www\.|https:\/\/)[^ <\n]{2,200}/g))for(b=0;b<e.length;b++)f=0===e[b].indexOf("http://")||0===e[b].indexOf("https://")?"":"http://",a=a.replace(e[b],"<"+d++ +">"),c.push("<a target='_blank' href='"+f+e[b]+"'>"+e[b]+"</a>");if(e=a.match(/(\$)[a-z][a-z0-9\._\-]{2,20}/gi))for(b=
|
|
0;b<e.length;b++)a=a.replace(new RegExp("\\"+e[b],"gi"),"<"+d++ +">"),c.push("<a target='_blank' href='/chart/"+e[b].substr(1)+"/'>"+e[b]+"</a>");if(e=a.match(/[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/gi))for(b=0;b<e.length;b++)a=a.replace(e[b],"<"+d++ +">"),c.push('<a class="email" href="mailto:'+e[b]+'">'+e[b]+"</a>");for(b=/(\s|^|>|\n)\@([a-z0-9\._\-\u00A0]{2,50})(\s|$|<|\n)/gi;null!=(e=b.exec(a));)a=a.replace(new RegExp(e[0],
|
|
"ig"),e[1]+"<"+d++ +">"+e[3]),c.push("<a target='_blank' href='/u/"+e[2].replace("\u00a0"," ")+"/'>@"+e[2]+"</a>"),b.lastIndex=0;0<c.length&&(a=a.replace(/<(\d+)>/g,function(a,b){return c[b]?c[b]:""}));return a};TradingView.urlizeAndParseQuotesAndClean=function(a){return TradingView.urlize(TradingView.parseQuotes(TradingView.clean(a)))};
|
|
(function(a){jQuery.fn.putCursorAtEnd=function(){return this.each(function(){a(this).focus();if(this.setSelectionRange){var b=2*a(this).val().length;this.setSelectionRange(b,b)}else a(this).val(a(this).val());this.scrollTop=999999})};jQuery.fn.putCursorAtPosition=function(b){return this.each(function(){a(this).focus();this.setSelectionRange&&this.setSelectionRange(b,b)})}})(jQuery);
|
|
TradingView.ShareTwitterSnapshot=function(a){function b(a,b){return"https://twitter.com/intent/tweet?&status="+encodeURIComponent(TradingView.ShareTwitterSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{window.JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{window.JsBridge.sendEvent("sharing_error")}catch(a){}};else{var c=open("about:blank","snapshot_tweet","scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+
|
|
Math.round(screen.width/2-275)+",top="+Math.round(screen.height/2-210));this.onSuccess=function(d){c.location.href=b(a,d)};this.onFailure=function(){c.close()}}};TradingView.ShareTwitterSnapshot.getStatus=function(a,b){return TradingView.isCmeWidget?b+" from cmegroup.com via @tradingview $"+a:"$"+a+" chart "+b+" via http://www.tradingview.com"};
|
|
TradingView.ShareStocktwitsSnapshot=function(a){function b(a,b){return"https://stocktwits.com/widgets/share?body="+encodeURIComponent(TradingView.ShareStocktwitsSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{window.JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{window.JsBridge.sendEvent("sharing_error")}catch(a){}};else{var c=open("about:blank","snapshot_tweet",
|
|
"scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,left="+Math.round(screen.width/2-275)+",top="+Math.round(screen.height/2-210));this.onSuccess=function(d){c.location.href=b(a,d)};this.onFailure=function(){c.close()}}};TradingView.ShareStocktwitsSnapshot.getStatus=function(a,b){return"$"+a+" chart "+b+" via http://www.tradingview.com"};
|
|
TradingView.authInStocktwits=function(a){runOrSignIn(function(){user.has_stocktwits?"function"===typeof a&&a():("function"===typeof a&&(user.on_stocktwits_auth_success=function(){a.apply(this,Array.prototype.slice.call(arguments));this.user.on_stocktwits_auth_success&&delete this.user.on_stocktwits_auth_success}.bind(window)),window.open("https://api.stocktwits.com/api/2/oauth/authorize?client_id="+window.stocktwits_consumer_key+"&response_type=code&redirect_uri="+location.protocol+"//"+location.host+
|
|
"/accounts/return/stocktwits/&scope=publish_messages","stocktwits_permission_request","scrollbars=yes,height=400,width=700").focus())})};TradingView.agoDateFormatter=function(a,b,c){c||(c=TradingView.agoDateFormatter.fullFormat);var d=c(new Date-b),e=d.text,d=d.timeout;a.attr("title",b.toLocaleString()).text(e);e=null;d&&(a.attr("data-ago-date-timer")&&clearTimeout(+a.attr("data-ago-date-timer")),e=setTimeout(function(){TradingView.agoDateFormatter(a,b,c)},d));a.attr("data-ago-date-timer",e)};
|
|
TradingView.agoDateFormatter.destroy=function(a){$(a).find("*").andSelf().filter("[data-ago-date-timer]").each(function(){clearTimeout(+$(this).attr("data-ago-date-timer"))})};TradingView.agoDateFormatter.nextMinuteThrough=function(a){return 6E4-a%6E4};TradingView.agoDateFormatter.nextHourThrough=function(a){return 36E5-a%36E5};TradingView.agoDateFormatter.nextDayThrough=function(a){return 864E5-a%864E5};
|
|
TradingView.agoDateFormatter.fullFormat=function(a){var b=Math.floor(a/6E4),c="",d=!1;60>b?(c=1>b?"less than a minute":b+" minute"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextMinuteThrough(a)):1440>b?(b=Math.floor(b/60),c=b+" hour"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextHourThrough(a)):43200>b?(b=Math.floor(b/1440),c=b+" day"+(1<b?"s":""),d=TradingView.agoDateFormatter.nextDayThrough(a)):15768E3>b?(b=Math.floor(b/43200),c=b+" month"+(1<b?"s":"")):(b=Math.floor(b/15768E3),c=b+" year"+
|
|
(1<b?"s":""));d&&(d+=200);return{text:c+" ago",timeout:d}};TradingView.agoDateFormatter.shortFormat=function(a){var b=Math.floor(a/6E4),c="",d=!1;60>b?(c=(1>b?0:b)+"m",d=TradingView.agoDateFormatter.nextMinuteThrough(a)):1440>b?(b=Math.floor(b/60),c=b+"h",d=TradingView.agoDateFormatter.nextHourThrough(a)):43200>b?(b=Math.floor(b/1440),c=b+"d",d=TradingView.agoDateFormatter.nextDayThrough(a)):15768E3>b?(b=Math.floor(b/43200),c=b+"mn"):(b=Math.floor(b/15768E3),c=b+"y");d&&(d+=200);return{text:c,timeout:d}};
|
|
function userlink(a,b){return Mustache.render(TradingView.templates.userlink,{username:a,is_pro:function(){return!!b},is_realtime:function(){return"pro_realtime"==b},is_premium:function(){return"pro_premium"==b},is_trial:function(){return"pro_realtime_trial"==b}},TradingView.templates)}function proBadge(a,b){return void 0===a||a?Mustache.render(TradingView.templates.proBadge,{is_realtime:"pro_realtime"==a,is_premium:"pro_premium"==a,is_trial:"pro_realtime_trial"==a,large_badge:!!b}):""}
|
|
TradingView.userBadge=function(a,b,c){var d="",e="";if(a.top_user_info){d=a.top_user_info.badge?a.top_user_info.badge.title:"";e=a.top_user_info.badge?a.top_user_info.badge["class"]:"";if(a.is_pro)switch(d+=" | ",a.pro_plan){case "pro_realtime_trial":d+="Pro Trial";break;case "pro_premium":d+="Premium";break;case "pro_realtime_trial":d+="Pro Plus";break;default:d+="Pro"}a.is_moderator&&(d+=" | Moderator")}return Mustache.render(TradingView.templates.userBadge,{is_moderator:a.is_moderator,is_pro:a.is_pro,
|
|
is_realtime:"pro_realtime"==a.pro_plan,is_premium:"pro_premium"==a.pro_plan,is_trial:"pro_realtime_trial"==a.pro_plan,is_top:!!a.top_user_info,badge_class:e,badge_title:d,large_badge:!!b,badge_tag:c},TradingView.templates)};TradingView.Common={publishChartWidget:function(a){runOrSignIn(function(){window.saver.publishChart(a)})},publishChart:function(a){runOrSignIn(function(){A83.showPublishIntroDialog().done(function(){window.saver.publishChart(a)})})}};
|
|
TradingView.symbol2id=function(a){return a.replace(/[^a-z0-9]/gi,"_")};TradingView.tokenInitialized=$.Deferred();TradingView.tokenExpiration=6E5;
|
|
TradingView.registerAuthToken=function(a){var b=this.tokenInitialized,c=new Date(1E3*user.auth_token_timestamp),d=new Date;loginStateChange.subscribe(TradingView,function(e){e&&user?user.auth_token&&(d-c<this.tokenExpiration?(a.setAuthToken(user.auth_token),b.resolve()):this.requestAndSetAuthToken(a).done(function(){b.resolve();console.info("Token expired and recreated.")})):this.isProRealtime()&&this.requestAndSetAuthToken(a).done(function(){b.resolve()})}.bind(this));setTimeout(b.resolve.bind(b),
|
|
5E3)};TradingView.requestAndSetAuthToken=function(a,b){var c=$.Deferred();this.requestAuthToken().done(function(d){a.setAuthToken(d,b);c.resolve()});return c};TradingView.requestAuthToken=function(a){function b(){e=$.post("/quote_token/",{grabSession:!!a},"json").done(function(a){c.resolve(a)}).fail(function(a){c.isRejected()||c.isResolved()||403==a.status||(a=Math.min(1E3*d,3E4),d++,setTimeout(b,a))})}var c=$.Deferred(),d=0,e;b();c.always(function(){e&&e.abort()});return c};
|
|
TradingView.isPro=function(){return is_authenticated&&user.is_pro};TradingView.isProRealtime=function(){return this.isPro()&&("pro_realtime"==user.pro_plan||"pro_realtime_trial"==user.pro_plan)};function updateChartActiveLabel(a,b){null==a&&(a=$(".chart-activity-label"));a=$(a);a.each(function(){var a=$(this),d;null==b?d=a.hasClass("chart-activity-label-active"):(d=b,a.toggleClass("chart-activity-label-active",d));a.find(".chart-activity-label-plate").text(d?"Active":"Closed")})}
|
|
TradingView.centerBlock=function(a){var b=$(window),c=a.width(),d=a.height(),e=b.width(),b=b.height();a.css({left:Math.round((e-c)/2)+"px",top:Math.round((b-d)/2)+"px"})};
|
|
TradingView.visitPaymentPageSwreg=function(a,b){if(!a.product_ids.hasOwnProperty(b))throw new TypeError("Unknown product");runOrSignIn(function(){if(!(b in{pro:1,pro_yearly:1,pro_realtime:1,pro_realtime_yearly:1}&&user.is_pro&&user.pro_plan==b)){var c={s:a.shop_id,q:1,d:0,v:0,bb:1,clr:1,clro:1,a:user.id,fn:user.first_name,sn:user.last_name,em:user.email,p:a.product_ids[b]},d=Object.keys(c).map(function(a){return encodeURIComponent(a)+"="+encodeURIComponent(c[a])});location.href=a.shop_url.replace(/(\?.*|$)/,
|
|
"?"+d.join("&"))}},!0)};
|
|
TradingView.visitPaymentPage=function(a,b,c){b=b||"y";c=c||{};var d="/order/";"bitcoin"==c.paymentMethod&&(d="/coinbase/begin/");runOrSignIn(function(){$('<form action="'+d+'" method="post"'+(c.newWindow?' target="_blank"':"")+'><input type="hidden" name="product" value="'+a+'"/><input type="hidden" name="billing_cycle" value="'+b+'"/><input type="hidden" name="fixed_billing_cycle" value="'+(c.fixedCycle?"true":"")+'"/><input type="hidden" name="exchanges_only" value="'+(c.exchangesOnly?"true":"")+
|
|
'"/></form>').appendTo(document.body).submit()},!0)};TradingView.hash=function(a){var b=0,c;if(0===a.length)return b;for(var d=0;d<a.length;d++)c=a.charCodeAt(d),b=(b<<5)-b+c,b&=b;return b};TradingView.uniq=function(a){return a.reduce(function(a,c,d){return~a.indexOf(c)?null:a.push(c),a},[])};function bindLate(a,b){return function(){return a[b].apply(a,arguments)}}
|
|
TradingView.debounce=function(a,b){var c;return function(){clearTimeout(c);c=setTimeout(a.bind.apply(a,[this].concat(Array.prototype.slice.call(arguments))),b)}};
|
|
TradingView.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var k=function(){h=!1===c.leading?0:Date.now();g=null;f=a.apply(d,e);g||(d=e=null)};return function(){var l=Date.now();h||!1!==c.leading||(h=l);var m=b-(l-h);d=this;e=arguments;0>=m||m>b?(g&&(clearTimeout(g),g=null),h=l,f=a.apply(d,e),g||(d=e=null)):g||!1===c.trailing||(g=setTimeout(k,m));return f}};TradingView.isLatin=function(a){return!/[^\u0000-\u00FF\u00A0\u2013-\u2122\u2200-\u23FF]/g.test(a)};
|
|
TradingView.isASCII=function(a,b){return(b?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(a)};TradingView.RegExpEscape=function(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};
|
|
TradingView.loadMorePeople=function(a,b,c){var d=b.$loading||$(),e=b.$button||$(),f=b.$container;d.show();e.hide();var g=c?0:f.children().length;a.data=a.data||{};a.data=$.extend({},a.data,{offset:g});$.ajax(a).done(function(a){var d=a.total,g=a.items;c&&(f.data("loaded",!1),f.empty());0<g.length?g.forEach(function(a){a.follow_button=!is_authenticated||user.id!=a.id;a.links=a.profile.location||a.profile.twitter_username||a.profile.website;a.badge=TradingView.userBadge(a,!0);a.reputation_delta&&(a.reputation_delta=
|
|
Math.round(a.reputation_delta));$(Mustache.render(h,a)).appendTo(f)}):c&&b.empty&&f.append($('<div class="empty"></div>').text(b.empty));f.children().length<d&&e.show();a.thats_all&&f.data("loaded",!0)}).always(function(){d.hide()});var h="<div class='item follow-list-item'>\t<a href='/u/{{ username }}/'><img src='{{ mid_picture_url}}'></a>\t<div class='indent'>\t<div class='description'>\t\t<div class='user-stats'>\t\t\t<span class='user-stats-followers' title='"+$.t("Followers")+"'><a href='/u/{{ username }}/#followers'>{{ followers_count }}</a></span>\t\t\t<span class='user-stats-charts' title='"+
|
|
$.t("Charts")+"'><a href='/u/{{ username }}/#charts'>{{ charts_count }}</a></span>\t\t\t<span class='user-stats-reputation' title='"+$.t("Reputation")+"'>{{ reputation }}{{# reputation_delta }} (+{{reputation_delta}}){{/ reputation_delta }}</span>\t\t</div>\t\t<div class='username'><a href='/u/{{ username }}/' class='userlink'>{{ username }}</a>{{& badge }}</div>\t\t{{# links }}\t\t<div class='links'>\t\t\t{{# profile.location }}<span class='contact location'>{{ profile.location }}</span>{{/ profile.location }}\t\t\t{{# profile.twitter_username }}<span class='contact twitter'><a href='//twitter.com/{{ profile.twitter_username }}' target='_blank'>{{ profile.twitter_username }}</a></span>{{/ profile.twitter_username }}\t\t\t{{# profile.website }}<span class='contact webpage'><a href='{{ profile.website }}' target='_blank'>{{ profile.website }}</a></span>{{/ profile.website }}\t\t</div>\t\t{{/ links }}\t\t{{# profile.about }}\t\t<div class='about'>{{ profile.about }}</div>\t\t{{/ profile.about }}\t\t{{# follow_button }}\t</div>\t\t<div class='action-buttons'>\t\t\t<button class='follow-user follow-user-{{ id }}{{# follow_status }} active{{/ follow_status }}' title='{{#follow_status}}"+
|
|
$.t("Unfollow")+"{{/follow_status}}{{^follow_status}}"+$.t("Follow")+"{{/follow_status}}' data-id='{{ id }}'>\t\t\t\t<span class='follow'>"+$.t("Follow")+"</span>\t\t\t\t<span class='following'>"+$.t("Followed")+"</span>\t\t\t\t<span class='unfollow'>"+$.t("Unfollow")+"</span>\t\t\t</button> \t\t\t<button class='message-user message active' title='"+$.t("Send")+" message' data-id='{{ id }}' data-username='{{ username }}'><span class='message'>"+$.t("Message")+"</span></button>\t\t</div>\t\t{{/ follow_button }}\t</div></div>"};
|
|
function follow(a){runOrSignIn(function(){var b=$(a.currentTarget),c=b.data("id");if(!b.is(".self")){var d=b.is(".active")?0:1;$.ajax({url:"/social/follow-the-user/",type:"POST",data:{targetId:c,follow:d}}).done(function(){$(".follow-user-"+c).toggleClass("active").attr("title",d?$.t("Unfollow"):$.t("Follow"))})}})}$("body").on("click","button.follow-user",follow);
|
|
TradingView.keyboardBinder=function(){function a(a){c.forEach(function(b,f){b.name===a&&c.splice(f,1)})}function b(a){for(var b=0;b<c.length;b++)if(c[b].name===a)return b}var c=[];$(window).on("keypress",function(a){for(var b=c.length-1;0<=b&&!0!==c[b].func(a);b--);});return{registerListener:function(a,e){var f={name:a,func:e},g=b(f.name);g?c[g]=f:c.push(f)},removeListener:function(b){a(b)},pushBackListener:function(a,e){var f={name:a,func:e},g=b(f.name);g&&c.splice(g,1);c.unshift(f)}}}();
|
|
function chartRelationButtons(a){var b=a.closest("[data-chart-id]").data("chart-id");if(!b)throw Error("chartRelationButtons can`t find data-chart-id attribute");a.on("click",".agree",function(a){function d(){e.toggleClass("active",f)}a.preventDefault();var e=$(this),f=e.hasClass("active");runOrSignIn(function(){e.toggleClass("active",!f);$.post("/vote-for-chart/",{id:b,vote:1}).done(function(a){if(a.error)return A83.showNotice("Error",a.error),d();void 0!==a.result_score&&e.text(a.result_score||
|
|
"").toggleClass("with-counter",0!==a.result_score)}).fail(d)})});a.on("click",".fav",function(a){function d(){e.toggleClass("active",f)}a.preventDefault();var e=$(this),f=e.hasClass("active");runOrSignIn(function(){e.toggleClass("active",!f);$.post(f?"/remove-from-favorites/":"/add-to-favorites/",{id:b}).done(function(a){if(a.error)return d();void 0!==a.followers&&e.text(a.followers||"").toggleClass("with-counter",0!==a.followers)}).fail(d)})})}
|
|
TradingView.makeTextContainerEditable=function(a,b,c){function d(b){a.removeClass("tv-editable-active").on("click",function(){h(c)}).off("mousedownoutside");b&&a.empty().text(b)}function e(b){a.addClass("tv-editable-active").off("click").on("mousedownoutside",function(){d(b)})}function f(){k&&k.remove()}function g(b){f();b&&(k=$('<div class="settings"><div class="error"><p></p></div></div>').find("p").text(b).end(),a.before(k))}function h(c){var h={okButtonText:$.t("OK"),okButtonClass:"tv-button ok",
|
|
cancelButtonText:$.t("Cancel"),cancelButtonClass:"tv-button cancel"};c=$.extend({},h,c);var k=a.text(),h=Modernizr.touch?"":k,p="textarea"===c.replaceWith?$("<textarea"+(c.inputClass?'class="'+c.inputClass+'" ':"")+"></textarea>"):$('<input type="text" '+(c.inputClass?'class="'+c.inputClass+'" ':"")+'value="">');p.val(h);var h=$('<div class="buttons"></div>'),r=$('<div class="'+c.okButtonClass+'">'+c.okButtonText+"</div>").appendTo(h),t=$('<div class="'+c.cancelButtonClass+'">'+c.cancelButtonText+
|
|
"</div>").appendTo(h);e(k);var v="function"===typeof c.onCancel?function(){c.onCancel();d()}:function(){d(k)},w=function(a,c,e){/^\s+$/.test(c)&&(c="");p.attr("disabled","disabled");r.addClass("process");b(a,c,e,function(){d()},f,g)};r.click(function(b){b.preventDefault();b.stopPropagation();w(a,p.val(),k)});t.click(function(a){a.preventDefault();a.stopPropagation();v()});p.keyup(function(b){b.preventDefault();b.stopPropagation();13!=b.keyCode||b.shiftKey?27==b.keyCode&&v():w(a,p.val(),k)});a.empty().append(p,
|
|
h);p.select()}var k;!a instanceof $?console.error("$container should be jQuery object"):b?"function"!=typeof b?console.error("onOk should be function"):(a.addClass("tv-editable"),d()):console.error("onOk required")};
|
|
TradingView.changeUserProfileField=function(a){function b(a){var b=Array.prototype.slice.call(arguments);b.shift();"function"===typeof a&&a.apply(this,b)}if(a&&a.name&&"undefined"!=typeof a.value){var c={};c[a.name]=a.value;$.post("/accounts/change_data_json/",c,function(c){!c.errors||$.isEmptyObject(c.errors)?(c=c[a.name],user[a.name]=c,b(a.onSuccess,c)):b(a.onError,c.errors[a.name])}).error(function(c){403===c.status?b(a.onError,"Please, try to reoload page to edit user data"):b(a.onError,A13.isProd()?
|
|
"Sorry, an error has occurred":c.responseText)}).always(function(){b(a.onComplete)})}else console.warn("Required options.name and options.value")};
|
|
TradingView.inputOnTyping=function(a,b,c){function d(){var a=$(this),d=a.val(),e=b(d);a.removeClass("tv-dialog-text-input-error");"function"===typeof c&&c(d);d!==e&&a.val(e)}function e(a){if(a.ctrlKey||a.metaKey||!a.charCode)return!1;a=a.keyCode||a.which;return 9==a||13==a||16==a||17==a||18==a||19==a||20==a||27==a||33<=a&&40>=a?!1:!0}a instanceof $?("function"!==typeof b&&(b=function(a){return a}),a.each(function(a,b){var c=$(b);c.on("keypress",function(a){if(e(a)){var b=function(){d.call(this);$(this).off("keyup",
|
|
b)}.bind(this);$(this).on("keyup",b)}});c.change(d)})):console.warn("'$inputs' should be instance of jQuery")};
|
|
TradingView.makeInputNumberOnly=function(a,b){b=b||{};var c=b.integerOnly,d=b.positiveOnly;TradingView.inputOnTyping(a,function(a){a=a.replace(/\,/g,".").replace(/[^0-9\.-]/g,"").replace(/^-/,d?"":"__minus__").replace(/\./,"__point__").replace(/^__point__/,"0__point__").replace(/[\.-]/g,"").replace("__minus__","-").replace("__point__",".").replace(/^0+/,"0");c&&/\d+/.test(a)&&(a=parseInt(a),TradingView.isInteger(b.minValue)&&(a=Math.max(b.minValue,a)),TradingView.isInteger(b.maxValue)&&(a=Math.min(b.maxValue,
|
|
a)));!c&&/^0\d/.test(a)&&(a=a.toString(),a=a.substring(0,1)+"."+a.substring(1,a.length));return a},b.inputOnTypingCallback)};TradingView.makeInputDateOnly=function(a,b){b=b||{};TradingView.inputOnTyping(a,function(a){if(4==a.length||7==a.length)a+="-";return a=a.substr(0,10)},b.inputOnTypingCallback)};TradingView.makeInputTimeOnly=function(a,b){b=b||{};TradingView.inputOnTyping(a,function(a){2==a.length&&(a+=":");return a=a.substr(0,5)},b.inputOnTypingCallback)};
|
|
TradingView.timezoneIsAvailable=function(a){for(var b=0;b<TradingView.availableTimezones.length;b++)if(a===TradingView.availableTimezones[b].id)return!0;return!1};TradingView.showChangeUserStatusDialog=function(){runOrSignIn(function(){A83.showChangeUserStatusDialog()});return!1};
|
|
TradingView.getUrlParams=function(){var a,b=/\+/g,c=/([^&=]+)=?([^&]*)/g,d=window.location.search.substring(1),e={};for(a=c.exec(d);a;)e[decodeURIComponent(a[1].replace(b," "))]=decodeURIComponent(a[2].replace(b," ")),a=c.exec(d);return e};TradingView.createUrlParams=function(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&null!=a[c]&&b.push(encodeURIComponent(c)+"="+encodeURIComponent(a[c]));return b.join("&")};
|
|
TradingView.setTrialAvailiable=function(a){window.localStorage&&(window.localStorage.trial_availiable=a?1:0)};TradingView.translatedIntervalString=function(a){var b=(""+a).match(/(.*)([DWM])/);return b?b[1]+$.t(b[2],{context:"dates"}):a};TradingView.capitalizeFirstLetter=function(a){return a.charAt(0).toUpperCase()+a.slice(1)};
|
|
TradingView.generateColor=function(a,b){if(0<=b&&100>=b){var c=parseInt(a.substr(1,2),16),d=parseInt(a.substr(3,2),16),e=parseInt(a.substr(5,2),16);return"rgba("+c+", "+d+", "+e+", "+(1-b/100).toFixed(2)+")"}throw"invalid transparency";};
|
|
TradingView.pow10Increment=function(a,b,c){var d=1;0>a&&(d=-1,b=!b);c=Math.abs(c);isFinite(c)||(c=1);a=Math.abs(a);var e=Math.pow(10,Math.floor(Math.log(a)/Math.LN10))||c||0;10*e<=a&&(e*=10);b&&a===e&&(e/=10);e<c&&(e=c);return b?Math.ceil(a/e-1)*e*d:Math.floor(a/e+1)*e*d};TradingView.abbreviatedNumber=function(a){var b=0;a=+a;if(isFinite(a))for(;1E3<=a&&0===a%100;)b++,a/=1E3;var c=" K M G T Y".split(" ")[b];null==c&&(c="e"+3*b);return a+c};
|
|
TradingView.makeFont=function(a,b,c){c&&(c+=" ");return c+a+"px "+b};$.fn.filterByData=function(a,b){return this.filter(function(){return $(this).data(a)==b})};$.fn.reverse=[].reverse;
|
|
function showExtensionPopup(){$(function(){function a(a){if(A83.modalDialog)A83.modalDialog.find(".tv-dialog").on("destroy",function(){setTimeout(a,0)});else a()}if(window.is_authenticated&&TradingView.D18("show_extension_popup")&&R77.enabled("show_extension_popup")&&!TradingView.isOnFeaturePage){var b;(function(){var a=window.chrome,b=window.navigator.vendor;return null!==a&&void 0!==a&&"Google Inc."===b})()&&(b="chrome");if(b){var c="notShowExtensionPopup."+b;TVSettings.getBool(c,
|
|
!1)||a(function(){A83.showBrowserExtensionDialog(b).find(".tv-dialog").on("destroy",function(){TVSettings.setValue(c,!0)})})}}})}TradingView.removeBBCodes=function(a){return a.replace(/\[quote=("|")([a-z0-9\._\-\u00A0]+)("|")\]/ig,"@$2 "+$.t("wrote")+":\n").replace(/\[\/quote\]/g,"")};TradingView.removeQuotes=function(a){return a.replace(/\[quote=("|")([a-z0-9\._\-\u00A0]+)("|")\][^]*\[\/quote\](\n?)/ig,"")};
|
|
TradingView.parseQuotes=function(a){var b=a.match(/^\[quote="([a-z0-9\._\-\u00A0]+)"\]/i),c=a.lastIndexOf("[/quote]");return b&&0===b.index&&0<c?TradingView.removeQuotes('<div class="ch-item-quote">@'+b[1]+" "+$.t("wrote")+":<br />"+a.substring(b[0].length,c)+"</div>"+("\n"==a[c+8]?a.substring(c+9):a.substring(c+8))):a};
|
|
TradingView.getInnerTextContent=function(a){var b=function(a){return a.childElementCount?$.map(a.childNodes,b).join("")+("DIV"==a.tagName?"\n":""):"BR"==a.tagName?"\n":a.textContent};return b(a)};TradingView.urlRegExp={publishedImage:"/(?:i|x)/([0-9a-zA-Z]{8})/?",publishedChartOld:"/v/([0-9a-zA-Z]{8})/?",publishedChart:"/chart/([0-9a-zA-Z:+*-/()]+?)/([0-9a-zA-Z]{8})(?:-([^/]+))?/?",publishedScript:"/script/([0-9a-zA-Z]{8})(?:-([^/]+))?/?"};
|
|
TradingView.createPublishedChartUrl=function(a,b,c){return a&&/[0-9a-zA-Z]{8}/.test(a)?a&&b?"/chart/"+b+"/"+a+(c?"-"+c:"")+"/":"/v/"+a+"/":""};
|
|
TradingView.parsePublishedChartUrl=function(a){var b={},c=new RegExp(TradingView.urlRegExp.publishedChartOld),d=new RegExp(TradingView.urlRegExp.publishedChart),e=new RegExp(TradingView.urlRegExp.publishedScript);c.test(a)?(a=a.match(c)||{},b={image_url:a[1]}):d.test(a)?(a=a.match(d)||{},b={symbol:a[1],image_url:a[2],title:a[3]}):e.test(a)&&(a=a.match(e)||{},b={image_url:a[1],title:a[2]});return b};
|
|
TradingView.createPublishedChartImageUrl=function(a){return a&&/[0-9a-zA-Z]{8}/.test(a)?"/i/"+a+"/":""};
|
|
TradingView.openNewChart=function(a){a=a||{};if(is_authenticated){var b='<form method="POST" target="_blank" action="/chart/" style="display: none;"><input type="text" name="new" value="1">';Object.keys(a).forEach(function(c){b+='<input type="text" name="'+c+'" value="'+a[c]+'">'});var b=b+'<input type="submit"></form>',c=$(b);$("body").append(c);c.submit()}else c=$.param(a),window.open("/chart/"+(c?"?"+c:""),"_blank")};$(window).load(function(){window.loaded=!0});TradingView.adPack=function(){function a(a){return a?"https://exante.eu/tradingview/?utm_source=tradingview&utm_medium=context_ad&utm_content="+a.name+"&utm_campaign="+a.listed_exchange:"https://exante.eu/tradingview/?utm_source=tradingview&utm_medium=context_ad"}function b(a){if("object"!=typeof a||null===a)a=user;return"Exante"===a.username}function c(a){a.removeClass("settings").addClass("ad-pack");var b=a.find(".form-section.tv-profile-area").eq(0);$('<div class="left-column">').appendTo(a.html(""));
|
|
var c=$('<div class="right-column">').appendTo(a);[{name:"ad-pack-change-messages",title:"Chart Pop-up Messages",action:"/ad_pack/change_messages/",fields:"default index stock futures forex bitcoin".split(" "),parent:a},{name:"ad-pack-pm-message",title:"Private Messages",action:"/ad_pack/pm_message/",fields:["message"],sbmText:"Send PM to All Non-Pro Users",parent:c,skip:!0}].forEach(function(a){if(!a.skip){var c=b.clone();c.find("h3").text(a.title);c.find("form").attr({id:a.name,action:a.action,
|
|
target:a.name+"-target"});c.find("iframe").replaceWith($(document.createElement("iframe")).attr({src:a.action,name:a.name+"-target"}).css({position:"absolute",left:-9999,width:10,height:10}));c.find("tr").each(function(){var b=$(this);if(!b.hasClass("error-row"))if(b.hasClass("caption")||!a.fields.length)b.remove();else{var c=a.fields.shift(),b=b.find("td");b.eq(0).text(c.charAt(0).toUpperCase()+c.substr(1));$(document.createElement("textarea")).attr({name:c,maxLength:Math.pow(2,8),rows:10,cols:40}).appendTo(b.eq(1).html(""))}});
|
|
a.sbmText&&c.find("input[type=submit]").attr("value",a.sbmText);c.appendTo(a.parent)}});return a}function d(a){return-1!==C.indexOf(a.listed_exchange)}function e(a){return-1!==A.indexOf(a.listed_exchange)}function f(a){return"INDEX"==a.listed_exchange&&-1!==y.indexOf(a.name)}function g(a){return"INDEX"==a.listed_exchange&&-1!==D.indexOf(a.name)}function h(a){return-1!==E.indexOf(a.listed_exchange)}function k(a){return-1!==z.indexOf(a.listed_exchange)}function l(a){return"forex"==a.type}function m(a){return"OTC"==
|
|
a.listed_exchange}function n(a,b,c,d){return a(c)&&b(d)||a(d)&&b(c)}function p(a,b){var c,p;c=!1;if(n(l,d,a,b)||n(l,e,a,b))c=l(a)?b:a,c="Want to trade Forex and "+c.name+"? Trade stocks and other currencies online with EXANTE on world\u2019s major exchanges!";if(n(l,f,a,b)||n(l,g,a,b))c=l(a)?b:a,c="Want to trade Forex and "+c.name+"? Trade indices and foreign currencies online with EXANTE on world\u2019s major exchanges!";if(n(l,h,a,b)||n(l,k,a,b))c=l(a)?b:a,c="Want to trade Forex and "+c.name+"? Trade foreign currencies and futures online with EXANTE on world\u2019s major exchanges!";
|
|
n(l,m,a,b)&&(c="Want to trade OTC and Forex? Get direct access to all OTC's and foreign currencies with EXANTE on world\u2019s major exchanges!");if(n(m,d,a,b)||n(m,e,a,b))c=m(a)?b:a,c="Interested in "+c.name+" and OTC? Get direct access to all OTC's and stocks with EXANTE on world\u2019s major exchanges!";if(n(m,f,a,b)||n(m,g,a,b))c=m(a)?b:a,c="Interested in "+c.name+" and OTC? Get direct access to all OTC's and indices with EXANTE on world\u2019s major exchanges!";if(n(m,h,a,b)||n(m,k,a,b))c=m(a)?
|
|
b:a,c="Interested in "+c.name+" and OTC? Get direct access to all OTC's and futures with EXANTE on world\u2019s major exchanges!";n(k,d,a,b)&&(c="Interested in "+a.name+" and "+b.name+"? Trade stocks and futures online with EXANTE on world\u2019s major exchanges!");n(k,e,a,b)&&(c="Interested in foreign stocks and futures? Trade them online with EXANTE on world\u2019s major exchanges!");if(n(k,f,a,b)||n(k,g,a,b))c="Interested in "+a.name+" and "+b.name+"? Trade indices and futures online with EXANTE on world\u2019s major exchanges!";
|
|
n(k,h,a,b)&&(c="Interested in "+a.name+" and "+b.name+"? Trade futures online with EXANTE on world\u2019s major exchanges!");if(n(h,d,a,b)||n(h,e,a,b))c="Interested in "+a.name+" and "+b.name+"? Trade stocks and futures online with EXANTE on world\u2019s major exchanges!";if(n(h,f,a,b)||n(h,g,a,b))c="Interested in "+a.name+" and "+b.name+"? Trade indices and futures online with EXANTE on world\u2019s major exchanges! ";n(g,d,a,b)&&(c="Interested in "+a.name+" and "+b.name+"? Trade stocks and futures online with EXANTE on world\u2019s major exchanges!");
|
|
n(g,e,a,b)&&(c="Want to trade "+a.name+" and "+b.name+"? EXANTE provides direct access to all major markets!");n(g,f,a,b)&&(c="Want to trade "+a.name+" and "+b.name+"indices? Trade indices online with EXANTE on world\u2019s major exchanges!");n(f,d,a,b)&&(c=f(a)?a:b,p=d(a)?a:b,c="Interested in "+p.name+" stocks and "+c.name+" index? Trade stocks and indices online with EXANTE on world\u2019s major exchanges!");n(f,e,a,b)&&(c=f(a)?a:b,p=e(a)?a:b,c="Interested in "+p.name+" stocks and "+c.name+" index? Trade stocks and indices online with EXANTE on world\u2019s major exchanges!");
|
|
n(d,e,a,b)&&(c="Interested in "+a.name+" and "+b.name+" stocks? Trade stocks and indices online with EXANTE on world\u2019s major exchanges!");c&&window.is_authenticated&&window.user&&window.user.username&&(c=window.user.username+", "+c.charAt(0).toLowerCase()+c.slice(1));return c}function r(b,c){if(c.full_name!=b.full_name){var d=+(localStorage.getItem("chart-ads-popup-exchange-counter-Exante")||0);if(!(2<=d)){var e=localStorage.getItem("chart-ads-popup-exchange-Exante");if(!(e&&864E6>(new Date).getTime()-
|
|
e)){var f=p(b,c);f&&$.post("/ad_pack/check_user/",function(b){b.check&&(localStorage.setItem("chart-ads-popup-exchange-Exante",(new Date).getTime()),localStorage.setItem("chart-ads-popup-exchange-counter-Exante",d+1),x=A83.createDialog("adPackExante",{addClass:"popup-exante",content:'<div class="message">'+f+'</div><div class="actions-block"><a class="no-button">'+$.t("No, thank you")+'</a><a href="'+a(c)+'" class="yes-button" target="_blank">'+$.t("Read more")+"</a></div>",hideTitle:!0}),x.on("click",
|
|
".no-button, .yes-button, .tv-dialog-title-close",function(a){a=$(a.target);a.hasClass("no-button")||a.hasClass("tv-dialog-title-close")?TradingView.trackEvent("AdPack","Exante-Exchnage-Popup-Decline"):a.hasClass("yes-button")&&TradingView.trackEvent("AdPack","Exante-Exchange-Popup-Accept");A83.destroy("adPackExante");x=null}),A83.positionDialog(x),TradingView.trackEvent("AdPack","Exante-Exchange-Popup-Show"))})}}}}var t=!1,v=!1,w=!1,u=!1,x;$(function(){t=TradingView.D18("adPackActive");
|
|
v=TradingView.D18("adPackCustomChatMsgActive");w=TradingView.D18("adPackChartPopUpActive");TradingView.D18("adPackMassPMActive");u=TradingView.D18("adPackProfileTabActive");t&&$(document.documentElement).addClass("sp-active")});var C="NYSE NASDAQ BATS AMEX TSX TSXV".split(" "),A=["NSE_EOD","LSE_EOD","MERCADO","BSE"],y="INX DJY0 IUX INDU DOWT TYX IUXX TRAN TXCX XAL DJWO DTY0 SRPP BGC TICK SKEW SSCL OUY0 ADDN FVX S1FI BCT BWH XEDB BANK RUA FOQ TXSX NSHF DSST SGQG SSDI XAU/USD RLV VXLE ONE DCTH TTEN TXBB S1TH S5TH AXTH MMTW SFTI SPXT YMY0 BIKT NDXT SG0I SG1E MYHN HIGN SSPN DREI DSWU S4FI DUY0 ADVQ DXY SPX DOWI VIX NASX TNX MERV XAU NYA NBI DOWU GVZ XOI BTK MID OEX DOWA NSEI XNG DOWC OVX VXV DOWE SOX VXN VXD CIV AMZ SPXP CZH VIXC VVIX GDM HGX DDA DUSA".split(" "),
|
|
D="HSI DAX RTS XGY0 FTSE BVSP HUI CAC MIB TWII EUR MOY0 NKY STI TRIN ATX BBR MXX HSCE KLSE AXJO JKSE S5FI OBX VLA MPY0 BSES TAY0 SSMI FTMC DUBS VZQ SIIN KSI NZD DIVD FTY0 SSCH BSB CXV BKC BCI SNAC COMP SAAA SFER QUANDL".split(" "),E="COMEX COMEX_MINI CBOE CBOT CBOT_MINI CME CME_MINI NYMEX NYMEX_MINI ICEUSA".split(" "),z=["ICEEUR","EUREX"];return{isAdvertiser:b,customChatMessage:function(a,c){t&&v&&b(a)&&c("exante")},chartPopUp:function(b){if(t&&w&&!user.is_pro){var c=~~localStorage.getItem("chart-ads-popup-counter-Exante"),
|
|
d=~~localStorage.getItem("chart-ads-popup-disabled-Exante");if(!(3<=c||d)){var e,f;b.model().mainSeries().onSymbolResolved().subscribe(null,function(){x||e||(e=setTimeout(function q(){e=null;if(f){var d=b.model().mainSeries().quoteData;d&&(d=f[d.type]||f["default"],String(d).replace(/^\s+|\s+$/g,"")&&(x=A83.createDialog("adPackExante",{addClass:"popup-exante",content:'<div class="message">'+d.replace(/</g,"<").replace(/>/g,">")+'</div><div class="actions-block"><a class="no-button">'+
|
|
$.t("No, thank you")+'</a><a href="'+a()+'" class="yes-button" target="_blank">'+$.t("Read more")+"</a></div>",hideTitle:!0}),x.on("click",".no-button, .yes-button, .tv-dialog-title-close",function(a){a=$(a.target);a.hasClass("no-button")||a.hasClass("tv-dialog-title-close")?(TradingView.trackEvent("AdPack","Exante-Popup-Decline"),localStorage.setItem("chart-ads-popup-counter-Exante",c+1)):a.hasClass("yes-button")&&(TradingView.trackEvent("AdPack","Exante-Popup-Accept"),localStorage.setItem("chart-ads-popup-disabled-Exante",
|
|
1));A83.destroy("adPackExante");x=null}),A83.positionDialog(x),TradingView.trackEvent("AdPack","Exante-Popup-Show")))}else $.ajax("/ad_pack/get_messages/").done(function(a){!a||a.constructor!==Object||a.error?a.error&&window.console&&console.error("AdPack Error: "+a.error):(f=a,q())})},9E5))},!0)}}},chartExchangePopUp:function(a){if(t&&w&&!user.is_pro){var b;a.model().mainSeries().onSymbolResolved().subscribe(null,function(a){b&&r(b,a);b=a})}},setTab:function(a){if(b()&&u&&a){var d=a.$decks.filter(".settings"),
|
|
e=a.$tabs.filter("a[href=#settings]");d&&e&&(d=c(d.clone()).insertAfter(d),e=e.closest(".filter-tabbed"),e=e.clone().insertAfter(e).find(".profile-tab"),e.text("Ad Pack").attr("href","#ad-pack").attr("data-value","ad-pack"),a._tabsList["ad-pack"]={showForNotAuth:!1},a.$tabs=a.$tabs.add(e.get(0)),a.$decks=a.$decks.add(d.get(0)))}}}}();D17=function(){function a(a){c.hasOwnProperty(a)||(c[a]=new Delegate);return c[a]}var b={},c={};b.unsubscribe=function(b,c,f){a(b).unsubscribe(f,c)};b.on=function(a,c,f){return b.subscribe(a,c,f)};b.subscribe=function(b,c,f){a(b).subscribe(f,c)};b.emit=function(b,c){a(b).fire(c)};return b}();var TVSettings=function(){function a(a,b){var c;c=r[a];window.is_authenticated&&!k||null!=c||!window.localStorage||(c=r[a]);return null==c?b:c}function b(a,b,c){c=c||{};b=""+b;r[a]!==b&&(r[a]=b,e(a));c.forceFlush&&f();return TVSettings}function c(a){null!=r[a]&&(delete r[a],e(a));return TVSettings}function d(){v=void 0;t.length&&f()}function e(a){if(!window.is_authenticated||k)try{null==r[a]?localStorage.removeItem("tradingview."+a):localStorage.setItem("tradingview."+a,r[a])}catch(b){}else t.push(a),
|
|
v||(v=setTimeout(d,p));TVXWindowEvents.emit("settings",JSON.stringify({key:a,value:r[a]}))}function f(a){if(!TradingView.onWidget()&&window.is_authenticated&&!k&&0!==t.length){var b=t;t=[];for(var c={},d=b.length;d--;){var e=b[d],f=r[e];void 0===f&&(f=null);c[e]=f}$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(c)},async:!a})}}function g(){return Object.keys(r)}var h=!1,k=R77.enabled("cqg_terminal");try{h=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(l){}if(h){var m=
|
|
{"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},h=function(a,b,c){a=m[a];return null===a||void 0===a?b:a},n=function(){};return{loaded:!1,loadedModel:!1,getValue:h,getJSON:h,getBool:h,getFloat:h,getInt:h,setValue:n,setJSON:n,remove:n,restoreDefaults:n,keys:function(){return Object.keys(m)},keysMask:function(){return[]},sync:n}}var p=12E4;"local"===window.environment&&(p=5E3);var r={},t=[],v,w=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/];TVXWindowEvents.on("settings",
|
|
function(a){a=JSON.parse(a);null==a.value?delete r[a.key]:r[a.key]=a.value});$(window).on("visibilitychange",function(a,b){b||f()});$(window).on("unload",function(){f(!0)});return{loaded:!1,loadedModel:!1,getValue:a,getJSON:function(b,d){var e=a(b,void 0);if(null==e)return d;try{return JSON.parse(e)}catch(f){return c(b),d}},getBool:function(b,c){var d=a(b);return null==d?c:d&&"false"!==d&&0!==+d?!0:!1},getFloat:function(b,c,d){d=a(b,void 0,d);if(null==d)return c;c=parseFloat(d);if(!isFinite(c))throw new TypeError('"'+
|
|
d+'" is not float (key: "'+b+'")');return c},getInt:function(b,c,d){d=a(b,void 0,d);if(null==d)return c;c=parseInt(d,10);if(!isFinite(c))throw new TypeError('"'+d+'" is not int (key: "'+b+'")');return c},setValue:b,setJSON:function(a,c){var d=JSON.stringify(c);b(a,d);return TVSettings},remove:c,restoreDefaults:function(){for(var a=0;a<localStorage.length;a++){var b=localStorage.key(a);"tradingview."===b.substring(0,12)&&(t=[],localStorage.removeItem(b))}$.post("/restoredefaults/",{},function(a){A83.showNotice("Success",
|
|
"Defaults has been successfully restored")}).error(function(a){})},keys:g,keysMask:function(a,b){var c=g(b),d=[];a=new RegExp("^"+TradingView.RegExpEscape(a).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi");for(var e=c.length-1;0<=e;e--)a.test(c[e])&&d.push(c[e]),a.lastIndex=0;return d},sync:function(a){if(window.is_authenticated&&!k){a=a||{};r=[];if(window.localStorage)for(var c=0===Object.keys(a).length,d=localStorage.length;d--;){var e=localStorage.key(d);if("tradingview."===e.substring(0,
|
|
12)){if(c){var f=e.substring(12);b(f,localStorage.getItem(e))}localStorage.removeItem(e)}}for(d in a)r[d]=a[d]+""}else if(r=[],window.localStorage)for(d=!R77.enabled("save_chart_properties_to_local_storage"),a=localStorage.length;a--;)if(c=localStorage.key(a),"tradingview."===c.substring(0,12)){e=c.substring(12);if(!(f=!d))a:{for(var f=e,g=0;g<w.length;++g)if(w[g].exec(f)){f=!0;break a}f=!1}f&&(r[e]=localStorage.getItem(c))}}}}();A13=function(){if("www.tradingview.com"==location.host||"dwq4do82y8xi7.cloudfront.net"==location.host||"i18n.tradingview.com"==location.host||location.host.match(/proxy\d.tradingview.com/)||location.host.match(/prod-[^.]+.tradingview.com/))return"battle";if(-1!==location.href.indexOf("tradingview.com"))return"staging";if(location.host.match(/webcharts/))return"staging_local";location.host.match(/^localhost(:\d+)?$/);return"local"};
|
|
A13.isLocal=function(){return"local"==this()};A13.isProd=function(){return"battle"==this()};A13.isDebug=function(){return!this.isProd()};TradingView.LOGLEVEL_NORMAL=1;TradingView.LOGLEVEL_DEBUG=2;A46={};TradingView.LOGHISTORY_LENGTH=500;TradingView.getLogLevel=function(){return TVSettings.getInt("log_level",TradingView.LOGLEVEL_NORMAL)};var lon=TradingView.loggingOn=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_DEBUG);TradingView.logNormal("Debug logging enabled")},loff=TradingView.loggingOff=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_NORMAL);TradingView.logNormal("Debug logging disabled")};
|
|
TradingView.log=function(){var a,b;setInterval(function(){b=a=null},1E3);return function(c,d,e){if(d!=a||e!==b){var f=e||"global",g=new Date;A46[f]=A46[f]||[];f=A46[f];"\n"!=d&&f.unshift({timestamp:g,msg:d});f.length>TradingView.LOGHISTORY_LENGTH&&f.pop();"undefined"!==typeof console&&console.log&&c<=TradingView.getLogLevel()&&(a=d,b=e,"\n"!=d&&console.log(g.toISOString()+":"+e+":"+d))}}}();
|
|
TradingView.getLogHistory=function(a,b){var c=[].concat(A46.global||[]).map(function(a){return $.extend({},a,{subsystem:"global"})});a&&(c=c.concat(A46[a]||[]).map(function(b){return $.extend({},b,{subsystem:a})}));c.sort(function(a,b){return a.timestamp.valueOf()-b.timestamp.valueOf()});b&&(c=c.slice(-b));return c.map(function(a){return a.timestamp.toISOString()+":"+a.subsystem+":"+a.msg})};
|
|
TradingView.logNormal=function(a,b){TradingView.log(TradingView.LOGLEVEL_NORMAL,a,b)};TradingView.logDebug=function(a,b){TradingView.log(TradingView.LOGLEVEL_DEBUG,a,b)};TradingView.logDebugChart=function(a){TradingView.logDebug(a,"chart")};TradingView.logDebugQuote=function(a){TradingView.logDebug(a,"quote")};TradingView.logNormalChart=function(a){TradingView.logNormal(a,"chart")};TradingView.logNormalQuote=function(a){TradingView.logNormal(a,"quote")};
|
|
TradingView.remoteDebug=function(){var a={arguments:JSON.stringify(Array.prototype.slice.call(arguments))};$.ajax("/remote_debug/",{data:a})};TradingView.remoteDebugTouch=function(){Modernizr.touch&&this.remoteDebug.apply(this,arguments)};if(A13.isProd()&&"undefined"!==typeof console){var noop=function(){};TradingView.remoteDebug=noop}TradingView.FPS_NONE=0;TradingView.FPS_SHOw_FULL=1;
|
|
var fpson=TradingView.displayFpsOn=function(){TVSettings.setValue("display_fps",TradingView.FPS_SHOw_FULL)},fpsoff=TradingView.displayFpsOff=function(){TVSettings.setValue("display_fps",TradingView.FPS_NONE)};TradingView.getDisplayFpsLevel=function(){return TVSettings.getInt("display_fps",TradingView.FPS_NONE)};
|
|
TradingView.perfomanceTestEnabled=function(){return window.performance&&window.performance.now&&(window.featureToggleState&&window.featureToggleState.perfomance_test_fps||localStorage["forcefeaturetoggle.perfomance_test_fps"])?!0:!1};(function(a){function b(b,d){this.container=a(b);this.options=d||{};this.options.callbacks||(this.options.callbacks={});this.column_num=0;this.items=[];this.init();var e=this;window.addEventListener("resize",function(){e.resize()})}b.prototype.fireCallback=function(a,b){if("function"===typeof this.options.callbacks[a])this.options.callbacks[a](b)};b.prototype.resize=function(){this.columnsCount!=this.calculateColumnsCount()&&(this.options.fixHeightOnRecalculate&&this.container.css({height:this.container.height()}),
|
|
this.removeColumns(),this.init(!0),this.options.fixHeightOnRecalculate&&this.container.css({height:"auto"}))};b.prototype.getItems=function(){return this.container.find("> "+this.options.itemsSelector).toArray()};b.prototype.addItems=function(a,b){this.items=this.items.concat(a);this.balance(a,b)};b.prototype.balance=function(a,b){switch(this.options.balanceType){case "height":this.balanceHeight(a,b);break;default:this.balanceSimple(a,b)}};b.prototype.balanceHeight=function(b,d){var e=this;this.columns.forEach(function(a){a.fragment||
|
|
(a.fragment=document.createDocumentFragment())});a.each(b,function(b,c){var h=a(c),k=h.data("cb-height")||h.outerHeight(!0);if(k)h.data("cb-height",k);else throw"Cant get item height";"none"==h.css("display")&&(k=0);var l=null;if(h.hasClass("two-columns-item")){e.columns.sort(TradingView.sortMultipleFunction("index"));var m;if(2<this.columnsCount)for(l=null,h=this.columns.length-1;0<h;h--){var n=Math.abs(this.columns[h].height-this.columns[h-1].height);if(null===l||n<=l)l=n,m=h-1}else m=0;l=this.columns[m];
|
|
m=this.columns[m+1];h=k;n=0;l.height>m.height?h+=l.height-m.height:n=m.height-l.height;var p=document.createElement("div");p.style.height=h+"px";p.className="empty-space";m.fragment.appendChild(p);m.height+=h;n&&(p=document.createElement("div"),p.style.height=n+"px",p.className="empty-space",l.fragment.appendChild(p),l.height+=n)}else e.columns.sort(TradingView.sortMultipleFunction("height","index")),l=e.columns[0];!e.options.maxRow||this.row_num<e.options.maxRow?(l.height+=k,l.fragment.appendChild(c)):
|
|
d&&e.container[0].removeChild(c)}.bind(this))};b.prototype.balanceSimple=function(b,d){var e=this;a.each(b,function(a,b){var c=e.columns[this.column_num];c.fragment||(c.fragment=document.createDocumentFragment());!e.options.maxRow||this.row_num<e.options.maxRow?(c.fragment.appendChild(b),c.count++):d&&e.container[0].removeChild(b);++this.column_num>=e.columnsCount&&(this.row_num++,this.column_num=0)}.bind(this))};b.prototype.init=function(a){this.row_num=this.column_num=0;this.columnsCount=this.calculateColumnsCount();
|
|
this.createLayout(this.columnsCount);a?this.balance(this.items,!1):this.addItems(this.getItems(),!0);this.pushFragmentsToColumns()};b.prototype.calculateColumnsCount=function(){var a=this.container.width(),b=this.options;if(!a)throw"Can't get container width.";for(var e=Math.floor(a/b.columnWidth);0<=e&&e*b.columnWidth+(e-1)*b.gap>a;)e--;return e};b.prototype.createLayout=function(b){this.columns=[];for(var d=document.createDocumentFragment(),e=0;e<b;e++){var f=a('<div class="cb-column"></div>');
|
|
this.columns.push({target:f,count:0,height:0,index:e});d.appendChild(f[0])}this.container.prepend(d)};b.prototype.pushFragmentsToColumns=function(a){for(var b=this.columns.length,e=0;e<b;e++){var f=this.columns[e];if(a)for(var g=0;g<f.fragment.childNodes.length;g++)f.fragment.childNodes[g].className+=" show-animate animate-init";f.target.append(f.fragment);delete f.fragment}var h=this;a&&setTimeout(function(){h.container.find(".animate-init").removeClass("animate-init")},1)};b.prototype.removeColumns=
|
|
function(){this.columns.forEach(function(a){a.target.detach()})};b.prototype.rescan=function(){this.addItems(this.getItems(),!0);this.pushFragmentsToColumns()};b.prototype.reset=function(){this.items=[];this.removeColumns();this.init()};a.fn.columnsBalancer=function(c){if(a(this).length)return new b(a(this),c);var d=[];a(this).each(function(){d.push(new b(a(this),c))});return d}})(jQuery);var A83={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4E3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(a){R77.enabled("constraint_dialogs_movement")&&(a.containment=".chart-page");return a},showBrowserExtensionDialog:function(a){if(a)return A83.createModalDialog("Browser Extension",{noHeader:!0,width:"730px",content:Mustache.render(TradingView.templates.dialogs.browserExtension,{browser:{chrome:{logo:"/static/images/svg/google-chrome-logo.svg",
|
|
name:"Google Chrome",href:"https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj"}}[a]})}),A83.modalDialog.find(".install-extension, .tv-dialog-title-close").click(function(a){A83.destroy()}),A83.positionDialog(),A83.modalDialog},showIntervalMismatchDialog:function(a){var b;b=!1;A83.createModalDialog("Interval is not applicable");var c=A83.modalDialog;c.css({zIndex:1E3});c.find(".tv-dialog").css("width","400px");c=
|
|
A83.modalDialog.find(".tv-dialog-content");c.html('<div class="main"><div class="caption-big"><p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p></div><div class="main-properties"></div></div>');c=c.find(".main-properties");c=$('<div class="dialog-buttons"></div>').appendTo(c);if(a){var d=$('<label class="dialog-trail-checkbox"><input type="checkbox" /> Do not show this message again</label>').appendTo(c).find("input");
|
|
d.attr("checked",a.silentIntervalChange.value());d.bind("click",function(){a.silentIntervalChange.setValue(this.checked)})}$('<a class="tv-button ok">OK</a>').appendTo(c).bind("click",function(){A83.destroy()});A83.positionDialog();A83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:b})},showSignInDialog:function(a,b){function c(a){var b;switch(a){case "signup":case "signup-trial":b=n.indexOfPage(l);break;case "recover":b=n.indexOfPage(m);break;default:a="signin",b=n.indexOfPage(k)}f.find('[name="signup_trial"]').val("signup-trial"==
|
|
a?1:0);f.find(".show-if-signin, .show-if-signup, .show-if-recover").not(".show-if-"+a).hide();f.find(".show-if-"+a).show();n.setActivePage(b)}function d(){A83.positionDialog()}if(!is_authenticated)if(b=$.extend({},b),"function"==typeof a?A83.onSigninSuccess=a:delete A83.onSigninSuccess,R77.enabled("whotrades_auth_only"))window.open("/accounts/signin/whotrades/","_blank");else{var e=A83.createModalDialog("Log in",{noHeader:!0,addClass:"auth-dialog"});if(b.onDestroy)A83.modalDialog.on("destroy",
|
|
b.onDestroy);var f=A83.modalDialog.find(".tv-dialog-content"),g=$('<div class="properties-tabs show-if-signin show-if-signup show-if-signup-trial"></div>').prependTo(f);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Sign In")).appendTo(g);$('<a href="#" class="properties-tabs-label"></a>').text($.t("Sign Up")).appendTo(g);$('<a href="#" class="properties-tabs-label"></a>').appendTo(g);var h=$(document.createElement("div")).appendTo(f),k=$(document.createElement("div")).addClass("page").appendTo(h),
|
|
l=$(document.createElement("div")).addClass("page").appendTo(h),m=$(document.createElement("div")).addClass("page recover").appendTo(h),n=new A71(g,h);k.html(TradingView.templates.dialogs.signin);l.html(TradingView.templates.dialogs.auth);m.html(TradingView.templates.dialogs.recover);c(b.mode);n.tabChanged.subscribe(null,function(a){n.pageAt(a).find('input:eq(0)[type!="hidden"]').focus();A83.positionDialog()});f.find(".recover-link").on("click",function(a){c("recover");a.preventDefault()});
|
|
f.find(".signup-link").on("click",function(a){c("signup");a.preventDefault()});f.find(".signin-link").on("click",function(a){c("signin");a.preventDefault()});0===TradingView.BrowserInfo.prototype.browser().indexOf("Internet Explorer")&&f.find("input[type=text], input[type=password]").wrap('<label class="auth-dialog-field">').each(function(){function a(){b.toggleClass("empty",!b.val());d=!1}var b=$(this),c=$('<span class="auth-dialog-field-placeholder">').text(b.attr("placeholder")).insertAfter(b);
|
|
b.removeAttr("placeholder");var d=!1;a();b.on("blur",function(){c.toggleClass("disabled",!!this.value)});b.on("keypress keydown keyup input paste",function(){d||(d=!0,setTimeout(function(b){a()},0))})});"stocktwits google-oauth2 facebook twitter linkedin yahoo".split(" ").forEach(function(a){var c="/accounts/signin/"+a+"/";f.find(".auth-dialog-social-"+a).on("click",function(a){"signup-trial"==b.mode&&$.cookie("will_start_trial",1,{path:"/"});a.preventDefault();window.open(c,"_blank")})});f.find("#signin-form").on("submit",
|
|
function(a){a.preventDefault();var b=$(this).find('[type="submit"]').addClass("process");A83.submit(function(a){""!==a.error?A83.showError("Error: "+a.error):(user=a.user,TradingView.changeLoginState(!0),"function"==typeof A83.onSigninSuccess&&(A83.onSigninSuccess(),delete A83.onSigninSuccess),window.next&&(location.href=window.next),A83.destroy());b.removeClass("process")},this)});f.find("#signup-form").on("submit",function(a){var c=this,d=TradingView.getUrlParams().utmsource;
|
|
window.utmSourceOverride&&(d=window.utmSourceOverride);var e=TradingView.getUrlParams().utmmedium;null!=d&&(d=$("<input>").attr("type","hidden").attr("name","utm_source").val(d),e=$("<input>").attr("type","hidden").attr("name","utm_medium").val(e),$(c).append(d),$(c).append(e));a.preventDefault();var f=$(c).find('[type="submit"]').addClass("process");A83.submit(function(a){$(".tv-dialog input").removeClass("error");$(".tv-dialog-field-error").hide();if(""!==a.errors)if("object"==typeof a.errors){for(var d in a.errors)$(c).find("input[name^="+
|
|
d+"]").addClass("error").data("error",a.errors[d][0]);$(".tv-dialog input.error").first().focus();A83.showError($(".tv-dialog input.error").first().data("error"))}else A83.showError("Error: "+a.errors);else b.onDestroy&&A83.modalDialog.off("destroy",b.onDestroy),A83.showNotice($.t("Activate Your Account"),a.message,{onClose:b.onDestroy});f.removeClass("process")},c)});f.find("#recover-form").on("submit",function(a){a.preventDefault();var b=A83.modalDialog;A83.submit(function(a){""!==
|
|
a.error?A83.showError("Failed: "+a.error):(A83.showMessage($.t("New password is sent to your email.")),setTimeout(function(){A83.modalDialog===b&&A83.destroy()},A83.messageDelay))},this)});if(window.matchMedia){var p=["(max-height: 645px)","(max-width: 460px)"].map(function(a){a=matchMedia(a);a.addListener(d);return a});e.on("destroy",function(){p.forEach(function(a){a.removeListener(d)})})}A83.positionDialog();A83.applyHandlers(null)}},showPublishIntroDialog:function(a){var b=
|
|
$.Deferred(),c=TVSettings.getBool("publish.showIntroText",!0);if(a||c){var d=$.t("Please read before publishing");a=A83.createDialog(d);var e=!1;a.css({width:"750px","z-index":130});a.find(".tv-dialog-content").html(Mustache.render(TradingView.templates.dialogs.publishIntro,{do_not_show:!c}));a.draggable(A83._constrainDraggableOptionsIfNeeded({handle:".tv-dialog-title"}));a.find('input[name="donotshow"]').on("change",function(a){TVSettings.setValue("publish.showIntroText",!$(this).is(":checked"))});
|
|
$("#publish-intro-continue").click(function(){A83.destroy(d);b.resolve()});a.on("destroy",function(){e=!0;setTimeout(b.resolve,0)});b.always(function(){e||A83.destroy(d)});A83.positionDialog(a);A83.applyHandlers(a)}else b.resolve();return b},showPublishChartDialog:function(a){function b(){k.find(".publish-related").tvtags("extractTags");var b={name:k.find('[name="name"]').val(),description:k.find('[name="description"]').val(),direction:k.find('input[name="direction"]').val(),
|
|
is_public:"1"};a.onWidget||(b.tags=k.find(".publish-tags").tvtags("extractTags").tvtags("tagsWithPending").join(","),b.twitter=k.find('input[name="twitter"]').is(":checked")?"1":"",b.stocktwits=k.find('input[name="stocktwits"]').is(":checked")?"1":"",b.is_public=k.find('input[name="public"]').is(":checked")?"1":"",b.related_charts=(k.find(".publish-related").tvtags("extractTags").tvtags("tagsWithPending")||[]).join(","),b.chat=k.find('input[name="chat"]').is(":checked")?"1":"");a.publishSource&&(b.publish_source=
|
|
a.publishSource);var c={onWidget:a.onWidget,ideaUrl:a.ideaUrl,publishAllLayout:k.find('[name="publish_entire_layout"]').is(":checked")};if(!b.name.trim())A83.showError($.t("Chart title is required"),k),k.find('[name="name"]').focus();else if(!b.description.trim())A83.showError($.t("Chart description is required"),k),k.find('[name="description"]').focus();else if(!TradingView.isLatin(b.name)||!TradingView.isLatin(b.description))A83.showError($.t("TradingView is only for English-language content at this time."));
|
|
else if(!TradingView.isLatin(b.tags))A83.showError($.t("Please use only English in tags"));else if(a.onPublish)a.onPublish(b,c)}function c(){k.show();var b=a.onWidget?{w:w,h:u}:TVSettings.getJSON("publishchart.size",{w:w,h:u});k.height(Math.max(Math.min(b.h,.9*$(window).height()),u));k.width(Math.max(Math.min(b.w,.9*$(window).width()),w));p();A83.positionDialog(k,{considerScroll:!0});if(a.onShow)a.onShow()}function d(){k.hide();if(a.onMinimize)a.onMinimize()}a=a||{};var e="edit"===a.mode,
|
|
f=!!a.isScript,g=!e&&!f,h=e?f?$.t("Edit Sript"):$.t("Edit Idea"):f?$.t("Publish Script"):$.t("Publish Idea"),k=A83.createDialog(h,{addClass:"publish-dialog",hideCloseCross:g,hideTitle:!0});k.css("width","700px");var l=k.find(".tv-dialog-content"),m=a.onWidget?TradingView.templates.dialogs.publishChartWidget:TradingView.templates.dialogs.publishChart,n=TradingView.clone(window.user||{});n.editMode=e;n.isScript=f;l.html(Mustache.render(m,n));f=k.find(".tv-dialog-title");$(document.createElement("div")).css({height:"30px",
|
|
"margin-bottom":"-10px",position:"relative"}).prependTo(f);if(g)$('<a class="tv-dialog-title-minimize"></a>').appendTo(f).on("click",function(a){a.preventDefault();d()});k.draggable(A83._constrainDraggableOptionsIfNeeded({handle:f}));var p=function(){var a=l.find(".jsfluid"),b=l.children(".main, *[class^=main-]").eq(0);return function(){a.css("height",k.height()-b.position().top-b.outerHeight()+a.height())}}();k.on("resize",function(a){a.stopPropagation();a.preventDefault();p()});g=a.formData||
|
|
{};g.name&&k.find('[name="name"]').val(g.name);g.description&&k.find('[name="description"]').val(g.description);g.direction&&k.find('input[name="direction"]').val(g.direction);g.related_charts&&k.find(".publish-related").val(g.related_charts);g.tags&&k.find(".publish-tags").val(g.tags);$("#publish-chart-form").submit(function(a){a.preventDefault();b()});$("#publish-dialog-do-publish").click(function(a){a.preventDefault();b()});k.find('input[name="public"]').on("change",function(a){$(this).is(":checked")||
|
|
(r.prop("checked",!1).change(),t.prop("checked",!1).change())});var r=k.find('input[name="twitter"]'),t=k.find('input[name="stocktwits"]');r.change(function(){r.is(":checked")&&(user.has_twitter||window.open("/accounts/permission/twitter/","twitter_permission_request","scrollbars=yes,height=400,width=700").focus())});t.change(function(){t.is(":checked")&&TradingView.authInStocktwits()});l.find(".publish-direction-buttons .tv-button").on("mousedown",function(){var a=$(this);$(".publish-direction-buttons .tv-button").removeClass("active");
|
|
a.addClass("active");k.find('input[name="direction"]').val(a.data("val"))}).each(function(){$(this).toggleClass("active",+$(this).data("val")===(+k.find('input[name="direction"]').val()||0))});k.find(".tv-dialog-readbefore a").on("click",function(a){a.preventDefault();A83.showPublishIntroDialog(!0)});a.isPrivate&&k.find('input[name="public"]').prop("checked",!1).change();(function(){function b(a){a=new Date(a);return[a.getFullYear(),("0"+a.getMonth()).substr(-2),("0"+a.getDate()).substr(-2)].join("-")}
|
|
function c(a){return TradingView.parsePublishedChartUrl(a).image_url}var d={},e=k.find(".publish-related");a.related&&e.val([].concat(a.related).join(","));e.tvtags("init",{suggest:function(a,b){var e=location.protocol+"//"+location.host+"/v/";a.substr(0,e.length)===e&&(a=c(a)||a);$.ajax("/ideas-json/",{data:{search:a},dataType:"json"}).done(function(a){a=a||[];a.forEach(function(a){d[a.image_url]=a;a.str=e+a.image_url+"/"});b(a)}).error(function(){b(null)})},formatSuggest:function(a){var c=$(document.createElement("span")).addClass("date").text(b(1E3*
|
|
a.created)+" "),d=$(document.createElement("strong")).text(a.name);a=$(document.createTextNode(" "+[a.short_name||a.pro_symbol,a.resolution].join(", ")));return{content:$().add(c).add(d).add(a)}},validate:function(a,b){var e=c(a);e?d[e]?b(!0):$.ajax("/ideas-json/"+e+"/",{dataType:"json"}).done(function(a){a&&a.length?(d[a[0].image_url]=a[0],b(!0)):b(!1)}).error(function(){b(!1)}):b(!1)},transform:c,format:function(a){a=a.str;var b=d[a];return b&&a?b.name:"Idea"},keys:["\n",",",/\s/,";"],separator:","}).on("change",
|
|
p)})();k.find(".publish-tags").tvtags("init",{keys:["\n",",",/\s/,";"],separator:",",addClass:"no-arrow with-ears",format:function(a){return{str:a.str,addClass:"tag"}},transform:function(a){return a.toLowerCase()},suggest:function(a,b){a||b(null);$.ajax("/tags-json/",{data:{search:a.toLowerCase()},dataType:"json"}).done(function(a){b(a)}).error(function(){b(null)})},maxLength:64,caseInsensitive:!0}).on("change",p);var v=[];a.D6&&function(){function b(){var a=f.value().model();return a?
|
|
(a=a.mainSeries(),(a.properties().shortName.value()||a.symbol())+" ("+a.interval()+")"):"Active Chart"}function c(){d.toggleClass("hidden",!("s"!==e.value()&&!g.value()));n.is(":checked")?(p.text("All Charts"),m.attr({"class":"tv-dialog-layout-button tv-dialog-layout-"+e.value()})):(p.text(b()),m.attr({"class":"tv-dialog-layout-button tv-dialog-layout-s"}))}var d=l.find(".tv-dialog-layoutpicker"),e=a.D6.layout.spawn(),f=a.D6.activeChartWidget.spawn(),g=a.D6.maximizeCurrentChart.spawn(),
|
|
h=A45.symbol.spawn();v=[e,f,g,h];var m=$('<span class="tv-dialog-layout-button">'),n=$('<input type="checkbox" name="publish_entire_layout">').hide().appendTo(m);$('<i class="icon"></i>').appendTo(m);var p=$("<span></span>").appendTo(m);$('<span class="arrow-icon"></span>').appendTo(m);e.subscribe(c);f.subscribe(c);g.subscribe(c);h.subscribe(c);c();TradingView.bindPopupMenu(m,function(){var a=n.is(":checked");return[{addClass:"tv-dialog-layout-popup tv-dialog-layout-s",title:"Publish Only "+
|
|
b(),action:function(){n.attr("checked",!1);c()},active:!a,icon:!0},{addClass:"tv-dialog-layout-popup tv-dialog-layout-"+e.value(),title:"Publish All Charts",action:function(){n.attr("checked",!0);c()},active:a,icon:!0}]},{direction:"up"});m.appendTo(d);k.on("destroy",function(){for(var a=0;a<v.length;a++)v[a].destroy()})}();k.find(".tv-dialog-cancel-button").on("click",function(a){a.preventDefault();e?A83.destroy(h):A83.showConfirm($.t("Cancel publication"),$.t("Are you sure you want to abandon your post?"),
|
|
function(){A83.destroy(h)})});(function(){function a(){var b=e.val()||"",c=e.prop("selectionStart");null==c&&(c=b.length);var d=e.prop("selectionEnd");null==d&&(d=b.length);return[b.substring(0,c),b.substring(c,d),b.substring(d)]}function b(a,c){var d=a.slice(0,c).join("").length;e.val(a.join(""));e.prop("selectionEnd",d);e.prop("selectionStart",d);e.focus()}function c(a){f.toggleClass("active",!!a);h.toggleClass("active",!!a);a?g.attr("disabled",!1).focus():g.attr("disabled",!0).blur()}function d(){var e=
|
|
g.val();g.val("");var f=/(\/v\/[a-zA-Z0-9]{8})|(\/chart\/[0-9a-zA-Z:+*-/()]+\/[0-9a-zA-Z]{8})|(\/script\/[0-9a-zA-Z]{8})/.test(e),h=/\/(i|x)\/[a-zA-Z0-9]{8}/.test(e),l=a();!e||f||h?(f?(l.splice(2,0,"[chart]"+e+"[/chart]"),b(l,3)):h&&(l.splice(2,0,"[image]"+e+"[/image]"),b(l,3)),c(!1)):A83.showError($.t("Please enter a valid idea URL or chart image URL"),k)}var e=k.find('[name="description"]');k.find(".bb-bold").addClass("apply-common-tooltip").attr("title",$.t("Bold")).on("click",function(c){c.preventDefault();
|
|
c=a();c.splice(2,0,"[/b]");c.splice(1,0,"[b]");b(c,4)});k.find(".bb-italic").addClass("apply-common-tooltip").attr("title",$.t("Italic")).on("click",function(c){c.preventDefault();c=a();c.splice(2,0,"[/i]");c.splice(1,0,"[i]");b(c,4)});k.find(".bb-list").addClass("apply-common-tooltip").attr("title",$.t("List or list item")).on("click",function(c){c.preventDefault();c=a();var d=!1;c[0].replace(/\[(\/)?list\]/gi,function(a,b){d=!b});d?(c.splice(2,0,""),c.splice(1,0,"\n[*]")):(c.splice(2,0,"\n[/list]"),
|
|
c.splice(1,0,"[list]\n[*]"));b(c,3)});var f=k.find(".bbcode-embed-form"),g=f.find("input");g.attr("placeholder",$.t("Published idea or chart image URL"));f.on("touchstartoutside mousedownoutside",function(a){f.hasClass("active")&&($(a.target).parents().andSelf().is(".bb-embed")||c(!1))});var h=k.find(".bb-embed");h.addClass("apply-common-tooltip").attr("title",$.t("Idea or chart snapshot image")).on("click",function(a){a.preventDefault();c(!0);g.val("").focus()});g.on("keypress",function(a){13===
|
|
a.keyCode&&(d(),a.preventDefault())});k.find(".embed-submit").on("click",function(a){a.preventDefault();d()})})();if(a.onDestroy)k.on("destroy",a.onDestroy);var w=k.width(),u=k.height();k.resizable({handles:"se",minHeight:u,minWidth:w,stop:function(){TVSettings.setJSON("publishchart.size",{w:k.width(),h:k.height()})}});A83.applyHandlers(k,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0,doNotCloseOnBgClick:!0});c();return{dialog:k,show:c,hide:d,close:function(){A83.destroy(h)}}},
|
|
showGoProDialog:function(a){a||(a={});A83.createModalDialog("",{noHeader:!0,addClass:"gopro-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3});b=b.find(".tv-dialog-content");b.html(Mustache.render(TradingView.templates.dialogs.goPro.layout,{trialButton:A10&&A10.trialAvailable&&A10.trialAvailable(),exchangesButton:a.exchangesButton,exchange:a.exchange}));var c=b.find(".col-main .col-copy");a=a.feature?Mustache.render(TradingView.templates.dialogs.goPro.features[a.feature],
|
|
{exchangesButton:a.exchangesButton,exchange:a.exchange,options:a.featureOptions||{}}):TradingView.templates.dialogs.goPro.defaultCopy;c.html(a);b.find(".yes-button").on("click",function(a){this.href===location.href&&a.preventDefault();A83.destroy()});b.find(".no-button").on("click",function(a){a.preventDefault();A83.destroy()});A83.positionDialog();A83.applyHandlers(null)},showAddSymbolDialog:function(a,b){b=$.extend({},{title:$.t("Add Symbol"),callback:function(a,b){},overlayOption:!1,
|
|
overlayOptionChecked:TVSettings.getBool("showAddSymbolDialog.checkboxState",!0),okButtonTitle:$.t("Add Symbol")},b||{});var c=A83.createDialog(b.title);c.css("min-width",0);c.find(".tv-dialog-content").html(Mustache.render(TradingView.templates.dialogs.addSymbol,b)).css("min-width",0);A83.applyHandlers(c);var d=$('<div class="symbol-edit-widget"></div>'),e=$('<input type="text" class="symbol-edit single" placeholder="'+$.t("Symbol")+'" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">').appendTo(d),
|
|
f=A69.bindToInput(e,{callback:function(a){var d=c.find("#tv-dialog-addsymbol-overlay-checkbox").is(":checked");if(a){var e=b.callback;e(a,d);$(window).off("keyup.addOverlay");A83.destroy(c.data("title"))}}});c.find("div.symbol-edit-place").replaceWith(d);c.find(".tv-dialog").draggable(A83._constrainDraggableOptionsIfNeeded({handle:".tv-dialog-title"}));c.find("input[type=checkbox]").on("change",function(a){TVSettings.setJSON("showAddSymbolDialog.checkboxState",a.target.checked)});
|
|
c.find(".ok").on("click",function(){f.acceptTypeIn()});c.show();A83.positionDialog(c);e.focus()},makeDraggable:function(a){a.draggable({handle:".tv-dialog-title"})},showConfirmInputsDialog:function(a,b,c){function d(a){var b=c.callback;a=a.state();b(a);A83.destroy(e.data("title"))}c=$.extend({},{title:$.t("Confirm Inputs"),callback:function(a){},okButtonTitle:$.t("Apply")},c||{});var e=A83.createDialog(c.title,{content:"<div class='main'></div>"});e.css("min-width",0);A83.applyHandlers(e,
|
|
{beforeDestroy:function(){$(window).unbind("keyup.hideInputsConfirmDialog")}});for(var f=TradingView.merge({},b.defaults.inputs),g=0;g<b.inputs.length;++g){var h=b.inputs[g];h.confirm||delete f[h.id]}var k=new Property({inputs:f});a=(new J41(k,a.model(),{metaInfo:function(){return b}},!0)).widget();f=e.find(".main");f.append(a);$(window).bind("keyup.hideInputsConfirmDialog",function(a){"13"==a.keyCode&&"textarea"!==a.target.tagName.toLowerCase()&&(d(k),$(window).unbind("keyup.hideInputsConfirmDialog"))});
|
|
$("select",f).each(function(){var a=$(this),b="tv-select-container dialog";a.hasClass("tv-select-container-fontsize")&&(b+=" tv-select-container-fontsize");a.selectbox({speed:100,classHolder:b})});$('input[type="text"]',f).addClass("tv-text-input inset dialog");$("input.ticker",f).TVTicker();e.find(".main").append("<div class='tv-dialogs-bottom-button'><span class='tv-button tv-right tv-uppercase ok'>Apply</span></div>");e.find(".ok").on("click",function(){d(k)});e.show();A83.positionDialog(e);
|
|
f.find("input,select").first().focus()},showUpdateAccountDataDialog:function(a){var b=Mustache.render('<form>{{#html}}<p>{{&html}}</p>{{/html}}<input type="text" value="{{value}}"></form>',{value:a.value||"",html:a.html});return A83.showCustomDialog({title:a.title,html:b,action:function(b){var d=b.find(".tv-button.ok");d.addClass("process");TradingView.changeUserProfileField({name:a.paramName,value:b.find("input[type=text]").val(),onSuccess:a.success,onError:function(d){d=(d||[]).join(" ");
|
|
"function"===typeof a.error?a.error(d):A83.showError(d||"Unexpected error: can't change profile data",b)},onComplete:function(){d.removeClass("process")}});return{notClose:!0}},onCancel:a.cancel})},showProRTTrialOffer:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");b=b.find(".tv-dialog-content");b.html(Mustache.render(TradingView.templates.dialogs.proRTTrialOffer));b.find("a.trial").on("click",
|
|
function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onAccept)a.callbacks.onAccept()});b.find("a.nothanks").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onDecline)a.callbacks.onDecline()});b.find("a.ordernow").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onOrder)a.callbacks.onOrder()});b.find("a.later").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onRemindLater)a.callbacks.onRemindLater()});A83.positionDialog();
|
|
A83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},showTrialMessage:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");b=b.find(".tv-dialog-content");b.html('<div class="main"><h3 class="title"></h3><div class="copy"></div><div class="big-buttons"><a href="javascript://" class="big-button ok">OK</a></div></div>');var c=b.find(".title"),d=b.find(".copy"),
|
|
e=b.find(".big-button.ok"),f=b.find(".big-buttons");a&&a.title?c.html(a.title):c.remove();a&&a.copy?d.html(a.copy):d.remove();a&&a.closeButtonCopy&&e.html(a.closeButtonCopy);a&&a.replaseCloseBtn&&f.html(a.replaseCloseBtn);b.find("a.ok").on("click",function(b){a&&a.replaseCloseBtnFunc?a.replaseCloseBtnFunc(b):(b.preventDefault(),A83.destroy())});A83.positionDialog();A83.applyHandlers(null)},showTrialMessageSuccess:function(){A83.showTrialMessage({title:$.t("PRO Plus Trial"),
|
|
copy:$.t("<p>Your 30-day free PRO Plus account has been activated. ")+$.t("You are now part of a community of 2 million+ ideas that have been ")+$.t("created within TradingView charts. To help get the ball rolling, ")+$.t("we'd suggest you spend a few minutes familiarizing yourself with our online <a href='/stock-charts-support/'>help section</a>. We hope you enjoy working with TradingView and wish you good trading!</p>"),replaseCloseBtn:"<a href='/chart/' class='big-button ok'>"+$.t("LAUNCH CHART")+
|
|
"</a>",replaseCloseBtnFunc:function(){}})},showTrialConfirmationDialog:function(a){a=a||{};A83.createModalDialog("",{noHeader:!0,addClass:"trialconfirm-dialog ",appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3});var c=b.find(".tv-dialog-content");c.html('<div class="main"><h3 class="title">'+(a.title||"Trial confirmation dialog")+'</h3><div class="copy">'+(a.text||"Trial confirmation text")+'</div><div class="actions-block"><a class="no-button">'+(a.noText||$.t("No, thank you"))+
|
|
'</a><a class="yes-button">'+$.t("START TRIAL")+"</a></div></div>");b=c.find(".no-button");c=c.find(".yes-button");b.on("click",function(b){b.preventDefault();if("function"==typeof a.onCancel)return a.onCancel(b);A83.destroy()});c.on("click",function(b){if("function"==typeof a.onSubmit)return a.onSubmit(b);b.preventDefault()});A83.positionDialog();A83.applyHandlers(null)},showEarlyAccessDialog:function(a){A83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",
|
|
appearance:"flat"});var b=A83.modalDialog;b.css({zIndex:1E3}).find(".tv-dialog");var b=b.find(".tv-dialog-content"),c={};switch(a&&a.reason){case "after 1 week":c.is_1wk=!0;break;case "after 2 weeks":c.is_2wk=!0;break;case "finished":c.is_finished=!0;break;default:c.is_manual=!0}b.html(Mustache.render(TradingView.templates.dialogs.earlyAccess,c));c=null;b.find("a.nothanks").on("click",function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onDecline)a.callbacks.onDecline()});b.find("a.ordernow").on("click",
|
|
function(b){b.preventDefault();if(a&&a.callbacks&&a.callbacks.onOrder)a.callbacks.onOrder()});A83.positionDialog();A83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},showUnsubscribeConfirmationDialog:function(a,b,c){A83.createModalDialog(a);A83.modalDialog.find(".tv-dialog").css("width","450px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="caption-big">'+$.t("Aww, we are sorry to see you go! If you cancel, you will no longer be billed after your current subscription period ends. Your subscription service will continue to be active until the end of the period that you paid for. Sorry, there are no refunds.")+
|
|
"<br/><br/>"+$.t("If you are sure you want to cancel, click Cancel, otherwise choose Do Not Cancel. If you cancel, we\u2019d really like to know the reason why you are cancelling so we can make things better.")+'</div><textarea style="width: 398px; height: 100px;"></textarea></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide yes" type="button" value="'+$.t("Cancel {{text}} and send feedback")+'" style="margin-right: 10px;"/><input class="tv-button wide no" type="button" value="'+
|
|
$.t("Do Not Cancel")+'"/></div>',{text:b}));var d=A83.modalDialog.find(".yes");d.click(function(){var a=A83.modalDialog.find("textarea").val();a?(d.addClass("process"),c(a)):A83.showError($.t("Please enter your feedback"))});A83.modalDialog.find(".no").click(function(){A83.destroy()});A83.positionDialog();A83.applyHandlers()},showChangeUserStatusDialog:function(){var a=$.t("Update status"),b=A83.createDialog(a);b.find(".tv-dialog").css("width","400px");
|
|
b.find(".tv-dialog-content").html('<form><div class="main"><input type="text" name="status" value="'+("string"==typeof window.user.status?window.user.status.replace(/"/g,"""):"")+'"></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="submit" value="'+$.t("OK")+'" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/></div></form>');var c=b.find(".ok"),d=b.find('[name="status"]'),e=$.t("Add status")+
|
|
"...";b.find("form").submit(function(){c.addClass("process");TradingView.changeUserProfileField({name:"status",value:String(d.val()).replace(/^\s+|\s+$/g,""),onSuccess:function(b){var c=$("#change-profile-status"),d=b?b:e;c.hasClass("tv-editable-active")?c.find('input[type="text"], textarea').val(d):c.text(d);$('[name="status"]').val(b);A83.destroy(a)},onError:function(a){A83.showError($.t("We'are sorry, something went wrong. Try to reload page."));console.warn(a)},onComplete:function(){c.removeClass("process")}});
|
|
return!1});b.find(".cancel").click(function(){A83.destroy(a)});Modernizr.touch&&d.val("");A83.positionDialog(b,{considerScroll:!0});A83.applyHandlers(b);d.focus().select()},showScriptSearchDialog:function(a){function b(){var a=e.val();if(a!==h){h=a;f.toggle(!!a);k&&(k.abort&&k.abort(),k=null);g.html('<div class="loading"></div>');var b=A56.suggest(h);k=b;A56.list().done(function(a){b.done(function(d){b===k&&c(d,a)})})}}function c(a,
|
|
b){g.empty();a&&(a.length||$('<p class="nothing">'+$.t("No scripts matched your criteria")+"</p>").appendTo(g),a.forEach(function(a){if(a){var c=$('<div class="item">');if(a.author){var e=$('<div class="item-avatar">').appendTo(c);$("<img>").attr({src:"/avatar/"+a.author.id+"/","class":"avatar userlink",alt:a.author.username,"data-username":a.author.username}).appendTo(e)}e=$('<div class="item-buttons"></div>').appendTo(c);$(Mustache.render(TradingView.templates.publishedScriptButton,{script_id_part:a.scriptIdPart,
|
|
script_install_count:a.scriptInstallCount,show_script_install_count:!!a.scriptInstallCount,script_in_library:b.some(function(b){return b.scriptIdPart==a.scriptIdPart})})).appendTo(e);if(d){var f=$('<a class="pubscript-try-button" title="Add this study to active chart"><span class="label">Try</span></a>');f.on("click",function(b){b.preventDefault();d(a)});f.appendTo(e)}e=$('<div class="item-main">').appendTo(c);f=$('<div class="item-title">').appendTo(e);$("<a>").attr({href:"/v/"+a.imageUrl+"/",target:"_blank"}).text(a.scriptName||
|
|
a.scriptTitle||"Study").appendTo(f);$('<div class="item-desc">').text(a.description||"").appendTo(e);g.append(c)}}))}var d=a.onTry;a=$.t("Search for scripts published by community");a=A83.createDialog(a,{width:815,content:TradingView.templates.dialogs.scriptSearch,addClass:"script-search-dialog"});var e=a.find("input[name=q]"),f=a.find(".input-reset"),g=a.find(".script-search-results");f.on("click",function(){e.val("");b()});var h,k=null;e.on("input keyup change",b);b();A83.positionDialog(a);
|
|
A83.applyHandlers(a);return a},showPrioritySupportDialog:function(){A83.showCustomDialog({title:$.t("Priority Support"),html:TradingView.templates.dialogs.proiritySupport,noButtons:!0})},showAlertMaintenanceDialog:function(){A83.showNotice("Alerts maintenance","We are doing some brief daily maintenance. Alerts will be back really soon, thanks for your patience!")},showNotice:function(a,b,c){"object"==typeof b&&(c=b,b="");c=c||{};var d=c.doNotCloseOnBgClick||!1,e=c.html||"";A83.createModalDialog(a);
|
|
a=c.addOkButton||c.doNotCenter?"caption-big":"caption-big-center";A83.modalDialog.find(".tv-dialog").css("width","400px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="{{captionClassName}} {{classSuffix}}">{{text}}'+e+"</div></div>",{captionClassName:a,classSuffix:c.classSuffix||"",text:b}));A83.positionDialog();A83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:d,beforeDestroy:c.onClose});return A83.modalDialog},showConfirm:function(a,
|
|
b,c,d,e){e=e||{};e.dontAskSetting&&TVSettings.getBool(e.dontAskSetting)?c():(A83.createModalDialog(a,e),A83.modalDialog.find(".tv-dialog").css("width","400px"),A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><div class="caption-big">{{text}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">Do not ask again</label>{{/dontAskSetting}}</div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="button" value="'+
|
|
$.t("YES")+'" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="'+$.t("NO")+'"/></div>',{text:b,dontAskSetting:!!e.dontAskSetting})),e.okButtonText&&A83.modalDialog.find(".ok").val(e.okButtonText),e.cancelButtonText&&A83.modalDialog.find(".cancel").val(e.cancelButtonText),A83.modalDialog.find(".ok").click(function(){e.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&TVSettings.setValue(e.dontAskSetting,!0);c();A83.destroy()}),
|
|
A83.modalDialog.find(".cancel").click(function(){d&&d();A83.destroy()}),A83.positionDialog(),A83.applyHandlers())},showPrompt:function(a,b,c,d,e){function f(){var a=k.val();if(h){var b=h(a);if(b){!0===b&&(b="Wrong value");A83.showError(b,A83.modalDialog);return}}A83.destroy();c&&c(a)}var g=e&&e.defaultValue,h=e&&e.validate;A83.createModalDialog(a,e);A83.modalDialog.find(".tv-dialog").css("width","400px");A83.modalDialog.find(".tv-dialog-content").html(Mustache.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="tv-dialogs-bottom tv-dialog-center"><input class="tv-button wide ok" type="button" value="'+
|
|
$.t("OK")+'" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/></div>',{text:b}));var k=A83.modalDialog.find('[name="prompt-value"]');g&&k.val(g);A83.modalDialog.find("form").submit(function(a){f();a.preventDefault()});A83.modalDialog.find(".ok").click(function(a){f();a.preventDefault()});A83.modalDialog.find(".cancel").click(function(){A83.destroy();d&&d()});A83.positionDialog();A83.applyHandlers();
|
|
setTimeout(function(){k.focus().select()},0)},showCustomDialog:function(a){function b(b){var c=a.action(A83.modalDialog),f=c&&c.notClose;(!c||c.error)&&void 0!==c||f?c.error&&A83.showError(c.error):A83.destroy();b.preventDefault()}function c(b){if("function"===typeof a.onCancel)a.onCancel();else A83.destroy()}A83.createModalDialog(a.title||"Dialog");A83.modalDialog.find(".tv-dialog").css("width",a.width||"400px");A83.modalDialog.find(".tv-dialog-content").html('<div class="main">'+
|
|
(a.html||"Content")+"</div>"+(a.noButtons?"":'<div class="tv-dialogs-bottom tv-dialog-center">'+(a.noButtonOk?"":'<input class="tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/>')+(a.noButtonCnacel?"":'<input class="tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/>')+"</div>"));a.okButtonText&&A83.modalDialog.find(".ok").val(a.okButtonText);a.cancelButtonText&&A83.modalDialog.find(".cancel").val(a.cancelButtonText);A83.modalDialog.find(".ok").click(b);
|
|
A83.modalDialog.find("form").submit(b);A83.modalDialog.find(".cancel").click(c);A83.modalDialog.find(".tv-dialog-title-close").click(c);A83.positionDialog();A83.applyHandlers();return A83.modalDialog},createModalDialog:function(a,b){b=b||{};null!==A83.modalDialog&&A83.destroy();A83.modalDialog=$('<div class="tv-dialog-shadowbox"><div class="tv-dialog tv-dialog-modal'+(b.addClass?" "+b.addClass:"")+'">'+(b.noHeader?"":'<div class="tv-dialog-title">'+
|
|
(b.noClose?"":'<a class="tv-dialog-title-close"></a>')+'<span class="tv-dialog-title-text">'+a+"</span></div>")+'<div class="tv-dialog-error"></div><div class="tv-dialog-message"></div><div class="tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",a);b.noShadowBox&&A83.modalDialog.addClass("transparent");b.addClass&&A83.modalDialog.addClass(b.addClass);b.width&&A83.modalDialog.find(".tv-dialog").css({width:b.width});b.content&&A83.modalDialog.find(".tv-dialog-content").html(b.content);
|
|
var c=$(".fancybox-overlay");c.length&&(c=c.css("z-index"),$(".tv-dialog-shadowbox").css("z-index",c+1));b.zIndex&&A83.modalDialog.css("z-index",b.zIndex);return A83.modalDialog},createDialog:function(a,b){if(A83.isOpen(a)){var c=A83.get(a);c.find(".tv-dialog-content").html("");c.data("new",!1);return c}b=b||{};c=$(Mustache.render('<div class="tv-dialog tv-dialog-nonmodal {{&addClass}}"><div class="tv-dialog-title{{#hideTitle}} tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="tv-dialog-error"></div><div class="tv-dialog-message"></div><div class="tv-dialog-content"></div></div>',
|
|
{addClass:b.addClass||"",hideTitle:b.hideTitle,hideCloseCross:b.hideCloseCross,title:a})).appendTo($("body"));b.width&&c.css({width:b.width});b.content&&c.find(".tv-dialog-content").html(b.content);var d=0,d=A83.dialogs&&A83.dialogs.length?MathEx.max($.map(A83.dialogs,function(a){return parseInt((a.dialog||a).css("z-index"),10)}))+1:110;c.css("z-index",d);c.data("new",!0);c.data("title",a);c.data("id",A83.dialogs.length+1);A83.dialogs.push({title:a,dialog:c,id:A83.dialogs.length+
|
|
1});d={start:function(a,b){for(var c=b.helper.css("z-index"),d=0,k=null,l=0;l<A83.dialogs.length;l++){var m=A83.dialogs[l].dialog.css("z-index");m>d&&(d=m,k=A83.dialogs[l].dialog)}b.helper.css("z-index",d);k.css("z-index",c)}};b.dragHandle?d.handle=b.dragHandle:b.hideTitle||(d.handle=".tv-dialog-title");c.draggable(A83._constrainDraggableOptionsIfNeeded(d));return c},positionDialog:function(a,b,c){function d(){k.css("margin-left",-Math.round(k.outerWidth()/2)+"px");k.css("margin-top",
|
|
-Math.round(k.outerHeight()/2)+"px")}c=c||{};b=b||c.position;if(a){var e=a.width(),f=a.height(),g=$(window).width(),h=$(window).height();b&&b.top&&b.left?(e=c.forcePosition?b.left:Math.max(2,Math.min(g-e-4,b.left))+"px",f=c.forcePosition?b.top:Math.max(2,Math.min(h-f-4,b.top))+"px"):b&&b.considerScroll?(b=$(document),e=Math.round((g-e)/2+b.scrollLeft())+"px",f=Math.round((h-f)/2+b.scrollTop())+"px"):(e=Math.round((g-e)/2)+"px",f=Math.round((h-f)/2)+"px");c.smooth?a.animate({left:e,top:f}):a.css({left:e,
|
|
top:f})}else{a=A83.modalDialog;var k=a.find(".tv-dialog");d();k.resize(d)}},applyHandlers:function(a,b){var c=!a||a===this.modalDialog;b=b||{};var d=c?function(){A83.destroy()}:function(){A83.destroy(a.data("title"))};a=a||A83.modalDialog.find(".tv-dialog");if(b.beforeDestroy)a.on("destroy",b.beforeDestroy);a.find(".tv-dialog-title .tv-dialog-title-close").on("click",d);b.doNotCloseOnBgClick||setTimeout(function(){a.on("mousedownoutside",function(c){c=$(c.target).parents().andSelf();
|
|
b.doNotCloseOnBgClickIfShadowbox&&c.is(".tv-dialog-shadowbox")||c.is(".colorpicker, .charts-popup-list, .tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container, #global-zeroclipboard-html-bridge")||(a.unbind("mousedownoutside"),d())})},0);a.find('input[type="checkbox"]').change(function(){var a=$(this);a.next(".tv-dialog-checkbox-mask").toggleClass("disabled",a.prop("disabled")).toggleClass("tv-dialog-checkbox-mask-active",a.is(":checked"))});c=a.find('input[type="text"]').focus(function(){$(this).addClass("tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textactive")}).first();
|
|
Modernizr.touch||b.notFocusFirst||c.focus();a.find('input[type="password"]').focus(function(){$(this).addClass("tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textactive")});a.find("textarea").focus(function(){$(this).addClass("tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("tv-dialog-content-textareaactive")});a.find(".tv-dialog-checkbox-mask").click(function(){var a=$(this).prev();a.prop("disabled")||(a.prop("checked",!a[0].checked),
|
|
a.change())});$(".tv-dialog .tv-dialog-error").mouseenter(function(){$(this).animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(A83.messageInterval)});$(".tv-dialog .tv-dialog-message").mouseenter(function(){$(this).animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(A83.messageInterval)});
|
|
b.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(b){if("27"==b.keyCode)return a?A83.destroy(a.data("title")):A83.destroy(),!1})},showError:function(a,b){var c;b?(c=b.find(".tv-dialog-error"),b.width()):(c=$(".tv-dialog .tv-dialog-error"),$(".tv-dialog").width());c.text(a).css({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(A83.messageInterval);A83.messageInterval=
|
|
setInterval(function(){$(".tv-dialog .tv-dialog-error").animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(A83.messageInterval)},A83.messageDelay)},showMessage:function(a){$(".tv-dialog .tv-dialog-message").text(a).css({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(A83.messageInterval);
|
|
A83.messageInterval=setTimeout(function(){$(".tv-dialog .tv-dialog-message").animate({marginTop:A83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(A83.messageInterval)},A83.messageDelay)},showStocktwitsDialog:function(a,b){return A83.showCustomDialog({title:$.t("Send Message to stocktwits"),html:Mustache.render('<textarea style="width: 100%" maxLength="120">{{text}}</textarea>',{text:a}),action:b})},
|
|
showSessionLockDialog:function(a,b){A83.createModalDialog("You are disconnected",{noHeader:!0,addClass:"gopro-dialog session-lock-dialog",noClose:!0});var c=A83.modalDialog;c.css({zIndex:1E3});var d=A83.modalDialog.find(".tv-dialog-content");d.html(Mustache.render(TradingView.templates.dialogs.goPro.layout,{noButton:!0}));d.find(".col-main .col-copy").html("<h2>"+$.t("Multiple Connections")+"</h2><p>"+$.t("Someone logged into your account from different device<span class='device_info'></span>")+
|
|
"</p><p>"+$.t("One account can be accessed from one browser (on one device) at a time - to stay compliant with exchange regulations and prevent unauthorized access.")+"</p><p>"+$.t('PRO members can add optional multi-device access. Click "Buy Multi-Device Access" to access your account from several devices at the same time. Click CONNECT to terminate the other session and connect here.')+"</p>");a&&(d=d.find(".device_info").append(":<br />"),"Other"!=a.device&&d.append($.t("Device"),": ",$("<b/>").text(a.device),
|
|
", "),d.append($.t("IP"),": ",$("<b/>").text(a.ip),", "),d.append($.t("Browser"),": ",$("<b/>").text(a.browser)),d.append("<br />"));d=c.find(".actions-block");$('<a class="reconnect-button">'+$.t("CONNECT")+"</a>").appendTo(d).bind("click",b);$('<a href="/gopro/" target="_blank" class="yes-button">'+$.t("BUY MULTIDEVICE ACCESS")+"</a>").appendTo(d).on("click",function(){window.user.is_pro&&"pro_realtime_trial"!=window.user.pro_plan?pro.visitExchangesPage({newWindow:!0}):TradingView.visitPaymentPage("pro",
|
|
"y",{newWindow:!0});return!1});A83.positionDialog();A83.applyHandlers(!1,{doNotCloseOnBgClick:!0,doNotCloseOnEsc:!0});return c},showInvalidFileFormatDialog:function(){A83.createModalDialog($.t("Invalid data format"),{addClass:"invalid-file-dialog",noClose:!0});var a=A83.modalDialog;a.css({zIndex:1E3});var b=A83.modalDialog.find(".tv-dialog-content");b.html('<div class="main"><p>'+$.t('File contains incorrectly formatted data. Please correct the format and try again. Examples: "NYSE:GE,NYSE:F,NASDAQ:MSFT" or "F,GE,MSFT"')+
|
|
'<div class="tv-dialog-right"></div></div>');b=b.find(".tv-dialog-right");$('<a class="tv-button wide ok">Close</a>').appendTo(b).bind("click",function(){a.remove()});A83.positionDialog();A83.applyHandlers(!1,{doNotCloseOnBgClick:!0,doNotCloseOnEsc:!0});return a},isOpen:function(a){for(var b=0;b<A83.dialogs.length;b++)if(A83.dialogs[b].title==a)return!0;return!1},get:function(a){for(var b=0;b<A83.dialogs.length;b++)if(A83.dialogs[b].title==a)return A83.dialogs[b].dialog},
|
|
submit:function(a,b){var c=b?$(b):$(".tv-dialog form").first(),d=c.serialize(),c=c.attr("action");$.post(c,d,function(b){void 0!==a&&a(b)},"json")},destroy:function(a,b){void 0!==A83.chart&&(A83.chart.destroy(),delete A83.chart);$(window).unbind("keyup.hideDialog");if(a)for(var c=0;c<A83.dialogs.length;c++)A83.dialogs[c].title==a&&(A83.dialogs[c].dialog.trigger("destroy",b),$(document).unbind("mouseup.hideDialog"+A83.dialogs[c].id),$("input",A83.dialogs[c].dialog).blur(),
|
|
A83.dialogs[c].dialog.remove(),A83.dialogs.splice(c,1));else A83.modalDialog&&(A83.modalDialog.find(".tv-dialog").trigger("destroy"),A83.modalDialog.remove(),A83.modalDialog=null)},changeTitle:function(a,b){a&&A83.dialogs.some(function(c){if(c.title==a){var d=c.dialog,e=d.find(".tv-dialog-title");c.title=b;d.data("title",b);e.html(e.html().replace(a,b));e.find("a").on("click",function(){A83.destroy(b)});return!0}})},calcHeight:function(a,b,c){null==
|
|
c&&(c=20);a+=c;c=parseInt($("body").height(),10);a>c&&(b=Math.max(0,b-(a-c)));return b},resizeContent:function(a,b,c){null==c&&(c=20);a+=c;c=parseInt($("body").height(),10);var d=b.height();a>c&&(d=Math.max(0,d-(a-c)),b.height(d))},resizeContentWidth:function(a,b,c){null==c&&(c=20);a+=c;c=parseInt($(window).width(),10);var d=b.width();a>c&&(d=Math.max(0,d-(a-c)),b.width(d))}};function ChartSaver(a){this.D5=a}ChartSaver.prototype.whenReadyToSave=function(a){var b=this.D5.activeChartWidget.value().model().mainSeries();if(b.symbolInfo()&&!b.hasDelayedSymbolIntervalChange())a();else{var c=null,d=null,c=function(){b.onSymbolError().unsubscribe(null,d,!0);a()},d=function(){b.onSymbolResolved().unsubscribe(null,c,!0)};b.onSymbolResolved().subscribe(null,c,!0);b.onSymbolError().subscribe(null,d,!0)}};
|
|
ChartSaver.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)};ChartSaver.prototype._fillAsyncInfo=function(a,b,c){var d=JSON.parse(a.content),e=this.D5;b||(c=!0);var f=$.Deferred();c?e.asyncState(!!b).then(function(b){a.content=JSON.stringify($.extend(!0,d,b));f.resolve(a)}):e.activeChartWidget.value().asyncState(!!b).then(function(b){a.content=JSON.stringify($.extend(!0,d,b));f.resolve(a)});return f.promise()};
|
|
ChartSaver.prototype._fillSavingInfo=function(a,b){a||(b=!0);var c={publish_request_id:Math.random().toString(36).substring(2)},d=this.D5,e=d.activeChartWidget.value(),f=d.metaInfo,g=e.model().mainSeries(),h=g.properties(),k=g.symbolInfo();if(!g||!f||!k)throw new ReferenceError("Missed required data");f.id.value()&&(c.id=f.id.value());c.name=f.name.value()||"";c.description=f.description.value()||"";c.resolution=g.properties().interval.value();c.symbol_type=k.type||"";c.exchange=
|
|
k.exchange||"";c.listed_exchange=k.listed_exchange||"";g.isSpread()?(h=k.legs[0],f=k.base_name[0],f=f.split(":")[1],c.symbol=h,c.short_name=this.verifiedShortName(h,f,e),c.expression=k.full_name):(f=k.ticker||h.symbol.value(),h=h.shortName.value(),c.symbol=f,c.short_name=this.verifiedShortName(f,h,e));h=[];f=0;for(g=k.legs.length;f<g;f++)h.push({symbol:k.legs[f],pro_symbol:k.base_name[f]});c.legs=JSON.stringify(h);c.content=b?JSON.stringify(d.state(!!a)):JSON.stringify(e.state(!!a));a&&(c.image=JSON.stringify(d.images({onlyActiveChart:!b})));
|
|
c.is_realtime=a?"0":"1";return c};
|
|
ChartSaver.prototype.publishChart=function(a){function b(a,b){c.onPublish(a,$.extend({},b,{closeForm:function(){c._dialogCtl.close()},showError:function(a){A83.showError(a,c._dialogCtl.dialog)}}))}var c=this;TradingView.trackEvent("GUI","Publish Chart");$(".publish-chart-button").removeClass("inprogress");c._dialogCtl?c._dialogCtl.show():c._dialogCtl=A83.showPublishChartDialog($.extend({D6:this.D5,onPublish:b,onMinimize:function(){$(".publish-chart-button").addClass("inprogress")},onDestroy:function(){delete c._dialogCtl;
|
|
$(".publish-chart-button").removeClass("inprogress")},related:c._lastPublishUrl},a))};
|
|
ChartSaver.prototype.onPublish=function(a,b){function c(a){d.publishInProgress=!1;a=a.responseText;if("ok:"===a.substr(0,3)){if(a=a.substr(3),a=JSON.parse(a),d.D5.metaInfo.id.value()||d.D5.metaInfo.id.setValue(a.id),b.closeForm&&b.closeForm(),d._lastPublishUrl=a.publishUrl,d.hWnd){var c=a.publishUrl;b.ideaUrl&&(c=Mustache.render(b.ideaUrl,{idea:a.idea}));d.hWnd.location=c}}else b.showError&&b.showError(a||"Error occured while publishing"),d.hWnd&&(d.hWnd.close(),
|
|
d.hWnd=null)}var d=this;if(!d.publishInProgress){var e=d._fillSavingInfo(!0,b&&b.publishAllLayout);d._fillAsyncInfo(e,!0,b&&b.publishAllLayout).then(function(b){$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},b,a),complete:c})});d.publishInProgress=!0;(!b.onWidget||b.ideaUrl)&&""!==a.name&&""!==a.description&&4E3>=a.description.length&&64>=a.name.length&&($.cookie("publish_request_id",e.publish_request_id,{path:"/"}),e="/loading/",b.ideaUrl&&(e="/loading?"+TradingView.createUrlParams({ideaUrl:b.ideaUrl})),
|
|
d.hWnd=window.open(e,"_blank"))}};ChartSaver.prototype.verifiedShortName=function(a,b,c){b=b||"";c=c.model().mainSeries();var d;if(d=!c.isSpread()){var e=b,f=/^[1-9]\//;d=a.replace(f,"");e=e.replace(f,"");d=-1==d.indexOf(e)}d&&!R77.enabled("short_name_may_differ_from_fullname")&&(b=a.substr(a.indexOf(":")+1),c.properties().shortName.setValue(b),TradingView.trackEvent("Chart","short_name differs from full_name"),console.error("short_name differs from full_name"));return b};
|
|
ChartSaver.prototype.saveChartSilently=function(a,b,c,d){var e=this.D5.metaInfo;b=this._fillSavingInfo(b);d=d||{};d.chartName&&(b.name=d.chartName);$(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")});TradingView.saveChart(b,e,a,c,d);$(window).off("beforeunload.savechart")};
|
|
TradingView.takeSnapshot=function(a,b,c,d){d=d||{};var e={wl:d.wl,images:JSON.stringify(a.images()),previews:d.previews};if(d.cme||"cme"===a.activeChartWidget.value().widgetCustomer())e.cme=!0;a=R77.enabled("charting_library_base")?d.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/";$.post(a,e,function(a){a?b(a):c()}).fail(function(){c()})};TradingView.buildCompanyDeataisTable=function(a,b){var c=$('<div class="dl-dialog-data clearfix">'),d=$('<div class="dl-item-group-col">').appendTo(c),e=$('<div class="dl-item-group-col">').appendTo(c),f=d;a=a||{};b=b||function(a){return a};Object.keys(TradingView.DetailWidgetFieldGroups).forEach(function(c){$('<div class="dl-item-group-header">'+$.t(c)+"</div>").appendTo(f);TradingView.DetailWidgetFieldGroups[c].forEach(function(c){var d=a[c]||"----";$('<div class="dl-item full" id="dl-item-'+c+
|
|
'"><div class="dl-col dl-col-field">'+TradingView.DetailWidgetFieldDescription[c][0]+'</div><div class="dl-col dl-col-val" title="'+d+'">'+b(d,c)+"</div></div>").data("field",c).appendTo(f)});f=f==d?e:d});return c};A71=function(a,b,c){this._$tabs=a;this._$pages=b;this.options=$.extend({},this._DEFAULT_OPTIONS,c||{});this.tabChanged=new Delegate;this.initActivePage();this.initHandlers()};A71.prototype._DEFAULT_OPTIONS={saveTab:!1};A71.prototype.initActivePage=function(){var a=0;this.options.saveTab&&(a=TVSettings.getInt(this.options.saveTab,0));this.setActivePage(a)};
|
|
A71.prototype.setActivePage=function(a){this._$tabs.children().removeClass("active").eq(a).addClass("active");this._$pages.children().removeClass("active").eq(a).addClass("active");this.options.saveTab&&TVSettings.setValue(this.options.saveTab,a);this.tabChanged.fire(a)};A71.prototype.initHandlers=function(){this._$tabs.on("click","*",this._onTabClick.bind(this))};A71.prototype._onTabClick=function(a){a.preventDefault();a=$(a.currentTarget).index();this.setActivePage(a)};
|
|
A71.prototype.addPage=function(a,b){var c=this.count();this._$tabs.append(a);this._$pages.append(b);c||this.setActivePage(0);return c};A71.prototype.removePage=function(a){this._$tabs.children().eq(a).remove();this._$pages.children().eq(a).remove();a=this._$tabs.children().filter(".active").length?this._$tabs.children().filter(".active").index():0<=a-1?a-1:0;this.setActivePage(a)};A71.prototype.count=function(){return this._$tabs.children().length};
|
|
A71.prototype.index=function(){return this._$tabs.children().filter(".active:eq(0)").index()};A71.prototype.indexOfPage=function(a){return this._$pages.children().index(a)};A71.prototype.pageAt=function(a){return this._$pages.children().eq(a)};TradingView.templates={index:{chartsSection:'<div class="index-charts-tab active" id="index-charts-tab-{{index}}"><div class="index-charts-tab-sizer"><div class="index-charts-tab-container"><div class="clear"></div></div><div class="index-charts-spinner"></div></div><div class="show-more"><a href="/chart/?q=&sort={{url}}" id="show-more-button">More {{sectionName}} Ideas</a></div></div>',chartsSectionItem:'<div class="item" id="chart-{{id}}"><a href="{{published_chart_url}}"><img class="chart-img" src="{{image_mid_url}}" alt="" /></a><div class="caption">{{>iconedFollowSymbolButton}} <a href="/chart/{{short_name}}/{{#full_name_required}}?exg={{exchange}}{{/full_name_required}}" class="symbol" data-symbol="{{symbol}}">{{short_name}}</a>, <span class="interval">{{interval}}</span> <span class="count views"><span class="icon icon-eye" title="'+
|
|
$.t("Views")+'"></span> {{views_count}}</span><span class="count comments"><span class="icon icon-comment" title="Comments"></span> {{comment_count}}</span></div><a class="cover{{#is_online}} online{{/is_online}}" href="{{published_chart_url}}"><img class="avatar-pic" src="{{user_picture}}" alt="{{full_name}}"/><div class="user-info">{{full_name}}{{#is_moderator}}<sup class="user-badge mod" title="'+$.t("Moderator")+'}">'+$.t("mod")+'</sup>{{/is_moderator}} {{^is_moderator}}{{#is_pro}}<sup class="user-badge pro{{#is_realtime}} realtime{{/is_realtime}}{{#is_trial}} trial{{/is_trial}}" title="'+
|
|
$.t("Pro")+"{{#is_realtime}} "+$.t("Realtime")+"{{/is_realtime}}{{#is_trial}} "+$.t("Trial")+'{{/is_trial}}">'+$.t("Pro")+'</sup>{{/is_pro}} {{/is_moderator}}<br/><span class="icon icon-charts" title="'+$.t("Charts")+'"></span> {{user_charts}} <span class="icon icon-rating-small" title="'+$.t("Rating")+'"></span> {{followers_count}}</div><div class="clear"></div><div class="name">{{name}}</div><div class="desc">{{desc}}</div><div class="date">{{created_time}}</div><div class="icons">{{> chartBadges}}<span class="chart-direction-label direction-{{direction}}">{{#direction_name}}{{direction}}{{/direction_name}}</span></div></a></div>'},
|
|
addressInputsRows:'<tr><td colspan="12"><p>'+$.t("Address")+'</p><input class="address-autocomplete" type="text" value="" placeholder="{{#addressPlaceholder}}{{addressPlaceholder}}{{/addressPlaceholder}}{{^addressPlaceholder}}Enter your ZIP code{{/addressPlaceholder}}"/></td></tr><tr><td colspan="12"><input type="text" autocomplete-name="route" name="STREET" value="{{#reference_transaction_billing_address.STREET}}{{reference_transaction_billing_address.STREET}}{{/reference_transaction_billing_address.STREET}}{{^reference_transaction_billing_address.STREET}}{{ user.billing_street }}{{/reference_transaction_billing_address.STREET}}" placeholder="Street" disabled="true"/></td></tr><tr><td colspan="6"><input type="text" autocomplete-name="locality" name="CITY" value="{{#reference_transaction_billing_address.CITY}}{{reference_transaction_billing_address.CITY}}{{/reference_transaction_billing_address.CITY}}{{^reference_transaction_billing_address.CITY}}{{ user.billing_city }}{{/reference_transaction_billing_address.CITY}}" placeholder="City" disabled="true"/></td><td colspan="6"><input type="text" autocomplete-name="administrative_area_level_1" name="STATE" value="{{#reference_transaction_billing_address.STATE}}{{reference_transaction_billing_address.STATE}}{{/reference_transaction_billing_address.STATE}}{{^reference_transaction_billing_address.STATE}}{{ user.billing_state }}{{/reference_transaction_billing_address.STATE}}" placeholder="State/Region" disabled="true"/></td></tr><tr><td colspan="6"><input type="text" autocomplete-name="country" name="COUNTRY" value="{{#reference_transaction_billing_address.COUNTRY}}{{reference_transaction_billing_address.COUNTRY}}{{/reference_transaction_billing_address.COUNTRY}}{{^reference_transaction_billing_address.COUNTRY}}{{ user.billing_country }}{{/reference_transaction_billing_address.COUNTRY}}" placeholder="Country" disabled="true"/><input type="hidden" autocomplete-name="country_code" name="COUNTRYCODE" value="{{#reference_transaction_billing_address.COUNTRYCODE}}{{reference_transaction_billing_address.COUNTRYCODE}}{{/reference_transaction_billing_address.COUNTRYCODE}}{{^reference_transaction_billing_address.COUNTRYCODE}}{{ user.billing_countrycode }}{{/reference_transaction_billing_address.COUNTRYCODE}}" /></td><td colspan="6"><input type="text" autocomplete-name="postal_code" name="ZIP" value="{{#reference_transaction_billing_address.ZIP}}{{reference_transaction_billing_address.ZIP}}{{/reference_transaction_billing_address.ZIP}}{{^reference_transaction_billing_address.ZIP}}{{ user.billing_zip }}{{/reference_transaction_billing_address.ZIP}}" placeholder="Zip Code" disabled="true"/></td></tr>',
|
|
dialogs:{paymentMethod:'<table class="tv-dialog-colomn-table"><tr><td><div class="tv-dialog-title"><span class="tv-dialog-title-text">{{title}}</span><a class="tv-dialog-title-close"></a></div><div class="main">{{#message}}<p>{{message}}</p>{{/message}}{{#pnref}}<div class="order-detail-head" data-method="oneclick-form"><h3><span class="order-checkbox radio active"></span>Make payment with previously used details</h3></div>{{/pnref}}<div class="order-detail-head" data-method="cc-form"><h3><span class="order-checkbox radio{{^pnref}} active{{/pnref}}"></span>Credit Card</h3></div><div class="order-detail-head" data-method="expresscheckout-form"><h3><span class="order-checkbox radio"></span>PayPal</h3></div>{{#pnref}}<div class="order-detail-body oneclick-form active"><p>'+
|
|
$.t("Your credit card on file is XXXX-XXXX-XXXX")+'-{{ cchint }}</p><form action="/paypal/oneclick/" id="oneclick-form" class="payment-form" method="post"><input type="hidden" name="pnref" value="{{ pnref }}" /><input type="hidden" name="billing_cycle" value="{{billing_cycle}}" /> <input type="hidden" name="child_products" value="{{child_products}}" /> <input type="hidden" name="exchanges_only" value="{{exchanges_only}}" /> {{#reference_transaction_billing_address_is_full}}<input name="ZIP" value="{{reference_transaction_billing_address.ZIP}}" type="hidden"><input name="STREET" value="{{reference_transaction_billing_address.STREET}}" type="hidden"><input name="CITY" value="{{reference_transaction_billing_address.CITY}}" type="hidden"><input name="STATE" value="{{reference_transaction_billing_address.STATE}}" type="hidden"><input name="COUNTRY" value="{{reference_transaction_billing_address.COUNTRY}}" type="hidden"><input name="COUNTRYCODE" value="{{reference_transaction_billing_address.COUNTRYCODE}}" type="hidden">{{/reference_transaction_billing_address_is_full}}{{^reference_transaction_billing_address_is_full}}<table id="oneclick-table">{{>addressInputsRows}}</table>{{/reference_transaction_billing_address_is_full}}</form></div>{{/pnref}}<div class="order-detail-body expresscheckout-form"><p>'+
|
|
$.t("You will be automatically redirected to PayPal in order to finish your purchase.")+'</p><form action="/paypal/expresscheckout/" id="expresscheckout-form" class="payment-form" method="post"><input type="hidden" name="billing_cycle" value="{{billing_cycle}}" /> <input type="hidden" name="child_products" value="{{child_products}}" /> <input type="hidden" name="exchanges_only" value="{{exchanges_only}}" /> </form></div><div class="order-detail-body cc-form{{^pnref}} active{{/pnref}}"><form action="https://{{ api_host }}" id="cc-form" class="payment-form" method="post"><input type="hidden" name="SECURETOKEN" value="" /><input type="hidden" name="SECURETOKENID" value="" /><input type="hidden" name="EXPDATE" value="" /> <table id="cc-table"><tr><td colspan="6"><p>'+
|
|
$.t("First Name")+'</p><input type="text" name="BILLTOFIRSTNAME" value="{{ user.first_name }}" /></td><td colspan="6"><p>'+$.t("Last Name")+'</p><input type="text" name="BILLTOLASTNAME" value="{{ user.last_name }}" /></td></tr>{{>addressInputsRows}}<tr><td colspan="12"><p>'+$.t("Email")+'</p><input type="text" name="BILLTOEMAIL" value="{{ user.email }}" /></td></tr><tr class="cc-row"><td colspan="5"><p>'+$.t("Card Number")+'</p><input type="text" name="ACCT_visible" value="" /></td><input type="hidden" name="ACCT" value="" /></td><td colspan="3"><p>'+
|
|
$.t("CVV/CSC")+' <span id="cc-table-csc-help-link" href="#csc-help">?</span></p><input type="text" name="CVV2" value="" /></td><td colspan="4"><p>'+$.t("Expiration Date (MM/YY)")+'</p><input class="exp-date" type="text" name="EXPDATEMM" value="" /><span class="slash">/</span><input class="exp-date" type="text" name="EXPDATEYY" value="" /></td></tr></table></form></div><div class="order-purchase-button"><a href="#subscribe" class="green" id="order-subscribe">{{#okText}}{{okText}}{{/okText}}{{^okText}}Subscribe{{/okText}}</a></div></div></td>{{#showTotalColumn}}<td class="tv-dialog-right-colomn"><div class="main"><div class="slip-header">'+
|
|
$.t("Your Order")+'</div><table class="slip-table">{{#totalsList}}<tr><td>{{name}} ({{billing_cycle_readable}})</td><td>${{cost}}</td></tr>{{/totalsList}}<tr class="slip-divider"><td colspan="2"></td></tr><tr class="slip-total"><td><b>'+$.t("Total")+'</b></td><td>${{total}}</td></tr></table></div><div class="cc-logos"></div></td>{{/showTotalColumn}}</tr></table>',proiritySupport:"<p><strong>"+$.t("Priority phone support")+"</strong>: +1 (614) 285-3457<br><br> "+$.t("Average waiting time on the phone is less than one minute. Phone support is available Monday-Friday from 6:30 AM until 3:00 PM EST.")+
|
|
"</p><p><strong>"+$.t("Priority email support")+'</strong>: <a href="mailto:premium@tradingview.com">premium@tradingview.com</a><br><br>'+$.t("E-mail support hours are 4:00 AM \u2013 3 PM EST Monday - Friday. Typical response time is 1 hour during business hours.")+"</p>",publishIntro:'<div class="main"><p>'+$.t("Publishing means sharing your chart and trading idea with the financial web and the investing community. A published idea needs to be detailed and descriptive in order to be meaningful to other traders.")+
|
|
"</p><p>"+$.t("In effort to make TradingView more useful to a larger number of users, moderators have the right to hide ideas with bad descriptions or not informative from the front page and the gallery. We are NOT limiting any ways of publishing or using TradingView charts. You can still create and publish any kind of charts; your profile and Activity Stream will still show all created charts.")+"</p><p>"+$.t("The best ideas are placed in the <b>Suggested</b> tab, where they receive extra exposure. All suggested ideas are hand-picked by our editorial team based on a number of criteria. We have a dedicated group of people who review every idea published every day to find the most interesting and informative ideas that will be helpful to other members.")+
|
|
"</p><p><strong>"+$.t("Following below suggestions will help get your ideas suggested:")+"</strong></p><ul><li>"+$.t("A clear title that describes your idea. Don\u2019t just write \u201cMSFT\u201d or \u201cMSFT Short\u201d. A title like this doesn\u2019t say much and won\u2019t attract much interest to your idea.")+"</li><li>"+$.t("A description that clearly states your idea. Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader\u2019s shoes and see if you\u2019d understand the context based on what you wrote. It\u2019s also a good idea to re-post descriptions right on the chart, so your idea can be shared without losing meaning.")+
|
|
"</li><li>"+$.t("Long-term intervals are better than short-term ones for publishing analysis. An idea on 1 minute bars will probably become obsolete by the time people read it. However a good idea may still be featured.")+"</li><li>"+$.t("Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant.")+"</li><li>"+$.t("Presentation is important. Too much clutter adds to confusion.")+"</li></ul><p>"+$.t("In short, the more understandable and interesting your ideas are, the more you\u2019ll gain respect of others and get discovered by the financial community. We\u2019ll do our best to help showcase good ideas.")+
|
|
"</p><p>"+$.t("Some authors that we recommend get marked as <b>Suggested Authors</b>, and their ideas get posted to the front page automatically. The basis for recommending authors is multiple factors, which include a large number of interesting ideas. A suggested author has a corresponding badge in their profile.")+'</p><div class="caption-text"><input id="tv-dialog-donotshow-checkbox" type="checkbox" name="donotshow"{{#do_not_show}} checked="checked"{{/do_not_show}}/><span class="tv-dialog-checkbox-mask donotshow{{#do_not_show}} tv-dialog-checkbox-mask-active{{/do_not_show}}"></span> <label for="tv-dialog-donotshow-checkbox"><strong>'+
|
|
$.t("Do not show this message again")+'</strong></label></div><div class="tv-dialogs-bottom-button"><a class="tv-dialog-button-blue tv-left" id="publish-intro-continue">'+$.t("CONTINUE")+"</a></div></div>",publishChartWidget:'<div class="main"><form id="publish-chart-form" autocomplete="off"><div class="caption first">'+$.t("IDEA TITLE AND DESCRIPTION")+'*</div><div class="publish-text"><input type="text" name="name" maxlength="64" placeholder="'+$.t("A clear title that describes your idea. Don't just write “MSFT” or “MSFT Short”.")+
|
|
'"/></div><div class="empty-caption"></div><div class="publish-text autowidth jsfluid"><textarea name="description" placeholder="'+$.t("Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader's shoes and see if you'd understand the context based on what you wrote. Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant.")+'"></textarea></div><div class="empty-caption"></div><input type="hidden" name="tags"/><div class="publish-direction-buttons clearfix"><div class="col-short"><a class="tv-button short" data-val="2">'+
|
|
$.t("SHORT")+'</a></div><div class="col-long"><a class="tv-button long" data-val="1">'+$.t("LONG")+'</a></div><div class="col-neutral"><a class="tv-button neutral active" data-val="0">'+$.t("NEUTRAL")+'</a></div></div><div class="tv-dialogs-bottom-button"><a class="tv-dialog-button-blue tv-right" id="publish-dialog-do-publish">{{^editMode}}'+$.t("PUBLISH IDEA")+"{{/editMode}}{{#editMode}}"+$.t("EDIT IDEA")+'{{/editMode}}</a><span class="tv-dialog-layoutpicker tv-right"></span><span class="tv-dialog-cancel-button tv-right">'+
|
|
$.t("Cancel")+'</span></div><input type="hidden" name="direction" value="0"/></form></div>',publishChart:'<div class="main"><form id="publish-chart-form" autocomplete="off"><div class="caption first">{{^isScript}}'+$.t("IDEA TITLE AND DESCRIPTION")+"*{{/isScript}}{{#isScript}}"+$.t("SCRIPT TITLE AND DESCRIPTION")+'*{{/isScript}}</div><div class="publish-text"><input type="text" name="name" maxlength="64" placeholder="{{^isScript}}'+$.t("A clear title that describes your idea. Don't just write “MSFT” or “MSFT Short”.")+
|
|
'{{/isScript}}"/></div><div class="empty-caption"></div><div class="bbcode-buttons clearfix"><span tabindex="-1" class="bbcode-button bb-bold"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M12.699 7.579h3.916c3.797-.089 5.041.962 5.151 3.896.072 1.909-1.75 2.441-2.622 2.598v.098c2.103.358 3.155 1.283 3.154 3.311-.002 3.047-2.479 3.925-4.766 3.945h-4.834zm1.611 5.928c2.418.132 5.948.008 5.85-2.344-.11-2.632-3.385-2.242-5.85-2.197zm0 1.367v5.176c2.514.154 6.377.26 6.26-2.676-.104-2.597-3.656-2.5-6.26-2.5z"/></svg></span><span tabindex="-1" class="bbcode-button bb-italic"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M15.624 7.579l-.28 1.281h2.563l-2.463 11.25h-2.563l-.287 1.313h6.782l.287-1.313h-2.594l2.463-11.25h2.594l.28-1.281h-6.782z"/></svg></span><span tabindex="-1" class="bbcode-button bb-list"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M8 8h2v2h-2zM8 13h2v2h-2zM8 18h2v2h-2zM14 8h12v2h-12zM14 13h13v2h-13zM14 18h9v2h-9z"/></svg></span><span tabindex="-1" class="bbcode-button bb-embed"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="29"><path d="M26.516 6.394a.85.85 0 0 0-.594.438l-6.719 11.094-4.406-5.469.031-.156c0-.713-.569-1.313-1.281-1.313-.713 0-1.281.6-1.281 1.313l.031.125-4.313 6.688a.85.85 0 1 0 1.438.906l4.125-6.438 4.406 5.5-.031.125c0 .713.569 1.313 1.281 1.313.713 0 1.281-.6 1.281-1.313v-.063l6.906-11.437a.85.85 0 0 0-.781-1.313.85.85 0 0 0-.094 0z"/></svg></span><div class="bbcode-embed-block"><div class="bbcode-embed-form"><input type="text" class="embed" disabled><span class="tv-dialog-button-blue embed-submit">'+
|
|
$.t("Insert")+'</span></div></div></div><div class="publish-text autowidth jsfluid"><textarea name="description" placeholder="{{^isScript}}'+$.t("Describe what you think and WHY you think that. Good fundamental analysis always helps. Put yourself in reader's shoes and see if you'd understand the context based on what you wrote. Clearly state Profit Target and Stop Loss areas if you are making a prediction. This significantly helps others understand what you meant.")+'{{/isScript}}"></textarea></div>{{^editMode}}{{^isScript}}<div class="empty-caption"></div><div class="publish-direction-buttons clearfix"><div class="col-short"><a class="tv-button short" data-val="2">'+
|
|
$.t("SHORT")+'</a></div><div class="col-long"><a class="tv-button long" data-val="1">'+$.t("LONG")+'</a></div><div class="col-neutral"><a class="tv-button neutral active" data-val="0">'+$.t("NEUTRAL")+'</a></div></div>{{/isScript}}{{/editMode}}{{^isScript}}<div class="caption">'+$.t("LINK TO RELATED IDEAS")+'</div><input class="publish-related" placeholder="'+$.t("Pick your idea or paste url to someone's else idea.")+'">{{/isScript}}<div class="caption">'+$.t("TAGS")+'</div><input class="publish-tags"><div class="tv-dialogs-bottom-button">{{^isScript}}{{^editMode}}<label class="publish-dialog-privacy tv-right" title="'+
|
|
$.t("Private Chart Publishing")+'"><input name="public" type="checkbox" checked="checked"/><span class="publish-dialog-privacy-icon"></span></label>{{/editMode}}{{/isScript}}<a class="tv-dialog-button-blue tv-right" id="publish-dialog-do-publish">{{#isScript}}{{#editMode}}'+$.t("EDIT SCRIPT")+"{{/editMode}}{{/isScript}}{{#isScript}}{{^editMode}}"+$.t("PUBLISH SCRIPT")+"{{/editMode}}{{/isScript}}{{^isScript}}{{#editMode}}"+$.t("EDIT IDEA")+"{{/editMode}}{{/isScript}}{{^isScript}}{{^editMode}}"+$.t("PUBLISH IDEA")+
|
|
'{{/editMode}}{{/isScript}}</a>{{^editMode}}<span class="tv-dialog-layoutpicker tv-right"></span>{{/editMode}}<span class="tv-dialog-cancel-button tv-right">'+$.t("Cancel")+'</span>{{^editMode}}<div class="tv-left repost-to"><span class="repost-to-label">'+$.t("Repost to")+'</span><input id="tv-dialog-twitter-checkbox" type="checkbox" name="twitter"{{#has_twitter}} checked="checked"{{/has_twitter}}/><label for="tv-dialog-twitter-checkbox" class="repost-to-twitter"><span class="icon"></span></label><input id="tv-dialog-stocktwits-checkbox" type="checkbox" name="stocktwits"{{^has_twitter}}{{#has_stocktwits}} checked="checked"{{/has_stocktwits}}{{/has_twitter}}/><label for="tv-dialog-stocktwits-checkbox" class="repost-to-stocktwits"><span class="icon"></span></label><div class="clear"></div></div>{{/editMode}}</div><input type="hidden" name="direction" value="0"/></form></div>',
|
|
goPro:{layout:'<div class="col-main"><div class="col-copy"></div><div class="actions-block">{{^noButton}}<a class="no-button">'+$.t("No, thank you")+'</a>{{^exchangesButton}}{{^trialButton}}<a href="/gopro/" target="_blank" class="yes-button">'+$.t("Upgrade now")+'<span class="arrow-icon"></span></a>{{/trialButton}}{{#trialButton}}<a href="/gopro/" target="_blank" class="yes-button">'+$.t("30 Day Free Trial")+'</a>{{/trialButton}}{{/exchangesButton}}{{#exchangesButton}}<a href="/gopro/" target="_blank" class="yes-button" onclick="pro.visitExchangesPage({newWindow: true}); return false;">'+
|
|
$.t("Add real-time markets")+'</a>{{/exchangesButton}}{{/noButton}}</div></div><div class="col-aside"><div class="col-bg"></div><div class="col-copy"><h2>'+$.t("Why <em>Go Pro</em>?")+"</h2><ul><li>"+$.t("Official real-time & intraday data")+"</li><li>"+$.t("Intraday Renko, Kagi, Line Break, PnF charts")+"</li><li>"+$.t("Intraday Spread Charts")+"</li><li>"+$.t("Volume Profile Indicators")+"</li><li>"+$.t("Custom Intervals")+"</li><li>"+$.t("Unlimited saved charts")+"</li><li>"+$.t("Multiple Watch Lists")+
|
|
"</li><li>"+$.t("Hot Lists")+"</li><li>"+$.t("PRO Badge & Adding Value")+"</li><li>"+$.t("Extended Trading Hours")+"</li><li>"+$.t("Multiple Charts Layout")+"</li><li>"+$.t("Drawings Syncing")+"</li><li>"+$.t("Unlimited number of indicators on a chart")+'</li></ul></div></div><div class="clear"></div>',defaultCopy:"<h2>"+$.t("Upgrade your account")+"</h2><p>"+$.t("This functionality is available only to PRO users.")+"</p><p>"+$.t("Please consider subscribing to our PRO service which includes many other features not available in the free membership.")+
|
|
"</p>",features:{proRtSymbol:"<h2>"+$.t("Official AMEX, NYSE & NASDAQ Real-time Data")+"</h2><p>"+$.t("You requested a symbol that is available only to PRO Plus and Premium users. You will now be switched to the equivalent BATS symbol.")+"</p><p>"+$.t("NASDAQ and NYSE charge exchange and per-user fees, which means we can\u2019t give this for free to everyone (as much as we'd love to). Our free feed is provided by BATS electronic exchange, which offers approximate volumes and prices with fewer updates.")+
|
|
"</p><p>"+$.t("If you need only the most complete and accurate data, then consider subscribing to the PRO Plus or Premium service from only $19.95/m that offers actual real-time data from the NYSE/NASDAQ/AMEX exchanges and much more.")+"</p>",kagiRenko:"<h2>"+$.t("Renko, Kagi, Line Break, Point & Figure")+"</h2><p>"+$.t("Only PRO Plus and Premium subscribers can access intraday Renko, Kagi, Line Break, Point & Figure charts. You will now be switched to a Daily (D) interval.")+"</p><p>"+
|
|
$.t("Intraday Renko, Kagi, Line Break and Point & Figure charts take considerable resources, so we can't give them out for free to everyone (as much as we'd like to). We can, however, give out these charts for free in the Daily and Weekly resolutions.")+"</p><p>"+$.t("If you do intraday analysis consider subscribing to PRO Plus or Premium service from only $19.95/m.")+"</p>",hotLists:"<h2>"+$.t("Hot Lists")+"</h2><p>"+$.t("You requested a hotlist that is available only to PRO users.")+"</p><p>"+
|
|
$.t("HotLists continuously scan the US stock market to identify best trading opportunities and take considerable resources, so we can't give them out for free to everyone (as much as we'd like to).")+"</p><p>"+$.t("If you want to identify opportunities in an efficient manner, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.")+"</p>",intradaySpread:"<h2>"+$.t("Intraday Spread")+"</h2><p>"+$.t("You requested an intraday spread symbol that is available only to PRO Plus and Premium users. You will now be switched to a Daily (D) interval.")+
|
|
"</p><p>"+$.t("Spreads for intraday charts are calculated based on 1-minute bars, and then recompiled into the selected interval. This approach is the only correct one, but requires significant server power. This means we can't give spread charts for free to everyone (as much as we'd like to).")+"</p><p>"+$.t("If you do intraday spread analysis consider subscribing to PRO Plus or Premium service from only $19.95/m.")+"</p>",customIntervals:"<h2>"+$.t("Custom Intervals")+"</h2><p>"+$.t("You requested a custom interval that is available only to PRO users.")+
|
|
"</p><p>"+$.t("This feature allows you to create any chart, such as 7 minutes, 12 minutes, or 8 hours. If you want to identify opportunities on custom intervals in an efficient manner, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.")+"</p>",multipleWatchLists:"<h2>"+$.t("Multiple Watch Lists")+"</h2><p>"+$.t("Multiple Watch Lists available only to PRO users.")+"</p><p>"+$.t("Any custom watchlist can be saved under a unique name and loaded at any time with one click. All lists are available from any computer, so you have your workspace wherever you go.")+
|
|
"</p><p>"+$.t("If you want to use different watchlists to quickly assess different sectors of the market, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.")+"</p>",extendedHours:"<h2>"+$.t("Extended Trading Hours")+"</h2><p>"+$.t("Only PRO Plus and Premium subscibers can access extended hours data on the charts. Extended trading hours include both pre-market and after hours sessions each day the market is open.")+
|
|
"</p><p>"+$.t("If you want to act quickly to news and events that occur when the regular market is closed, please consider subscribing to PRO Plus or Premium service from only $19.95/m.")+"</p>",multipleCharts:"<h2>"+$.t("Multiple Charts Layout")+"</h2><p>"+$.t("Multiple Charts Layout available only to PRO users.")+"</p><p>"+$.t("You can plot up to 8 charts in one tab of your browser. Moreover, it\u2019s possible to link your charts by resolutions or symbols. And even use global cursor that synchronizes many charts.")+
|
|
"</p><p>"+$.t("If you want to unlock the power of multiple time frame analysis and add multiple symbols to the same chart layout, consider subscribing to our PRO service for only $9.95/m. This subscription includes many other features not available in the free membership.")+"</p>",alerts:"<h2>"+$.t("Unlimited server-side alerts")+"</h2><p>"+$.t("You already set {{options.maxAlertsNumber}} alerts. Upgrade to PRO Plus to set unlimited custom alerts and improve your experience!")+"</p><p>"+$.t("TradingView alerts run on powerful and backed-up servers, so you\u2019ll always get notified when something happens and won\u2019t miss a beat. This takes considerable resources, so we can't give an unlimited number of alerts to everyone for free (as much as we'd like to).")+
|
|
"</p><p>"+$.t("Become a PRO Plus user for just $19.95 and get unlimited alerts! You also get a ton of other useful features, like multiple charts on the same screen, custom chart timeframe like 3-min charts, and our sincere thanks!")+"</p>",intradayExchange:"<h2>"+$.t("Official real-time, intraday and volume data")+"</h2><p>"+$.t("Only PRO, PRO Plus and Premium users that have a subscription to {{exchange}} Exchange can get official data on real-time prices, volume and intraday history. You'll now be switched to the Daily (D) interval, which is available to all users.")+
|
|
"</p><p>"+$.t("Exchanges charge per-user fees and redistribution fees from TradingView for delivery of intraday and real-time data. So, we can't give this data for free to everyone (as much as we'd like to).")+"</p><p>"+$.t("If you do intraday analysis, consider subscribing to the {{exchange}} exchange.{{^exchangesButton}} You must subscribe to PRO, PRO Plus or Premium service first (from only 9.95/m).{{/exchangesButton}}")+"</p>",savedChartsLimit:"<h2>"+$.t("Unlimited Saved Charts")+"</h2><p>"+$.t("You can save up to 5 charts with your subscription. Upgrade to PRO, PRO Plus or Premium membership and save unlimited charts, along with many other exciting features. Starting from only $9.95 a month - upgrade today!")+
|
|
"</p>",studyLimit:"<h2>"+$.t("Unlimited number of indicators on a chart")+"</h2><p>"+$.t("Your free account allows you to apply up to 10 studies to a chart. Upgrade to PRO, PRO Plus or Premium account to have as many studies on a chart as you want, as well as many other exciting features.")+"</p><p>"+$.t("We are happy to give away as many things for free as possible, however studies are server-based and this takes considerable resources. So we can't give an unlimited number of indicators to everyone for free (as much as we'd like to).")+
|
|
"</p><p>"+$.t("Become a Pro user for just $9.95 and get unlimited studies! You also get a ton of other useful features, like multiple charts on the same screen, custom chart timeframe like 3-min charts, and our sincere thanks because you support further development of TradingView!")+"</p>",savedChartsForAlertLimit:"<h2>"+$.t("Unlimited Saved Charts")+"</h2><p>"+$.t("To set an alert on a drawing requires the chart to be saved. Unfortunately you have already saved 5 charts. Upgrade to PRO, PRO Plus or Premium account and save as many charts as you want, along with many other exciting features. Starts from only $9.95 a month - upgrade today!")+
|
|
"</p>"}},addSymbol:' <div class="main"> <div class="symbol-edit-place"></div>{{#overlayOption}} <div class="tv-dialog-relative">\t<input id="tv-dialog-addsymbol-overlay-checkbox" type="checkbox" name="addsymbol-overlay" {{#overlayOptionChecked}}checked="checked"{{/overlayOptionChecked}} />\t<span class="tv-dialog-checkbox-mask tv-dialog-checkbox-mask{{#overlayOptionChecked}}-active{{/overlayOptionChecked}}"></span>\t<label for="tv-dialog-addsymbol-overlay-checkbox">'+$.t("Overlay the main chart")+
|
|
'</label> </div>{{/overlayOption}} <div class="tv-dialogs-bottom-button"> <span class="tv-button tv-right tv-uppercase ok">{{okButtonTitle}}</span> </div> </div>',billingCycleSelection:'<div class="main billing-cycle-dialog"><div class="bcd-title">'+$.t("Subscription Plans")+'</div><div class="bcd-subtitle">'+$.t("You're subscribing to {{ product_title }}")+'</div><div class="bcd-choice-container clearfix"><div class="bcd-choice active" data-cycle="y"><div class="bcd-choice-bg"></div><div class="bcd-choice-marker"></div><div class="bcd-choice-copy"><h5>'+
|
|
$.t("Buy Annual")+'</h5><div class="bcd-prices"><p>${{price_1_m}} '+$.t("per month")+"</p><p>${{price_1_y}} "+$.t("per year")+"</p><p>"+$.t("Save ${{savings}}")+"</p><p>"+$.t("No monthly invoices")+'</p></div></div></div><div class="bcd-choice" data-cycle="m"><div class="bcd-choice-bg"></div><div class="bcd-choice-marker"></div><div class="bcd-choice-copy"><h5>'+$.t("Buy Monthly")+'</h5><div class="bcd-prices"><p>${{price_2_m}} '+$.t("per month")+"</p><p>${{price_2_y}} "+$.t("per year")+"</p><p>"+
|
|
$.t("Invoiced every month")+'</p></div></div></div></div><div class="bcd-continue"><a class="bcd-continue-button">'+$.t("Continue")+"</a></div></div>",symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-cion"></div></div></div><div class="filter"></div><div class="results"></div>',proRTTrialOffer:'<div class="main"><h3>'+$.t("Your Personal Invitation to Go PRO Plus")+
|
|
"</h3><p>"+$.t("For a limited time, we\u2019re offering a <strong>FREE 1 month</strong> subscription of PRO Plus (no credit card required, no catches or hidden autobilling).")+"</p><p>"+$.t('Our PRO Plus users see amazing benefits. You get advanced trading opportunities using multi symbol statistical arbitrage techniques. <a href="/gopro/" target="_blank">Read more about PRO Plus features</a>.')+'</p><div class="big-buttons two-buttons"><a href="javascript://" class="big-button trial">'+$.t("Activate Offer and GO PRO")+
|
|
'</a><a href="javascript://" class="big-button nothanks">'+$.t("No, thank you")+"</a></div></div>",earlyAccess:'<div class="main"><h3>'+$.t("Early Access 50% off{{#is_finished}} – Final chance{{/is_finished}}")+"</h3>{{#is_1wk}}<p>"+$.t("So… You\u2019ve had free PRO Plus for a week now. Seeing the advantages?")+"</p><ul><li>"+$.t("Multiple charts layout and watch lists")+"</li><li>"+$.t("Custom intervals and unlimited alerts")+"</li><li>"+$.t("Intraday Renko, Kagi, Line Break, PnF and spread charts")+
|
|
"</li><li>"+$.t("Volume profile indicators and extended trading hours")+"</li></ul><p>"+$.t("If you like what you see, you have an exclusive chance to get <strong>12 months for only $179.4</strong>. That\u2019s less than $15/month and 50% off regular price.")+"</p><p>"+$.t("Do you want to take advantage of this offer now?")+"</p>{{/is_1wk}}{{#is_2wk}}<p>"+$.t("Oh no! You have only 2 weeks left in your PRO Plus trial! These benefits will expire in two short weeks:")+"</p><ul><li>"+$.t("Multiple charts layout and watch lists")+
|
|
"</li><li>"+$.t("Custom intervals and unlimited alerts")+"</li><li>"+$.t("Intraday Renko, Kagi, Line Break, PnF and spread charts")+"</li><li>"+$.t("Volume profile indicators and extended trading hours")+"</li></ul><p>"+$.t("Just for you, we made a special deal that lets you continue for another <strong>12 months for only $179.4</strong>. That\u2019s less than $15/month and 50% off regular month-to-month payments.")+"</p><p><strong>"+$.t("Low price available now – don\u2019t miss this chance!")+
|
|
"</strong></p>{{/is_2wk}}{{#is_finished}}<p>"+$.t("Don\u2019t cry… but your free PRO Plus trial has ended! We hope you benefited from useful features and felt good about yourself for supporting the community.")+"</p><p>"+$.t("Now is your <strong>LAST and FINAL</strong> chance to get 12 months for <strong>only $179.4</strong> (regular $360). That\u2019s less than $15/month and 50% off regular month-to-month payments.")+"</p><p>"+$.t("Remember, with PRO Plus you benefit from:")+"</p><ul><li>"+
|
|
$.t("Multiple charts layout and watch lists")+"</li><li>"+$.t("Custom intervals and unlimited alerts")+"</li><li>"+$.t("Intraday Renko, Kagi, Line Break, PnF and spread charts")+"</li><li>"+$.t("Volume profile indicators and extended trading hours")+"</li></ul><p>"+$.t("Don\u2019t miss the last chance to get the special Early Access and secure this low rate! <strong>Act now!</strong>")+"</p>{{/is_finished}}{{#is_manual}}<p>"+$.t("Upgrade and get 50% off regular month-to-month payments!")+"</p><p>"+
|
|
$.t("Just for you, we made a special deal that lets you continue for another 12 months for <strong>only $179.4</strong>. That is less than $15/month. Don\u2019t miss the last chance to get the special Early Access and secure this low rate! Act now!")+"</p><p>"+$.t("Remember, with PRO Plus you benefit from:")+"</p><ul><li>"+$.t("Multiple charts layout and watch lists")+"</li><li>"+$.t("Custom intervals and unlimited alerts")+"</li><li>"+$.t("Intraday Renko, Kagi, Line Break, PnF and spread charts")+
|
|
"</li><li>"+$.t("Volume profile indicators and extended trading hours")+'</li></ul>{{/is_manual}}<div class="big-buttons"><a href="javascript://" class="big-button ordernow">'+$.t("Early Access for $15/Month")+'</a></div><div class="more-controls"><a href="javascript://" class="nothanks">'+$.t("No, thank you")+"</a></div></div>",auth:'<div class="main"><div class="auth-dialog-socials"><a class="auth-dialog-social-facebook" title="Facebook"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-facebook"></use></svg></a><a class="auth-dialog-social-twitter" title="Twitter"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-twitter"></use></svg></a><a class="auth-dialog-social-google-oauth2" title="Google+"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-googleplus"></use></svg></a><a class="auth-dialog-social-yahoo" title="Yahoo!"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-yahoo"></use></svg></a><a class="auth-dialog-social-linkedin" title="Linked In"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-linkedin"></use></svg></a><a class="auth-dialog-social-stocktwits" title="StockTwits"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-stocktwits"></use></svg></a></div><div class="auth-dialog-separator"><span class="auth-dialog-separator-copy">'+
|
|
$.t("Or")+'</span></div><form id="signup-form" action="/accounts/signup/"><input name="email" type="text" placeholder="'+$.t("E-mail")+'"><input name="username" type="text" placeholder="'+$.t("Username")+'"><input name="password" type="password" placeholder="'+$.t("Password")+'"><input type="hidden" name="signup_trial" value="0"><div class="auth-dialog-notice"><p>'+$.t('By clicking on “Sign Up” below, you are agreeing to the <a href="/policies/" target="_blank">Terms of Service</a>.')+
|
|
'</p></div><button class="" type="submit">'+$.t("Sign Up")+"</button></form></div>",signin:'<div class="main"><div class="auth-dialog-socials"><a class="auth-dialog-social-facebook" title="Facebook"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-facebook"></use></svg></a><a class="auth-dialog-social-twitter" title="Twitter"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-twitter"></use></svg></a><a class="auth-dialog-social-google-oauth2" title="Google+"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-googleplus"></use></svg></a><a class="auth-dialog-social-yahoo" title="Yahoo!"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-yahoo"></use></svg></a><a class="auth-dialog-social-linkedin" title="Linked In"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-linkedin"></use></svg></a><a class="auth-dialog-social-stocktwits" title="StockTwits"><svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-stocktwits"></use></svg></a></div><div class="auth-dialog-separator"><span class="auth-dialog-separator-copy">'+
|
|
$.t("Or")+'</span></div><form id="signin-form" action="/accounts/signin/"><input name="username" type="text" placeholder="'+$.t("Username")+'"><input name="password" type="password" placeholder="'+$.t("Password")+'"><div class="auth-dialog-options"><label class="auth-dialog-remember"><span class="auth-dialog-remember-pseudo"><input type="checkbox" name="remember" checked /><i></i></span><span class="auth-dialog-remember-text">'+$.t("Remember me")+'</span></label><a class="auth-dialog-recover recover-link">'+
|
|
$.t("Forgot password?")+'</a></div><button type="submit">'+$.t("Sign In")+"</button></form></div>",recover:'<div class="main"><h2 class="auth-dialog-title recover"><span class="">'+$.t("Recover Password")+'</span></h2><form id="recover-form" action="/accounts/forgot_password/"><input name="email" type="text"placeholder="'+$.t("E-mail")+'"><button type="submit">'+$.t("Recover")+"</button></form></div>",browserExtension:'<div class="main-browser-extension"><div class="tv-dialog-title tv-dialog-title-hidden"><a class="tv-dialog-title-close"></a></div><div class="left"><div class="extension-poster"></div></div><div class="right"><div class="browser-info"><img class="logo" src="{{ browser.logo }}"><div class="name ">{{ browser.name }}</div><div class="info">'+
|
|
$.t("Extension")+'</div><div class="clearfix"></div></div><h1>'+$.t("TradingView Free Quotes and Chat")+"</h1><p>"+$.t("Follow free market quotes, your watchlist, public and private chats from TradingView, while surfing the web in any browser tab.")+'</p><a href="{{{ browser.href }}}" class="install-extension" target="_blank"><button>'+$.t("Install")+'</button></a></div><div class="clearfix"></div></div>'},lists:{savedCharts:"<ul>{{#charts}}<li><a href='/chart/{{url}}/'><span class='name'>{{name}}</span> <span class='subscript'>{{modified}}{{#short_symbol}} | {{short_symbol}}{{#interval}}, {{interval}}{{/interval}}{{/short_symbol}}</span> <span class='icon icon-carousel-item-delete-dark' title='Delete' data-id='{{url}}'></span></a></li>{{/charts}}</ul>"},
|
|
userlink:"<a href='/u/{{username}}/' class='userlink'>{{username}}</a>{{> userBadge}}",userBadge:"{{#is_top}}{{> topBadge}}{{/is_top}}{{^is_top}}{{#is_moderator}}{{> modBadge}}{{/is_moderator}}{{^is_moderator}}{{#is_pro}}{{> proBadge}}{{/is_pro}}{{/is_moderator}}{{/is_top}}",proBadge:'<{{badge_tag}}{{^badge_tag}}a href="/gopro/"{{/badge_tag}} class="apply-common-tooltip user-badge pro{{#is_realtime}} realtime{{/is_realtime}}{{#is_premium}} premium{{/is_premium}}{{#is_trial}} trial{{/is_trial}}{{#large_badge}} large{{/large_badge}}" title="{{#is_realtime}}'+
|
|
$.t("Pro Realtime")+"{{/is_realtime}}{{#is_premium}}"+$.t("Premium")+"{{/is_premium}}{{#is_trial}}"+$.t("Pro Trial")+"{{/is_trial}}{{^is_realtime}}{{^is_premium}}{{^is_trial}}"+$.t("Pro")+'{{/is_trial}}{{/is_premium}}{{/is_realtime}}">'+$.t("pro")+"</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>",modBadge:"<{{badge_tag}}{{^badge_tag}}a href='/house-rules/'{{/badge_tag}} class='user-badge mod{{#large_badge}} large{{/large_badge}} apply-common-tooltip' title='"+$.t("Moderator")+"'>"+$.t("mod")+"</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>",
|
|
topBadge:"<{{badge_tag}}{{^badge_tag}}a href='/people/'{{/badge_tag}} class='user-badge top{{#large_badge}} large{{/large_badge}} {{badge_class}} apply-common-tooltip' title='{{badge_title}}'>"+$.t("top")+"</{{badge_tag}}{{^badge_tag}}a{{/badge_tag}}>",chartBadges:'{{#is_hot}}<span class="icon icon-chart-recommended" title="'+$.t("Suggested Chart")+'"></span>{{/is_hot}}',iconedFollowSymbolButton:'{{#pro_symbol}}<button class="follow-symbol iconed{{#current_user_follows_symbol}} active{{/current_user_follows_symbol}}" data-symbol="{{pro_symbol}}" title="'+
|
|
$.t("Follow {{pro_symbol}}")+'"></button>{{/pro_symbol}}',globalNotification:'<div class="tv-global-notification" id="global-notification-{{ id }}"><div class="tv-layout-width"><span class="icon icon-notification-info"></span>{{{ text }}}</div><span class="global-notification-close"><i class="icon icon-notification-close"></i></span></div>',actionsLog:'<div class="entry"><b>{{#is_system}}<img src="/static/images/small-logo.png" class="log-system-message"/>system{{/is_system}}{{^is_system}}<a href="/u/{{username}}" target="_blank">{{username}}</a>{{/is_system}}</b><div class="entry-time time-upd">{{ created_timestamp }}</div> <div class="message">{{{text}}}</div></div>',
|
|
onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',userlinkPopup:'<div class="msg-userlink-popup" data-id="{{ id }}"><div class="msg-userlink-popup-container"><a class="userpic" href="/u/{{ username }}/"><img class="userpic" src="{{#has_picture}}{{big_picture_url}}{{/has_picture}}{{^has_picture}}{{mid_picture_url}}{{/has_picture}}"/></a><div class="content"><div class="username">{{> userlink}}<span class="btc-tip"></span></div><div class="user-stats-small"><span class="user-stats-followers" title="'+
|
|
$.t("Followers")+'">{{followers_count}}</span><span class="user-stats-charts" title="'+$.t("Charts")+'">{{charts_count}}</span><span class="user-stats-reputation" title="'+$.t("Reputation")+'">{{reputation}}</span></div>{{^is_self}}<div class="action-buttons"><button class="follow-user follow-user-{{ id }}{{#follow_status}} active{{/follow_status}}" title="{{#follow_status}}'+$.t("Unfollow")+"{{/follow_status}}{{^follow_status}}"+$.t("Follow")+'{{/follow_status}}" data-id="{{ id }}"><span class="follow">'+
|
|
$.t("Follow")+'</span><span class="following">'+$.t("Followed")+'</span><span class="unfollow">'+$.t("Unfollow")+'</span></button> <button class="message-user message active" title="'+$.t("Send message")+'" data-username="{{ username }}" data-id="{{ id }}"><span class="message">'+$.t("Message")+'</span></button></div>{{/is_self}}</div><div class="clear"></div>{{#status}}<div class="user-status">{{status}}</div>{{/status}}<div class="send-form"><p>To: <strong>{{ username }}</strong></p><p><textarea name="message-text"></textarea></p><p class="actions"><button class="message-user active send">'+
|
|
$.t("Send")+'</button><button class="message-user cancel">'+$.t("Cancel")+"</button></p></div></div></div>",miniWidgetWizardAddSymbol:'<tr class="symbol-item"><td>{{symbol}}</td><td>{{description}}</td><td>{{timeframe}}</td><td><div class="remove-symbol"></div></td></tr>',userInfoWidgetButtons1:'<div class="buttons layout-2-buttons"><button class="profile-action profile-edit" data-id="{{ id }}" data-username="{{ username }}" title="'+$.t("Edit profile")+'"><span class="">'+$.t("Edit")+'</span></button><button class="profile-action profile-signout" title="'+
|
|
$.t("Sign out")+'" onclick="TradingView.signOut(); return false;"><span class="">'+$.t("Sign out")+'</span></button><div class="clear"></div></div>',userInfoWidgetButtons2:'<div class="buttons layout-1-buttons"><button class="follow-user {{ is_followed_css }} follow-user-{{ id }}" data-id="{{ id }}"><span class="follow" title="'+$.t("Follow")+'"></span><span class="following" title="'+$.t("Following")+'"></span><span class="unfollow" title="'+$.t("Unfollow")+'"></span></button><div class="clear"></div></div>',
|
|
userInfoWidgetButtons3:'<div class="buttons layout-1-buttons"><button class="profile-action profile-signin" title="'+$.t("Sign in")+'" onclick="runOrSignIn(function() {}); return false;"><span class="">'+$.t("Sign in")+'</span></button><div class="clear"></div></div>'};TradingView.postMessageWrapper=function(){var a={},b={},c={},d,e=0,f=0;window.addEventListener&&window.addEventListener("message",function(c){var e;try{e=JSON.parse(c.data),R77.enabled("charting_library_debug_mode")&&console.log("PostMessage: incoming message: "+JSON.stringify(e))}catch(f){return}e.provider&&"TradingView"==e.provider&&("get"==e.type?b[e.name]&&b[e.name].forEach(function(a){"function"===typeof a&&a.call(e,e.data,function(a){d.postMessage(JSON.stringify({id:e.id,type:"on",name:e.name,
|
|
client_id:e.client_id,data:a,provider:"TradingView"}),"*")})}):"on"==e.type?a[e.client_id]&&a[e.client_id][e.id]&&(a[e.client_id][e.id].call(e,e.data),delete a[e.client_id][e.id]):"post"==e.type&&b[e.name]&&b[e.name].forEach(function(a){"function"===typeof a&&a.call(e,e.data,function(){})}))});return function(g,h){a[h]={};d=c[h]=g;var k="";return{on:function(a,c,d){b[a]&&d||(b[a]=[]);b[a].push(c)},get:function(b,d,f){b={id:e++,type:"get",name:b,client_id:h,data:d,provider:"TradingView"};a[h][b.id]=
|
|
f;c[h].postMessage(JSON.stringify(b),"*")},post:function(a,b,c){b={id:f++,type:"post",name:b,client_id:k,data:c,provider:"TradingView"};a&&"function"===typeof a.postMessage&&a.postMessage(JSON.stringify(b),"*")},setClientId:function(a){k=a}}}}();A15={force_prefix:"forcefeaturetoggle.",enableFeature:function(a){localStorage[this.force_prefix+a]="true"},disableFeature:function(a){localStorage.removeItem(this.force_prefix+a)}};
|
|
TradingView.D18=function(a){function b(b){localStorage["featuretoggle."+b]=Math.random()<=a[b];return localStorage["featuretoggle."+b]}if(TradingView.pushStreamMultiplexer)TradingView.pushStreamMultiplexer.on("featuretoggle",function(c){a[c.name]=c.state;b(c.name)});return function(c){var d;if(d="local"===window.environment)d=-1===["alerts-maintenance"].indexOf(c);if(d||"true"===localStorage[A15.force_prefix+c]||window.is_authenticated&&"undefined"!=typeof user&&
|
|
user&&user.settings&&user.settings[A15.force_prefix+c])return!0;if(!a[c])return!1;if(1===a[c])return!0;d=localStorage["featuretoggle."+c];return void 0===d||null===d?b(c):"true"===d}}(window.featureToggleState||{});TradingView.QuoteTabbedWidget=function(a,b,c){this._id=a;this.$container=b;this._tabs=c||b.data("quoteTabs");this.visible=new WatchedValue(!0);this.animationInProcess=new WatchedValue(!0);this._init()};
|
|
TradingView.QuoteTabbedWidget.prototype._init=function(){var a=this;a.$container.empty();a.$container.addClass("quote-tabbed-widget");var b=a.$tabs=$('<div class="tabs"></div>'),c=a.$pages=$('<div class="pages"></div>');a._tabs.forEach(function(a){a.symbols=$.map(a.symbols||[],function(a){if(!a.last||!a.pctchange||!a.pctchangedir)return"undefined"!==typeof a.last&&delete a.last,"undefined"!==typeof a.pctchange&&delete a.pctchange,"undefined"!==typeof a.pctchangedir&&delete a.pctchangedir,a;"down"===
|
|
a.pctchangedir?a.changeColor=TradingView.PriceColorer.formatSign(-1):"up"===a.pctchangedir&&(a.changeColor=TradingView.PriceColorer.formatSign(1));return a});b.append(Mustache.render('<div class="tab">{{title}}</div>',a));a=$(Mustache.render('<div class="page-wrapper"><div class="page"><table>{{#symbols}}<tr data-symbol={{symbol_full}} {{^last}}data-need-quote-ticker=true{{/last}}><td class="name"><a href="/chart/{{short_name}}/" data-symbol={{symbol_full}} class="chart-link{{^symbol}} symbol-short-name{{/symbol}}">{{#symbol}}{{symbol}}{{/symbol}}</a></td><td class="ticker"><span class="symbol-last">{{last}}</span> <span class="symbol-change-pt" {{#changeColor}}style="color: {{changeColor}} "{{/changeColor}}>{{#pctchange}}({{pctchange}}){{/pctchange}}</span></td><td class="chart-cell"><a href="/chart/?symbol={{symbol_full}}" class="chart"></a></td></tr>{{/symbols}}</table></div></div>',
|
|
a));c.append(a)});var d=new A71(b,c,{saveTab:this._activeTabKey()});a._onTabChanged(d.index());d.tabChanged.subscribe(a,a._onTabChanged);var e=$('<div class="tabs-wrapper"></div>');b.appendTo(e);a.$container.append(e);a.$container.append(c);a.visible.subscribe(function(b){a.$pages.children().each(function(c){c=b?d.index()===c:!1;a._setPageActive($(this),c,!0)})});a.animationInProcess.subscribe(function(b){a.$pages.children().each(function(c){(c=$(this).data("chart"))&&(b?c.unbindOnResize():
|
|
a.visible.value()&&c.bindOnResize())})})};TradingView.QuoteTabbedWidget.prototype._onTabChanged=function(a){var b=this;b.$pages.children().each(function(c){b._setPageActive($(this),a===c)})};
|
|
TradingView.QuoteTabbedWidget.prototype._setPageActive=function(a,b,c){function d(){a.find("tr").each(function(b){b=$(this);var c=b.data("symbol");if(c){if(b.data("quoteTicker"))b.data("quoteTicker").enabled=!0;else if(b.data("needQuoteTicker")){var d=new TradingView.QuoteTicker(c,b,{changePercentInBrackets:!0});b.data("quoteTicker",d)}b.data("chart")?b.data("chart").connect():(c=new TradingView.MiniChart(c,b.find(".chart"),{minHeight:18,showMessage:!1,onlyLastBars:30,timeframe:{value:"1m"},chartOptions:{grid:{xIsVisible:!1,
|
|
yIsVisible:!1},xScale:{visible:!1},yScale:{visible:!1},plot:{line:{color:"#2e5c75",width:1},belowLineFillStyle:"rgba(46,94,117, 0.2)"}}}),a.resize(c.widget.onResize),b.data("chart",c))}})}function e(){a.find("tr").each(function(a){a=$(this);a.data("quoteTicker")&&(a.data("quoteTicker").enabled=!1);a.data("chart")&&a.data("chart").disconnect()})}b?(clearTimeout(a.data("turnOffTimeout")),d()):a.data("turnOffTimeout",setTimeout(function(){e()},1E3*(c?0:60)))};
|
|
TradingView.QuoteTabbedWidget.prototype._activeTabKey=function(){return"undefined"!==typeof this._id?"marketsummary.quotestabbedwidget."+this._id+".activetabindex":null};$(function(){var a=$("#market-summary-header"),b=$("#market-summary-body");a.length&&b.length&&(TradingView.marketSummary=new TradingView.MarketSummary(a,b))});
|
|
TradingView.MarketSummary=function(a,b){this.$button=$(".market-summary-toggle");this.$header=a;this.$body=b;this.animationInProcess=new WatchedValue(!1);this.bodyIsVisible=new WatchedValue(!1);this.toggled=new Delegate;this.initHeader();this.$button.click(this.toggle.bind(this));this.toggle(TVSettings.getBool("marketsummary.opened",!0));loginStateChange.subscribe(this,function(){is_authenticated&&this.toggle(TVSettings.getBool("marketsummary.opened",!0))})};
|
|
TradingView.MarketSummary.POPULAR_QUOTES_TABED_WIDGET=0;TradingView.MarketSummary.ACTIVE_QUOTES_TABED_WIDGET=1;TradingView.MarketSummary.prototype.initHeader=function(){this._initQouteTickers();this._bindChartSearchToLinks()};
|
|
TradingView.MarketSummary.prototype.toggle=function(a){function b(){c.animationInProcess.setValue(!1);c.toggled.fire(d)}var c=this;if(!c.animationInProcess.value()){c.animationInProcess.setValue(!0);c.$button.toggleClass("opened",a);var d=c.$button.hasClass("opened");d?c.$body.slideDown(function(){b();c.chart()||c._initChart();c.activeQuotes()||c._initActiveQuotes();c.popularQuotes()||c._initPopularQuotes()}.bind(c)):c.$body.slideUp(b);c.bodyIsVisible.setValue(d);TVSettings.setValue("marketsummary.opened",
|
|
d)}};TradingView.MarketSummary.prototype._initQouteTickers=function(){this.$header.find(".market-summary-quote-ticker").each(function(){var a=$(this);new TradingView.QuoteTicker(a.data("symbol"),a)})};TradingView.MarketSummary.prototype.chart=function(){return this._chart};TradingView.MarketSummary.prototype.activeQuotes=function(){return this._activeQuotes};TradingView.MarketSummary.prototype.popularQuotes=function(){return this._popularQuotes};
|
|
TradingView.MarketSummary.prototype._initChart=function(){function a(a,b){"boolean"!==typeof b&&(b=!a.hasClass("chart-legend-colored"));var c=a.data();a.find("a").css("border-left-color",b?c.color:"transparent");a.toggleClass("chart-legend-colored",b)}for(var b=this,c=[],d=b.$header.find(".market-summary-quote-ticker.chart-legend"),e=0;e<d.length;e++){var f=d.eq(e),g=f.data();c.push({symbol:g.symbol,options:{line:{color:g.color}}});a(f,!0)}b._chart=new TradingView.MiniChart(c,b.$body.find(".tickers-chart"),
|
|
{showMessage:!1,timeframe:{visible:!0,value:"5y"},showTimeframes:!0,chartOptions:{minHeight:18,grid:{xIsVisible:!1,yIsVisible:!0,line:{width:1,style:CanvasEx.LINESTYLE_DASHED,color:"#3a3b43"}},yScale:{visible:!0,position:"right",isPercentage:!0,paddingLeft:10,paddingRight:4,marginInPercents:10,font:{size:10,family:"Helvetica",color:"#57585d"},drawOverPlotArea:!1,drawTickMarkLine:!1,maxTickMarkAmount:5},xScale:{visible:!1},plot:{line:{width:2},belowLineFillStyle:"transparent",aboveLineFillStyle:"transparent"},
|
|
loading:{showWhileNoPlots:!0}}});b.bodyIsVisible.subscribe(function(c){c?b._chart.connect():b._chart.disconnect();d.each(function(){a($(this),c)})});b.animationInProcess.subscribe(function(a){a?b._chart.widget().unbindOnResize():b.bodyIsVisible.value()&&b._chart.widget().bindOnResize()})};TradingView.MarketSummary.prototype._initActiveQuotes=function(){this._activeQuotes=this._createQuotesWidget(TradingView.MarketSummary.ACTIVE_QUOTES_TABED_WIDGET,this.$body.find(".active-quotes"))};
|
|
TradingView.MarketSummary.prototype._initPopularQuotes=function(){this._popularQuotes=this._createQuotesWidget(TradingView.MarketSummary.POPULAR_QUOTES_TABED_WIDGET,this.$body.find(".populars-quotes"))};TradingView.MarketSummary.prototype._createQuotesWidget=function(a,b){var c=new TradingView.QuoteTabbedWidget(a,b);this.bodyIsVisible.subscribe(function(a){c.visible.setValue(a)});this.animationInProcess.subscribe(function(a){c.animationInProcess.setValue(a)});this._bindChartSearchToLinks();return c};
|
|
TradingView.MarketSummary.prototype._bindChartSearchToLinks=function(a,b){this.$header.add(this.$body).find("a.chart-link:not(.inited)").addClass("inited").click(function(a){if(TradingView.searchCharts&&TradingView.searchCharts.queryField&&TradingView.searchCharts.form){var b=$(this).data("symbol");b&&(TradingView.searchCharts.queryField.val(b).change(),TradingView.searchCharts.form.submit(),a.preventDefault())}})};TradingView.DetailSearchWidget=function(a,b,c){this._id=TradingView.guid();this._options=c||{};this.elements=b||{};this._volumeFormatter=new TradingView.VolumeFormatter;this.setSymbol(a)};TradingView.DetailSearchWidget.prototype.setSymbol=function(a){a==this._symbol&&this._subscribed||(this._subscribed&&this.unsubscribe(),this._symbol=a,this.subscribe())};
|
|
TradingView.DetailSearchWidget.prototype.subscribe=function(){this._symbol&&(quoteSessionMultiplexerInstance.full.subscribe(this._id,this._symbol,this.onData.bind(this)),this._subscribed=!0)};TradingView.DetailSearchWidget.prototype.unsubscribe=function(){this._subscribed&&(quoteSessionMultiplexerInstance.full.unsubscribe(this._id,this._symbol),this._subscribed=!1)};
|
|
TradingView.DetailSearchWidget.prototype.onData=function(a,b){switch(a.status){case "ok":this.successData(a);break;case "permission_denied":this.downgradeData(a);break;case "error":this.errorData(a)}};TradingView.DetailSearchWidget.prototype.successData=function(a){switch(a.values.symbol_status){case "realtime":case "realtime_data":case "realtime_fundamental":this.renderData(a)}};TradingView.DetailSearchWidget.prototype.downgradeData=function(a){console.warn("downgradeData")};
|
|
TradingView.DetailSearchWidget.prototype.errorData=function(a){this.unsubscribe();this.findElement(".error").text("Invalid symbol "+this._symbol);console.warn("[Detail Search Widget] invalid symbol: "+this._symbol)};
|
|
TradingView.DetailSearchWidget.prototype.renderData=function(a){var b=this,c=!1;Object.keys(this.elements).forEach(function(d){var e=b.findElement(d),f,g,h;if(e&&e.length&&(f=a.values[d]||"---",h=b.format(f),g=e.text(),h!=g))switch(c=!0,d){case "web_site_url":h=/http(s)?:\/\//.test(h)?h.replace(/http(s)?:\/\//,""):h;h=/\/$/.test(h)?h.replace(/\/$/,""):h;e.text(h);"---"===f?e.removeAttr("href"):e.attr("href",/http(s)?:\/\//.test(f)?f:"http://"+f);break;default:e.text(h),void 0!==e.attr("title")&&e.attr("title",
|
|
h)}});if(c&&"function"===typeof this._options.onDataRendered)this._options.onDataRendered(a)};TradingView.DetailSearchWidget.prototype.findElement=function(a){return this.elements[a]};TradingView.DetailSearchWidget.prototype.format=function(a){var b=parseFloat(a);return TradingView.isNaN(b)?a:TradingView.isInteger(b)?this._volumeFormatter.format(b):b};TradingView.Symbology=function(){};TradingView.Symbology.prototype.convertTo=function(a,b,c){return a};TradingView.Symbology.prototype.convertFrom=function(a){return a};TradingView.YahooSymbology=function(){this.specialFromCases={};for(var a in this.specialCases)this.specialFromCases[this.specialCases[a]]=a;this.exchangeFromMap={};for(a in this.exchangeMap)this.exchangeFromMap[this.exchangeMap[a]]=a};inherit(TradingView.YahooSymbology,TradingView.Symbology);
|
|
TradingView.YahooSymbology.prototype.convertTo=function(a,b,c){return a in this.specialCases?this.specialCases[a]:"forex"==b?a+"=X":"TSX"==c?a+".TO":"TSXV"==c?a+".V":"MICEX"==c?a+".ME":"COMEX"==c?a+".CMX":"CME"==c?a+".CME":"CBOT"==c?a+".CBT":"MOEX"==c?a+".ME":"index"==b?"^"+a:a};TradingView.YahooSymbology.prototype.convertFrom=function(a){if(a in this.specialFromCases)return this.specialFromCases[a];var b=a.split("."),c=b[1];return c?(a=this.exchangeFromMap["."+c])?a+":"+b[0]:null:a};
|
|
TradingView.YahooSymbology.prototype.exchangeFromMap={};TradingView.YahooSymbology.prototype.exchangeMap={TSX:".TO",TSXV:".V",MICEX:".ME",COMEX:".CMX",CME:".CME",CBOT:".CBT"};TradingView.YahooSymbology.prototype.specialFromCases={};TradingView.YahooSymbology.prototype.specialCases={ESP35:"^IBEX",FRA40:"^FCHI",GER30:"^GDAXI",JPN225:"^N225",NAS100:"^NDX",SPX500:"SPY",SUI30:"^SSMI",UK100:"^FTSE",FTSE:"^DJI",USDOLLAR:"^USDOLLAR",DOWI:"^DJI",DOWT:"^DJT",DOWU:"^DJU"};TradingView.StockTwitsSymbology=function(){};inherit(TradingView.StockTwitsSymbology,TradingView.Symbology);TradingView.StockTwitsSymbology.prototype.convertTo=function(a,b,c){return"futures"==b?a+"_F":a};TradingView.NewsProvider=function(a){if(!this.isValidProvider(a))throw new TypeError("Invalid provider: "+a);this._provider=new this.providers[a];this._baseURL=this._BASE_URL+a+"/"};TradingView.NewsProvider.prototype.isValidProvider=function(a){return a in this.providers};
|
|
TradingView.NewsProvider.prototype.providers={yahoo:function(){this.symbology=new TradingView.YahooSymbology},stocktwits:function(){this.symbology=new TradingView.StockTwitsSymbology},fxwirepro:function(){this.symbology=new TradingView.Symbology;this.package_name="tv-fxwirepro";this.feed_realtime="fxwirepro_realtime";this.feed_delayed="fxwirepro_delayed"},futuresmag:function(){this.symbology=new TradingView.Symbology}};
|
|
TradingView.NewsProvider.prototype._BASE_URL=R77.enabled("trading_terminal")?"https://www.tradingview.com/headlines/":"/headlines/";TradingView.NewsProvider.prototype.getURLforSymbol=function(a,b,c){a=this.convertSymbol(a,b,c);return this._baseURL+"symbol/"+a+"/"};TradingView.NewsProvider.prototype.convertSymbol=function(a,b,c){return this.getProvider().symbology.convertTo(a,b,c)};TradingView.NewsProvider.prototype.getURLforCategory=function(a){return this._baseURL+"category/"+a+"/"};
|
|
TradingView.NewsProvider.prototype.getURLforSpread=function(a){a=a.join(",");return this._baseURL+"spread/"+a+"/"};TradingView.NewsProvider.prototype.getBySymbol=function(a,b,c){var d=this.getProvider(),e="",e=$.isFunction(d.getURLforSymbol)?d.getURLforSymbol(a,b,c):this.getURLforSymbol(a,b,c);return $.ajax(e,{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
|
|
TradingView.NewsProvider.prototype.getBySpread=function(a,b,c){var d=this.getProvider();a=a.map(function(a,d){a=A68.ticker(a);return d?a:this.convertSymbol(a,b,c)}.bind(this));var e="",e=$.isFunction(d.getURLforSpread)?d.getURLforSpread(a,b,c):this.getURLforSpread(a);return $.ajax(e,{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
|
|
TradingView.NewsProvider.prototype.getByCategory=function(a){var b=this.getProvider();$.isFunction(b.getURLforCategory)?b.getURLforCategory(a):this.getURLforCategory(a);return $.ajax(this.getURLforCategory(a),{type:"GET",dataType:"json"}).pipe(this._onReceived.bind(this))};
|
|
TradingView.NewsProvider.prototype._onReceived=function(a){if(a)return a.forEach(function(a){a.published=new Date(1E3*a.published)}),$.isFunction(this.getProvider().itemTransform)?a.map(this.getProvider().itemTransform,this._provider):a};TradingView.NewsProvider.prototype.init=function(a){var b=this.getProvider();$.isFunction(b.init)&&b.init(this,a)};TradingView.NewsProvider.prototype.update=function(a){$.isFunction(this.getProvider().update)&&this.getProvider().update(a)};
|
|
TradingView.NewsProvider.prototype.destroy=function(){$.isFunction(this.getProvider().destroy)&&this.getProvider().destroy();this.getProvider().$message instanceof $&&this.getProvider().$message.remove()};TradingView.NewsProvider.prototype.options=function(a){return $.isFunction(this.getProvider().getOptions)?this.getProvider().getOptions(a):!1};TradingView.NewsProvider.prototype.getProvider=function(){return this._provider};
|
|
TradingView.NewsProvider.prototype.providers.yahoo.prototype.init=function(a,b){this._newsWidget=b.newsWidget;this._providerBase=a};TradingView.NewsProvider.prototype.providers.yahoo.prototype.getURLforSymbol=function(a,b,c){return"MTGOX"==c?this._providerBase.getURLforCategory("bitcoin"):"futures"!=b&&"cfd"!=b||a in this.symbology.specialCases?this._providerBase.getURLforSymbol(a,b,c):this._providerBase.getURLforCategory("futures")};
|
|
TradingView.NewsProvider.prototype.providers.yahoo.prototype.getURLforSpread=function(a,b,c){return"MTGOX"==c?this.getByCategory("bitcoin"):"futures"==b||"cfd"==b?this.getByCategory("futures"):this._providerBase.getURLforSpread(a)};TradingView.NewsProvider.prototype.providers.yahoo.prototype.itemTransform=function(a){return{id:a.id,link:a.link,published:a.published,title:a.title,source:this.getSource(a)}};
|
|
TradingView.NewsProvider.prototype.providers.yahoo.prototype.getSource=function(a){var b=a.summary&&a.summary.match(/\[[^\-]+\]/g);if(b)return b[0].replace(/\[(at )?|\]/g,"");for(var c in this.NewsSources)if(~a.link.indexOf(c))return this.NewsSources[c];return"Yahoo Finance"};
|
|
TradingView.NewsProvider.prototype.providers.yahoo.prototype.NewsSources={"allthingsd.com":"AllThingsD","ap.org":"AP","bankrate.com":"Bankrate.com","barrons.com":"Barrons.com","bizjournals.com":"Business Journals","bloomberg.com":"Bloomberg","businessinsider.com":"Business Insider","businesswire.com":"Business Wire","businessweek.com":"BusinessWeek","cnbc.com":"CNBC","cnnmoney.com":"CNNMoney.com","newswire.ca":"CNW Group",consumerreports:"Consumer Reports",creditcards:"CreditCards.com","dailyfx.com":"DailyFX",
|
|
"entrepreneur.com":"Entrepreneur",etfdb:"ETF Database",etftrends:"ETF Trends",etfguide:"ETFguide",etfzone:"ETFZone","ft.com":"Financial Times","forbes.com":"Forbes","fortune.cnn.com":"Fortune","foxbusiness.com":"Fox Business","futuresmag.com":"Futuresmag.com",gftforex:"GFT Forex","globenewswire.com":"GlobeNewswire",indieresearch:"IndieResearch",indexuniverse:"IndexUniverse.com","investopedia.com":"Investopedia","investors.com":"Investor's Business Daily",kiplinger:"Kiplinger","marketwatch.com":"MarketWatch",
|
|
marketwire:"Marketwire",minyanville:"Minyanville","money.cnn.com":"Money",morningstar:"Morningstar","fool.com":"Motley Fool","nytimes.com":"New York Times","oilprice.com":"Oilprice.com",optionetics:"Optionetics",optionmonster:"optionMONSTER","paidcontent.org":"paidContent.org",newswire:"PR Newswire","reuters.com":"Reuters","seekingalpha.com":"Seeking Alpha","smallcapinvestor.com":"SmallCapInvestor.com",smartmoney:"SmartMoney",atlantic:"The Atlantic","wsj.com":"The Wall Street Journal","theflyonthewall.com":"Theflyonthewall.com",
|
|
"thestreet.com":"TheStreet",thomsonreuters:"Thomson Reuters ONE",usnews:"US News & World Report","wallstcheatsheet.com":"Wall St. Cheat Sheet",transcript:"Wall Street Transcript",zacks:"Zacks"};TradingView.NewsProvider.prototype.providers.yahoo.prototype.update=function(a){a=TradingView.NewsWidget.prototype.providers.yahoo.title;this._newsWidget._quoteMetaInfo&&this._newsWidget._quoteMetaInfo.name&&(a+=" "+$.t("for")+" "+this._newsWidget._quoteMetaInfo.name);this._newsWidget._bridge.setTitle(a)};
|
|
TradingView.NewsProvider.prototype.providers.stocktwits.prototype.init=function(a,b){this._newsWidget=b.newsWidget};TradingView.NewsProvider.prototype.providers.stocktwits.prototype.update=function(a){a=TradingView.NewsWidget.prototype.providers.stocktwits.title;this._newsWidget._quoteMetaInfo&&this._newsWidget._quoteMetaInfo.name&&(a+=" "+$.t("for")+" "+this._newsWidget._quoteMetaInfo.name);this._newsWidget._bridge.setTitle(a)};
|
|
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.init=function(a,b){this._pushstream_channel=this.feed_realtime;this._providerBase=a;this._newsWidget=b.newsWidget;this.currencies={};pro.hasPackage(this.package_name)||(this._pushstream_channel=this.feed_delayed,this._newsWidget.D2.value().delayedWarningShown||(this.showDelayedWarning(),this._newsWidget.updateProperties({delayedWarningShown:!0})));this.setTitle();TradingView.pushStreamMultiplexer.on(this._pushstream_channel,
|
|
function(a){a=this.filterNews(a);if(b.onData)b.onData(a,{incremental:!0})}.bind(this))};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getURLforSymbol=function(a,b,c){a=this._providerBase.convertSymbol(a,b,c);b=pro.hasPackage(this.package_name)?this.feed_realtime:this.feed_delayed;return this._providerBase._BASE_URL+b+"/symbol/"+a+"/"};
|
|
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getURLforSpread=function(a,b,c){b=pro.hasPackage(this.package_name)?this.feed_realtime:this.feed_delayed;a=a.join(",");return this._providerBase._BASE_URL+b+"/spread/"+a+"/"};
|
|
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.update=function(a){this.currencies={};if(Array.isArray(a))for(var b=0;b<a.length;b++)this.currencies[a[b].substr(0,3)]=1,this.currencies[a[b].substr(3,3)]=1;else this.currencies[a.substr(0,3)]=1,this.currencies[a.substr(3,3)]=1};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.destroy=function(){TradingView.pushStreamMultiplexer.off(this._pushstream_channel)};
|
|
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.filterNews=function(a){return a.filter(function(a){a.published=new Date(1E3*a.published);return""===a.currency||a.currency in this.currencies},this)};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.showAboutDialog=function(){pro.showProductDialog(this.package_name)};
|
|
TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.showDelayedWarning=function(){var a=$('<div class="widgetbody-overlay"><span class="ns-fxwire-message-close"></span><div class="ns-fxwire-message"><h3>This is delayed news feed</h3><p>This is delayed FxWire PRO news feed. Want real-time updates and more features?</p><a href="#">Learn More</a></div></div>').appendTo(this._newsWidget._bridge.$body);a.find(".ns-fxwire-message a").click(function(){this.showAboutDialog();a.remove()}.bind(this));
|
|
a.find(".ns-fxwire-message-close").click(function(){a.remove()});this.$message=a};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.setTitle=function(a){a="FxWire Pro "+(pro.hasPackage(this.package_name)?"Realtime":"Delayed");this._newsWidget._bridge.setTitle(a)};TradingView.NewsProvider.prototype.providers.fxwirepro.prototype.getOptions=function(){return[{title:"About and Subscription",action:this.showAboutDialog.bind(this)}]};
|
|
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.categories={all:"All Content",news:"News","market-analysis":"Market Analysis","trading-strategies":"Trading Strategies",blogs:"Blogs",commodities:"Commodities",forex:"Forex",options:"Options"};TradingView.NewsProvider.prototype.providers.futuresmag.prototype.getURLforSymbol=function(a,b,c){return this._providerBase.getURLforCategory(this._category)};
|
|
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.init=function(a,b){this._news=b.newsWidget;this._providerBase=a;this.setCategory(this._news.D2.value()&&this._news.D2.value().category||"all",!0)};TradingView.NewsProvider.prototype.providers.futuresmag.prototype.setCategory=function(a,b){this._category=a;this._news.updateProperties({category:a});this._news._bridge.setTitle($.t("Futures Magazine")+" - "+$.t(this.categories[a]));b||this._news.update()};
|
|
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.getOptions=function(){function a(a){return function(){this.setCategory(a)}.bind(this)}var b=[],c;for(c in this.categories)b.push({title:this.categories[c],action:a.call(this,c),active:c==this._category});b.push({separator:1});b.push({title:"About",action:this.showAboutDialog.bind(this)});return b};
|
|
TradingView.NewsProvider.prototype.providers.futuresmag.prototype.showAboutDialog=function(){A83.showNotice("About Futuresmag News Feed","For 40 years Futures has been a thought leader and independent voice of the commodity, futures, options, forex and stock trader.")};A45=function(){function a(a,l){function p(r){function v(b){if(R77.enabled("same_data_requery")||E.value()!==b)l?l.setSymbol(b):a.setSymbol(b)}function w(){b.setValue(E.value())}function u(){d.setValue(y.actualSymbol())}function x(){c.setValue(D.shortName.value());var a=y.symbolInfo();a?(u(),a.hasOwnProperty("supported_resolutions")?g.setValue(a.supported_resolutions):g.setValue(void 0),f.setValue(!!a.has_intraday)):f.deleteValue()}function C(b){if(R77.enabled("same_data_requery")||
|
|
z.value()!==b)l?l.setResolution(b):a.setResolution(b)}function A(){e.setValue(z.value())}a.modelCreated().unsubscribe(null,p);var y=a.model().mainSeries(),D=y.properties(),E=D.symbol;E.subscribe(null,w);b.setValue(E.value());b.subscribe(v);y.onSymbolResolved().subscribe(null,u);b.hook=function(a){y.symbolSameAsCurrent(a)&&(a=y.actualSymbol());return a};y.onSymbolResolved().subscribe(null,x);y.onSymbolError().subscribe(null,x);x();var z=D.interval;z.subscribe(null,A);e.setValue(z.value());e.subscribe(C);
|
|
a.readOnly()&&(b.writeLock=!0);h=function(){E.unsubscribe(null,w);b.unsubscribe(v);y.onSymbolResolved().unsubscribe(null,x);y.onSymbolError().unsubscribe(null,x);z.unsubscribe(null,A);e.unsubscribe(C);delete b.hook;delete b.writeLock;h=function(){};k=function(){}}}h();k=function(){return a};var r=a.model();r?p(r):(a.modelCreated().subscribe(null,p),h=function(){a.modelCreated().unsubscribe(null,p);h=function(){};k=function(){}},r=a.properties().mainSeriesProperties,b.setValue(r.symbol.value()),e.setValue(r.interval.value()))}
|
|
var b=new WatchedValue,c=new WatchedValue,d=new WatchedValue,e=new WatchedValue,f=new WatchedValue,g=new WatchedValue,h=function(){},k=function(){},l=function(){};return{symbol:b,actualSymbol:d,seriesShortSymbol:c.readonly(),interval:e,intraday:f.readonly(),supportedResolutions:g.readonly(),bindToChartWidget:a,unbindFromChartWidget:function(){h()},getChartWidget:function(){return k()},bindToSearchCharts:function(a){function c(a){e=!0;b.setValue(a.resolved_symbol);e=!1}function d(b){e||a.search(b)}
|
|
l();var e=!1;a.onSearchBySymbol.subscribe(null,c);b.subscribe(d);l=function(){a.onSearchBySymbol.unsubscribe(null,c);b.unsubscribe(d);l=function(){}}},unbindFromSearchCharts:function(){l()},bindToChartWidgetCollection:function(b){h();b.activeChartWidget.subscribe(function(c){h();a(c,b)},{callWithLast:!0})}}}();function linkingSetSymbol(a){a&&"string"===typeof a&&($(".header-chart-panel .symbol-edit-wrap input").val(A68.shortName(a)),A45.symbol.setValue(a))};(function(a){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var b=function(b){return(a.devicePixelRatio||1)/(b.backingStorePixelRatio||b.webkitBackingStorePixelRatio||b.mozBackingStorePixelRatio||b.msBackingStorePixelRatio||b.oBackingStorePixelRatio||b.backingStorePixelRatio||1)}(document.createElement("canvas").getContext("2d"));2>b||(a.hidpiCanvasRatio=b,function(a){a.drawImagePatchedSource=a.drawImage;a.drawImagePatchedSourceAndDest=a.drawImage;(function(a,b){for(var c in a)a.hasOwnProperty(c)&&
|
|
b(a[c],c)})({fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4],drawImagePatchedSourceAndDest:[1,2,3,4,5,6,7,8]},function(d,e){var f=a[e];a[e]=function(){var a,c;if("all"===d)for(c=[],a=arguments.length;0<a--;)c[a]=arguments[a]*b;else for(c=Array.prototype.slice.call(arguments),
|
|
a=d.length;0<a--;)c[d[a]]&&(c[d[a]]*=b);return f.apply(this,c)}});a.drawImage=function(a){return function(){return arguments[0]instanceof HTMLCanvasElement?a.drawImagePatchedSourceAndDest.apply(this,arguments):a.drawImagePatchedSource.apply(this,arguments)}}(a);a.fillText=function(a){return function(){var c=Array.prototype.slice.call(arguments);c[1]*=b;c[2]*=b;this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c*b+d});a.apply(this,c);this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,
|
|
function(a,c,d){return c/b+d})}}(a.fillText);a.strokeText=function(a){return function(){var c=Array.prototype.slice.call(arguments);c[1]*=b;c[2]*=b;this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c*b+d});a.apply(this,c);this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(a,c,d){return c/b+d})}}(a.strokeText)}(CanvasRenderingContext2D.prototype),function(a){a.getContext=function(a){return function(c){var f=a.call(this,c);"2d"===c&&this.width!=Math.floor(parseInt(this.style.width)*
|
|
b)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=b,this.height*=b);return f}}(a.getContext)}(HTMLCanvasElement.prototype))}})(window);!function(a,b){"object"==typeof exports?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Spinner=b()}(this,function(){function a(a,b){var c,d=document.createElement(a||"div");for(c in b)d[c]=b[c];return d}function b(a){for(var b=1,c=arguments.length;c>b;b++)a.appendChild(arguments[b]);return a}function c(a,b,c,d){var e=["opacity",b,~~(100*a),c,d].join("-");c=.01+c/d*100;d=Math.max(1-(1-a)/b*(100-c),a);var f=l.substring(0,l.indexOf("Animation")).toLowerCase();return n[e]||(p.insertRule("@"+
|
|
(f&&"-"+f+"-"||"")+"keyframes "+e+"{0%{opacity:"+d+"}"+c+"%{opacity:"+a+"}"+(c+.01)+"%{opacity:1}"+(c+b)%100+"%{opacity:"+a+"}100%{opacity:"+d+"}}",p.cssRules.length),n[e]=1),e}function d(a,b){var c,d,e=a.style;b=b.charAt(0).toUpperCase()+b.slice(1);for(d=0;d<m.length;d++)if(c=m[d]+b,void 0!==e[c])return c;return void 0!==e[b]?b:void 0}function e(a,b){for(var c in b)a.style[d(a,c)||c]=b[c];return a}function f(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)void 0===a[d]&&(a[d]=
|
|
c[d])}return a}function g(a,b){return"string"==typeof a?a:a[b%a.length]}function h(a){this.opts=f(a||{},h.defaults,r)}function k(){function c(b,d){return a("<"+b+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',d)}p.addRule(".spin-vml","behavior:url(#default#VML)");h.prototype.lines=function(a,d){function f(){return e(c("group",{coordsize:m+" "+m,coordorigin:-l+" "+-l}),{width:m,height:m})}function h(a,k,m){b(n,b(e(f(),{rotation:360/d.lines*a+"deg",left:~~k}),b(e(c("roundrect",{arcsize:d.corners}),
|
|
{width:l,height:d.width,left:d.radius,top:-d.width>>1,filter:m}),c("fill",{color:g(d.color,a),opacity:d.opacity}),c("stroke",{opacity:0}))))}var k,l=d.length+d.width,m=2*l;k=2*-(d.width+d.length)+"px";var n=e(f(),{position:"absolute",top:k,left:k});if(d.shadow)for(k=1;k<=d.lines;k++)h(k,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(k=1;k<=d.lines;k++)h(k);return b(a,n)};h.prototype.opacity=function(a,b,c,d){a=a.firstChild;d=d.shadow&&d.lines||0;a&&b+
|
|
d<a.childNodes.length&&(a=a.childNodes[b+d],a=a&&a.firstChild,a=a&&a.firstChild,a&&(a.opacity=c))}}var l,m=["webkit","Moz","ms","O"],n={},p=function(){var c=a("style",{type:"text/css"});return b(document.getElementsByTagName("head")[0],c),c.sheet||c.styleSheet}(),r={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2E9,className:"spinner",top:"50%",left:"50%",position:"absolute"};h.defaults={};f(h.prototype,{spin:function(b){this.stop();
|
|
var c=this,d=c.opts,f=c.el=e(a(0,{className:d.className}),{position:d.position,width:0,zIndex:d.zIndex});d.radius+d.length+d.width;if(e(f,{left:d.left,top:d.top}),b&&b.insertBefore(f,b.firstChild||null),f.setAttribute("role","progressbar"),c.lines(f,c.opts),!l){var g,h=0,k=(d.lines-1)*(1-d.direction)/2,m=d.fps,n=m/d.speed,p=(1-d.opacity)/(n*d.trail/100),r=n/d.lines;!function Q(){h++;for(var a=0;a<d.lines;a++)g=Math.max(1-(h+(d.lines-a)*r)%n*p,d.opacity),c.opacity(f,a*d.direction+k,g,d);c.timeout=
|
|
c.el&&setTimeout(Q,~~(1E3/m))}()}return c},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=void 0),this},lines:function(d,f){function h(b,c){return e(a(),{position:"absolute",width:f.length+f.width+"px",height:f.width+"px",background:b,boxShadow:c,transformOrigin:"left",transform:"rotate("+~~(360/f.lines*m+f.rotate)+"deg) translate("+f.radius+"px,0)",borderRadius:(f.corners*f.width>>1)+"px"})}for(var k,m=0,n=(f.lines-1)*(1-f.direction)/
|
|
2;m<f.lines;m++)k=e(a(),{position:"absolute",top:1+~(f.width/2)+"px",transform:f.hwaccel?"translate3d(0,0,0)":"",opacity:f.opacity,animation:l&&c(f.opacity,f.trail,n+m*f.direction,f.lines)+" "+1/f.speed+"s linear infinite"}),f.shadow&&b(k,e(h("#000","0 0 4px #000"),{top:"2px"})),b(d,b(k,h(g(f.color,m),"0 0 1px rgba(0,0,0,.1)")));return d},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}});var t=e(a("group"),{behavior:"url(#default#VML)"});return!d(t,"transform")&&
|
|
t.adj?k():l=d(t,"animation"),h});TradingView.IntervalHelper=function(){var a={},b=/^(\d*)([DWM])$/;a.isDWM=function(a){return(a=b.exec(a+""))?{qty:a[1]||"1",unit:a[2]}:!1};a.isAvailable=function(a){var b=A45.supportedResolutions.value(),e=!1,e="undefined"!=typeof b?-1!=b.indexOf(a):!0;return A45.intraday.value()?e:this.isDWM(a)&&e};a.isMinute=function(a){a=parseInt(a);return 1<=a&&1440>=a};a.isHour=function(a){return 60<=a&&!(a%60)};return a}();TradingView.DesktopNotification=function(){function a(){return window.Notification&&window.Notification.permissionLevel?window.Notification.permissionLevel():window.Notification.permission}function b(b){var c=a();"granted"==c&&"function"==typeof b?b():"default"==c&&window.Notification.requestPermission(function(a){"granted"==a&&"function"==typeof b&&b()})}function c(a,b){var c=new window.Notification(a,{body:40<b.length?b.substring(0,40)+"...":b,icon:"/static/images/desktop-notification.png"});c.onclick=
|
|
function(){window.focus()};setTimeout(c.close.bind(c),5E3);return c}function d(d,h){"denied"!=a()&&b(function(){localStorage.setItem(e+f,document.hidden);TVXWindowEvents.emit("desktop-notification-tab-visibility-request");setTimeout(function(){"false"!=localStorage.getItem(e+f)&&document.hidden&&c(d,h)},100)})}localStorage.setItem(e+f,document.hidden);var e="tvdesktopnotifications.",f="tabs-hidden";TVXWindowEvents.on("desktop-notification-tab-visibility-request",function(){"true"==localStorage.getItem(e+
|
|
f)&&localStorage.setItem(e+f,document.hidden)});return window.Notification?{show:d,askPermission:b}:{show:function(){},askPermission:function(){}}}();TradingView.StudyInputsHelper=function(){function a(a,b){var c=b.slice(0).toLowerCase();if(a){for(var d=0;d<a.size();++d)if(a.item(d).description.toLowerCase()===c||a.item(d).shortDescription.toLowerCase()===c)return a.item(d);throw Error("Can't find metainfo for `"+b+"`");}throw Error("There is no studies metainfo at all");}function b(a){return a.inputs.map(function(a){return{id:a.id,type:a.type,name:a.name}})}function c(c,d,e){function k(a){return a.name.toLowerCase()===p}e=a(e.model().studiesMetaData(),
|
|
c);var l=b(e),m={},n;for(n in d){var p=n.toLowerCase(),r=l.filter(k);0===r.length?console.warn("Uknown input `"+n+"` of `"+c+"`"):(r=r[0],m[r.id]=d[n])}return{id:e.id,name:c,inputs:m}}var d={},e={bool:function(a){return!!a},integer:function(a){return parseInt(a)},"float":function(a){return parseFloat(a)},string:function(a){return a}};d.getStudyRecordFromArray=function(c,d){d=d||D3;var h;var k=d;if(Array.isArray(c)){var l=c.slice(0);h=l[0];for(var k=a(k.model().studiesMetaData(),h),m=k.is_price_study,
|
|
n=b(k),p,l=l.splice(1),r=0;r<l.length;++r)p||(p={}),p[n[r].id]=(e[n[r].type]||e.string)(l[r]);h={id:k.id,name:h,overlay:m,inputs:p}}else k=a(k.model().studiesMetaData(),c),h={id:k.id,overlay:k.is_price_study};return h};d.getStudyRecordFromObject=function(a,b,d){d=d||D3;return c(a,b,d)};return d}();A82.ChartapiMessager=function(a,b){this._server=a;this._session=b;this._timezone=null;this._isDWM=!1};A82.ChartapiMessager.prototype._userTimezone=function(){return this._timezone};A82.ChartapiMessager.prototype.setTimezone=function(a){this._timezone="exchange"==a?"exchange":PineJsCalendar.get_timezone(a)};A82.ChartapiMessager.prototype.setResolution=function(a){this._isDWM=TradingView.IntervalHelper.isDWM(a)};
|
|
A82.ChartapiMessager.prototype.onRequestMetadata=function(a,b){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSymbolResolved=function(a,b){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSymbolError=function(a,b){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,a,b]})};
|
|
A82.ChartapiMessager.prototype.onStudyError=function(a,b){this._server.receiveLocalResponse({method:"study_error",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSeriesLoading=function(a,b){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSeriesCompleted=function(a,b,c){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,a,c,b]})};
|
|
A82.ChartapiMessager.prototype.onSeriesError=function(a,b){this._server.receiveLocalResponse({method:"series_error",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onSeriesClearData=function(a,b){var c={};c[a]={series:[],turnaround:b};this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,c,{index:0,zoffset:0,changes:[],marks:[]}]})};
|
|
A82.ChartapiMessager.prototype.onStudyCompleted=function(a,b){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,a,b]})};A82.ChartapiMessager.prototype.onStudyLoading=function(a,b){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,a,b]})};
|
|
A82.ChartapiMessager.prototype._calcMarksTime=function(a,b,c,d,e){b=PineJsCalendar.get_timezone(b);var f,g;if(this._isDWM){var h=new PineJsBarBuilder.Session;h.init(b,c);for(g=0;g<a.length;g++)c=a[g],f=d(c),f=PineJsCalendar.utc_to_cal(b,1E3*f),f=h.spec.correctTradingDay(f,b),PineJsCalendar.set_hms(f,0,0,0,0),a[g]=e(c,parseInt(f.valueOf()/1E3))}else for(g=0;g<a.length;g++)a[g]=e(a[g],this.timeInTimezone(d(a[g]),b))};
|
|
A82.ChartapiMessager.prototype.onTickmarksUpdated=function(a,b,c){b=b.slice(0);this._calcMarksTime(b,c.timezone,c.session,function(a){return a},function(a,b){return b});c=[];for(var d=[],e,f=0;f<b.length;++f){var g=b[f];c.push([this._spanByTime(g,e),g,a+f]);d.push(g);e=g}this._server.receiveLocalResponse({method:"tickmark_update",params:[this._session,{index:a,zoffset:0,changes:d,marks:c}]})};
|
|
A82.ChartapiMessager.prototype.onTimescaleUpdate=function(a,b,c,d,e){this._calcMarksTime(c,d.timezone,d.session,function(a){return a.value[0]},function(a,b){a.exTime=b;return a});d={};d[a]={series:c,turnaround:b};a=[];b=[];for(var f=void 0,g=0;g<c.length;++g){var h=c[g].exTime;a.push([this._spanByTime(h,f),h,e+g]);b.push(c[g].value[0]);f=h}this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,d,{index:e,zoffset:0,changes:b,marks:a}]})};
|
|
A82.ChartapiMessager.prototype.onSeriesTimeframeUpdate=function(a,b,c,d,e){this._server.receiveLocalResponse({method:"series_timeframe",params:[this._session,a,b,c,d,e]})};A82.ChartapiMessager.prototype.onPointsetDataUpdate=function(a,b,c,d){this._onDataUpdate(a,b,c,void 0,d,1)};A82.ChartapiMessager.prototype.onDataUpdate=function(a,b,c,d,e){this._onDataUpdate(a,b,c,d,e,0)};
|
|
A82.ChartapiMessager.prototype._onDataUpdate=function(a,b,c,d,e,f){e={};d=d?JSON.stringify({offsets:d}):"";e[a]={s:c,ns:{d:d,indexes:[]},turnaround:b};this._server.receiveLocalResponse({method:"data_update",params:[this._session,e]})};A82.ChartapiMessager.prototype.onQuotesData=function(a){this._server.receiveLocalResponse({method:"quote_symbol_data",params:a})};
|
|
A82.ChartapiMessager.prototype.timeInTimezone=function(a,b){return"exchange"==this._userTimezone()?parseInt(PineJsCalendar.utc_to_cal(b,1E3*a).valueOf()/1E3):parseInt(PineJsCalendar.utc_to_cal(this._userTimezone(),1E3*a).valueOf()/1E3)};
|
|
A82.ChartapiMessager.prototype._spanByTime=function(a,b){var c=[{divisor:1,span:20},{divisor:3E5,span:21},{divisor:18E5,span:22},{divisor:36E5,span:30},{divisor:108E5,span:31},{divisor:216E5,span:32},{divisor:432E5,span:33}];if(b){var d=new Date(1E3*b),e=new Date(1E3*a);if(e.getYear()!=d.getYear())return 70;if(e.getUTCMonth()!=d.getUTCMonth())return 60;if(e.getUTCDate()!=d.getUTCDate())return 50;for(var f=c.length-1;0<=f;--f)if(Math.floor(d/c[f].divisor)!=Math.floor(e/c[f].divisor))return c[f].span}else return 20};
|
|
TradingView.ChartapiMessagerInstances=[];A82.ChartApi=function(a){this._notificationHandlers=[];this._sessions=[];this.studyCounter=0;this._enabled=this._connected=!1;this._studyEngine=new A79(a);this._callbacks={};this._symbolIdCache={};this._seriesIdCache={};this._recentSeriesId=null;this._enableLogging=!1;this._enabledMoreBarsRequest=!0;var b=this;this._studyEngine.on("configuration_received",function(){b._fireEvent("configuration_received")});this._studyEngine.on("realtime_tick",function(a){b._fireEvent("realtime_tick",
|
|
{time:a.value[0]/1E3,open:a.value[1],high:a.value[2],low:a.value[3],close:a.value[4],volume:a.value[5]},!0)});this._autosavePause=void 0;this._setupAutoSave();TradingView.availableTimezones=[{id:"UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")}].concat([{id:"Europe/Athens",title:"Athens"},{id:"Europe/Berlin",title:"Berlin"},{id:"America/Bogota",title:"Bogota"},{id:"Asia/Bangkok",title:"Bangkok"},{id:"America/Argentina/Buenos_Aires",title:"Buenos Aires"},{id:"America/Chicago",title:"Chicago"},
|
|
{id:"Asia/Hong_Kong",title:"Hong Kong"},{id:"Asia/Kolkata",title:"Kolkata"},{id:"Europe/London",title:"London"},{id:"America/Los_Angeles",title:"Los Angeles"},{id:"Europe/Madrid",title:"Madrid"},{id:"Europe/Moscow",title:"Moscow"},{id:"America/New_York",title:"New York"},{id:"Europe/Paris",title:"Paris"},{id:"America/Sao_Paulo",title:"Sao Paulo"},{id:"Asia/Seoul",title:"Seoul"},{id:"Asia/Shanghai",title:"Shanghai"},{id:"Asia/Singapore",title:"Singapore"},{id:"Australia/Sydney",title:"Sydney"},{id:"Asia/Taipei",
|
|
title:"Taipei"},{id:"Asia/Tehran",title:"Tehran"},{id:"Asia/Tokyo",title:"Tokyo"},{id:"America/Toronto",title:"Toronto"},{id:"America/Vancouver",title:"Vancouver"},{id:"Europe/Warsaw",title:"Warsaw"}].map(function(a){a.title=$.t(a.title);return a}).sort(function(a,b){return a.title.localeCompare(b.title)}))};A82.ChartApi.prototype.purgeCache=function(a){this._symbolIdCache={};delete this._recentSeriesId;this._studyEngine.purgeCache();this._studyEngine.purgeRangeExtensionData()};
|
|
A82.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(a){this._enabledMoreBarsRequest=a};A82.ChartApi.prototype.setTimeFramesList=function(a){this._timeframes=[];for(var b=/(\d+)(\w+)/,c=0;c<a.length;++c){var d=a[c],e=b.exec(d.text),f=e[2].toLowerCase(),e=parseInt(e[1]),g="y"==f?12*e+"m":e+f,h=PineJS.Symbol.parsePeriod(d.resolution);this._timeframes.push({text:e+$.t(f,{context:"dates",count:e}),value:g,targetResolution:d.resolution,requiresIntraday:h.isIntraday})}};
|
|
A82.ChartApi.prototype._setupAutoSave=function(){var a=this,b=!1;A77.undoStack().onChange().subscribe(this,function(){a._autosavePause?b=!0:(a._fireEvent("onAutoSaveNeeded",void 0,!0),a._autosavePause=setTimeout(function(){b&&a._fireEvent("onAutoSaveNeeded",void 0,!0);a._autosavePause=void 0;b=!1},5E3))})};A82.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols};
|
|
A82.ChartApi.prototype.availableTimeFrames=function(a,b){return a?this._timeframes.filter(function(b){return b.requiresIntraday&&!a.has_intraday||a.supported_resolutions&&0>a.supported_resolutions.indexOf(b.targetResolution)?!1:!0}):[]};A82.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||{1:1,3:1,5:1,15:1,30:1,45:1,60:1,120:1,180:1,240:1,D:1,W:1,M:1}};A82.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()};
|
|
A82.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()};A82.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()};A82.ChartApi.prototype.start=function(){this._enabled=!0;this._fireEvent("start_enabled")};A82.ChartApi.prototype._logMessage=function(a){this._enableLogging&&console.log(a)};A82.ChartApi.prototype.unsubscribe=function(a,b){var c=this._callbacks[a];c&&c.splice(c.indexOf(b),1)};
|
|
A82.ChartApi.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};A82.ChartApi.prototype._fireEvent=function(a,b,c){if(this._callbacks.hasOwnProperty(a)){var d=this._callbacks[a].slice(0);c||(this._callbacks[a]=[]);for(a=0;a<d.length;++a)d[a](b)}};A82.ChartApi.prototype.setAuthToken=function(a,b){throw"This method is not implemented";};A82.ChartApi.prototype.authTokenRequired=function(a){return!1};
|
|
A82.ChartApi.prototype.chartCreateSession=function(a,b){};A82.ChartApi.prototype.chartDeleteSession=function(a){};A82.ChartApi.prototype.createSession=function(a,b){TradingView.ChartapiMessagerInstances[a]=new A82.ChartapiMessager(this,a);this._sessions[a]=b;this._notificationHandlers[a]=b;if(this.connected())b.onMessage({method:"connected",params:[]})};
|
|
A82.ChartApi.prototype.removeSession=function(a){delete this._sessions[a];delete this._notificationHandlers[a];this.chartDeleteSession(a);this._studyEngine.stopSources()};A82.ChartApi.prototype.connected=function(){return this._connected};A82.ChartApi.prototype._getHost=function(a){return a};A82.ChartApi.prototype._isSafari5=function(){return!!navigator.appVersion.match(/\/5\.[^\/]*?Safari\//)};A82.ChartApi.prototype._isIE9=function(){return!!navigator.appVersion.match(/MSIE 9/)};
|
|
A82.ChartApi.prototype._isIOS5=function(){return!!navigator.appVersion.match(/iPad, CPU 5/)};A82.ChartApi.prototype._getPort=function(a){return this._isSafari5()||this._isIE9()?8081:a};A82.ChartApi.prototype.connect=function(){if(this._enabled)this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}));else{var a=this;this.on("start_enabled",function(){a.connect()})}};
|
|
A82.ChartApi.prototype.disconnect=function(){throw"This method is not implemented";};
|
|
A82.ChartApi.prototype.switchTimezone=function(a,b){TradingView.ChartapiMessagerInstances[a].setTimezone(b);if(this._recentSeriesId){this._studyEngine.purgeEndOfDataFlags(this._recentSeriesId);var c=this;this._doWhenSeriesSymbolIdIsReady(this._recentSeriesId,function(b){var e=c._seriesIdCache[c._recentSeriesId].resolution;c._studyEngine.setDatafeedRequestsAllowed(!1);c._studyEngine.recreateSources(b.name,e,a);c._studyEngine.setDatafeedRequestsAllowed(!0);c._doWhenSeriesDataReceived(function(){var e=
|
|
c._seriesIdCache[c._recentSeriesId].resolution,g=D3.model().mainSeries().data().last();c._studyEngine.rebuildExtrapolatedData(a,b.name,e,b.info,1E3*g.value[0])})})}};A82.ChartApi.prototype.receiveLocalResponse=function(a){this._logMessage("< "+a.method);this._dispathNotification(a);this._fireEvent("message_"+a.method,void 0,!0)};A82.ChartApi.prototype.getMarks=function(a,b,c,d,e){this._studyEngine.getMarks(a,b,c,d,e)};
|
|
A82.ChartApi.prototype.getTimescaleMarks=function(a,b,c,d,e){this._studyEngine.getTimescaleMarks(a,b,c,d,e)};
|
|
A82.ChartApi.prototype.resolveSymbol=function(a,b,c,d,e){function f(b,d){TradingView.ChartapiMessagerInstances[a].onSymbolError(b,d);g._symbolIdCache[b]={name:c,status:"invalid_symbol"};g._fireEvent(b+"_resolve_fail");g._fireEvent("resolve_fail",b)}this._notificationHandlers[a][b]=new TradingView.HandlerInfo(d,b);this._symbolIdCache[b]=null;var g=this;this._studyEngine.resolveSymbol(c,function(d){d.errmsg?f(b,d.errmsg):(g._symbolIdCache[b]={name:c,info:d,status:"ok"},g._fireEvent(b+"_resolved",
|
|
d),g._fireEvent("symbol_resolved",{symbolInfo:d,symbolId:b}),TradingView.ChartapiMessagerInstances[a].onSymbolResolved(b,d))},function(a){f(b,a)})};A82.ChartApi.prototype._doWhenSymbolIdIsReady=function(a,b){function c(){e&&(b({name:d._symbolIdCache[a].name,info:d._symbolIdCache[a].info}),e=!1,d.unsubscribe(a+"_resolved",c),d.unsubscribe(a+"_resolve_fail",c))}var d=this,e=!0;this._symbolIdCache[a]?c():(this.on(a+"_resolved",c),this.on(a+"_resolve_fail",c))};
|
|
A82.ChartApi.prototype._doWhenSeriesDataReceived=function(a){function b(){D3.model().mainSeries().onCompleted().unsubscribe(null,b);a()}D3.model().mainSeries().onCompleted().subscribe(null,b)};
|
|
A82.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(a,b,c){function d(){var b=h._symbolIdCache[h._seriesIdCache[a].symbolId];return{name:b.name,info:b.info}}function e(){h.unsubscribe("symbol_resolved",g);h.unsubscribe("resolve_fail",f)}function f(b){b==h._seriesIdCache[a].symbolId&&c&&(e(),c())}function g(c){c.symbolId==h._seriesIdCache[a].symbolId&&(e(),b(d()))}var h=this;this._symbolIdCache[this._seriesIdCache[a].symbolId]?b(d()):(this.on("symbol_resolved",g),this.on("resolve_fail",
|
|
f))};A82.ChartApi.prototype.createSeries=function(a,b,c,d,e,f,g){c=c||"";this._notificationHandlers[a][b]=new TradingView.HandlerInfo(g,b);this._recentSeriesId=b;TradingView.ChartapiMessagerInstances[a].setResolution(e);var h=this;this._seriesIdCache[b]={symbolId:d,resolution:e,turnaround:c};this._studyEngine.updateSeriesTurnaround(b,c);this._doWhenSeriesSymbolIdIsReady(b,function(d){h._studyEngine.createSeries(d.name,e,a,b,c)})};
|
|
A82.ChartApi.prototype.removeSeries=function(a,b,c){this._notificationHandlers[a][b]=new TradingView.HandlerInfo(c,b);this._studyEngine.removeSeries(b)};
|
|
A82.ChartApi.prototype.setVisibleTimeRange=function(a,b,c,d){var e=D3.model().mainSeries().data(),e=!!e.timeToBarIndex(b,TradingView.SEARCH_FROM_LEFT),f=this._recentSeriesId;e?(e=D3.model().mainSeries().data(),b=[e.timeToBarIndex(b,TradingView.SEARCH_FROM_LEFT),e.timeToBarIndex(c,TradingView.SEARCH_FROM_RIGHT)],TradingView.ChartapiMessagerInstances[a].onSeriesTimeframeUpdate(f,this._seriesIdCache[f].turnaround,b[0],b[1],!0),d&&d()):console.warn("This method doesn't support moving to not loaded history bars now")};
|
|
A82.ChartApi.prototype._exactBarsCountOfTimeFrame=function(a,b){for(var c=D3.model().mainSeries().bars(),d=D3.model().mainSeries().symbolInfo().session,e=c._valueAt(c.size()-1)[0],d=PineJsBarBuilder.alignPeriodsBack(d,a.resolution,a.interval,1,1E3*e),e=c.size(),d=d/1E3,f=0,f=0;f<e&&!(c._valueAt(f)[0]>d);++f);return e-f};
|
|
A82.ChartApi.prototype.modifySeries=function(a,b,c,d,e,f,g){c=c||"";var h=this._seriesIdCache[b]?this._seriesIdCache[b].resolution:void 0;TradingView.ChartapiMessagerInstances[a].setResolution(e);var k=this;this._notificationHandlers[a][b]=new TradingView.HandlerInfo(function(g){if("series_completed"==g.method){var m=PineJS.Symbol.parsePeriod(h),n=PineJS.Symbol.parsePeriod(e);n.range&&m.range!=n.range&&(m=D3.model().mainSeries().bars().size(),n=k._exactBarsCountOfTimeFrame(n.range,k._symbolIdCache[d].info),
|
|
n=Math.max(0,m-1-n),m=Math.max(n,m-1),TradingView.ChartapiMessagerInstances[a].onSeriesTimeframeUpdate(b,c,n,m))}f(g)},b);this._recentSeriesId=b;this._studyEngine.updateSeriesTurnaround(b,c);this._seriesIdCache[g]=null;this._seriesIdCache[b]={symbolId:d,resolution:e,turnaround:c};this._doWhenSeriesSymbolIdIsReady(b,function(c){k._studyEngine.purgeEndOfDataFlags(b);k._studyEngine.purgeRangeExtensionData();k._studyEngine.purgeDataCache();k._studyEngine.recreateSources(c.name,e,a,!0)})};
|
|
A82.ChartApi.prototype.requestMoreData=function(a,b,c,d){this._enabledMoreBarsRequest&&(this._notificationHandlers[a][b]=new TradingView.HandlerInfo(d,b),this._studyEngine.extendSeriesRange(b,a,c))};A82.ChartApi.prototype.setStudiesAccessController=function(a){this.studiesAccessController=a};A82.ChartApi.prototype.setWatchlistSettings=function(a){this._watchlistSettings=a};A82.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()};
|
|
A82.ChartApi.prototype.requestMetadata=function(a,b,c){this._notificationHandlers[a][b]=new TradingView.HandlerInfo(c,b);c=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[a].onRequestMetadata(b,c)};A82.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT};
|
|
A82.ChartApi.prototype.createStudy=function(a,b,c,d,e,f,g){if(!this.isCanCreateStudy())throw"Exceeded the limit of studies";var h=this;c=c||"";this._notificationHandlers[a][b]=new TradingView.HandlerInfo(g,b);var k=this._seriesIdCache[d].resolution;this._doWhenSymbolIdIsReady(this._seriesIdCache[d].symbolId,function(d){h._studyEngine.createStudy(d.name,k,a,b,c,e,f);h.studyCounter++})};
|
|
A82.ChartApi.prototype.removeStudy=function(a,b){this._notificationHandlers[a][b]=null;this._studyEngine.removeStudy(b);this.studyCounter--};A82.ChartApi.prototype.modifyStudy=function(a,b,c,d,e){c=c||"";this._notificationHandlers[a][b]=new TradingView.HandlerInfo(e,b);[a,b,c].concat(d);this._studyEngine.recomputeStudy(b,d,a,c)};
|
|
A82.ChartApi.prototype.createPointset=function(a,b,c,d,e,f,g){this._notificationHandlers[a][b]=new TradingView.HandlerInfo(g,b);var h=this;this._doWhenSymbolIdIsReady(d,function(c){h._studyEngine.createPointset(a,b,c.info.full_name,c.info,e,f)})};A82.ChartApi.prototype.modifyPointset=function(a,b,c,d,e){throw"This call is not implemented";};A82.ChartApi.prototype.removePointset=function(a,b,c){this._notificationHandlers[a][b]=null;this._studyEngine.removePointset(b)};
|
|
A82.ChartApi.prototype.requestMoreTickmarks=function(a,b,c,d){this._notificationHandlers[a][b]=new TradingView.HandlerInfo(d,b);var e=this;this._doWhenSeriesSymbolIdIsReady(b,function(d){e._studyEngine.onMoreTickmarksRequested(a,d.name,d.info,e._seriesIdCache[b].resolution,c)})};A82.ChartApi.prototype.requestFirstBarTime=function(a,b,c,d){this._notificationHandlers[a][b]=new TradingView.HandlerInfo(d,b)};A82.ChartApi.prototype._invokeHandler=function(a,b){a&&a(b)};
|
|
A82.ChartApi.prototype._sendRequest=function(a,b){throw"This method is not implemented";};A82.ChartApi.prototype._onMessage=function(a){throw"This method is not implemented";};A82.ChartApi.prototype._convertTimescaleResponse=function(a){for(var b=a.marks,c=0;c<b.length;++c)b[c]={span:b[c][0],time:b[c][1],index:b[c][2]};return a};
|
|
A82.ChartApi.prototype._dispathNotification=function(a){var b=a.params.shift();if(this._notificationHandlers[b])switch(a.method){case "timescale_update":var c=a.params[0];a=a.params[1];var d=this._convertTimescaleResponse(a);d.clear=0===a.changes.length&&0===a.marks.length;this._notificationHandlers[b].onMessage({method:"timescale_update",params:d});for(var e in c)d={},d.customId=e,d.plots=c[e].series,c[e].ns&&(d.nonseries=c[e].ns),d.turnaround=c[e].turnaround,d={method:"data_update",params:d},
|
|
this._invokeNotificationHandler(b,e,d);break;case "tickmark_update":d=this._convertTimescaleResponse(a.params[0]);d.changes=[];this._notificationHandlers[b].onMessage({method:"timescale_update",params:d});break;case "data_update":for(e in a.params[0]){var f=a.params[0][e],d={};d.customId=e;d.plots=f.series?f.series:f.plots;d.turnaround=f.turnaround;"s"in f&&"ns"in f&&(d.plots=f.s,d.nonseries=f.ns);for(c in d.plots)for(var g in d.plots[c].value)1E100===d.plots[c].value[g]&&(d.plots[c].value[g]=void 0);
|
|
d={method:"data_update",params:d};this._invokeNotificationHandler(b,e,d)}break;case "index_update":for(e in a.params[0])d={method:"index_update",params:a.params[0][e]},this._invokeNotificationHandler(b,e,d);break;case "critical_error":TradingView.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+a.params[0]);this._notificationHandlers[b].onMessage({method:"critical_error",params:a.params});break;case "quote_symbol_data":case "quote_list_fields":case "depth_symbol_error":case "depth_symbol_success":case "dd":case "dpu":case "depth_bar_last_value":this._notificationHandlers[b].onMessage({method:a.method,
|
|
params:a.params});break;default:this._invokeNotificationHandler(b,a.params[0],a)}};A82.ChartApi.prototype._invokeNotificationHandler=function(a,b,c){if(void 0!==b){var d=this._notificationHandlers[a][b];"undefined"!==typeof d&&d&&this._invokeHandler(d.handler,c);"series_deleted"!=c.method&&"study_deleted"!=c.method||delete this._notificationHandlers[a][b]}};
|
|
A82.ChartApi.prototype.searchSymbolsByName=function(a,b,c,d,e){0===a.length&&0===b.length&&0===c.length&&e([]);this._studyEngine.searchSymbolsByName(a,b,c,e)};A82.ChartApi.prototype._notifySessions=function(a){for(var b in this._sessions){if(!this._sessions.hasOwnProperty(b))break;var c=this._sessions[b];if("function"===typeof c.onMessage)c.onMessage(a)}};A82.ChartApi.prototype.unpack=function(a){throw"This method is not implemented";};
|
|
A82.ChartApi.prototype.reconnectTimeout=function(a){throw"This method is not implemented";};A82.ChartApi.prototype.quoteCreateSession=function(a){return this._studyEngine.quoteCreateSession(a)};A82.ChartApi.prototype.quoteDeleteSession=function(a){return this._studyEngine.quoteDeleteSession(a)};A82.ChartApi.prototype.quoteSetFields=function(a,b){return this._studyEngine.quoteSetFields(a,b)};
|
|
A82.ChartApi.prototype.quoteAddSymbols=function(a,b){return this._studyEngine.quoteAddSymbols(a,b)};A82.ChartApi.prototype.quoteRemoveSymbols=function(a,b){return this._studyEngine.quoteRemoveSymbols(a,b)};A82.ChartApi.prototype.quoteFastSymbols=function(a,b){return this._studyEngine.quoteFastSymbols(a,b)};A82.ChartApi.prototype.quoteHibernateAll=function(a){return this._studyEngine.quoteHibernateAll(a)};A82.ChartApi.prototype.depthCreateSession=function(a,b,c){};
|
|
A82.ChartApi.prototype.depthDeleteSession=function(a){};A82.ChartApi.prototype.depthSetSymbol=function(a,b){};A82.ChartApi.prototype.depthClearSymbol=function(a){};A82.ChartApi.prototype.depthSetScale=function(a,b){};A82.ChartApi.prototype.createStudiesAccessController=function(a,b,c){return a?new this.StudiesAccessController(this._studyEngine,JSON.parse(a)):new this.ObsoleteStudiesAccessController(this._studyEngine,b&&JSON.parse(b),c&&JSON.parse(c))};
|
|
A82.ChartApi.prototype.StudiesAccessController=function(a,b){this._studyEngine=a;this._studiesAccess=b};A82.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(a){for(var b=null,c=0;c<this._studiesAccess.tools.length;++c){var d=this._studiesAccess.tools[c];if(d.name==a||d==a){b=d;break}}return b};
|
|
A82.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(a){a=this._findTool(a.description);return"black"==this._studiesAccess.type?!a||a.grayed:!!a},this)};A82.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};
|
|
A82.ChartApi.prototype.ObsoleteStudiesAccessController=function(a,b,c){this._studyEngine=a;this._enabledStudiesList=b;this._disabledStudiesList=c};
|
|
A82.ChartApi.prototype.ObsoleteStudiesAccessController.prototype.getEnabledTools=function(){var a=this._studyEngine.studiesMetadata();0<this._enabledStudiesList.length?a=a.filter(function(a){return a.is_hidden_study||0<=this._enabledStudiesList.indexOf(a.description)},this):0<this._disabledStudiesList.length&&(a=a.filter(function(a){return a.is_hidden_study||-1==this._disabledStudiesList.indexOf(a.description)},this));return a};
|
|
A82.ChartApi.prototype.ObsoleteStudiesAccessController.prototype.isToolGrayed=function(){return!1};TradingView.requireFullInterfaceImplementation(A82.ChartApi,"A82.ChartApi",R98,"R98");this.TzData=TzData=function(){var a={"America/New_York":{time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476E3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372E3,-1347228E3,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462E4,-1125871200,-1112565600,-1094421600,-1081116E3,-1062972E3,
|
|
-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236E3,-76941E4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836E3,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,
|
|
-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,
|
|
576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,
|
|
1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-17762,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
|
|
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
|
|
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
|
|
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3]},"America/Los_Angeles":{time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236E3,-769420800,-765410400,-687996E3,-662680800,
|
|
-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356E3,-337212E3,-323906400,-305762400,-292456800,-273708E3,-261007200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,
|
|
152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,
|
|
972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,
|
|
1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,
|
|
-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,
|
|
-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,
|
|
-1504476E3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372E3,-1347228E3,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462E4,-1125871200,-1112565600,-1094421600,-1081116E3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236E3,-769413600,-765410400,-747266400,
|
|
-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836E3,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,
|
|
25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,
|
|
846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,
|
|
1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-21036,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,
|
|
-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,
|
|
-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,
|
|
-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600,-18E3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236E3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{time:[-2366755200,-1632088800,-1615154400,-1601771400,
|
|
-1583712E3,-1567375200,-1554681600,-1534716E3,-1524088800,-1503266400,-149238E4,-1471816800,-1460930400,-1440972E3,-1428876E3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868E3,-1283724E3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116E3,-1062972E3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,
|
|
-76941E4,-765410400,-747266400,-733960800,-715824E3,-702518400,-684374400,-671068800,-652924800,-634176E3,-620863200,-602719200,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212E3,-321487200,-305762400,-289432800,-273708E3,-257983200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,
|
|
-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,136346400,152071200,167796E3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,
|
|
796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,
|
|
1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452E3,1899338400,1919901600,1930788E3],offset:[-19052,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
|
|
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-14400,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,
|
|
-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,
|
|
-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3,-14400,-18E3]},"America/Vancouver":{time:[-2713910400,-1632088800,-1615154400,-880236E3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612E3,-620863200,-608162400,-589413600,-576108E3,-557964E3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,
|
|
-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356E3,-337212E3,-323906400,-305762400,-292456800,-273708E3,-261007200,-242258400,-226533600,-210808800,-195084E3,-179359200,-163634400,-147909600,-13158E4,-11646E4,-100130400,-84405600,-68680800,-52956E3,-37231200,-21506400,-5781600,9943200,25668E3,41392800,57722400,73447200,89172E3,104896800,120621600,136346400,152071200,167796E3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924E3,325648800,
|
|
341373600,357098400,372823200,388548E3,404877600,419997600,436327200,452052E3,467776800,483501600,499226400,514951200,530676E3,544586400,562125600,576036E3,59418E4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788E3,814932E3,828842400,846381600,860292E3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684E3,1049594400,1067133600,1081044E3,1099188E3,1112493600,1130637600,
|
|
1143943200,1162087200,1173578400,1194141600,1205028E3,1225591200,1236477600,1257040800,1268532E3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444E3,1394330400,1414893600,142578E4,1446343200,1457834400,1478397600,1489284E3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196E3,1615687200,1636250400,1647136800,16677E5,1678586400,1699149600,1710036E3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,
|
|
1888452E3,1899338400,1919901600,1930788E3],offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,
|
|
-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,
|
|
-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112E3,-1567468800,-1233446400,-1222992E3,-1205971200,-1194048E3,-117288E4,-1162512E3,-1141344E3,-1130976E3,-1109808E3,-109944E4,-1078272E3,-1067817600,-1046649600,-1036281600,
|
|
-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352E3,-83376E4,-82728E4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832E3,-71107200,-54777600,-39052800,-23328E3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408E3,719366400,731462400,938912400,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,
|
|
-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448E3,591148800,1924970400],
|
|
offset:[-21408,-21600,-18E3,-21600,-18E3,-21600]},"America/Sao_Paulo":{time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184E4,-570758400,-560217600,-539136E3,-53136E4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816E3,761702400,
|
|
782265600,793152E3,813715200,823996800,84456E4,856051200,876096E3,888710400,908064E3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904E3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232E4,1203206400,1224374400,1234656E3,1255824E3,1266710400,1287273600,129816E4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576E3,1487462400,1508025600,1518912E3,154008E4,
|
|
1550361600,1571529600,1581811200,1602979200,1613865600,1634428800,1645315200,1665878400,1677369600,1697328E3,1708214400,1729382400,1739664E3,1760832E3,1771718400,1792281600,1803168E3,1823731200,1834617600,1855180800,1866067200,1887235200,1897516800,1918684800,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,
|
|
-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,
|
|
-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974E3],offset:[-17776,-17776,-18E3,-14400,-18E3]},"Europe/Moscow":{time:[-2840140800,-1688256E3,-165681E4,-1641340800,-1627956E3,-1618700400,-1596416400,-1593813600,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,
|
|
622609200,638330400,654663600,670388400,686113200,695786400,701823600,717548400,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,
|
|
12679,9079,16279,12679,16279,14400,10800,14400,18E3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,
|
|
-1182988800,-1178150400,-906854400,-904867200,-85725E4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036E3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582E3,433310400,449031600,465364800,481086E3,496814400,512535600,528264E3,543985200,559713600,575434800,591163200,606884400,622612800,638334E3,654667200,670388400,686116800,701838E3,717566400,733287600,749016E3,764737200,780465600,
|
|
796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288E3,92259E4,941342400,954039600,972792E3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342E3,1162094400,1174791600,1193544E3,1206846E3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296E3,1427598E3,1445745600,1459047600,14778E5,1490497200,1509249600,1521946800,1540699200,
|
|
1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835E4,1667102400,1679799600,1698552E3,1711854E3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102E3,1887854400,1901156400,1919304E3,1932606E3],offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,
|
|
7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Berlin":{time:[-2422051200,-1693702800,
|
|
-1680476400,-1663452E3,-1650142800,-1632002400,-1618693200,-938901600,-85725E4,-844552800,-828219600,-812498400,-79677E4,-781048800,-776552400,-765925200,-761173200,-748476E3,-733266E3,-717627600,-714603600,-71037E4,-701902800,-684972E3,-670453200,-654127200,-639003600,323834400,338958E3,354679200,370407600,386128800,401857200,417578400,433306800,449028E3,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,
|
|
701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,
|
|
1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,
|
|
7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{time:[-3852662400,
|
|
-1691964E3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034E3,-1570399200,-1552165200,-1538344800,-152253E4,-15075E5,-1490562E3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732E3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314E3,-1315778400,-1301259600,-1284328800,-126981E4,-1253484E3,-1238360400,-1221429600,-1206910800,-118998E4,-1175461200,-1159135200,-1143406800,-1126476E3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058E3,-1032127200,-1017608400,
|
|
-1001282400,-986158800,-969228E3,-950475600,-942012E3,-904514400,-896043600,-875484E3,-864594E3,-844034400,-832539600,-812584800,-798066E3,-781048800,-772059600,-764802E3,-748476E3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996E3,-668034E3,-654732E3,-636584400,-622072800,-605739600,-590623200,-57429E4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422E4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298E3,-306972E3,
|
|
-291848400,-276732E3,-257979600,-245282400,-22653E4,-213228E3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484E3,-100731600,-88034400,-68677200,-59004E3,57726E3,69818400,89175600,101268E3,120625200,132717600,152074800,164167200,183524400,196221600,214974E3,227671200,246423600,259120800,278478E3,290570400,309927600,32202E4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676E3,543978E3,562125600,575427600,593575200,
|
|
606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428E3,76473E4,782877600,796179600,814327200,828234E3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482E3,1004234400,1017536400,1035684E3,1048986E3,1067133600,1080435600,1099188E3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436E3,1269738E3,1288490400,1301187600,131994E4,1332637200,1351389600,1364691600,
|
|
1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049E4,1509242400,1521939600,1540692E3,1553994E3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444E3,1774746E3,1792893600,1806195600,1824948E3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,
|
|
3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,
|
|
3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Madrid":{time:[-2177452800,-1661734800,-1648425600,-1631926800,-1616889600,-1601254800,-1585353600,-1442451600,-1427673600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394E3,-1301270400,-1284339600,-1269820800,-1029114E3,-1017619200,-1002848400,-986169600,-969238800,-954115200,
|
|
-940208400,-873075600,-862531200,-842835600,-828230400,-811386E3,-796003200,-779936400,-765414E3,-748486800,-733881600,-652323600,-639183600,135126E3,150253200,167180400,181702800,196815600,212547600,22887E4,243997200,260406E3,276051600,29178E4,307508400,323834400,338958E3,354679200,370407600,386128800,401857200,417578400,433306800,449028E3,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,
|
|
733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,
|
|
1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,
|
|
3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,
|
|
7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544E4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618E3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224E3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394E3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472E3,-1160355600,-1143417600,-1127696400,
|
|
-1111968E3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012E3,-932432400,-85725E4,-844552800,-828219600,-812498400,-800064E3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178E4,307508400,323834400,338958E3,354679200,370407600,386128800,401857200,417578400,433306800,449028E3,465361200,481082400,496810800,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,
|
|
638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,
|
|
1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,
|
|
0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,
|
|
7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452E3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725E4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266E3,-715212E3,-701902800,-684972E3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,
|
|
-355356E3,-334191600,-323301600,-307580400,-291852E3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404E3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978E3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284E3,749012400,764733600,780462E3,796183200,
|
|
811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036E3,972788400,985485600,1004238E3,101754E4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788E3,1193540400,1206842400,122499E4,1238292E3,1256439600,1269741600,1288494E3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742E3,1459044E3,1477796400,1490493600,1509246E3,1521943200,1540695600,1553997600,
|
|
1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796E3,1698548400,1711850400,1729998E3,17433E5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,
|
|
3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,
|
|
7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364E3,-844639200,-828309600,-813189600,57722400,68007600,89172E3,100062E3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924E3,320814E3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326E3,530071200,542775600,562125600,57483E4,59418E4,606279600,625629600,
|
|
636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932E3,828241200,846381600,859690800,877831200,891140400,909280800,92259E4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684E3,1048993200,1067133600,1080442800,1099188E3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172E3,1238900400,1254621600,127035E4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,
|
|
1412474400,1428202800,1443924E3,1459652400,1475373600,1491102E3,1506823200,1522551600,1538877600,1554606E3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676E3,1680404400,1696125600,1712458800,172818E4,1743908400,1759629600,1775358E3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,
|
|
36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,
|
|
36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,39600]},"Asia/Tokyo":{time:[-2587678861,-2335219200,-1017792E3,-683762400,-672357600,-654732E3,-640908E3,-620258400,-609458400,-588808800,-578008800,1925024400],offset:[33539,32400,32400,32400,36E3,32400,36E3,32400,36E3,32400,36E3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792E3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856E3,-670636800,-65232E4,-639100800,-620784E3,-607564800,-589248E3,-576028800,-562896E3,
|
|
-541728E3,-528681600,-510192E3,-497145600,-478656E3,-465609600,-449798400,-433987200,-418176E3,-402451200,-38664E4,-370915200,-355104E3,-339379200,-323568E3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584E3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,
|
|
28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176E3,-1167609600,-1073001600,-894153600,-879638400,-766972800,-138758400,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27E3,32400,27E3,27E3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704E4,545184E3,558489600,576633600,589939200,608688E3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,
|
|
28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{time:[-2524521600,-2053900800,-1325462400,-1199232E3,-1017792E3,-767318400,-498096E3,-303955200,-293500800,-264902400,-39484800,547603200,560908800,579052800,592358400,1925024400],offset:[30472,30600,32400,30600,32400,32400,32400,28800,32400,28800,30600,32400,36E3,32400,36E3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776E3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,
|
|
71712E4,732758400,748656E3,764294400,780192E3,795830400,811728E3,827366400,843264E3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768E4,1253577600,1269216E3,1285113600,1300752E3,1316649600,1332288E3,1348185600,1363910400,1379808E3,1395446400,1411344E3,1426982400,144288E4,1458518400,1474416E3,1490140800,1506038400,1521676800,1537574400,
|
|
1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368E3,1916265600,1931904E3],offset:[12344,12344,12600,14400,18E3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,
|
|
16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-2840140800,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,23400,19800,23400,19800]},
|
|
"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021E3,-694470600,-683757E3,-668032200,-654726600,-636582600,-623277E3,-605133E3,-591827400,-573683400,-559773E3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877E3,-308781E3,-288822600,-277331400,-257373E3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509E3,-132784200,
|
|
-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381E3,9343800,25068600,40793400,56518200,72243E3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371E3,295414200,309324600,1925020800],offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,
|
|
32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]}};"undefined"!==typeof module&&module.exports?module.exports=a:this.TzData=a;return a}(this);var PineJsCalendar=function(){function a(a){this._name=a;var b=c[a];b||("UTC"!==a&&"Etc/UTC"!==a&&console.error("unknown timezone: "+a),b={time:[],offset:[]});b.time.length!==b.offset.length&&(console.error("timezone transition table doesn't match offset table"),b={time:[],offset:[]});if(!b.time_utc){a=b.time;for(var d=b.offset,h=a.length,k=Array(h),l=0;l<h;l++)a[l]*=1E3,d[l]*=1E3,k[l]=a[l]-d[l];b.time_utc=k}this.tz=b}var b="undefined"!==typeof window?window:global,c=b.TzData?b.TzData:require("./tzdata.js");
|
|
a.prototype.offset_utc=function(b){return a._offset(this.tz.time_utc,this.tz.offset,b)};a.prototype.offset_loc=function(b){return a._offset(this.tz.time,this.tz.offset,b)};a._offset=function(a,b,c){a:{var d=a.length;if(0===d)a=-1;else for(var k=0,l=d-1,m=(k+l)/2|0;;){if(a[m]>c){if(l=m-1,l<k){a=m;break a}}else if(k=m+1,l<k){a=m<d-1?m+1:-1;break a}m=(k+l)/2|0}}return-1===a?0:b[a]};var d={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,
|
|
DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:864E5,get_year:function(a){return a.getUTCFullYear()},get_month:function(a){return a.getUTCMonth()},get_hours:function(a){return a.getUTCHours()},get_minutes:function(a){return a.getUTCMinutes()},get_seconds:function(a){return a.getUTCSeconds()},get_day_of_month:function(a){return a.getUTCDate()},get_day_of_week:function(a){return a.getUTCDay()+1},get_day_of_year:function(a){var b=Date.UTC(a.getUTCFullYear(),
|
|
0,1,0,0,0,0);return((a.getTime()-b)/d.secondsPerDay|0)+1},get_week_of_year:function(a){var b=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0);a=d.clone(a);d.set_hms(a,0,0,0,0);a.setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7));return((a.getTime()-b)/d.secondsPerDay+1)/7|0},get_minutes_from_midnight:function(a){return 60*d.get_hours(a)+d.get_minutes(a)},set_hms:function(a,b,c,d,k){a.setUTCHours(b);a.setUTCMinutes(c);a.setUTCSeconds(d);a.setUTCMilliseconds(k)},add_days_considering_dst:function(a,b,c){var d=
|
|
a.offset_utc(b);b=this.clone(b);this.add_date(b,c);a=a.offset_utc(b);b.setTime(b.getTime()+d-a);return b},add_date:function(a,b){a.setTime(a.getTime()+b*d.secondsPerDay)},clone:function(a){return new Date(a.getTime())},get_days_per_year:function(a){a=a.getUTCFullYear();return this.days_per_year(a)},days_per_year:function(a){return 0!==a%4||0===a%100&&0!==a%400?365:366},get_part:function(a,b){switch(b){case d.YEAR:return d.get_year(a);case d.MONTH:return d.get_month(a);case d.DAY_OF_MONTH:return d.get_day_of_month(a);
|
|
case d.WEEK_OF_YEAR:return d.get_week_of_year(a);case d.DAY_OF_WEEK:return d.get_day_of_week(a);case d.HOUR_OF_DAY:return d.get_hours(a);case d.MINUTE:return d.get_minutes(a);case d.DAY_OF_YEAR:return d.get_day_of_year(a);case d.SECOND:return d.get_seconds(a);default:return a.getTime()}},time_minutes:function(a){return 6E4*a},time_minutes_diff:function(a,b){return((a/1E3|0)-(b/1E3|0))/60|0},utc_to_cal:function(a,b){var c=a.offset_utc(b);return new Date(b+c)},get_cal:function(a,b,c,d){b=new Date(Date.UTC(b,
|
|
c,d));a=a.offset_utc(+b);return new Date(b.valueOf()-a)},get_cal_utc:function(a,b,c){return new Date(Date.UTC(a,b,c))},cal_to_utc:function(a,b){var c=b.getTime(),d=a.offset_loc(c);return c-d},get_timezone:function(b){return new a(b)},shift_day:function(a,b){var c;c=a-1+b;6<c?c%=7:0>c&&(c=(7+c%7)%7);return c+1}};"undefined"!==typeof module&&module.exports?module.exports=d:window.PineJsCalendar=d;return d}();var PineJsBarBuilder=function(){function a(a,b){switch(a){case "D":return new t(b);case "W":return new v(b);case "M":return new w(b)}console.error("unknown dwm resolution: "+a);return null}function b(a,b,c){var d=b;a.moveTo(d);for(var e=[],f=0,g=0;!c(e,d);){if(5<f)throw console.trace(["0x10",new Date(b),"->",new Date(d)]),"Internal error 0x10 while extrapolating.";d=a.indexOfBar(d);if(-1===d)d=a.startOfBar(0);else if(-2===d)d=a.startOfBar(-2);else{var h=a.startOfBar(d);if(h!=b){if(g&&g==h)throw console.trace(["0x11",
|
|
new Date(b),"->",new Date(h)]),"Internal error 0x11 while extrapolating.";g=h;f=0;e.push(h)}d=a.startOfBar(d+1)}a.moveTo(d);f++}return e}function c(a){if(isNaN(a))return NaN;var b=this.indexOfBar(a);-2===b&&(this.moveTo(a),b=this.indexOfBar(a));return 0>b?NaN:this.startOfBar(b)}function d(a,b){this.period=a;this.session=b;this.sessionEnd=this.sessionStart=Number.MIN_VALUE}function e(a,b,c,d){this.period=c;this.sessionTgt=a;this.sessionSrc=b||a;this.builder=d;this.periodStart=-Number.MAX_VALUE;this.periodEnd=
|
|
-Number.MAX_VALUE;this.periodLastBarStart=-Number.MAX_VALUE}function f(a,b,c){c=z.clone(c);b.alignToSessionStart(c,a);return z.cal_to_utc(a,c)}function g(a,b){var c=z.get_day_of_week(b)-a.firstDayOfWeek;return 0>c?c+7:c}function h(a,b){var c=b+a.firstDayOfWeek;return c>z.SATURDAY?c-z.SATURDAY:c}function k(a,b){var c=z.get_day_of_year(b)-1,d=g(a,b)-c%7;if(0==d)return c/7|0;0<=d&&(d-=7);return(d+c)/7|0}function l(a,b,c){for(var d=0;b<c;++b)d+=a.isWeekEnd(h(a,b))?1:0;return d}function m(a,b){var c=new Date(Date.UTC(b,
|
|
11,31,23,59)),d=z.days_per_year(b)-n(a,c);z.get_day_of_week(c)!==z.SUNDAY&&z.get_day_of_week(c)!==z.SATURDAY||d--;return d}function n(a,b){var c=z.get_day_of_year(b)-1,d=g(a,b),e=d-c%7;0>e&&(e+=7);var f=0;c<7-e?f+=l(a,e,d):(c=0==e?0:l(a,e,7),f+=l(a,0,d)+c);return f+k(a,b)*a.weekEndsCount()}function p(){}function r(a){this.sessionsSpec=a}function t(a){this.session=a}function v(a){this.session=a}function w(a){this.session=a}function u(a,b,c){this._dayOfWeek=a;this._start=b;this._length=c}function x(a,
|
|
b){return a.compareTo(b)}function C(a){function b(a){var d=a.split(";");if(2<d.length)return console.error("Only one `first day` specification expected @ session "+a),a;if(1==d.length)return a;var e=1,f=0<=d[0].indexOf("-")?NaN:parseInt(d[0]);isNaN(f)&&(e=0,f=parseInt(d[1]));if(f<z.SUNDAY||f>z.SATURDAY)return console.error("Unexpected day index @ session: "+a+"; day index "+f),a;c.firstDayOfWeek=f;return d[e]}var c=this;a=a||"0000-0000";this.entries=[];this.firstDayOfWeek=z.MONDAY;if("24x7"===a.toLowerCase())Q.forEach(function(a){this.addSessionEntry(a,
|
|
0,0)},this);else{a=b(a);var d=!1,e={};a.split("|").forEach(function(a){var b=a.split(":");1!==b.length&&2!==b.length&&console.error("bad session section: "+a);var c=1===b.length;c&&(d&&console.error("duplicated default section: "+a),d=!0);(c?K:A(b[1])).forEach(function(a){c&&e[a]||(e[a]=b[0])},this)},this);Q.forEach(function(b){var c=e[b];c&&c.split(",").forEach(function(c){var d=c.split("-");2!==d.length&&(console.error("bad sessions spec: "+a),d=["0000","0000"]);c=parseInt(d[0]);d=parseInt(d[1]);
|
|
this.addSessionEntry(b,c%100+60*(c/100|0),d%100+60*(d/100|0))},this)},this)}this.entries.sort(x)}function A(a){for(var b=[],c=0;c<a.length;c++){var d=a.charAt(c)-0;-1===b.indexOf(d)&&b.push(d)}return b}function y(){}function D(a,b,c){var d=a.length;if(0===d)return-1;for(var e=0,f=d-1,g=(e+f)/2|0;;){var h=c(a[g],b);if(0===h||0<h){if(f=g-1,f<e)return g}else if(e=g+1,f<e)return g<d-1?g+1:-1;g=(e+f)/2|0}}var E="undefined"!==typeof window?window:global,z=E.PineJsCalendar?E.PineJsCalendar:require("./calendar.js"),
|
|
F={D:864E5,W:6048E5,M:2592E6};d.prototype.alignTime=c;d.prototype.indexOfBar=function(a){return a<this.sessionStart?-1:a>=this.sessionEnd?-2:z.time_minutes_diff(a,this.sessionStart)/this.period|0};d.prototype.startOfBar=function(a){if(-2===a)return this.sessionEnd;if(0>a)throw"Negative offset is not supported";return this.sessionStart+z.time_minutes(this.period*a)};d.prototype.isLastBar=function(a,b){var c=this.sessionStart+z.time_minutes(this.period*(a+1)-1);return b>=c};d.prototype.moveTo=function(a){var b=
|
|
this.session.timezone;a=z.utc_to_cal(b,a);var c=this.session.spec.alignToSessionStart(a,this.session.timezone);this.sessionStart=z.cal_to_utc(b,a);this.sessionEnd=this.sessionStart+z.time_minutes(c)};e.prototype.alignTime=c;e.prototype.tradingDayToSessionStart=function(a){this.moveTo(a);return this.startOfBar(0)};e.prototype.indexOfBar=function(a){return a<this.periodStart?-1:a>=this.periodEnd?-2:0};e.prototype.startOfBar=function(a){if(-2===a||0<a)return this.periodEnd;if(-1===a)throw"PRE_SESSION is not supported";
|
|
return this.periodStart};e.prototype.isLastBar=function(a,b){return b>=this.periodLastBarStart};e.prototype.moveTo=function(a){var b=z.utc_to_cal(this.sessionSrc.timezone,a),b=this.sessionSrc.spec.correctTradingDay(b,this.sessionSrc.timezone),c=(this.builder.indexOfPeriod(b)/this.period|0)*this.period;a=this.sessionTgt.timezone;var d=z.get_year(b),b=this.sessionTgt.spec,e=this.builder.startOfPeriod(a,c,d);this.periodStart=f(a,b,e);c=this.builder.startOfPeriod(a,c+this.period,d);this.periodEnd=f(a,
|
|
b,c)};e.prototype.moveToPrevWorkDay=function(a,b){for(;a.isWeekEnd(z.get_day_of_week(b));)z.add_date(b,-1)};p.prototype.indexOfPeriod=function(a){return z.get_day_of_year(a)-1};p.prototype.startOfPeriod=function(a,b,c){c=z.get_cal(a,c,z.JANUARY,1);b=z.add_days_considering_dst(a,c,b);return z.utc_to_cal(a,+b)};r.prototype.uber=new p;r.prototype.indexOfPeriod=function(a){return this.uber.indexOfPeriod(a)-n(this.sessionsSpec,a)};r.prototype.startOfPeriod=function(a,b,c){function d(a,b){for(var c=0,e=
|
|
a;7>e&&(k.sessionsSpec.isWeekEnd(h(k.sessionsSpec,e))||!(0>--b));++e)c++;return c}function e(a,b,c){var d=0,f=0;for(a=c%(7-k.sessionsSpec.weekEndsCount())-(0==a?0:b.businessDays);7>f&&0<a;++f){var g=k.sessionsSpec.isWeekEnd(h(k.sessionsSpec,f)),d=d+(g?1:0);a-=g?0:1}d=b.weekEnds+d;b=(c-b.businessDays)/(7-k.sessionsSpec.weekEndsCount())|0;b=d+k.sessionsSpec.weekEndsCount()*b;return c+b}var f=m(this.sessionsSpec,c);b>=f&&(c++,b=0);var k=this,f=new Date(Date.UTC(c,z.JANUARY,1)),f=g(this.sessionsSpec,
|
|
f),n=new function(a,b){this.weekEnds=l(a,b,7);this.calendarDays=7-b;this.businessDays=this.calendarDays-this.weekEnds}(this.sessionsSpec,f);b=b<n.businessDays?d(f,b):e(f,n,b);return this.uber.startOfPeriod(a,b,c)};t.prototype.indexOfPeriod=function(a){return this.builder().indexOfPeriod(a)};t.prototype.startOfPeriod=function(a,b,c){return this.builder().startOfPeriod(a,b,c)};t.prototype.builder=function(){this._builder||(this._builder=this.session.spec.hasWeekEnds()?new r(this.session.spec):new p);
|
|
return this._builder};v.prototype.indexOfPeriod=function(a){return k(this.session.spec,a)};v.prototype.startOfPeriod=function(a,b,c){var d=new Date(Date.UTC(c,z.JANUARY,1)),e=g(this.session.spec,d);b=0===e?7*b:7*(b+1)-e;d=z.get_days_per_year(d);if(b>d)return this.startOfPeriod(a,0,c+(b/d|0));c=z.get_cal(a,c,z.JANUARY,1);c=z.add_days_considering_dst(a,c,b);return z.utc_to_cal(a,+c)};w.prototype.indexOfPeriod=function(a){return z.get_month(a)};w.prototype.startOfPeriod=function(a,b,c){0>b?(a=(-b+11)/
|
|
12|0,c-=a,b+=12*a):b>z.DECEMBER&&(c++,b=z.JANUARY);b=z.get_cal_utc(c,b,1);c=g(this.session.spec,b);4<c&&z.add_date(b,7-c);return b};u.prototype.start=function(){return 0>this._start?this._start+z.minutesPerDay:this._start};u.prototype.isOvernight=function(){return 0>this._start};u.prototype.dayOfWeek=function(){return this._dayOfWeek};u.prototype.length=function(){return this._length};u.prototype.weight=function(){return this._dayOfWeek*z.minutesPerDay+this._start};u.prototype.compareTo=function(a){var b=
|
|
this.weight(),c=b+this._length;a=a.weight();return b<=a&&a<c?0:b>a?1:-1};var K=[z.MONDAY,z.TUESDAY,z.WEDNESDAY,z.THURSDAY,z.FRIDAY],Q=[z.SUNDAY,z.MONDAY,z.TUESDAY,z.WEDNESDAY,z.THURSDAY,z.FRIDAY,z.SATURDAY];C.prototype.addSessionEntry=function(a,b,c){c<=b&&0!=b&&(b-=z.minutesPerDay);this.entries.push(new u(a,b,c==b?z.minutesPerDay:c-b))};C.prototype.isWeekEnd=function(a){var b=D(this.entries,new u(a,0,0),function(a,b){return a.dayOfWeek()-b.dayOfWeek()});return 0>b||this.entries[b].dayOfWeek()!=a};
|
|
C.prototype.hasWeekEnds=function(){return 0<this.weekEndsCount()};C.prototype.weekEndsCount=function(){if(void 0==this._weekEndsCount){var a=[];this.entries.forEach(function(b){a[b.dayOfWeek()]=1},this);this._weekEndsCount=7-a.reduce(function(a,b){return a+(b||0)},0)}return this._weekEndsCount};C.prototype.indexOfSession=function(a,b){var c=D(this.entries,new u(a,b,0),x);return-1===c?0:c};C.prototype.findSession=function(a,b){return this.entries[this.indexOfSession(a,b)]};C.prototype.correctTradingDay=
|
|
function(a,b){var c=z.get_day_of_week(a),d=60*z.get_hours(a)+z.get_minutes(a),c=(this.findSession(c,d).dayOfWeek()-c+7)%7;return 0!=c?z.add_days_considering_dst(b,a,c):a};C.prototype.alignToSessionStart=function(a,b){var c=z.get_day_of_week(a),d=z.get_minutes_from_midnight(a),d=this.findSession(c,d),e=d.dayOfWeek(),f=d.isOvernight(),c=(e-c+7)%7-(f?1:0);0!==c&&z.add_date(a,c);c=d.start();z.set_hms(a,c/60|0,c%60,0,0);d=d.length();e=new Date(a.valueOf()+6E4*d);c=b.offset_loc(a)/6E4;e=b.offset_loc(e)/
|
|
6E4;return d+(c-e)};y.prototype.init=function(a,b){this.timezone="string"===typeof a?z.get_timezone(a):a;this.spec=new C(b);return this};E={PRE_SESSION:-1,POST_SESSION:-2,LASTBAR_SESSION:-3,newBarBuilder:function(b,c,f,g){return""===b?new d(c,f):new e(f,g,c,a(b,f))},Session:y,alignPeriodsBack:function(a,b,c,d,e){a=(new y).init("UTC",a);var f=""!=b;f?(c*=F[b],b=F.D):(c*=6E4,b=6E4*a.spec.findSession(0,0)._length);b/=c;a=(f?7:a.spec.hasWeekEnds()?5:7)*b;return d<a?e-d/b*F.D:e-d/a*F.W},extrapolateBarsFrontByCount:function(a,
|
|
c,d){return b(a,c,function(a,b){return a.length>=d})},extrapolateBarsFrontToTime:function(a,c,d){return b(a,c,function(a,b){return b>d})},lower_bound:D,isTradingNow:function(a,b){var c=z.utc_to_cal(b.timezone,+a),d=z.get_day_of_week(c),c=z.get_minutes_from_midnight(c),e=b.spec.findSession(d,c);if(1440===e._length)return d==e._dayOfWeek;e.isOvernight()&&c>e._start+e._length&&d==e._dayOfWeek-1&&(d++,c-=1440);return d==e._dayOfWeek&&c>=e._start&&c<e._start+e._length},numberOfFullWeeks:k,numberOfWeekEndsSinceYearStart:n,
|
|
BusinessDaysBuilder:r,alignExchangeTimeToSessionStartAndReturnUTC:f};"undefined"!==typeof module&&module.exports?module.exports=E:window.PineJsBarBuilder=E;return E}();var PineJS=function(){function a(a,b,c,d,e){c=e;e=0;if(isNaN(a.get(b-1)))return{index:NaN,value:NaN};for(var f=0;f<b;++f)d(a.get(f),c)&&(e=f,c=a.get(f));return{index:e,value:c}}function b(a,b){return 100*a/b}function c(a,b,c,d,e){this._areaRight=a;this._areaLeft=b;this._pivotType=c;this._series=d;this._currentIndex=e.new_var(0);this._currentValue=e.new_var(NaN);this._pivotIndex=e.new_var(-1);this._index=u.n(e);this._isNewBar=e.symbol.isNewBar;a=this._currentIndex.get(1);b=this._currentValue.get(1);
|
|
c=this._pivotIndex.get(1);1<this._index&&(this._currentIndex.set(a),this._currentValue.set(b),this._pivotIndex.set(c))}function d(a,b,d){this._deviation=a;a=d.new_var(u.high(d));var e=d.new_var(u.low(d));a.get(2*b+1);e.get(2*b+1);this._pivotHigh=new c(b,b,c.HIGH,a,d);this._pivotLow=new c(b,b,c.LOW,e,d);this._lastVal=d.new_var(NaN);this._lastIndex=d.new_var(-1);this._lastType=d.new_var();this._index=u.n(d);this._isNewBar=d.symbol.isNewBar;this._isBarClosed=d.symbol.isBarClosed;b=this._lastIndex.get(1);
|
|
d=this._lastVal.get(1);a=this._lastType.get(1);1<this._index&&this.addPivot(b,d,a);this.processPivot(this._pivotHigh);this.processPivot(this._pivotLow)}function e(a){this.symbol=a;this.vars=[];this.vars_index=0;this.ctx=[];this.ctx_index=0}function f(a){this.mindepth=0;this.original=NaN;this.modified=!1;this.symbol=a}function g(a,b,c,d){this.periodBase=c;this.tickerid=a;this.period=b;this.index=-1;this.updatetime=this.volume=this.close=this.low=this.high=this.open=this.time=NaN;this.isBarClosed=this.isNewBar=
|
|
!1;this.session=new w.Session;this.other_sessions={};this.script=d;this.ticker=g.parseTicker(a);a=g.parsePeriod(b);this.resolution=a.resolution;this.interval=a.interval;this.bb_cache={}}function h(a,b,c,d,f,g,h){this.body=f;this.symbols=[];this.runner=d;this.inputCallback=h;this.out=g;this.ctx=new e(this.add_sym(a,b,c));this.init()}function k(a){this.symbols=[];this.barsets=[];this.subscription=[];this.host=a;this.isRecalculated=!1;this.start()}function l(a){this.runner=new k(a)}function m(a,b){this.info=
|
|
a;this.bars=b||[];this.isBarClosed=!0}function n(a,b){this.period=a;this.generateEmptyBars=!!b}function p(){}function r(){}var t="undefined"!==typeof window?window:global,v=t.PineJsCalendar?t.PineJsCalendar:require("./calendar.js"),w=t.PineJsBarBuilder?t.PineJsBarBuilder:require("./barbuilder.js"),u={max_series_size:5E3,n:function(a){return a.symbol.index+1},nz:function(a,b){b=b||0;return isFinite(a)?a:b},na:function(a){return 0==arguments.length?NaN:isNaN(a)?1:0},isZero:function(a){return 1E-10>=
|
|
Math.abs(a)},toBool:function(a){return isFinite(a)&&!u.isZero(a)},eq:function(a,b){return u.isZero(a-b)},neq:function(a,b){return!u.eq(a,b)},ge:function(a,b){return u.isZero(a-b)||a>b},gt:function(a,b){return!u.isZero(a-b)&&a>b},lt:function(a,b){return!u.isZero(a-b)&&a<b},le:function(a,b){return u.isZero(a-b)||a<b},and:function(a,b){return isNaN(a)||isNaN(b)?NaN:u.isZero(a)||u.isZero(b)?0:1},or:function(a,b){return isNaN(a)||isNaN(b)?NaN:u.isZero(a)&&u.isZero(b)?0:1},not:function(a){return isNaN(a)?
|
|
NaN:u.isZero(a)?1:0}};u.max=Math.max;u.min=Math.min;u.pow=Math.pow;u.abs=Math.abs;u.log=Math.log;u.log10=function(a){return Math.log(a)/Math.LN10};u.sqrt=Math.sqrt;u.sign=function(a){return isNaN(a)?NaN:u.isZero(a)?0:0<a?1:-1};u.exp=Math.exp;u.sin=Math.sin;u.cos=Math.cos;u.tan=Math.tan;u.asin=Math.asin;u.acos=Math.acos;u.atan=Math.atan;u.floor=Math.floor;u.ceil=Math.ceil;u.round=Math.round;u.avg=function(a,b,c,d,e,f){if(2===arguments.length)return(a+b)/2;for(var g=0,h=0;h<arguments.length;h++)g+=
|
|
arguments[h];return g/arguments.length};u.open=function(a){return a.symbol.open};u.high=function(a){return a.symbol.high};u.low=function(a){return a.symbol.low};u.close=function(a){return a.symbol.close};u.hl2=function(a){return(a.symbol.high+a.symbol.low)/2};u.hlc3=function(a){return(a.symbol.high+a.symbol.low+a.symbol.close)/3};u.ohlc4=function(a){return(a.symbol.open+a.symbol.high+a.symbol.low+a.symbol.close)/4};u.volume=function(a){return a.symbol.volume};u.time=function(a,b,c){return a.symbol.bartime(b,
|
|
c)};u.period=function(a){return a.symbol.period};u.tickerid=function(a){return a.symbol.tickerid};u.ticker=function(a){return a.symbol.ticker};u.interval=function(a){return a.symbol.interval};u.isdwm=function(a){return a.symbol.isdwm()};u.isintraday=function(a){return!a.symbol.isdwm()};u.isdaily=function(a){return"D"===a.symbol.resolution};u.isweekly=function(a){return"W"===a.symbol.resolution};u.ismonthly=function(a){return"M"===a.symbol.resolution};u.year=function(a,b){return u.timepart(a.symbol,
|
|
v.YEAR,b)};u.month=function(a,b){return u.timepart(a.symbol,v.MONTH,b)};u.weekofyear=function(a,b){return u.timepart(a.symbol,v.WEEK_OF_YEAR,b)};u.dayofmonth=function(a,b){return u.timepart(a.symbol,v.DAY_OF_MONTH,b)};u.dayofweek=function(a,b){return u.timepart(a.symbol,v.DAY_OF_WEEK,b)};u.hour=function(a,b){return u.timepart(a.symbol,v.HOUR_OF_DAY,b)};u.minute=function(a,b){return u.timepart(a.symbol,v.MINUTE,b)};u.second=function(a,b){return u.timepart(a.symbol,v.SECOND,b)};u.iff=function(a,b,c){return u.not(a)?
|
|
c:b};u.rising=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)>a.get(0))return 0;return 1};u.falling=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)<a.get(0))return 0;return 1};u.timepart=function(a,b,c){a=v.utc_to_cal(a.timezone,c||a.bartime());return v.get_part(a,b)};u.rsi=function(a,b){return u.isZero(b)?100:u.isZero(a)?0:100-100/(1+a/b)};u.sum=function(a,b,c){c=c.new_var();a=u.nz(a.get())+u.nz(c.get(1))-u.nz(a.get(b));c.set(a);return a};u.sma=function(a,b,c){c=u.sum(a,b,c);return u.na(a.get(b-
|
|
1))?NaN:c/b};u.rma=function(a,b,c){var d=u.sum(a,b,c),e=b-1,f=a.get(e);c=c.new_var();var g=c.get(1);a=a.get();b=u.na(f)?NaN:u.na(g)?d/b:(a+g*e)/b;c.set(b);return b};u.fixnan=function(a,b){var c=b.new_var();if(isNaN(a))return c.get(1);c.set(a);return a};u.tr=function(a){var b=a.new_var(u.close(a));return u.max(u.max(u.high(a)-u.low(a),u.abs(u.high(a)-b.get(1))),u.abs(u.low(a)-b.get(1)))};u.atr=function(a,b){var c=b.new_var(u.tr(b));return u.sma(c,a,b)};u.ema=function(a,b,c){var d=u.sum(a,b,c);c=c.new_var();
|
|
var e=a.get(0);a=a.get(b-1);var f=c.get(1);b=u.na(a)?NaN:u.na(f)?d/b:2*(e-f)/(b+1)+f;c.set(b);return b};u.wma=function(a,b,c){c=0;for(var d=b=Math.round(b);0<=d;d--)c+=(b-d)*a.get(d);return 2*c/(b*(b+1))};u.vwma=function(a,b,c){var d=c.new_var(u.volume(c));a=c.new_var(a.get(0)*u.volume(c));return u.sma(a,b,c)/u.sma(d,b,c)};u.swma=function(a,b){return(a.get(0)+2*a.get(1)+2*a.get(2)+a.get(3))/6};u.lowestbars=function(b,c,d){return-a(b,c,d,function(a,b){return u.lt(a,b)},Number.MAX_VALUE).index};u.lowest=
|
|
function(b,c,d){return a(b,c,d,function(a,b){return u.lt(a,b)},Number.MAX_VALUE).value};u.highestbars=function(b,c,d){return-a(b,c,d,function(a,b){return u.gt(a,b)},Number.MIN_VALUE).index};u.highest=function(b,c,d){return a(b,c,d,function(a,b){return u.gt(a,b)},Number.MIN_VALUE).value};u.cum=function(a,b){var c=b.new_var(),d=u.nz(c.get(1))+a;c.set(d);return d};u.accdist=function(a){u.open(a);var b=u.high(a),c=u.low(a),d=u.close(a),e=u.volume(a);return u.cum(d==b&&d==c||b==c?0:e*(2*d-c-b)/(b-c),a)};
|
|
u.correlation=function(a,b,c,d){var e=u.sma(a,c,d),f=u.sma(b,c,d),g=d.new_var(a.get()*b.get());return(u.sma(g,c,d)-e*f)/Math.sqrt(u.variance2(a,e,c)*u.variance2(b,f,c))};u.stoch=function(a,c,d,e,f){c=u.highest(c,e);d=u.lowest(d,e);return u.fixnan(b(a.get()-d,c-d),f)};u.tsi=function(a,b,c,d){var e=d.new_var(u.change(a));a=d.new_var(u.abs(u.change(a)));e=d.new_var(u.ema(e,c,d));c=d.new_var(u.ema(a,c,d));e=u.ema(e,b,d);b=u.ema(c,b,d);return e/b};u.cross=function(a,b,c){if(isNaN(a)||isNaN(b))return!1;
|
|
a=c.new_var(function(a){return 0>a?-1:0==a?0:1}(a-b));return!isNaN(a.get(1))&&a.get(1)!=a.get()};u.linreg=function(a,b,c){for(var d=0,e=0,f=0,g=0,h=0;h<b;++h)var k=a.get(h),l=b-1-h+1,d=d+l,e=e+k,f=f+l*l,g=g+k*l;a=(b*g-d*e)/(b*f-d*d);return e/b-a*d/b+a+a*(b-1-c)};u.sar=function(a,b,c,d){function e(b,c){var d=n.get();p.set(b);n.set(c);r.set(1E3*a);t.set(d);return d}var f=u.high(d),g=u.low(d),h=u.close(d),k=d.new_var(f),l=d.new_var(g),m=d.new_var(h).get(1),l=l.get(1),k=k.get(1),n=d.new_var(),p=d.new_var(),
|
|
r=d.new_var(),t=d.new_var();d=t.get(1);if(isNaN(m))return NaN;isNaN(d)&&(u.ge(h,m)?(p.set(1),n.set(Math.max(f,k)),d=Math.min(g,l)):(p.set(-1),d=Math.max(f,k),n.set(Math.min(g,l))),r.set(1E3*a));if(1==p.get()){if(u.gt(f,n.get())&&(n.set(f),r.set(Math.min(r.get()+1E3*b,1E3*c))),u.le(g,d))return e(-1,g)}else if(u.lt(g,n.get())&&(n.set(g),r.set(Math.min(r.get()+1E3*b,1E3*c))),u.ge(f,d))return e(1,f);b=d+r.get()*(n.get()-d)/1E3;1==p.get()?u.ge(b,g)&&(b=g-1E-7):u.le(b,f)&&(b=f+1E-7);t.set(b);return b};
|
|
u.alma=function(a,b,c,d){c=Math.floor(c*(b-1));var e=b/d*(b/d);d=[];for(var f=0,g=0;g<b;++g){var h=Math.exp(-1*Math.pow(g-c,2)/(2*e)),f=f+h;d.push(h)}for(g=0;g<b;++g)d[g]/=f;for(g=c=0;g<b;++g)c+=d[g]*a.get(b-g-1);return c};u.wvap=function(a,b){return a.get()-a.get(1)};u.change=function(a){return a.get()-a.get(1)};u.roc=function(a,b){var c=a.get(b);return 100*(a.get()-c)/c};u.dev=function(a,b,c){c=u.sma(a,b,c);return u.dev2(a,b,c)};u.dev2=function(a,b,c){for(var d=0,e=0;e<b;e++)var f=a.get(e),f=u.abs(f-
|
|
c),d=d+f;return d/b};u.stdev=function(a,b,c){a=u.variance(a,b,c);return u.sqrt(a)};u.variance=function(a,b,c){c=u.sma(a,b,c);return u.variance2(a,c,b)};u.variance2=function(a,b,c){for(var d=0,e=0;e<c;e++)var f=a.get(e),f=u.abs(f-b),d=d+f*f;return d/c};u.percentrank=function(a,b){if(u.na(a.get(b-1)))return NaN;for(var c=0,d=a.get(),e=1;e<b;e++){var f=a.get(e);u.ge(d,f)&&c++}return 100*c/b};c.LOW=0;c.HIGH=1;c.prototype.isPivotFound=function(){return-1!=this._pivotIndex.get()};c.prototype.pivotIndex=
|
|
function(){return this._pivotIndex.get()};c.prototype.currentValue=function(){return this._currentValue.get()};c.prototype.pivotType=function(){return this._pivotType};c.prototype.reset=function(){this._currentValue.set(NaN);this._currentIndex.set(0);this._pivotIndex.set(-1)};c.prototype.isRightSideOk=function(a){return a-this._currentIndex.get()==this._areaRight};c.prototype.isViolate=function(a,b){if(1>a||isNaN(this._currentValue.get()))return!0;var d=this._series.get(this._index-a);return isNaN(d)?
|
|
!0:d===this._currentValue.get()?b:this._pivotType==c.HIGH?d>this._currentValue.get():d<this._currentValue.get()};c.prototype.processPoint=function(a){this.isViolate(a,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(a))};c.prototype.isRestartNeeded=function(a){return a-this._currentIndex.get()>this._areaRight};c.prototype.update=function(){this._isNewBar&&this.isPivotFound()&&this.reset();this.processPoint(this._index);if(this.isRightSideOk(this._index)){if(-1==this._pivotIndex.get()){for(var a=
|
|
!0,b=0;b<this._areaLeft;++b)if(this.isViolate(this._currentIndex.get()-1-b,!0)){a=!1;break}a&&this._pivotIndex.set(this._currentIndex.get())}}else-1!=this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),b=0;b<=this._areaRight;++b)this.processPoint(this._index-this._areaRight+b)};d.prototype.addPivot=function(a,b,c){this._lastIndex.set(a);this._lastVal.set(b);this._lastType.set(c)};d.prototype.updatePivot=function(a,b){this._lastIndex.set(a);this._lastVal.set(b)};
|
|
d.prototype.lastPrice=function(){return this._lastVal.get()};d.prototype.lastIndex=function(){return this._lastIndex.get()};d.prototype.addPoint=function(a,b,d){if(isNaN(this._lastVal.get()))this.addPivot(a,b,d);else{var e=this._lastVal.get();this._lastType.get()==d?(d===c.HIGH?b>e:b<e)&&this.updatePivot(a,b):Math.abs(e-b)/b>this._deviation&&this.addPivot(a,b,d)}};d.prototype.processPivot=function(a){a.update();this._isBarClosed&&a.isPivotFound()&&this.addPoint(a.pivotIndex(),a.currentValue(),a.pivotType())};
|
|
u.zigzag=function(a,b,c){return(new d(a,b,c)).lastPrice()};u.zigzagbars=function(a,b,c){a=new d(a,b,c);return-1==a.lastIndex()?NaN:a.lastIndex()-u.n(c)};e.prototype.new_sym=function(a,b,c){return this.symbol.script.add_sym(a,b,c)};e.prototype.select_sym=function(a){this.symbol=this.symbol.script.get_sym(a)};e.prototype.new_var=function(a){var b=this.vars;b.length<=this.vars_index&&b.push(new f(this.symbol));b=b[this.vars_index++];0<arguments.length&&b.set(a);return b};e.prototype.new_ctx=function(){this.ctx.length<=
|
|
this.ctx_index&&this.ctx.push(new e(this.symbol));return this.ctx[this.ctx_index++]};e.prototype.prepare=function(a){for(var b=this.vars_index=this.ctx_index=0;b<this.vars.length;b++)this.vars[b].prepare(a);for(b=0;b<this.ctx.length;b++)this.ctx[b].prepare(a)};e.prototype.stop=function(){this.vars=this.symbol=null};f.prototype.valueOf=function(){return this.get(0)};f.prototype.get=function(a){isNaN(a)&&(a=0);a=a||0;return this.hist?a>=this.hist.length?(console.error("not enough depth: "+this),NaN):
|
|
this._get(a):(this.mindepth=u.max(this.mindepth,a),NaN)};f.prototype._get=function(a){a=this.hist_pos-a;0>a&&(a+=this.hist.length);return this.hist[a]};f.prototype.set=function(a){this.hist&&(this.hist[this.hist_pos]=a,this.modified=!0)};f.prototype.prepare=function(a){a===this.symbol&&(a.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)};f.prototype.add_hist=function(){if(!this.hist){for(var a=u.na(this.mindepth)?u.max_series_size:
|
|
u.min(this.mindepth+1,u.max_series_size),a=Math.round(a),b=Array(a),c=0;c<a;c++)b[c]=NaN;this.hist=b;this.hist_pos=-1}this.hist_pos=(this.hist_pos+1)%this.hist.length;this.hist[this.hist_pos]=this.original};f.prototype.adopt=function(a,b,c){this.hist||(this.mindepth=NaN);var d=b.get(),d=a.indexOf(d);0!==c&&(b=b.get(1),u.na(b)||(a=a.indexOf(b),d=d===a?-1:d));return 0>d?NaN:this._get(d)};f.prototype.indexOf=function(a){if(!this.hist)return this.mindepth=NaN,-1;if(u.na(a))return-1;for(var b=this.symbol.index+
|
|
1,c=this.hist.length,d=0,b=(b>c?c:b)-1,c=(b+d)/2|0;;){if(this._get(c)>a){if(d=c+1,d>b)return c+1}else if(b=c-1,d>b)return c;c=(b+d)/2|0}};g.parseTicker=function(a){var b=a.indexOf(":");return-1===b?a:a.substr(b+1)};g.parsePeriod=function(a){var b=(a+"").slice(0),c;0<=b.indexOf(",")&&(a=b.split(","),c=g.parsePeriod(a[1]),b=a[0]);a=!1;var d=b[b.length-1];-1==="DWM".indexOf(d)&&(a=!0,d="");b=parseInt(a?b:1<b.length?b.slice(0,b.length-1):1);return{resolution:d,interval:b,pureResolution:[b,d].join(""),
|
|
isIntraday:a,range:c}};g.newBarBuilder=function(a,b,c){a=g.parsePeriod(a);return w.newBarBuilder(a.resolution,a.interval,b,c)};g.newSession=function(a,b){var c=v.get_timezone(a);return(new w.Session).init(c,b)};g.prototype.set_symbolinfo=function(a){a||console.error("WARN: symbolinfo isn't defined for "+this.tickerid);this.info=a;this.timezone=v.get_timezone(a.timezone);this.session.init(this.timezone,a.session);for(var b in this.other_sessions)this.other_sessions.hasOwnProperty(b)&&this.other_sessions[b].init(this.timezone,
|
|
b)};g.prototype.get_session=function(a){if(!a)return this.session;var b=this.other_sessions[a];b||(b=new w.Session,this.other_sessions[a]=b);return b};g.prototype.isdwm=function(){return""!==this.resolution};g.prototype.enable_dwm_aligning=function(a,b){this.dwm_aligner=g.newBarBuilder(this.period,a,b)};g.prototype.bartime=function(a,b){var c=this.time;if(a){var d=a;b&&(d+=b);var e=this.bb_cache[d];e||(e=this.get_session(b),e=g.newBarBuilder(a,e),this.bb_cache[d]=e);c=e.alignTime(c)}if(!this.isdwm()||
|
|
isNaN(c))return c;c=v.utc_to_cal(this.timezone,c);this.session.spec.correctTradingDay(c,this.timezone);return v.cal_to_utc(this.timezone,c)};g.prototype.lastbar=function(a){if(!isNaN(a.time)){var b=a.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(b),b=this.dwm_aligner.startOfBar(0));var c=this.time!==b;c&&0<=this.index&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this));this.time=b;this.open=a.open;this.high=a.high;this.low=a.low;this.close=a.close;this.volume=a.volume;
|
|
this.updatetime=a.updatetime;this.isNewBar=c;this.isBarClosed=a.isBarClosed;this.isNewBar&&this.index++;this.script.calc(this)}};h.prototype.calc=function(a){var b=this.ctx,c=this.body;b.prepare(a);a=c.main(b,this.inputCallback);!isNaN(b.symbol.time)&&this.out&&this.out(b.symbol,a)};h.prototype.init=function(){var a=this.ctx,b=this.body;b.init&&b.init(a,this.inputCallback);b.main(a,this.inputCallback)};h.prototype.add_sym=function(a,b,c){a=this.runner.add_sym(a,b,c,this);this.symbols.push(a);a.isdwm()&&
|
|
1<this.symbols.length&&a.enable_dwm_aligning(this.symbols[0].session,a.session);return a};h.prototype.stop=function(a){this.symbols=null;this.ctx.stop();this.ctx=null};h.prototype.get_sym=function(a){return this.symbols[a]};k.prototype.add_sym=function(a,b,c,d){a=new g(a,b,c,d);this.symbols.push(a);return a};k.prototype.get_sym=function(a){return this.symbols[a]};k.prototype.start=function(){function a(e,f){var g=k.feed.subscribe(e.tickerid,e.period,e.periodBase,function(a){c.update(f,a)},b.onErrorCallback,
|
|
b.symbolInfo,b.rangeExtension);d.push(g)}var b=this.host;this._script=new h(b.tickerid,b.period,b.periodBase||b.period,this,b.body,b.out,b.input);for(var c=this,d=[],e=this.symbols,f=0;f<e.length;f++)a(e[f],f);this.subscription=d};k.prototype.stop=function(){var a=this.subscription;if(a||this._script){for(var b=0;b<a.length;b++)k.feed.unsubscribe(a[b]);this.subscription=null;this._script.stop();this.symbols=this._script=null}else console.warn("Recurring script engine stop happened.")};k.prototype.update=
|
|
function(a,b){if(b){var c=this.symbols[a];if(this.isRecalculated){var d=b.bar(b.count()-1);d.isBarClosed=b.isLastBarClosed();c.lastbar(d)}else this.barsets[a]||(this.barsets[a]=b,c.set_symbolinfo(b.symbolinfo()),this.recalc())}else console.error("Unexpected barset = null")};k.prototype.recalc=function(){for(var a=this.symbols,b=0;b<a.length;b++)if(!this.barsets[b])return;for(b=a.length-1;0<=b;b--)for(var c=a[b],d=this.barsets[b],e=d.count(),f=0;f<e;f++){var g=d.bar(f);g.isBarClosed=f===e-1?d.isLastBarClosed():
|
|
!0;c.lastbar(g)}this.isRecalculated=!0;this.host.recalc(this)};k.feed={subscribe:function(a,b,c,d){console.error("must be initialized with setupFeed")},unsubscribe:function(a){console.error("must be initialized with setupFeed")}};l.prototype.stop=function(){this.runner.stop()};m.prototype.symbolinfo=function(){return this.info};m.prototype.isLastBarClosed=function(){return this.isBarClosed};m.prototype.bar=function(a){return this.bars[a]};m.prototype.count=function(){return this.bars.length};m.prototype.add=
|
|
function(a,b){var c=this.bars,d=c.length,e=a.time,f=0===d?NaN:c[d-1].time;0===d||f<e?c.push(a):f===e?c[d-1]=a:console.error("time order violation, prev: "+(new Date(f)).toUTCString()+", cur: "+(new Date(e)).toUTCString());this.isBarClosed=!!b};n.prototype.init=function(a){this.bb=g.newBarBuilder(this.period,a.symbol.session);this.bbEmptyBars=this.generateEmptyBars?g.newBarBuilder(this.period,a.symbol.session):void 0};n.prototype.extrapolate=function(a,b){return isNaN(a)||isNaN(b)?void 0:w.extrapolateBarsFrontToTime(this.bbEmptyBars,
|
|
a,b)};n.prototype.main=function(a){var b=a.symbol.time,c=this.bb.alignTime(b),d=a.new_var(c),e=u.na(c),f=d.get(1),g=u.na(f)?1:u.neq(c,f),d=a.new_var(),h=a.new_var(),k=a.new_var(),l=a.new_var(),m=d.get(1),n=h.get(1),p=k.get(1),r=l.get(1),m=e?NaN:g?u.open(a):m,n=e?NaN:g?u.high(a):u.max(u.high(a),n),p=e?NaN:g?u.low(a):u.min(u.low(a),p),t=e?NaN:u.close(a),r=e?NaN:g?u.volume(a):u.volume(a)+r,e=e?NaN:b,b=a.symbol.isBarClosed&&this.bb.isLastBar(b),f=this.generateEmptyBars&&g?this.extrapolate(f,c):void 0;
|
|
a=a.new_var(u.close(a)).get(1);a=f instanceof Array?a:NaN;d.set(m);h.set(n);k.set(p);l.set(r);return[c,m,n,p,t,r,e,b,f,a]};p.prototype.main=function(a){var b=a.new_var(u.open(a)),c=a.new_var(u.close(a)),d=b.get(1),e=c.get(1),c=u.ohlc4(a),d=u.na(b.get(1))?(u.open(a)+u.close(a))/2:(d+e)/2;b.set(d);var b=u.max(u.high(a),u.max(d,c)),e=u.min(u.low(a),u.min(d,c)),f=u.volume(a);a=a.symbol;return[a.time,d,b,e,c,f,a.updatetime,a.isBarClosed]};r.prototype.main=function(a){var b=u.open(a),c=u.high(a),d=u.low(a),
|
|
e=u.close(a);a=u.volume(a);return[b,c,d,e,a]};t={Std:u,Series:f,Symbol:g,SymbolInfo:function(a,b){this.timezone=a||"America/New_York";this.session=b||"0000-0000"},StudyEngine:l,BarSet:m,OHLCV:r,BarBuilder:n,HeikenAshi:p,setupFeed:function(a){k.feed=a}};"undefined"!==typeof module&&module.exports?module.exports=t:window.PineJS=t;return t}(this);var PineJSFeed=function(){function a(a){this.host=a;this.cache={}}function b(a){if(0!==a.indexOf("="))return{symbol:a};a=JSON.parse(a.slice(1));a.type&&(0===a.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?a.builder=new c.HeikenAshi:console.error("unknown builder type: "+a.type));"string"!=typeof a.symbol&&(a.session=a.symbol.session||a.session,a.symbol=a.symbol.symbol);return a}var c=PineJS?PineJS:require("./iljs.js"),d=PineJsBarBuilder?PineJsBarBuilder:require("./barbuilder.js"),e=c.Symbol,f=
|
|
c.StudyEngine,g=c.BarBuilder,h=c.BarSet;a.prototype.getCache=function(a){return this.cache[a]};a.prototype.putCache=function(a,b){this.cache[a]=b};a.prototype.subscribe=function(a,b,c,d,e,f){var g;g=a+b+c+(f.has_empty_bars||f.force_session_rebuild?"_":"");var h=this.getCache(g);h||(h=this.createItem(a,b,c,f),this.putCache(g,h));h.listeners.addListener(d,e);return{key:g,listener:d}};a.prototype.unsubscribe=function(a){var b=this.getCache(a.key);b&&b.listeners.removeListener(a.listener)};a.prototype.removeUnused=
|
|
function(){var a=[],b;for(b in this.cache)this.cache[b]&&0===this.cache[b].listeners.listenersCount()&&a.push(b);if(0!==a.length){for(b=0;b<a.length;b++){var c=a[b],d=this.cache[c];this.cache[c]=null;d.stop()}this.removeUnused()}};a.prototype.rebuildFrom=function(a,b,c){a=e.parsePeriod(a);b=e.parsePeriod(b);if(""!==a.resolution){if(c.has_weekly_and_monthly)return a.resolution;if("undefined"===typeof c.has_daily||c.has_daily)return"D";""!==b.resolution&&(b.resolution="",b.interval=c.intraday_multipliers?
|
|
c.intraday_multipliers[0]:1)}if("undefined"!==typeof c.has_intraday&&!c.has_intraday)return"";b=""!==a.resolution?b.interval:""===b.resolution?Math.min(a.interval,b.interval):a.interval;if(c.intraday_multipliers&&(c=c.intraday_multipliers,-1===c.indexOf(b))){for(a=c.length-1;0<=a;a--){var d=c[a];if(0===b%d)return""+d}return""}return""+b};a.prototype.createItem=function(a,c,d,e){var f=new m;a=b(a);if(a.builder)return new l(f,a.symbol,c,d,a.builder,e);var h=this.rebuildFrom(c,d,e),n=e.has_empty_bars||
|
|
e.force_session_rebuild;return c!==h||n?(d=e.has_empty_bars,e=$.extend({},e),n&&(e.has_empty_bars=!1,e.force_session_rebuild=!1),new l(f,a.symbol,c,h,new g(c,d),e)):new k(f,a.symbol,c,d,a.session&&"extended"!==a.session,this.host,e)};var k=function(a,b,c,d,e,f,g){this.listeners=a;this.host=f;this._aligner_set=!1;var h=this;this.host.resolve(b,function(a){e&&a.regular_session&&(a.session=a.regular_session);var f=h.calculateFromTo(a,d||c,b);h.subs=h.host.subscribe(a,c,f,function(a){h.listeners.fire(a)},
|
|
function(a){h.listeners.onError(a)})},function(a){h.listeners.onError(a)})};k.prototype._create_dwm_aligner=function(a,b){var c=PineJsCalendar.get_timezone(b.timezone),f=new d.Session;f.init(c,b.session);return e.newBarBuilder(a,f,f)};k.prototype.stop=function(){this.host.unsubscribe(this.subs)};k.prototype.calculateFromTo=function(a,b,c){c=e.parsePeriod(b);var f=(new Date).valueOf(),f=a.expired?PineJsCalendar.cal_to_utc(PineJsCalendar.get_timezone(a.timezone),new Date(1E3*a.expiration_date))||f:
|
|
f,g,h;""===c.resolution?(g=c.interval,h="D"):(g=12*("D"===c.resolution?1:"W"===c.resolution?5:30)*c.interval,h="M");c.range?(g=c.range.interval,h=c.range.resolution):this.host.calculateHistoryDepth&&(b=this.host.calculateHistoryDepth(b,h,g))&&(g=b.intervalBack||g,h=b.resolutionBack||h);a=a.sessionString||a.session;b=d.alignPeriodsBack(a,h,g,1,f);this.host.getRangeExtension&&(g=this.host.getRangeExtension(),0<g&&(b=d.alignPeriodsBack(a,c.resolution,c.interval,g,b)));return{from:b,to:f+6E4}};var l=
|
|
function(a,b,c,d,e,g){this.listeners=a;this.isRecalculated=!1;if(""===d)console.error("unsupported resolution for rebuild: "+c),this.listeners.onError("unsupported resolution for rebuild: "+c);else{var h=this;this.engine=new f({tickerid:b,period:d,periodBase:c,body:e,symbolInfo:g,recalc:function(){h._recalc()},out:function(a,b){h._out(a,b)},onErrorCallback:function(a){h.listeners.onError(a)}})}};l.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")};
|
|
l.prototype._recalc=function(){this.isRecalculated&&console.error("recalc called twice!");this.barset&&this.listeners.fire(this.barset);this.isRecalculated=!0};l.prototype._out=function(a,b){var c=b[0];if(!isNaN(c)){var c={time:c,open:b[1],high:b[2],low:b[3],close:b[4],volume:b[5],updatetime:b[6]},d=b[7];this.barset||(this.barset=new h(a.info));var e=b[8];if(e instanceof Array)for(var f=0;f<e.length;f++){var g=b[9],k=e[f];this.barset.add({time:k,open:g,high:g,low:g,close:g,volume:0,updatetime:k},
|
|
!0);this.isRecalculated&&this.listeners.fire(this.barset)}this.barset.add(c,d);this.isRecalculated&&this.listeners.fire(this.barset)}};var m=function(){this.listeners=[]};m.prototype.listenersCount=function(){return this.listeners.reduce(function(a,b){return a+(b?1:0)},0)};m.prototype.addListener=function(a,b){this.listeners.push({dataListener:a,onErrorCallback:b});this.barset&&a(this.barset);this.errorMsg&&b(this.errorMsg)};m.prototype.removeListener=function(a){var b=this.listeners.filter(function(b){return b.dataListener==
|
|
a});0!=b.length&&(b=this.listeners.indexOf(b[0]),delete this.listeners[b])};m.prototype.onError=function(a){this.errorMsg=a||"unspecified error";for(var b=this.listeners,c=b.length,d=0;d<c;d++){var e=b[d];if(e&&e.onErrorCallback)e.onErrorCallback(a)}};m.prototype.fire=function(a){this.barset=a;for(var b=this.listeners,c=b.length,d=0;d<c;d++){var e=b[d];e&&e.dataListener(a)}};var n={setupFeed:function(b){a.instance=new a(b);c.setupFeed(a.instance)},parseSymbol:b,unsubscribeUnused:function(){a.instance.removeUnused()}};
|
|
"undefined"!==typeof module&&module.exports?module.exports=n:PineJSFeed=n;return n}();A82.studyLibrary=[{name:"Accumulation/Distribution",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:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",
|
|
scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(a,b,c,d){return PineJS.Std.or(PineJS.Std.and(PineJS.Std.eq(a,b),PineJS.Std.eq(a,c)),PineJS.Std.eq(b,c))?0:(2*a-c-b)/(b-c)*d};this.main=function(a,b){this._context=a;this._input=b;var c=this.f_0(PineJS.Std.close(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context),PineJS.Std.volume(this._context));return[PineJS.Std.cum(c,this._context)]}}},{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:1E12}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(a,b){return 100*(a+b)/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.high(this._context),e=c+1,d=this._context.new_var(d),d=PineJS.Std.highestbars(d,e,this._context),d=this.f_0(d,c),f=PineJS.Std.low(this._context),f=this._context.new_var(f),e=PineJS.Std.lowestbars(f,
|
|
e,this._context),c=this.f_0(e,c);return[d,c]}}},{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:1E12}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.gt(a,b)};this.f_1=function(a,b){return PineJS.Std.lt(a,b)};this.f_2=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context)),d=this._context.new_var(d),d=PineJS.Std.sum(d,c,this._context),e=this.f_1(PineJS.Std.close(this._context),
|
|
PineJS.Std.open(this._context)),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context);return[this.f_2(d,c)]}}},{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:1E12}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.tr(this._context),d=this._context.new_var(d);return[PineJS.Std.rma(d,c,this._context)]}}},{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(a,b){return a-b};this.f_1=function(a){return PineJS.Std.le(a,0)?0:1};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.hl2(this._context),d=this._context.new_var(c),d=PineJS.Std.sma(d,5,this._context),c=this._context.new_var(c),c=PineJS.Std.sma(c,34,this._context),d=this.f_0(d,c),c=this._context.new_var(d),c=PineJS.Std.change(c),
|
|
c=this.f_1(c);return[d,c]}}},{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:1E12},{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(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.f_3=function(a,b,c){return(a-b)/c};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._context.new_var(c),
|
|
f=PineJS.Std.sma(f,d,this._context),c=this._context.new_var(c),d=PineJS.Std.stdev(c,d,this._context),d=this.f_0(e,d),e=this.f_1(f,d),d=this.f_2(f,d);return[this.f_3(e,d,f)]}}},{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(a,b,c,d){return(a-b)/(c-d)};this.main=function(a,b){this._context=a;this._input=b;return[this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context),PineJS.Std.high(this._context),PineJS.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:1E12},{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(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._context.new_var(c),f=PineJS.Std.sma(f,d,this._context),c=this._context.new_var(c),d=PineJS.Std.stdev(c,d,this._context),
|
|
d=this.f_0(e,d),e=this.f_1(f,d),d=this.f_2(f,d);return[f,e,d]}}},{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:1E12},{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(a,b){return a*b};this.f_1=function(a,b){return a+b};this.f_2=function(a,b){return a-b};this.f_3=function(a,b,c){return(a-b)/(c-b)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._context.new_var(c),f=PineJS.Std.sma(f,d,this._context),g=this._context.new_var(c),d=PineJS.Std.stdev(g,
|
|
d,this._context),d=this.f_0(e,d),e=this.f_1(f,d),f=this.f_2(f,d);return[this.f_3(c,f,e)]}}},{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:1E12}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(a,b,c,d){return PineJS.Std.or(PineJS.Std.and(PineJS.Std.eq(a,b),PineJS.Std.eq(a,c)),PineJS.Std.eq(b,c))?0:(2*a-c-b)/(b-c)*d};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=
|
|
a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context),PineJS.Std.volume(this._context)),d=this._context.new_var(d),d=PineJS.Std.sum(d,c,this._context),e=PineJS.Std.volume(this._context),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context);return[this.f_1(d,c)]}}},{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:1E12},{id:"in_1",name:"long",defval:10,
|
|
type:"integer",min:1,max:1E12}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.accdist(this._context),f=this._context.new_var(e),c=PineJS.Std.ema(f,c,this._context),e=this._context.new_var(e),d=PineJS.Std.ema(e,d,this._context);return[this.f_0(c,d)]}}},{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:1E12},{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(a,b,c){return a-b*c};this.f_1=function(a,b,c){return a+b*c};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),
|
|
d=this._input(1),e=this._input(2),f=PineJS.Std.high(this._context),g=this._context.new_var(f),h=PineJS.Std.highest(g,c,this._context),g=PineJS.Std.atr(c,this._context),h=this.f_0(h,d,g),f=this._context.new_var(f),c=PineJS.Std.lowest(f,c,this._context),d=this.f_1(c,d,g),c=this._context.new_var(h),c=PineJS.Std.highest(c,e,this._context),d=this._context.new_var(d);return[PineJS.Std.lowest(d,e,this._context),c]}}},{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:1E12}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},
|
|
constructor:function(){this.f_0=function(a){return PineJS.Std.ge(a,0)?a:0};this.f_1=function(a){return PineJS.Std.ge(a,0)?0:-a};this.f_2=function(a,b){return 100*a/b};this.f_3=function(a,b){return this.f_2(a-b,a+b)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.change(d),e=this.f_0(d),d=this.f_1(d),e=this._context.new_var(e),e=PineJS.Std.sum(e,c,this._context),d=this._context.new_var(d),c=PineJS.Std.sum(d,
|
|
c,this._context);return[this.f_3(e,c)]}}},{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:1E12}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},
|
|
constructor:function(){this.f_0=function(a,b,c){return(a-b)/(.015*c)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._context.new_var(c),e=PineJS.Std.sma(e,d,this._context),f=this._context.new_var(c),d=PineJS.Std.dev(f,d,this._context);return[this.f_0(c,e,d)]}}},{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:1E12}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(a,b,c,d){return 100*PineJS.Std.log10(a/(b-c))/d};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.atr(1,this._context),d=this._context.new_var(d),
|
|
d=PineJS.Std.sum(d,c,this._context),e=PineJS.Std.high(this._context),e=this._context.new_var(e),e=PineJS.Std.highest(e,c,this._context),f=PineJS.Std.low(this._context),f=this._context.new_var(f),f=PineJS.Std.lowest(f,c,this._context),c=PineJS.Std.log10(c);return[this.f_0(d,e,f,c)]}}},{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 Index",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:1E12},{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(a){return-a};this.f_1=function(a,b){return PineJS.Std.and(PineJS.Std.gt(a,b),PineJS.Std.gt(a,0))?a:0};this.f_2=function(a,b){return 100*
|
|
a/b};this.f_3=function(a,b){return a+b};this.f_4=function(a,b,c){return PineJS.Std.abs(a-b)/(PineJS.Std.eq(c,0)?1:c)};this.f_5=function(a){return 100*a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.high(this._context),e=this._context.new_var(e),f=PineJS.Std.change(e),e=PineJS.Std.low(this._context),e=this._context.new_var(e),e=PineJS.Std.change(e),g=this.f_0(e),e=PineJS.Std.tr(this._context),e=this._context.new_var(e),h=PineJS.Std.rma(e,
|
|
c,this._context),e=this.f_1(f,g),e=this._context.new_var(e),e=PineJS.Std.rma(e,c,this._context),e=this.f_2(e,h),e=PineJS.Std.fixnan(e,this._context),f=this.f_1(g,f),f=this._context.new_var(f),c=PineJS.Std.rma(f,c,this._context),c=this.f_2(c,h),c=PineJS.Std.fixnan(c,this._context),f=this.f_3(e,c),f=this.f_4(e,c,f),f=this._context.new_var(f),d=PineJS.Std.rma(f,d,this._context),d=this.f_5(d);return[e,c,d]}}},{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 Coeff",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:1E12}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",
|
|
name:"Correlation Coeff"},constructor:function(){this.init=function(a,b){this._context=a;this._input=b;this._context.new_sym(this._input(0),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;this._input=b;var c=this._context.new_var(this._context.symbol.time);this._input(0);PineJS.Std.period(this._context);var d=PineJS.Std.close(this._context),e=this._input(1);this._context.select_sym(1);var f=this._context.new_var(this._context.symbol.time),
|
|
g=PineJS.Std.close(this._context),g=this._context.new_var(g);this._context.select_sym(0);c=g.adopt(f,c,0);d=this._context.new_var(d);c=this._context.new_var(c);return[PineJS.Std.correlation(d,c,e,this._context)]}}},{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:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1},plot_2:{title:"Plot",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:1E12}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.low(this._context),d=this._context.new_var(d),d=PineJS.Std.lowest(d,c,this._context),e=PineJS.Std.high(this._context),
|
|
e=this._context.new_var(e),c=PineJS.Std.highest(e,c,this._context),e=PineJS.Std.avg(c,d);return[d,c,e]}}},{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 Exponential Moving Average",
|
|
shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(a,b){return 2*a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),e=this._context.new_var(d),c=PineJS.Std.ema(e,
|
|
c,this._context);return[this.f_0(d,c)]}}},{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:1E12},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:1E12}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(a,b,c,d,e){return a*b*(c-d)/e};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.hl2(this._context),e=this._context.new_var(e),e=PineJS.Std.change(e),c=this.f_0(c,e,PineJS.Std.high(this._context),PineJS.Std.low(this._context),
|
|
PineJS.Std.volume(this._context)),c=this._context.new_var(c);return[PineJS.Std.sma(c,d,this._context)]}}},{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:"Elders 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:1E12}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(a,b){return a*b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.change(d),
|
|
d=this.f_0(d,PineJS.Std.volume(this._context)),d=this._context.new_var(d);return[PineJS.Std.ema(d,c,this._context)]}}},{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:1E12},{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(a,b,c){return a?b:c};this.f_1=function(a,b){return a*(1+b)};this.f_2=function(a,b){return a*(1-b)};this.main=function(a,b){this._context=a;
|
|
this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._input(2),g=this._context.new_var(c),g=PineJS.Std.ema(g,d,this._context),c=this._context.new_var(c),d=PineJS.Std.sma(c,d,this._context),f=this.f_0(f,g,d),d=e/100,e=this.f_1(f,d),d=this.f_2(f,d);return[f,e,d]}}},{name:"Ichimoku Cloud",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:"#008000"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,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"}],styles:{plot_0:{title:"Tenkan-sen",histogramBase:0,joinPoints:!1},plot_1:{title:"Kijun-sen",histogramBase:0,joinPoints:!1},plot_2:{title:"Chikou span",histogramBase:0,joinPoints:!1},plot_3:{title:"Senkou A",histogramBase:0,joinPoints:!1},plot_4:{title:"Senkou B",histogramBase:0,joinPoints:!1}},description:"Ichimoku Cloud",
|
|
shortDescription:"Ichimoku",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:1E12},{id:"in_1",name:"Middle",defval:26,type:"integer",min:1,max:1E12},{id:"in_2",name:"Long",defval:52,type:"integer",min:1,max:1E12},{id:"in_3",name:"displacement",defval:26,type:"integer",min:1,max:1E12}],id:"Ichimoku Cloud@tv-basicstudies-1",scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.f_0=
|
|
function(a){return-a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=this._input(3),g=PineJS.Std.low(this._context),h=this._context.new_var(g),k=PineJS.Std.lowest(h,c,this._context),h=PineJS.Std.high(this._context),l=this._context.new_var(h),c=PineJS.Std.highest(l,c,this._context),c=PineJS.Std.avg(k,c),k=this._context.new_var(g),k=PineJS.Std.lowest(k,d,this._context),l=this._context.new_var(h),d=PineJS.Std.highest(l,d,this._context),
|
|
d=PineJS.Std.avg(k,d),k=PineJS.Std.avg(c,d),g=this._context.new_var(g),g=PineJS.Std.lowest(g,e,this._context),h=this._context.new_var(h),e=PineJS.Std.highest(h,e,this._context),e=PineJS.Std.avg(g,e),h=PineJS.Std.close(this._context);return[c,d,{value:h,offset:this.f_0(f)},{value:k,offset:f},{value:e,offset:f}]}}},{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(a,b){return PineJS.Std.ge(a,0)?b:-b};this.f_1=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.hlc3(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c),d=this.f_0(c,PineJS.Std.volume(this._context)),c=this._context.new_var(d),c=PineJS.Std.ema(c,34,this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,55,this._context),c=this.f_1(c,d),d=this._context.new_var(c),d=PineJS.Std.ema(d,13,this._context);
|
|
return[c,d]}}},{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 MA",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1E12}],id:"Hull MA@tv-basicstudies-1",
|
|
scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(a,b){return 2*a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=d/2,f=this._context.new_var(c),e=PineJS.Std.wma(f,e,this._context),c=this._context.new_var(c),c=PineJS.Std.wma(c,d,this._context),c=this.f_0(e,c),d=PineJS.Std.sqrt(d),d=PineJS.Std.round(d),c=this._context.new_var(c);return[PineJS.Std.wma(c,d,this._context)]}}},{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:1E12},{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(a,b,c,d){return a?b:c-d};this.f_1=function(a,b,c){return a+b*c};this.f_2=function(a,b,c){return a-b*c};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._input(2),c=this._context.new_var(c),c=PineJS.Std.ema(c,
|
|
e,this._context),d=this.f_0(d,PineJS.Std.tr(this._context),PineJS.Std.high(this._context),PineJS.Std.low(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,e,this._context),e=this.f_1(c,d,f),f=this.f_2(c,d,f);return[e,c,f]}}},{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:1E12}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.linreg(c,
|
|
d,0)]}}},{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:1E12},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:1E12},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:1E12},{id:"in_3",name:"roclen4",defval:30,
|
|
type:"integer",min:1,max:1E12},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:1E12},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:1E12},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:1E12},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:1E12},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:1E12}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(a,b,c,d){return a+
|
|
2*b+3*c+4*d};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=this._input(3),g=this._input(4),h=this._input(5),k=this._input(6),l=this._input(7),m=this._input(8),n=PineJS.Std.close(this._context),p=this._context.new_var(n),c=PineJS.Std.roc(p,c),c=this._context.new_var(c),g=PineJS.Std.sma(c,g,this._context),c=this._context.new_var(n),d=PineJS.Std.roc(c,d),d=this._context.new_var(d),h=PineJS.Std.sma(d,h,this._context),d=this._context.new_var(n),
|
|
e=PineJS.Std.roc(d,e),e=this._context.new_var(e),k=PineJS.Std.sma(e,k,this._context),n=this._context.new_var(n),f=PineJS.Std.roc(n,f),f=this._context.new_var(f),l=PineJS.Std.sma(f,l,this._context),l=this.f_0(g,h,k,l),f=this._context.new_var(l),m=PineJS.Std.sma(f,m,this._context);return[l,m]}}},{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:1E12},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:1E12}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(a,b){return a?b:PineJS.Std.na()};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),f=this._context.new_var(e),c=PineJS.Std.sma(f,c,this._context),
|
|
e=this._context.new_var(e),d=PineJS.Std.sma(e,d,this._context),e=PineJS.Std.cross(c,d,this._context),e=this.f_0(e,c);return[c,d,e]}}},{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(a,b,c){return a*(PineJS.Std.le(b,0)?0:c)};this.f_1=function(a,b,c){return a*(PineJS.Std.ge(b,0)?0:c)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.hlc3(this._context),e=this._context.new_var(d),f=PineJS.Std.change(e),e=this.f_0(PineJS.Std.volume(this._context),f,d),e=this._context.new_var(e),e=PineJS.Std.sum(e,c,this._context),d=this.f_1(PineJS.Std.volume(this._context),f,d),d=this._context.new_var(d),
|
|
c=PineJS.Std.sum(d,c,this._context);return[PineJS.Std.rsi(e,c)]}}},{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:1E12}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(a,b){return a-b};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.high(this._context),PineJS.Std.low(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,9,this._context),e=this._context.new_var(d),e=PineJS.Std.ema(e,9,this._context),d=this.f_1(d,
|
|
e),d=this._context.new_var(d);return[PineJS.Std.sum(d,c,this._context)]}}},{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}},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:1E12}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.ema(c,d,this._context)]}}},{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(a,b,c){return PineJS.Std.gt(a,0)?b:PineJS.Std.lt(c,0)?-b:0*b};this.main=function(a,b){this._context=a;this._input=
|
|
b;var c=PineJS.Std.close(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c);return[this.f_0(c,PineJS.Std.volume(this._context),c)]}}},{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_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:1E12},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:1E12},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:1E12}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._input(2),g=this._context.new_var(c),d=PineJS.Std.ema(g,d,this._context),
|
|
c=this._context.new_var(c),e=PineJS.Std.ema(c,e,this._context),e=this.f_0(d,e),c=this._context.new_var(e),f=PineJS.Std.sma(c,f,this._context);return[this.f_0(e,f),e,f]}}},{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}},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:1E12}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.sma(c,d,this._context)]}}},{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}},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:1E12}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",
|
|
name:"Moving Average Weighted"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.wma(c,d,this._context)]}}},{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(a,
|
|
b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2);return[PineJS.Std.sar(c,d,e,this._context)]}}},{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(a,b,c){return PineJS.Std.gt(a,0)?b:PineJS.Std.lt(c,0)?-b:0*b};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),c=this._context.new_var(c),c=PineJS.Std.change(c),c=this.f_0(c,PineJS.Std.volume(this._context),c);return[PineJS.Std.cum(c,this._context)]}}},{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:1E12},{id:"in_1",name:"longlen",defval:21,type:"integer",
|
|
min:1,max:1E12}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(a,b){return(a-b)/b*100};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._context.new_var(c),d=PineJS.Std.sma(f,d,this._context),c=this._context.new_var(c),e=PineJS.Std.sma(c,e,this._context);return[this.f_0(d,e)]}}},{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:1E12}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(a){return PineJS.Std.max(a,0)};this.f_1=function(a){return-PineJS.Std.min(a,
|
|
0)};this.f_2=function(a,b){return PineJS.Std.eq(a,0)?100:PineJS.Std.eq(b,0)?0:100-100/(1+b/a)};this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c),e=PineJS.Std.change(c),c=this.f_0(e),c=this._context.new_var(c),c=PineJS.Std.rma(c,d,this._context),e=this.f_1(e),e=this._context.new_var(e),d=PineJS.Std.rma(e,d,this._context);return[this.f_2(d,c)]}}},{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:1E12}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(a,b){return a-b};this.f_1=function(a,b){return a/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context),PineJS.Std.open(this._context)),d=this._context.new_var(d),d=PineJS.Std.swma(d,this._context),d=this._context.new_var(d),
|
|
d=PineJS.Std.sum(d,c,this._context),e=this.f_0(PineJS.Std.high(this._context),PineJS.Std.low(this._context)),e=this._context.new_var(e),e=PineJS.Std.swma(e,this._context),e=this._context.new_var(e),c=PineJS.Std.sum(e,c,this._context),c=this.f_1(d,c),d=this._context.new_var(c),d=PineJS.Std.swma(d,this._context);return[c,d]}}},{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:1E12}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.le(a,0)?0:b};this.f_1=function(a,b){return PineJS.Std.gt(a,0)?0:b};this.f_2=function(a,b){return a/(a+b)*100};this.main=function(a,
|
|
b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),e=this._context.new_var(d),c=PineJS.Std.stdev(e,c,this._context),d=this._context.new_var(d),e=PineJS.Std.change(d),d=this.f_0(e,c),d=this._context.new_var(d),d=PineJS.Std.ema(d,14,this._context),c=this.f_1(e,c),c=this._context.new_var(c),c=PineJS.Std.ema(c,14,this._context);return[this.f_2(d,c)]}}},{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:1E12},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:1E12},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:1E12}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},
|
|
constructor:function(){this.f_0=function(a,b){return a-b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=PineJS.Std.close(this._context),f=this._context.new_var(f),c=PineJS.Std.tsi(f,c,d,this._context),d=this._context.new_var(c),e=PineJS.Std.ema(d,e,this._context),d=this.f_0(c,e);return[c,e,d]}}},{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:"%D",
|
|
histogramBase:0,joinPoints:!1},plot_1:{title:"%K",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:1E12},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1E12},{id:"in_2",name:"smoothD",defval:3,
|
|
type:"integer",min:1,max:1E12}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=PineJS.Std.close(this._context),g=PineJS.Std.high(this._context),h=PineJS.Std.low(this._context),f=this._context.new_var(f),g=this._context.new_var(g),h=this._context.new_var(h),c=PineJS.Std.stoch(f,g,h,c,this._context),c=this._context.new_var(c),d=PineJS.Std.sma(c,
|
|
d,this._context),c=this._context.new_var(d),e=PineJS.Std.sma(c,e,this._context);return[d,e]}}},{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:1E12}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(a){return PineJS.Std.log(a)};this.f_1=function(a){return 1E4*a};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this.f_0(PineJS.Std.close(this._context)),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),
|
|
d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),d=this._context.new_var(d),c=PineJS.Std.ema(d,c,this._context),c=this._context.new_var(c),c=PineJS.Std.change(c);return[this.f_1(c)]}}},{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:"%D",histogramBase:0,joinPoints:!1},plot_1:{title:"%K",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:1E12},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1E12},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1E12},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1E12}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",
|
|
name:"Stochastic RSI"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._input(2),g=this._input(3),h=PineJS.Std.rsi(c,d),c=this._context.new_var(h),d=this._context.new_var(h),h=this._context.new_var(h),e=PineJS.Std.stoch(c,d,h,e,this._context),e=this._context.new_var(e),f=PineJS.Std.sma(e,f,this._context),e=this._context.new_var(f),g=PineJS.Std.sma(e,g,this._context);return[f,g]}}},{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:1E12}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",
|
|
name:"Triple EMA"},constructor:function(){this.f_0=function(a,b,c){return 3*(a-b)+c};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.close(this._context),d=this._context.new_var(d),d=PineJS.Std.ema(d,c,this._context),e=this._context.new_var(d),e=PineJS.Std.ema(e,c,this._context),f=this._context.new_var(e),c=PineJS.Std.ema(f,c,this._context);return[this.f_0(d,e,c)]}}},{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:1E12}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(a,b){this._context=a;this._input=
|
|
b;var c=PineJS.Std.close(this._context),d=this._input(0),c=this._context.new_var(c);return[PineJS.Std.vwma(c,d,this._context)]}}},{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:1E12},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:1E12}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(a,b){return 100*(a-b)/b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),
|
|
d=this._input(1),e=PineJS.Std.volume(this._context),f=this._context.new_var(e),c=PineJS.Std.ema(f,c,this._context),e=this._context.new_var(e),d=PineJS.Std.ema(e,d,this._context);return[this.f_0(c,d)]}}},{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:1E12},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:1E12},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:1E12}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=PineJS.Std.hl2(this._context),g=this._context.new_var(f),c=PineJS.Std.ema(g,
|
|
c,this._context),g=this._context.new_var(f),d=PineJS.Std.ema(g,d,this._context),f=this._context.new_var(f),e=PineJS.Std.ema(f,e,this._context);return[{value:c,offset:8},{value:d,offset:5},{value:e,offset:3}]}}},{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:"Willams %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:1E12}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(a,b,c){return 100*(a-b)/(b-c)};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.high(this._context),d=this._context.new_var(d),d=PineJS.Std.highest(d,c,this._context),e=PineJS.Std.low(this._context),e=this._context.new_var(e),c=PineJS.Std.lowest(e,c,this._context);return[this.f_0(PineJS.Std.close(this._context),
|
|
d,c)]}}},{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:1E12},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:-1E12,max:1E12},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:-1E12,max:1E12}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(a,b){return a+b};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=this._input(2),f=PineJS.Std.close(this._context),g=this._context.new_var(f),d=PineJS.Std.roc(g,
|
|
d),f=this._context.new_var(f),e=PineJS.Std.roc(f,e),e=this.f_0(d,e),e=this._context.new_var(e);return[PineJS.Std.wma(e,c,this._context)]}}},{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:-1E12,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(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),e=this._context.new_var(e);
|
|
return[PineJS.Std.linreg(e,c,d)]}}},{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:-1E12,max:1E12},{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(a,b){this._context=a;this._input=b;var c=PineJS.Std.close(this._context),d=this._input(0),e=this._input(1),f=this._input(2),c=this._context.new_var(c);return[PineJS.Std.alma(c,
|
|
d,e,f)]}}},{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"}},precision:4,inputs:{in_0:25,in_1:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,inputs:[{id:"in_0",name:"long",
|
|
defval:25,type:"integer",min:-1E12,max:1E12},{id:"in_1",name:"short",defval:13,type:"integer",min:-1E12,max:1E12}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),e=PineJS.Std.close(this._context),e=this._context.new_var(e);return[PineJS.Std.tsi(e,d,c,this._context)]}}},{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:1E12},{id:"in_1",name:"Source",defval:"close",type:"source",options:"open high low close hl2 hlc3 ohlc4".split(" ")}],
|
|
id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std[this._input(1)](this._context),c=this._context.new_var(d).get(c);return[c?d-c:null]}}}];A82.studyLibrary=A82.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",
|
|
name:"Source",options:"open high low close hl2 hlc3 ohlc4".split(" "),type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(a,b){this._context=a;this._context.new_sym(b(1),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;var c=this._context.new_var(this._context.symbol.time);PineJS.Std.period(this._context);this._context.select_sym(1);var d=this._context.new_var(this._context.symbol.time),
|
|
e=PineJS.Std[b(0)](this._context),e=this._context.new_var(e);this._context.select_sym(0);return[e.adopt(d,c,0)]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{},high:{},low:{},close:{}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",
|
|
defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(a,b){this._context=a;this._context.new_sym(b(0),PineJS.Std.period(this._context),PineJS.Std.period(this._context))};this.main=function(a,b){this._context=a;var c=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var d=this._context.new_var(this._context.symbol.time),e=this._context.new_var(PineJS.Std.open(this._context)),f=this._context.new_var(PineJS.Std.high(this._context)),
|
|
g=this._context.new_var(PineJS.Std.low(this._context)),h=this._context.new_var(PineJS.Std.close(this._context));this._context.select_sym(0);return[e.adopt(d,c,0),f.adopt(d,c,0),g.adopt(d,c,0),h.adopt(d,c,0)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,
|
|
visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{showMA:!1}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},
|
|
1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(a,b){return PineJS.Std.gt(a,b)?0:1};this.f_1=function(a,b){return a?b:PineJS.Std.na()};this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=PineJS.Std.volume(this._context),e=this.f_0(PineJS.Std.open(this._context),PineJS.Std.close(this._context)),f=PineJS.Std.volume(this._context),f=this._context.new_var(f),f=PineJS.Std.sma(f,
|
|
20,this._context),c=this.f_1(c,f);return[d,e,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"ZigZag",shortDescription:"ZigZag",is_price_study:!0,
|
|
classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1E3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(a,b){this._context=a;this._input=b;var c=this._input(0),d=this._input(1),c=c/100,e=d/2,d=PineJS.Std.zigzag(c,e,this._context),c=PineJS.Std.zigzagbars(c,e,this._context);return[d,c]}}}]);A81=function(){this._sets={}};A81.prototype._cacheKey=function(a,b){return a};A81.prototype.createPointset=function(a,b,c,d,e,f){b=this._cacheKey(b,c);this._sets.hasOwnProperty(b)||(this._sets[b]=[]);c=[];for(var g=0;g<d.length;++g)if(0!==d[g][1]){var h=e.getPointTimeUTC(d[g][0],d[g][1],f);c.push(h)}else d[g][0]&&c.push(d[g][0]);this._sets[b].push({guid:a,points:c})};
|
|
A81.prototype.removePointset=function(a){for(var b in this._sets)for(var c=this._sets[b],d=0;d<c.length;++d)if(c[d].guid==a){c.splice(d,1);return}};A81.prototype._refreshPointsetData=function(a,b,c,d){for(var e=[],f=0;f<a.points.length;++f){var g=a.points[f],h=this._indexOfTime(b,g,c,d);e.push({index:f,value:[h,g]})}return e};
|
|
A81.prototype.broadcastPointsetsUpdates=function(a,b,c,d,e,f){a=this._cacheKey(a,b);if(this._sets.hasOwnProperty(a)){b=this._sets[a].length;for(var g=0;g<b;++g){var h=this._sets[a][g],k=this._refreshPointsetData(h,c,d,e);f(h.guid,k)}}};
|
|
A81.prototype._indexOfTime=function(a,b,c,d){var e=PineJsBarBuilder.lower_bound(a,1E3*b,function(a,b){return a.value[0]>b?1:a.value[0]<b?-1:0});return 0<=e&&b<a[a.length-1].value[0]?(a[e].value[0]/1E3!==b&&0!==e&&e--,a[e].index):c.indexOfBar(b,d)};A82.ExtrapolationManager=function(){this._storages={}};A82.ExtrapolationManager.prototype._storageKey=function(a,b,c){return a+","+b+","+c};A82.ExtrapolationManager.prototype.remove=function(a,b,c){delete this._storages[this._storageKey(a,b,c)]};
|
|
A82.ExtrapolationManager.prototype.storage=function(a,b,c){c=PineJS.Symbol.parsePeriod(c);b=this._storageKey(a,b,c.pureResolution);if(this._storages[b])return this._storages[b];this._storages[b]=new A80(TradingView.ChartapiMessagerInstances[a],c.pureResolution);return this._storages[b]};A80=function(a,b){this._chartApiMessager=a;this._lastRealBarIndex=this._lastRealBarTime=null;this._resolution=b;this._extrapolatedBarsCache=[];this._onReadyCallbacks=[]};
|
|
A80.prototype.ready=function(){return!!this._lastRealBarTime};A80.prototype.rebuild=function(a,b){this._lastRealBarTime=a;this._extrapolatedBarsCache=[];this.ensureExtrapolatedToBar(b,this._lastRealBarIndex)};
|
|
A80.prototype.getPointTimeUTC=function(a,b,c){a=0===this._extrapolatedBarsCache.length||a<this._extrapolatedBarsCache[0]?-1:this.indexOfBar(a,c)-this._lastRealBarIndex;this.ensureExtrapolatedToBar(c,a+b+1);return this._extrapolatedBarsCache[a+b]};A80.prototype.indexOfBar=function(a,b){this._ensureExtrapolatedToTime(b,1E3*a);var c=PineJsBarBuilder.lower_bound(this._extrapolatedBarsCache,a,function(a,b){return a>b?1:a<b?-1:0});return this._lastRealBarIndex+c+1};
|
|
A80.prototype._extrapolateData=function(a,b){if(!this.ready())throw"No real bars known, so cannot extrapolate anything";var c=b(this._lastRealBarTime);if(c&&0!==c.length){for(var d=0;d<c.length;++d)c[d]/=1E3;c[0]==this._lastRealBarTime/1E3&&(c=c.slice(1));this._extrapolatedBarsCache=c;var e=c.slice(0);e.sort();for(d=0;d<e.length-1;++d)e[d]==e[d+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1E3*e[d]));this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+
|
|
1,c,a)}else this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,a)};A80.prototype.onTickmarksNeeded=function(a,b){if(this.ready())this.ensureExtrapolatedToBar(a,b);else{var c=this;this._onReadyCallbacks.push(function(){c.ensureExtrapolatedToBar(a,b)})}};
|
|
A80.prototype.ensureExtrapolatedToBar=function(a,b){var c=this;return this._extrapolateData(a,function(d){return c._extrapolatedBarsCache.length>=b||!c._shouldExtrapolateMore()?null:PineJsBarBuilder.extrapolateBarsFrontByCount(c.newBarBuilder(a),d,b)})};
|
|
A80.prototype._ensureExtrapolatedToTime=function(a,b){var c=this;return this._extrapolateData(a,function(d){if(d>=b||!c._shouldExtrapolateMore())return null;d=PineJsBarBuilder.extrapolateBarsFrontToTime(c.newBarBuilder(a),d,b);d[d.length-1]<b&&console.warn("Extrapolation error: not enough data created");return d})};A80.prototype.newBarBuilder=function(a){a=PineJS.Symbol.newSession(a.timezone,a.session);return PineJS.Symbol.newBarBuilder(this._resolution,a)};
|
|
A80.prototype._shouldExtrapolateMore=function(){return 100>this._extrapolatedBarsCache.length};
|
|
A80.prototype.setLastBarTime=function(a,b){this._lastRealBarIndex===a&&this._lastRealBarTime!==b&&(this._extrapolatedBarsCache=[]);this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==a&&(this._lastRealBarIndex>a?this._extrapolatedBarsCache=[]:this._extrapolatedBarsCache.shift(a-this._lastRealBarIndex));this._lastRealBarIndex=a;this._lastRealBarTime=b;for(var c=0;c<this._onReadyCallbacks.length;++c)this._onReadyCallbacks[c]();this._onReadyCallbacks=
|
|
[]};A79=function(a){function b(a,b){if(R77.enabled("disable_resolution_rebuild")||!TradingView.IntervalHelper.isDWM(a))return null;var c=PineJsCalendar.get_timezone(b.timezone),d=new PineJsBarBuilder.Session;d.init(c,b.session);return PineJS.Symbol.newBarBuilder(a,d,d)}function c(a,b){var c=f._cacheSymbols[a.ticker];void 0===c&&(c=f._cacheSymbols[a.ticker]={});var d=c[b];void 0===d&&(d=c[b]=[]);return d}function d(a){if(R77.enabled("charting_library_debug_mode"))for(var b=
|
|
1;b<a.length;b++)a[b].time<=a[b-1].time&&console.error("Corrupted bars, time {0} at {1} > {2} at {3}".format(a[b].time,b,a[b-1].time,b-1))}function e(a,b,e){if(0===e.length)return!0;a=c(a,b);if(a.length===e.length&&a[0].time===e[0].time&&a[a.length-1].time===e[e.length-1].time)return f._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!=a.length&&e[e.length-1].time>=a[0].time&&(b=a[a.length-1].time===e[e.length-1].time,a.splice(0,a.length),!b))return!1;
|
|
Array.prototype.unshift.apply(a,e);d(a);return!0}var f=this;this._studiesCache={};this._metainfoCache=[];this._symbolInfoCache={};this._extrapolationManager=new A82.ExtrapolationManager;this._externalDatafeed=a;this._datafeedConfiguration=null;this._callbacks={};this._externalDatafeed.onReady(function(a){f._logMessage("Datafeed settings received: {0}".format(JSON.stringify(a)));f._datafeedConfiguration=f._adoptConfigurationData(a);f._fireEvent("configuration_received")});this._pointsetsManager=
|
|
new A81;this._rangeExtensionData={summary:0};this._quotesInfo=[];this._endOfData={};this._cacheSymbols={};this._recursionGuardCounter=0;this._datafeedRequestsAllowed=!0;this._create_dwm_aligner=b;this._extendedRange=function(){return f._rangeExtensionData.summary};PineJSFeed.setupFeed({resolve:function(a,b,c){f.resolveSymbol(a,b,c)},subscribe:function(a,h,k,l,m){function n(a){if(x)for(var b=0;b<a.length;b++)a[b].time=x.tradingDayToSessionStart(a[b].time)}function p(b,k,m){d(b);
|
|
n(b);var p=c(a,h),E=k&&k.version&&1<k.version;if(!m&&E){m=p.length;if(0<b.length){var z=b[b.length-1].time;f._logMessage("Receiving bars: `{0}` total {1} bars in [{2} ... {3}] ".format(t,b.length,(new Date(b[0].time)).toUTCString(),(new Date(z)).toUTCString()));if(!e(a,h,b)){f._logMessage("Incremental update failed. Starting full update.");r(w,u);return}}else f._logMessage("Receiving bars: barset is empty");if(p.length===m&&(m=u-w,m=86400<m?m:86400,!k.noData||k.nextTime)){k.nextTime&&f._logMessage("Next time received: `{0}`".format((new Date(1E3*
|
|
k.nextTime)).toUTCString()));u=k.nextTime||w;w=u-m;r(w,u);return}}b=E?p:b;var F=new PineJS.BarSet(a,b);0<b.length?f._logMessage("Bars to return: `{0}` total {1} bars in [{2} ... {3}] ".format(t,b.length,(new Date(b[0].time)).toUTCString(),(new Date(b[b.length-1].time)).toUTCString())):f._logMessage("Nothing to return");f._recursionGuardCounter=0;l(F);a.expired||f._externalDatafeed.subscribeBars(a,h,function(b){x&&(b.time=x.tradingDayToSessionStart(b.time));if(E){var d=c(a,h),e=d.length,f=b.time,k=
|
|
0===e?NaN:d[e-1].time;0===e||k<f?d.push(b):k===f?d[e-1]=b:console.error("putToCacheNewBar: time violation, prev: "+(new Date(k)).toUTCString()+", cur: "+(new Date(f)).toUTCString())}F.add(b);l(F)},v)}function r(b,d){4<f._recursionGuardCounter++&&f._logMessage("Stop requesting data. 4 attempts to reach the data failed.");if(f._datafeedRequestsAllowed){var e=c(a,h);if(0<e.length){e=e[0].time/1E3;if(b>=e)return f._logMessage("Requested bars which already sent"),p([],{version:2},!1),v;d=e-1}f._logMessage("Requesting data: `{0}` in [{1} ... {2}] ".format(t,
|
|
(new Date(1E3*b)).toUTCString(),(new Date(1E3*d)).toUTCString()));f._externalDatafeed.getBars(a,h,b,d,function(a,b){p(a,b)},m)}else setTimeout(function(){p([],{version:2},!0)},0)}var t=a.ticker,v=t+","+h;f._logMessage("History request for {0} {1}: from `{2}` to {3}".format(t,h,new Date(k.from),new Date(k.to)));var w=parseInt(k.from/1E3),u=parseInt(k.to/1E3);R77.enabled("log_data_request_time")&&(k=new Date,console.log(k.toLocaleTimeString()+":"+k.getMilliseconds()+"> Requesting data"));var x=
|
|
b(h,a);r(w,u);return v},unsubscribe:function(a){f._externalDatafeed.unsubscribeBars(a)},calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth,getRangeExtension:this._extendedRange})};A79.prototype.setDatafeedRequestsAllowed=function(a){this._datafeedRequestsAllowed=a};A79.prototype.purgeCache=function(){this._endOfData={};this._symbolInfoCache={}};A79.prototype.purgeDataCache=function(){this._cacheSymbols={}};
|
|
A79.prototype._logMessage=function(a){R77.enabled("charting_library_debug_mode")&&console.log(a)};A79.prototype._extendRange=function(a){this._rangeExtensionData.summary+=a};A79.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};
|
|
A79.prototype._fireEvent=function(a,b,c){if(this._callbacks.hasOwnProperty(a)){for(var d=this._callbacks[a],e=0;e<d.length;++e)d[e](b);c||(this._callbacks[a]=[])}};
|
|
A79.prototype._adoptConfigurationData=function(a){a=TradingView.merge({},a);var b=a.supported_resolutions;if(!b||0===b.length)return a.supported_resolutions=void 0,a;for(var c={},d=0;d<b.length;d++){var e=b[d];if(c.hasOwnProperty(e))throw"Duplicating resolution `"+e+"`";c[e]=1}a.supported_resolutions=c;return a};A79.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions};
|
|
A79.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]};A79.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]};A79.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/};
|
|
A79.prototype._createStudyLogicObject=function(a){var b=a.split("@")[0],c=A82.studyLibrary.filter(function(c){return c.metainfo.id==a||c.metainfo.shortDescription==b});if(0===c.length)throw"Study `"+a+"` not found";return new c[0].constructor};
|
|
A79.prototype.getMarks=function(a,b,c,d,e){function f(a){function b(c,d){return isArray(a[c])?a[c][d]:a[c]}if(isArray(a))return a;for(var c=[],d=0;d<a.id.length;++d)c.push({id:b("id",d),time:b("time",d),color:b("color",d),text:b("text",d),label:b("label",d),labelFontColor:b("labelFontColor",d),minSize:b("minSize",d)});return c}var g={red:6,green:5,blue:4,yellow:3};if(this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks){this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(a.full_name,
|
|
e,(new Date(1E3*b)).toUTCString(),(new Date(1E3*c)).toUTCString()));var h=this;this._externalDatafeed.getMarks(a,b,c,function(b){b=f(b).map(function(a){a.time=parseInt(a.time);return a});h._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(a.full_name,e,JSON.stringify(b)));var c=h._create_dwm_aligner(e,a);b=b.map(function(a){a.tickmark=null!==c?c.tradingDayToSessionStart(1E3*a.time)/1E3:a.time;a.direction=g[a.color];a.onClicked=function(){D17.emit("onMarkClick",
|
|
a.id)};a.label=!!a.label&&a.label[0];return a});d(b)},e)}};
|
|
A79.prototype.getTimescaleMarks=function(a,b,c,d,e){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(a.full_name,e,(new Date(1E3*b)).toUTCString(),(new Date(1E3*c)).toUTCString()));var f=this;this._externalDatafeed.getTimescaleMarks(a,b,c,function(b){f._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(a.full_name,e,
|
|
JSON.stringify(b)));var c=f._create_dwm_aligner(e,a);b=b.map(function(a){a.tickmark=null!==c?c.tradingDayToSessionStart(1E3*a.time)/1E3:a.time;return a});d(b)},e)}};
|
|
A79.prototype._computeStudy=function(a,b,c,d,e,f,g,h){var k=!0,l=[],m={},n=0,p=this;this.resolveSymbol(b,function(r){if(PineJS.Symbol.parsePeriod(c).isIntraday&&!r.has_intraday)h("Unsupported resolution");else{var t=new PineJS.StudyEngine({tickerid:b,symbolInfo:r,period:c,body:a,onErrorCallback:h,input:function(a){return e[a]},out:function(a,b){for(var c=a.time,d="number"===typeof f?[b]:b,e=0;e<d.length;++e){var f=d[e];f&&"object"==typeof f&&(m["plot_"+e]=f.offset,f=f.value,n++);
|
|
"number"===typeof f&&isNaN(f)&&(f=void 0);d[e]=f}e=l.length-1;(f=0>e||c>l[e].value[0])?l.push({index:l.length,value:[c].concat(d)}):l[e].value=[c].concat(d);k||g([l[l.length-1]],f,l.length,m,r)},recalc:function(){k=!1;f(l,0<n?m:void 0,r)}});if(!p._studiesCache[d])throw"This should never happen";p._studiesCache[d].engine=t}},function(a){h(a)})};
|
|
A79.prototype._createStudy=function(a,b,c,d,e,f,g){var h=this;TradingView.ChartapiMessagerInstances[d].onStudyLoading(e,f);h._computeStudy(c,a,b,e,g,function(c,g,m){TradingView.ChartapiMessagerInstances[d].onDataUpdate(e,f,h._convertBarsTimeToUnix(c),g,m,h._extendedRange(a,b));TradingView.ChartapiMessagerInstances[d].onStudyCompleted(e,f)},function(c,g,m,n,p){TradingView.ChartapiMessagerInstances[d].onDataUpdate(e,f,h._convertBarsTimeToUnix(c),n,p,h._extendedRange(a,b))},function(a){TradingView.ChartapiMessagerInstances[d].onStudyError(e,
|
|
a)})};A79.prototype.purgeEndOfDataFlags=function(a){for(var b in this._studiesCache)a&&a!=b||(this._studiesCache[b].firstBarTime=null)};A79.prototype.stopSources=function(){for(var a in this._studiesCache){var b=this._studiesCache[a];b&&b.engine&&b.engine.stop()}PineJSFeed.unsubscribeUnused()};
|
|
A79.prototype.recreateSources=function(a,b,c,d){this.stopSources();for(var e in this._studiesCache){var f=this._studiesCache[e];f&&(f.symbol=a,f.resolution=b,"series"==f.type&&this.createSeries(a,b,c,e,f.turnaround,d))}for(e in this._studiesCache)(f=this._studiesCache[e])&&"study"==f.type&&this._createStudy(a,b,f.studyObject,c,e,f.turnaround,f.inputs)};
|
|
A79.prototype.removeStudy=function(a){this._studiesCache[a]&&this._studiesCache[a].engine&&(this._studiesCache[a].engine.stop(),PineJSFeed.unsubscribeUnused());this._studiesCache[a]=null};A79.prototype.removeSeries=function(a){this.removeStudy(a)};
|
|
A79.prototype.recomputeStudy=function(a,b,c,d){var e=this._studiesCache[a];if(!e)throw"This should never happen";e.inputs=b;e.turnaround=d;e.engine&&e.engine.stop();this._createStudy(e.symbol,e.resolution,e.studyObject,c,a,d,b)};A79.prototype._convertBarsTimeToUnix=function(a){for(var b=[],c=0;c<a.length;++c){var d={index:a[c].index,value:[].concat(a[c].value)};d.value[0]/=1E3;b.push(d)}return b};
|
|
A79.prototype.createStudy=function(a,b,c,d,e,f,g){f=this._createStudyLogicObject(f);this._studiesCache[d]={studyObject:f,symbol:a,resolution:b,guid:d,type:"study",inputs:g,turnaround:e};this._createStudy(a,b,f,c,d,e,g)};A79.prototype.purgeRangeExtensionData=function(){this._rangeExtensionData={summary:0}};
|
|
A79.prototype.extendSeriesRange=function(a,b,c){var d=this._studiesCache[a];if(!d)throw"This should never happen";if(this._isEndOfData(b,a,d.turnaround)){var e=d.engine.runner.host.symbolInfo.data_status;setTimeout(function(){TradingView.ChartapiMessagerInstances[b].onSeriesCompleted(a,d.turnaround,e)},0)}else{this._extendRange(c+10);var f=this;setTimeout(function(){f.recreateSources(d.symbol,d.resolution,b,!0)},0)}};
|
|
A79.prototype.updateSeriesTurnaround=function(a,b){this._studiesCache[a]||(this._studiesCache[a]={});this._studiesCache[a].type="series";this._studiesCache[a].turnaround=b};
|
|
A79.prototype.createSeries=function(a,b,c,d,e,f){function g(a,d,e){m._extrapolationManager.storage(c,a.full_name,b).setLastBarTime(d,e)}var h=new PineJS.OHLCV,k=this._studiesCache[d],l=k&&k.firstBarTime;this._studiesCache[d]={symbol:a,resolution:b,studyObject:h,guid:d,type:"series",turnaround:e};TradingView.ChartapiMessagerInstances[c].onSeriesLoading(d,e);var m=this;this._computeStudy(h,a,b,d,[],function(a,h,k){MarketStatusWatcher.onMainSeriesSymbolChanged(k.session,k.timezone,
|
|
k.expired);h=m._studiesCache[d];if(!h)throw"This should never happen";var t=m._convertBarsTimeToUnix(a),v=0<t.length?1E3*t[0].value[0]:void 0;if(0===t.length||l===v){m._logMessage("Series has no more data on server: {0}".format(k.full_name));m._setEndOfData(c,d,e);if(0===t.length)TradingView.ChartapiMessagerInstances[c].onSeriesClearData(d,e);TradingView.ChartapiMessagerInstances[c].onSeriesCompleted(d,e,k.data_status)}else{h.firstBarTime=v;g(k,t.length-1,1E3*t[t.length-1].value[0]);if(f)TradingView.ChartapiMessagerInstances[c].onSeriesClearData(d,
|
|
e);TradingView.ChartapiMessagerInstances[c].onTimescaleUpdate(d,e,t,k,0);TradingView.ChartapiMessagerInstances[c].onSeriesCompleted(d,e,k.data_status);h=m._extrapolationManager.storage(c,k.full_name,b);m._pointsetsManager.broadcastPointsetsUpdates(k.full_name,b,a,h,k,function(a,b){TradingView.ChartapiMessagerInstances[c].onPointsetDataUpdate(a,e,b,k)})}},function(a,b,f,h,k){var l=m._convertBarsTimeToUnix(a);h=l[l.length-1];if(b){if(!m._studiesCache[d])throw"This should never happen";b=f-1;m._logMessage("New bar arrived: symbol {0}, bar {1}".format(k.full_name,
|
|
JSON.stringify(h)));TradingView.ChartapiMessagerInstances[c].onTimescaleUpdate(d,e,[h],k,b);g(k,b,1E3*h.value[0])}else m._logMessage("Last bar update: symbol {0}, bar {1}".format(k.full_name,JSON.stringify(h))),TradingView.ChartapiMessagerInstances[c].onDataUpdate(d,e,l,void 0,k);m._fireEvent("realtime_tick",a[a.length-1],!0)},function(a){m._logMessage("Series error: {0}".format(a));TradingView.ChartapiMessagerInstances[c].onSeriesError(d,a)})};
|
|
A79.prototype.onMoreTickmarksRequested=function(a,b,c,d,e){this._extrapolationManager.storage(a,c.full_name,d).onTickmarksNeeded(c,e)};A79.prototype.removePointset=function(a){this._pointsetsManager.removePointset(a)};A79.prototype.rebuildExtrapolatedData=function(a,b,c,d,e){this._extrapolationManager.storage(a,d.full_name,c).rebuild(e,d)};
|
|
A79.prototype.createPointset=function(a,b,c,d,e,f){a=this._extrapolationManager.storage(a,d.full_name,e);this._pointsetsManager.createPointset(b,c,e,f,a,d)};A79.prototype.studiesMetadata=function(){0===this._metainfoCache.length&&(this._metainfoCache=A82.studyLibrary.map(function(a){return a.metainfo}));return this._metainfoCache};
|
|
A79.prototype.searchSymbolsByName=function(a,b,c,d){this._logMessage("Symbol search requested: user input `{0}`, exchange: `{1}`, type `{2}`".format(a,b,c));var e=this;this._externalDatafeed.searchSymbolsByName(a,b,c,function(a){e._logMessage("Symbol search response: {0}".format(JSON.stringify(a)));d(a)})};
|
|
A79.prototype.resolveSymbol=function(a,b,c){function d(a){f._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(e,a));c(a)}var e=PineJSFeed.parseSymbol(a).symbol,f=this;this._symbolInfoCache.hasOwnProperty(e)?b(this._symbolInfoCache[e]):(this._logMessage("Symbol resolve requested: `{0}` ".format(e)),this._externalDatafeed.resolveSymbol(e,function(a){f._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(e,JSON.stringify(a)));a.base_name||(a.base_name=
|
|
[a.name]);a.legs||(a.legs=[a.name]);a.exchange||(a.exchange=a["exchange-listed"]);a.full_name||(a.full_name=a.symbol||a.exchange+":"+a.name);a.data_status||(a.data_status="streaming");a.ticker||(a.ticker=a.symbol);!a.session&&a["session-regular"]&&(a.session=a["session-regular"]);!a.minmov&&a.minmovement&&(a.minmov=a.minmovement);f._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(e,JSON.stringify(a)));f._symbolInfoCache[e]=f._symbolInfoCache[a.symbol]=a;b(a)},d))};
|
|
A79.prototype._stopQuotesSubscription=function(a){this._quotesInfo[a].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[a].listenerGUID),this._quotesInfo[a].listenerGUID=void 0)};
|
|
A79.prototype._startQuotesSubscription=function(a){function b(b){b.forEach(function(b){b.symbolname=b.n;b.status=b.s;b.values=b.v;b.values.change=b.v.ch;b.values.last_price=b.v.lp;b.values.change_percent=b.v.chp;TradingView.ChartapiMessagerInstances[a].onQuotesData([a].concat([b]))})}if(0!==this._quotesInfo[a].symbols.length){var c=this;this._externalDatafeed.getQuotes(this._quotesInfo[a].symbols,function(d){b(d);c._quotesInfo[a].listenerGUID=a;c._externalDatafeed.subscribeQuotes(c._quotesInfo[a].symbols,
|
|
c._quotesInfo[a].fastSymbols,b,c._quotesInfo[a].listenerGUID)})}};A79.prototype._restartQuotesSubscription=function(a){this._stopQuotesSubscription(a);this._startQuotesSubscription(a)};A79.prototype.quoteCreateSession=function(a){this._quotesInfo[a]={symbols:[],fastSymbols:[],listenerGUID:void 0}};A79.prototype.quoteDeleteSession=function(a){this._stopQuotesSubscription(a);this._quotesInfo[a]=null};
|
|
A79.prototype.quoteSetFields=function(a,b){};A79.prototype.quoteAddSymbols=function(a,b){this._quotesInfo[a].symbols=this._filteredSymbols(this._quotesInfo[a].symbols.concat(b));this._restartQuotesSubscription(a)};A79.prototype.quoteRemoveSymbols=function(a,b){this._quotesInfo[a].symbols=this._quotesInfo[a].symbols.filter(function(a){return 0>b.indexOf(a)});this._restartQuotesSubscription(a)};
|
|
A79.prototype.quoteFastSymbols=function(a,b){this._quotesInfo[a].fastSymbols=this._filteredSymbols(b);this._restartQuotesSubscription(a)};A79.prototype.quoteHibernateAll=function(a){};A79.prototype._filteredSymbols=function(a){var b=[];a.forEach(function(a){a instanceof Object||0>b.indexOf(a)&&b.push(a)});return b};A79.prototype._isEndOfData=function(a,b,c){return!!this._endOfData[a+"!"+b+"@"+c]};
|
|
A79.prototype._setEndOfData=function(a,b,c){this._endOfData[a+"!"+b+"@"+c]=!0};TradingView.MetainfoTuner=function(){function a(a){R77.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+a)}var b={"volume.transparency":"!transparency"},c={};Object.keys(TradingView.StudyConsts).forEach(function(a){0==a.indexOf("PLOT_")&&0!=a.indexOf("PLOT_TYPE_")&&(c[a.toLowerCase().substring(5)]=TradingView.StudyConsts[a])});var d={setMetainfoProperty:function(d,e,h){e=b[e]||e;e=e.split(".");if(0==e[0].indexOf("!"))d[e[0].slice(1)]=h;else{var k;a:{var l=e[0];for(k in d.styles)if(d.styles[k].title.toLowerCase()==
|
|
l.toLowerCase())break a;k=null}a:{for(var l=e[0],m=0;m<d.inputs.length;++m)if(d.inputs[m].name.toLowerCase()==l.toLowerCase()){l={id:d.inputs[m].id,index:m};break a}l=null}m="options"==e[0];if(k||l||m)if(k&&l||k&&m||l&&m)a("Study `{0}` ambiguous identifier `{1}`".format(d.description,e[0]));else if(k)if(l=e[1],"color"==l){var n;b:{for(n in d.plots)if("colorer"==d.plots[n].type&&d.plots[n].target==k){n=d.defaults.palettes[d.plots[n].palette];break b}n=null}l=2<e.length?parseInt(e[2]):NaN;null==n&&
|
|
!isNaN(l)&&0<l?a("Plot `{1}` of `{0}` does not have color #{2}".format(d.description,e[0],l)):0==l||isNaN(l)?(d.defaults.styles[k].color=h,null!=n&&(n.colors[0].color=h)):n.colors[l].color=h}else d.defaults.styles[k].hasOwnProperty(l)?("plottype"==l&&(h=c[h]),d.defaults.styles[k][l]=h):a("Plot `{1}` of `{0}` does not have property `{2}`".format(d.description,e[0],l));else l?(e=l.index,d.defaults.inputs[l.id]=h,d.inputs[e].defval=h):d[e[1]]=h;else a("Study `{0}` has no plot or input `{1}`".format(d.description,
|
|
e[0]))}},setProperty:function(b,c){var e=b.split(".")[0],k;a:{k=A82.studyLibrary;for(var l=0;l<k.length;++l){var m=k[l].metainfo;if(m.description.toLowerCase()==e.toLowerCase()||m.shortDescription.toLowerCase()==e.toLowerCase()){k=m;break a}}k=null}k?d.setMetainfoProperty(k,b.substring(e.length+1),c):a("Study `{0}` not found".format(e))}};if("undefined"!=typeof __initialMetainfoOverrides&&__initialMetainfoOverrides)for(var e in __initialMetainfoOverrides)d.setProperty(e,__initialMetainfoOverrides[e]);
|
|
return d}();var MarketStatusWatcher=function(){function a(){if(c)if(d)D3.D0.mainSeries().marketStatus.setValue("out_of_session");else{var a=PineJsBarBuilder.isTradingNow(new Date,c)?"market":"out_of_session";D3.D0.mainSeries().marketStatus.setValue(a)}}var b={},c,d;b.onMainSeriesSymbolChanged=function(b,f,g){f=PineJsCalendar.get_timezone(f);c=(new PineJsBarBuilder.Session).init(f,b);d=g;a()};setInterval(a,6E4);return b}();TradingView.PublishedChartsTimeline=function(){};J89=function(){};TradingView.study_PivotPointsStandard=function(){};TradingView.study_PivotPointsHighLow=function(){};TradingView.study_ZigZag=function(){};TradingView.study_LinearRegression=function(){};TradingView.study_ElliottWave=function(){};TradingView.ESDStudyBase=function(){};A55=function(){this.hasPackage=function(){return!1}};window.user={is_pro:!1,settings:{}};
|
|
A55.prototype.getStudies=function(){return[]};A55.prototype.getProduct=function(){return{}};A55.prototype.getStudiesOrder=function(){return[]};TradingView.LineToolRegressionTrend=function(){};
|
|
TradingView.templates={dialogs:{addSymbol:' <div class="main"> <div class="symbol-edit-place"></div>{{#overlayOption}} <div class="tv-dialog-relative">\t<input id="tv-dialog-addsymbol-overlay-checkbox" type="checkbox" name="addsymbol-overlay" {{#overlayOptionChecked}}checked="checked"{{/overlayOptionChecked}} />\t<span class="tv-dialog-checkbox-mask tv-dialog-checkbox-mask{{#overlayOptionChecked}}-active{{/overlayOptionChecked}}"></span>\t<label for="tv-dialog-addsymbol-overlay-checkbox"> Overlay the main chart</label> </div>{{/overlayOption}} <div class="tv-dialogs-bottom-button"> <span class="tv-button tv-right tv-uppercase ok">{{okButtonTitle}}</span> </div> </div>',symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+
|
|
TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-cion"></div></div></div><div class="filter"></div><div class="results"></div>'}};TradingView.AlertLabel=function(){};TradingView.getDataVendorString=function(){};A72={sendReport:function(){}};TradingView.study_VbPVisible=function(){};TradingView.study_VbPSessions=function(){};TradingView.LineToolVbPFixed=function(){};TradingView.study_Script$TV_DIVIDENDS=function(){};TradingView.study_Script$TV_SPLITS=function(){};
|
|
TradingView.study_Script$TV_EARNINGS=function(){};TradingView.MockupRequestedCache=function(a){a&&a([])};TradingView.MockupRequestedCache.D20=function(){};TradingView.getThemesList=TradingView.MockupRequestedCache;TradingView.StudyStrategy=function(){};TradingView.LinetoolTemplatesList=function(){};
|
|
</script><script>var customIndicatorsPresent=!!urlParams.indicatorsFile;var customIndicatorsLodaded=$.Deferred();var chartApiInitializationTimePassed=$.Deferred();$.when(customIndicatorsLodaded,chartApiInitializationTimePassed).done(function(){D16.start()});if(customIndicatorsPresent){$.getScript(urlParams.indicatorsFile).done(function(){if(typeof __customIndicators!="undefined"&&isArray(__customIndicators)){A82.studyLibrary=A82.studyLibrary.concat(__customIndicators);console.log("{0} custom indicators loaded.".format(__customIndicators.length));customIndicatorsLodaded.resolve()}}).fail(function(a){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile,a.statusText,a.status));customIndicatorsLodaded.resolve()})}else{customIndicatorsLodaded.resolve()}pm=TradingView.postMessageWrapper(window.parent);pm.__delayedMesssages=[];pm.on("widgetReady",function(b,a){pm.__delayedMesssages.push({data:b,cb:a});pm.setClientId(b.client_id)});function postMessageToParent(a,b){if(window&&window.parent){pm.post(window.parent,a,b)}}function customizeUI(a){if(a.studiesOverrides){var c=a.studiesOverrides;for(var b in c){TradingView.MetainfoTuner.setProperty(b,c[b])}}__defaultsOverrides=a.defaultsOverrides}is_authenticated=false;function createChart(){if(!Modernizr.canvas||!Modernizr.canvastext){throw"Charting library cannot be running under this browser"}R77.setEnabled("charting_library_debug_mode",urlParams.debug=="true");headerChartPanel=$(".header-chart-panel");widgetContainer=$("#library-container");tvHeader=$(".tv-header");footer=$("#footer-chart-panel");if(R77.enabled("remove_library_container_border")){widgetContainer.css("border","0px");widgetContainer.css("padding","1px")}customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):undefined,defaultsOverrides:JSON.parse(urlParams.overrides)});if(R77.enabled("saveload_storage_customization")){if(typeof urlParams.chartsStorageUrl=="undefined"||!urlParams.chartsStorageUrl||typeof urlParams.clientId=="undefined"||!urlParams.clientId){R77.setEnabled("saveload_storage_customization",false);R77.setEnabled("header_saveload",false)}else{TradingView.ChartingLibraryBackend.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0")}}D16=new A82.ChartApi(window.parent[urlParams.uid].datafeed);D16.setTimeFramesList(JSON.parse(urlParams.timeFrames));D16.setStudiesAccessController(D16.createStudiesAccessController(urlParams.studiesAccess,urlParams.enabledStudies,urlParams.disabledStudies));if(R77.enabled("narrow_chart_enabled")){$(".chart-page").css("min-width","240px")}if(R77.enabled("use_localstorage_for_settings")){TVSettings.sync()}var i=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:undefined;var d=urlParams.interval||"D";var g={jqParent:$("#chart-area"),onResize:function(r){var o=$(document.body).height()-2;widgetContainer.height(o);var k=$("#footer-chart-panel");var p=k&&k.is(":visible")?k.outerHeight():0;var q=$("#bottom-area");var m=q&&q.is(":visible")?q.outerHeight():0;var l=R77.enabled("header_widget")&&headerChartPanel.is(":visible")?headerChartPanel.outerHeight():0;var n=o-l-tvHeader.outerHeight()-m-p;n=Math.max(50,n);r.height(n)},padding:R77.enabled("border_around_the_chart")?5:0,edge:R77.enabled("border_around_the_chart")?5:0,content:i,widgetOptions:{hideIdeas:true,addVolume:true,handleSessionErrors:true,muteSessionErrors:true,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:d,hideSymbolSearch:JSON.parse(urlParams.hideSymbolSearch)},globalEvents:true,snapshotUrl:urlParams.snapshotUrl};if(i&&typeof i.extendedData!="undefined"){var e=i.extendedData;g.metaInfo={id:e.uid,name:e.name,description:e.description,uid:e.uid,username:"",tags:""}}D6=new A8(g);ChartSaverInstance=saver=new ChartSaver(D6);D3=D6.activeChartWidget.value();pro=new A55();var f=JSON.parse(urlParams.favorites);f.intervals=f.intervals.map(function(k){var l=(""+k);if(l.match(/1[DWMYdwmy]/)){l=l.slice(1)}return l});if(R77.enabled("study_templates")){studyTemplates=new A65({D6:D6,notShowQuicks:!R77.enabled("items_favoriting")})}headerWidget=new A5({D6:D6,headerChartPanel:headerChartPanel,hideStudyTemplates:true,favoriteIntervals:f.intervals,interval_options:{interval:d},favoriteChartTypes:f.chartTypes});A45.bindToChartWidgetCollection(D6);var h=function(){};var c=JSON.parse(urlParams.logo);if(c.image){h=function(o,n,k){$(".onchart-custom-logo").remove();var p=$('<img src="'+c.image+'">');var q=!c.link?p:$('<a href="'+c.link+'" target="_blank"/>').append(p);var u=$('<span class="text">Powered by <span><a href="https://www.tradingview.com/" target="_blank"><span class="text logo-highlighted">TradingView</span></a>');var m=$('<div class="onchart-custom-logo"/>').appendTo(n||D3._jqMainDiv);var s=$('<div class="wrapper"/>').appendTo(m);var t=$('<table class="inner">').appendTo(s);var r=$("<tr>").appendTo(t);$('<td class="custom-logo">').append(q).appendTo(r);var l=$("<tr>").appendTo(t);if(R77.enabled("link_to_tradingview")){$('<td class="tv-link">').append(u).appendTo(l)}if(k){m.addClass("on-pane")}}}else{h=function(k,l,n){if(!R77.enabled("link_to_tradingview")){return}$(".onchart-tv-logo").remove();var m=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/charting_library/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/charting_library/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text"><span id="logo-symbol"></span> charts by <span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(l||D3._jqMainDiv);if(R77.enabled("minimalistic_logo")){m.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")})}else{m.addClass("expanded")}if(n){m.addClass("on-pane")}}}var b=R77.enabled("widget_logo")&&urlParams.disableLogo!="true";if(b){D3.createLogo=h;if(!R77.enabled("move_logo_to_main_pane")){D3.withModel(null,h)}}TradingView.tokenInitialized.resolve();if(urlParams.toolbarbg){var a="#"+urlParams.toolbarbg;$(".tv-side-toolbar").css("background-color",a);$(".chart-controls-bar").css("background-color",a);$("#chart-area").css("background-color",a);headerChartPanel.css("background-color",a);$("#footer-chart-panel").css("background-color",a)}var j=new A6({container:$(".tv-side-toolbar"),D6:D6,onWidget:true,enabledDrawings:urlParams.enabledDrawings?JSON.parse(urlParams.enabledDrawings):[],disabledDrawings:urlParams.disabledDrawings?JSON.parse(urlParams.disabledDrawings):[],drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):undefined});window.sideToolbar=j;if(urlParams.hideSideToolbar=="true"||!R77.enabled("left_toolbar")){j._fold(true)}window.lineToolPropertiesToolbar=new TradingView.LineToolPropertiesWidget(D6);D3.onDisconnected().subscribe(null,function(k){if(k){showCriticalErrorMessage();return}});$(".tv-content").bind("contextmenu",function(l){var k=$(l.originalEvent.target);if(!k.is("input")&&!k.is("textarea")){return false}});chartApiInitializationTimePassed.resolve();(function(){pm.on("symbolInfo",function(p,q){var n=D3.model().mainSeries().symbolInfo(),o=D3.model().mainSeries().properties().interval.value(),m={name:n.name,exchange:n.exchange,description:n.description,type:n.type,interval:o};q(m)});pm.on("resize",function(){$(window).resize()});pm.on("initializationFinished",function(){A77.clearStack()});function k(n,m){D3.withModel(null,function(){if(D3.model().mainSeries().bars().size()>0){m()}else{var o=function(){m();D3.model().mainSeries().onBarReceived().unsubscribe(null,o)};D3.model().mainSeries().onBarReceived().subscribe(null,o)}})}pm.on("widgetReady",function(n,m){k(n,m);pm.setClientId(n.client_id)});for(var l=0;l<pm.__delayedMesssages.length;++l){k(pm.__delayedMesssages[l].data,pm.__delayedMesssages[l].cb)}pm.on("executeAction",function(m){D3.executeActionByName(m.action)});pm.on("executeActionById",function(m){D3.executeActionById(m.actionId)});pm.on("removeAllStudies",function(){D3.removeAllStudies()});pm.on("refreshMarks",function(){D3.refreshMarks()});pm.on("clearMarks",function(){D3.clearMarks()});pm.on("removeAllShapes",function(){D3.removeAllDrawingTools()});pm.on("saveChart",function(){ChartSaverInstance.whenReadyToSave(function(){var m=ChartSaverInstance.saveToJSON();postMessageToParent("onChartSaved",JSON.parse(m.content))})});pm.on("changeSymbol",function(n){A45.interval.setValue(n.interval);A45.symbol.setValue(n.symbol);function m(){D3.model().mainSeries().onDataLoaded().unsubscribe(null,m);pm.post(window.parent,"symbolChangeFinished",{})}D3.model().mainSeries().onDataLoaded().subscribe(null,m)});pm.on("symbolIntervalRequest",function(){pm.post(window.parent,"symbolInterval",JSON.stringify({symbol:A45.actualSymbol.value(),interval:A45.interval.value()}))});pm.on("removeEntity",function(m){var n=D3.model().chartModel().dataSourceForId(m);if(!n){console.warn("Can't find a source with id: "+m);return}D3.model().chartModel().removeSource(n,true)})})();D3.withModel(null,function(){D3.model().mainSeries().onSymbolResolved().subscribe(null,function(){var l=D3.model().mainSeries().symbolInfo(),m=D3.model().mainSeries().properties().interval.value(),k={name:l.name,exchange:l.exchange,description:l.description,type:l.type,interval:m};postMessageToParent("onSymbolChange",k)});A45.interval.subscribe(function(k){postMessageToParent("onIntervalChange",k)});D16.on("realtime_tick",function(k){postMessageToParent("onTick",k)});D16.on("onAutoSaveNeeded",function(){postMessageToParent("onAutoSaveNeeded")});D17.subscribe("onMarkClick",function(k){postMessageToParent("onMarkClick",k)});D17.subscribe("onTimescaleMarkClick",function(k){postMessageToParent("onTimescaleMarkClick",k)})});D6.onScreenshotReady().subscribe(null,function(k){postMessageToParent("onScreenshotReady",k)})}var datafeedReady=$.Deferred();$.when(localizationReady,datafeedReady).done(function(){JSON.parse(urlParams.disabledFeatures).map(function(b){R77.setEnabled(b,false)});JSON.parse(urlParams.enabledFeatures).map(function(b){R77.setEnabled(b,true)});setTimeout(createChart,0);if(R77.enabled("14851")){(function(d,e,j,h,f,c,b){d.GoogleAnalyticsObject=f;d[f]=d[f]||function(){(d[f].q=d[f].q||[]).push(arguments)},d[f].l=1*new Date();c=e.createElement(j),b=e.getElementsByTagName(j)[0];c.async=1;c.src=h;b.parentNode.insertBefore(c,b)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");var a=document.URL.match(new RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-53174009-1","auto");ga("set",{hostname:a,page:a,referrer:a});ga("send","pageview")}});window.parent[urlParams.uid].datafeed.onReady(function(){datafeedReady.resolve()});window.getFunctionFromArguments=function(a){return window.parent[urlParams.uid][a]};function setChartType(a){D3.model().mainSeries().properties().style.setValue(a)}function loadChart(a){D3.loadContent(a.json.charts[0],a.extendedData);A45.symbol.setValue(D3.symbolProperty().value());D17.emit("chart_loaded")}function createStudy(a){a.name=a.name.toLowerCase();var c=TradingView.StudyMetaInfo.findStudyMetaInfoByDescription(D3.model().studiesMetaData(),a.name);c=$.extend({},c);delete c.state;if(!c){console.warn("Study `"+a.name+"` not found.")}var b={};if(a.overrides){var f=a.overrides;for(var e in f){TradingView.MetainfoTuner.setMetainfoProperty(c,e,f[e])}b.styles=c.defaults.styles}if(a.inputs){b.inputs=TradingView.StudyInputsHelper.getStudyRecordFromArray([a.name].concat(a.inputs),D3).inputs}var d=D3.model().chartModel().insertStudy(c,b,a.forceOverlay);if(!!a.lock&&a.lock){d.setUserEditEnabled(false)}if(a.callback){a.callback(d.id())}}window.createShortcutAction=(function(){var a={};return function(b,c){if(a[b]===undefined){a[b]=new TradingView.Action({shortcut:b})}a[b].callbacks().subscribe(null,c)}})();window.closePopupsAndDialogs=function(){A83.dialogs.forEach(function(a){a.dialog.find(".tv-dialog-title-close").click()});TradingView.ContextMenu.hideAll()};function createShape(a){a.points=[a.point];return createMultipointShape(a)}function createMultipointShape(c){var e=c.options.disableUndo?D3.model().model():D3.model();function j(s,q,p){var o=e.timeScale().timePointToIndex(s);var i={index:o};if(!!q){i.price=q}else{var n=["open","high","low","close"];var r=!!p?n.indexOf(p)+1:1;if(r<=0){r=1}i.price=e.mainSeries().data().valueAt(o)[r]}return i}var d;var m=[];for(d=0;d<c.points.length;d++){var a=c.points[d];m.push(j(a.time,a.price,a.channel))}var b=D3._paneWidgets[0]._state;var f={text:{name:"LineToolText",supportsText:true},note:{name:"LineToolNote",supportsText:true},callout:{name:"LineToolCallout",supportsText:true},balloon:{name:"LineToolBalloon",supportsText:true},arrow_up:{name:"LineToolArrowMarkUp",supportsText:true},arrow_down:{name:"LineToolArrowMarkDown",supportsText:true},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:true},arrow_right:{name:"LineToolArrowMarkRight",supportsText:true},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"}};var k=f[c.options.shape]||f.flag;if(k.name==="LineToolPolyline"){if(m[0].price!=m[m.length-1].price||m[0].index!=m[m.length-1].index){m.push(m[0])}}var h=new J52(k.name.toLowerCase());if(c.options.overrides){for(var l in c.options.overrides){if(h[l]){h[l].setValue(c.options.overrides[l])}}}if(k.supportsText&&!!c.options.text){h.text.setValue(c.options.text)}var g=e.createLineTool(b,m[0],k.name,h);if(g.pointsCount()!=m.length&&g.pointsCount()!=-1){throw"Wrong points count for "+c.options.shape+". Required "+g.pointsCount()}for(d=1;d<m.length&&D3.model().lineBeingCreated();d++){e.coninueCreatingLine(m[d],{},d<m.length-1)}if(c.options.lock){g.setUserEditEnabled(false)}if(c.options.disableSelection){g.customization.disableSelection=true}if(c.options.disableSave){g.customization.disableSave=true}if(c.options.zOrder){if(c.options.zOrder=="top"){e.bringToFront(g)}else{if(c.options.zOrder=="bottom"){e.sendToBack(g)}}}if(c.callback){c.callback(g.id())}}function setVisibleRange(a,b){if(typeof a==="undefined"||!a.from||!a.to||isNaN(a.from)||isNaN(a.to)){console.warn("Wrong time range: "+JSON.stringify(a));return}D3.setVisibleTimeRange(parseInt(a.from),parseInt(a.to),b)}function getVisibleRange(d){if(!d){console.warn("Callback expected as argument");return}var c=D3.model().timeScale();var a=c.visibleBars();var b={from:c.indexToUserTime(a.firstBar()<0?0:a.firstBar()),to:c.indexToUserTime(a.lastBar())};d({from:(+b.from||0)/1000,to:(+b.to||0)/1000})}function createStudyTemplate(a,b){b(D3.model().model().studyTemplate(a.saveInterval))}function applyStudyTemplate(a){D3.model().model().restoreStudyTemplate(a,""+(Math.random()*1000))}function addCustomCSSFile(a){var b=document.createElement("link");document.getElementsByTagName("head")[0].appendChild(b);b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");b.setAttribute("href",a)};</script></body></html> |